refactor: handle work name
This commit is contained in:
parent
0750d77b98
commit
90cbe69ba7
1 changed files with 39 additions and 1 deletions
|
|
@ -1236,6 +1236,38 @@ function getInvoice() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleWorkName() {
|
||||||
|
const validService = productService.value.find(
|
||||||
|
(item) => 'service' in item && item.service !== null,
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!validService || validService?.service === null) return;
|
||||||
|
|
||||||
|
const workName = validService?.service.name;
|
||||||
|
|
||||||
|
if (
|
||||||
|
!!quotationFormData.value.workName &&
|
||||||
|
!(quotationFormData.value.workName === workName)
|
||||||
|
) {
|
||||||
|
dialogCheckData({
|
||||||
|
action: () => {
|
||||||
|
quotationFormData.value.workName = workName;
|
||||||
|
},
|
||||||
|
checkData: () => {
|
||||||
|
return {
|
||||||
|
oldData: [
|
||||||
|
{ nameField: 'workName', value: quotationFormData.value.workName },
|
||||||
|
],
|
||||||
|
newData: [{ nameField: 'workName', value: workName }],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
cancel: () => {},
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
quotationFormData.value.workName = workName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
[
|
[
|
||||||
() => quotationFormState.value.statusFilterRequest,
|
() => quotationFormState.value.statusFilterRequest,
|
||||||
|
|
@ -1266,6 +1298,7 @@ async function formDownload() {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
{{ console.log(productService) }}
|
||||||
<ImportWorker
|
<ImportWorker
|
||||||
v-model:open="pageState.importWorker"
|
v-model:open="pageState.importWorker"
|
||||||
v-model:data="importWorkerCriteria"
|
v-model:data="importWorkerCriteria"
|
||||||
|
|
@ -2350,7 +2383,12 @@ async function formDownload() {
|
||||||
v-model:service-list="serviceList"
|
v-model:service-list="serviceList"
|
||||||
v-model:selected-product-group="selectedProductGroup"
|
v-model:selected-product-group="selectedProductGroup"
|
||||||
:agent-price="agentPrice"
|
:agent-price="agentPrice"
|
||||||
@submit="convertToTable"
|
@submit="
|
||||||
|
(node) => {
|
||||||
|
convertToTable(node);
|
||||||
|
handleWorkName();
|
||||||
|
}
|
||||||
|
"
|
||||||
@select-group="
|
@select-group="
|
||||||
async (id) => {
|
async (id) => {
|
||||||
await getAllService(id);
|
await getAllService(id);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue