Browse Source

工单新增添加处理结果

pre-production
马远东 1 year ago
parent
commit
cd5e99bb76
  1. 1
      src/views/aftersales/aftersalesWorkOrder.vue
  2. 330
      src/views/aftersales/aftersalesWorkOrderAdd.vue
  3. 1
      src/views/aftersales/aftersalesWorkOrderend.vue

1
src/views/aftersales/aftersalesWorkOrder.vue

@ -515,7 +515,6 @@ import { useRouter } from 'vue-router';
import dayjs from 'dayjs';
const $router = useRouter();
const $useStore = useStore();
const $route = useRoute();
/** vuex */
const accessControl = $useStore.getters.permission;

330
src/views/aftersales/aftersalesWorkOrderAdd.vue

@ -445,6 +445,72 @@
</el-tab-pane>
</el-tabs>
<el-tabs type="border-card">
<el-tab-pane label="处理结果">
<div class="selector">
<el-select
v-model="Indexform.result"
multiple
filterable
default-first-option
:reserve-keyword="false"
placeholder="请选择处理结果"
@change="changeProcessingResults"
>
<el-option
v-for="item in ProcessingResults"
:key="item.dictKey"
:label="item.dictValue"
:value="item.dictKey"
/>
</el-select>
</div>
<div class="ProcessingResults" v-if="ProcessingList.length">
<div class="title">处理结果-理赔金额</div>
<div class="Listadmiration">
<div class="name" v-for="(item, index) in ProcessingList" :key="index">
<span>{{ item.name }}:</span>
<div class="payment_right">
<el-input-number
v-model="item.input"
:min="item.min"
:max="item.max"
@change="TotalChange"
/>
<div class="Paymentname" @click="PaymentSelection(item)">
{{ item.payment ? item.text : '支付方式' }}
</div>
<el-date-picker
v-model="item.compensationTime"
type="datetime"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD HH:mm:ss"
placeholder="理赔支付时间"
/>
</div>
</div>
</div>
<div class="el_tool">
<span>总金额:{{ TotalClaimAmount }}</span>
</div>
<!-- <el-divider>
<span class="ZFname">理赔支付时间</span>
</el-divider>
<div class="lptime">
<el-date-picker
v-model="Indexform.compensationTime"
type="datetime"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD HH:mm:ss"
placeholder="请选择运理赔支付时间"
/>
</div> -->
</div>
</el-tab-pane>
</el-tabs>
<div class="Transport_damage_photos" v-if="SelectType == 1 || SelectType == 3 || StateType">
<span class="title">{{
SelectType == 1 ? '运损照片' : SelectType == 3 ? '窜货照片' : '照片'
@ -556,6 +622,28 @@
</span>
</template>
</el-dialog>
<!-- 支付方式选择 -->
<el-dialog v-model="ZFdialog" title="支付方式选择" width="45%" class="ZFfsLoad">
<el-radio-group v-model="Indexform.compensationMethod">
<el-radio
:label="item.dictKey"
v-for="item in Paymentmethod"
:key="item.dictKey"
size="large"
border
>{{ item.dictValue }}</el-radio
>
</el-radio-group>
<template #footer>
<span class="dialog-footer">
<el-button @click="ZFdialog = false">取消</el-button>
<el-button type="primary" @click="PaymentConfirmation(Indexform.compensationMethod)">
确定
</el-button>
</span>
</template>
</el-dialog>
</template>
<script setup>
@ -573,6 +661,7 @@ import {
$_getAbnormalPackage,
$_shippingInformation,
} from '@/api/aftersales/aftersalesWorkOrder';
import { computeNumber } from '@/utils/util';
import { ref, reactive, toRefs, computed, onMounted, nextTick } from 'vue';
import { getToken } from '@/utils/auth';
const $router = useRouter();
@ -581,7 +670,9 @@ const Indexform = ref({
packList: [],
decreaseImageEntityList: [], //
}); //
const ProcessingResults = ref([]); //
const IndexException = ref([]); //
const ZFname = ref(''); //
const DiscoveringNodes = ref([]); //
const warehouseData = ref([]); //
const SelectType = ref(null); //
@ -590,6 +681,7 @@ const HistoricalPackageinput = ref(''); //历史包件选择
const dialogImageUrl = ref(null); //
const dialogVisible = ref(null); //
const groundlineSet = ref(true); //线
const TotalClaimAmount = ref(0); //
const groundlineType = ref(null); //线
const ShortageState = ref(false); //
const fleeingState = ref(false); //
@ -599,6 +691,7 @@ const valueStrictly = ref();
const routerID = ref(null); //ID
const routerState = ref(''); //
const personResponsibleList = ref([]); //
const ZFdialog = ref(false); //
const companyProportion = ref(0); //
const identifying = ref(1); //
const dialogHistoricalPackage = ref(false); //
@ -608,6 +701,8 @@ const NumberPackages = ref(0); //包件个数
const dialogImgList = ref(false); //
const amplifyurl = ref(''); //
const amplifysrcList = ref([]); //
const ProcessingList = ref([]); //
const Paymentmethod = ref([]); //
const PackageInfo = ref([
//
{ packageCode: '', orderCode: '', waybillNumber: '', brandName: '' },
@ -725,8 +820,70 @@ const onLoad = () => {
updateDictionary(IndexException.value, 'pc_work_order'); //
updateDictionary(DiscoveringNodes.value, 'pc_discovery_node'); //
handle(); //
getDictionaryBiz('result_handling').then(res => {
console.log(res, '发现环节');
ProcessingResults.value = res.data.data;
});
//
getDictionaryBiz('payment_method').then(res => {
//
console.log(res);
Paymentmethod.value = res.data.data;
});
};
onLoad(); //
//
const changeProcessingResults = val => {
//
ProcessingList.value = ProcessingList.value.filter(item => val.includes(item.state - 1));
//
val.forEach(num => {
let newItem = {
input: 0,
min: 0,
max: 9999999999999,
state: num + 1,
payment: '',
text: '',
compensationTime: '',
};
// numnewItemname
switch (num) {
case '1':
newItem.name = '下补单';
break;
case '2':
newItem.name = '维修/补漆';
break;
case '3':
newItem.name = '客户未要求理赔';
break;
case '4':
newItem.name = '用库存';
break;
case '5':
newItem.name = '赔商家';
break;
case '6':
newItem.name = '赔付运费';
break;
case '7':
newItem.name = '工厂考核';
break;
default:
return;
}
//
if (!ProcessingList.value.some(item => item.state === newItem.state)) {
ProcessingList.value.push(newItem);
console.log(`添加:${newItem.name}`);
}
});
};
//
const abnormalChange = val => {
console.log(val, '异常事件类型');
@ -782,6 +939,43 @@ function DeliveryTrainnumber() {
}
});
}
//
const TotalChange = () => {
TotalClaimAmount.value = 0;
ProcessingList.value.forEach(item => {
console.log(item);
TotalClaimAmount.value += item.input;
});
};
//
const PaymentSelection = val => {
console.log(val, '支付');
console.log(Paymentmethod.value);
if (val.payment) {
//
let data = Paymentmethod.value.find(item => item.dictKey == val.payment);
Indexform.value.compensationMethod = data.dictKey;
} else {
Indexform.value.compensationMethod = null; //
}
ZFdialog.value = true; //
ZFname.value = val.name; //
};
//
const PaymentConfirmation = val => {
console.log(val, '支付方式选择确定');
let data = ProcessingList.value.find(item => item.name == ZFname.value);
console.log(data, '处理好的');
data.text = Paymentmethod.value.find(item => item.dictKey == val).dictValue;
data.payment = val;
ZFdialog.value = false; //
ElMessage({
message: '支付方式选择成功',
type: 'success',
});
console.log(ProcessingList.value, '选择好的支付列表');
};
//
const handleRemove = (uploadFile, uploadFiles) => {
@ -848,6 +1042,8 @@ const ConfirmForm = () => {
personResponsibleDTO: [],
packageEntityList: [], ////
decreaseImageEntityList: [], //
processingMoneyEntityList: [], //
aftersalesProcessingResultsDTO: {}, //
...Indexform.value,
}; //
@ -1033,18 +1229,39 @@ const ConfirmForm = () => {
console.log(processorEntityList, '老责任方处理好的数据');
// //
// if (Indexform.value.duty.length) {
// Indexform.value.forEach(item => {
// let found = warehouseData.value.find(element => element.value == item.toString());
// processorEntityList.push({
// businessName: found ? found.label : '',
// businessId: item,
// conditions: 1,
// typesOf: 1,
// });
// });
// }
//
if (ProcessingList.value.length) {
let sum = 0; //
for (let i = 0; i < ProcessingList.value.length; i++) {
console.log(ProcessingList.value[i].input);
sum = computeNumber(sum, '+', ProcessingList.value[i].input).result;
}
DataSubmit.aftersalesProcessingResultsDTO.money = sum; //
DataSubmit.aftersalesProcessingResultsDTO.processingMoneyEntityList = ProcessingList.value
.map(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, //
compensationTime:item.compensationTime,//
};
} else {
return null;
}
})
.filter(item => item !== null);
}
delete DataSubmit.duty, //
delete DataSubmit.packList; //
@ -1527,4 +1744,93 @@ const ViewPackageDetails = val => {
height: 100% !important;
overflow-y: scroll;
}
:deep(.selector) {
.el-select {
width: 100%;
}
}
.ProcessingResults {
width: 100%;
min-height: 260px;
border: 1px solid #ccc;
position: relative;
padding: 26px;
box-sizing: border-box;
margin-top: 20px;
color: #606266;
display: flex;
flex-direction: column;
justify-content: space-between;
margin-bottom: 16px;
.title {
position: absolute;
top: -20px;
left: 20px;
font-size: 26px;
background-color: #fff;
}
.Listadmiration {
display: flex;
flex-wrap: wrap;
margin-top: 26px;
justify-content: space-between;
.name {
display: flex;
margin-bottom: 20px;
height: 30px;
width: 42%;
justify-content: space-between;
.payment_right {
display: flex;
:deep(.el-input) {
height: 100% !important;
}
}
span {
display: block;
color: #606266;
font-size: 16px;
margin-right: 8px;
display: flex;
align-items: center;
}
}
}
.lptime,
.ZFlptime {
display: flex;
.name {
width: 10%;
color: #606266;
}
.el-input {
width: auto;
}
:deep(.el-input--prefix) {
width: 200px;
}
}
.ZFlptime {
margin: 10px 0;
}
}
.Paymentname {
display: flex;
justify-content: center;
align-items: center;
border: 1px solid #bfbfbf;
margin-left: 2px;
border-radius: 4px;
width: 100px;
font-size: 14px;
padding: 10px;
cursor: pointer;
width: 100px;
margin: 0 10px;
}
.Paymentname:hover {
border: 1px solid #172e60;
}
</style>

1
src/views/aftersales/aftersalesWorkOrderend.vue

@ -1733,6 +1733,7 @@ const submit = () => {
? paymentMethodMatch.dictValue
: '未知支付方式',
resultName: item.name, //
};
} else {
return null;

Loading…
Cancel
Save