| | |
| | | >新增</el-button> |
| | | </el-form-item> |
| | | <el-form-item v-if="isAdmin" label="单位:" > |
| | | <el-select v-model="data.queryParams.companyId" placeholder="请选择" clearable> |
| | | <el-select v-model="queryParams.companyId" placeholder="请选择" clearable> |
| | | <el-option |
| | | v-for="item in companyList" |
| | | :key="item.id" |
| | |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item v-if="isAdmin" label="年份:"> |
| | | <el-form-item label="年份:"> |
| | | <el-date-picker |
| | | v-model="data.queryParams.year" |
| | | v-model="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" plain @click="openDialog('edit',data.dataList)" v-if="data.hasInfo" v-hasPermi="['annualVerificationPlan:list:edit']">编辑</el-button> |
| | | <el-button type="primary" @click="getList">查询</el-button> |
| | | <el-button type="primary" plain @click="reset">重置</el-button> |
| | | <el-button type="primary" @click="openDialog('edit',dataList)" v-if="data.hasInfo" v-hasPermi="['annualVerificationPlan:list:edit']">编辑</el-button> |
| | | <el-button type="primary" plain @click="downloadFile()" v-if="data.hasInfo">导出</el-button> |
| | | <el-button type="primary" plain @click="copy">复制</el-button> |
| | | <!-- <el-button type="primary">导出</el-button>--> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <div style="background: #fff;padding: 20px;border-radius: 0.6rem"> |
| | | <el-form :model="data.dataList" label-position="left" size="default" label-width="120px" v-if="data.hasInfo"> |
| | | <el-form :model="dataList" label-position="left" size="default" label-width="120px" v-if="data.hasInfo"> |
| | | <el-form-item v-if="isAdmin" label="单位:" prop="companyId"> |
| | | <el-input |
| | | v-model.trim="data.dataList.companyName" |
| | | v-model.trim="dataList.companyName" |
| | | style="width: 100%;" |
| | | readonly |
| | | > |
| | |
| | | </el-form-item> |
| | | <el-form-item label="计划名称:" prop="name"> |
| | | <el-input |
| | | v-model.trim="data.dataList.name" |
| | | v-model.trim="dataList.name" |
| | | style="width: 100%;" |
| | | readonly |
| | | > |
| | |
| | | </el-form-item> |
| | | <el-form-item label="年份:" prop="year"> |
| | | <el-input |
| | | v-model.trim="data.dataList.year" |
| | | v-model.trim="dataList.year" |
| | | style="width: 100%;" |
| | | readonly |
| | | > |
| | |
| | | <el-form-item label="设备列表:" prop="annualVerificationDevices"> |
| | | |
| | | </el-form-item> |
| | | <el-table v-if="data.dataList.annualVerificationDevices && data.dataList.annualVerificationDevices.length>0" :data="data.dataList.annualVerificationDevices" style="margin-bottom: 20px" :border="true"> |
| | | <el-table v-if="dataList.annualVerificationDevices && dataList.annualVerificationDevices.length>0" :data="dataList.annualVerificationDevices" style="margin-bottom: 20px" :border="true"> |
| | | <el-table-column label="序号" type="index" width="80" align="center"> |
| | | </el-table-column> |
| | | <el-table-column label="设备编号" prop="deviceNumber" align="center"/> |
| | | <el-table-column label="设备名称" prop="deviceName" align="center"/> |
| | | <el-table-column label="设备类型" prop="planType" align="center"> |
| | | <template #default="scope"> |
| | | {{scope.row.planType == 1?'软件':'硬件'}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="规格型号" prop="model" align="center"/> |
| | | <el-table-column label="校准周期" prop="calibrationCycle" align="center"/> |
| | | <el-table-column label="下次校准时间" prop="nextCalibrationTime" align="center"> |
| | | <template #default="scope"> |
| | | {{scope.row.nextCalibrationTime.substring(0,10)}} |
| | | {{scope.row.nextCalibrationTime?.substring(0,10)}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="实际检定时间" prop="actCalibrationTime" align="center"> |
| | | <template #default="scope"> |
| | | {{scope.row.actCalibrationTime.substring(0,10)}} |
| | | {{scope.row.actCalibrationTime?.substring(0,10)}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="校准人" prop="calibrationUser" align="center"/> |
| | |
| | | <el-col :span="12"> |
| | | <el-form-item label="编制:" prop="establishmentName"> |
| | | <el-input |
| | | v-model.trim="data.dataList.establishmentName" |
| | | v-model.trim="dataList.establishmentName" |
| | | style="width: 100%;" |
| | | readonly |
| | | > |
| | |
| | | <el-col :span="12"> |
| | | <el-form-item label="日期:" prop="establishmentTime" > |
| | | <el-input |
| | | v-model.trim="data.dataList.establishmentTime" |
| | | v-model.trim="dataList.establishmentTime" |
| | | style="width: 100%;" |
| | | readonly |
| | | > |
| | |
| | | <el-col :span="12"> |
| | | <el-form-item label="审核:" prop="processName"> |
| | | <el-input |
| | | v-model.trim="data.dataList.processName" |
| | | v-model.trim="dataList.processName" |
| | | style="width: 100%;" |
| | | readonly |
| | | > |
| | |
| | | <el-col :span="12"> |
| | | <el-form-item label="日期:" prop="processTime" > |
| | | <el-input |
| | | v-model.trim="data.dataList.processTime" |
| | | v-model.trim="dataList.processTime" |
| | | style="width: 100%;" |
| | | readonly |
| | | > |
| | |
| | | <!-- />--> |
| | | |
| | | <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> |
| | | |
| | |
| | | getMaintenanceEvaluateList |
| | | } from "@/api/infrastructureMng/ledger"; |
| | | import { |
| | | copyAnnualVerificationPlan, |
| | | delAnnualVerificationPlan, |
| | | getAnnualVerificationPlanDetail, |
| | | getAnnualVerificationPlanList |
| | | } from "@/api/assetManage/assetMng"; |
| | | import {copyControl} from "@/api/environment/factors"; |
| | | |
| | | |
| | | const userStore = useUserStore() |
| | |
| | | companyList: [], |
| | | isAdmin: false, |
| | | baseUrl: import.meta.env.VITE_APP_BASE_API, |
| | | hasInfo: false |
| | | hasInfo: false, |
| | | copyVisible:false, |
| | | targetYear:'', |
| | | sourceYear:'', |
| | | }); |
| | | |
| | | const { queryParams, total, dataList,companyList, isAdmin } = toRefs(data); |
| | | const { queryParams, total, dataList,companyList, isAdmin, copyVisible } = toRefs(data); |
| | | const userInfo = ref() |
| | | onMounted(async ()=>{ |
| | | data.queryParams.year = new Date().getFullYear().toString() |
| | |
| | | data.dataList.companyName = data.companyList.find(i=>i.id == data.dataList.companyId)?.name |
| | | data.dataList.establishmentTime = data.dataList.establishmentTime.substring(0,10) |
| | | data.dataList.processTime = data.dataList.processTime.substring(0,10) |
| | | console.log(data.dataList,'data') |
| | | } |
| | | }else{ |
| | | data.hasInfo = false |
| | |
| | | |
| | | /** 重置新增的表单以及其他数据 */ |
| | | const reset= async()=> { |
| | | data.queryParams = { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | companyId: null, |
| | | year: new Date().getFullYear().toString() |
| | | if(data.isAdmin){ |
| | | data.queryParams = { |
| | | companyId: '', |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | year: new Date().getFullYear().toString(), |
| | | } |
| | | data.companyList = []; |
| | | await getCompanyList() |
| | | }else { |
| | | data.queryParams = { |
| | | companyId: data.queryParams.companyId, |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | year: new Date().getFullYear().toString(), |
| | | } |
| | | } |
| | | await getCompanyList() |
| | | 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 copyAnnualVerificationPlan(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> |