feat: 新增售后异议管理全流程功能
本次提交完成售后异议管理模块的开发,主要包括以下内容: 1. 新增售后异议主页面、待办页面和意见填写页面 2. 新增5个通用业务组件用于页面渲染 3. 新增4个业务API接口文件 4. 优化流程图表单描述、文件列表样式和钢卷信息展示 5. 完善投诉受理单的日期格式化和实体类继承
This commit is contained in:
314
klp-ui/src/views/wms/post/objection/opinion.vue
Normal file
314
klp-ui/src/views/wms/post/objection/opinion.vue
Normal file
@@ -0,0 +1,314 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="filter-bar">
|
||||
<div class="dept-tabs">
|
||||
<span v-for="tab in deptTabs" :key="tab.key" class="dept-tab" :class="{ active: activeDept === tab.key }" @click="switchDept(tab.key)">
|
||||
{{ tab.label }}
|
||||
</span>
|
||||
</div>
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" class="filter-form">
|
||||
<el-form-item label="售后编号">
|
||||
<el-input v-model="queryParams.complaintNo" placeholder="请输入售后编号" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="任务状态">
|
||||
<el-select v-model="queryParams.taskStatus" placeholder="请选择" clearable>
|
||||
<el-option label="待填写" :value="0" />
|
||||
<el-option label="已完成" :value="1" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<el-table v-loading="loading" :data="taskList" border>
|
||||
<el-table-column label="售后编号" align="center" width="150">
|
||||
<template slot-scope="scope">
|
||||
{{ (scope.row.acceptInfo || {}).complaintNo || '' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="投诉日期" align="center" width="110">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime((scope.row.acceptInfo || {}).complaintDate, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="任务状态" align="center" prop="taskStatus" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.taskStatus === 0" type="warning">待填写</el-tag>
|
||||
<el-tag v-else-if="scope.row.taskStatus === 1" type="success">已完成</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="处理意见" align="center" min-width="200" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
<div v-html="scope.row.deptOpinion"></div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="填写时间" align="center" prop="fillTime" width="160">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.fillTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="120" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-if="canEdit(scope.row)" size="mini" type="text" icon="el-icon-edit" @click="handleView(scope.row, true)">填写</el-button>
|
||||
<el-button v-else size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row, false)">查看</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<el-dialog :title="(isEditable ? '填写' : '查看') + '处理意见 - ' + getDeptLabel()" :visible.sync="opinionOpen" width="900px" append-to-body :close-on-click-modal="false">
|
||||
<div v-loading="detailLoading" class="opinion-dialog">
|
||||
<HeaderControlSection
|
||||
:complaintNo="acceptDetail.complaintNo"
|
||||
:flowStatus="acceptDetail.flowStatus"
|
||||
:meta="acceptDetail"
|
||||
>
|
||||
<template #actions>
|
||||
<el-button size="mini" type="text" icon="el-icon-refresh" @click="refreshDetail" title="刷新">刷新</el-button>
|
||||
</template>
|
||||
|
||||
<template #basic-info>
|
||||
<BasicInfoSection :data="acceptDetail" />
|
||||
</template>
|
||||
|
||||
<template #contract-info>
|
||||
<ContractInfoSection :coilList="dialogCoilList" />
|
||||
</template>
|
||||
</HeaderControlSection>
|
||||
|
||||
<el-divider />
|
||||
|
||||
<CoilInfoSection :coilList="dialogCoilList" :loading="coilLoading" :editable="false" />
|
||||
|
||||
<el-divider />
|
||||
|
||||
<div v-if="isEditable" class="opinion-form">
|
||||
<div class="section-title">填写处理意见</div>
|
||||
<el-form ref="opinionForm" :model="opinionForm" label-width="100px">
|
||||
<el-form-item label="处理意见" prop="deptOpinion">
|
||||
<editor v-model="opinionForm.deptOpinion" :min-height="200" />
|
||||
</el-form-item>
|
||||
<el-form-item label="意见文件">
|
||||
<file-upload v-model="opinionForm.fillFile" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="opinionOpen = false">{{ isEditable ? '取 消' : '关 闭' }}</el-button>
|
||||
<el-button v-if="isEditable" :loading="submitLoading" type="primary" @click="submitOpinion">提 交</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listComplaintTask, getComplaintTask, updateComplaintTask } from "@/api/flow/complaintTask";
|
||||
import { getComplaintAccept } from "@/api/flow/complaintAccept";
|
||||
import { listAcceptCoilRel } from "@/api/flow/acceptCoilRel";
|
||||
import HeaderControlSection from "./components/HeaderControlSection.vue";
|
||||
import BasicInfoSection from "./components/BasicInfoSection.vue";
|
||||
import CoilInfoSection from "./components/CoilInfoSection.vue";
|
||||
import ContractInfoSection from "./components/ContractInfoSection.vue";
|
||||
|
||||
export default {
|
||||
name: "AftermarketOpinion",
|
||||
components: { HeaderControlSection, BasicInfoSection, CoilInfoSection, ContractInfoSection },
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
detailLoading: false,
|
||||
coilLoading: false,
|
||||
submitLoading: false,
|
||||
total: 0,
|
||||
activeDept: 'production',
|
||||
deptTabs: [
|
||||
{ key: 'production', label: '生产部' },
|
||||
{ key: 'quality', label: '质量部' },
|
||||
{ key: 'sales', label: '销售部' }
|
||||
],
|
||||
deptMap: { production: 1, quality: 2, sales: 3 },
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
deptId: 1,
|
||||
complaintNo: undefined,
|
||||
taskStatus: undefined
|
||||
},
|
||||
taskList: [],
|
||||
opinionOpen: false,
|
||||
opinionForm: { deptOpinion: '', fillFile: '' },
|
||||
acceptDetail: {},
|
||||
dialogCoilList: [],
|
||||
currentTask: {},
|
||||
isEditable: false
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
switchDept(key) {
|
||||
this.activeDept = key;
|
||||
this.queryParams.deptId = this.deptMap[key];
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
getList() {
|
||||
this.loading = true;
|
||||
const params = { ...this.queryParams };
|
||||
if (params.taskStatus === '' || params.taskStatus === undefined) {
|
||||
delete params.taskStatus;
|
||||
}
|
||||
listComplaintTask(params).then(response => {
|
||||
this.taskList = response.rows || [];
|
||||
this.total = response.total;
|
||||
}).finally(() => { this.loading = false; });
|
||||
},
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
resetQuery() {
|
||||
this.queryParams.complaintNo = undefined;
|
||||
this.queryParams.taskStatus = undefined;
|
||||
this.handleQuery();
|
||||
},
|
||||
handleView(row, editable) {
|
||||
this.currentTask = row;
|
||||
this.isEditable = editable;
|
||||
this.opinionForm = { deptOpinion: '', fillFile: '' };
|
||||
this.detailLoading = true;
|
||||
this.coilLoading = true;
|
||||
this.dialogCoilList = [];
|
||||
this.acceptDetail = row.acceptInfo || {};
|
||||
|
||||
listAcceptCoilRel({ acceptId: row.acceptId, pageNum: 1, pageSize: 999 }).then(r => {
|
||||
this.dialogCoilList = r.rows || [];
|
||||
}).finally(() => { this.coilLoading = false; this.detailLoading = false; });
|
||||
|
||||
getComplaintTask(row.taskId).then(response => {
|
||||
const task = response.data || {};
|
||||
this.opinionForm = {
|
||||
deptOpinion: task.deptOpinion || '',
|
||||
fillFile: task.fillFile || ''
|
||||
};
|
||||
});
|
||||
|
||||
this.opinionOpen = true;
|
||||
},
|
||||
refreshDetail() {
|
||||
if (!this.currentTask.acceptId) return;
|
||||
this.detailLoading = true;
|
||||
this.coilLoading = true;
|
||||
getComplaintAccept(this.currentTask.acceptId).then(response => {
|
||||
this.acceptDetail = response.data || {};
|
||||
}).finally(() => { this.detailLoading = false; });
|
||||
listAcceptCoilRel({ acceptId: this.currentTask.acceptId, pageNum: 1, pageSize: 999 }).then(r => {
|
||||
this.dialogCoilList = r.rows || [];
|
||||
}).finally(() => { this.coilLoading = false; });
|
||||
},
|
||||
getDeptLabel() {
|
||||
const map = { production: '生产部', quality: '质量部', sales: '销售部' };
|
||||
return map[this.activeDept] || '';
|
||||
},
|
||||
canEdit(row) {
|
||||
const status = (row.acceptInfo || {}).flowStatus;
|
||||
return (status === 2 || status === 3) && row.taskStatus === 0;
|
||||
},
|
||||
submitOpinion() {
|
||||
if (!this.opinionForm.deptOpinion) {
|
||||
this.$modal.msgWarning("请填写处理意见");
|
||||
return;
|
||||
}
|
||||
this.submitLoading = true;
|
||||
updateComplaintTask({
|
||||
taskId: this.currentTask.taskId,
|
||||
acceptId: this.currentTask.acceptId,
|
||||
deptId: this.currentTask.deptId,
|
||||
deptOpinion: this.opinionForm.deptOpinion,
|
||||
fillFile: this.opinionForm.fillFile,
|
||||
taskStatus: 1,
|
||||
fillTime: this.parseTime(new Date(), '{y}-{m}-{d} {h}:{i}:{s}')
|
||||
}).then(() => {
|
||||
this.$modal.msgSuccess("意见提交成功");
|
||||
this.opinionOpen = false;
|
||||
this.getList();
|
||||
}).finally(() => { this.submitLoading = false; });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.filter-bar {
|
||||
background: #fafafa;
|
||||
padding: 12px 16px;
|
||||
margin-bottom: 12px;
|
||||
border-radius: 4px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 20px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.dept-tabs {
|
||||
display: flex;
|
||||
gap: 0;
|
||||
}
|
||||
.dept-tab {
|
||||
padding: 6px 20px;
|
||||
cursor: pointer;
|
||||
font-size: 13px;
|
||||
color: #606266;
|
||||
background: #fff;
|
||||
border: 1px solid #dcdfe6;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
.dept-tab:first-child {
|
||||
border-radius: 4px 0 0 4px;
|
||||
}
|
||||
.dept-tab:last-child {
|
||||
border-radius: 0 4px 4px 0;
|
||||
}
|
||||
.dept-tab.active {
|
||||
color: #fff;
|
||||
background: #409eff;
|
||||
border-color: #409eff;
|
||||
}
|
||||
.dept-tab:hover:not(.active) {
|
||||
color: #409eff;
|
||||
}
|
||||
.filter-form {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0;
|
||||
}
|
||||
.filter-form .el-form-item {
|
||||
margin-bottom: 0;
|
||||
margin-right: 10px;
|
||||
}
|
||||
.opinion-dialog {
|
||||
max-height: 70vh;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.opinion-dialog /deep/ .section-title {
|
||||
margin-top: 16px;
|
||||
}
|
||||
.section-title {
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
color: #1d2129;
|
||||
margin: 0 0 12px 0;
|
||||
padding: 0 0 10px 0;
|
||||
border-bottom: 2px solid transparent;
|
||||
border-image: linear-gradient(to right, #c0c4cc, transparent) 1;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.opinion-form {
|
||||
padding-top: 4px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user