ezhizao_zx пре 10 месеци
родитељ
комит
37b300974a
1 измењених фајлова са 13 додато и 12 уклоњено
  1. 13 12
      src/views/business/returnTurnover/DialogReturnTurnover.vue

+ 13 - 12
src/views/business/returnTurnover/DialogReturnTurnover.vue

@@ -81,8 +81,9 @@ function getCarriers() {
       carriers.value.push(
         ...res.rows.map((v) => ({ value: v.id, label: v.code }))
       );
-      carriers.value.push(...form.value.carriers);
-      console.log(carriers.value);
+      console.log(form.value.carriers);
+      carriers.value.push(...form.value.carriers.map(v => ({ value: v.id, label: v.code })));
+      // console.log(carriers.value);
     }
   });
 }
@@ -93,25 +94,24 @@ function getNowCarriers(data) {
       form.value.carriers =
         res.data.dayworkCarrierList && res.data.dayworkCarrierList.length > 0
           ? res.data.dayworkCarrierList.filter(v => v.processInspectionId == "0").map((v) => ({
-            value: v.carrierId,
-            label: v.carrierCode,
+            id: v.carrierId,
+            code: v.carrierCode,
           }))
           : [];
 
       const carriers = res.data.dayworkCarrierList && res.data.dayworkCarrierList.length > 0
         ? res.data.dayworkCarrierList.filter(v => v.processInspectionId == "0").map((v) => ({
-          id: v.carrierId,
-          code: v.carrierCode,
+          value: v.carrierId,
+          label: v.carrierCode,
         }))
         : []
-      form.value.carrierIds = res.data.carrierIds.filter(v => carriers.some(e => e.id == v));
+      form.value.carrierIds = res.data.carrierIds.filter(v => form.value.carriers.some(e => e.id == v));
       getCarriers()
     }
   });
 }
 function getTurnoverDept(data) {
-  let lastProcessStepNumber =
-    data.processes[data.processes.length - 1].processStepNumber;
+  let lastProcessStepNumber = data.processes[data.processes.length - 1].processStepNumber;
   getTurnoverDeptList({
     dayworkId: form.value.dayworkId,
     processStepNumber: lastProcessStepNumber,
@@ -122,7 +122,7 @@ function getTurnoverDept(data) {
   });
 }
 function remoteCarriers(queryString, choiced) {
-  console.log(choiced);
+  // console.log(choiced);
   loadingCarrier.value = true;
   listCarriers({
     isAbandoned: 0,
@@ -135,6 +135,7 @@ function remoteCarriers(queryString, choiced) {
         label: v.code,
         category: v.categoryId,
       }));
+      // console.log(choiced)
       carriers.value.push(
         ...choiced
           .filter((v) => !carriers.value.map((e) => e.value).includes(v.id))
@@ -200,8 +201,8 @@ function handleSave() {
         form.value.productionDeptName = deptList.value.find(
           (v) => v.value == form.value.productionDeptId
         ).label;
-        console.log(form.value.carriers);
-        console.log(form.value);
+        // console.log(form.value.carriers);
+        // console.log(form.value);
         updateReceiptTurnover(form.value).then((response) => {
           proxy.$modal.msgSuccess("修改成功");
           visible.value = false;