Procházet zdrojové kódy

fix: 修复挂起状态判断和添加行点击事件

liujt před 7 měsíci
rodič
revize
cefe45c184

+ 1 - 1
src/views/bpm/handleTask/components/saleOrder/invoice/detailDialog.vue

@@ -682,7 +682,7 @@
       handleRowClick(row) {
         // this.current = row;
         // console.log('handleRowClick', row)
-        if (row.isSuspend === 1) {
+        if (row.isSuspend == 1) {
           this.$alert(`替代批次号:${row.offsetDetail[0].batchNo}`, {
             confirmButtonText: '知道了',
             type: 'none'

+ 12 - 3
src/views/bpm/outgoingManagement/outbound.vue

@@ -337,7 +337,7 @@
                   <el-link
                     type="danger"
                     @click="deleteProductList(row, $index)"
-                    v-if="isEdit && row.isSuspend != 1"
+                    v-if="isEdit"
                     >删除</el-link
                   >
                 </template>
@@ -1068,15 +1068,18 @@
                 );
               });
           }
+          console.log(this.saleProductList, 'this.saleProductList33333');
           let pData = {
             type: '1',
+            deliveryOrderNo: this.form.docNo,
             builders: this.detailList.map((item) => {
               return {
                 categoryId:
                   item.categoryId || item.instanceId || item.productId,
                 num: item.demandQuantity || item.measurementCount,
                 warehouseId: this.bizType == 11 ? item.warehouseId : '',
-                batchNo: item.batchNo || ''
+                batchNo: item.batchNo || '',
+                reversionBatchNo: item.isSuspend == 1 ? item.offsetDetail?.batchNo || '' : '',
               };
             })
           };
@@ -1128,13 +1131,16 @@
             this.formData.extInfo.verifyDeptCode = this.form.deptId;
             this.formData.extInfo.verifyDeptName = this.form.deptName;
           });
+          console.log(this.saleProductList, 'this.saleProductList11111');
           let pData = {
             type: '1',
+            deliveryOrderNo: this.form.docNo,
             builders: this.saleProductList.map((item) => {
               return {
                 categoryId: item.productId || item.categoryId,
                 num: item.totalCount,
-                batchNo: item.batchNo || ''
+                batchNo: item.batchNo || '',
+                reversionBatchNo: item.isSuspend == 1 ? item?.offsetDetail[0]?.batchNo || '' : '',
                 // warehouseId: this.bizType == 3 ? item.warehouseId : ''
                 // batchNo: item.batchNo || '',
               };
@@ -1145,6 +1151,7 @@
             taskIds: this.extractedList.map((item) => item.taskId),
             workOrderIds: this.extractedList.map((item) => item.workOrderId)
           };
+          console.log('111~~~~~~~~', pData)
           storageApi
             .getHierarchyFifo(this.wwType == 3 ? pData2 : pData)
             .then((data) => {
@@ -1163,8 +1170,10 @@
             this.formData.extInfo.verifyDeptCode = this.form.deptId;
             this.formData.extInfo.verifyDeptName = this.form.deptName;
           });
+          console.log(this.saleProductList, 'this.saleProductList22222');
           let pData = {
             type: '1',
+            // deliveryOrderNo: this.form.docNo,
             builders: this.form.productList.map((item) => {
               return {
                 categoryId: item.productId,

+ 29 - 0
src/views/bpm/stockManagement/storage.vue

@@ -169,6 +169,8 @@
               ref="productListTable"
               :data="productList"
               tooltip-effect="dark"
+              @row-click="handleRowClick"
+              :row-class-name="tableRowClassName"
             >
               <el-table-column
                 label="序号"
@@ -1399,6 +1401,26 @@
     },
     methods: {
       ...mapActions('dict', ['requestDict']),
+      // 通过挂起状态设置行样式
+      tableRowClassName({row}) {
+        // console.log('tableRowClassName', row)
+        if (row.isReversal == 1) {
+          return 'warning-row';
+        }
+        return '';
+      },
+      handleRowClick(row) {
+        // this.current = row;
+        console.log('handleRowClick', row)
+        if (row.isReversal == 1) {
+          this.$alert(`替代批次号:${row.suspendOrReverseDetail[0].batchNo}`, {
+            confirmButtonText: '知道了',
+            type: 'none'
+          }).catch(() => {
+            // 捕获用户取消操作时的Promise rejection
+          });
+        }
+      },
       changeCount(number) {
         return new BigNumber(number).toString();
       },
@@ -1973,6 +1995,10 @@
               return {
                 index: this.productList.length + index,
                 isSave: true,
+                isReversal: this.detailList.find((val) => val.categoryCode == item.code)
+                    ?.isReversal || item.isReversal || 0, // 是否挂起
+                suspendOrReverseDetail: this.detailList.find((val) => val.categoryCode == item.code)
+                    ?.suspendOrReverseDetail || item.suspendOrReverseDetail || null, // 挂起或反冲详情
                 categoryId: item.id, // 物品id
                 categoryName: item.name, // 物品名称
                 categoryCode: item.code, // 物品编码
@@ -4078,6 +4104,9 @@
 </script>
 
 <style lang="scss" scoped>
+::v-deep .el-table .warning-row {
+    background: #d9ecff;
+  }
   .inbound_details {
     margin-top: 10px;