Przeglądaj źródła

refactor(销售服务管理): 移除未使用的文件组件和入库申请逻辑,优化重量计算逻辑

yusheng 7 miesięcy temu
rodzic
commit
a55a5f5314

+ 0 - 2
src/views/bpm/handleTask/components/salesServiceManagement/demand/salesServiceDialog.vue

@@ -630,7 +630,6 @@
 </template>
 
 <script>
-import fileMain from '@/components/addDoc/index.vue';
 import dictMixins from '@/mixins/dictMixins';
 import { mapGetters } from 'vuex';
 import spareParts from './sparePartsList.vue';
@@ -642,7 +641,6 @@ import { getSalesDemandById, contactDetail } from '@/api/afterSales/index';
 export default {
   mixins: [dictMixins],
   components: {
-    fileMain,
     spareParts
   },
   computed: {

+ 1 - 43
src/views/bpm/handleTask/components/salesServiceManagement/demand/submit.vue

@@ -23,17 +23,9 @@
         type="success"
         size="mini"
         @click="handleAudit(1)"
-        v-if="taskDefinitionKey != 'storemanApprove'"
         >通过
       </el-button>
-      <el-button
-        icon="el-icon-edit-outline"
-        type="success"
-        size="mini"
-        @click="storemanApprove"
-        v-if="taskDefinitionKey == 'storemanApprove'"
-        >申请入库
-      </el-button>
+
       <el-button
         icon="el-icon-circle-close"
         type="danger"
@@ -63,7 +55,6 @@
     cancelTask
   } from '@/api/bpm/task';
 
-  import storageApi from '@/api/warehouseManagement';
   // 流程实例的详情页,可用于审批
   export default {
     name: '',
@@ -103,39 +94,6 @@
       handleBackList() {
         this.$emit('handleBackList');
       },
-      async storemanApprove() {
-        let res = await this.getTableValue();
-        let storageData = res.returnStorageData;
-
-        if (!storageData) {
-          return;
-        }
-        // 入库来源isSkip 0-正常  1-外部(外部跳过内部审核流程)
-        storageData.isSkip = 1;
-
-        try {
-          this.isSaveLoading = true;
-          await storageApi.storage(storageData);
-          approveTaskWithVariables({
-            id: this.taskId,
-            reason: this.form.reason,
-            variables: {
-              pass: true
-            }
-          }).then((res) => {
-            if (res.code != '-1') {
-              this.$emit('handleAudit', {
-                status: 1,
-                title: '入库'
-              });
-            }
-            this.isSaveLoading = false;
-          });
-        } catch (error) {
-          this.isSaveLoading = false;
-          this.$message.error('保存失败');
-        }
-      },
 
       async handleAudit(status) {
         await this.approveTaskWithVariables(status);

+ 14 - 10
src/views/bpm/stockManagement/storage.vue

@@ -1525,9 +1525,14 @@
           let weight = 0;
           if (row.measureUnit == row.weightUnit) {
             weight = row.measureQuantity;
-            row.singleWeight =
-              Math.trunc((row.measureQuantity / row.packingQuantity) * 100) /
-              100;
+            // 如果重量单位和包装单位一致,则单重0
+            if (row.weightUnit == row.packageUnit) {
+              row.singleWeight = 0;
+            } else {
+              row.singleWeight =
+                Math.trunc((row.measureQuantity / row.packingQuantity) * 100) /
+                100;
+            }
           } else if (row.singleWeight) {
             weight = row.measureQuantity * Number(row.singleWeight);
           }
@@ -1774,8 +1779,8 @@
                   : '', // 颜色
                 measureType: item.measureType, // 计量方式
                 netWeight: item.netWeight > -1 ? item.netWeight : 0, // 净重
-                singleWeight: singleWeight||0, // 单重重量
-                weight: weight||0, // 总重量
+                singleWeight: singleWeight || 0, // 单重重量
+                weight: weight || 0, // 总重量
                 weightUnit: item.weightUnit, // 重量单位
                 totalMoney: totalMoney, // 总价
                 unitPrice: item.unitPrice || unitPrice, // 单价
@@ -3874,11 +3879,10 @@
             .dictValue;
           if (outBoolen) {
             // 计量单位为KG类,直接替换
-            
-              item.weight = item.measureQuantity
-                ? Number(item.measureQuantity)
-                : 0;
-            
+
+            item.weight = item.measureQuantity
+              ? Number(item.measureQuantity)
+              : 0;
           } else {
             console.log('计量单位为不为KG类======================');
             // 计量单位为不为KG类,重新统计计算