<template> <div class="orderDia"> <div class="orderContent"> <!-- 基本情况 --> <div class="orderBox"> <div class="boxTitle">基本情况</div> <div class="boxContent" v-loading="infoLoading"> <el-form ref="orderFormRef" :rules="rules" label-width="auto" :model="orderForm"> <el-row justify="space-between"> <el-col :span="7"> <el-form-item label="工单编码" prop=""> <el-input v-model="orderForm.orderNumber" disabled /> </el-form-item> </el-col> <el-col :span="7"> <el-form-item label="工单类型" prop=""> <el-select v-model="orderForm.orderType" style="width: 100%" disabled> <el-option v-for="item in work_order_type" :key="item.value" :label="item.label" :value="item.value" /> </el-select> </el-form-item> </el-col> <el-col :span="7"> <el-form-item label="工单来源" prop=""> <el-select v-model="orderForm.orderSource" style="width: 100%" disabled> <el-option v-for="item in work_order_source" :key="item.value" :label="item.label" :value="item.value" /> </el-select> </el-form-item> </el-col> </el-row> <el-row justify="space-between"> <el-col :span="7"> <el-form-item label="上 报 人" prop=""> <el-input v-model="orderForm.reportPerson" disabled /> </el-form-item> </el-col> <el-col :span="7"> <el-form-item label="联系方式" prop=""> <!-- phone --> <el-input v-model="orderForm.reportPersonPhone" disabled /> </el-form-item> </el-col> <el-col :span="7"> <el-form-item label="警情时间" prop=""> <el-date-picker v-model="orderForm.alarmTime" type="datetime" format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" disabled /> </el-form-item> </el-col> </el-row> <el-row justify="space-between"> <el-col :span="16"> <el-form-item label="发送位置" prop=""> <!-- phone --> <el-input v-model="orderForm.reportLocation" style="width: 97%" disabled /> </el-form-item> </el-col> <el-col :span="7"> <el-form-item label="登记时间" prop=""> <el-date-picker v-model="orderForm.registerTime" type="datetime" format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" disabled /> </el-form-item> </el-col> </el-row> <el-row justify="space-between"> <el-col :span="24"> <el-form-item label="信  息" prop=""> <!-- phone --> <el-input v-model="orderForm.message" :autosize="{ minRows: 2, maxRows: 4 }" type="textarea" disabled /> </el-form-item> </el-col> </el-row> <el-row justify="space-between"> <el-col :span="7"> <el-form-item label="要求完成时间" prop=""> <el-date-picker v-model="orderForm.requireFinishTime" type="datetime" format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" disabled /> </el-form-item> </el-col> <el-col :span="7"> <el-form-item label="处理单位" prop=""> <!-- phone --> <el-input v-model="orderForm.handleDeptName" disabled /> </el-form-item> </el-col> <el-col :span="7"> <el-form-item label="处理人" prop=""> <!-- phone --> <el-input v-model="orderForm.handlePersonName" disabled /> </el-form-item> </el-col> </el-row> </el-form> </div> </div> <!-- 附件 --> <div class="orderBox"> <div class="boxTitle">附件</div> <div class="boxContent" v-loading="infoLoading"> <div class="imgBox" v-if="orderForm?.orderFileList?.length"> <el-image style="width: 100px; height: 100px" :src="i.url" v-for="(i, index) in orderForm.orderFileList" :key="i" :zoom-rate="1.2" :max-scale="7" :min-scale="0.2" :preview-src-list=" orderForm.orderFileList.map(item => { return item.url; }) " :initial-index="index" fit="cover" class="imgItem" /> </div> <div v-else>无</div> </div> </div> <!-- 处理流程 --> <div class="orderBox"> <div class="boxTitle">处理流程</div> <div class="boxContent" v-loading="infoLoading"> <div class="processBox"> <div class="processItem" v-for="(item, i) in handleProcess.timeStep" :key="i"> {{ item }} </div> </div> <el-steps :active="handleProcess.active" align-center> <!-- :title="item.activityName" --> <el-step :title="item.activityName" :description="item.endTime" v-for="(item, index) in handleProcess.dataList" :key="index" :status="item.processStatus" > <template #title> <div class="titleBox"> {{ item.activityName }} <div class="callBox" v-if="item.processStatus == 'process'"> <div class="callTitle">催办</div> <img src="@/assets/images/order/shortMessage_icon.png" alt="" class="callImg" /> <img src="@/assets/images/order/phone_icon.png" alt="" class="callImg" /> </div> </div> </template> </el-step> </el-steps> <el-divider /> <div class="processDesc"> <div class="descTitle"> 上一步操作:<span> {{ handleProcess.operation }} </span> </div> <div class="descTime">{{ handleProcess.operationTime }}</div> </div> </div> </div> <!-- 处理详情 --> <div class="orderBox" v-if="props.status == 'check' || props.status == 'complete'"> <div class="boxTitle">处理详情</div> <div class="boxContent" v-loading="infoLoading"> <div class="detailInfo"> <div class="leftInfo">处理意见:</div> <div class="rightInfo">{{ orderForm.handleComment }}</div> </div> <div class="detailInfo"> <div class="leftInfo">处理照片:</div> <div class="rightInfo"> <div class="imgBox" v-if="orderForm?.handlePicList?.length"> <el-image style="width: 100px; height: 100px" :src="i.url" v-for="(i, index) in orderForm.handlePicList" :key="i" :zoom-rate="1.2" :max-scale="7" :min-scale="0.2" :preview-src-list=" orderForm.handlePicList.map(item => { return item.url; }) " :initial-index="index" fit="cover" class="imgItem" /> </div> <div v-else>无</div> </div> </div> <!-- <div class="imgBox" v-if="orderForm?.handlePicList?.length"> <el-image style="width: 100px; height: 100px" :src="i.url" v-for="(i, index) in orderForm.handlePicList" :key="i" :zoom-rate="1.2" :max-scale="7" :min-scale="0.2" :preview-src-list=" orderForm.handlePicList.map(item => { return item.url; }) " :initial-index="index" fit="cover" class="imgItem" /> </div> <div v-else>无</div> --> </div> </div> <!-- 事务操作 --> <div class="orderBox" v-if="props.status != 'xiangqing'"> <div class="boxTitle">事务操作</div> <div class="boxContent"> <el-form ref="confirmFormRef" :rules="rules" label-width="auto" :model="confirmForm"> <!-- 受理 --> <template v-if="props.status == 'accept'"> <el-row justify="space-between"> <el-col :span="7"> <el-form-item label="受理方式" prop=""> <!-- <el-input v-model="confirmForm.reportPerson" placeholder="请输入上报人" /> --> <el-radio-group v-model="confirmForm.type"> <el-radio label="1">接受</el-radio> <el-radio label="0">驳回</el-radio> </el-radio-group> </el-form-item> </el-col> <el-col :span="7"> <el-form-item label="受理时间" prop=""> <el-date-picker v-model="confirmForm.customFinishTime" type="datetime" placeholder="请选择受理时间" format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" /> </el-form-item> </el-col> </el-row> </template> <!-- 提交 --> <template v-if="props.status == 'submit'"> <el-row justify="space-between"> <el-col :span="7"> <el-form-item label="提交方式" prop=""> <!-- <el-input v-model="confirmForm.reportPerson" placeholder="请输入上报人" /> --> <el-radio-group v-model="confirmForm.type"> <el-radio label="1">接受</el-radio> <el-radio label="0">驳回</el-radio> </el-radio-group> </el-form-item> </el-col> <el-col :span="7"> <el-form-item label="提交时间" prop=""> <el-date-picker v-model="confirmForm.customFinishTime" type="datetime" placeholder="请选择提交时间" format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" /> </el-form-item> </el-col> </el-row> <el-row justify="space-between" v-if="props.status == 'submit'"> <el-col :span="7"> <el-form-item label="提交部门" prop=""> <el-select v-model="confirmForm.nextTaskApproveRoleId" style="width: 100%"> <el-option v-for="item in useOrder.deptList" :key="item.deptId" :label="item.deptName" :value="item.deptId" /> </el-select> </el-form-item> </el-col> </el-row> </template> <!-- 分派 --> <template v-if="props.status == 'assign'"> <el-row justify="space-between"> <el-col :span="7"> <el-form-item label="分派方式" prop=""> <!-- <el-input v-model="confirmForm.reportPerson" placeholder="请输入上报人" /> --> <el-radio-group v-model="confirmForm.type"> <el-radio label="1">接受</el-radio> <el-radio label="0">驳回</el-radio> </el-radio-group> </el-form-item> </el-col> <el-col :span="7"> <el-form-item label="分派时间" prop=""> <el-date-picker v-model="confirmForm.customFinishTime" type="datetime" placeholder="请选择分派时间" format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" /> </el-form-item> </el-col> </el-row> <el-row justify="space-between"> <el-col :span="7"> <el-form-item label="分派人员" prop=""> <el-select v-model="confirmForm.nextTaskApproveUserId" style="width: 100%"> <el-option v-for="item in useOrder.userList" :key="item.userId" :label="item.nickName" :value="item.userId" /> </el-select> </el-form-item> </el-col> </el-row> </template> <!-- 响应 --> <template v-if="props.status == 'response'"> <el-row justify="space-between"> <el-col :span="7"> <el-form-item label="响应方式" prop=""> <!-- <el-input v-model="confirmForm.reportPerson" placeholder="请输入上报人" /> --> <el-radio-group v-model="confirmForm.type"> <el-radio label="1">接受</el-radio> <el-radio label="0">驳回</el-radio> </el-radio-group> </el-form-item> </el-col> <el-col :span="7"> <el-form-item label="响应时间" prop=""> <el-date-picker v-model="confirmForm.customFinishTime" type="datetime" placeholder="请选择受理时间" format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" /> </el-form-item> </el-col> </el-row> </template> <!-- 上报 --> <template v-if="props.status == 'report'"> <el-row justify="space-between"> <el-col :span="7"> <el-form-item label="处理时间" prop=""> <el-date-picker v-model="confirmForm.customFinishTime" type="datetime" placeholder="请选择处理时间" format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" /> </el-form-item> </el-col> </el-row> <el-row justify="space-between"> <el-col :span="24"> <el-form-item label="处理位置" prop=""> <el-input v-model="confirmForm.reportLocation" placeholder="请选择处理位置" /> </el-form-item> </el-col> </el-row> <el-row justify="space-between"> <el-col :span="24"> <el-form-item label="处理图片" prop=""> <ImageFileUpload :limit="4" v-model:saveFileArr="confirmForm.handlePicList" :listType="'picture-card'" :fileType="['jpg', 'png', 'jpeg', 'svg', 'gif']" :fileSize="10" ></ImageFileUpload> </el-form-item> </el-col> </el-row> </template> <!-- 核实 --> <template v-if="props.status == 'check'"> <el-row justify="space-between"> <el-col :span="7"> <el-form-item label="核实方式" prop=""> <!-- <el-input v-model="confirmForm.reportPerson" placeholder="请输入上报人" /> --> <el-radio-group v-model="confirmForm.type"> <el-radio label="1">接受</el-radio> <el-radio label="0">驳回</el-radio> </el-radio-group> </el-form-item> </el-col> <el-col :span="7"> <el-form-item label="核实时间" prop=""> <el-date-picker v-model="confirmForm.customFinishTime" type="datetime" placeholder="请选择核实时间" format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" /> </el-form-item> </el-col> </el-row> </template> <!-- 结单 --> <template v-if="props.status == 'complete'"> <el-row justify="space-between"> <el-col :span="7"> <el-form-item label="结单方式" prop=""> <!-- <el-input v-model="confirmForm.reportPerson" placeholder="请输入上报人" /> --> <el-radio-group v-model="confirmForm.type"> <el-radio label="1">接受</el-radio> <el-radio label="0">驳回</el-radio> </el-radio-group> </el-form-item> </el-col> <el-col :span="7"> <el-form-item label="结单时间" prop=""> <el-date-picker v-model="confirmForm.customFinishTime" type="datetime" placeholder="请选择结单时间" format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" /> </el-form-item> </el-col> </el-row> </template> <el-row justify="space-between"> <el-col :span="24"> <el-form-item label="意  见" prop=""> <!-- phone --> <el-input v-model="confirmForm.approveComment" :autosize="{ minRows: 2, maxRows: 4 }" type="textarea" placeholder="请输入意见" maxlength="300" show-word-limit /> </el-form-item> </el-col> </el-row> </el-form> </div> </div> <!-- 处理明细 --> <div class="orderBox" v-if="props.status == 'xiangqing'"> <div class="boxTitle">处理明细</div> <div class="boxContent"> <div class="textBox" v-for="(item, index) in handleProcess.historyData" :key="item.id"> {{ item.operationTime + ' ' + item.operation }} </div> </div> </div> </div> <div class="boxBtn" v-if="props.status != 'xiangqing'"> <el-button type="primary" :disabled="infoLoading" @click="handleSubmit(confirmFormRef)">提交</el-button> <el-button @click="close">返回</el-button> </div> </div> </template> <script setup name="orderDia"> import ImageFileUpload from '@/components/ImageFileUpload/index.vue'; //图片文件上传 import phone_icon from '@/assets/images/order/phone_icon.png'; import shortMessage_icon from '@/assets/images/order/shortMessage_icon.png'; import { getWorkOrder, listHistoryData, submitWorkOrder } from '@/api/order'; import bus from '@/bus'; import useUserStore from '@/store/modules/user'; import useOrderStore from '@/store/modules/order'; const useOrder = useOrderStore(); console.log('deptList===========', useOrder, useUserStore().userInfo); const { proxy } = getCurrentInstance(); // 工单类型: work_order_type // 工单状态: work_order_status // 工单来源: work_order_source const { work_order_type, work_order_status, work_order_source } = proxy.useDict( 'work_order_type', 'work_order_status', 'work_order_source' ); const emit = defineEmits(['closeDialog', 'getList']); const props = defineProps({ status: { type: String, default: '', }, orderId: { type: String, default: '', }, }); const orderFormRef = ref(); const confirmFormRef = ref(); const infoLoading = ref(false); const orderData = reactive({ rules: { name: [ { required: true, message: 'Please input Activity name', trigger: 'blur' }, { min: 3, max: 5, message: 'Length should be 3 to 5', trigger: 'blur' }, ], region: [ { required: true, message: 'Please select Activity zone', trigger: 'change', }, ], count: [ { required: true, message: 'Please select Activity count', trigger: 'change', }, ], }, orderForm: {}, handleProcess: { active: 0, // 'wait' | 'process' | 'finish' | 'error' | 'success' // 等待还未进行 进行 完成 错误 成功 dataList: [], // timeStep: ['9min','9min','9min','9min','9min','9min','9min'], timeStep: [], operation: '', operationTime: '', historyData: [], }, confirmForm: { customFinishTime: proxy.moment().format('YYYY-MM-DD HH:mm:ss'), id: '', submitUserId: useUserStore().userInfo.userId, type: '1', approveResult: '', approveComment: '', nextTaskApproveRoleId: '', nextTaskApproveUserId: '', handlePicList: [], handleComment: '', fileSaveRequestList: [ // { // name: 'food.jpeg', // url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100', // }, // { // name: 'food.jpeg', // url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100', // }, // { // name: 'food.jpeg', // url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100', // }, // { // name: 'food.jpeg', // url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100', // }, ], }, historyParams: { workflowKey: 'WorkOrder', fileRefFieldPattern: 'picture', businessKey: '', }, }); const { rules, orderForm, handleProcess, confirmForm, historyParams } = toRefs(orderData); // 详情 const getDetail = () => { infoLoading.value = true; getWorkOrder(props.orderId).then(res => { // console.log('----------', res); orderForm.value = res.data; handleProcess.value.dataList = res.data.workOrderWorkFlowStepVo?.workOrderWorkFlowHistoryVoList; handleProcess.value.timeStep = res.data.workOrderWorkFlowStepVo?.timeStepList; // previousOperation handleProcess.value.operation = res.data.previousOperation?.operation || ''; handleProcess.value.operationTime = res.data.previousOperation?.operationTime || ''; const processIndex = handleProcess.value.dataList.findIndex(item => item.processStatus === 'process'); if (processIndex !== -1) { handleProcess.value.active = processIndex + 1; } infoLoading.value = false; }); }; // 历史记录 const getHistoryData = () => { historyParams.value.businessKey = props.orderId; listHistoryData(historyParams.value).then(res => { // console.log('historyData', res); handleProcess.value.historyData = res.data; }); }; const handleSubmit = async formRef => { if (!formRef) return; formRef.validate(valid => { if (valid) { if (props.status == 'report') { confirmForm.value.handleComment = confirmForm.value.approveComment; } confirmForm.value.approveResult = confirmForm.value.type == '1' ? 'true' : 'false'; confirmForm.value.id = props.orderId; // console.log('🚀 ~ handleSubmit ~ valid:', valid, confirmForm.value); submitWorkOrder(confirmForm.value).then(response => { proxy.$modal.msgSuccess('提交成功'); // getList(); emit('getList'); emit('closeDialog'); bus.emit('orderTitleList'); }); } }); }; const close = () => { emit('closeDialog'); }; onMounted(() => { useOrder.getUserList({ workOrderId: props.orderId }); if (props.status == 'xiangqing') { getHistoryData(); } getDetail(); }); </script> <style lang="scss" scoped> .orderDia { width: 100%; height: 720px; // border: 1px solid red; padding-bottom: 20px; .orderContent { height: calc(100% - 40px); overflow-y: auto; } .orderBox { width: 100%; border-radius: 2px; border: 1px solid #eaeaea; margin-bottom: 20px; .boxTitle { height: 40px; background: #f6f6f8; // border-radius: 2px; // border: 1px solid #eaeaea; font-weight: bold; font-size: 14px; color: #333333; display: flex; align-items: center; padding-left: 20px; } .boxContent { min-height: 50px; // height: calc(100% - 120px); margin: 10px 0; // border: 1px solid red; padding: 0 10px; :deep(.el-step__description) { padding-left: 10%; padding-right: 10%; } .processBox { width: 100%; width: calc(100% - 190px); height: 12px; font-weight: 400; font-size: 12px; color: #666666; box-sizing: border-box; margin: 0px 0px 0 95px; margin-top: 30px; display: flex; align-items: center; // border: 1px solid red; .processItem { // border: 1px solid red; // width: 188px; flex: 1; text-align: center; } } .processDesc { display: flex; justify-content: space-between; align-items: center; font-size: 14px; .descTitle { font-weight: 900; color: #333333; } span { font-weight: 400; color: #666666; } .descTime { font-weight: 400; color: #666666; } } .imgBox { display: flex; align-items: center; .imgItem { width: 100px; height: 100px; margin-right: 15px; } } .detailInfo { display: flex; align-items: center; margin-bottom: 5px; } } } .boxBtn { display: flex; align-items: center; justify-content: center; height: 40px; } } .titleBox { position: relative; // width: 20px; // height: 20px; // border-radius: 50%; // background-color: blue; font-weight: 500; font-size: 14px; .callBox { position: absolute; left: 50px; top: -55px; display: flex; .callTitle { width: 40px; height: 22px; line-height: 22px; background: #4285f4; border-radius: 2px; font-weight: 500; font-size: 14px; color: #ffffff; text-align: center; } .callImg { margin-left: 5px; } } } .el-divider { margin: 10px 0 15px 0; } :deep(.el-loading-spinner) { top: 20%; } </style>