|
@@ -24,12 +24,31 @@ Component({
|
|
this.data.data.qty = e.detail.value
|
|
this.data.data.qty = e.detail.value
|
|
this.triggerEvent("input", this.data.data);
|
|
this.triggerEvent("input", this.data.data);
|
|
},
|
|
},
|
|
|
|
+ newOnBlur(e) {
|
|
|
|
+ let value = e.detail.value,
|
|
|
|
+ data = this.data.data,
|
|
|
|
+ that = this;
|
|
|
|
+ if (data.oldQty == value) return;
|
|
|
|
+ wx.showModal({
|
|
|
|
+ title: `提示`,
|
|
|
|
+ content: `是否确定修改“${data.itemname}”数量为:${value}`,
|
|
|
|
+ complete: (res) => {
|
|
|
|
+ if (res.cancel) {
|
|
|
|
+ that.setData({
|
|
|
|
+ "data.qty": data.oldQty
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ if (res.confirm) that.triggerEvent("changeItem", data)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
onBlur(e) {
|
|
onBlur(e) {
|
|
let {
|
|
let {
|
|
value
|
|
value
|
|
} = e.detail,
|
|
} = e.detail,
|
|
data = this.data.data,
|
|
data = this.data.data,
|
|
name = e.currentTarget.dataset.name;
|
|
name = e.currentTarget.dataset.name;
|
|
|
|
+ console.log(data)
|
|
if (data[name] == value) return;
|
|
if (data[name] == value) return;
|
|
if (name == 'qty' && value <= 0) {
|
|
if (name == 'qty' && value <= 0) {
|
|
wx.showToast({
|
|
wx.showToast({
|