|
@@ -0,0 +1,508 @@
|
|
|
+<template>
|
|
|
+ <div class="order-add-container layout-padding">
|
|
|
+ <el-row :gutter="10" class="h100">
|
|
|
+ <!-- 中间工单信息 -->
|
|
|
+ <el-col :span="12" class="left-content mb20 h100" v-loading="state.formLoading">
|
|
|
+ <el-scrollbar class="h100" noresize>
|
|
|
+ <el-card shadow="never">
|
|
|
+ <el-form :model="state.ruleForm" ref="ruleFormRef" label-width="110px" label-position="right" scroll-to-error>
|
|
|
+ <p class="border-title mb10">来电信息</p>
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <!-- 服务坐席 -->
|
|
|
+ <el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="12">
|
|
|
+ <el-form-item label="服务坐席">
|
|
|
+ <span>{{ state.ruleForm.acceptorName }}</span>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <!-- 来源渠道 -->
|
|
|
+ <el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="12">
|
|
|
+ <!-- 手动创建 -->
|
|
|
+ <template v-if="state.createBy === 'manual'">
|
|
|
+ <el-form-item label="来源渠道" prop="channel" :rules="[{ required: true, message: '请选择来源渠道', trigger: 'change' }]">
|
|
|
+ <el-select
|
|
|
+ v-model="state.ruleForm.channel"
|
|
|
+ placeholder="请选择来源渠道"
|
|
|
+ class="w100"
|
|
|
+ clearable
|
|
|
+ value-key="dicDataValue"
|
|
|
+ @change="
|
|
|
+ (val) => {
|
|
|
+ ruleFormRef.resetFields('fromPhone');
|
|
|
+ state.ruleForm.fromPhone = null;
|
|
|
+ state.ruleForm.sourceChannel = val?.dicDataName ?? null;
|
|
|
+ state.ruleForm.sourceChannelCode = val?.dicDataValue ?? null;
|
|
|
+ }
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <el-option v-for="item in state.channelOptions" :value="item" :key="item.dicDataValue" :label="item.dicDataName" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
+ </el-col>
|
|
|
+ <el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="12">
|
|
|
+ <el-form-item label="来电人姓名" prop="fromName" :rules="[{ required: false, message: '请填写来电人姓名', trigger: 'blur' }]">
|
|
|
+ <el-input v-model="state.ruleForm.fromName" placeholder="请填写来电人姓名" clearable> </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="12">
|
|
|
+ <el-form-item label="联系电话" prop="contact" :rules="[{ required: false, message: '请填写联系电话', trigger: 'blur' }]">
|
|
|
+ <el-input v-model="state.ruleForm.contact" placeholder="请填写联系电话" clearable> </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <p class="border-title mb10">诉求信息</p>
|
|
|
+ <el-row>
|
|
|
+ <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" v-if="state.ruleForm.no">
|
|
|
+ <el-form-item label="工单编码">
|
|
|
+ {{ state.ruleForm.no }} <span v-if="state.ruleForm?.password">【{{ state.ruleForm.password }}】</span>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="12">
|
|
|
+ <el-form-item label="受理类型" prop="acceptTypeObj" :rules="[{ required: true, message: '请选择受理类型', trigger: 'change' }]">
|
|
|
+ <el-select
|
|
|
+ v-model="state.ruleForm.acceptTypeObj"
|
|
|
+ placeholder="请选择受理类型"
|
|
|
+ class="w100"
|
|
|
+ value-key="dicDataValue"
|
|
|
+ @change="
|
|
|
+ (val) => {
|
|
|
+ state.ruleForm.acceptType = val?.dicDataName ?? null;
|
|
|
+ state.ruleForm.acceptTypeCode = val?.dicDataValue ?? null;
|
|
|
+ }
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in state.acceptTypeOptions"
|
|
|
+ :key="item.dicDataValue"
|
|
|
+ :disabled="item.disabled"
|
|
|
+ :label="item.dicDataName"
|
|
|
+ :value="item"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="12">
|
|
|
+ <el-form-item label="执法部门" prop="acceptTypeObj" :rules="[{ required: true, message: '请选择执法部门', trigger: 'change' }]">
|
|
|
+ <el-select
|
|
|
+ v-model="state.ruleForm.acceptTypeObj"
|
|
|
+ placeholder="请选择执法部门"
|
|
|
+ class="w100"
|
|
|
+ value-key="dicDataValue"
|
|
|
+ @change="
|
|
|
+ (val) => {
|
|
|
+ state.ruleForm.acceptType = val?.dicDataName ?? null;
|
|
|
+ state.ruleForm.acceptTypeCode = val?.dicDataValue ?? null;
|
|
|
+ }
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in state.acceptTypeOptions"
|
|
|
+ :key="item.dicDataValue"
|
|
|
+ :disabled="item.disabled"
|
|
|
+ :label="item.dicDataName"
|
|
|
+ :value="item"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
|
|
|
+ <el-form-item label="热点分类" prop="hotspotId" :rules="[{ required: true, message: '请选择热点分类', trigger: 'change' }]">
|
|
|
+ <hot-spot-select
|
|
|
+ v-model="state.ruleForm.hotspotId"
|
|
|
+ class="w100"
|
|
|
+ :externalArr="state.hotspotExternal"
|
|
|
+ @choose="chooseHotSpot"
|
|
|
+ placeholder="请选择热点分类"
|
|
|
+ clearable
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
|
|
|
+ <el-row :gutter="0">
|
|
|
+ <el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="12">
|
|
|
+ <el-form-item
|
|
|
+ label="事发地址"
|
|
|
+ prop="areaCode"
|
|
|
+ :rules="[{ required: true, message: '请选择事发地址', trigger: 'change' }]"
|
|
|
+ v-loading="addressLoading"
|
|
|
+ >
|
|
|
+ <el-cascader
|
|
|
+ :options="state.areaOptions"
|
|
|
+ filterable
|
|
|
+ :props="{ value: 'id', label: 'areaName', emitPath: false, checkStrictly: true }"
|
|
|
+ placeholder="请选择事发地址"
|
|
|
+ class="w100"
|
|
|
+ v-model="state.ruleForm.areaCode"
|
|
|
+ ref="areaRef"
|
|
|
+ @change="changeArea"
|
|
|
+ >
|
|
|
+ </el-cascader>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="12">
|
|
|
+ <el-form-item
|
|
|
+ label=""
|
|
|
+ prop="street"
|
|
|
+ :rules="[{ required: false, message: '请填写详细地址', trigger: 'blur' }]"
|
|
|
+ label-width="10px"
|
|
|
+ class="w100 flex"
|
|
|
+ >
|
|
|
+ <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
|
|
|
+ <el-input v-model="state.ruleForm.street" placeholder="请填写详细地址" clearable> </el-input>
|
|
|
+ </el-col>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </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> </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
|
|
|
+ <el-form-item label="受理内容" prop="content" :rules="[{ required: true, message: '请填写受理内容', trigger: 'blur' }]">
|
|
|
+ <common-advice
|
|
|
+ @chooseAdvice="chooseAdvice"
|
|
|
+ v-model="state.ruleForm.content"
|
|
|
+ placeholder="请填写受理内容"
|
|
|
+ :loading="state.formLoading"
|
|
|
+ :commonEnum="commonEnum.Seat"
|
|
|
+ modal
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
|
|
|
+ <el-form-item label="附件" prop="files" :rules="[{ required: false, message: '请填写诉求内容', trigger: 'change' }]">
|
|
|
+ <annex-list :businessId="state.orderId" classify="受理上传" v-model="state.ruleForm.files" v-model:format="filesFormat" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :xs="24" :sm="12" :md="24" :lg="24" :xl="24">
|
|
|
+ <el-form-item>
|
|
|
+ <el-button class="default-button" @click="onCancel"> 取消 </el-button>
|
|
|
+ <el-button class="default-button" @click="save(ruleFormRef)" :loading="buttonLoading"> 保存 </el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ </el-card>
|
|
|
+ </el-scrollbar>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup lang="ts" name="judgeOrderAdd">
|
|
|
+import { defineAsyncComponent, onMounted, reactive, ref, watch } from 'vue';
|
|
|
+import type { FormInstance } from 'element-plus';
|
|
|
+import { ElMessage } from 'element-plus';
|
|
|
+import { storeToRefs } from 'pinia';
|
|
|
+import { useRoute, useRouter } from 'vue-router';
|
|
|
+import { throttle, transformFile } from '@/utils/tools';
|
|
|
+import { commonEnum } from '@/utils/constants';
|
|
|
+import { getCurrentCityConfig } from '@/utils/appConfig';
|
|
|
+import { orderAdd, orderBaseDataAdd, orderBaseExt, orderDetail, orderEdit } from '@/api/business/order';
|
|
|
+import { useUserInfo } from '@/stores/userInfo';
|
|
|
+import { treeArea } from '@/api/auxiliary/area';
|
|
|
+import mittBus from '@/utils/mitt';
|
|
|
+import { orderRepeatEvent } from '@/api/business/repeatEvent';
|
|
|
+
|
|
|
+// 引入组件
|
|
|
+const CommonAdvice = defineAsyncComponent(() => import('@/components/CommonAdvice/index.vue')); // 常用意见
|
|
|
+const AnnexList = defineAsyncComponent(() => import('@/components/AnnexList/index.vue')); // 附件列表
|
|
|
+const HotSpotSelect = defineAsyncComponent(() => import('@/components/Hotspot/index.vue')); // 选择热点
|
|
|
+// 定义变量内容
|
|
|
+const { cityName, cityCode } = getCurrentCityConfig();
|
|
|
+const state = reactive<any>({
|
|
|
+ createBy: 'manual', // 工单创建方式 默认手动创建 tel:来电弹单 letter:互联网来信 默认表示手动创建
|
|
|
+ ruleForm: {
|
|
|
+ sourceChannel: null, // 来源频道
|
|
|
+ sourceChannelCode: null, //来源频道code
|
|
|
+ fromPhone: null, // 来电号码
|
|
|
+ acceptorName: null, // 员工姓名
|
|
|
+ contact: null, // 联系电话
|
|
|
+ no: null, // 工单编码
|
|
|
+ title: null, // 工单标题
|
|
|
+ acceptType: null, // 受理类型
|
|
|
+ acceptTypeCode: null, // 受理类型code
|
|
|
+ hotspotId: '', // 热点分类
|
|
|
+ areaCode: cityCode, // 区域编码
|
|
|
+ city: cityName, // 市
|
|
|
+ street: null, // 街道
|
|
|
+ content: '', // 工单内容
|
|
|
+ },
|
|
|
+ formLoading: false, // 表单加载状态
|
|
|
+ hotspotExternal: [], // 热点分类外部数据
|
|
|
+ eventCategoryExternal: [], // 事件分类外部数据
|
|
|
+ acceptTypeOptions: [], // 受理类型
|
|
|
+ channelOptions: [], // 来源频道
|
|
|
+ emergencyLevelOptions: [], // 紧急程度
|
|
|
+ genderOptions: [], // 性别
|
|
|
+ identityTypeOptions: [], //来电人身份
|
|
|
+ licenceTypeOptions: [], // 证件类型
|
|
|
+ ageRangeOptions: [], // 年龄段
|
|
|
+ pushTypeOptions: [], //推送分类
|
|
|
+ areaOptions: [], //省市区
|
|
|
+ transpondCity: [],
|
|
|
+ focusOnEvents: [], // 重点关注事项
|
|
|
+ orderId: null, // 工单id
|
|
|
+ orgData: [],
|
|
|
+});
|
|
|
+const storesUserInfo = useUserInfo(); // 用户信息
|
|
|
+const { userInfos } = storeToRefs(storesUserInfo); // 用户信息
|
|
|
+state.ruleForm.acceptorName = userInfos.value.name; // 员工姓名
|
|
|
+state.ruleForm.acceptorStaffNo = userInfos.value.staffNo; // 员工工号
|
|
|
+const route = useRoute(); // 路由
|
|
|
+const router = useRouter(); // 路由
|
|
|
+// 选择热点分类
|
|
|
+const knowledgeRef = ref<RefType>();
|
|
|
+const chooseHotSpot = (val: any) => {
|
|
|
+ state.ruleForm.hotspotSpliceName = val?.hotSpotFullName; // 热点分类拼接名称
|
|
|
+ state.ruleForm.hotspotName = val?.hotSpotName; // 热点分类名称
|
|
|
+ state.ruleForm.hotspotCode = val?.provinceCode; // 热点分类code
|
|
|
+ state.ruleForm.hotspotExternal = val?.externalArr?.join(',') ?? ''; // 热点分类默认展开项
|
|
|
+ knowledgeRef.value.querySearch(state.ruleForm.hotspotName);
|
|
|
+};
|
|
|
+// 获取事发地址
|
|
|
+const areaRef = ref<RefType>();
|
|
|
+const changeArea = () => {
|
|
|
+ const currentNode = areaRef.value.getCheckedNodes();
|
|
|
+ // 判断数组长度
|
|
|
+ if (currentNode[0].pathLabels.length <= 4) {
|
|
|
+ state.ruleForm.city = currentNode[0].pathLabels[0] ?? ''; // 市
|
|
|
+ state.ruleForm.county = currentNode[0].pathLabels[1] ?? ''; // 区
|
|
|
+ state.ruleForm.town = currentNode[0].pathLabels[2] ?? ''; // 地区
|
|
|
+ } else {
|
|
|
+ // 如果数组长度大于4
|
|
|
+ state.ruleForm.city = currentNode[0].pathLabels[0] ?? ''; // 市
|
|
|
+ state.ruleForm.county = currentNode[0].pathLabels[1] ?? ''; // 区
|
|
|
+ state.ruleForm.town = currentNode[0].pathLabels[2] ?? ''; // 地区
|
|
|
+ state.ruleForm.areaText = currentNode[0].pathLabels.slice(3).join('') ?? ''; // 地区
|
|
|
+ console.log(state.ruleForm.areaText);
|
|
|
+ }
|
|
|
+};
|
|
|
+// 根据热点和事发地址去查询重复性事件 是否展示重复性事件
|
|
|
+const repeatEventRef = ref<RefType>();
|
|
|
+const showRepeatEvent = ref<boolean>(false);
|
|
|
+const stopWatch = watch([() => state.ruleForm.hotspotSpliceName, () => state.ruleForm.address], (value) => {
|
|
|
+ if (value[0] && value[1]) {
|
|
|
+ orderRepeatEvent({ hotspotSpliceName: value[0], address: value[1] }).then((res: any) => {
|
|
|
+ if (res.result) {
|
|
|
+ showRepeatEvent.value = true;
|
|
|
+ repeatEventRef.value.queryList();
|
|
|
+ } else {
|
|
|
+ showRepeatEvent.value = false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ showRepeatEvent.value = false;
|
|
|
+ }
|
|
|
+});
|
|
|
+stopWatch();
|
|
|
+const ruleFormRef = ref<RefType>();
|
|
|
+// 删除不必要的属性
|
|
|
+const deleteUnnecessaryProperties = (obj: any) => {
|
|
|
+ const propertiesToDelete = ['ageRangeObj', 'pushTypeObj', 'licenceTypeObj', 'channel', 'acceptTypeObj', 'transpondCity'];
|
|
|
+ propertiesToDelete.forEach((prop) => Reflect.deleteProperty(obj, prop));
|
|
|
+};
|
|
|
+const filesFormat = ref<EmptyArrayType>([]); // 附件列表格式化
|
|
|
+
|
|
|
+// 是否打开拓展表单
|
|
|
+const shouldOpenDialog = (obj: any) =>
|
|
|
+ !ExpandFormRef.value.state.validated &&
|
|
|
+ obj.orderExtension &&
|
|
|
+ obj.orderExtension.orderTypeCode &&
|
|
|
+ ['scjgjts,scjgjjb'].includes(obj.orderExtension.orderTypeCode);
|
|
|
+
|
|
|
+const buttonLoading = ref<boolean>(false);
|
|
|
+// 保存
|
|
|
+const save = throttle((formEl: FormInstance | undefined) => {
|
|
|
+ if (!formEl) return;
|
|
|
+ formEl.validate((valid: boolean) => {
|
|
|
+ if (!valid) return;
|
|
|
+ buttonLoading.value = true;
|
|
|
+ let orderDetail = {
|
|
|
+ ...state.ruleForm,
|
|
|
+ repeatableEventDetails: repeatableEventDetails.value,
|
|
|
+ files: filesFormat.value,
|
|
|
+ };
|
|
|
+ deleteUnnecessaryProperties(orderDetail);
|
|
|
+ const operation = state.orderId ? orderEdit : orderAdd;
|
|
|
+ const addOrderAndNavigate = () => {
|
|
|
+ operation(orderDetail)
|
|
|
+ .then(() => {
|
|
|
+ buttonLoading.value = false;
|
|
|
+ ElMessage.success('操作成功');
|
|
|
+ onCancel();
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ buttonLoading.value = false;
|
|
|
+ });
|
|
|
+ };
|
|
|
+ if (shouldOpenDialog(orderDetail)) {
|
|
|
+ ExpandFormRef.value.openDialog(true);
|
|
|
+ } else {
|
|
|
+ addOrderAndNavigate();
|
|
|
+ }
|
|
|
+ });
|
|
|
+}, 300);
|
|
|
+// 选中常用意见
|
|
|
+const chooseAdvice = (item: any) => {
|
|
|
+ state.ruleForm.content += item.content;
|
|
|
+};
|
|
|
+// 取消
|
|
|
+const onCancel = () => {
|
|
|
+ mittBus.emit('clearCache', 'todoSeats');
|
|
|
+ mittBus.emit('clearCachePage', ['order', 'todoOrder', 'todoCenter', 'callLog']);
|
|
|
+ // 关闭当前 tagsView
|
|
|
+ mittBus.emit('onCurrentContextmenuClick', Object.assign({}, { contextMenuClickId: 1, ...route }));
|
|
|
+};
|
|
|
+// 加载基础数据
|
|
|
+const loadBaseData = async () => {
|
|
|
+ try {
|
|
|
+ const res = await orderBaseDataAdd();
|
|
|
+ state.acceptTypeOptions = res.result?.acceptTypeOptions ?? [];
|
|
|
+ state.channelOptions = res.result?.channelOptions ?? [];
|
|
|
+ state.emergencyLevelOptions = res.result?.emergencyLevelOptions ?? [];
|
|
|
+ state.genderOptions = res.result?.genderOptions ?? [];
|
|
|
+ state.identityTypeOptions = res.result?.identityTypeOptions ?? [];
|
|
|
+ orderTypeOptions.value = res.result?.orderTypeOptions ?? [];
|
|
|
+ state.pushTypeOptions = res.result?.pushTypeOptions ?? [];
|
|
|
+ state.licenceTypeOptions = res.result?.licenceTypeOptions ?? [];
|
|
|
+ state.ageRangeOptions = res.result?.ageRangeOptions ?? [];
|
|
|
+ state.transpondCity = res.result?.transpondCity ?? [];
|
|
|
+ state.focusOnEvents = res.result?.focusOnEvents ?? [];
|
|
|
+ } catch (error) {
|
|
|
+ console.log(error);
|
|
|
+ }
|
|
|
+};
|
|
|
+// 如果是修改加载表单内容
|
|
|
+const loadForm = async () => {
|
|
|
+ state.formLoading = true;
|
|
|
+ if (route.query.createBy) {
|
|
|
+ // route.query.createBy createBy 代表来源 tel:来电弹单 letter:互联网来信 默认表示手动创建
|
|
|
+ state.createBy = route.query.createBy;
|
|
|
+ if (route.query.createBy === 'tel') {
|
|
|
+ //通话
|
|
|
+ state.ruleForm.sourceChannel = '电话'; //电话
|
|
|
+ state.ruleForm.sourceChannelCode = 'RGDH'; //电话
|
|
|
+ state.ruleForm.fromPhone = route.query.fromTel; // 来电号码
|
|
|
+ state.ruleForm.contact = route.query.fromTel; // 联系电话
|
|
|
+ state.ruleForm.callId = route.query.callId; // 通话id
|
|
|
+ state.ruleForm.transferPhone = route.query.transfer; // 转接来源
|
|
|
+ state.ruleForm.channel = {
|
|
|
+ // 来源渠道
|
|
|
+ dicDataValue: state.ruleForm.sourceChannelCode,
|
|
|
+ dicDataName: state.ruleForm.sourceChannel,
|
|
|
+ };
|
|
|
+ const isNumberIdentityType = parseInt(<string>route.query.identityType);
|
|
|
+ if ([1, 2].includes(isNumberIdentityType)) {
|
|
|
+ // 按键接收(1:市民 2:企业 3:智能应答)
|
|
|
+ state.ruleForm.identityType = isNumberIdentityType;
|
|
|
+ } else {
|
|
|
+ state.ruleForm.identityType = 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (route.query.id) {
|
|
|
+ // 如果 有id
|
|
|
+ state.orderId = route.query.id;
|
|
|
+ const response = await orderDetail(route.query.id);
|
|
|
+ // 如果获取到id 调用查询详情
|
|
|
+ state.ruleForm = response.result;
|
|
|
+ state.ruleForm.files = transformFile(response.result.files);
|
|
|
+ if (response.result.duplicateIds && response.result.duplicateIds.length) {
|
|
|
+ // 是否重复
|
|
|
+ state.ruleForm.isRepeat = 'true';
|
|
|
+ state.ruleForm.duplicateTitle = '已选择';
|
|
|
+ } else {
|
|
|
+ state.ruleForm.isRepeat = 'false';
|
|
|
+ }
|
|
|
+ if (state.ruleForm.focusOnEvents) {
|
|
|
+ state.ruleForm.focusOnEventsArr = response.result.focusOnEvents.split(',');
|
|
|
+ }
|
|
|
+ state.ruleForm.channel = {
|
|
|
+ // 来源渠道
|
|
|
+ dicDataValue: state.ruleForm.sourceChannelCode,
|
|
|
+ dicDataName: state.ruleForm.sourceChannel,
|
|
|
+ };
|
|
|
+
|
|
|
+ if (state.ruleForm.hotspotExternal) {
|
|
|
+ //热点分类默认展开
|
|
|
+ state.hotspotExternal = state.ruleForm.hotspotExternal.split(',');
|
|
|
+ }
|
|
|
+ if (state.ruleForm.eventCategoryExternal) {
|
|
|
+ //热点分类默认展开
|
|
|
+ state.eventCategoryExternal = state.ruleForm.eventCategoryExternal.split(',');
|
|
|
+ }
|
|
|
+ state.ruleForm.ageRangeObj = {
|
|
|
+ // 年龄段
|
|
|
+ dicDataValue: state.ruleForm.ageRangeCode,
|
|
|
+ dicDataName: state.ruleForm.ageRange,
|
|
|
+ };
|
|
|
+ state.ruleForm.licenceTypeObj = {
|
|
|
+ // 证件类型
|
|
|
+ dicDataValue: state.ruleForm.licenceTypeCode,
|
|
|
+ dicDataName: state.ruleForm.licenceType,
|
|
|
+ };
|
|
|
+ state.ruleForm.acceptTypeObj = {
|
|
|
+ // 受理类型
|
|
|
+ dicDataValue: state.ruleForm.acceptTypeCode,
|
|
|
+ dicDataName: state.ruleForm.acceptType,
|
|
|
+ };
|
|
|
+ state.ruleForm.pushTypeObj = {
|
|
|
+ // 推送分类
|
|
|
+ dicDataValue: state.ruleForm.pushTypeCode,
|
|
|
+ dicDataName: state.ruleForm.pushType,
|
|
|
+ };
|
|
|
+ state.ruleForm.transpondCityObj = {
|
|
|
+ // 市州互转
|
|
|
+ dicDataValue: state.ruleForm.transpondCityValue,
|
|
|
+ dicDataName: state.ruleForm.transpondCityName,
|
|
|
+ };
|
|
|
+ state.formLoading = false;
|
|
|
+ } else {
|
|
|
+ state.formLoading = false;
|
|
|
+ }
|
|
|
+};
|
|
|
+// 加载省市区
|
|
|
+const addressLoading = ref<boolean>(false);
|
|
|
+const loadAddress = async () => {
|
|
|
+ addressLoading.value = true;
|
|
|
+ try {
|
|
|
+ const area = await treeArea();
|
|
|
+ state.areaOptions = area.result ?? []; //省市区数据
|
|
|
+ addressLoading.value = false;
|
|
|
+ } catch (error) {
|
|
|
+ console.log(error);
|
|
|
+ } finally {
|
|
|
+ addressLoading.value = false;
|
|
|
+ }
|
|
|
+};
|
|
|
+// 加载扩展信息
|
|
|
+const orderTypeOptions = ref<EmptyObjectType>([]); // 工单类型
|
|
|
+// 拓展信息
|
|
|
+const extra = ref<any>({
|
|
|
+ ext: {},
|
|
|
+ area: {},
|
|
|
+ orderTypeOptions: [],
|
|
|
+});
|
|
|
+const extraLoading = ref<boolean>(false);
|
|
|
+const loadExtra = async () => {
|
|
|
+ extraLoading.value = true;
|
|
|
+ try {
|
|
|
+ const ext = await orderBaseExt(); // 扩展信息
|
|
|
+ extra.value = { ext: { ...ext.result, orderTypeOptions: orderTypeOptions.value, area: state.areaOptions } }; //补充信息
|
|
|
+ } catch (error) {
|
|
|
+ console.log(error);
|
|
|
+ } finally {
|
|
|
+ extraLoading.value = false;
|
|
|
+ }
|
|
|
+};
|
|
|
+loadBaseData();
|
|
|
+loadForm();
|
|
|
+onMounted(async () => {
|
|
|
+ await loadAddress();
|
|
|
+ await loadExtra();
|
|
|
+});
|
|
|
+</script>
|