From 10be60669d627bf4c1f6f10a3b6bc485ee5faad4 Mon Sep 17 00:00:00 2001
From: rain <1679827795@qq.com>
Date: Sun, 27 Apr 2025 10:46:22 +0800
Subject: [PATCH] 取消流程状态工单发起和任务发起流程,优化列表排版布局
---
src/views/tickets/ticket.vue | 131 ++++++++++++++++---------------------------
1 files changed, 50 insertions(+), 81 deletions(-)
diff --git a/src/views/tickets/ticket.vue b/src/views/tickets/ticket.vue
index 60b7ae4..5dcc0d3 100644
--- a/src/views/tickets/ticket.vue
+++ b/src/views/tickets/ticket.vue
@@ -50,10 +50,10 @@
</template>
</template>
<template #status="{ row }">
- <span :style="getStatusTagType(row.status) ? 'color:' + getStatusTagType(row.status) : ''">
- {{ mapStatus(row.status) }}
- </span>
-</template>
+ <span :style="getStatusTagType(row.status) ? 'color:' + getStatusTagType(row.status) : ''">
+ {{ mapStatus(row.status) }}
+ </span>
+ </template>
<template #keyData="{ row }">
<span>{{ row.address }}</span>
</template>
@@ -133,17 +133,9 @@
</el-col>
<el-col :span="12">
<el-form-item label="附件图片" prop="photos" required class="upload-wrapper">
- <el-upload ref="upload"
- :action="'#'"
- :auto-upload="false"
- list-type="picture-card"
- :on-change="handleFileChange"
- :on-remove="handleUploadRemove"
- :before-upload="beforeUpload"
- :file-list="form.photos"
- :limit="1"
- accept="image/*"
- class="create-upload">
+ <el-upload ref="upload" :action="'#'" :auto-upload="false" list-type="picture-card"
+ :on-change="handleFileChange" :on-remove="handleUploadRemove" :before-upload="beforeUpload"
+ :file-list="form.photos" :limit="1" accept="image/*" class="create-upload">
<template v-if="form.photos.length < 1">
<i class="el-icon-plus">+</i>
</template>
@@ -175,9 +167,6 @@
<div class="custom-steps-container">
<!-- 标题行 -->
<div class="steps-titles">
- <div class="step-title active">
- {{ workType === 1 ? '发起工单' : '发起任务' }}
- </div>
<div v-for="(status, index) in stepStatusList" :key="index" :class="{
'step-title': true,
'active': index <= stepStatusList.indexOf(String(currentDetail.status))
@@ -187,22 +176,7 @@
</div>
<!-- Element Steps 组件 -->
- <el-steps :active="getActiveStep()" align-center class="custom-steps">
- <el-step>
- <template #description>
- <span class="step-description">
- {{ currentDetail.creator || '未知' }}
- </span>
- <div class="step-description">
- <template v-if="workType === 0">
- {{ currentDetail.job_create_time || currentDetail.startTime || '未知时间' }}
- </template>
- <template v-else>
- {{ currentDetail.startTime || '未知时间' }}
- </template>
- </div>
- </template>
- </el-step>
+ <el-steps :active="getActiveStep() - 1" align-center class="custom-steps">
<el-step v-for="(status, index) in stepStatusList" :key="index">
<template #description>
<span class="step-description">
@@ -244,7 +218,8 @@
<el-table-column prop="label2" label="基本信息" width="150">
<template #default="{ row }">
<!-- 添加必填星号的标签 -->
- <span v-if="currentDetail.status === 0 && (row.label2 === '工单类型' || row.label2 === '工单内容')" class="required-label">
+ <span v-if="currentDetail.status === 0 && (row.label2 === '工单类型' || row.label2 === '工单内容')"
+ class="required-label">
<span class="required-star">*</span>{{ row.label2 }}
</span>
<span v-else>{{ row.label2 }}</span>
@@ -259,7 +234,8 @@
</el-select>
</template>
<template v-else-if="currentDetail.status === 0 && row.label2 === '工单内容' && hasProcessingBtnPermission()">
- <el-input type="textarea" v-model="currentDetail.content" placeholder="请输入工单内容" class="required-input" />
+ <el-input type="textarea" v-model="currentDetail.content" placeholder="请输入工单内容"
+ class="required-input" />
</template>
<template v-else>{{ row.value2 }}</template>
</template>
@@ -305,17 +281,9 @@
上传图片
</template>
</div>
- <el-upload v-if="hasProcessedAndOverBtnPermission()"
- ref="upload"
- :action="'#'"
- :auto-upload="false"
- list-type="picture-card"
- :on-change="handleFileChange"
- :on-remove="handleUploadRemove"
- :before-upload="beforeUpload"
- :file-list="currentDetail.photos || []"
- :limit="1"
- accept="image/*"
+ <el-upload v-if="hasProcessedAndOverBtnPermission()" ref="upload" :action="'#'" :auto-upload="false"
+ list-type="picture-card" :on-change="handleFileChange" :on-remove="handleUploadRemove"
+ :before-upload="beforeUpload" :file-list="currentDetail.photos || []" :limit="1" accept="image/*"
class="detail-upload">
<template v-if="!currentDetail.photos || currentDetail.photos.length < 1">
<i class="el-icon-plus">+</i>
@@ -449,7 +417,8 @@
</el-dialog>
<!-- 添加在其他 dialog 组件之后 -->
- <el-dialog v-model="reviewDialogVisible" title="批量审核" width="70%" append-to-body custom-class="review-dialog" @close="cancleBatchReject">
+ <el-dialog v-model="reviewDialogVisible" title="批量审核" width="70%" append-to-body custom-class="review-dialog"
+ @close="cancleBatchReject">
<div class="review-container">
<div class="review-image-wrapper">
<!-- 修改左右箭头的显示条件 -->
@@ -566,17 +535,17 @@
page: true,
column: [
// { label: "序号", prop: "id", width: 70 },
- { label: "工单编号", prop: "orderNumber", width: 150 },
+ { label: "工单编号", prop: "orderNumber", width: 150 ,overHidden: true, tooltip: true},
{ label: "工单名称", prop: "orderName", width: 170, overHidden: true, tooltip: true },
- { label: "所属单位", prop: "department", width: 100 },
+ { label: "所属单位", prop: "department", width: 100 ,overHidden: true, tooltip: true},
{ label: "发起时间", prop: "startTime", width: 160 },
- { label: "关联算法", prop: "aiType", width: 160 },
- { label: "工单类型", prop: "type", width: 108 },
+ { label: "关联算法", prop: "aiType", width: 160 ,overHidden: true, tooltip: true},
+ { label: "工单类型", prop: "type", width: 120 ,overHidden: true, tooltip: true},
{
label: "工单内容",
prop: "content",
slot: true,
- width: 212,
+ width: 190,
overHidden: true
},
{ label: "创建人", prop: "creator", width: 100 },
@@ -1014,7 +983,7 @@
startTime: item.create_time,
aiType: item.ai_types,
content: item.content, // 将后端返回的 content 映射为 content
- type: this.types.find(t => t.value === item.work_order_type_dict_key)?.label,
+ type: this.types.find(t => t.value === item.event_dict_key)?.label,
keyData: (!isNaN(longitude) && !isNaN(latitude))
? `${longitude.toFixed(6)}, ${latitude.toFixed(6)}`
: '未知位置',
@@ -1079,7 +1048,7 @@
longitude: String(this.form.location[0]),
latitude: String(this.form.location[1]),
address: this.form.address,
- workOrderTypeDictKey: this.form.type,
+ eventDictKey: this.form.type,
aiType: Array.isArray(this.form.algorithm) ? this.form.algorithm : [this.form.algorithm], // 传数组
updateUser: this.form.handler,
createDept: this.form.department,
@@ -1133,7 +1102,7 @@
longitude: this.form.location?.[0] ? String(this.form.location[0]) : undefined,
latitude: this.form.location?.[1] ? String(this.form.location[1]) : undefined,
address: this.form.address || undefined,
- workOrderTypeDictKey: this.form.type || undefined,
+ eventDictKey: this.form.type || undefined,
aiType: Array.isArray(this.form.algorithm) ? this.form.algorithm : [this.form.algorithm], // 传数组
updateUser: handlerValue,
createDept: this.form.department || undefined,
@@ -1207,18 +1176,18 @@
},
getStatusTagType(status) {
- // 草稿不加颜色
- if (status === -1 || status === "-1") return '';
- // 状态颜色映射
- const colorMap = {
- "0": "#ffb6b6", // 待处理-淡红
- "3": "#e57373", // 处理中-更淡红
- "2": "#faad14", // 待审核-橙色
- "4": "#a0cfff", // 已完成-淡蓝
- "5": "#67c23a", // 已完结-绿色
- };
- return colorMap[String(status)] || '';
-},
+ // 草稿不加颜色
+ if (status === -1 || status === "-1") return '';
+ // 状态颜色映射
+ const colorMap = {
+ "0": "#ffb6b6", // 待处理-淡红
+ "3": "#e57373", // 处理中-更淡红
+ "2": "#faad14", // 待审核-橙色
+ "4": "#a0cfff", // 已完成-淡蓝
+ "5": "#67c23a", // 已完结-绿色
+ };
+ return colorMap[String(status)] || '';
+ },
async fetchTabCounts() {
try {
@@ -1495,7 +1464,7 @@
发起时间: item.create_time || '',
关联算法: item.ai_types || '',
工单内容: item.address || '',
- 工单类型: this.types.find(t => t.value === item.work_order_type_dict_key)?.label || '',
+ 工单类型: this.types.find(t => t.value === item.event_dict_key)?.label || '',
经纬度: (!isNaN(longitude) && !isNaN(latitude)) ? `${longitude.toFixed(6)}, ${latitude.toFixed(6)}` : '',
创建人: item.create_user || '',
处理人: item.update_user || '',
@@ -1689,7 +1658,7 @@
},
async approveAndDispatch() {
if (this.dispatchLoading) return;
-
+
// 添加必填项检查
if (!this.currentDetail.orderName || !this.currentDetail.orderName.trim()) {
this.$message.warning('请填写工单名称');
@@ -1703,7 +1672,7 @@
this.$message.warning('请填写工单内容');
return;
}
-
+
// 通过验证后,打开派发对话框
this.dispatchDialogVisible = true;
},
@@ -1837,7 +1806,7 @@
}
// 获取工单类型值 - 从types中找到匹配的值
- const typeValue = this.types.find(t => t.label === row.type)?.value || row.work_order_type_dict_key;
+ const typeValue = this.types.find(t => t.label === row.type)?.value || row.event_dict_key;
// 获取处理人ID - 使用userNameToIdMap映射
const handlerId = this.userNameToIdMap[row.handler] || row.handler;
@@ -2058,10 +2027,10 @@
cancleBatchReject() {
this.reviewDialogVisible = false;
- this.selections = [];
- this.currentImageIndex = 1;
- this.currentReviewImage = '';
- this.fetchTableData();
+ this.selections = [];
+ this.currentImageIndex = 1;
+ this.currentReviewImage = '';
+ this.fetchTableData();
},
// 批量审核不通过
async handleBatchReject() {
@@ -2804,12 +2773,12 @@
height: 100px;
line-height: 100px;
}
-
+
/* 隐藏额外的上传按钮 */
:deep(.el-upload.el-upload--picture-card) {
display: none;
}
-
+
/* 当没有图片时显示上传按钮 */
:deep(.el-upload.el-upload--picture-card:first-child) {
display: flex;
@@ -2827,7 +2796,7 @@
:deep(.el-image) {
width: 700px !important;
height: 520px !important;
-
+
.el-image__inner {
width: 100%;
height: 100%;
@@ -2849,7 +2818,7 @@
.required-label {
position: relative;
display: inline-block;
-
+
.required-star {
color: #F56C6C;
margin-right: 4px;
@@ -2859,7 +2828,7 @@
/* 必填输入框样式 */
.required-input {
width: 100%;
-
+
:deep(.el-input__inner),
:deep(.el-textarea__inner) {
&:focus {
--
Gitblit v1.9.3