Kaynağa Gözat

feat: 销售订单去掉税率默认值,通过参数配置税率是否必填

liujt 9 ay önce
ebeveyn
işleme
c1696dd113

+ 19 - 3
src/BIZComponents/inventoryTable.vue

@@ -208,6 +208,9 @@
       <template v-slot:headerTotalCount="{ column }">
         <span :class="{ 'is-required': isTotalCount }">{{ column.label }}</span>
       </template>
+      <template v-slot:headerTaxRate="{ column }">
+        <span :class="{ 'is-required': isTaxRate == 1 }">{{ column.label }}</span>
+      </template>
       <template v-slot:totalPrice="scope">
         <el-form-item :prop="'datasource.' + scope.$index + '.totalPrice'">
           {{ (Number(scope.row.totalPrice) || 0).toFixed(2) }}元
@@ -333,7 +336,14 @@
       </template> -->
 
       <template v-slot:taxRate="scope">
-        <el-form-item :prop="'datasource.' + scope.$index + '.taxRate'">
+        <el-form-item 
+          :prop="'datasource.' + scope.$index + '.taxRate'"
+          :rules="{
+            required: isTaxRate == 1 ? true : false,
+            message: '请输入税率',
+            trigger: 'change'
+          }"
+        >
           <el-input
             v-model="scope.row.taxRate"
             placeholder="请输入"
@@ -918,10 +928,15 @@
         type: Boolean,
         default: false
       },
-      defTaxRate: {
+      // 是否税率必填
+      isTaxRate: {
         type: Number,
         default: 0
       },
+      defTaxRate: {
+        type: Number,
+        default: undefined
+      },
       countObj: {
         type: Object,
         default: () => {
@@ -1143,7 +1158,8 @@
             prop: 'taxRate',
             label: '税率',
             slot: 'taxRate',
-            align: 'center'
+            align: 'center',
+            headerSlot: 'headerTaxRate',
           },
           {
             width: 180,

+ 9 - 2
src/views/saleManage/saleOrder/components/addDialog.vue

@@ -361,8 +361,8 @@
         :isArrivalWay="true"
         :cacheKeyUrl="cacheKeyUrl"
         :isGoods="true"
+        :isTaxRate="isTaxRate"
         :isSinglePrice="form.needProduce != 2"
-        :defTaxRate="13"
         :isBatchNo="isBatchNo == 1 && form.saleTypeName.includes('受托')"
       ></inventoryTable>
       <headerTitle
@@ -713,7 +713,8 @@
         isUpdate: false,
         enterprisePage: [],
         businessId: '',
-        isBatchNo: 0
+        isBatchNo: 0,
+        isTaxRate: 0
       };
     },
     computed: {
@@ -797,6 +798,12 @@
       }).then((res) => {
         this.isBatchNo = res.value;
       });
+
+      parameterGetByCode({
+        code: 'eom_saleOrder_order-taxRate'
+      }).then((res) => {
+        this.isTaxRate = res.value;
+      });
     },
     methods: {
       setCountAmount(allPrice) {