chenrui vor 4 Jahren
Ursprung
Commit
ce032b14ee

+ 10 - 4
src/views/allocationManagement/storeTransferOut/edit.vue

@@ -304,7 +304,7 @@ export default {
       const params = {
         id: isEdit ? row.id : undefined,
         storeCallOutSn: this.$route.params.sn,
-        outCost: row.putCost,
+        outCost: isEdit ? row.outCost : row.putCost,
         outQty: isEdit ? row.outQty : 1, //  添加时调出数量默认为1
         productSn: row.productSn,
         productCode: row.productCode,
@@ -316,6 +316,13 @@ export default {
         warehouseSn: row.warehouseSn,
         warehouseLocationSn: row.warehouseLocationSn
       }
+      if (isEdit) { // 编辑
+        // 清空数量时,值应保持未清空前的值,因数量不可为空
+        if (!row.outQty) {
+          row.outQty = row.outQtyBackups
+          return
+        }
+      }
       storeCallOutDetailSave(params).then(res => {
         if (res.status == 200) {
           this.$message.success(res.message)
@@ -355,9 +362,7 @@ export default {
       this.openModal = true
     },
     //  基本信息  保存
-    handleOk () {
-
-    },
+    handleOk () {},
     //  提交
     handleSubmit () {
       const _this = this
@@ -418,6 +423,7 @@ export default {
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
             data.list[i].no = no + i + 1
+            data.list[i].outQtyBackups = data.list[i].outQty
             // 成本小计  由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
             data.list[i].costSubtotal = getOperationalPrecision(data.list[i].outCost, data.list[i].outQty)
           }

+ 18 - 5
src/views/bulkManagement/bulkWarehousingOrder/edit.vue

@@ -363,20 +363,19 @@ export default {
     },
     //  添加/编辑
     handleAdd (row, isEdit) {
-      console.log(row, '--------------------添加编辑')
-      if (!row.putCost) {
+      if (!isEdit && !row.putCost) {
         this.$message.warning('请输入成本价')
         return
       }
-      if (!row.putQty) {
+      if (!isEdit && !row.putQty) {
         this.$message.warning('请输入数量')
         return
       }
-      if (!row.warehouseSn) {
+      if (!isEdit && !row.warehouseSn) {
         this.$message.warning('请选择仓库')
         return
       }
-      if (!row.warehouseLocationSn) {
+      if (!isEdit && !row.warehouseLocationSn) {
         this.$message.warning('请选择仓位')
         return
       }
@@ -395,8 +394,20 @@ export default {
         warehouseLocationSn: row.warehouseLocationSn,
         warehouseSn: row.warehouseSn
       }
+      if (isEdit) { // 编辑
+        // 清空成本价或数量时,值应保持未清空前的值,因成本价和数量都不可为空
+        if (!row.putCost) {
+          row.putCost = row.putCostBackups
+          return
+        }
+        if (!row.putQty) {
+          row.putQty = row.putQtyBackups
+          return
+        }
+      }
       sparePartsPurDetailSave(params).then(res => {
         if (res.status == 200) {
+          this.$message.success(res.message)
           this.getChooseDealerProductList()
         }
       })
@@ -612,6 +623,8 @@ export default {
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
             data.list[i].no = no + i + 1
+            data.list[i].putCostBackups = data.list[i].putCost
+            data.list[i].putQtyBackups = data.list[i].putQty
             // 成本小计  由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
             data.list[i].costSubtotal = getOperationalPrecision(data.list[i].putCost, data.list[i].putQty)
           }

+ 2 - 2
src/views/purchasingManagement/purchaseReturn/list.vue

@@ -96,8 +96,8 @@ export default {
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
         { title: '采退单号', scopedSlots: { customRender: 'purchaseReturnNo' }, align: 'center' },
-        { title: '退货数量', dataIndex: 'productTotalQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '退款金额', dataIndex: 'productTotalCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '退货数量', dataIndex: 'totalQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '退款金额', dataIndex: 'totalAmount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '审核时间', dataIndex: 'auditTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '业务状态', dataIndex: 'stateDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '财务状态', dataIndex: 'settleStateDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } },