|
@@ -1,7 +1,11 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div class="ele-body">
|
|
<div class="ele-body">
|
|
|
<el-card shadow="never" v-loading="loading">
|
|
<el-card shadow="never" v-loading="loading">
|
|
|
- <search class="seep-search" @search="reload"></search>
|
|
|
|
|
|
|
+ <search
|
|
|
|
|
+ class="seep-search"
|
|
|
|
|
+ @search="reload"
|
|
|
|
|
+ @pass-pietype-list="handlePietypeList"
|
|
|
|
|
+ ></search>
|
|
|
<!-- 数据表格 -->
|
|
<!-- 数据表格 -->
|
|
|
<ele-pro-table
|
|
<ele-pro-table
|
|
|
ref="table"
|
|
ref="table"
|
|
@@ -12,154 +16,206 @@
|
|
|
>
|
|
>
|
|
|
<!-- 表头工具栏 -->
|
|
<!-- 表头工具栏 -->
|
|
|
<template v-slot:toolbar></template>
|
|
<template v-slot:toolbar></template>
|
|
|
- <!-- <template v-slot:code="{ row }"
|
|
|
|
|
- ><el-link
|
|
|
|
|
- type="primary"
|
|
|
|
|
- :underline="false"
|
|
|
|
|
- @click="goDetail(row, 'view')"
|
|
|
|
|
- >
|
|
|
|
|
- {{ row.code }}
|
|
|
|
|
- </el-link>
|
|
|
|
|
- </template>-->
|
|
|
|
|
- <!-- 操作列 -->
|
|
|
|
|
- <!-- <template v-slot:action="{ row }"></template> -->
|
|
|
|
|
</ele-pro-table>
|
|
</ele-pro-table>
|
|
|
</el-card>
|
|
</el-card>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
- import search from './components/search.vue';
|
|
|
|
|
- import { evaluatePage } from '@/api/salesServiceManagement/index';
|
|
|
|
|
|
|
+import search from './components/search.vue';
|
|
|
|
|
+import { pageByDispatchRecord } from '@/api/salesServiceManagement/index';
|
|
|
|
|
+import dictMixins from '@/mixins/dictMixins';
|
|
|
|
|
|
|
|
- import dictMixins from '@/mixins/dictMixins';
|
|
|
|
|
- export default {
|
|
|
|
|
- mixins: [dictMixins],
|
|
|
|
|
- components: {
|
|
|
|
|
- search
|
|
|
|
|
- },
|
|
|
|
|
- data() {
|
|
|
|
|
- return {
|
|
|
|
|
- evaluateStatus: {
|
|
|
|
|
- 1: '非常不满意',
|
|
|
|
|
- 2: '不满意',
|
|
|
|
|
- 3: '一般',
|
|
|
|
|
- 4: '满意',
|
|
|
|
|
- 5: '非常满意'
|
|
|
|
|
|
|
+export default {
|
|
|
|
|
+ mixins: [dictMixins],
|
|
|
|
|
+ components: {
|
|
|
|
|
+ search
|
|
|
|
|
+ },
|
|
|
|
|
+ data() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ pietypeList: [],
|
|
|
|
|
+ deptResList: [], // 部门
|
|
|
|
|
+ deptIdToNameMap: {},
|
|
|
|
|
+ // 加载状态
|
|
|
|
|
+ loading: false
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
|
|
+ computed: {
|
|
|
|
|
+ columns() {
|
|
|
|
|
+ return [
|
|
|
|
|
+ {
|
|
|
|
|
+ columnKey: 'index',
|
|
|
|
|
+ label: '序号',
|
|
|
|
|
+ type: 'index',
|
|
|
|
|
+ width: 55,
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ fixed: 'left'
|
|
|
},
|
|
},
|
|
|
- // 表格列配置
|
|
|
|
|
-
|
|
|
|
|
- // 加载状态
|
|
|
|
|
- loading: false
|
|
|
|
|
- };
|
|
|
|
|
- },
|
|
|
|
|
- computed: {
|
|
|
|
|
- columns() {
|
|
|
|
|
- return [
|
|
|
|
|
- {
|
|
|
|
|
- columnKey: 'index',
|
|
|
|
|
- label: '序号',
|
|
|
|
|
- type: 'index',
|
|
|
|
|
- width: 55,
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- showOverflowTooltip: true,
|
|
|
|
|
- fixed: 'left'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- slot: 'code',
|
|
|
|
|
- prop: 'code',
|
|
|
|
|
- label: '编码',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- showOverflowTooltip: true
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'workCode',
|
|
|
|
|
- label: '工单编码',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- showOverflowTooltip: true
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'contactName',
|
|
|
|
|
- label: '客户名称',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- showOverflowTooltip: true
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'contactCode',
|
|
|
|
|
- label: '客户编码',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- showOverflowTooltip: true
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'attitudeRating',
|
|
|
|
|
- label: '服务态度评分',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- showOverflowTooltip: true,
|
|
|
|
|
- formatter: (row) => {
|
|
|
|
|
- return this.evaluateStatus[row.attitudeRating];
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'responseSpeed',
|
|
|
|
|
- label: '响应速度评分',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- showOverflowTooltip: true,
|
|
|
|
|
- formatter: (row) => {
|
|
|
|
|
- return this.evaluateStatus[row.responseSpeed];
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'serviceRating',
|
|
|
|
|
- label: '整体满意度',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- showOverflowTooltip: true,
|
|
|
|
|
- formatter: (row) => {
|
|
|
|
|
- return this.evaluateStatus[row.serviceRating];
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'evaluationContent',
|
|
|
|
|
- label: '评价内容',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- showOverflowTooltip: true
|
|
|
|
|
- },
|
|
|
|
|
-
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'createUserName',
|
|
|
|
|
- label: '创建人',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- showOverflowTooltip: true
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'createTime',
|
|
|
|
|
- label: '创建时间',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- showOverflowTooltip: true
|
|
|
|
|
|
|
+ {
|
|
|
|
|
+ slot: 'demandCode',
|
|
|
|
|
+ prop: 'demandCode',
|
|
|
|
|
+ label: '售后需求编码',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ minWidth: 200
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'pieCarType',
|
|
|
|
|
+ label: '派车类型',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ minWidth: 200,
|
|
|
|
|
+ formatter: (row) => this.getPieTypeLabel(row.pieCarType)
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'createUserName',
|
|
|
|
|
+ label: '申请人',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ minWidth: 200,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'department',
|
|
|
|
|
+ label: '所属部门',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ minWidth: 300,
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ formatter: (row) => {
|
|
|
|
|
+ const deptIds = row.valueJson?.department || [];
|
|
|
|
|
+ return this.getDeptNames(deptIds);
|
|
|
}
|
|
}
|
|
|
- ];
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'subject_matter',
|
|
|
|
|
+ label: '出差事由',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ minWidth: 200,
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ formatter: (row) => row.valueJson?.subject_matter || ''
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'estimated_duration',
|
|
|
|
|
+ label: '预计出差时长',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ minWidth: 200,
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ formatter: (row) => row.valueJson?.estimated_duration || ''
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'travel_time',
|
|
|
|
|
+ label: '出差时间',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ minWidth: 200,
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ formatter: (row) => row.valueJson?.travel_time || ''
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'return_time',
|
|
|
|
|
+ label: '返回时间',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ minWidth: 200,
|
|
|
|
|
+ formatter: (row) => row.valueJson?.return_time || ''
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'car_number',
|
|
|
|
|
+ label: '车牌号',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ minWidth: 200,
|
|
|
|
|
+ formatter: (row) => row.valueJson?.car_number || ''
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'vehicle_user',
|
|
|
|
|
+ label: '用车人',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ minWidth: 200,
|
|
|
|
|
+ formatter: (row) => row.valueJson?.vehicle_user || ''
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'vehicle_mileage',
|
|
|
|
|
+ label: '出差里程数',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ minWidth: 200,
|
|
|
|
|
+ formatter: (row) => row.valueJson?.vehicle_mileage || ''
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'return_mileage_to_factory',
|
|
|
|
|
+ label: '返厂里程数',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ minWidth: 200,
|
|
|
|
|
+ formatter: (row) => row.valueJson?.return_mileage_to_factory || ''
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'status',
|
|
|
|
|
+ label: '状态',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ minWidth: 200,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'createTime',
|
|
|
|
|
+ label: '创建时间',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ minWidth: 200,
|
|
|
|
|
+ }
|
|
|
|
|
+ ];
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ getDeptNames(deptIdArr) {
|
|
|
|
|
+ if (!deptIdArr || !Array.isArray(deptIdArr) || deptIdArr.length === 0) {
|
|
|
|
|
+ return "-";
|
|
|
}
|
|
}
|
|
|
|
|
+ const deptNames = deptIdArr.map(deptId =>
|
|
|
|
|
+ this.deptIdToNameMap[deptId] || ''
|
|
|
|
|
+ );
|
|
|
|
|
+ return deptNames.join("、");
|
|
|
},
|
|
},
|
|
|
- created() {},
|
|
|
|
|
- methods: {
|
|
|
|
|
- /* 表格数据源 */
|
|
|
|
|
- datasource({ page, limit, where, order }) {
|
|
|
|
|
- return evaluatePage({ pageNum: page, size: limit, ...where });
|
|
|
|
|
- },
|
|
|
|
|
- /* 刷新表格 */
|
|
|
|
|
- reload(where) {
|
|
|
|
|
- this.$refs.table.reload({ page: 1, where });
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ getPieTypeLabel(value) {
|
|
|
|
|
+ if (!value) return '';
|
|
|
|
|
+ const target = this.pietypeList.find(item => item.value === String(value));
|
|
|
|
|
+ return target ? target.label : value;
|
|
|
|
|
+ },
|
|
|
|
|
+ handlePietypeList(list, deptRes) {
|
|
|
|
|
+ this.pietypeList = list;
|
|
|
|
|
+ this.deptResList = deptRes;
|
|
|
|
|
+ this.deptIdToNameMap = deptRes.reduce((map, dept) => {
|
|
|
|
|
+ map[dept.id] = dept.name;
|
|
|
|
|
+ return map;
|
|
|
|
|
+ }, {});
|
|
|
|
|
+ },
|
|
|
|
|
+ datasource({ page, limit, where }) {
|
|
|
|
|
+ const dataPromise = pageByDispatchRecord({
|
|
|
|
|
+ pageNum: page,
|
|
|
|
|
+ size: limit,
|
|
|
|
|
+ ...where
|
|
|
|
|
+ });
|
|
|
|
|
+ dataPromise
|
|
|
|
|
+ .then(response => console.log(response))
|
|
|
|
|
+ .catch(error => console.error('获取数据失败:', error));
|
|
|
|
|
+ return dataPromise;
|
|
|
|
|
+ },
|
|
|
|
|
+ /* 刷新表格 */
|
|
|
|
|
+ reload(where) {
|
|
|
|
|
+ this.$refs.table.reload({ page: 1, where });
|
|
|
}
|
|
}
|
|
|
- };
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
- ::v-deep .el-input__inner::placeholder {
|
|
|
|
|
- font-size: 13px;
|
|
|
|
|
- }
|
|
|
|
|
- ::v-deep .seep-search {
|
|
|
|
|
- .el-input__inner {
|
|
|
|
|
- padding: 0 5px 0 10px;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+::v-deep .el-input__inner::placeholder {
|
|
|
|
|
+ font-size: 13px;
|
|
|
|
|
+}
|
|
|
|
|
+::v-deep .seep-search {
|
|
|
|
|
+ .el-input__inner {
|
|
|
|
|
+ padding: 0 5px 0 10px;
|
|
|
}
|
|
}
|
|
|
-</style>
|
|
|
|
|
|
|
+}
|
|
|
|
|
+</style>
|