ysy 2 سال پیش
والد
کامیت
38c5172a86
3فایلهای تغییر یافته به همراه21 افزوده شده و 8 حذف شده
  1. BIN
      dist.zip
  2. 0 1
      src/views/materialPlan/components/ProductModal.vue
  3. 21 7
      src/views/materialPlan/components/plan-edit-dialog.vue

BIN
dist.zip


+ 0 - 1
src/views/materialPlan/components/ProductModal.vue

@@ -219,7 +219,6 @@ export default {
         return;
       }
       if (this.type == 'add') {
- 
        _arr = this.selection.map(m => {
           m.categoryId = m.id
           delete m.id

+ 21 - 7
src/views/materialPlan/components/plan-edit-dialog.vue

@@ -96,13 +96,13 @@
               </template>
 
               <template v-slot:deliveryMethod="{ row }">
-                <el-select clearable class="ele-block" v-model="row.deliveryMethod" placeholder="请选择">
-                  <el-option label="一次性到货" :value="1" />
-                  <el-option label="分批到货" :value="2" @click.native="handleMethod(row)" />
+                <el-select clearable class="ele-block"  @change="changeMethod" 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>
               </template>
 
-              <template v-slot:requireDeliveryTime="{ row }">
+              <template v-slot:requireDeliveryTime="{ row }" >
                 <el-date-picker style="width: 100%" clearable v-model="row.requireDeliveryTime" type="date"
                   v-if="row.deliveryMethod == 1" value-format="yyyy-MM-dd" placeholder="请选择日期">
                 </el-date-picker>
@@ -521,6 +521,19 @@ export default {
 
       if (salesOrderIds.length > 0) {
         listBomBySalesOrderIds({ salesOrderIds: salesOrderIds }).then((res) => {
+  
+       res.forEach(m => {
+          if(m.materialList.length > 0) {
+            m.materialList.forEach(p => {
+              p.detailId = m.id
+            })
+          }
+        })
+
+        console.log(res)
+
+        
+
           this.$refs.table.setData([...this.tableData, ...res]);
 
           this.$refs.table.toggleRowExpansionAll()
@@ -572,10 +585,10 @@ export default {
 
     remove2(row) {
       const data = this.$refs.table.getData() ?? [];
-      this.formData.materialRemoveIds.push(row.id)
+      this.formData.materialRemoveIds.push(row.categoryId)
       data.forEach((e) => {
         if (row.detailId == e.id) {
-          e.materialList = e.materialList.filter((d) => d.id !== row.id);
+          e.materialList = e.materialList.filter((d) => d.categoryId !== row.categoryId);
         }
       })
 
@@ -628,6 +641,7 @@ export default {
 
     },
 
+
     handleMethod(row) {
       this.$refs.timeDialogRef.open(row)
     },
@@ -641,7 +655,7 @@ export default {
          
           e.materialList.forEach(m => {
             if (m.id == current.id) {
-              m.timeList = timeList
+              m.timeList = timeList || null
             }
           })