ysy 2 лет назад
Родитель
Сommit
838de28b82

+ 4 - 3
src/views/materialPlan/components/plan-edit-dialog.vue

@@ -66,10 +66,10 @@
 
 
         <!-- 展开内容 -->
-        <template v-slot:expand="{ row }">
+        <template v-slot:expand="{ row,  $index }">
           <div style="width:calc(100% - 95px); min-height: 60px; margin-left: 95px;" v-if="row.materialList.length > 0">
             <ele-pro-table :toolbar="false" toolsTheme="none" ref="table2" :need-page="false"
-              :datasource="row.materialList" :columns="columns2" row-key="id">
+              :datasource="row.materialList" :columns="columns2" :key="row.categoryId + '-'+ $index">
 
 
               <template v-slot:sort="{ $index }">
@@ -96,7 +96,7 @@
               </template>
 
               <template v-slot:deliveryMethod="{ row }">
-                <el-select clearable class="ele-block"  @change="changeMethod" v-model="row.deliveryMethod" placeholder="请选择">
+                <el-select clearable class="ele-block"  v-model="row.deliveryMethod" placeholder="请选择">
                   <el-option label="一次性到货" :value="1" @click.native="row.timeList = null" />
                   <el-option label="分批到货" :value="2" @click.native="handleMethod(row); row.requireDeliveryTime= null" />
                 </el-select>
@@ -449,6 +449,7 @@ export default {
 
         this.$nextTick(() => {
           this.$refs.table.toggleRowExpansionAll()
+          this.$forceUpdate()
         })
 
       })

+ 4 - 3
src/views/materialPlan/components/produce-edit-dialog.vue

@@ -64,10 +64,10 @@
 
 
         <!-- 展开内容 -->
-        <template v-slot:expand="{ row }">
+        <template v-slot:expand="{ row, $index }">
           <div style="width:calc(100% - 95px); min-height: 60px; margin-left: 95px;" v-if="row.materialList.length > 0">
             <ele-pro-table :toolbar="false" toolsTheme="none" ref="table2" :need-page="false"
-              :datasource="row.materialList" :columns="columns2" row-key="id">
+              :datasource="row.materialList" :columns="columns2" :key="row.categoryId + '-'+ $index">
 
 
               <template v-slot:sort="{ $index }">
@@ -398,7 +398,8 @@ export default {
         this.$set(this.formData, 'name', res.name)
         this.$set(this.formData, 'remark', res.remark)
         this.formData['id'] = res.id
-        this.$refs.table.setData([...res.salesOrderList]);
+        this.$refs.table.setData([...res.workOrderList
+]);
         this.$nextTick(() => {
           this.$refs.table.toggleRowExpansionAll()
         })

+ 23 - 10
src/views/materialPlan/index.vue

@@ -76,7 +76,7 @@ export default {
           { label: '发布失败', value: '3' }
         ],
         second: [
-          { label: '所有状态', value: '7,4,5,6' },
+          { label: '所有状态', value: '' },
           { label: '待生产', value: '4' },
           { label: '生产中', value: '5' },
           { label: '已完成', value: '6' },
@@ -126,6 +126,8 @@ export default {
 
 
 
+
+
         {
           columnKey: 'status',
           label: '状态',
@@ -135,13 +137,19 @@ export default {
         },
 
 
-        {
-          columnKey: 'approvalStatus',
-          label: '审批状态',
-          align: 'center',
-          slot: 'approvalStatus',
-          action: 'approvalStatus'
-        },
+        ...(this.activeName === 'first'
+          ? [
+            {
+              prop: 'approvalStatus',
+              label: '审批状态',
+              align: 'center',
+              slot: 'approvalStatus',
+              action: 'approvalStatus'
+            }
+          ]
+          : []),
+
+
 
         {
           prop: 'createUserName',
@@ -183,7 +191,13 @@ export default {
       return obj && obj.label;
     },
     /* 表格数据源 */
-    datasource({ page, limit, where, order }) {
+    datasource({ page, limit, where }) {
+      if (this.activeName == 'first') {
+        where.type = 1
+      } else if (this.activeName == 'second') {
+        where.type = 2
+        delete where.statusList
+      }
       return getList({
         pageNum: page,
         size: limit,
@@ -195,7 +209,6 @@ export default {
         this.$refs.planEditDialogRef.open(type, row);
       } else if (this.activeName == 'second') {
         this.$refs.produceEditDialogRef.open(type, row);
-
       }
 
     },