Jelajahi Sumber

reactor:工单关键词;

zhangchong 1 tahun lalu
induk
melakukan
c3454f43f6

+ 18 - 2
src/components/OrderDetail/index.vue

@@ -166,7 +166,7 @@
 							</el-col>
 							<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
 								<el-form-item label="受理内容">
-									{{ state.ruleForm.content }}
+									<div v-html="showKeyWord(state.ruleForm.content, state.ruleForm.keywords)"></div>
 								</el-form-item>
 							</el-col>
 							<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
@@ -589,6 +589,21 @@ const state = reactive<any>({
 const showMaskNumber = ref<boolean>(true); // 是否展示号码
 const ruleFormRef = ref<RefType>(); // 表单ref
 const router = useRouter(); // 路由
+// 高亮关键词
+const showKeyWord = (val: string[], keywordArr: string[]) => {
+	let str = val;
+	if (keywordArr && keywordArr.length) {
+		// 2.定制关键词对应正则
+		keywordArr.forEach((e) => {
+			let regStr = '' + `(${e})`;
+			let reg = new RegExp(regStr, 'g');
+			// 3.正则替换,关键词飘红
+			str = str.replace(reg, '<span class="color-danger font-bold"">' + e + '</span>');
+		});
+	}
+	return str;
+};
+
 // 查看工单详情
 const getOrderDetail = async (id: string) => {
 	state.loading = true;
@@ -598,6 +613,7 @@ const getOrderDetail = async (id: string) => {
 		state.ruleForm.files = transformFile(state.ruleForm.files);
 		state.workflow = state.ruleForm?.workflow ?? {};
 		state.supplements = res.result?.workflow?.supplements ?? [];
+		state.ruleForm.keywords = ['书记', '市长'];
 		state.loading = false;
 		state.dialogVisible = true;
 	} catch (error) {
@@ -620,7 +636,7 @@ const getHistoryList = async () => {
 };
 // 查询市民画像
 const citizenPortraitRef = ref<RefType>(); // 市民画像
-const getPortraitList = async (id: string) => {
+const getPortraitList = async () => {
 	state.loading = true;
 	try {
 		citizenPortraitRef.value?.getCitizen(state.ruleForm);

+ 22 - 3
src/views/home/component/ToDo.vue

@@ -42,7 +42,7 @@
 					<span>{{ row.isProvince ? '省工单' : '市工单' }}</span>
 				</template>
 				<template #title="{ row }">
-					<order-detail :order="row" @updateList="handleChange(activeName)">{{ row.title }}</order-detail>
+					<order-detail :order="row" @updateList="handleChange(activeName)" :type="row.canSign ? 'danger' : 'primary'">{{ row.title }}</order-detail>
 				</template>
 				<template #employeeName="{ row }">
 					<span
@@ -51,6 +51,7 @@
 				</template>
 				<!-- 表格操作 -->
 				<template #operation="{ row }">
+					<el-button link type="primary" @click="onSign(row)" title="签收工单" v-if="row.canSign"> 签收 </el-button>
 					<order-detail :order="row" @updateList="handleChange(activeName)" />
 				</template>
 			</ProTable>
@@ -119,7 +120,7 @@ const todoColumns = [
 	{ prop: 'sourceChannel', label: '来源方式', width: 100 },
 	{ prop: 'hotspotName', label: '热点分类', width: 100 },
 	{ prop: 'employeeName', label: '受理人', width: 170 },
-	{ prop: 'operation', label: '操作', fixed: 'right', width: 170, align: 'center' },
+	{ prop: 'operation', label: '操作', fixed: 'right', width: 160, align: 'center' },
 ];
 // 工单坐席待办表头
 const seatsColumns = [
@@ -157,7 +158,7 @@ const seatsColumns = [
 	{ prop: 'emergencyLevelText', label: '紧急程度', width: 100 },
 	{ prop: 'hotspotName', label: '热点分类', width: 100 },
 	{ prop: 'employeeName', label: '受理人', width: 150 },
-	{ prop: 'operation', label: '操作', fixed: 'right', width: 190, align: 'center' },
+	{ prop: 'operation', label: '操作', fixed: 'right', width: 160, align: 'center' },
 ];
 // tab切换
 const handleChange = async (tab: any) => {
@@ -220,6 +221,24 @@ const linkList = () => {
 			break;
 	}
 };
+// 签收工单
+const onSign = (row: any) => {
+	ElMessageBox.confirm(`您确定要要签收【${row.title}】,是否继续?`, '提示', {
+		confirmButtonText: '确认',
+		cancelButtonText: '取消',
+		type: 'warning',
+		draggable: true,
+		cancelButtonClass: 'default-button',
+		autofocus: false,
+	})
+		.then(() => {
+			orderSign(row.id).then(() => {
+				ElMessage.success('签收成功');
+				handleChange(activeName.value);
+			});
+		})
+		.catch(() => {});
+};
 onMounted(() => {
 	getTableAndNum();
 });

+ 8 - 0
src/views/todo/seats/accept/index.vue

@@ -443,6 +443,14 @@
 										</el-col>
 									</el-row>
 								</el-col>
+                <!-- 宜宾特殊需求,可配置开关 -->
+<!--                <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
+                  <el-form-item label="是否行政执法工单" label-width="140px" prop="isRepeat" :rules="[{ required: true, message: '请选择是否行政执法工单', trigger: 'change' }]">
+                    <el-radio-group v-model="state.ruleForm.isRepeat">
+                      <el-radio :label="item.key" v-for="item in state.repeatOptions" :key="item.key">{{ item.value }}</el-radio>
+                    </el-radio-group>
+                  </el-form-item>
+                </el-col>-->
 								<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
 									<el-form-item label="工单标题" prop="title" :rules="[{ required: true, message: '请填写工单标题', trigger: 'blur' }]">
 										<el-input v-model="state.ruleForm.title" placeholder="请填写工单标题" clearable @input="inputTitle"> </el-input>