|
@@ -74,11 +74,22 @@
|
|
|
bordered>
|
|
|
<!-- 采购数量 -->
|
|
|
<template slot="purchaseQty" slot-scope="text, record">
|
|
|
- <a-input placeholder="请输入采购数量" v-model="record.qty" @change="updateQty(record)"/>
|
|
|
+ <a-input-number
|
|
|
+ size="small"
|
|
|
+ v-model="record.qty"
|
|
|
+ :precision="0"
|
|
|
+ :min="1"
|
|
|
+ :max="999999"
|
|
|
+ @blur="updateQty(record)"
|
|
|
+ style="width: 100%;"
|
|
|
+ placeholder="请输入采购数量" />
|
|
|
</template>
|
|
|
<!-- 包装数 -->
|
|
|
<template slot="baozh" slot-scope="text, record">
|
|
|
- {{ record.productEntity.packQty||'--' }}/{{ record.productEntity.packQtyUnit||'--' }}
|
|
|
+ <span v-if="record.productEntity.packQty&&record.productEntity.packQtyUnit">
|
|
|
+ {{ record.productEntity.packQty||'--' }}{{ record.productEntity.unit }}/{{ record.productEntity.packQtyUnit||'--' }}
|
|
|
+ </span>
|
|
|
+ <span v-else>--</span>
|
|
|
</template>
|
|
|
<!-- 产品编码 -->
|
|
|
<template slot="productCode" slot-scope="text, record">
|
|
@@ -200,14 +211,18 @@ export default {
|
|
|
},
|
|
|
// 修改数量
|
|
|
updateQty (row) {
|
|
|
- purchaseUpdateQty({ qty: row.qty, purchaseCartSn: row.purchaseCartSn }).then(res => {
|
|
|
- if (res.status == 200) {
|
|
|
- this.$message.info(res.message)
|
|
|
- row.qtyBack = row.qty
|
|
|
- } else {
|
|
|
- row.qty = row.qtyBack
|
|
|
- }
|
|
|
- })
|
|
|
+ if (row.qty != row.qtyBack && row.qty) {
|
|
|
+ purchaseUpdateQty({ qty: row.qty, purchaseCartSn: row.purchaseCartSn }).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ this.$message.info(res.message)
|
|
|
+ row.qtyBack = row.qty
|
|
|
+ } else {
|
|
|
+ row.qty = row.qtyBack
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ row.qty = row.qtyBack
|
|
|
+ }
|
|
|
},
|
|
|
// 批量删除
|
|
|
deleteMore () {
|
|
@@ -265,7 +280,7 @@ export default {
|
|
|
let content = ''
|
|
|
if ((res.data.productSizeRepeat != res.data.productSize) && (res.data.productSizeRepeat != 0)) {
|
|
|
content = `您已经选择 ${res.data.productSize} 个产品,其中 ${res.data.productSizeRepeat} 个产品已经存在于采购单中,本次只会加入不重复的产品。确认加入本次采购吗?`
|
|
|
- this.confirmFun(content,params)
|
|
|
+ this.confirmFun(content, params)
|
|
|
} else if (res.data.productSizeRepeat == res.data.productSize) {
|
|
|
content = `抱歉,您选择的 ${res.data.productSize} 个产品,采购单中已经全部存在,无需加入!`
|
|
|
this.$info({
|
|
@@ -280,12 +295,12 @@ export default {
|
|
|
})
|
|
|
} else {
|
|
|
content = `您已经选择 ${res.data.productSize} 个产品,确认要将已选产品加入本次采购吗?`
|
|
|
- this.confirmFun(content,params)
|
|
|
+ this.confirmFun(content, params)
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- confirmFun (content,params) {
|
|
|
+ confirmFun (content, params) {
|
|
|
const _this = this
|
|
|
this.$confirm({
|
|
|
title: '提示',
|