|
@@ -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
|