|
|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<div class="ele-body">
|
|
|
<el-card shadow="never" v-loading="loading">
|
|
|
- <plan-search @search="reload"> </plan-search>
|
|
|
+ <plan-search @search="reload"></plan-search>
|
|
|
<!-- 数据表格 -->
|
|
|
<ele-pro-table
|
|
|
ref="table"
|
|
|
@@ -10,13 +10,10 @@
|
|
|
cache-key="systemRoleTable"
|
|
|
:pageSize="20"
|
|
|
>
|
|
|
-
|
|
|
<!-- 表头工具栏 -->
|
|
|
- <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 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 }">
|
|
|
@@ -25,9 +22,7 @@
|
|
|
:underline="false"
|
|
|
@click="handleUpdate(row,'edit')"
|
|
|
v-if="[0, 4,5].includes(row.planStatus)"
|
|
|
- >
|
|
|
- 修改
|
|
|
- </el-link>
|
|
|
+ >修改</el-link>
|
|
|
<el-popconfirm
|
|
|
class="ele-action"
|
|
|
title="确认删除这条记录吗?"
|
|
|
@@ -35,249 +30,261 @@
|
|
|
v-if="[0, 4,5].includes(row.planStatus)"
|
|
|
>
|
|
|
<template v-slot:reference>
|
|
|
- <el-link type="danger" :underline="false" icon="el-icon-delete">
|
|
|
- 删除
|
|
|
- </el-link>
|
|
|
+ <el-link type="danger" :underline="false" icon="el-icon-delete">删除</el-link>
|
|
|
</template>
|
|
|
</el-popconfirm>
|
|
|
<el-dropdown @command="(command) => handleCommand(command, row)">
|
|
|
<span class="el-dropdown-link">
|
|
|
- 操作菜单<i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
+ 操作菜单
|
|
|
+ <i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
</span>
|
|
|
<el-dropdown-menu slot="dropdown">
|
|
|
- <el-dropdown-item
|
|
|
- command="handleRevocation"
|
|
|
- v-if="row.planStatus == 1"
|
|
|
- >撤回
|
|
|
- </el-dropdown-item>
|
|
|
+ <el-dropdown-item command="handleRevocation" v-if="row.planStatus == 1">撤回</el-dropdown-item>
|
|
|
<el-dropdown-item
|
|
|
command="handleDispatchOrders"
|
|
|
v-if="[0, 4,5].includes(row.planStatus)"
|
|
|
- >派单
|
|
|
- </el-dropdown-item>
|
|
|
- <el-dropdown-item command="handleGenerate"
|
|
|
- >生成报价单
|
|
|
- </el-dropdown-item>
|
|
|
+ >派单</el-dropdown-item>
|
|
|
+ <el-dropdown-item command="handleGenerate">生成报价单</el-dropdown-item>
|
|
|
<!-- <el-dropdown-item command="addSpareItems"
|
|
|
>申请备品备件
|
|
|
- </el-dropdown-item> -->
|
|
|
+ </el-dropdown-item>-->
|
|
|
</el-dropdown-menu>
|
|
|
</el-dropdown>
|
|
|
</template>
|
|
|
</ele-pro-table>
|
|
|
</el-card>
|
|
|
- <addOrUpdateDialog
|
|
|
- ref="addOrUpdateDialogRef"
|
|
|
- @reload="reload"
|
|
|
- ></addOrUpdateDialog>
|
|
|
+ <addOrUpdateDialog ref="addOrUpdateDialogRef" @reload="reload"></addOrUpdateDialog>
|
|
|
<applyForSpare ref="edit" @reload="reload" />
|
|
|
<generateForm ref="generateFormRef"></generateForm>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import planSearch from './components/plan-search.vue';
|
|
|
- import addOrUpdateDialog from './components/addOrUpdateDialog.vue';
|
|
|
- import generateForm from './components/generateForm.vue';
|
|
|
+import planSearch from './components/plan-search.vue';
|
|
|
+import addOrUpdateDialog from './components/addOrUpdateDialog.vue';
|
|
|
+import generateForm from './components/generateForm.vue';
|
|
|
|
|
|
- import applyForSpare from '../components/applyForSpare.vue';
|
|
|
+import applyForSpare from '../components/applyForSpare.vue';
|
|
|
|
|
|
- import {
|
|
|
- getSalesPlan,
|
|
|
- deleteSalesPlan,
|
|
|
- planRevocation
|
|
|
- } from '@/api/salesServiceManagement/index';
|
|
|
+import {
|
|
|
+ getSalesPlan,
|
|
|
+ deleteSalesPlan,
|
|
|
+ planRevocation
|
|
|
+} from '@/api/salesServiceManagement/index';
|
|
|
|
|
|
- import dictMixins from '@/mixins/dictMixins';
|
|
|
+import dictMixins from '@/mixins/dictMixins';
|
|
|
|
|
|
- export default {
|
|
|
- mixins: [dictMixins],
|
|
|
- components: {
|
|
|
- planSearch,
|
|
|
- addOrUpdateDialog,
|
|
|
- generateForm,
|
|
|
- applyForSpare
|
|
|
- },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- // 表格列配置
|
|
|
- columns: [
|
|
|
- {
|
|
|
- columnKey: 'index',
|
|
|
- label: '序号',
|
|
|
- type: 'index',
|
|
|
- width: 55,
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- fixed: 'left'
|
|
|
- },
|
|
|
- {
|
|
|
- slot: 'code',
|
|
|
- prop: 'code',
|
|
|
- label: '计划单号',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'name',
|
|
|
- label: '计划名称',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'isSyncBill',
|
|
|
- label: '是否自动派单',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- formatter: (item) => {
|
|
|
- return {
|
|
|
- 0: '否',
|
|
|
- 1: '是'
|
|
|
- }[item.isSyncBill];
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'duration',
|
|
|
- label: '预计售后时长(分钟)',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'planStatus',
|
|
|
- label: '状态',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- formatter: (item) => {
|
|
|
- return {
|
|
|
- 0: '待派单',
|
|
|
- 1: '已派单',
|
|
|
- 2: '执行中',
|
|
|
- 3: '已完成',
|
|
|
- 4: '已撤回',
|
|
|
- 5: '已驳回'
|
|
|
-
|
|
|
- }[item.planStatus];
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'urgent',
|
|
|
- label: '紧急程度',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- formatter: (item) => {
|
|
|
- return {
|
|
|
- 1: '普通',
|
|
|
- 2: '紧急',
|
|
|
- 3: '重要'
|
|
|
- }[item.urgent];
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'createUserName',
|
|
|
- label: '创建人',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'createTime',
|
|
|
- label: '创建时间',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- formatter: (_row, _column, cellValue) => {
|
|
|
- return this.$util.toDateString(cellValue);
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- columnKey: 'action',
|
|
|
- label: '操作',
|
|
|
- width: 230,
|
|
|
- align: 'center',
|
|
|
- resizable: false,
|
|
|
- slot: 'action',
|
|
|
- showOverflowTooltip: true,
|
|
|
- fixed: 'right'
|
|
|
+export default {
|
|
|
+ mixins: [dictMixins],
|
|
|
+ components: {
|
|
|
+ planSearch,
|
|
|
+ addOrUpdateDialog,
|
|
|
+ generateForm,
|
|
|
+ applyForSpare
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ // 表格列配置
|
|
|
+ columns: [
|
|
|
+ {
|
|
|
+ columnKey: 'index',
|
|
|
+ label: '序号',
|
|
|
+ type: 'index',
|
|
|
+ width: 55,
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ fixed: 'left'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ slot: 'code',
|
|
|
+ prop: 'code',
|
|
|
+ label: '计划单号',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'name',
|
|
|
+ label: '计划名称',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'categoryName',
|
|
|
+ label: '设备名称',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ formatter: (row) => {
|
|
|
+ if (!row.deviceDetails) return '';
|
|
|
+ let str = '';
|
|
|
+ row.deviceDetails.map((el, idx) => {
|
|
|
+ if (idx + 1 == row.deviceDetails.length) {
|
|
|
+ str += el.categoryName;
|
|
|
+ } else {
|
|
|
+ str = str + '' + el.categoryName + ',';
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return str;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'contactName',
|
|
|
+ label: '客户名称',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'isSyncBill',
|
|
|
+ label: '是否自动派单',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ formatter: (item) => {
|
|
|
+ return {
|
|
|
+ 0: '否',
|
|
|
+ 1: '是'
|
|
|
+ }[item.isSyncBill];
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'duration',
|
|
|
+ label: '预计售后时长(分钟)',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'planStatus',
|
|
|
+ label: '状态',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ formatter: (item) => {
|
|
|
+ return {
|
|
|
+ 0: '待派单',
|
|
|
+ 1: '已派单',
|
|
|
+ 2: '执行中',
|
|
|
+ 3: '已完成',
|
|
|
+ 4: '已撤回',
|
|
|
+ 5: '已驳回'
|
|
|
+ }[item.planStatus];
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'urgent',
|
|
|
+ label: '紧急程度',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ formatter: (item) => {
|
|
|
+ return {
|
|
|
+ 1: '普通',
|
|
|
+ 2: '紧急',
|
|
|
+ 3: '重要'
|
|
|
+ }[item.urgent];
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'createUserName',
|
|
|
+ label: '创建人',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'createTime',
|
|
|
+ label: '创建时间',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ formatter: (_row, _column, cellValue) => {
|
|
|
+ return this.$util.toDateString(cellValue);
|
|
|
}
|
|
|
- ],
|
|
|
- // 加载状态
|
|
|
- loading: false
|
|
|
- };
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnKey: 'action',
|
|
|
+ label: '操作',
|
|
|
+ width: 230,
|
|
|
+ align: 'center',
|
|
|
+ resizable: false,
|
|
|
+ slot: 'action',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ fixed: 'right'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ // 加载状态
|
|
|
+ loading: false
|
|
|
+ };
|
|
|
+ },
|
|
|
+ computed: {},
|
|
|
+ created() {
|
|
|
+ this.requestDict('维修计划状态');
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ /* 表格数据源 */
|
|
|
+ datasource({ page, limit, where, order }) {
|
|
|
+ return getSalesPlan({ pageNum: page, size: limit, ...where });
|
|
|
},
|
|
|
- computed: {},
|
|
|
- created() {
|
|
|
- this.requestDict('维修计划状态');
|
|
|
+ /* 刷新表格 */
|
|
|
+ reload(where) {
|
|
|
+ this.$refs.table.reload({ page: 1, where });
|
|
|
},
|
|
|
- methods: {
|
|
|
- /* 表格数据源 */
|
|
|
- datasource({ page, limit, where, order }) {
|
|
|
- return getSalesPlan({ pageNum: page, size: limit, ...where });
|
|
|
- },
|
|
|
- /* 刷新表格 */
|
|
|
- reload(where) {
|
|
|
- this.$refs.table.reload({ page: 1, where });
|
|
|
- },
|
|
|
- async cancel(row) {
|
|
|
- const res = await deleteSalesPlan([row.id]);
|
|
|
- if (res) {
|
|
|
- this.$message.success('删除成功');
|
|
|
- this.reload();
|
|
|
- }
|
|
|
- },
|
|
|
- handleUpdate(row,type) {
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.addOrUpdateDialogRef.init(row, type);
|
|
|
- });
|
|
|
- },
|
|
|
- goDetail(row) {
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.addOrUpdateDialogRef.init(row, 'view');
|
|
|
- });
|
|
|
- },
|
|
|
- handleDispatchOrders(row) {
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.addOrUpdateDialogRef.init(row, 'view',true);
|
|
|
- });
|
|
|
- },
|
|
|
- async handleRevocation(row) {
|
|
|
- try {
|
|
|
- await planRevocation([row.id]);
|
|
|
- this.$message.success('撤回成功');
|
|
|
- this.reload();
|
|
|
- } catch (err) {
|
|
|
- // this.$message.error(err)
|
|
|
- }
|
|
|
- },
|
|
|
- addSpareItems(row) {
|
|
|
- let data = JSON.parse(JSON.stringify(row));
|
|
|
- this.$refs.edit.open(data, 'plan');
|
|
|
- },
|
|
|
- async handleGenerate(row) {
|
|
|
- this.$refs.generateFormRef.open(row);
|
|
|
- },
|
|
|
- handleCommand(command, row) {
|
|
|
- if (command === 'handleRevocation') {
|
|
|
- this.handleRevocation(row);
|
|
|
- }
|
|
|
- if (command === 'handleDispatchOrders') {
|
|
|
- this.handleDispatchOrders(row);
|
|
|
- }
|
|
|
- if (command === 'handleGenerate') {
|
|
|
- this.handleGenerate(row);
|
|
|
- }
|
|
|
- if (command === 'addSpareItems') {
|
|
|
- this.addSpareItems(row);
|
|
|
- }
|
|
|
+ async cancel(row) {
|
|
|
+ const res = await deleteSalesPlan([row.id]);
|
|
|
+ if (res) {
|
|
|
+ this.$message.success('删除成功');
|
|
|
+ this.reload();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleUpdate(row, type) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.addOrUpdateDialogRef.init(row, type);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ goDetail(row) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.addOrUpdateDialogRef.init(row, 'view');
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleDispatchOrders(row) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.addOrUpdateDialogRef.init(row, 'view', true);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ async handleRevocation(row) {
|
|
|
+ try {
|
|
|
+ await planRevocation([row.id]);
|
|
|
+ this.$message.success('撤回成功');
|
|
|
+ this.reload();
|
|
|
+ } catch (err) {
|
|
|
+ // this.$message.error(err)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ addSpareItems(row) {
|
|
|
+ let data = JSON.parse(JSON.stringify(row));
|
|
|
+ this.$refs.edit.open(data, 'plan');
|
|
|
+ },
|
|
|
+ async handleGenerate(row) {
|
|
|
+ this.$refs.generateFormRef.open(row);
|
|
|
+ },
|
|
|
+ handleCommand(command, row) {
|
|
|
+ if (command === 'handleRevocation') {
|
|
|
+ this.handleRevocation(row);
|
|
|
+ }
|
|
|
+ if (command === 'handleDispatchOrders') {
|
|
|
+ this.handleDispatchOrders(row);
|
|
|
+ }
|
|
|
+ if (command === 'handleGenerate') {
|
|
|
+ this.handleGenerate(row);
|
|
|
+ }
|
|
|
+ if (command === 'addSpareItems') {
|
|
|
+ this.addSpareItems(row);
|
|
|
}
|
|
|
}
|
|
|
- };
|
|
|
+ }
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
- .el-dropdown-link {
|
|
|
- cursor: pointer;
|
|
|
- color: var(--color-primary-5);
|
|
|
- }
|
|
|
+.el-dropdown-link {
|
|
|
+ cursor: pointer;
|
|
|
+ color: var(--color-primary-5);
|
|
|
+}
|
|
|
|
|
|
- .el-icon-arrow-down {
|
|
|
- font-size: 12px;
|
|
|
- }
|
|
|
+.el-icon-arrow-down {
|
|
|
+ font-size: 12px;
|
|
|
+}
|
|
|
</style>
|