tangning 10 月之前
父節點
當前提交
586e1909db
共有 1 個文件被更改,包括 17 次插入7 次删除
  1. 17 7
      src/views/work/quoteModel.vue

+ 17 - 7
src/views/work/quoteModel.vue

@@ -83,7 +83,7 @@
         priceLists: [],
         priceListsPrice: {},
         manMadeList: [],
-        valueObj:{},
+        valueObj: {},
       });
       const loading = ref(false);
       const { createMessage, createConfirm } = useMessage();
@@ -195,7 +195,6 @@
         fileFlow.priceListsPrice;
         allListOption.map((ele) => {
           fileFlow.manMadeList.push({
-            ...ele,
             label: `${ele.name} ${ele.price}元`,
             value: ele.laborCostId,
             priceListId: ele.priceListId,
@@ -288,6 +287,11 @@
             //人工费
             manMade.push(ele.partId);
             count = count + ele.count * ele.price;
+            fileFlow.manMadeList.forEach((item) => {
+              if (item.value == ele.laborId) {
+                item.disabled = ele.status == 2;
+              }
+            });
           } else if (ele.type == 0) {
             //备件
             countIndex++;
@@ -399,7 +403,15 @@
         });
         fileFlow.priceCount = count.toFixed(2);
         valueObj.manMade = manMade;
-        fileFlow.valueObj = valueObj
+        if (manMade.length > 0) {
+          priceSchema.push({
+            field: 'manMade',
+            componentProps: {
+              options: fileFlow.manMadeList,
+            },
+          });
+        }
+        fileFlow.valueObj = valueObj;
         console.log('priceSchema', priceSchema);
         priceSchema.map((item) => {
           appendSchemaByField(item, '');
@@ -410,7 +422,7 @@
       }
       function addSchemas(number, isJm = false, disabled) {
         console.log('addSchemas', number, n.value);
-        let priceListsLength = 0 //fileFlow.priceLists.filter((ele) => ele.type == 0).length;
+        let priceListsLength = 0; //fileFlow.priceLists.filter((ele) => ele.type == 0).length;
         let parentList: FormSchema[] = [
           {
             field: 'deviceType' + number,
@@ -545,7 +557,6 @@
               fileFlow.manMadeList.map((ele) => {
                 if (manMade.includes(ele.laborCostId)) {
                   priceListsparams.push({
-                    ...ele,
                     count: 1,
                     priceListId: ele.priceListId,
                     laborId: ele.laborCostId,
@@ -554,7 +565,6 @@
                   });
                 }
               });
-              console.log('manMade', manMade, fileFlow.manMadeList,priceListsparams);
               for (let index = 1; index < n.value; index++) {
                 if (params[`device_${index}`]) {
                   priceListsparams.push({
@@ -563,7 +573,7 @@
                     remark: params[`remark${index}`],
                     price: params[`device_${index}`],
                     type: params[`deduction${index}`] ? 3 : 2,
-                    priceListId: fileFlow.valueObj[`priceListId${index}`]
+                    priceListId: fileFlow.valueObj[`priceListId${index}`],
                   });
                 }
               }