|
@@ -8,6 +8,33 @@
|
|
|
:inline="true"
|
|
|
class="demo-form-inline"
|
|
|
>
|
|
|
+ <el-form-item>
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.orderNo"
|
|
|
+ placeholder="服务单号"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ style="width: 150px"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.contractNo"
|
|
|
+ placeholder="合同单号"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ style="width: 150px"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.deliveryNo"
|
|
|
+ placeholder="发货单号"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ style="width: 150px"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-select
|
|
|
v-model="queryParams.serviceStaffIds"
|
|
@@ -90,6 +117,7 @@
|
|
|
style="width: 250px"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
+ <div style="width: 100%"></div>
|
|
|
<el-form-item>
|
|
|
<el-button
|
|
|
size="small"
|
|
@@ -119,8 +147,8 @@
|
|
|
style="margin-left: 8px"
|
|
|
>
|
|
|
<el-radio-button label="">全部</el-radio-button>
|
|
|
- <el-radio-button label="待处理"
|
|
|
- >待处理<el-badge
|
|
|
+ <el-radio-button label="未接单"
|
|
|
+ >未接单<el-badge
|
|
|
v-if="pendingCount > 0"
|
|
|
:value="pendingCount"
|
|
|
class="pending-badge"
|
|
@@ -223,7 +251,9 @@
|
|
|
scope.row.progress > 0
|
|
|
? scope.row.progress + '%'
|
|
|
: '2px',
|
|
|
- backgroundColor: getProgressBarColor(scope.row.progress),
|
|
|
+ backgroundColor: getProgressBarColor(
|
|
|
+ scope.row.statusName
|
|
|
+ ),
|
|
|
}"
|
|
|
>
|
|
|
<span class="progress-text" v-if="scope.row.progress > 0">
|
|
@@ -354,45 +384,91 @@
|
|
|
<template slot-scope="scope">
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
- type="info"
|
|
|
- plain
|
|
|
+ style="
|
|
|
+ background-color: #2d8cf0;
|
|
|
+ border-color: #2d8cf0;
|
|
|
+ color: #fff;
|
|
|
+ "
|
|
|
@click="handleView(scope.row)"
|
|
|
>查看</el-button
|
|
|
>
|
|
|
- <el-button size="mini" type="primary" @click="handleEdit(scope.row)"
|
|
|
- >编辑</el-button
|
|
|
- >
|
|
|
- <el-dropdown
|
|
|
- trigger="click"
|
|
|
- @command="(command) => handleCommand(command, scope.row)"
|
|
|
- >
|
|
|
- <el-button size="mini" type="success">
|
|
|
- 更多<i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
- </el-button>
|
|
|
- <el-dropdown-menu slot="dropdown">
|
|
|
- <el-dropdown-item command="delete" class="dropdown-danger"
|
|
|
- >删除</el-dropdown-item
|
|
|
- >
|
|
|
- <el-dropdown-item command="dispatch" class="dropdown-success"
|
|
|
- >派单</el-dropdown-item
|
|
|
- >
|
|
|
- <el-dropdown-item command="reject" class="dropdown-danger"
|
|
|
- >驳回</el-dropdown-item
|
|
|
- >
|
|
|
- <el-dropdown-item command="dailyWrite" class="dropdown-info"
|
|
|
- >填写</el-dropdown-item
|
|
|
- >
|
|
|
- <el-dropdown-item command="complete" class="dropdown-success"
|
|
|
- >完成</el-dropdown-item
|
|
|
- >
|
|
|
- <el-dropdown-item command="accept" class="dropdown-primary"
|
|
|
- >接单</el-dropdown-item
|
|
|
- >
|
|
|
- <el-dropdown-item command="check" class="dropdown-warning"
|
|
|
- >验收</el-dropdown-item
|
|
|
- >
|
|
|
- </el-dropdown-menu>
|
|
|
- </el-dropdown>
|
|
|
+ <template v-if="scope.row.statusName === '未接单'">
|
|
|
+ <el-button size="mini" type="primary" @click="handleEdit(scope.row)"
|
|
|
+ >编辑</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="success"
|
|
|
+ @click="handleDispatch(scope.row)"
|
|
|
+ >派单</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ style="
|
|
|
+ background-color: #e74c3c;
|
|
|
+ border-color: #e74c3c;
|
|
|
+ color: #fff;
|
|
|
+ "
|
|
|
+ @click="handleReject(scope.row)"
|
|
|
+ >驳回</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ style="
|
|
|
+ background-color: #f39c12;
|
|
|
+ border-color: #f39c12;
|
|
|
+ color: #fff;
|
|
|
+ "
|
|
|
+ @click="handleAccept(scope.row)"
|
|
|
+ >接单</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="danger"
|
|
|
+ @click="handleDelete(scope.row)"
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ <template v-else-if="scope.row.statusName === '处理中'">
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ style="
|
|
|
+ background-color: #409eff;
|
|
|
+ border-color: #409eff;
|
|
|
+ color: #fff;
|
|
|
+ "
|
|
|
+ @click="handleDailyWrite(scope.row)"
|
|
|
+ >填写</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="success"
|
|
|
+ @click="handleComplete(scope.row)"
|
|
|
+ >完成</el-button
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ <template v-else-if="scope.row.statusName === '已完成未验收'">
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="warning"
|
|
|
+ @click="handleCheck(scope.row)"
|
|
|
+ >验收</el-button
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ <template v-else-if="scope.row.statusName === '已完成'">
|
|
|
+ <!-- 仅保留查看按钮 -->
|
|
|
+ </template>
|
|
|
+ <template v-else-if="scope.row.statusName === '接单驳回'">
|
|
|
+ <el-button size="mini" type="primary" @click="handleEdit(scope.row)"
|
|
|
+ >编辑</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="danger"
|
|
|
+ @click="handleDelete(scope.row)"
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
+ </template>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -540,14 +616,17 @@ export default {
|
|
|
orderTimeRange: [],
|
|
|
completeTimeRange: [],
|
|
|
viewType: "",
|
|
|
+ orderNo: "",
|
|
|
+ deliveryNo: "",
|
|
|
+ contractNo: "",
|
|
|
},
|
|
|
// 状态选项
|
|
|
statusOptions: [
|
|
|
- { label: "待处理", value: "待处理" },
|
|
|
+ { label: "未接单", value: "未接单" },
|
|
|
{ label: "处理中", value: "处理中" },
|
|
|
{ label: "已完成未验收", value: "已完成未验收" },
|
|
|
{ label: "已完成", value: "已完成" },
|
|
|
- { label: "已驳回", value: "已驳回" },
|
|
|
+ { label: "接单驳回", value: "接单驳回" },
|
|
|
],
|
|
|
// 项目选项
|
|
|
projectOptions: [],
|
|
@@ -724,15 +803,24 @@ export default {
|
|
|
},
|
|
|
handleViewTypeChange(value) {
|
|
|
this.queryParams.statusName = value;
|
|
|
+ this.queryParams.serviceStaffIds = "";
|
|
|
+ this.queryParams.customerName = "";
|
|
|
+ this.queryParams.projectName = "";
|
|
|
+ this.queryParams.projectId = "";
|
|
|
+ this.queryParams.orderTimeRange = [];
|
|
|
+ this.queryParams.completeTimeRange = [];
|
|
|
+ this.queryParams.orderNo = "";
|
|
|
+ this.queryParams.deliveryNo = "";
|
|
|
+ this.queryParams.contractNo = "";
|
|
|
this.getList();
|
|
|
},
|
|
|
getStatusType(statusName) {
|
|
|
const statusMap = {
|
|
|
- 待处理: "info",
|
|
|
+ 未接单: "info",
|
|
|
处理中: "primary",
|
|
|
已完成: "success",
|
|
|
已完成未验收: "warning",
|
|
|
- 已驳回: "danger",
|
|
|
+ 接单驳回: "danger",
|
|
|
};
|
|
|
return statusMap[statusName] || "info";
|
|
|
},
|
|
@@ -762,6 +850,19 @@ export default {
|
|
|
parammaps: {
|
|
|
orderId: row.id,
|
|
|
},
|
|
|
+ }, // 在 handleDelete 方法的 params.data 数组中添加:
|
|
|
+ {
|
|
|
+ name: "insertInstallationOrderProcessLog",
|
|
|
+ type: "e",
|
|
|
+ parammaps: {
|
|
|
+ orderId: row.id,
|
|
|
+ operationType: "delete",
|
|
|
+ operationUserId: this.currentUser.id,
|
|
|
+ operationUserName: this.currentUser.name,
|
|
|
+ beforeStatus: row.statusName,
|
|
|
+ afterStatus: row.statusName,
|
|
|
+ operationContent: "删除服务工单",
|
|
|
+ },
|
|
|
},
|
|
|
],
|
|
|
};
|
|
@@ -822,7 +923,7 @@ export default {
|
|
|
goodsName: item.goodsName,
|
|
|
goodsId: item.goodsId,
|
|
|
todayQuantity: item.todayQuantity || 0,
|
|
|
- remark: item.remark,
|
|
|
+ remark: item.installRemark,
|
|
|
})),
|
|
|
},
|
|
|
children: [
|
|
@@ -856,6 +957,26 @@ export default {
|
|
|
parammaps: {
|
|
|
orderId: this.currentRow.id,
|
|
|
},
|
|
|
+ }, // 在 handleDailyWriteConfirm 方法的 params.data 数组中添加:
|
|
|
+ {
|
|
|
+ name: "insertInstallationOrderProcessLog",
|
|
|
+ type: "e",
|
|
|
+ parammaps: {
|
|
|
+ orderId: this.currentRow.id,
|
|
|
+ operationType: "write",
|
|
|
+ operationUserId: this.currentUser.id,
|
|
|
+ operationUserName: this.currentUser.name,
|
|
|
+ beforeStatus: this.currentRow.statusName,
|
|
|
+ afterStatus: this.currentRow.statusName,
|
|
|
+ operationContent: `填写日期:${formData.dates.join(
|
|
|
+ ","
|
|
|
+ )}|产品名称:${formData.records
|
|
|
+ .map((item) => item.goodsName)
|
|
|
+ .join(",")}|数量:${formData.records.reduce(
|
|
|
+ (sum, item) => sum + (parseInt(item.todayQuantity) || 0),
|
|
|
+ 0
|
|
|
+ )}`,
|
|
|
+ },
|
|
|
},
|
|
|
],
|
|
|
};
|
|
@@ -890,6 +1011,19 @@ export default {
|
|
|
parammaps: {
|
|
|
orderId: row.id,
|
|
|
},
|
|
|
+ }, // 在 handleComplete 方法的 params.data 数组中添加:
|
|
|
+ {
|
|
|
+ name: "insertInstallationOrderProcessLog",
|
|
|
+ type: "e",
|
|
|
+ parammaps: {
|
|
|
+ orderId: row.id,
|
|
|
+ operationType: "complete",
|
|
|
+ operationUserId: this.currentUser.id,
|
|
|
+ operationUserName: this.currentUser.name,
|
|
|
+ beforeStatus: row.statusName,
|
|
|
+ afterStatus: "已完成未验收",
|
|
|
+ operationContent: "完成服务工单",
|
|
|
+ },
|
|
|
},
|
|
|
],
|
|
|
};
|
|
@@ -906,7 +1040,7 @@ export default {
|
|
|
this.$message.error("操作失败");
|
|
|
}
|
|
|
},
|
|
|
- // 验收
|
|
|
+ // 验收-获取客户联系人
|
|
|
async handleCheck(row) {
|
|
|
this.currentRow = row;
|
|
|
this.checkDialogVisible = true;
|
|
@@ -935,28 +1069,74 @@ export default {
|
|
|
common: {
|
|
|
returnmap: "0",
|
|
|
},
|
|
|
- data: [
|
|
|
- {
|
|
|
- name: "checkInstallationOrder",
|
|
|
- type: "e",
|
|
|
- parammaps: {
|
|
|
- orderId: formData.orderId,
|
|
|
- checkUserId: formData.serviceStaffId,
|
|
|
- checkUserName:
|
|
|
- this.installerOptions.find(
|
|
|
- (item) => item.id === formData.serviceStaffId
|
|
|
- )?.label || "",
|
|
|
- contactId: formData.customerContactId,
|
|
|
- contactName:
|
|
|
- this.customerContactOptions.find(
|
|
|
- (item) => item.id === formData.customerContactId
|
|
|
- )?.name || "",
|
|
|
- checkDate: formData.checkDate,
|
|
|
- contactImageId: formData.checkImage,
|
|
|
+ data: [],
|
|
|
+ };
|
|
|
+ if (formData.isNewContact) {
|
|
|
+ params.data.push({
|
|
|
+ name: "insertContacts",
|
|
|
+ type: "e",
|
|
|
+ parammaps: {
|
|
|
+ customerId: this.currentRow.customerId,
|
|
|
+ contactName: formData.customContact,
|
|
|
+ telephone: formData.telephone,
|
|
|
+ },
|
|
|
+ });
|
|
|
+ }
|
|
|
+ // 处理验收图片
|
|
|
+ if (formData.checkImage.length > 0) {
|
|
|
+ params.data.push({
|
|
|
+ name: "insertInstallationOrderImages",
|
|
|
+ resultmaps: {
|
|
|
+ list: formData.checkImage.map((item, index) => ({
|
|
|
+ imageId: item,
|
|
|
+ imageType: "check_image",
|
|
|
+ })),
|
|
|
+ },
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ name: "insertInstallationOrderImages",
|
|
|
+ type: "e",
|
|
|
+ parammaps: {
|
|
|
+ orderId: this.currentRow.id,
|
|
|
+ imageId: "@insertInstallationOrderImages.imageId",
|
|
|
+ imageType: "@insertInstallationOrderImages.imageType",
|
|
|
+ },
|
|
|
},
|
|
|
+ ],
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ params.data.push(
|
|
|
+ {
|
|
|
+ name: "checkInstallationOrder",
|
|
|
+ type: "e",
|
|
|
+ parammaps: {
|
|
|
+ orderId: formData.orderId,
|
|
|
+ checkUserId: formData.serviceStaffId,
|
|
|
+ checkUserName:
|
|
|
+ this.installerOptions.find(
|
|
|
+ (item) => item.id === formData.serviceStaffId
|
|
|
+ )?.label || "",
|
|
|
+ contactId: formData.isNewContact
|
|
|
+ ? "@insertContacts.LastInsertId"
|
|
|
+ : formData.customContact,
|
|
|
+ checkDate: formData.checkDate,
|
|
|
},
|
|
|
- ],
|
|
|
- };
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "insertInstallationOrderProcessLog",
|
|
|
+ type: "e",
|
|
|
+ parammaps: {
|
|
|
+ orderId: this.currentRow.id,
|
|
|
+ operationType: "check",
|
|
|
+ operationUserId: this.currentUser.id,
|
|
|
+ operationUserName: this.currentUser.name,
|
|
|
+ beforeStatus: this.currentRow.statusName,
|
|
|
+ afterStatus: "已完成",
|
|
|
+ operationContent: "验收服务工单",
|
|
|
+ },
|
|
|
+ }
|
|
|
+ );
|
|
|
|
|
|
const response = await ExecDataByConfig(params);
|
|
|
if (response.msg === "ok") {
|
|
@@ -1010,11 +1190,17 @@ export default {
|
|
|
handleEditSuccess() {
|
|
|
this.getList(); // 刷新列表数据
|
|
|
},
|
|
|
- getProgressBarColor(progress) {
|
|
|
- if (progress >= 100) return "#67C23A"; // 完成
|
|
|
- if (progress >= 80) return "#409EFF"; // 接近完成
|
|
|
- if (progress >= 50) return "#E6A23C"; // 过半
|
|
|
- return "#909399"; // 开始阶段
|
|
|
+ getProgressBarColor(status) {
|
|
|
+ // 根据状态返回对应的颜色
|
|
|
+ const statusColorMap = {
|
|
|
+ 未接单: "#909399", // 灰色
|
|
|
+ 处理中: "#409eff", // 蓝色
|
|
|
+ 已完成未验收: "#e6a23c", // 橙色
|
|
|
+ 已完成: "#67c23a", // 绿色
|
|
|
+ 接单驳回: "#f56c6c", // 红色
|
|
|
+ };
|
|
|
+
|
|
|
+ return statusColorMap[status] || "#909399";
|
|
|
},
|
|
|
showProgressTooltip(event, percentage) {
|
|
|
this.progressTooltip = document.createElement("div");
|
|
@@ -1067,6 +1253,19 @@ export default {
|
|
|
rejectReason: formData.rejectReason,
|
|
|
},
|
|
|
},
|
|
|
+ {
|
|
|
+ name: "insertInstallationOrderProcessLog",
|
|
|
+ type: "e",
|
|
|
+ parammaps: {
|
|
|
+ orderId: this.currentRow.id,
|
|
|
+ operationType: "reject",
|
|
|
+ operationUserId: this.currentUser.id,
|
|
|
+ operationUserName: this.currentUser.name,
|
|
|
+ beforeStatus: this.currentRow.statusName,
|
|
|
+ afterStatus: "接单驳回",
|
|
|
+ operationContent: `驳回原因:${formData.rejectReason}`,
|
|
|
+ },
|
|
|
+ },
|
|
|
],
|
|
|
};
|
|
|
|
|
@@ -1100,6 +1299,19 @@ export default {
|
|
|
acceptName: this.currentUser.name,
|
|
|
},
|
|
|
},
|
|
|
+ {
|
|
|
+ name: "insertInstallationOrderProcessLog",
|
|
|
+ type: "e",
|
|
|
+ parammaps: {
|
|
|
+ orderId: this.currentRow.id,
|
|
|
+ operationType: "accept",
|
|
|
+ operationUserId: this.currentUser.id,
|
|
|
+ operationUserName: this.currentUser.name,
|
|
|
+ beforeStatus: this.currentRow.statusName,
|
|
|
+ afterStatus: "处理中",
|
|
|
+ operationContent: "接单处理",
|
|
|
+ },
|
|
|
+ },
|
|
|
],
|
|
|
};
|
|
|
|