|
|
@ -652,7 +652,7 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 点击 服务项目
|
|
|
|
// 点击 服务项目
|
|
|
|
function saveService(data) {
|
|
|
|
function saveService(data, flag) {
|
|
|
|
if (!props.id) {
|
|
|
|
if (!props.id) {
|
|
|
|
createMessage.warning('请先保存主单')
|
|
|
|
createMessage.warning('请先保存主单')
|
|
|
|
return false
|
|
|
|
return false
|
|
|
@ -662,12 +662,23 @@
|
|
|
|
projectCodes: [data.projectCode],
|
|
|
|
projectCodes: [data.projectCode],
|
|
|
|
opertType: 0,
|
|
|
|
opertType: 0,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (flag) obj.projectCodes = data.projectCode
|
|
|
|
if (!data.isYield) {
|
|
|
|
if (!data.isYield) {
|
|
|
|
|
|
|
|
if (flag) {
|
|
|
|
|
|
|
|
bookingServiceItem.value.forEach((item) => {
|
|
|
|
|
|
|
|
data.projectCode.forEach(o => {
|
|
|
|
|
|
|
|
if (item.projectCode == o) {
|
|
|
|
|
|
|
|
item.isYield = !item.isYield
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
} else {
|
|
|
|
bookingServiceItem.value.forEach((item) => {
|
|
|
|
bookingServiceItem.value.forEach((item) => {
|
|
|
|
if (item.projectCode == data.projectCode) {
|
|
|
|
if (item.projectCode == data.projectCode) {
|
|
|
|
item.isYield = !item.isYield
|
|
|
|
item.isYield = !item.isYield
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
seriveLoading.value = true
|
|
|
|
seriveLoading.value = true
|
|
|
|
SaveServiceProject(obj).then((res) => {
|
|
|
|
SaveServiceProject(obj).then((res) => {
|
|
|
|
seriveLoading.value = false
|
|
|
|
seriveLoading.value = false
|
|
|
@ -686,12 +697,18 @@
|
|
|
|
}).catch(() => {
|
|
|
|
}).catch(() => {
|
|
|
|
seriveLoading.value = false
|
|
|
|
seriveLoading.value = false
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
if (flag) {
|
|
|
|
|
|
|
|
bookingServiceItem.value.forEach((item) => {
|
|
|
|
|
|
|
|
item.isYield = false
|
|
|
|
|
|
|
|
})
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
bookingServiceItem.value.forEach((item) => {
|
|
|
|
bookingServiceItem.value.forEach((item) => {
|
|
|
|
if (item.projectCode == data.projectCode) {
|
|
|
|
if (item.projectCode == data.projectCode) {
|
|
|
|
item.isYield = !item.isYield
|
|
|
|
item.isYield = !item.isYield
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
seriveLoading.value = true
|
|
|
|
seriveLoading.value = true
|
|
|
|
CancelServiceProject(obj).then((res) => {
|
|
|
|
CancelServiceProject(obj).then((res) => {
|
|
|
|
seriveLoading.value = false
|
|
|
|
seriveLoading.value = false
|
|
|
@ -1000,8 +1017,22 @@
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
onMounted(() => {
|
|
|
|
onMounted(() => {
|
|
|
|
emitter.on('customerBack', (v) => {
|
|
|
|
emitter.on('customerBack', async (v) => {
|
|
|
|
// if (v.serviceItem)
|
|
|
|
// 联动带出服务项目(先取消,在添加)
|
|
|
|
|
|
|
|
const pitem = bookingServiceItem.value.filter(item => {
|
|
|
|
|
|
|
|
return item.isYield
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
if (pitem.length == 0 && !v.serviceItem) return
|
|
|
|
|
|
|
|
const pcode = pitem.map(row => {
|
|
|
|
|
|
|
|
return row.projectCode
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
await saveService({ isYield: true, projectCode: pcode }, true)
|
|
|
|
|
|
|
|
if (v.serviceItem) {
|
|
|
|
|
|
|
|
const projectCode = v.serviceItem.split(',')
|
|
|
|
|
|
|
|
saveService({ isYield: false, projectCode }, true)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// saveService({ isYield: false, projectCode: [] })
|
|
|
|
|
|
|
|
// console.log(v.serviceItem)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
emitter.on('seaAddNotes', (v) => {
|
|
|
|
emitter.on('seaAddNotes', (v) => {
|
|
|
|
if (!props.id) return
|
|
|
|
if (!props.id) return
|
|
|
|