Browse Source

fix(退货管理): 修复退货数量验证及挂起操作显示问题

liujt 7 months ago
parent
commit
7eda3654cb

+ 12 - 0
src/views/purchasingManage/purchaseOrder/returnGoods/components/addReturnGoodsDialog.vue

@@ -499,6 +499,18 @@ export default {
         if (productList.length === 0) {
           return this.$message.error('至少选择一个退货产品');
         }
+        let productListData = [];
+        productList.forEach((item) => {
+          if (!item.totalCount) {
+            productListData.push(item.productName);
+          }
+        });
+        console.log(productListData);
+        if (productListData.length) {
+          return this.$message.error(
+            productListData.toString() + ' 退货数量不能为空!'
+          );
+        }
         let commitData = Object.assign({}, this.form, {
           totalAmount: Number(this.totalAmount),
           productList

+ 1 - 1
src/views/purchasingManage/purchaseOrder/returnGoods/components/inventoryTable.vue

@@ -105,9 +105,9 @@
           :prop="'datasource.' + scope.$index + '.totalCount'"
           :rules="[
             { required: true, message: '请输入数字', trigger: 'blur' },
-            { validator: validateTotalCount(scope.row), trigger: 'blur' }
           ]"
         >
+          <!-- { validator: validateTotalCount(scope.row), trigger: 'blur' } -->
           <el-input
             v-model="scope.row.totalCount"
             @input="(val) => changeNum(val, scope.$index, scope.row)"

+ 20 - 18
src/views/saleManage/saleOrder/invoice/components/inventoryTable.vue

@@ -378,24 +378,26 @@
           替代料
         </el-link>
         
-        <el-popconfirm
-          v-if="scope.row.isSuspend === 1"
-          class="ele-action"
-          title="确定要挂起吗?"
-          @confirm="pending(scope.row, 0)"
-        >
-          <template v-slot:reference>
-            <el-link
-              type="primary"
-              :underline="false"
-            >
-          取消挂起
-        </el-link>
-          </template>
-        </el-popconfirm>
-        <el-link v-else type="primary" :underline="false" @click="pendingReplaceTable(scope.row, scope.$index)">
-              挂起
-        </el-link>
+        <template v-if="scope.row.batchNo">
+          <el-popconfirm
+            v-if="scope.row.isSuspend === 1"
+            class="ele-action"
+            title="确定要挂起吗?"
+            @confirm="pending(scope.row, 0)"
+          >
+            <template v-slot:reference>
+              <el-link
+                type="primary"
+                :underline="false"
+              >
+            取消挂起
+          </el-link>
+            </template>
+          </el-popconfirm>
+          <el-link v-else type="primary" :underline="false" @click="pendingReplaceTable(scope.row, scope.$index)">
+                挂起
+          </el-link>
+        </template>
       </template>
     </ele-pro-table>
     <productListNew