Browse Source

待排产列表-批量委外

damon227 10 tháng trước cách đây
mục cha
commit
38a8d62a64

+ 32 - 6
src/views/modules/production/scheduling.vue

@@ -1,7 +1,7 @@
 <!-- 任务处理中心 -->
 <template>
   <div class="production">
-    <template v-if="!detailsVisible && !outsourceVisible && !checkVisible && !preCheckVisible && !purchaseVisible && !printLabelVisible && !addOrUpdateVisible">
+    <template v-if="!detailsVisible && !outsourceVisible && !checkVisible && !preCheckVisible && !purchaseVisible && !printLabelVisible && !addOrUpdateVisible && !addOrUpdateOutsourceVisible">
       <el-header style="font-size: large;text-align: center">任务处理中心</el-header>
       <el-form>
         <el-form-item>
@@ -212,12 +212,14 @@
     <print-label v-if="printLabelVisible" ref="printLabel" @onChose="onChose" @addOne="addOneClick"/>
     <!-- 弹窗, 新增 / 修改 -->
     <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" :options-type="optionsType" @refreshDataList="getDataList" @onChose="onChose"></add-or-update>
+    <!-- 委外 -->
+    <outsource-add-or-update v-if="addOrUpdateOutsourceVisible" ref="addOrUpdateOutsource" @refreshDataList="getDataList" @onChose="onChose"></outsource-add-or-update>
   </div>
 </template>
 
 <script>
   import Detail from './scheduling-details'
-  // import Outsource from '@/views/modules/sale/outsource-add-or-update'
+  import OutsourceAddOrUpdate from '@/views/modules/sale/outsource-add-or-update'
   import { getSchedulingList, getChildren } from '@/api/production'
   import SchedulingCheck from '@/views/modules/production/scheduling-check'
   import SchedulingPreCheck from '@/views/modules/production/scheduling-pre-check'
@@ -240,8 +242,8 @@ export default {
       SchedulingPreCheck,
       SchedulingCheck,
       Detail,
-      AddOrUpdate
-      // Outsource
+      AddOrUpdate,
+      OutsourceAddOrUpdate
     },
     data () {
       return {
@@ -253,6 +255,7 @@ export default {
         craftsVisible: false,
         printLabelVisible: false,
         addOrUpdateVisible: false,
+        addOrUpdateOutsourceVisible: false,
         dataForm: {},
         dataList: [],
         pageIndex: 1,
@@ -330,6 +333,7 @@ export default {
         this.batchIncomeBtnDisabled = false
         this.batchBtnDisabled = false
         this.addOrUpdateVisible = false
+        this.addOrUpdateOutsourceVisible = false
       },
        // 获取采购类别字典
       getTypeList () {
@@ -546,9 +550,31 @@ export default {
            return
         }
 
-        this.outsourceVisible = true
+        let list = []
+        this.selectedRows.forEach(item => {
+          list.push({
+            detailId:Math.round(Math.random() * 1000000),
+            productName: item.productName,
+            productNumber:item.productNumber,
+            productSpec: item.productSpec,
+            cnt:item.cnt,
+            unitName:'',
+            deadline:'',
+            batchNumber:item.batchNumber,
+            arrivedTime:'',
+            qualifiedCnt:'',
+            price:'',
+            taxPrice:'',
+            taxAmount:'',
+            taxRateVal:'',
+            specificationExplian:'',
+            notes:''
+          })
+        })
+
+        this.addOrUpdateOutsourceVisible = true
         this.$nextTick(() => {
-          this.$refs.outsource.init(this.selectedRows)
+          this.$refs.addOrUpdateOutsource.init(null,null,null,list)
         })
       }
     }

+ 4 - 1
src/views/modules/sale/outsource-add-or-update.vue

@@ -242,11 +242,14 @@ export default {
       onChose () {
         this.$emit('onChose')
       },
-      async init (id, scheduleIds, tableId) {
+      async init (id, scheduleIds, tableId, productDetails) {
         if (scheduleIds) {
           this.prodProductionIds = scheduleIds
         }
         this.productDetails = []
+        if(productDetails){
+          this.productDetails = productDetails
+        }
         this.dataForm = {
           payType: '1'
         }