| | |
| | | v-hasPermi="['equipCalibrateConfirm:add']" |
| | | >新增</el-button> |
| | | </el-form-item> |
| | | <el-form-item v-if="isAdmin" label="企业:" > |
| | | <el-form-item v-if="isAdmin" label="单位:" > |
| | | <el-select v-model="data.queryParams.companyId" placeholder="请选择" clearable> |
| | | <el-option |
| | | v-for="item in companyList" |
| | |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="年份:"> |
| | | <el-date-picker |
| | | v-model="data.queryParams.year" |
| | | type="year" |
| | | value-format="YYYY" |
| | | placeholder="请选择年份" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item > |
| | | <el-button v-if="isAdmin" type="primary" @click="getList">查询</el-button> |
| | | <el-button v-if="isAdmin" type="primary" plain @click="reset">重置</el-button> |
| | | <el-button type="primary" @click="getList">查询</el-button> |
| | | <el-button type="primary" plain @click="reset">重置</el-button> |
| | | <el-button type="primary" plain @click="copy">复制</el-button> |
| | | <!-- <el-button type="primary">导出</el-button>--> |
| | | </el-form-item> |
| | | </el-form> |
| | |
| | | {{scope.row.deviceName + '确认单'}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="calibrationTime" align="center" label="校准日期" /> |
| | | <el-table-column label="操作" align="center"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" @click="openDialog('view',scope.row)">查看</el-button> |
| | |
| | | @pagination="getList" |
| | | /> |
| | | <edit-dialog ref="dialogRef" @getList=getList></edit-dialog> |
| | | <el-dialog |
| | | v-model="copyVisible" |
| | | width="500px" |
| | | :before-close="handleCloseCopy" |
| | | :close-on-press-escape="false" |
| | | :close-on-click-modal="false" |
| | | > |
| | | <div v-if="data.isAdmin"> |
| | | <span style="display:block;margin-bottom: 8px">单位名称:</span> |
| | | <el-select |
| | | v-model="queryParams.companyId" |
| | | filterable |
| | | style="width: 100%;margin-bottom: 8px" |
| | | > |
| | | <el-option |
| | | v-for="item in data.companyList" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | </div> |
| | | <span style="display:block;margin-bottom: 8px">将以下年份数据:</span> |
| | | <el-date-picker |
| | | v-model="data.sourceYear" |
| | | type="year" |
| | | value-format="YYYY" |
| | | style="margin-bottom: 8px;width: 100%;" |
| | | placeholder="请选择" |
| | | /> |
| | | <span style="display:block;margin-bottom: 8px">复制到:</span> |
| | | <el-date-picker |
| | | v-model="data.targetYear" |
| | | type="year" |
| | | value-format="YYYY" |
| | | style="margin-bottom: 8px;width: 100%" |
| | | placeholder="请选择" |
| | | /> |
| | | <div class="dialog-footer" style="display: flex;justify-content: right"> |
| | | <el-button @click="handleCloseCopy" size="default">取 消</el-button> |
| | | <el-button type="primary" @click="onSubmitCopy" size="default" v-preReClick>确认</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | getMaintenanceRecordList |
| | | } from "@/api/infrastructureMng/ledger"; |
| | | import {getInternalAuditCheckInfo} from "@/api/innerReview/meetingReview"; |
| | | import {delCalibrationMonitoringEquipment, getCalibrationMonitoringEquipmentList} from "@/api/assetManage/assetMng"; |
| | | import { |
| | | copyCalibrationMonitoringEquipment, |
| | | delCalibrationMonitoringEquipment, |
| | | getCalibrationMonitoringEquipmentList |
| | | } from "@/api/assetManage/assetMng"; |
| | | |
| | | |
| | | const userStore = useUserStore() |
| | |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | companyId: null |
| | | companyId: null, |
| | | year:'' |
| | | }, |
| | | total: 0, |
| | | dataList: [], |
| | | companyList: [], |
| | | expertData: [], |
| | | isAdmin: false |
| | | isAdmin: false, |
| | | copyVisible:false, |
| | | targetYear:'', |
| | | sourceYear:'', |
| | | }); |
| | | const fields = ref({ |
| | | '序号':'index', |
| | |
| | | '使用地点':'duty', |
| | | '使用情况':'phone' |
| | | }); |
| | | const { queryParams, total, dataList,companyList, isAdmin, expertData } = toRefs(data); |
| | | const { queryParams, total, dataList,companyList, isAdmin, expertData, copyVisible } = toRefs(data); |
| | | const userInfo = ref() |
| | | onMounted(async ()=>{ |
| | | if(userStore.roles.includes('admin')){ |
| | |
| | | data.isAdmin = false |
| | | data.queryParams.companyId = userStore.companyId |
| | | } |
| | | await getNowYear() |
| | | await getList() |
| | | }) |
| | | |
| | | const getNowYear = () =>{ |
| | | data.queryParams.year = new Date().getFullYear().toString() |
| | | } |
| | | onUnmounted(()=>{ |
| | | |
| | | }) |
| | |
| | | loading.value = true |
| | | const res = await getCalibrationMonitoringEquipmentList(data.queryParams) |
| | | if(res.code == 200){ |
| | | data.dataList = res.data.list || [] |
| | | data.dataList = res.data.list.map(item => { |
| | | return{ |
| | | ...item, |
| | | calibrationTime: item.calibrationTime.substring(0,10) |
| | | } |
| | | }) || [] |
| | | data.total = res.data.total |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | |
| | | } |
| | | |
| | | /** 重置新增的表单以及其他数据 */ |
| | | const reset= async()=> { |
| | | data.queryParams = { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | companyId: null |
| | | const reset= async()=>{ |
| | | if(data.isAdmin){ |
| | | data.queryParams = { |
| | | companyId: '', |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | year: '', |
| | | |
| | | } |
| | | data.companyList = []; |
| | | await getCompanyList() |
| | | }else { |
| | | data.queryParams = { |
| | | companyId: data.queryParams.companyId, |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | year: '', |
| | | } |
| | | } |
| | | await getCompanyList() |
| | | await getList() |
| | | await getNowYear() |
| | | await getList(); |
| | | |
| | | } |
| | | const handleDelete = (val) => { |
| | | ElMessageBox.confirm( |
| | |
| | | } |
| | | }) |
| | | } |
| | | const copy = () => { |
| | | |
| | | data.copyVisible = true |
| | | } |
| | | const onSubmitCopy = async () => { |
| | | if(data.isAdmin && !data.queryParams.companyId){ |
| | | ElMessage.warning('请先选择单位') |
| | | return |
| | | } |
| | | if(!data.sourceYear){ |
| | | ElMessage.warning('请先选择要复制的年份') |
| | | return |
| | | } |
| | | if(!data.targetYear){ |
| | | ElMessage.warning('请选择目标年份') |
| | | return |
| | | } |
| | | ElMessageBox.confirm( |
| | | '该操作将覆盖目标年份的数据,是否继续?', |
| | | '提示', |
| | | { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | }) |
| | | .then( async() => { |
| | | const param = { |
| | | companyId: data.queryParams.companyId, |
| | | sourceYear: data.sourceYear, |
| | | targetYear: data.targetYear |
| | | } |
| | | const res = await copyCalibrationMonitoringEquipment(param); |
| | | if(res.code === 200){ |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: res.data |
| | | }); |
| | | await handleCloseCopy() |
| | | await getList(); |
| | | |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | }).catch(err => { |
| | | }) |
| | | } |
| | | const handleCloseCopy = () => { |
| | | data.targetYear='' |
| | | data.sourceYear='' |
| | | data.copyVisible = false |
| | | } |
| | | |
| | | </script> |