This commit is contained in:
蔡玲
2024-11-15 15:58:00 +08:00
parent f56681ddcd
commit 7309f5e425
3 changed files with 71 additions and 29 deletions

View File

@@ -95,7 +95,7 @@
<td>{{el.kclx}}</td> <td>{{el.kclx}}</td>
<td>{{el.kczt}}</td> <td>{{el.kczt}}</td>
<td> <td>
<input class="td_input" type="number" confirm-type="go" v-model="el.sl" @blur="updateNum(e, el)" @confirm="updateNum(e, el)"/> <input class="td_input" type="number" confirm-type="go" v-model="el.sl" @focus="focusInput(e, el)" @blur="updateNum(e, el)" @confirm="updateNum(e, el)"/>
</td> </td>
<td @tap.stop="showPop(1, e, el)"> <td @tap.stop="showPop(1, e, el)">
<view class="zd-row td_change"> <view class="zd-row td_change">
@@ -175,7 +175,6 @@
dataList: [], // 一级表格数据 dataList: [], // 一级表格数据
popData: [], // 副表格点击物料编码弹出弹窗 popData: [], // 副表格点击物料编码弹出弹窗
popObj: {}, // 弹窗当前主表格内容 popObj: {}, // 弹窗当前主表格内容
popObj1: {},
show: false, // 弹窗显示布尔值 show: false, // 弹窗显示布尔值
type: '', // 弹窗类型 type: '', // 弹窗类型
delShow: false, // 详情弹窗布尔值 delShow: false, // 详情弹窗布尔值
@@ -183,6 +182,8 @@
value: '', // 选择仓库名称 value: '', // 选择仓库名称
range: [], range: [],
disabled1: false, disabled1: false,
raw: '', // 副表格修改前输入框数据
rawObj: {} // 副表格修改前行数据
} }
}, },
onLoad () { onLoad () {
@@ -319,16 +320,47 @@
this.disabled1 = false this.disabled1 = false
} }
}, },
// 修改副表格单行收货数量 // 副表格单行数量获取焦点
focusInput (e, el) {
this.raw = el.sl
},
// 修改副表格单行数量
updateNum (e, el) { updateNum (e, el) {
this._allocationBillDetailUpdate(e, el) this._allocationBillDetailUpdate(e, el, 'sl')
}, },
// 副表格单行收货数量和收货仓库接口 // 副表格单行收货数量和收货仓库接口
async _allocationBillDetailUpdate (e, el) { async _allocationBillDetailUpdate (e, el, type) {
try { try {
let res = await allocationBillDetailUpdate(el) let res = await allocationBillDetailUpdate(el)
if (res.code !== 1) { if (res.code === 1) {
this._allocationBillDetail(e) this.dataList.map(ele => {
if (e.id === ele.id) {
e.subData.map(elem => {
if (elem.id === el.id) {
if (type === 'dcck') {
elem.dcckbm = el.dcckbm
elem.dcckmc = el.dcckmc
}
if (type === 'drck') {
elem.drckbm = el.drckbm
elem.drckmc = el.drckmc
}
}
})
}
})
} else {
this.dataList.map(ele => {
if (e.id === ele.id) {
e.subData.map(elem => {
if (elem.id === el.id) {
if (type === 'sl') {
elem.sl = this.raw
}
}
})
}
})
} }
uni.showToast({ uni.showToast({
title: res.desc, title: res.desc,
@@ -341,13 +373,12 @@
// 副表格修改仓库弹窗 // 副表格修改仓库弹窗
showPop (type, e, obj) { showPop (type, e, obj) {
this.popObj = {} this.popObj = {}
this.popObj1 = {}
this.value = '' this.value = ''
this.type = type this.type = type
if (type === 1 || type === 2) { // 修改副表格单行仓库弹窗 if (type === 1 || type === 2) { // 修改副表格单行仓库弹窗
this.show = true this.show = true
this.popObj = e this.popObj = e
this.popObj1 = obj this.rawObj = obj
} }
}, },
// 副表格修改仓库弹窗->确定 // 副表格修改仓库弹窗->确定
@@ -366,22 +397,17 @@
text = el.text text = el.text
} }
}) })
this.dataList.map(e => { let obj = Object.assign({}, this.rawObj)
if (e.id === this.popObj.id) { if (this.type === 1) {
e.subData.map(el => { obj.dcckbm = this.value
if (el.id === this.popObj1.id) { obj.dcckmc = text
if (this.type === 1) { this._allocationBillDetailUpdate(this.popObj, obj, 'dcck')
el.dcckbm = this.value } else if (this.type === 2) {
el.dcckmc = text obj.drckbm = this.value
} else if (this.type === 2) { obj.drckmc = text
el.drckbm = this.value this._allocationBillDetailUpdate(this.popObj, obj, 'drck')
el.drckmc = text }
} this.show = false
this._allocationBillDetailUpdate(this.popObj, el)
}
})
}
})
}, },
// 详情弹窗 // 详情弹窗
getDetails (type,e) { getDetails (type,e) {

View File

@@ -230,9 +230,9 @@ export const receiptBillDetailPage = (fuzzy, djid, page, size) => request({
} }
}) })
// 2.副表格修改-数量和仓库编码 // 2.副表格修改-数量和仓库编码
export const receiptBillDetailUpdate = (arr) => request({ export const receiptBillDetailUpdate = (obj) => request({
url:'api/receiptBillDetail/update', url:'api/receiptBillDetail/update',
data: arr data: obj
}) })
// 3.库位分配 // 3.库位分配

View File

@@ -2329,6 +2329,14 @@ export const receiptBillDetailUpdate = () => {
return res return res
} }
export const allocationBillDetailUpdate = () => {
let res = {
code: 1,
desc: 'ok'
}
return res
}
export const allocationBillDetail = () => { export const allocationBillDetail = () => {
let res = { let res = {
"pageNum": 1, "pageNum": 1,
@@ -2339,12 +2347,20 @@ export const allocationBillDetail = () => {
{ {
"id": "0201", "id": "0201",
"material_code": "btAAAAW8Wd5QCrde", "material_code": "btAAAAW8Wd5QCrde",
"qty": "1" "sl": "1",
"dcckbm": '100',
"dcckmc": 'aaa',
"drckbm": '200',
"drckmc": 'bbb'
}, },
{ {
"id": "0202", "id": "0202",
"material_code": "btAAAAW8WdpQCrde", "material_code": "btAAAAW8WdpQCrde",
"qty": "1" "sl": "1",
"dcckbm": '100',
"dcckmc": 'aaa',
"drckbm": '200',
"drckmc": 'bbb'
} }
], ],
"code": 1, "code": 1,