feat(crm): 新增销售报表功能并优化订单异议处理

- 新增销售报表功能,包括汇总数据展示、图表统计和订单明细
- 优化订单异议处理流程,增加处理状态显示和操作按钮条件渲染
- 重构订单状态枚举导入和使用方式
- 移除不必要的查询条件和冗余代码
- 修复部分UI样式问题
This commit is contained in:
砂糖
2025-12-29 11:11:23 +08:00
parent 11c21f2a33
commit 980a9cf2b7
8 changed files with 1122 additions and 227 deletions

View File

@@ -39,6 +39,15 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="订单状态" prop="orderStatus">
<el-select v-model="form.orderStatus" placeholder="请选择订单状态">
<el-option v-for="(value, label) in ORDER_STATUS" :key="value" :label="label"
:value="value"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" type="textarea" :rows="4" />
@@ -50,6 +59,8 @@
</template>
<script>
import { ORDER_STATUS } from '../js/enum'
export default {
name: 'OrderEdit',
props: {
@@ -64,6 +75,7 @@ export default {
},
data() {
return {
ORDER_STATUS,
form: {
...this.initValue
},

View File

@@ -2,20 +2,11 @@
<div>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="异议编号" prop="objectionCode">
<el-input
v-model="queryParams.objectionCode"
placeholder="请输入异议编号"
clearable
@keyup.enter.native="handleQuery"
/>
<el-input v-model="queryParams.objectionCode" placeholder="请输入异议编号" clearable
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="处理人" prop="handleUser">
<el-input
v-model="queryParams.handleUser"
placeholder="请输入处理人"
clearable
@keyup.enter.native="handleQuery"
/>
<el-input v-model="queryParams.handleUser" placeholder="请输入处理人" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
@@ -25,22 +16,10 @@
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新增</el-button>
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出</el-button>
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
@@ -71,41 +50,24 @@
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
></el-button>
<el-button
size="mini"
type="text"
icon="el-icon-check"
@click="handleDo(scope.row)"
></el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"></el-button>
<el-button size="mini" type="text" icon="el-icon-check" @click="handleDo(scope.row)"
v-if="scope.row.objectionStatus == 0"></el-button>
<el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)"
v-if="scope.row.objectionStatus == 1"></el-button>
<!-- <el-button
size="mini"
type="text"
icon="el-icon-check"
@click="handleFinish(scope.row)"
>结案</el-button> -->
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
></el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"></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"
/>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" />
<!-- 添加或修改销售异议管理对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
@@ -114,7 +76,7 @@
<el-input v-model="form.objectionCode" placeholder="请输入异议编号" />
</el-form-item>
<el-form-item label="异议内容">
<editor v-model="form.objectionContent" :min-height="192"/>
<editor v-model="form.objectionContent" :min-height="192" />
</el-form-item>
<!-- <el-form-item label="处理内容">
<editor v-model="form.handleContent" :min-height="192"/>
@@ -147,6 +109,42 @@
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<el-dialog title="处理订单" :visible.sync="checkOpen" width="500px" append-to-body>
<el-form ref="form" :model="checkForm" :rules="rules" label-width="80px">
<el-form-item label="处理内容">
<editor v-model="checkForm.handleContent" :min-height="192" />
</el-form-item>
<!-- <el-form-item label="处理人" prop="handleUser">
<el-input v-model="form.handleUser" placeholder="请输入处理人" />
</el-form-item>
<el-form-item label="处理时间" prop="handleTime">
<el-date-picker clearable
v-model="form.handleTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择处理时间">
</el-date-picker>
</el-form-item> -->
</el-form>
<div slot="footer" class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitCheckForm"> </el-button>
<el-button @click="checkOpen = false"> </el-button>
</div>
</el-dialog>
<el-dialog title="查看处理结果" :visible.sync="viewOpen" width="500px" append-to-body>
<el-descriptions :column="2" :data="viewForm" label-width="80px">
<el-descriptions-item label="处理人">{{ viewForm.handleUser }}</el-descriptions-item>
<el-descriptions-item label="处理时间">{{ viewForm.handleTime }}</el-descriptions-item>
<el-descriptions-item label="处理内容" :span="2">
<div v-html="viewForm.handleContent"></div>
</el-descriptions-item>
</el-descriptions>
<div slot="footer" class="dialog-footer">
<el-button @click="viewOpen = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
@@ -158,7 +156,7 @@ export default {
props: {
order: {
type: Object,
default: () => {}
default: () => { }
}
},
computed: {
@@ -168,6 +166,9 @@ export default {
orderId() {
console.log(this.order, 'order')
return this.order.orderId
},
currentUserName() {
return this.$store.getters.name;
}
},
watch: {
@@ -223,7 +224,13 @@ export default {
form: {},
// 表单校验
rules: {
}
},
checkForm: {
handleContent: undefined,
},
checkOpen: false,
viewForm: {},
viewOpen: false,
};
},
methods: {
@@ -241,6 +248,10 @@ export default {
this.open = false;
this.reset();
},
handleView(row) {
this.viewForm = row;
this.viewOpen = true;
},
// 表单重置
reset() {
this.form = {
@@ -277,11 +288,13 @@ export default {
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.objectionId)
this.single = selection.length!==1
this.single = selection.length !== 1
this.multiple = !selection.length
},
handleDo(row) {
console.log(row, '处理')
this.checkForm = row;
this.checkOpen = true;
},
/** 新增按钮操作 */
handleAdd() {
@@ -326,6 +339,22 @@ export default {
}
});
},
/** 提交处理按钮 */
submitCheckForm() {
this.buttonLoading = true;
updateSalesObjection({
...this.checkForm,
handleUser: this.currentUserName,
handleTime: this.parseTime(new Date(), '{y}-{m}-{d} {h}:{i}:{s}'),
objectionStatus: 1,
}).then(response => {
this.$modal.msgSuccess("处理成功");
this.checkOpen = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
},
/** 删除按钮操作 */
handleDelete(row) {
const objectionIds = row.objectionId || this.ids;