Ver código fonte

fix:函上传单价和非税报价校验

snow 1 ano atrás
pai
commit
feaeebeb6d

+ 1 - 1
src/components/manage/src/letter/_template.js

@@ -1,4 +1,4 @@
-const mapFields = {
+export const mapFields = {
     name: "name",
     // primaryClassification: 'primaryClassification', // 一级分类
     // secondaryClassification: 'secondaryClassification',  // 二级分类

+ 24 - 3
src/components/manage/src/letter/xlsxUploadModal.vue

@@ -85,8 +85,10 @@ import {
   getColumn,
   requsetFields,
   requiredFields,
-  getTableProperty
+  getTableProperty,
+  mapFields
 } from './_template'
+import { add_sum, accMul } from '../../../../utils/validate'
 
 
 export default {
@@ -221,11 +223,30 @@ export default {
             return false
           }
 
-          console.log(tableItem[property])
-          if(intergeFields.includes(property) && this.isNumberValid(tableItem[property]) && String(tableItem[property]).includes(".")){
+          if(intergeFields.includes(property) && this.isNumberValid(tableItem[property]) 
+            && String(tableItem[property]).includes(".")){
             this.$message.warning(`第 ${line} 行 : ${getColumn(property).label} 必须为正整数`)
             return false
           }
+
+          if(property === mapFields.price){
+            // 校验:单价 * 数量 = 含税报价
+            const includeTaxTotal = accMul(tableItem[mapFields.price], tableItem[mapFields.num])
+            if(Number(includeTaxTotal) !== Number(tableItem[mapFields.taxIncludedQuote])){
+              this.$message.warning(`第 ${line} 行 : 单价 * 数量必须等于含税报价`)
+              return
+            }
+          }
+
+          if(property === mapFields.nonTaxQuotes){
+            //校验:非税报价 + 税额 = 含税报价
+            const total = add_sum(tableItem[mapFields.nonTaxQuotes], tableItem[mapFields.tax])
+            console.log(total)
+            if(Number(total) !== Number(tableItem[mapFields.taxIncludedQuote])){
+              this.$message.warning(`第 ${line} 行 : 非税报价 + 税额必须等于含税报价`)
+              return
+            }
+          }
         }
       }
 

+ 1 - 1
src/views/customerService/demandOrder/columns.js

@@ -40,7 +40,7 @@ const listCol = [
   },
 
   {
-    prop: 'require_item',
+    prop: 'require_item_name',
     label: '活动需求',
     width: '155px'
   },

+ 1 - 1
src/views/customerService/demandOrder/index.vue

@@ -163,7 +163,7 @@
 
             <span v-else>
               {{scope.row.participant_min}} ~ {{scope.row.participant_max}}
-            </span>
+            </span>
           </template>
         <template #status="{ scope }">
           <el-tag

+ 2 - 2
src/views/customerService/workbench/index.vue

@@ -153,8 +153,8 @@
 
               <div class="task-card__content">
                 <span v-if="Number(item.participant_max) === 0">{{item.participant_min}}+</span>
-                <span v-else>{{item.participant_min}} ~ {{item.participant_max}}</span> 人
-                 ,  {{item.req_demand_name.map(({name}) => name).join(" + ")}}
+                <span v-else>{{item.participant_min}} ~ {{item.participant_max}} </span> 人
+                 ,  {{item.req_demand_name.map(({name}) => name).join(" + ") || '--'}}
               </div>
 
               <div class="task-card__content">

+ 17 - 8
src/views/customerService/workbench/modal.vue

@@ -1,13 +1,6 @@
 <template>
   <el-dialog :visible="innerVisible" :title="title" center :close-on-click-modal="false" @close="handleClose">
     <el-form ref="ruleForm" label-width="110px" size="mini" :rules="rules" :model="ruleForm">
-      <!-- <el-form-item label="服务名称" prop="name">
-        <el-input placeholder="服务名称" v-model="ruleForm.name" />
-      </el-form-item>
-      <el-form-item label="服务分类" prop="service_cat">
-        <search-category :value.sync="ruleForm.service_cat" style="width:100%" ref="category" />
-      </el-form-item> -->
-
       <el-form-item label="服务分类" prop="service_cat">
         <search-sort ref="sort" :value="service_cat" size="mini" placeholder="服务分类" @handleChange="handleCategoryChange" />
       </el-form-item>
@@ -120,6 +113,7 @@
 <script>
 import { ModalTypes } from "./_template"
 import asyncRequest from "@/apis/service/customerService/workbench";
+import { accMul, add_sum } from '../../../utils/validate';
 
 export default {
   props:['visible','sitem', 'type', "storeId"],
@@ -250,7 +244,20 @@ export default {
       this.$refs.ruleForm.validate(async isValid => {
         if(!isValid) return
 
-        const { id,name,service_cat,unit,price,num,remark,total_fee,tax,pay_fee,tax_fee } = this.ruleForm;
+        const { id, name, service_cat, unit, price, num, remark, total_fee, tax, pay_fee, tax_fee } = this.ruleForm;
+
+        const includeTaxTotal = accMul(num, price)
+        const total = add_sum(pay_fee, tax_fee)
+
+        if(Number(includeTaxTotal) !== Number(total_fee)) {
+          this.$message.warning('单价*数量 必须等于必须等于含税报价!')
+          return
+        }
+
+        if(Number(total) !== Number(total_fee)){
+          this.$message.warning('非税报价+税额 必须等于含税报价!')
+          return
+        }
 
         const params = {
           id,
@@ -268,6 +275,8 @@ export default {
           tax_fee
         }
 
+
+
         if(this.type === ModalTypes.copy){
           delete params.id
         }

+ 2 - 8
src/views/platformService/settlement/detail.vue

@@ -14,14 +14,8 @@
                 <template #status>
                   <el-tag
                     :size="tablebtnSize"
-                    :type="
-                      (statusList.find((item) => item.id == sitem.status) || {})
-                        .type || ''
-                    "
-                    v-text="
-                      (statusList.find((item) => item.id == sitem.status) || {})
-                        .label || '--'
-                    "
+                    :type="(statusList.find((item) => item.id == sitem.status) || {}).type || ''"
+                    v-text="(statusList.find((item) => item.id == sitem.status) || {}).label || '--'"
                   ></el-tag>
                 </template>
               </show-data-table>

+ 1 - 3
src/views/platformService/settlement/index.vue

@@ -142,9 +142,7 @@
             v-for="(si, sii) in scope.row.specinfo"
             :key="si.spec_value_id + sii"
           >
-            {{ sii == 0 ? "__" : "--" }}{{ si.spec_name }}[{{
-              si.spec_value_name
-            }}]</span>
+            {{ sii == 0 ? "__" : "--" }}{{ si.spec_name }}[{{si.spec_value_name}}]</span>
         </template>
         <template #can="{ scope }">
           <span v-for="(si, sii) in scope.row.can" :key="si.id + sii">