Ver código fonte

测试环境bug解决

cz 1 ano atrás
pai
commit
7186219ca9

+ 16 - 11
src/components/process/ServiceContract.vue

@@ -80,13 +80,14 @@
       <template #file>
         <div style="width: 100%">
           <el-upload
-            v-model:fileList="formData.data.fileList"
+            v-model="formData.data.fileList"
             action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
             :data="uploadData"
             multiple
             :before-upload="uploadFile"
             :on-success="handleSuccess2"
-            :on-preview="onPreviewFile2">
+            :on-preview="onPreviewFile"
+          >
             <el-button>选择</el-button>
           </el-upload>
         </div>
@@ -117,8 +118,15 @@
                     placeholder="国家"
                     filterable
                     @change="(val) => getCityData(val, '20', true)"
-                    :no-match-text="'无数据,请联系管理员添加'">
-                    <el-option v-for="item in countryData" :key="item.id" :label="item.chineseName + '(' + item.name + ')'" :value="item.id"> </el-option>
+                    :no-match-text="'无数据,请联系管理员添加'"
+                  >
+                    <el-option
+                      v-for="item in countryData"
+                      :key="item.id"
+                      :label="item.chineseName + '(' + item.name + ')'"
+                      :value="item.id"
+                    >
+                    </el-option>
                   </el-select>
                 </el-form-item>
               </el-col>
@@ -716,7 +724,6 @@ const rules = ref({
   ],
 });
 
-
 const getDict = () => {
   proxy.getDictOne(["account_currency", "funds_payment_method"]).then((res) => {
     accountCurrency.value = res["account_currency"].map((x) => ({
@@ -1069,7 +1076,7 @@ const uploadFile = async (file) => {
 
 const handleSuccess2 = (any, UploadFile) => {
   console.log(any, UploadFile);
-  console.log(formData.data)
+  console.log(formData.data);
   formData.data.fileList.push({
     id: UploadFile.raw.id,
     fileName: UploadFile.raw.fileName,
@@ -1277,18 +1284,16 @@ watch(
       ["10", "20", "30"].includes(route.query.processType)
     ) {
       for (var text in props.queryData) {
-        
         formData.data[text] = props.queryData[text];
-        
       }
       formData.data.fileList = formData.data.fileList.map((item) => {
         return {
           name: item.fileName,
           url: item.fileUrl,
-          ...item
-        }
+          ...item,
+        };
       });
-      console.log(formData.data)
+      console.log(formData.data);
       if (formData.data.countryId) {
         getCityData(formData.data.countryId, "20");
       }

+ 7 - 2
src/views/salesMange/salesMange/invoice/index.vue

@@ -31,7 +31,7 @@
                 <template #default="{ row, $index }">
                   <div style="width: 100%">
                     <el-form-item :prop="'invoiceDetailsList.' + $index + '.contractId'" :rules="rules.contractId" :inline-message="true">
-                      <el-select v-model="row.contractId" placeholder="请选择合同编号" style="width: 100%">
+                      <el-select v-model="row.contractId" filterable placeholder="请选择合同编号" style="width: 100%">
                         <el-option v-for="item in contractList" :key="item.value" :label="item.label" :value="item.value" />
                       </el-select>
                     </el-form-item>
@@ -166,7 +166,7 @@ const config = computed(() => {
                 type: "warning",
               }).then(() => {
                 proxy
-                  .post("/supplierInfo/delete", {
+                  .post("/invoice/delete", {
                     id: row.id,
                   })
                   .then((res) => {
@@ -257,6 +257,7 @@ const formConfig = computed(() => {
       label: "归属公司",
       prop: "corporationId",
       data: corporationList.value,
+      filterable: true,
       style: {
         width: "100%",
       },
@@ -359,6 +360,10 @@ const submitForm = () => {
         }
       }
     }
+    const total =  formData.data.invoiceDetailsList.reduce((val,x)=>val+=Number(x.money),0)
+    if(formData.data.money !=  Number( parseFloat(total).toFixed(2))){
+       return ElMessage("关联金额总合必须等于发票金额");
+    }
     submitLoading.value = true;
     proxy.post("/contractInvoice/add", formData.data).then(
       () => {