|
@@ -426,8 +426,11 @@
|
|
|
<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-button type="primary" @click="submit(ruleFormRef)" :loading="buttonLoading" v-if="canHandle"> 办理 </el-button>
|
|
|
+ <el-button class="default-button" @click="save(ruleFormRef)" :loading="buttonLoading" :disabled="isSaveSuccess"> 保存 </el-button>
|
|
|
+ <el-button type="primary" @click="submit(ruleFormRef)" :loading="buttonLoading" v-if="canHandle" :disabled="!isSaveSuccess">
|
|
|
+ 办理
|
|
|
+ </el-button>
|
|
|
+ <el-text class="ml12" type="danger" tag="b">注意:工单内容填写或者修改后请先保存再办理;</el-text>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -477,8 +480,6 @@
|
|
|
<process-audit ref="processAuditRef" @orderProcessSuccess="onCancel" />
|
|
|
<!-- 地图选点 -->
|
|
|
<map-dialog ref="mapDialogRef" @confirm="selectMap" />
|
|
|
- <!-- 企业搜索 -->
|
|
|
- <company-search ref="companySearchRef" @selectCompany="selectCompany" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -487,7 +488,7 @@ import { computed, defineAsyncComponent, onMounted, reactive, ref, watch } from
|
|
|
import type { FormInstance } from 'element-plus';
|
|
|
import { ElMessage, ElMessageBox, ElNotification } from 'element-plus';
|
|
|
import { storeToRefs } from 'pinia';
|
|
|
-import { useRoute, useRouter } from 'vue-router';
|
|
|
+import { useRoute } from 'vue-router';
|
|
|
import { useTelStatus } from '@/stores/telStatus';
|
|
|
import { useAppConfig } from '@/stores/appConfig';
|
|
|
import { throttle, transformFile } from '@/utils/tools';
|
|
@@ -500,20 +501,19 @@ import mittBus from '@/utils/mitt';
|
|
|
import { orderRepeatEvent } from '@/api/business/repeatEvent';
|
|
|
import { removeDuplicate } from '@/utils/arrayOperation';
|
|
|
import { Session } from '@/utils/storage';
|
|
|
+import {watchPausable} from "@vueuse/core";
|
|
|
|
|
|
// 引入组件
|
|
|
const Knowledge = defineAsyncComponent(() => import('@/views/todo/seats/accept/Knowledge.vue')); // 知识库
|
|
|
const HistoryOrder = defineAsyncComponent(() => import('@/views/todo/seats/accept/History.vue')); // 历史工单
|
|
|
const RepeatEvent = defineAsyncComponent(() => import('@/views/todo/seats/accept/Repeat-event.vue')); // 重复事件
|
|
|
-const CitizenPortrait = defineAsyncComponent(() => import('@/views/todo/seats/accept/Citizen-portrait.vue')); // 市民坏画像
|
|
|
+const CitizenPortrait = defineAsyncComponent(() => import('@/views/todo/seats/accept/Citizen-portrait.vue')); // 市民画像
|
|
|
const ExpandForm = defineAsyncComponent(() => import('@/views/todo/seats/accept/Expand-form.vue')); // 拓展表单
|
|
|
const OrderHistory = defineAsyncComponent(() => import('@/views/business/order/components/Order-history.vue')); // 历史工单弹窗列表
|
|
|
const CommonAdvice = defineAsyncComponent(() => import('@/components/CommonAdvice/index.vue')); // 常用意见
|
|
|
const AnnexList = defineAsyncComponent(() => import('@/components/AnnexList/index.vue')); // 附件列表
|
|
|
const ProcessAudit = defineAsyncComponent(() => import('@/components/ProcessAudit/index.vue')); // 流程审批
|
|
|
const MapDialog = defineAsyncComponent(() => import('@/views/todo/seats/accept/Map-Dialog.vue')); // 地图定位
|
|
|
-const CompanySearch = defineAsyncComponent(() => import('@/views/todo/seats/accept/Company-search.vue')); // 企业搜索
|
|
|
-const EventSelect = defineAsyncComponent(() => import('@/components/Hotspot/event.vue')); // 选择事件
|
|
|
const HotSpotSelect = defineAsyncComponent(() => import('@/components/Hotspot/index.vue')); // 选择热点
|
|
|
// 定义变量内容
|
|
|
const { cityName, cityCode } = getCurrentCityConfig();
|
|
@@ -603,36 +603,6 @@ const { AppConfigInfo } = storeToRefs(appConfigStore); // 系统配置信息
|
|
|
state.ruleForm.acceptorName = userInfos.value.name; // 员工姓名
|
|
|
state.ruleForm.acceptorStaffNo = userInfos.value.staffNo; // 员工工号
|
|
|
const route = useRoute(); // 路由
|
|
|
-const router = useRouter(); // 路由
|
|
|
-const voiceType = ref('');
|
|
|
-// 选择坐席还是市民通话内容
|
|
|
-const voiceAssistantRef = ref<RefType>();
|
|
|
-const changeVoiceType = () => {
|
|
|
- voiceAssistantRef.value.filterMessage(voiceType.value);
|
|
|
-};
|
|
|
-const leftTopActive = ref('realtime');
|
|
|
-// 切换工单小结和实时质检
|
|
|
-const callSummaryRef = ref<RefType>();
|
|
|
-const handleLeftTop = (val: string) => {
|
|
|
- if (val === 'summary') {
|
|
|
- setTimeout(() => {
|
|
|
- callSummaryRef.value.getRecognize();
|
|
|
- }, 300);
|
|
|
- }
|
|
|
-};
|
|
|
-
|
|
|
-// 选择企业
|
|
|
-const companySearchRef = ref<RefType>();
|
|
|
-const handleSelect = () => {
|
|
|
- companySearchRef.value.openDialog();
|
|
|
-};
|
|
|
-// 选择企业
|
|
|
-const selectCompany = (row: any) => {
|
|
|
- state.ruleForm.enterpriseName = row.enterpriseName;
|
|
|
- state.ruleForm.enterpriseCode = row.enterpriseCode;
|
|
|
- state.ruleForm.zhuanBanMingCheng = row.specialTeamName;
|
|
|
- state.ruleForm.zhuanBanCode = row.specialTeamCode;
|
|
|
-};
|
|
|
// 证件号码验证
|
|
|
const licenceNoPattern = computed(() => {
|
|
|
switch (state.ruleForm.licenceTypeCode) {
|
|
@@ -642,12 +612,6 @@ const licenceNoPattern = computed(() => {
|
|
|
return /^[A-Za-z0-9]+$/;
|
|
|
}
|
|
|
});
|
|
|
-// 选择事件分类
|
|
|
-const chooseEvent = (val: any, node: any, externalArr: any) => {
|
|
|
- state.ruleForm.eventCategoryName = val?.eventName; // 事件分类名称
|
|
|
- state.ruleForm.eventCategorySpliceName = val?.eventFullName; // 事件分类拼接名称
|
|
|
- state.ruleForm.eventCategoryExternal = externalArr?.join(',') ?? ''; // 事件分类id
|
|
|
-};
|
|
|
// 选择热点分类
|
|
|
const knowledgeRef = ref<RefType>();
|
|
|
const chooseHotSpot = (val: any, node: any, externalArr: any) => {
|
|
@@ -901,6 +865,12 @@ const shouldOpenDialog = (obj: any) =>
|
|
|
['scjgjts,scjgjjb'].includes(obj.orderExtension.orderTypeCode);
|
|
|
|
|
|
const buttonLoading = ref<boolean>(false);
|
|
|
+const isSaveSuccess = ref<boolean>(false); // 是否保存成功 保存成功后才展示办理按钮
|
|
|
+// 检测表单数据是否有变化
|
|
|
+const watchPauseAbleFn = watchPausable(state.ruleForm, () => {
|
|
|
+ isSaveSuccess.value = false; // 工单编辑后重新展示保存按钮
|
|
|
+}, { deep: true });
|
|
|
+watchPauseAbleFn.pause();
|
|
|
// 保存
|
|
|
const save = throttle((formEl: FormInstance | undefined) => {
|
|
|
if (!formEl) return;
|
|
@@ -916,10 +886,14 @@ const save = throttle((formEl: FormInstance | undefined) => {
|
|
|
const operation = state.orderId ? orderEdit : orderAdd;
|
|
|
const addOrderAndNavigate = () => {
|
|
|
operation(orderDetail)
|
|
|
- .then(() => {
|
|
|
+ .then((res:any) => {
|
|
|
buttonLoading.value = false;
|
|
|
- ElMessage.success('操作成功');
|
|
|
- onCancel();
|
|
|
+ ElMessage.success('保存成功');
|
|
|
+ if(res.result) state.ruleForm.id = res.result;
|
|
|
+ isSaveSuccess.value = true;
|
|
|
+ setTimeout(()=>{
|
|
|
+ watchPauseAbleFn.resume();
|
|
|
+ },300)
|
|
|
})
|
|
|
.catch(() => {
|
|
|
buttonLoading.value = false;
|
|
@@ -996,10 +970,6 @@ const handleForm = (orderDetail: any) => {
|
|
|
processOrder(orderDetail);
|
|
|
}
|
|
|
};
|
|
|
-// 检测表单数据是否有变化
|
|
|
-watch(state.ruleForm, (newValue) => {
|
|
|
- console.log('Form data changed:', newValue);
|
|
|
-}, { deep: true });
|
|
|
// 提交
|
|
|
const submit = throttle((formEl: FormInstance | undefined) => {
|
|
|
if (!formEl) return;
|