tangning пре 1 година
родитељ
комит
147c573e9e
1 измењених фајлова са 38 додато и 4 уклоњено
  1. 38 4
      src/views/work/quoteModel.vue

+ 38 - 4
src/views/work/quoteModel.vue

@@ -32,6 +32,14 @@
           />
           <!-- <Button v-if="(n - 1) == field" @click="del(field)">删除</Button> -->
         </template>
+        <template #dels="{ field }">
+          <Icon
+            @click="dels(field)"
+            icon="ant-design:close-circle-outlined"
+            :size="18"
+            :class="`mr-2`"
+          />
+        </template>
         <template #delList="{ field }">
           <Button @click="del(field)"><close-circle-outlined /></Button>
         </template>
@@ -233,6 +241,18 @@
         n.value--;
         updataCount();
       }
+      function dels(field) {
+        var substr = field.slice(3);
+        console.log(field, substr);
+        removeSchemaByFiled([
+          `priceListText${substr}`,
+          `discount${substr}`,
+          `priceList${substr}`,
+          `del${substr}`,
+        ]);
+        // n.value--;
+        updataCount();
+      }
       function addReduction() {
         let list = addSchemas(n.value, true);
         let valueObj = {};
@@ -306,7 +326,7 @@
                   ],
                 },
                 colProps: {
-                  span: 8,
+                  span: 5,
                 },
               },
               {
@@ -319,12 +339,12 @@
                 // labelWidth:300,
                 // subLabel:"数量",
                 colProps: {
-                  span: 8,
+                  span: 7,
                 },
                 required: true,
                 componentProps: {
                   disabled: ele.status == 1,
-                  min: 1,
+                  min: 0,
                   max: 999,
                   maxLength: 15,
                   onChange: (val) => {
@@ -334,6 +354,16 @@
                   },
                 },
               },
+              {
+                field: 'del' + ele.priceListId.toString(),
+                component: 'Input',
+                label: '',
+                labelWidth: 0,
+                colProps: {
+                  span: 4,
+                },
+                slot: 'dels',
+              },
             );
           } else {
             //人工费
@@ -453,7 +483,9 @@
       }
       const handleSubmit = async () => {
         const params = await validate();
-        if (fileFlow.priceCount < 0) {
+        let newPrice = parseFloat(fileFlow.priceCount);
+        console.log('newPrice', newPrice, fileFlow.priceCount, newPrice > 0);
+        if (!(newPrice > 0)) {
           return createMessage.error('合计金额不能小于0');
         }
         try {
@@ -562,6 +594,7 @@
             `priceListText${ele.priceListId}`,
             `discount${ele.priceListId}`,
             `remark${ele.priceListId}`,
+            `del${ele.priceListId}`,
           );
         });
         indexa = indexa + fileFlow.priceLists.length;
@@ -592,6 +625,7 @@
         t,
         n,
         del,
+        dels,
         add,
         addReduction,
         updataRepairInfo,