|
@@ -110,35 +110,31 @@
|
|
},
|
|
},
|
|
columns () {
|
|
columns () {
|
|
const _this = this
|
|
const _this = this
|
|
- const priceFormat = function(data){
|
|
|
|
- return _this.toThousands(data) || '--'
|
|
|
|
- }
|
|
|
|
- const numsFormat = function(data){
|
|
|
|
- return data || data == 0 ? data : '--'
|
|
|
|
- }
|
|
|
|
- const codeFormat = function(record,data,h){
|
|
|
|
- let ftext = ''
|
|
|
|
- let fcolor = ''
|
|
|
|
- if(record.promotionFlag == 'GIFT'){
|
|
|
|
- ftext = '促'
|
|
|
|
- fcolor = '#52c41a'
|
|
|
|
- }
|
|
|
|
- // if(record.promotionFlag == 'REGULAR'){
|
|
|
|
- // ftext = '正'
|
|
|
|
- // fcolor = '#108ee9'
|
|
|
|
- // }
|
|
|
|
- if(record.promotionFlag == 'DISCOUNT'){
|
|
|
|
- ftext = '特'
|
|
|
|
- fcolor = '#faad14'
|
|
|
|
- }
|
|
|
|
- return (
|
|
|
|
- <div>
|
|
|
|
- <span style="padding-right: 15px;">{data}</span>
|
|
|
|
- {ftext?(<a-badge count={ftext} number-style={{ backgroundColor: fcolor, zoom:'80%' }}></a-badge>):''}
|
|
|
|
- {Number(record.stockQty||0) < Number(record.unpushedQty||0)?(<a-badge count="缺" number-style={{ zoom:'80%' }}></a-badge>):''}
|
|
|
|
- </div>
|
|
|
|
- )
|
|
|
|
- }
|
|
|
|
|
|
+ const priceFormat = function(data){
|
|
|
|
+ return _this.toThousands(data) || '--'
|
|
|
|
+ }
|
|
|
|
+ const numsFormat = function(data){
|
|
|
|
+ return data || data == 0 ? data : '--'
|
|
|
|
+ }
|
|
|
|
+ const codeFormat = function(record,data,h){
|
|
|
|
+ let ftext = ''
|
|
|
|
+ let fcolor = ''
|
|
|
|
+ if(record.promotionFlag == 'GIFT'){
|
|
|
|
+ ftext = '促'
|
|
|
|
+ fcolor = '#52c41a'
|
|
|
|
+ }
|
|
|
|
+ if(record.promotionFlag == 'DISCOUNT'){
|
|
|
|
+ ftext = '特'
|
|
|
|
+ fcolor = '#faad14'
|
|
|
|
+ }
|
|
|
|
+ return (
|
|
|
|
+ <div>
|
|
|
|
+ <span style="padding-right: 15px;">{data}</span>
|
|
|
|
+ {ftext?(<a-badge count={ftext} number-style={{ backgroundColor: fcolor, zoom:'80%' }}></a-badge>):''}
|
|
|
|
+ {Number(record.stockQty||0) < Number(record.unpushedQty||0)?(<a-badge count="缺" number-style={{ zoom:'80%' }}></a-badge>):''}
|
|
|
|
+ </div>
|
|
|
|
+ )
|
|
|
|
+ }
|
|
// 输入框
|
|
// 输入框
|
|
const inputFormat = function(record,data,h) {
|
|
const inputFormat = function(record,data,h) {
|
|
if(record.surplusQty>0){
|
|
if(record.surplusQty>0){
|
|
@@ -147,7 +143,8 @@
|
|
<a-input-number
|
|
<a-input-number
|
|
size="small"
|
|
size="small"
|
|
value={record.qty}
|
|
value={record.qty}
|
|
- onChange={e => _this.cancelNumsChange(e,record)}
|
|
|
|
|
|
+ onChange={e => record.qty = e}
|
|
|
|
+ onBlur={e => _this.cancelNumsChange(e,record)}
|
|
precision={0}
|
|
precision={0}
|
|
min={1}
|
|
min={1}
|
|
max={record.surplusQty}
|
|
max={record.surplusQty}
|
|
@@ -269,9 +266,10 @@
|
|
this.selectedRowKeys = []
|
|
this.selectedRowKeys = []
|
|
},
|
|
},
|
|
// 已选产品 blur
|
|
// 已选产品 blur
|
|
- cancelNumsChange (val, record) {
|
|
|
|
|
|
+ cancelNumsChange (e, record) {
|
|
const _this = this
|
|
const _this = this
|
|
- if (val && val != record.qtyBackups) {
|
|
|
|
|
|
+ const val = e.target.value
|
|
|
|
+ if (val && val != record.qtyBackups && val<=record.surplusQty) {
|
|
_this.spinning = true
|
|
_this.spinning = true
|
|
updateQty({
|
|
updateQty({
|
|
dispatchBillDetailSn: record.dispatchBillDetailSn,
|
|
dispatchBillDetailSn: record.dispatchBillDetailSn,
|
|
@@ -284,6 +282,7 @@
|
|
_this.spinning = false
|
|
_this.spinning = false
|
|
_this.$emit('refashTable')
|
|
_this.$emit('refashTable')
|
|
} else {
|
|
} else {
|
|
|
|
+ record.qty = record.qtyBackups
|
|
_this.spinning = false
|
|
_this.spinning = false
|
|
}
|
|
}
|
|
})
|
|
})
|