|
@@ -411,7 +411,7 @@
|
|
|
v-if="
|
|
|
checkButtonPermission(
|
|
|
'productManagement:installationOrder:edit'
|
|
|
- )
|
|
|
+ ) && isCurrentUserInCreateId(scope.row.createId)
|
|
|
"
|
|
|
>编辑</el-button
|
|
|
>
|
|
@@ -422,7 +422,7 @@
|
|
|
v-if="
|
|
|
checkButtonPermission(
|
|
|
'productManagement:installationOrder:dispatch'
|
|
|
- )
|
|
|
+ ) && isCurrentUserInCreateId(scope.row.createId)
|
|
|
"
|
|
|
>派单</el-button
|
|
|
>
|
|
@@ -437,7 +437,7 @@
|
|
|
v-if="
|
|
|
checkButtonPermission(
|
|
|
'productManagement:installationOrder:reject'
|
|
|
- )
|
|
|
+ ) && isCurrentUserInServiceStaff(scope.row.serviceStaffIds)
|
|
|
"
|
|
|
>驳回</el-button
|
|
|
>
|
|
@@ -452,7 +452,7 @@
|
|
|
v-if="
|
|
|
checkButtonPermission(
|
|
|
'productManagement:installationOrder:accept'
|
|
|
- )
|
|
|
+ ) && isCurrentUserInServiceStaff(scope.row.serviceStaffIds)
|
|
|
"
|
|
|
>接单</el-button
|
|
|
>
|
|
@@ -463,12 +463,28 @@
|
|
|
v-if="
|
|
|
checkButtonPermission(
|
|
|
'productManagement:installationOrder:delete'
|
|
|
- )
|
|
|
+ ) && isCurrentUserInCreateId(scope.row.createId)
|
|
|
"
|
|
|
>删除</el-button
|
|
|
>
|
|
|
</template>
|
|
|
- <template v-else-if="scope.row.statusName === '处理中'">
|
|
|
+ <template
|
|
|
+ v-else-if="
|
|
|
+ scope.row.statusName === '处理中' ||
|
|
|
+ scope.row.statusName === '已接单'
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="success"
|
|
|
+ @click="handleDispatch(scope.row)"
|
|
|
+ v-if="
|
|
|
+ checkButtonPermission(
|
|
|
+ 'productManagement:installationOrder:dispatch'
|
|
|
+ ) && isCurrentUserInCreateId(scope.row.createId)
|
|
|
+ "
|
|
|
+ >派单</el-button
|
|
|
+ >
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
style="
|
|
@@ -480,7 +496,7 @@
|
|
|
v-if="
|
|
|
checkButtonPermission(
|
|
|
'productManagement:installationOrder:dailyWrite'
|
|
|
- )
|
|
|
+ ) && isCurrentUserInServiceStaff(scope.row.serviceStaffIds)
|
|
|
"
|
|
|
>填写</el-button
|
|
|
>
|
|
@@ -491,7 +507,7 @@
|
|
|
v-if="
|
|
|
checkButtonPermission(
|
|
|
'productManagement:installationOrder:complete'
|
|
|
- )
|
|
|
+ ) && isCurrentUserInServiceStaff(scope.row.serviceStaffIds)
|
|
|
"
|
|
|
>完成</el-button
|
|
|
>
|
|
@@ -599,6 +615,7 @@
|
|
|
<daily-write-dialog
|
|
|
:visible.sync="dailyWriteDialogVisible"
|
|
|
:row-data="currentRow"
|
|
|
+ :current-user="currentUser"
|
|
|
@confirm="handleDailyWriteConfirm"
|
|
|
/>
|
|
|
|
|
@@ -701,10 +718,13 @@ export default {
|
|
|
orderNo: "",
|
|
|
deliveryNo: "",
|
|
|
contractNo: "",
|
|
|
+ userId: Cookies.get("g_userId") || "",
|
|
|
+ roleId: Cookies.get("g_roleId") || "",
|
|
|
},
|
|
|
// 状态选项
|
|
|
statusOptions: [
|
|
|
{ label: "未接单", value: "未接单" },
|
|
|
+ { label: "已接单", value: "已接单" },
|
|
|
{ label: "处理中", value: "处理中" },
|
|
|
{ label: "已完成未验收", value: "已完成未验收" },
|
|
|
{ label: "已完成", value: "已完成" },
|
|
@@ -751,6 +771,7 @@ export default {
|
|
|
currentUser: {
|
|
|
id: Cookies.get("g_userId") || "",
|
|
|
name: Cookies.get("g_empname") || "",
|
|
|
+ roleId: Cookies.get("g_roleId") || "",
|
|
|
},
|
|
|
editDialogVisible: false,
|
|
|
viewDialogVisible: false,
|
|
@@ -796,15 +817,26 @@ export default {
|
|
|
this.loading = true;
|
|
|
|
|
|
// 使用参数处理混入方法
|
|
|
- const send_data = this.handleParams(
|
|
|
- this.queryParams,
|
|
|
- "getInstallationOrderList"
|
|
|
- );
|
|
|
+ const send_data = [
|
|
|
+ this.handleParams(this.queryParams, "getInstallationOrderList"),
|
|
|
+ {
|
|
|
+ name: "getInstallationOrderToDoNum",
|
|
|
+ offset: 0,
|
|
|
+ pagecount: 0,
|
|
|
+ parammaps: {
|
|
|
+ userId: this.currentUser.id,
|
|
|
+ roleId: this.currentUser.roleId,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ];
|
|
|
|
|
|
- GetDataByName(send_data)
|
|
|
+ GetDataByNames(send_data)
|
|
|
.then((response) => {
|
|
|
- this.tableData = response.data.list || [];
|
|
|
- this.total = response.data.total || 0;
|
|
|
+ this.tableData = response.data.getInstallationOrderList.list || [];
|
|
|
+ this.total = response.data.getInstallationOrderList.total || 0;
|
|
|
+ // 获取处理工单数量
|
|
|
+ this.pendingCount =
|
|
|
+ response.data.getInstallationOrderToDoNum.list[0].num;
|
|
|
this.loading = false;
|
|
|
})
|
|
|
.catch((error) => {
|
|
@@ -831,12 +863,6 @@ export default {
|
|
|
pid: "79",
|
|
|
},
|
|
|
},
|
|
|
- {
|
|
|
- name: "getInstallationOrderToDoNum",
|
|
|
- offset: 0,
|
|
|
- pagecount: 0,
|
|
|
- parammaps: {},
|
|
|
- },
|
|
|
];
|
|
|
|
|
|
GetDataByNames(send_select_list)
|
|
@@ -853,10 +879,6 @@ export default {
|
|
|
this.projectOptions = response.data.getDictListSelect.list || [];
|
|
|
|
|
|
console.log("项目下拉框", this.projectOptions);
|
|
|
-
|
|
|
- // 获取处理工单数量
|
|
|
- this.pendingCount =
|
|
|
- response.data.getInstallationOrderToDoNum.list[0].num;
|
|
|
})
|
|
|
.catch((error) => {
|
|
|
console.error("获取下拉框数据失败:", error);
|
|
@@ -906,6 +928,7 @@ export default {
|
|
|
getStatusType(statusName) {
|
|
|
const statusMap = {
|
|
|
未接单: "info",
|
|
|
+ 已接单: "primary",
|
|
|
处理中: "primary",
|
|
|
已完成: "success",
|
|
|
已完成未验收: "warning",
|
|
@@ -1001,6 +1024,7 @@ export default {
|
|
|
type: "e",
|
|
|
parammaps: {
|
|
|
datas: formData.dates.join(","),
|
|
|
+ userId: this.currentUser.id,
|
|
|
orderId: this.currentRow.id,
|
|
|
},
|
|
|
},
|
|
@@ -1046,6 +1070,13 @@ export default {
|
|
|
parammaps: {
|
|
|
orderId: this.currentRow.id,
|
|
|
},
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "updateDailyDetailYesterdayAndBeforeQuantity",
|
|
|
+ type: "e",
|
|
|
+ parammaps: {
|
|
|
+ orderId: this.currentRow.id,
|
|
|
+ },
|
|
|
}, // 在 handleDailyWriteConfirm 方法的 params.data 数组中添加:
|
|
|
{
|
|
|
name: "insertInstallationOrderProcessLog",
|
|
@@ -1261,6 +1292,7 @@ export default {
|
|
|
// 根据状态返回对应的颜色
|
|
|
const statusColorMap = {
|
|
|
未接单: "#909399", // 灰色
|
|
|
+ 已接单: "#409eff", // 蓝色
|
|
|
处理中: "#409eff", // 蓝色
|
|
|
已完成未验收: "#e6a23c", // 橙色
|
|
|
已完成: "#67c23a", // 绿色
|
|
@@ -1270,6 +1302,9 @@ export default {
|
|
|
return statusColorMap[status] || "#909399";
|
|
|
},
|
|
|
showProgressTooltip(event, percentage) {
|
|
|
+ // 先移除可能存在的旧tooltip
|
|
|
+ this.hideProgressTooltip();
|
|
|
+
|
|
|
this.progressTooltip = document.createElement("div");
|
|
|
this.progressTooltip.className = "progress-tooltip";
|
|
|
this.progressTooltip.textContent = (() => {
|
|
@@ -1289,19 +1324,27 @@ export default {
|
|
|
rect.left + rect.width / 2 - tooltipRect.width / 2 + "px";
|
|
|
this.progressTooltip.style.top = rect.top - tooltipRect.height - 8 + "px";
|
|
|
|
|
|
- setTimeout(() => {
|
|
|
- this.progressTooltip.classList.add("show");
|
|
|
- }, 0);
|
|
|
+ // 使用 requestAnimationFrame 确保 DOM 更新后再添加显示类
|
|
|
+ requestAnimationFrame(() => {
|
|
|
+ if (this.progressTooltip) {
|
|
|
+ this.progressTooltip.classList.add("show");
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
hideProgressTooltip() {
|
|
|
if (this.progressTooltip) {
|
|
|
+ // 移除显示类
|
|
|
this.progressTooltip.classList.remove("show");
|
|
|
- setTimeout(() => {
|
|
|
- if (this.progressTooltip && this.progressTooltip.parentNode) {
|
|
|
- this.progressTooltip.parentNode.removeChild(this.progressTooltip);
|
|
|
+
|
|
|
+ // 确保移除所有可能存在的旧tooltip
|
|
|
+ const oldTooltips = document.querySelectorAll(".progress-tooltip");
|
|
|
+ oldTooltips.forEach((tooltip) => {
|
|
|
+ if (tooltip.parentNode) {
|
|
|
+ tooltip.parentNode.removeChild(tooltip);
|
|
|
}
|
|
|
- this.progressTooltip = null;
|
|
|
- }, 200);
|
|
|
+ });
|
|
|
+
|
|
|
+ this.progressTooltip = null;
|
|
|
}
|
|
|
},
|
|
|
// 处理驳回确认
|
|
@@ -1399,6 +1442,21 @@ export default {
|
|
|
tableRowClassName({ row }) {
|
|
|
return row.statusName === "已驳回" ? "rejected-row" : "";
|
|
|
},
|
|
|
+ // 判断当前用户是否在服务人员列表中
|
|
|
+ isCurrentUserInServiceStaff(serviceStaffIds) {
|
|
|
+ if (!serviceStaffIds) return false;
|
|
|
+ const currentUserId = parseInt(this.currentUser.id);
|
|
|
+ const staffIds = serviceStaffIds
|
|
|
+ .split(",")
|
|
|
+ .map((id) => parseInt(id.trim()));
|
|
|
+ return staffIds.includes(currentUserId);
|
|
|
+ },
|
|
|
+ // 判断当前用户是否是创建人
|
|
|
+ isCurrentUserInCreateId(createId) {
|
|
|
+ console.log("createId", createId, this.currentUser.id);
|
|
|
+ if (!createId) return false;
|
|
|
+ return createId === parseInt(this.currentUser.id);
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|