Commit 23fe8b07 by 张立顺

fix bug

1 parent 1e28171d
...@@ -282,12 +282,42 @@ Page({ ...@@ -282,12 +282,42 @@ Page({
delete item.confirmInfo delete item.confirmInfo
return item return item
}) })
let params = { let params = {
constructionInfoList: subOrderRelationList, constructionInfoList: subOrderRelationList,
orderCode, orderCode,
subOrderRelationList: copySubOrderRelationList subOrderRelationList: copySubOrderRelationList
} }
if (requesting) return false
let checkFlag = false
for (let index = 0; index < subOrderRelationList.length; index++) {
const item = subOrderRelationList[index]
// Check if the sub-order has associated products
if (!item.subOrderList.length) {
wx.$util.showToast(`施工单${index + 1}关联商品不能为空`)
checkFlag = true
break // Move to the next index
}
// Check if the sub-order has a main technician
if (!item.mainTechnicianList.length) {
wx.$util.showToast(`施工单${index + 1}主技师不能为空`)
checkFlag = true
break // Move to the next index
}
// Check if the sub-order has service items
if (!item.serviceItemsList.length) {
wx.$util.showToast(`施工单${index + 1}服务项不能为空`)
checkFlag = true
break // Move to the next index
}
}
console.log(params, 'params')
if (requesting || checkFlag) return false
this.setData({ this.setData({
requesting: true requesting: true
}) })
...@@ -353,7 +383,7 @@ Page({ ...@@ -353,7 +383,7 @@ Page({
if (goodsList.length > 0) { if (goodsList.length > 0) {
tabList.push('施工单' + (tabList.length + 1)) tabList.push('施工单' + (tabList.length + 1))
let obj = { let obj = {
servicesList: copyServicesList, servicesList: wx.$util.deepClone(copyServicesList),
mainSelected: [], mainSelected: [],
deputySelected: [] deputySelected: []
} }
...@@ -603,7 +633,8 @@ Page({ ...@@ -603,7 +633,8 @@ Page({
return return
} }
// 切换tab 重新赋值刷新数据 // 切换tab 重新赋值刷新数据
const currentTabIndex = e?.detail || 0 const currentTabIndex =
e?.detail !== undefined && e?.detail !== null ? e.detail : tabIndex
console.log(tabIndex, currentTabIndex, 'tabIndex') console.log(tabIndex, currentTabIndex, 'tabIndex')
subOrderRelationList[tabIndex] = wx.$util.deepClone({ subOrderRelationList[tabIndex] = wx.$util.deepClone({
...subOrderRelationList[tabIndex], ...subOrderRelationList[tabIndex],
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!