|
@@ -0,0 +1,220 @@
|
|
|
+<template>
|
|
|
+ <el-dialog v-model="state.dialogVisible" draggable title="工单重办" width="50%" append-to-body destroy-on-close @close="close">
|
|
|
+ <div class="collapse-container">
|
|
|
+ <el-form label-width="110px" ref="ruleFormRef" :model="state.ruleForm">
|
|
|
+ <el-row :gutter="35">
|
|
|
+ <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
|
|
|
+ <el-form-item label="退回节点" prop="nextStepCode" :rules="[{ required: true, message: '请选退回节点', trigger: 'change' }]">
|
|
|
+ <el-select v-model="state.ruleForm.nextStepCode" placeholder="请选退回节点" class="w100" @change="selectTrace">
|
|
|
+ <el-option v-for="item in steps" :value="item.key" :key="item.key" :label="item.value"> </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12" v-if="state.ruleForm.nextStepCode">
|
|
|
+ <el-form-item label="办理对象" prop="nextHandlers" :rules="[{ required: true, message: '请选择办理对象', trigger: 'change' }]">
|
|
|
+ <el-select-v2
|
|
|
+ v-model="state.ruleForm.nextHandlers"
|
|
|
+ :options="stepsItems"
|
|
|
+ placeholder="请选择办理对象"
|
|
|
+ class="w100"
|
|
|
+ multiple
|
|
|
+ clearable
|
|
|
+ collapse-tags
|
|
|
+ collapse-tags-tooltip
|
|
|
+ filterable
|
|
|
+ value-key="key"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
|
|
|
+ <el-form-item label="延期" prop="timeLimitCount" :rules="[{ required: false, message: '请输入延期申请数量', trigger: 'blur' }]">
|
|
|
+ <el-row :gutter="10">
|
|
|
+ <el-col :xs="24" :sm="12" :md="12" :lg="14" :xl="18">
|
|
|
+ <el-select
|
|
|
+ v-model="state.ruleForm.timeLimitCount"
|
|
|
+ placeholder="请选择"
|
|
|
+ class="w100"
|
|
|
+ :rules="[{ required: true, message: '请选择延期数量', trigger: 'change' }]"
|
|
|
+ >
|
|
|
+ <el-option v-for="item in delayOptions" :value="item.value" :key="item.value" :label="item.label" />
|
|
|
+ </el-select>
|
|
|
+ </el-col>
|
|
|
+ <el-col :xs="24" :sm="12" :md="12" :lg="10" :xl="6"> 工作日 </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
|
|
|
+ <el-form-item label="错件类别" prop="timeLimitCount" :rules="[{ required: true, message: '请选择错件类别', trigger: 'change' }]">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24" v-for="(item, index) in state.ruleForm.visitDetails" :key="item.id" class="mb18">
|
|
|
+ <el-form-item
|
|
|
+ :prop="`visitDetails.${index}.orgHandledAttitude`"
|
|
|
+ :rules="[{ required: true, message: '请选择错件类别', trigger: 'change' }]"
|
|
|
+ >
|
|
|
+ <template #label>
|
|
|
+ {{ item.name }}
|
|
|
+ </template>
|
|
|
+ <el-select
|
|
|
+ v-model="item.orgHandledAttitude"
|
|
|
+ placeholder="请选择错件类别"
|
|
|
+ class="w100"
|
|
|
+ value-key="value"
|
|
|
+ @change="
|
|
|
+ (val) => {
|
|
|
+ item.orgHandledAttitude.value = val.label;
|
|
|
+ item.orgHandledAttitude.key = val.value;
|
|
|
+ }
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <el-option v-for="items in reasonOptions" :key="items.value" :label="items.label" :value="items" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
|
|
|
+ <el-form-item label="重办意见" prop="reason" :rules="[{ required: true, message: '请填写重办意见', trigger: 'blur' }]">
|
|
|
+ <el-input v-model="state.ruleForm.reason" type="textarea" :autosize="{ minRows: 6, maxRows: 10 }" placeholder="请填写重办意见" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ <template #footer>
|
|
|
+ <span class="dialog-footer">
|
|
|
+ <el-button @click="closeDialog" class="default-button">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="onSubmit(ruleFormRef)" :loading="state.loading">重办</el-button>
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+</template>
|
|
|
+<script setup lang="ts" name="SpecialDialog">
|
|
|
+import { reactive, ref } from 'vue';
|
|
|
+import { ElMessage, FormInstance } from 'element-plus';
|
|
|
+import { storeToRefs } from 'pinia';
|
|
|
+import { useUserInfo } from '@/stores/userInfo';
|
|
|
+import { specialApplyBase, specialApply } from '@/api/business/special';
|
|
|
+
|
|
|
+// 引入组件
|
|
|
+
|
|
|
+// 定义子组件向父组件传值/事件
|
|
|
+const emit = defineEmits(['updateList']);
|
|
|
+// 定义变量内容
|
|
|
+const state = reactive<any>({
|
|
|
+ dialogVisible: false, // 是否显示弹窗
|
|
|
+ loading: false, // 是否显示加载
|
|
|
+ ruleForm: {
|
|
|
+ nextStepCode: null, // 特提节点
|
|
|
+ cause: null, // 特提原因
|
|
|
+ reason: null, // 特提理由
|
|
|
+ nextHandlers: [], // 处理对象
|
|
|
+ visitDetails: [
|
|
|
+ {
|
|
|
+ name: '热线中心',
|
|
|
+ orgNoSatisfiedReason: null,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '一级部门',
|
|
|
+ orgNoSatisfiedReason: null,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ orderDetail: {}, // 工单详情
|
|
|
+ workflowId: null, // 工作流id
|
|
|
+});
|
|
|
+const ruleFormRef = ref<RefType>();
|
|
|
+const storesUserInfo = useUserInfo();
|
|
|
+const { userInfos } = storeToRefs(storesUserInfo); // 用户信息
|
|
|
+const specialReason = ref<EmptyArrayType>([]); // 特提理由
|
|
|
+const steps = ref<EmptyArrayType>([]); // 特提节点
|
|
|
+const stepsItems = ref<EmptyArrayType>([]); // 处理对象
|
|
|
+const delayOptions = ref([
|
|
|
+ { value: 1, label: '1' },
|
|
|
+ { value: 3, label: '3' },
|
|
|
+ { value: 5, label: '5' },
|
|
|
+]); // 延期
|
|
|
+const reasonOptions = ref<EmptyArrayType>([
|
|
|
+ {
|
|
|
+ label: 'A:不录,烧录,录入错误',
|
|
|
+ id: 1,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: 'B:错误退回',
|
|
|
+ id: 2,
|
|
|
+ },
|
|
|
+]); // 错件原因
|
|
|
+/**
|
|
|
+ * @description 打开弹窗
|
|
|
+ * @param {object} val 工单详情
|
|
|
+ */
|
|
|
+const openDialog = async (val: any) => {
|
|
|
+ state.orderDetail = val;
|
|
|
+ state.workflowId = val.workflowId;
|
|
|
+ state.loading = true;
|
|
|
+ state.dialogVisible = true;
|
|
|
+ try {
|
|
|
+ const [baseRes] = await Promise.all([specialApplyBase(val.workflowId)]);
|
|
|
+ steps.value = baseRes.result?.step?.steps ?? [];
|
|
|
+ specialReason.value = baseRes.result.specialReason ?? [];
|
|
|
+ } catch (e) {
|
|
|
+ console.log(e);
|
|
|
+ } finally {
|
|
|
+ state.loading = false;
|
|
|
+ }
|
|
|
+};
|
|
|
+// 关闭弹窗
|
|
|
+const closeDialog = () => {
|
|
|
+ state.dialogVisible = false;
|
|
|
+};
|
|
|
+const close = () => {
|
|
|
+ ruleFormRef.value?.clearValidate();
|
|
|
+ ruleFormRef.value?.resetFields();
|
|
|
+ steps.value = [];
|
|
|
+ stepsItems.value = [];
|
|
|
+};
|
|
|
+// 选择节点确定办理对象
|
|
|
+const selectTrace = (val: any) => {
|
|
|
+ const step = steps.value.find((item) => item.key === val);
|
|
|
+ state.ruleForm.nextStepName = step?.value;
|
|
|
+ ruleFormRef.value?.resetFields('nextHandlers');
|
|
|
+ stepsItems.value = step?.items ?? [];
|
|
|
+ stepsItems.value = stepsItems.value.map((item: any) => {
|
|
|
+ return {
|
|
|
+ value: {
|
|
|
+ ...item,
|
|
|
+ },
|
|
|
+ label: item.value,
|
|
|
+ };
|
|
|
+ });
|
|
|
+};
|
|
|
+// 提交
|
|
|
+const filesFormat = ref<EmptyArrayType>([]); // 附件列表
|
|
|
+const onSubmit = (formEl: FormInstance | undefined) => {
|
|
|
+ if (!formEl) return;
|
|
|
+ formEl.validate((valid: boolean) => {
|
|
|
+ if (!valid) return;
|
|
|
+ state.loading = true;
|
|
|
+ let request = {
|
|
|
+ ...state.ruleForm,
|
|
|
+ workflowId: state.workflowId,
|
|
|
+ orderId: state.orderDetail.id,
|
|
|
+ files: filesFormat.value,
|
|
|
+ };
|
|
|
+ specialApply(request)
|
|
|
+ .then(() => {
|
|
|
+ state.loading = false;
|
|
|
+ closeDialog();
|
|
|
+ emit('updateList');
|
|
|
+ ElMessage.success('特提申请成功');
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ state.loading = false;
|
|
|
+ });
|
|
|
+ });
|
|
|
+};
|
|
|
+defineExpose({
|
|
|
+ openDialog,
|
|
|
+ closeDialog,
|
|
|
+});
|
|
|
+</script>
|