| | |
| | | <!-- 步骤条 --> |
| | | <div class="stepContainer"> |
| | | <up-steps :current="currentStep" direction="column"> |
| | | <up-steps-item |
| | | v-for="(step, index) in stepTitles" |
| | | :key="index" |
| | | > |
| | | <up-steps-item v-for="(step, index) in stepTitles" :key="index"> |
| | | <template #title> |
| | | <div class="horizontal-step"> |
| | | <span class="step-title">{{ step.title }}</span> |
| | |
| | | <div>关联任务:{{workDetailData.job_name}}</div> |
| | | <div>工单创建人:{{workDetailData.event_num?.slice(0, 2) === 'AI' ? 'AI 小飞':workDetailData.creator}}</div> |
| | | <div>事件地址:{{workDetailData.address}}</div> |
| | | |
| | | <div>关联算法:{{workDetailData.ai_types}}</div> |
| | | <div>发起部门:{{workDetailData.dept_name}}</div> |
| | | <div>发起任务时间:{{workDetailData.create_time}}</div> |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | |
| | | import {getStepInfo,getList,flowEvent} from '/src/api/work/index.js' |
| | | import { |
| | | getStepInfo, |
| | | getList, |
| | | flowEvent |
| | | } from '/src/api/work/index.js' |
| | | |
| | | const eventNum = ref(''); |
| | | const currentStatus = ref('') |
| | |
| | | const currentStep = ref(0); |
| | | // 工单内容 |
| | | const workDetailData = ref({}) |
| | | const stepTitles =ref([ |
| | | { |
| | | const stepTitles = ref([{ |
| | | title: '待审核', |
| | | status: '2' |
| | | }, |
| | |
| | | const response = res.data.data.records; |
| | | workDetailData.value = response[0]; |
| | | currentStatus.value = workDetailData.value.status; |
| | | console.log('详情',response); |
| | | // console.log('详情',response); |
| | | } |
| | | // 步骤条 |
| | | const calculateCurrentStep = (status) => { |
| | |
| | | } |
| | | return statusToStep[String(status)] || 0 |
| | | } |
| | | |
| | | const getStepInfoData = async (val) => { |
| | | const res = await getStepInfo(val); |
| | | stepResponse.value = res.data.data; |
| | | console.log('stepResponse',stepResponse.value) |
| | | currentStep.value = calculateCurrentStep(currentStatus.value); |
| | | |
| | | // 动态匹配步骤描述 |
| | | const matchedSteps = {}; |
| | | stepResponse.value.forEach(step => { |
| | | // 找到 stepTitles 中对应的步骤索引 |
| | | const stepIndex = stepTitles.value.findIndex(item => item.status === String(step.status)); |
| | | if (stepIndex !== -1) { |
| | | matchedSteps[stepIndex] = step; |
| | | } |
| | | }); |
| | | |
| | | // 确保 stepResponse 按 stepTitles 顺序填充 |
| | | stepResponse.value = stepTitles.value.map((_, index) => matchedSteps[index] || null); |
| | | }; |
| | | // 图片预览 |
| | | const previewImage = (url) => { |
| | | uni.previewImage({ |
| | |
| | | }); |
| | | }; |
| | | // 通过 |
| | | const approveTicket=()=>{} |
| | | const approveTicket = async () => { |
| | | const data = { |
| | | id: workDetailData.value.id, |
| | | status: workDetailData.value.status, |
| | | isPass: 0, // 0 表示通过 |
| | | eventNum: workDetailData.value.event_num, |
| | | }; |
| | | console.log('data', data) |
| | | const file = workDetailData.value.file || null; |
| | | const response = await flowEvent(data, file); |
| | | console.log('通过', response) |
| | | } |
| | | // // 不通过 |
| | | const rejectTicket=()=>{} |
| | | // // 受理 |
| | |
| | | background-color: antiquewhite; |
| | | border-radius: 5px; |
| | | padding: 10px; |
| | | |
| | | .horizontal-step { |
| | | display: flex; |
| | | align-items: center; |
| | |
| | | display: flex; |
| | | justify-content: space-between; |
| | | margin-bottom: 10px; |
| | | |
| | | .btngroups { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | |
| | | .u-button { |
| | | padding: 9px 20px; |
| | | height: 32px; |
| | | |
| | | &:last-child { |
| | | margin-left: 12px; |
| | | margin-right: 12px; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .leftBtn { |
| | | width: 70px; |
| | | height: 32px; |
| | |
| | | cursor: pointer; |
| | | opacity: 0.8; |
| | | } |
| | | |
| | | .disableds { |
| | | background: #999 !important; |
| | | cursor: not-allowed !important; |
| | |
| | | opacity: 0.3 !important; |
| | | } |
| | | } |
| | | |
| | | .workOrderContent { |
| | | margin-top: 15px; |
| | | |
| | | .workOrderContainer { |
| | | div { |
| | | margin-bottom: 10px; |
| | | } |
| | | |
| | | .titketName { |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | } |
| | | } |
| | | |