瀏覽代碼

bug修复

chenrui 3 年之前
父節點
當前提交
9d9b22e2e2

+ 14 - 3
src/views/purchasingManagement/purchaseOrder/edit.vue

@@ -240,7 +240,7 @@ export default {
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '产品编码', dataIndex: 'code', width: 220, align: 'center', sorter: true },
-        { title: '产品名称', dataIndex: 'name', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '原厂编码', dataIndex: 'origCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '箱/单位', dataIndex: 'unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '采购单价', dataIndex: 'purchasePrice', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) }, fixed: 'right' },
@@ -286,6 +286,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].qtyBackups = data.list[i].qty
           }
           this.localDataSource = data.list
           this.disabled = false
@@ -354,7 +355,12 @@ export default {
     },
     // 修改数量后
     qtyBlur (val, record) {
-      this.handleAdd(record, 1)
+      // this.handleAdd(record, 1)
+      //  光标移出,值发生改变再调用编辑接口
+      if (val != record.qtyBackups) {
+        // this.handleAdd(record, 'edit')
+        this.handleAdd(record, 1)
+      }
     },
     //  导入明细
     handleImport () {
@@ -394,7 +400,12 @@ export default {
         params.purchaseBillNo = this.detail.purchaseBillNo
         params.price = row.purchasePrice
         params.qty = row.qty
-      } else {
+      } else { //  编辑
+        // 清空成本价或数量时,值应保持未清空前的值,因成本价和数量都不可为空
+        if (!row.qty) {
+          row.qty = row.qtyBackups
+          return
+        }
         params = row
       }
       this.addLoading = true

+ 1 - 1
src/views/purchasingManagement/purchaseOrder/list.vue

@@ -164,7 +164,7 @@ export default {
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '采购单号', scopedSlots: { customRender: 'purchaseBillNo' }, width: 220, align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '供应商', dataIndex: 'purchaseTargetName', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '供应商', dataIndex: 'purchaseTargetName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '产品款数', dataIndex: 'totalCategory', 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: 'discountedAmount', width: 115, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },