feat(订单明细): 添加删除订单明细功能

feat(辅料管理): 新增辅料变动记录功能

feat(仪表拓扑): 在仪表标签中显示上次抄表记录

fix(设备管理): 修复图片预览空值问题

refactor(员工管理): 部门树显示负责人信息

style(备件变动): 优化备件变动页面布局

docs(订单记录): 更新操作类型映射表

test(销售异议): 新增销售异议管理模块

chore: 更新.gitignore文件
This commit is contained in:
砂糖
2026-01-04 14:42:51 +08:00
parent aeecf4bcf7
commit 42dbbf79ae
16 changed files with 1724 additions and 316 deletions

View File

@@ -246,9 +246,10 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
const itemIds = row.itemId || this.ids;
const orderId = this.orderId;
this.$modal.confirm('是否确认删除正式订单明细编号为"' + itemIds + '"的数据项?').then(() => {
this.loading = true;
return delOrderItem(itemIds);
return actions[ORDER_ACTIONS.deleteOrderDetail].handler(itemIds, orderId)
}).then(() => {
this.loading = false;
this.getList();

View File

@@ -119,7 +119,8 @@ export default {
[ORDER_ACTIONS.createOrder]: '创建正式订单',
[ORDER_ACTIONS.updateOrder]: '修改正式订单',
[ORDER_ACTIONS.createOrderdetail]: '创建订单明细',
[ORDER_ACTIONS.updateOrderdetail]: '修改订单明细'
[ORDER_ACTIONS.updateOrderdetail]: '修改订单明细',
[ORDER_ACTIONS.deleteOrderDetail]: '删除订单明细',
};
// 若不存在对应映射,返回原始类型
return actionNameMap[type] || type || '未知操作';

View File

@@ -1,5 +1,5 @@
import { addOrder, updateOrder } from '@/api/crm/order'
import { addOrderItem, updateOrderItem } from '@/api/crm/orderItem'
import { addOrderItem, updateOrderItem, delOrderItem } from '@/api/crm/orderItem'
import { addOrderOperationTrace } from '@/api/crm/orderOperationTrace'
// 需要被记录的操作
@@ -11,6 +11,7 @@ const ORDER_ACTIONS = {
updateOrder: 'updateOrder',
createOrderdetail: 'createOrderdetail',
updateOrderdetail: 'updateOrderdetail',
deleteOrderDetail: 'deleteOrderDetail'
}
const actions = {
@@ -66,11 +67,12 @@ const actions = {
const { data: orderItem } = await addOrderItem({
...payload,
})
if (orderItem.orderItemId) {
console.log(payload)
if (payload.orderId) {
addOrderOperationTrace({
orderId: orderItem.orderId,
orderId: payload.orderId,
operationType: ORDER_ACTIONS.createOrderdetail,
newStatus: payload.orderItemId,
newStatus: payload.orderId,
operationContent: JSON.stringify(payload)
})
}
@@ -90,7 +92,7 @@ const actions = {
addOrderOperationTrace({
orderId: payload.orderId,
operationType: ORDER_ACTIONS.updateOrderdetail,
newStatus: payload.orderItemId,
newStatus: payload.orderId,
operationContent: JSON.stringify(payload)
})
@@ -98,6 +100,25 @@ const actions = {
}
},
deleteOrderDetail: {
type: 'deleteOrderDetail',
name: '删除订单明细',
description: '删除订单明细的相关信息',
// 订单明细的相关信息
async handler(payload, orderId) {
await delOrderItem(payload)
console.log(payload)
addOrderOperationTrace({
orderId: orderId,
operationType: ORDER_ACTIONS.deleteOrderDetail,
newStatus: payload,
operationContent: payload
})
return payload
}
},
// 预订单审批为正式订单
approvePreOrder: {
type: 'approvePreOrder',

View File

@@ -0,0 +1,360 @@
<template>
<div class="app-container">
<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-form-item>
<el-form-item label="处理人" prop="handleUser">
<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>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<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-col>
<el-col :span="1.5">
<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>
<el-table v-loading="loading" :data="salesObjectionList" @selection-change="handleSelectionChange">
<el-table-column label="编号" align="center" prop="objectionCode" />
<!-- <el-table-column label="异议类型" align="center" prop="objectionType" /> -->
<!-- <el-table-column label="异议内容" align="center" prop="objectionContent" /> -->
<el-table-column label="状态" align="center" prop="objectionStatus">
<template slot-scope="scope">
<el-tag v-if="scope.row.objectionStatus === 0" type="danger">待处理</el-tag>
<el-tag v-else-if="scope.row.objectionStatus === 1" type="success">已处理</el-tag>
<el-tag v-else-if="scope.row.objectionStatus === 2" type="info">已关闭</el-tag>
</template>
</el-table-column>
<!-- <el-table-column label="处理内容" align="center" prop="handleContent" /> -->
<el-table-column label="处理人" align="center" prop="handleUser" />
<el-table-column label="处理时间" align="center" prop="handleTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.handleTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<!-- <el-table-column label="结案时间" align="center" prop="closeTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.closeTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column> -->
<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)"
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>
</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="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="异议编号" prop="objectionCode">
<el-input v-model="form.objectionCode" placeholder="请输入异议编号" />
</el-form-item>
<el-form-item label="异议内容">
<editor v-model="form.objectionContent" :min-height="192" />
</el-form-item>
<el-form-item label="订单编号">
<order-select v-model="form.orderId" placeholder="请选择订单" />
</el-form-item>
<el-form-item label="异议客户">
<customer-select v-model="form.customerId" placeholder="请选择客户" />
</el-form-item>
<!-- <el-form-item label="处理内容">
<editor v-model="form.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-item label="结案时间" prop="closeTime">
<el-date-picker clearable
v-model="form.closeTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择结案时间">
</el-date-picker>
</el-form-item> -->
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<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>
<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>
<script>
import { listSalesObjection, getSalesObjection, delSalesObjection, addSalesObjection, updateSalesObjection } from "@/api/crm/salesObjection";
import OrderSelect from "@/components/KLPService/OrderSelect";
import CustomerSelect from "@/components/KLPService/CustomerSelect";
export default {
name: "SalesObjection",
components: {
OrderSelect,
CustomerSelect,
},
computed: {
currentUserName() {
return this.$store.getters.name;
}
},
created() {
this.getList();
},
data() {
return {
// 按钮loading
buttonLoading: false,
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 销售异议管理表格数据
salesObjectionList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
objectionCode: undefined,
orderId: undefined,
customerId: undefined,
objectionType: undefined,
objectionContent: undefined,
objectionStatus: undefined,
handleContent: undefined,
handleUser: undefined,
handleTime: undefined,
closeTime: undefined,
},
// 表单参数
form: {},
// 表单校验
rules: {
},
checkForm: {
handleContent: undefined,
},
checkOpen: false,
viewForm: {},
viewOpen: false,
};
},
methods: {
/** 查询销售异议管理列表 */
getList() {
this.loading = true;
listSalesObjection(this.queryParams).then(response => {
this.salesObjectionList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
handleView(row) {
this.viewForm = row;
this.viewOpen = true;
},
// 表单重置
reset() {
this.form = {
objectionId: undefined,
objectionCode: undefined,
orderId: this.orderId,
customerId: this.customerId,
objectionType: 0,
objectionContent: undefined,
objectionStatus: undefined,
handleContent: undefined,
handleUser: undefined,
handleTime: undefined,
closeTime: undefined,
remark: undefined,
createBy: undefined,
createTime: undefined,
updateBy: undefined,
updateTime: undefined,
delFlag: undefined
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.objectionId)
this.single = selection.length !== 1
this.multiple = !selection.length
},
handleDo(row) {
console.log(row, '处理')
this.checkForm = row;
this.checkOpen = true;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加销售异议管理";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.loading = true;
this.reset();
const objectionId = row.objectionId || this.ids
getSalesObjection(objectionId).then(response => {
this.loading = false;
this.form = response.data;
this.open = true;
this.title = "修改销售异议管理";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
this.buttonLoading = true;
if (this.form.objectionId != null) {
updateSalesObjection(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
} else {
addSalesObjection(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
}
}
});
},
/** 提交处理按钮 */
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;
this.$modal.confirm('是否确认删除销售异议管理编号为"' + objectionIds + '"的数据项?').then(() => {
this.loading = true;
return delSalesObjection(objectionIds);
}).then(() => {
this.loading = false;
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
}).finally(() => {
this.loading = false;
});
},
/** 导出按钮操作 */
handleExport() {
this.download('crm/salesObjection/export', {
...this.queryParams
}, `salesObjection_${new Date().getTime()}.xlsx`)
}
}
};
</script>