|
|
|
@ -235,7 +235,7 @@
|
|
|
|
|
<el-form-item label="调查经过"> |
|
|
|
|
<el-input |
|
|
|
|
:disabled="RouterState == 'Kfend'" |
|
|
|
|
v-model="Indexform.investigationPocess" |
|
|
|
|
v-model="Indexform.investigationProcess" |
|
|
|
|
placeholder="请输入调查经过" |
|
|
|
|
clearable |
|
|
|
|
:rows="2" |
|
|
|
@ -251,7 +251,7 @@
|
|
|
|
|
<el-form-item class="investigate" label="调查经过"> |
|
|
|
|
<el-input |
|
|
|
|
:disabled="RouterState == 'Kfend'" |
|
|
|
|
v-model="Indexform.investigationPocess" |
|
|
|
|
v-model="Indexform.investigationProcess" |
|
|
|
|
placeholder="请输入调查经过" |
|
|
|
|
clearable |
|
|
|
|
:rows="2" |
|
|
|
@ -444,8 +444,8 @@
|
|
|
|
|
<span>完结信息</span> |
|
|
|
|
</span> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<div class="el-ckbtn" v-if="RouterState != 'Infoedit'"> |
|
|
|
|
<!-- v-if="RouterState != 'Infoedit'" --> |
|
|
|
|
<div class="el-ckbtn"> |
|
|
|
|
<el-button type="primary" @click="AddCompensation">添加赔款方</el-button> |
|
|
|
|
<el-button type="primary" @click="AddPayee">添加收款方</el-button> |
|
|
|
|
</div> |
|
|
|
@ -460,41 +460,29 @@
|
|
|
|
|
<div class="el_pkLi"> |
|
|
|
|
<div class="sk_input"> |
|
|
|
|
<el-input |
|
|
|
|
:disabled="RouterState == 'Infoedit'" |
|
|
|
|
v-model="item.name" |
|
|
|
|
:placeholder="item.state == 0 ? '请填写赔款方' : '请填写收款方'" |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
<div class="sk_input"> |
|
|
|
|
<el-input |
|
|
|
|
v-model="item.reason" |
|
|
|
|
:disabled="RouterState == 'Infoedit'" |
|
|
|
|
placeholder="请填写原因" |
|
|
|
|
/> |
|
|
|
|
<el-input v-model="item.reason" placeholder="请填写原因" /> |
|
|
|
|
</div> |
|
|
|
|
<div class="sk_input"> |
|
|
|
|
<el-input |
|
|
|
|
@input="amountMoney" |
|
|
|
|
:disabled="RouterState == 'Infoedit'" |
|
|
|
|
:min="0" |
|
|
|
|
v-model="item.num" |
|
|
|
|
placeholder="金额" |
|
|
|
|
/> |
|
|
|
|
<el-input @input="amountMoney" :min="0" v-model="item.num" placeholder="金额" /> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<!-- :disabled="RouterState == 'Infoedit'" --> |
|
|
|
|
<div class="sk_input" v-if="item.state == 0"> |
|
|
|
|
<el-input |
|
|
|
|
v-model="item.explains" |
|
|
|
|
:disabled="RouterState == 'Infoedit'" |
|
|
|
|
placeholder="请填写说明" |
|
|
|
|
/> |
|
|
|
|
<el-input v-model="item.explains" placeholder="请填写说明" /> |
|
|
|
|
</div> |
|
|
|
|
<div class="sk_input" v-if="item.state == 1"> |
|
|
|
|
<!-- <el-input v-model="item.explain" placeholder="请填写说明" /> --> |
|
|
|
|
</div> |
|
|
|
|
<div class="el_cwBtn" v-if="RouterState != 'Infoedit'"> |
|
|
|
|
<!-- v-if="RouterState != 'Infoedit'" --> |
|
|
|
|
<div class="el_cwBtn"> |
|
|
|
|
<el-button type="primary" @click="payremove(item.state, index, item)"> |
|
|
|
|
移除 |
|
|
|
|
</el-button> |
|
|
|
|
<el-button type="primary" v-if="item.state == 0"> 财务处理 </el-button> |
|
|
|
|
<el-button type="primary" @click="payremove(item.state, index)"> 移除 </el-button> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
@ -675,6 +663,7 @@ import {
|
|
|
|
|
import { ref, reactive, toRefs, computed, onMounted, nextTick } from 'vue'; |
|
|
|
|
import { getToken } from '@/utils/auth'; |
|
|
|
|
import { computeNumber, isNumer } from '@/utils/util'; |
|
|
|
|
import error from '@/error'; |
|
|
|
|
const $router = useRouter(); |
|
|
|
|
const $route = useRoute(); |
|
|
|
|
const TotalamountCompensation = ref(0); //赔款金额合计 |
|
|
|
@ -724,6 +713,21 @@ const NewImageAddress = ref([]); //旧的片地址
|
|
|
|
|
const InitialresponsibleParty = ref(); //初始的责任方 |
|
|
|
|
const ProcessingParty = ref(); //拷贝一份处理方 |
|
|
|
|
const CopyingInfo = ref({}); //拷贝的信息 |
|
|
|
|
const ProcessingpartyData = ref([]); //处理方拷贝的信息 |
|
|
|
|
const ResponsiblepartyData = ref([]); //责任方拷贝的信息 |
|
|
|
|
const completionRecipientEntityListData = ref([]); //收款方拷贝 |
|
|
|
|
const completionRecordEntitiesData = ref([]); //赔款方拷贝 |
|
|
|
|
const UncompletionRecipientEntityListData = ref([]); //收款取消的 |
|
|
|
|
const UncompletionRecordEntitiesDat = ref([]); //赔款取消的 |
|
|
|
|
const CompletionInformation = ref([]); //完结信息收赔款信息 |
|
|
|
|
const formData = ref({}); // 存储修改过的数据 |
|
|
|
|
// ref 用于跟踪哪些字段被修改过 |
|
|
|
|
// 当字段改变时标记它为已修改 |
|
|
|
|
|
|
|
|
|
const modifiedFields = ref(new Set()); |
|
|
|
|
const markFieldAsModified = fieldName => { |
|
|
|
|
modifiedFields.value.add(fieldName); |
|
|
|
|
}; |
|
|
|
|
const CompensationParty = ref([ |
|
|
|
|
{ name: '', state: 0, num: null, reason: '', cld: 1, explains: '' }, //赔款方 |
|
|
|
|
{ name: '', state: 1, num: null, reason: '', cld: 1, explains: '' }, //收款方 |
|
|
|
@ -865,6 +869,7 @@ const onLoad = () => {
|
|
|
|
|
console.log(oldData.value, '旧数据'); |
|
|
|
|
console.log(res, '回显返回值参数'); |
|
|
|
|
Indexform.value = res.data.data; |
|
|
|
|
formData.value = JSON.parse(JSON.stringify(Indexform.value)); |
|
|
|
|
Indexform.value.result = []; |
|
|
|
|
Indexform.value.processor = []; |
|
|
|
|
Indexform.value.packageImage = []; |
|
|
|
@ -873,17 +878,18 @@ const onLoad = () => {
|
|
|
|
|
Indexform.value['packageImage'].push({ |
|
|
|
|
name: res.imageName, |
|
|
|
|
url: res.imagePath, |
|
|
|
|
id: res.id, |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
// 拷贝基础信息 |
|
|
|
|
CopyingInfo.value.deliveryDriver = res.data.data.deliveryDriver; //配送司机 |
|
|
|
|
CopyingInfo.value.deliveryTime = res.data.data.deliveryTime; //配送时间 |
|
|
|
|
CopyingInfo.value.warehousingTime = res.data.data.warehousingTime; //入库时间 |
|
|
|
|
CopyingInfo.value.waybillMall = res.data.data.waybillMall; //运单商场 |
|
|
|
|
CopyingInfo.value.trainNumber = res.data.data.trainNumber; //车次号 |
|
|
|
|
CopyingInfo.value.first = res.data.data.first; //一级品 |
|
|
|
|
CopyingInfo.value.secondary = res.data.data.secondary; //二级品 |
|
|
|
|
CopyingInfo.value.problemDescription = res.data.data.problemDescription; //异常问题描述 |
|
|
|
|
// CopyingInfo.value.deliveryDriver = res.data.data.deliveryDriver; //配送司机 |
|
|
|
|
// CopyingInfo.value.deliveryTime = res.data.data.deliveryTime; //配送时间 |
|
|
|
|
// CopyingInfo.value.warehousingTime = res.data.data.warehousingTime; //入库时间 |
|
|
|
|
// CopyingInfo.value.waybillMall = res.data.data.waybillMall; //运单商场 |
|
|
|
|
// CopyingInfo.value.trainNumber = res.data.data.trainNumber; //车次号 |
|
|
|
|
// CopyingInfo.value.first = res.data.data.first; //一级品 |
|
|
|
|
// CopyingInfo.value.secondary = res.data.data.secondary; //二级品 |
|
|
|
|
// CopyingInfo.value.problemDescription = res.data.data.problemDescription; //异常问题描述 |
|
|
|
|
NewImageAddress.value = JSON.parse(JSON.stringify(Indexform.value['packageImage'])); //拷贝一份固定数据 |
|
|
|
|
// 包件回显 |
|
|
|
|
PackageInfo.value = res.data.data.abnormalPackageVOList; |
|
|
|
@ -900,6 +906,7 @@ const onLoad = () => {
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
FangAddList.value = res.data.data.personResponsibleVOS.map(res => { |
|
|
|
|
ResponsiblepartyData.value.push(res); |
|
|
|
|
return { |
|
|
|
|
businessName: res.businessId, //责任人ID |
|
|
|
|
personResponsibleName: res.personResponsibleName, //责任人名称 |
|
|
|
@ -912,9 +919,11 @@ const onLoad = () => {
|
|
|
|
|
res.data.data.processorVOList.forEach(item => { |
|
|
|
|
if (item.typesOf == 2) { |
|
|
|
|
// 处理方 |
|
|
|
|
ProcessingpartyData.value.push(item); //处理方拷贝为了取消的时候获取到ID |
|
|
|
|
Indexform.value.processor.push(item.businessId); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
ProcessingParty.value = JSON.parse(JSON.stringify(Indexform.value.processor)); //拷贝一份处理方 |
|
|
|
|
console.log(ProcessingParty.value, '拷贝的处理方'); |
|
|
|
|
console.log(Indexform.value.processor, ' Indexform.value.processor'); |
|
|
|
@ -973,10 +982,23 @@ const onLoad = () => {
|
|
|
|
|
) { |
|
|
|
|
// 如果收款方和赔款方存在数据清空初始数据 |
|
|
|
|
CompensationParty.value = []; |
|
|
|
|
|
|
|
|
|
// 赔款方 |
|
|
|
|
if (res.data.data.completionRecordEntities.length) { |
|
|
|
|
completionRecordEntitiesData.value = JSON.parse( |
|
|
|
|
JSON.stringify(res.data.data.completionRecordEntities) |
|
|
|
|
); //赔款方拷贝 |
|
|
|
|
res.data.data.completionRecordEntities.forEach((item, index) => { |
|
|
|
|
CompletionInformation.value.push({ |
|
|
|
|
//把赔款方信息添加到数组中 |
|
|
|
|
state: 0, //状态 |
|
|
|
|
num: item.money, //金额 |
|
|
|
|
name: item.indemnitor, //收款方名字 |
|
|
|
|
reason: item.reason, //收款方原因 |
|
|
|
|
explains: item.explains, //收款方说明 |
|
|
|
|
cld: index + 1, |
|
|
|
|
id: item.id, //赔款方id |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
TotalamountCompensation.value += Number(item.money); |
|
|
|
|
CompensationParty.value.push({ |
|
|
|
|
state: 0, //状态 |
|
|
|
@ -985,13 +1007,29 @@ const onLoad = () => {
|
|
|
|
|
reason: item.reason, //收款方原因 |
|
|
|
|
explains: item.explains, //收款方说明 |
|
|
|
|
cld: index + 1, |
|
|
|
|
id: item.id, //赔款方id |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 收款方 |
|
|
|
|
if (res.data.data.completionRecipientEntityList.length) { |
|
|
|
|
completionRecipientEntityListData.value = JSON.parse( |
|
|
|
|
JSON.stringify(res.data.data.completionRecipientEntityList) |
|
|
|
|
); //拷贝收款方 |
|
|
|
|
|
|
|
|
|
res.data.data.completionRecipientEntityList.forEach((item, index) => { |
|
|
|
|
CompletionInformation.value.push({ |
|
|
|
|
//把收款方信息添加到数组中 |
|
|
|
|
state: 1, //状态 |
|
|
|
|
num: item.money, //金额 |
|
|
|
|
name: item.recipient, //收款方名字 |
|
|
|
|
reason: item.reasonReceivingPayment, //收款方原因 |
|
|
|
|
explains: item.explains, //收款方说明 |
|
|
|
|
cld: index + 1, |
|
|
|
|
id: item.id, //收款方id |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
TotalamountReceived.value += Number(item.money); |
|
|
|
|
CompensationParty.value.push({ |
|
|
|
|
state: 1, //状态 |
|
|
|
@ -1000,6 +1038,7 @@ const onLoad = () => {
|
|
|
|
|
reason: item.reasonReceivingPayment, //收款方原因 |
|
|
|
|
explains: item.explains, //收款方说明 |
|
|
|
|
cld: index + 1, |
|
|
|
|
id: item.id, //收款方id |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
@ -1230,7 +1269,17 @@ const amountMoney = () => {
|
|
|
|
|
console.log('收款总计金额', TotalamountReceived.value); |
|
|
|
|
}; |
|
|
|
|
// 移除按钮 |
|
|
|
|
const payremove = (state, val) => { |
|
|
|
|
const payremove = (state, val, data) => { |
|
|
|
|
console.log(state, '当前移除按钮的状态'); |
|
|
|
|
// const completionRecipientEntityListData=ref([]);//收款方拷贝 |
|
|
|
|
// const completionRecordEntitiesData=ref([]);//赔款方拷贝 |
|
|
|
|
if (state == 0) { |
|
|
|
|
UncompletionRecordEntitiesDat.value.push(data); //删除的赔款方 |
|
|
|
|
} else { |
|
|
|
|
UncompletionRecipientEntityListData.value.push(data); //删除的收款方 |
|
|
|
|
console.log(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 判断赔付方,至少保留一条数据 |
|
|
|
|
let som = 0; |
|
|
|
|
if (state == 0) { |
|
|
|
@ -1272,6 +1321,8 @@ function removeEmptyProperties(obj) {
|
|
|
|
|
|
|
|
|
|
//表单提交 |
|
|
|
|
const ConfirmForm = () => { |
|
|
|
|
console.log(ProcessingpartyData.value, '处理方信息'); |
|
|
|
|
|
|
|
|
|
// console.log(oldData.value,'查看老数据'); |
|
|
|
|
// ...Indexform.value |
|
|
|
|
let DataSubmit = { |
|
|
|
@ -1287,6 +1338,8 @@ const ConfirmForm = () => {
|
|
|
|
|
personResponsibleDTO: [], //添加预计责任人(完成) |
|
|
|
|
unPersonResponsibleDTO: [], //取消预计责任人(完成) |
|
|
|
|
surveyRecordDTO: {}, //调查经过 |
|
|
|
|
unCompletionRecipientEntities: [], //取消异常工单完结处理结果收款方 |
|
|
|
|
unCompletionRecordEntities: [], //取消异常工单完结的赔款方 |
|
|
|
|
}; |
|
|
|
|
DataSubmit.id = $route.query.id; //任务 |
|
|
|
|
|
|
|
|
@ -1295,13 +1348,13 @@ const ConfirmForm = () => {
|
|
|
|
|
); //修改过的包件信息 |
|
|
|
|
|
|
|
|
|
// 调查经过 |
|
|
|
|
if (Indexform.value.investigationPocess) { |
|
|
|
|
DataSubmit.surveyRecordDTO = { |
|
|
|
|
content: Indexform.value.investigationPocess, //内容' |
|
|
|
|
workOrderId: $route.query.id, //工单ID |
|
|
|
|
// pictureUrl: KFfeel.value.join(','), //附件路径 |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
// if (Indexform.value.investigationProcess) { |
|
|
|
|
// DataSubmit.surveyRecordDTO = { |
|
|
|
|
// content: Indexform.value.investigationProcess, //内容' |
|
|
|
|
// workOrderId: $route.query.id, //工单ID |
|
|
|
|
// // pictureUrl: KFfeel.value.join(','), //附件路径 |
|
|
|
|
// }; |
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
if (Modified.length) { |
|
|
|
|
// 如果有修改过包件信息执行 |
|
|
|
@ -1341,11 +1394,7 @@ const ConfirmForm = () => {
|
|
|
|
|
if (SelectType.value == '1' || SelectType.value == '3') { |
|
|
|
|
if (unDecreaseImageEntityList.value.length) { |
|
|
|
|
unDecreaseImageEntityList.value.forEach(item => { |
|
|
|
|
DataSubmit['unDecreaseImageEntityList'].push({ |
|
|
|
|
imageType: SelectType.value == '1' ? 10 : SelectType.value == '3' ? 20 : '', |
|
|
|
|
imageName: item.name, |
|
|
|
|
imagePath: item.url, |
|
|
|
|
}); |
|
|
|
|
DataSubmit['unDecreaseImageEntityList'].push(item.id); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -1373,7 +1422,7 @@ const ConfirmForm = () => {
|
|
|
|
|
console.log(modifyresponsibility, '发送改变的责任方'); |
|
|
|
|
modifyresponsibility.forEach(item => { |
|
|
|
|
DataSubmit['personResponsibleDTO'].push({ |
|
|
|
|
wordOrderId: Indexform.value.workOrderNumber, //工单异常ID |
|
|
|
|
wordOrderId: $route.query.id, //工单异常ID |
|
|
|
|
personResponsibleId: |
|
|
|
|
personResponsibleList.value.find(obj => obj.id == item.personResponsibleName)?.id || null, //责任人ID |
|
|
|
|
personResponsibleName: |
|
|
|
@ -1384,22 +1433,15 @@ const ConfirmForm = () => {
|
|
|
|
|
description: item.description, //说明 |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
// 被移除的责任方处理 |
|
|
|
|
if (unProcessorEntityList.value.length) { |
|
|
|
|
console.log(ResponsiblepartyData.value, '初始值责任方'); |
|
|
|
|
unProcessorEntityList.value.forEach(item => { |
|
|
|
|
DataSubmit['unPersonResponsibleDTO'].push({ |
|
|
|
|
wordOrderId: Indexform.value.workOrderNumber, //工单异常ID |
|
|
|
|
personResponsibleId: |
|
|
|
|
personResponsibleList.value.find(obj => obj.id == item.personResponsibleName)?.id || null, //责任人ID |
|
|
|
|
personResponsibleName: |
|
|
|
|
personResponsibleList.value.find(obj => obj.id == item.personResponsibleName)?.name || |
|
|
|
|
null, //责任人名称 |
|
|
|
|
businessId: warehouseData.value.find(obj => obj.value == item.businessName)?.value || null, //责任方ID |
|
|
|
|
businessName: |
|
|
|
|
warehouseData.value.find(obj => obj.value == item.businessName)?.label || null, //责任方名称//责任方名称 |
|
|
|
|
responsibilityRatio: item.responsibilityRatio, //责任比例 |
|
|
|
|
description: item.description, //说明 |
|
|
|
|
}); |
|
|
|
|
console.log(item, '循环要被删除的责任方'); |
|
|
|
|
DataSubmit['unPersonResponsibleDTO'].push( |
|
|
|
|
ResponsiblepartyData.value.find(obj => obj.businessId == item.businessName).id |
|
|
|
|
); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1427,11 +1469,10 @@ const ConfirmForm = () => {
|
|
|
|
|
}); |
|
|
|
|
// 新增处理方要携带调查经过 |
|
|
|
|
DataSubmit.surveyRecordDTO = { |
|
|
|
|
content: Indexform.value.investigationPocess, //内容' |
|
|
|
|
content: Indexform.value.investigationProcess, //内容' |
|
|
|
|
workOrderId: $route.query.id, //工单ID |
|
|
|
|
// pictureUrl: KFfeel.value.join(','), //附件路径 |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 删除的 |
|
|
|
@ -1440,104 +1481,154 @@ const ConfirmForm = () => {
|
|
|
|
|
); |
|
|
|
|
console.log(processornremove, '被删除的处理方'); |
|
|
|
|
if (processornremove.length) { |
|
|
|
|
console.log(ProcessingpartyData.value, '准备处理的数据'); |
|
|
|
|
processornremove.forEach(item => { |
|
|
|
|
DataSubmit['unProcessorEntityList'].push({ |
|
|
|
|
businessName: warehouseData.value.find(obj => obj.value == item).label, //名称 |
|
|
|
|
businessId: warehouseData.value.find(obj => obj.value == item).value, //ID |
|
|
|
|
workOrderId: $route.query.id, //异常工单ID |
|
|
|
|
conditions: 2, //状态 1正常 2新增 3取消 |
|
|
|
|
typesOf: 2, //1 责任方 2 处理方 |
|
|
|
|
warehouseId: $route.query.warehouseId, //仓库ID |
|
|
|
|
processingStatus: $route.query.ProcessType, //处理状态 类型 1 待处理 2 已处理 |
|
|
|
|
}); |
|
|
|
|
let ids = warehouseData.value.find(obj => obj.value == item).value; |
|
|
|
|
DataSubmit['unProcessorEntityList'].push( |
|
|
|
|
ProcessingpartyData.value.find(obj => obj.businessId == ids).id |
|
|
|
|
); //ID); |
|
|
|
|
}); |
|
|
|
|
// 新增处理方要携带调查经过 |
|
|
|
|
DataSubmit.surveyRecordDTO = { |
|
|
|
|
content: Indexform.value.investigationPocess, //内容' |
|
|
|
|
workOrderId: $route.query.id, //工单ID |
|
|
|
|
// pictureUrl: KFfeel.value.join(','), //附件路径 |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// ProcessingParty.value = JSON.parse(JSON.stringify(Indexform.value.processor)); //拷贝一份处理方 |
|
|
|
|
|
|
|
|
|
// // 完结信息修改 |
|
|
|
|
// console.log(CompensationParty.value); |
|
|
|
|
// // 异常工单完结赔款方 |
|
|
|
|
// DataSubmit['completionRecordEntities'] = CompensationParty.value |
|
|
|
|
// .filter(item => item.state === 0) // 先筛选出状态为 0 的项 |
|
|
|
|
// .map(item => { |
|
|
|
|
// return { |
|
|
|
|
// indemnitor: item.name, // 赔款方 |
|
|
|
|
// reason: item.reason, // 原因 |
|
|
|
|
// money: Number(item.num), // 金额 |
|
|
|
|
// reasonArbitration: item.reason, // 说明 |
|
|
|
|
// workOrderId: $route.query.id, // 异常工单 |
|
|
|
|
// warehouseId: $route.query.warehouseId, // 仓库ID |
|
|
|
|
// }; |
|
|
|
|
// }); |
|
|
|
|
// // 异常工单完结收款方 |
|
|
|
|
// DataSubmit['completionRecipientEntities'] = CompensationParty.value |
|
|
|
|
// .filter(item => item.state === 1) // 先筛选出状态为 1 的项 |
|
|
|
|
// .map(item => { |
|
|
|
|
// return { |
|
|
|
|
// recipient: item.name, // 收款方 |
|
|
|
|
// reasonReceivingPayment: item.reason, // 原因 |
|
|
|
|
// money: Number(item.num), // 金额 |
|
|
|
|
// workOrderNumber: $route.query.workOrderNumber, // 工单号 |
|
|
|
|
// responsibleParty: FangAddList.value |
|
|
|
|
// .map(aItem => |
|
|
|
|
// warehouseData.value |
|
|
|
|
// .filter(bItem => bItem.value === aItem.businessName) |
|
|
|
|
// .map(match => match.label) |
|
|
|
|
// .join(',') |
|
|
|
|
// ) |
|
|
|
|
// .join(','), |
|
|
|
|
// warehouseId: $route.query.warehouseId, // 仓库ID |
|
|
|
|
// workOrderId: $route.query.id, //异常工单 |
|
|
|
|
// }; |
|
|
|
|
// }); |
|
|
|
|
|
|
|
|
|
// // 支付方式 |
|
|
|
|
// DataSubmit.aftersalesProcessingResultsDTO['compensationMethod'] = ProcessingList.value |
|
|
|
|
// .map(item => item.text) |
|
|
|
|
// .join(','); |
|
|
|
|
|
|
|
|
|
// DataSubmit.aftersalesProcessingResultsDTO['processingMoneyEntityList'] = ProcessingList.value |
|
|
|
|
// .map(item => { |
|
|
|
|
// console.log(item); |
|
|
|
|
// let match = ProcessingResults.value.find(element => element.dictValue == item.name); |
|
|
|
|
// if (match) { |
|
|
|
|
// let paymentMethodMatch = Paymentmethod.value.find( |
|
|
|
|
// paymentMethod => paymentMethod.dictKey == item.payment |
|
|
|
|
// ); |
|
|
|
|
// return { |
|
|
|
|
// resultType: match.dictKey, //赔方式的key |
|
|
|
|
// money: item.input, //金额 |
|
|
|
|
// typesOf: 1, //固定参数 |
|
|
|
|
// compensationMethod: paymentMethodMatch ? paymentMethodMatch.dictKey : '未知支付方式', |
|
|
|
|
// compensationMethodName: paymentMethodMatch |
|
|
|
|
// ? paymentMethodMatch.dictValue |
|
|
|
|
// : '未知支付方式', |
|
|
|
|
// resultName: item.name, //处理结果名字 |
|
|
|
|
// }; |
|
|
|
|
// } else { |
|
|
|
|
// return null; |
|
|
|
|
// } |
|
|
|
|
// }) |
|
|
|
|
// .filter(item => item !== null); |
|
|
|
|
console.log(CompensationParty.value); |
|
|
|
|
// 异常工单完结赔款方 |
|
|
|
|
|
|
|
|
|
// unCompletionRecipientEntities: [], //取消异常工单完结处理结果收款方 |
|
|
|
|
// unCompletionRecordEntities:[],//取消异常工单完结的赔款方 |
|
|
|
|
|
|
|
|
|
// completionRecordEntitiesData.value; //赔款 |
|
|
|
|
// completionRecipientEntityListData.value; //收款 |
|
|
|
|
|
|
|
|
|
if (UncompletionRecipientEntityListData.value.length) { |
|
|
|
|
// 如果有取消的完结收款执行 |
|
|
|
|
console.log(completionRecipientEntityListData.value, '完结收款'); |
|
|
|
|
// 完结收款取消的收款 |
|
|
|
|
UncompletionRecipientEntityListData.value.forEach(item => { |
|
|
|
|
console.log(item, '完结取消的收款方'); |
|
|
|
|
DataSubmit['unCompletionRecipientEntities'].push( |
|
|
|
|
completionRecipientEntityListData.value.find(obj => obj.id == item.id).id |
|
|
|
|
); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (UncompletionRecordEntitiesDat.value.length) { |
|
|
|
|
// 完结收款取消的赔款 |
|
|
|
|
console.log(completionRecordEntitiesData.value, '完结赔款'); |
|
|
|
|
UncompletionRecordEntitiesDat.value.forEach(item => { |
|
|
|
|
console.log(item, '完结取消的赔款方'); |
|
|
|
|
DataSubmit['unCompletionRecordEntities'].push( |
|
|
|
|
completionRecordEntitiesData.value.find(obj => obj.id == item.id).id |
|
|
|
|
); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// completionRecordEntitiesData.value; //赔款方 |
|
|
|
|
// completionRecipientEntityListData.value;//收款方 |
|
|
|
|
|
|
|
|
|
// 这里处理新增的赔款方和收款方 |
|
|
|
|
|
|
|
|
|
let CompletedModificationsData = CompensationParty.value.filter(itemB => { |
|
|
|
|
return !CompletionInformation.value.some(itemA => { |
|
|
|
|
return itemB.name === itemA.name; |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
console.log(CompletedModificationsData, '新增或者修改的数据'); |
|
|
|
|
console.log(CompletionInformation.value, '完结收款赔款累计信息'); |
|
|
|
|
|
|
|
|
|
// 有新增或者有修改的完结收赔款信息 |
|
|
|
|
if (CompletedModificationsData.length) { |
|
|
|
|
CompletedModificationsData.forEach(item => { |
|
|
|
|
if (item.state == 0) { |
|
|
|
|
// 赔款方 |
|
|
|
|
DataSubmit['completionRecordEntities'].push({ |
|
|
|
|
indemnitor: item.name, // 赔款方 |
|
|
|
|
reason: item.reason, // 原因 |
|
|
|
|
money: Number(item.num), // 金额 |
|
|
|
|
reasonArbitration: item.reason, // 说明 |
|
|
|
|
workOrderId: $route.query.id, // 异常工单 |
|
|
|
|
warehouseId: $route.query.warehouseId, // 仓库ID |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
DataSubmit['completionRecipientEntities'].push({ |
|
|
|
|
recipient: item.name, // 收款方 |
|
|
|
|
reasonReceivingPayment: item.reason, // 原因 |
|
|
|
|
money: Number(item.num), // 金额 |
|
|
|
|
workOrderNumber: $route.query.workOrderNumber, // 工单号 |
|
|
|
|
responsibleParty: FangAddList.value |
|
|
|
|
.map(aItem => |
|
|
|
|
warehouseData.value |
|
|
|
|
.filter(bItem => bItem.value === aItem.businessName) |
|
|
|
|
.map(match => match.label) |
|
|
|
|
.join(',') |
|
|
|
|
) |
|
|
|
|
.join(','), |
|
|
|
|
warehouseId: $route.query.warehouseId, // 仓库ID |
|
|
|
|
workOrderId: $route.query.id, //异常工单 |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 支付方式 |
|
|
|
|
DataSubmit.aftersalesProcessingResultsDTO['compensationMethod'] = ProcessingList.value |
|
|
|
|
.map(item => item.text) |
|
|
|
|
.join(','); |
|
|
|
|
|
|
|
|
|
DataSubmit.aftersalesProcessingResultsDTO['processingMoneyEntityList'] = ProcessingList.value |
|
|
|
|
.map(item => { |
|
|
|
|
console.log(item); |
|
|
|
|
let match = ProcessingResults.value.find(element => element.dictValue == item.name); |
|
|
|
|
if (match) { |
|
|
|
|
let paymentMethodMatch = Paymentmethod.value.find( |
|
|
|
|
paymentMethod => paymentMethod.dictKey == item.payment |
|
|
|
|
); |
|
|
|
|
return { |
|
|
|
|
resultType: match.dictKey, //赔方式的key |
|
|
|
|
money: item.input, //金额 |
|
|
|
|
typesOf: 1, //固定参数 |
|
|
|
|
compensationMethod: paymentMethodMatch ? paymentMethodMatch.dictKey : '未知支付方式', |
|
|
|
|
compensationMethodName: paymentMethodMatch |
|
|
|
|
? paymentMethodMatch.dictValue |
|
|
|
|
: '未知支付方式', |
|
|
|
|
resultName: item.name, //处理结果名字 |
|
|
|
|
}; |
|
|
|
|
} else { |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
.filter(item => item !== null); |
|
|
|
|
|
|
|
|
|
//移除的货损图片 |
|
|
|
|
DataSubmit = removeEmptyProperties(DataSubmit); |
|
|
|
|
console.log(DataSubmit, '处理好的数据'); |
|
|
|
|
$_modifyData(DataSubmit).then(res => { |
|
|
|
|
console.log(res, '编辑成功返回值'); |
|
|
|
|
// if (res.data.code == 200) { |
|
|
|
|
// ElMessage({ |
|
|
|
|
// message: res.data.msg, |
|
|
|
|
// type: 'success', |
|
|
|
|
// }); |
|
|
|
|
// } |
|
|
|
|
}); |
|
|
|
|
$_modifyData(DataSubmit) |
|
|
|
|
.then(res => { |
|
|
|
|
console.log(res, '编辑成功返回值'); |
|
|
|
|
ElMessage({ |
|
|
|
|
message: res.data.msg, |
|
|
|
|
type: 'success', |
|
|
|
|
}); |
|
|
|
|
$router.push({ |
|
|
|
|
path: '/aftersales/aftersalesWorkOrderInfo', |
|
|
|
|
query: { |
|
|
|
|
id: $route.query.id, |
|
|
|
|
name: $route.query.workOrderNumber + '-信息查看', |
|
|
|
|
warehouseId: $route.query.warehouseId, |
|
|
|
|
workOrderNumber: $route.query.workOrderNumber, //添加异常记录包条码 |
|
|
|
|
businessId: $route.query.businessId, |
|
|
|
|
ProcessType: $route.query.ProcessType, |
|
|
|
|
}, |
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
.catch(error => { |
|
|
|
|
ElMessage({ |
|
|
|
|
message: res.data.msg, |
|
|
|
|
type: 'success', |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
// 客服仲裁完结 |
|
|
|
|