Browse Source

优化售后已知问题

dev-xx
马远东 11 months ago
parent
commit
8321caa323
  1. 431
      src/views/aftersales/aftersalesWorkOrderAddTemp.vue
  2. 10
      src/views/distribution/inventory/distrilbutionBillLading.vue

431
src/views/aftersales/aftersalesWorkOrderAddTemp.vue

@ -1,5 +1,5 @@
<template>
<div class="pageContent" v-loading="form.Pageloading" element-loading-text="页面正在初始化中...">
<div class="pageContent" v-loading="form.Pageloading" element-loading-text="正在加载中...">
<!-- 菜单 -->
<div class="placeholder">
<el-tabs
@ -81,7 +81,7 @@
</div>
</div>
<template v-for="(item, index) in form.PackageList" :key="index + item.packageCode">
<template v-for="(item, index) in form.PackageList" :key="index">
<div class="el_Package">
<div class="Package">
<span class="Number"> {{ index + 1 }}</span>
@ -90,7 +90,12 @@
:rules="ruleForm.packageCode"
label="包条码"
>
<el-input v-model="item.packageCode" placeholder="请输入包条码" clearable />
<el-input
@change="ChangePackageInfo(item)"
v-model="item.packageCode"
placeholder="请输入包条码"
clearable
/>
</el-form-item>
<el-form-item
@ -130,12 +135,19 @@
:prop="`PackageList[${index}.brandName]`"
:rules="ruleForm.brandName"
>
<el-input v-model="item.brandName" placeholder="请输入品牌" clearable />
<el-input
v-model="item.brandName"
placeholder="品牌(有则自动带出)"
disabled
clearable
/>
</el-form-item>
</div>
<!-- 按钮 -->
<div class="el_activPackage_btton">
<el-button @click="ViewhistoricalPackages">查看历史包件</el-button>
<el-button v-if="item.history" @click="ViewhistoricalPackages(item)"
>查看历史包件</el-button
>
<el-button v-if="index" type="primary" @click="Removepackage(index)"
>移除</el-button
>
@ -159,12 +171,13 @@
v-model="form.trainNumber"
placeholder="请选择车次号"
style="width: 100%"
@change="DeliveryTrainnumber(form.trainNumber)"
>
<el-option
v-for="item in Trainoptions"
v-for="item in form.Trainoptions"
:key="item.value"
:label="item.label"
:value="item.value"
:label="item.trainNumber"
:value="item.trainNumber"
clearable
/>
</el-select>
@ -257,7 +270,8 @@
>
<el-input
v-model="form.typeServiceName"
placeholder="合作模式(自动带出)"
placeholder="合作模式(有则自动带出)"
disabled
clearable
/>
</el-form-item>
@ -357,6 +371,7 @@
style="width: 100%"
clearable
filterable
@change="ResponsiblePartychange(item)"
>
<el-option
v-for="items in item.Responsibleoptions"
@ -389,8 +404,8 @@
<el-option
v-for="items in item.ResponsibleoNameptions"
:key="items.value"
:label="items.label"
:value="items.value"
:label="items.name"
:value="items.id"
/>
</el-select>
</el-form-item>
@ -449,7 +464,7 @@
v-loading="form.Packageloading"
>
<el-tab-pane label="处理结果-理赔金额" name="0">
<el-form-item label="">
<el-form-item label="" prop="result">
<el-select
v-model="form.result"
placeholder="请选择处理结果类型"
@ -472,7 +487,11 @@
<div class="el_Processingresults_box">
<span class="el_title">{{ item.title }}</span>
<div class="el_Processingresults_box_list">
<el-form-item label="金额">
<el-form-item
label="金额"
:prop="`Claimamount[${index}.money]`"
:rules="ruleForm.packageCode"
>
<el-input-number
v-model="item.money"
:min="0"
@ -482,10 +501,18 @@
/>
</el-form-item>
<el-form-item label="支付单位">
<el-form-item
label="支付单位"
:prop="`Claimamount[${index}.paymentUnit]`"
:rules="ruleForm.packageCode"
>
<el-input v-model="item.paymentUnit" placeholder="请输入支付单位" clearable />
</el-form-item>
<el-form-item label="理赔支付时间">
<el-form-item
label="理赔支付时间"
:prop="`Claimamount[${index}.compensationTime]`"
:rules="ruleForm.packageCode"
>
<el-date-picker
v-model="item.compensationTime"
type="datetime"
@ -495,7 +522,11 @@
size="default"
/>
</el-form-item>
<el-form-item label="支付方式">
<el-form-item
label="支付方式"
:prop="`Claimamount[${index}.compensationMethod]`"
:rules="ruleForm.packageCode"
>
<el-select
v-model="item.compensationMethod"
placeholder="请选择支付方式"
@ -515,11 +546,37 @@
</template>
</div>
</el-tab-pane>
<!-- 照片上传 -->
<el-tabs
v-model="form.responsibilities"
class="demo-tabs responsibilities"
@tab-click="handleClick"
v-loading="form.Packageloading"
>
<el-form-item label="">
<el-tab-pane label="照片" name="0">
<el-upload
v-model:file-list="form.fileList"
:action="action"
:headers="headers"
:on-success="ImgSuccess"
:before-upload="beforeAvatarUpload"
list-type="picture-card"
>
<el-icon><Plus /></el-icon>
</el-upload>
</el-tab-pane>
</el-form-item>
</el-tabs>
</el-tabs>
<!-- 操作按钮 -->
<div class="flex-c-c">
<el-button type="primary" icon="Refresh" @click="resetFormData">重置</el-button>
<el-button type="primary" icon="Position" @click="onSubmit">保存</el-button>
</div>
</el-form>
</div>
<el-button type="primary" @click="onSubmit">提交</el-button>
</div>
<!-- 历史包件弹窗 -->
<el-dialog v-model="form.historydialog" title="查看历史包件" width="500">
@ -528,21 +585,21 @@
<el-select v-model="form.discoveryNode" placeholder="历史包件选择" style="width: 100%">
<el-option
v-for="item in form.Historicalpackage"
:key="item.value"
:label="item.label"
:value="item.value"
:key="item.workOrderId"
:label="item.workOrderNumber"
:value="item.workOrderId"
/>
</el-select>
</el-form-item>
<el-button>查看详情</el-button>
<el-button @click="Viewdetails(form.discoveryNode)">查看详情</el-button>
</div>
<template #footer>
<!-- <template #footer>
<div class="dialog-footer">
<el-button @click="form.historydialog = false"> 取消</el-button>
<el-button type="primary" @click="historyPush">查看</el-button>
</div>
</template>
</template> -->
</el-dialog>
</template>
@ -559,8 +616,12 @@ import {
$_getAbnormalPackage,
$_shippingInformation,
} from '@/api/aftersales/aftersalesWorkOrder';
import { useRouter, useRoute } from 'vue-router';
import { getDetailWarehouse, getDeptWarehouse } from '@/api/basicdata/basicdataWarehouse'; //
import { deepClone } from '@/utils/util';
import { getToken } from '@/utils/auth';
const $router = useRouter();
const formCopy = ref({}); //
const form = ref({
TabactiveName: '0', //
activPackage: '0', //
@ -605,8 +666,10 @@ const form = ref({
],
},
],
Trainoptions: [], //
//
Claimamount: [],
fileList: [], //
});
const ruleForm = reactive({
workOrderType: [{ required: true, message: '请选择异常类型', trigger: ['bulr', 'change'] }],
@ -616,7 +679,7 @@ const ruleForm = reactive({
orderCode: [{ required: true, message: '请输入订单自编号', trigger: ['bulr', 'change'] }],
first: [{ required: true, message: '请输入一级品', trigger: ['bulr', 'change'] }],
secondary: [{ required: true, message: '请输入二级品', trigger: ['bulr', 'change'] }],
brandName: [{ required: true, message: '请输入品牌', trigger: ['bulr', 'change'] }],
brandName: [{ required: false, message: '请输入品牌', trigger: ['bulr', 'change'] }],
trainNumber: [{ required: true, message: '请选择车次号', trigger: ['bulr', 'change'] }],
deliveryTime: [{ required: true, message: '请输入配送时间', trigger: ['bulr', 'change'] }],
deliveryDriver: [{ required: true, message: '请输入配送司机', trigger: ['bulr', 'change'] }],
@ -625,7 +688,7 @@ const ruleForm = reactive({
warehousingTime: [{ required: true, message: '请选择入库时间', trigger: ['bulr', 'change'] }],
discoveryTime: [{ required: true, message: '请选择发现时间', trigger: ['bulr', 'change'] }],
waybillMall: [{ required: true, message: '请输入运单商场', trigger: ['bulr', 'change'] }],
typeServiceName: [{ required: true, message: '请输入合作模式', trigger: ['bulr', 'change'] }],
typeServiceName: [{ required: false, message: '请输入合作模式', trigger: ['bulr', 'change'] }],
processor: [{ required: true, message: '请输入处理方', trigger: ['bulr'] }],
investigationPocess: [{ required: true, message: '请输入调查经过', trigger: ['bulr', 'change'] }],
businessName: [{ required: true, message: '请选择责任方', trigger: ['bulr', 'change'] }],
@ -633,6 +696,13 @@ const ruleForm = reactive({
responsibilityRatio: [{ required: true, message: '请输入占比', trigger: ['bulr', 'change'] }],
tripartite: [{ required: true, message: '请输入三方责任人', trigger: ['bulr', 'change'] }],
description: [{ required: true, message: '请输入说明', trigger: ['bulr', 'change'] }],
money: [{ required: true, message: '请输入金额', trigger: ['bulr', 'change'] }],
paymentUnit: [{ required: true, message: '请输入支付单位', trigger: ['bulr', 'change'] }],
compensationTime: [{ required: true, message: '请输选择支付时间', trigger: ['bulr', 'change'] }],
compensationMethod: [
{ required: true, message: '请输选择支付方式', trigger: ['bulr', 'change'] },
],
result: [{ required: true, message: '请输选择处理结果', trigger: ['bulr'] }],
});
const ResponsibleParty = ref([]); //
const ruleFormRef = ref(); //
@ -710,11 +780,11 @@ const PageState = () => {
first: '', //
secondary: '', //
brandName: '', //
history: true, //
history: false, //
id: 1,
},
];
formCopy.value = deepClone(form.value); //
//
// form.value.Claimamount = [
@ -781,6 +851,8 @@ const Addpackages = () => {
first: '', //
secondary: '', //
brandName: '', //
history: false, //
HistoricalPackageList: [], //
id: form.value.PackageList.length + 1,
};
form.value.PackageList.push(data);
@ -808,7 +880,8 @@ const Removepackage = index => {
};
//
const ViewhistoricalPackages = () => {
const ViewhistoricalPackages = item => {
form.value.Historicalpackage = item.HistoricalPackageList;
form.value.historydialog = true; //
};
//
@ -883,7 +956,6 @@ const CompanyProportionInput = value => {
const Claimssettlement = value => {
console.log(value, '理赔金额');
console.log(Processingresultsoptions.value, '参数列表');
let toa = ['1', '2'];
let data = [];
value.forEach(item => {
let _data = Processingresultsoptions.value.find(res => res.value == item);
@ -892,26 +964,271 @@ const Claimssettlement = value => {
}
});
console.log(data, '筛选出来的值');
form.value.Claimamount = [];
if (data && data.length) {
form.value.Claimamount = [];
data.forEach(item => {
form.value.Claimamount.push({
title: item.label, //
money: 0, //
paymentUnit: '', //
compensationTime: '', //
compensationTime: '', //
compensationMethod: '', //
Paymentmethod: [...JSON.parse(JSON.stringify(Paymentmethodoptions.value))],
});
});
}
};
// TOKEN
const headers = computed(() => {
return { 'Blade-Auth': 'Bearer ' + getToken() };
});
//
const action = computed(() => {
return '/api/blade-resource/oss/endpoint/put-file';
});
//
const beforeAvatarUpload = rawFile => {
console.log(rawFile, '图片上传前回调');
if (rawFile.type !== 'image/png' && rawFile.type !== 'image/jpeg') {
ElMessage.error('只能上传格式为PNG/JPG的图片!');
return false;
} else if (rawFile.size / 1024 / 1024 > 3) {
ElMessage.error('图片大小不能大于3MB!');
return false;
}
return true;
};
//
const ImgSuccess = (response, uploadFile) => {
if (response.success === true) {
console.log(response);
console.log(form.value);
}
};
const historyPush = () => {};
//
const resetFormData = () => {
// 使 HTML
const message = `重置表单会造成<span style="color: red;">数据丢失!</span>是否继续?`;
ElMessageBox.confirm(message, '警告', {
dangerouslyUseHTMLString: true, // HTML
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
}).then(async () => {
form.value.Pageloading = true; //
form.value = await deepClone(formCopy.value); //
ruleFormRef.value.resetFields();
let _time = setTimeout(() => {
form.value.Pageloading = false; //
clearTimeout(_time);
}, 300);
});
};
//
const ChangePackageInfo = async item => {
console.log(item, 'item');
if (!item.packageCode) {
item.waybillNumber = ''; //
item.orderCode = ''; //
item.first = ''; //
item.secondary = ''; //
item.brandName = ''; //
let data = form.value.PackageList.find(res => res.packageCode); //
if (!data) {
form.value.waybillMall = ''; //
form.value.typeServiceName = ''; //
}
return;
}
//
if (form.value.PackageList.length > 1) {
let packageCodeState = await form.value.PackageList.find(res => {
//
return res.packageCode === item.packageCode && res !== item;
});
//
if (packageCodeState) {
ElMessage({
message: '已经存在相同包条码,请勿重复添加!',
type: 'warning',
});
return;
}
}
let data = {
packageCode: item.packageCode, //
};
$_getAbnormalPackage(data).then(async res => {
console.log(res, '查询包条');
let packageData = {};
if (res.data.code == 200 && res.data && res.data.data.length) {
packageData = res.data.data[0]; //,
//
let state = await form.value.PackageList.find(res => res.orderCode || res.brandName);
if (state) {
if (state.orderCode != packageData.orderCode || state.brandName != packageData.brandName) {
ElMessage({
message: '请选择相同订单自编号和品牌的包条码!',
type: 'warning',
});
return;
}
}
ElMessage({
message: '查询成功',
type: 'success',
});
item.waybillNumber = packageData.waybillNumber || ''; //
item.orderCode = packageData.orderCode || ''; //
item.first = packageData.firsts || ''; //
item.secondary = packageData.second || ''; //
item.brandName = packageData.brandName || ''; //
form.value.waybillMall = packageData.mallName || ''; //
form.value.typeServiceName = packageData.typeServiceName || ''; //
// ,
const results = res.data.data.filter(item => {
return item.workOrderId && item.workOrderNumber;
});
//
if (results.length) {
item.history = true;
item.HistoricalPackageList = results;
} else {
item.history = false;
}
} else {
ElMessage({
message: '暂无查询内容,请检查参数是否正确!',
type: 'warning',
});
}
// (线线)
if (form.value.discoveryNode == '3') {
let addedTrainNumbers = []; //
res.data.data.forEach(item => {
item.trunklines.forEach(itemChid => {
if (!addedTrainNumbers.includes(itemChid.trainNumber)) {
form.value.Trainoptions.push({
trainNumber: itemChid.trainNumber, //
vehicleRoute: itemChid.vehicleRoute, // 线
});
addedTrainNumbers.push(itemChid.trainNumber);
}
});
});
}
// item.mallName = packageData.mallName; //
// Indexform.value.waybillMall = packageData.mallName; //
// Indexform.value.typeServiceName = packageData.typeServiceName
// ? packageData.typeServiceName
// : ''; //
});
};
//
const Viewdetails = value => {
if (!value) {
ElMessage({
message: '请选择要查看的数据',
type: 'warning',
});
return;
}
//
let data = form.value.Historicalpackage.find(res => res.workOrderId == value);
$router.push({
path: '/aftersales/aftersalesWorkOrderInfo',
query: {
id: data.workOrderId,
name: data.workOrderId + '-信息查看',
routerState: 'view',
},
});
};
// >
const ResponsiblePartychange = item => {
let data = {
warehouseId: item.businessName,
};
//
item.personResponsibleName = '';
$_getBusinessDepartmentUser(data).then(res => {
console.log(res, '获取责任人列表');
if (res.data.code == 200 && res.data.data && res.data.data.length) {
ElMessage({
message: '查询成功',
type: 'success',
});
item.ResponsibleoNameptions = res.data.data;
} else {
ElMessage({
message: '暂未查询到责任人',
type: 'warning',
});
item.ResponsibleoNameptions = [];
}
});
};
// 线
const DeliveryTrainnumber = value => {
if (value) {
if(form.value.Trainoptions.length){
let data = form.value.Trainoptions.find(res => res.trainNumber == value);
form.value.vehicleRoute = data.vehicleRoute;
}
}
};
//
const onSubmit = () => {
console.log(form.value);
ruleFormRef.value.validate(valid => {
console.log(valid, '123123');
if (!valid) {
ElMessage({
message: '有遗漏信息未填写,请根据提示填写完整!',
type: 'warning',
});
return;
}
const message = `注意信息填写正确!点击确定将<span style="color: red;">提交工单</span>是否继续?`;
ElMessageBox.confirm(message, '提示', {
dangerouslyUseHTMLString: true, // HTML
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
}).then(async () => {
form.value.Pageloading = true; //
//
let _time = setTimeout(() => {
form.value.Pageloading = false; //
clearTimeout(_time);
}, 300);
console.log(valid, '校验状态');
if (!form.value.fileList || !form.value.fileList.length) {
console.log('请上传图片');
return;
} else if (form.value.fileList || form.value.fileList.length) {
let state = form.value.fileList.every(
item => item.response && item.response.data && item.response.data.link
);
if (!state) {
ElMessage({
message: '图片未上传成功,请重新上传',
type: 'warning',
});
}
}
});
});
};
const TabactiveClick = (a, b) => {
@ -1068,13 +1385,13 @@ const TabactiveClick = (a, b) => {
:deep(.el_Investigation) {
flex: 1;
}
:deep(.is-error) {
.el-input--suffix {
.el-textarea__inner:focus {
box-shadow: 0 0 0 1px #ff0000 inset !important;
}
}
}
// :deep(.is-error) {
// .el-input--suffix {
// .el-textarea__inner:focus {
// box-shadow: 0 0 0 1px #ff0000 inset !important;
// }
// }
// }
}
}
.responsibilities {
@ -1114,6 +1431,7 @@ const TabactiveClick = (a, b) => {
align-items: center;
justify-content: center;
border-radius: 50%;
margin-top: 2px;
}
}
}
@ -1161,9 +1479,21 @@ const TabactiveClick = (a, b) => {
.el_title {
display: flex;
width: fit-content;
padding: 0 2px;
padding: 0 10px;
margin-bottom: 4px;
border-left: 3px solid #172e60;
// border-left: 3px solid #172e60;
position: relative;
}
.el_title::after {
position: absolute;
content: '';
width: 6px;
height: 6px;
border-radius: 50%;
left: 0;
top: 50%;
transform: translate(0, -50%);
background-color: #172e60;
}
.el_Processingresults_box_list {
display: flex;
@ -1171,6 +1501,10 @@ const TabactiveClick = (a, b) => {
align-items: center;
margin-right: 11px;
.el-form-item {
width: 24%;
.el-input-number {
width: 100% !important;
}
.el-form-item__label {
margin-bottom: 0;
}
@ -1179,4 +1513,17 @@ const TabactiveClick = (a, b) => {
}
}
}
.pageContent {
height: 100vh;
}
.flex-c-c {
position: fixed;
bottom: 20px;
left: 50%;
}
:deep(.el-loading-mask) {
position: fixed;
left: 12%;
top: 11%;
}
</style>

10
src/views/distribution/inventory/distrilbutionBillLading.vue

@ -2106,7 +2106,7 @@ export default {
}
this.pageOrder.currentPage = 1;
this.onLoadOrder(this.pageOrder, this.pageOrder);
},
},
inputsc(index, row) {
this.query[row.prop] = index;
this.pageOrder.currentPage = 1;
@ -3103,19 +3103,19 @@ export default {
// --
currentChangeOrder(currentPage) {
this.pageOrder.currentPage = currentPage;
this.onLoadOrder(this.pageOrder);
this.onLoadOrder(this.pageOrder,this.query);
},
sizeChangeOrder(pageSize) {
this.pageOrder.pageSize = pageSize;
this.onLoadOrder(this.pageOrder);
this.onLoadOrder(this.pageOrder,this.query);
},
currentChange(currentPage) {
this.page.currentPage = currentPage;
this.onLoad(this.page);
this.onLoad(this.page,this.query);
},
sizeChange(pageSize) {
this.page.pageSize = pageSize;
this.onLoad(this.page);
this.onLoad(this.page,this.query);
},
onLoad(page, params = {}) {

Loading…
Cancel
Save