| | |
| | | <el-date-picker |
| | | class="gd-date-picker" |
| | | popper-class="gd-date-picker-popper" |
| | | v-model="executeTime" |
| | | v-model="dateRange" |
| | | type="daterange" |
| | | range-separator="-" |
| | | start-placeholder="开始日期" |
| | |
| | | <div class="gd-table-content gd-table-content-bg"> |
| | | <el-table class="gd-table" :data="list" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="46" /> |
| | | <el-table-column type="index" width="64" label="序号" /> |
| | | <el-table-column prop="workOrderName" show-overflow-tooltip label="工单名称" /> |
| | | <el-table-column prop="workOrderCode" show-overflow-tooltip label="工单编号" /> |
| | | <el-table-column prop="workOrderType" show-overflow-tooltip label="工单类型"> |
| | |
| | | {{ getDictLabel(row.workOrderType, dictObj.workOrderType) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="status" show-overflow-tooltip label="阶段状态" /> |
| | | <el-table-column prop="status" show-overflow-tooltip label="阶段状态" > |
| | | <template v-slot="{ row }"> |
| | | {{ getDictLabel(row.workOrderStatus, dictObj.workOrderStatus).split('_')[0] }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="workOrderStatus" show-overflow-tooltip label="工单状态"> |
| | | <template v-slot="{ row }"> |
| | | {{ getDictLabel(row.workOrderStatus, dictObj.workOrderStatus) }} |
| | | {{ getDictLabel(row.workOrderStatus, dictObj.workOrderStatus).split('_')[1] }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="executeTime" show-overflow-tooltip label="执行时间范围"> |
| | | <template v-slot="{ row }">{{ row.executeStartTime }} ~ {{ row.executeEndTime }}</template> |
| | | <template v-slot="{ row }"> |
| | | {{ dayjs(row.executeStartTime).format('YYYY-MM-DD') }} ~ |
| | | {{ dayjs(row.executeEndTime).format('YYYY-MM-DD') }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="serviceParty" show-overflow-tooltip label="服务方名称" /> |
| | | <el-table-column prop="createDeptName" show-overflow-tooltip label="需求方名称" /> |
| | |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import { getDictionaryByCode } from '@/api/system/dictbiz' |
| | | import { getDeptTree } from '@/api/system/dept' |
| | | import { getDictLabel } from '@ztzf/utils' |
| | | import { dateRangeFormat, getDictLabel } from '@ztzf/utils' |
| | | import FormDiaLog from './FormDiaLog.vue' |
| | | import { gdWorkOrderPageApi, gdWorkOrderRemoveApi } from './orderManageApi' |
| | | import dayjs from 'dayjs' |
| | | |
| | | // 初始化查询参数 |
| | | const initSearchParams = () => ({ |
| | |
| | | size: 10, // 每页大小 |
| | | }) |
| | | const searchParams = ref(initSearchParams()) // 查询参数 |
| | | const executeTime = ref([]) // 执行时间范围 |
| | | const dateRange = ref([]) // 执行时间范围 |
| | | const total = ref(0) // 总条数 |
| | | const loading = ref(true) // 列表加载中 |
| | | const list = ref([]) // 列表数据 |
| | |
| | | |
| | | // 获取列表 |
| | | async function getList() { |
| | | const range = dateRangeFormat(dateRange.value) |
| | | loading.value = true |
| | | try { |
| | | const res = await gdWorkOrderPageApi(searchParams.value) |
| | | const res = await gdWorkOrderPageApi({ ...searchParams.value, startTime: range[0], endTime: range[1] }) |
| | | list.value = res?.data?.data?.records ?? [] |
| | | total.value = res?.data?.data?.total ?? 0 |
| | | } finally { |
| | |
| | | |
| | | // 查询 |
| | | function handleSearch() { |
| | | // 处理执行时间范围 |
| | | if (executeTime.value && executeTime.value.length === 2) { |
| | | searchParams.value.executeStartTime = executeTime.value[0] |
| | | searchParams.value.executeEndTime = executeTime.value[1] |
| | | } else { |
| | | searchParams.value.executeStartTime = '' |
| | | searchParams.value.executeEndTime = '' |
| | | } |
| | | searchParams.value.current = 1 |
| | | getList() |
| | | } |
| | |
| | | // 重置查询 |
| | | function resetForm() { |
| | | queryParamsRef.value?.resetFields() |
| | | executeTime.value = [] |
| | | dateRange.value = [] |
| | | searchParams.value.current = 1 |
| | | getList() |
| | | } |