| | |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="文档类型" prop="resultType"> |
| | | <el-select |
| | | class="gd-select gray" |
| | | popper-class="gd-select-popper" |
| | | <el-cascader |
| | | class="gd-cascader gray" |
| | | popper-class="gd-cascader-popper" |
| | | v-model="searchParams.resultType" |
| | | :options="workOrderTypeXT" |
| | | :props="taskTypeCascaderProps" |
| | | placeholder="请选择" |
| | | clearable |
| | | @change="handleSearch" |
| | | > |
| | | <el-option |
| | | v-for="item in dictObj.workOrderType" |
| | | :key="item.dictKey" |
| | | :label="item.dictValue" |
| | | :value="item.dictKey" |
| | | /> |
| | | </el-select> |
| | | /> |
| | | </el-form-item> |
| | | |
| | | <el-form-item class="gd-search-actions"> |
| | |
| | | <!-- <el-table-column prop="resultType" show-overflow-tooltip label="文档类型" /> --> |
| | | <el-table-column prop="resultType" show-overflow-tooltip label="文档类型"> |
| | | <template v-slot="{ row }"> |
| | | {{ getDictLabel(row.resultType, dictObj.workOrderType) }} |
| | | {{ getTaskTypeLabel(row.resultType, workOrderTypeXT) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" class-name="operation-btns"> |
| | |
| | | <el-input v-model="editParams.nickName" class="gd-input" placeholder="请输入" /> |
| | | </el-form-item> |
| | | <el-form-item label="文档类型" prop="resultType" v-if="titleTxt === '上传巡查报告'"> |
| | | <el-select |
| | | class="gd-select" |
| | | popper-class="gd-select-popper" |
| | | <el-cascader |
| | | class="gd-cascader" |
| | | popper-class="gd-cascader-popper" |
| | | v-model="editParams.resultType" |
| | | :options="workOrderTypeXT" |
| | | :props="{ ...taskTypeCascaderProps, multiple: true }" |
| | | placeholder="请选择" |
| | | clearable |
| | | > |
| | | <el-option |
| | | v-for="item in dictObj.workOrderType" |
| | | :key="item.dictKey" |
| | | :label="item.dictValue" |
| | | :value="item.dictKey" |
| | | /> |
| | | </el-select> |
| | | collapse-tags |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="上传文件" prop="link" v-if="titleTxt === '上传巡查报告'"> |
| | | <el-upload class="avatar-uploader" action="" :show-file-list="false" :before-upload="onUploadFileBefore"> |
| | |
| | | </basic-container> |
| | | </template> |
| | | <script setup> |
| | | import { Search, RefreshRight, Download, Upload, Delete } from '@element-plus/icons-vue' |
| | | import { fjPageApi, fjSubmitApi, fjRemoveApi, fjDetailApi, fjUploadApi,fjDownloadByByteApi } from './inspectionRequestApi' |
| | | import { Search, RefreshRight, Download, Upload } from '@element-plus/icons-vue' |
| | | import { fjPageApi, fjSubmitApi, fjRemoveApi, fjUploadApi, fjDownloadByByteApi } from './inspectionRequestApi' |
| | | import { useStore } from 'vuex' |
| | | import { ref, computed, inject, onMounted } from 'vue' |
| | | import { ElMessage, ElMessageBox, ElLoading } from 'element-plus' |
| | | import { getDictLabel } from '@ztzf/utils' |
| | | import { ref, computed, onMounted } from 'vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import PreviewFiles from '@/components/PreviewFiles/PreviewFiles.vue' |
| | | import { getDictionaryByCode } from '@/api/system/dictbiz' |
| | | import { Base64 } from 'js-base64' |
| | | import { getDictListApi } from '@/api/zkxt' |
| | | import { |
| | | getTaskTypeLabel, |
| | | normalizeTaskTypeOptions, |
| | | taskTypeCascaderProps, |
| | | } from '../taskTypeOptions' |
| | | |
| | | const store = useStore() |
| | | const userInfo = computed(() => store.getters.userInfo) |
| | |
| | | // 上传名称 |
| | | const uploadName = ref('') |
| | | |
| | | const dictObj = ref({ |
| | | workOrderType: [], // 巡查任务类型 |
| | | }) |
| | | const workOrderTypeXT = ref([]) |
| | | |
| | | const searchParams = ref(initSearchParams()) // 查询参数 |
| | | const total = ref(0) // 总条数 |
| | |
| | | |
| | | // 获取字典 |
| | | function getDictList() { |
| | | getDictionaryByCode('workOrderType').then(res => { |
| | | dictObj.value = res.data.data |
| | | getDictListApi('task_inspection_type').then(res => { |
| | | workOrderTypeXT.value = normalizeTaskTypeOptions(res.data.data || []) |
| | | }) |
| | | } |
| | | |
| | | function toTaskTypeQueryValue(value) { |
| | | return Array.isArray(value) ? value.join(',') : value |
| | | } |
| | | |
| | | // 将字节大小转换为可读格式的函数 |
| | |
| | | async function getList() { |
| | | loading.value = true |
| | | try { |
| | | const res = await fjPageApi({ ...searchParams.value }) |
| | | const res = await fjPageApi({ |
| | | ...searchParams.value, |
| | | resultType: toTaskTypeQueryValue(searchParams.value.resultType), |
| | | }) |
| | | list.value = res?.data?.data?.records ?? [] |
| | | total.value = res?.data?.data?.total ?? 0 |
| | | } finally { |
| | |
| | | if (valid) { |
| | | submitting.value = true |
| | | try { |
| | | await fjSubmitApi({ ...editParams.value }) |
| | | await fjSubmitApi(editParams.value) |
| | | ElMessage.success('保存成功') |
| | | isShowEditView.value = false |
| | | getList() |