| | |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="维护内容:" prop="maintenanceContentArr"> |
| | | <el-checkbox-group v-model="form.maintenanceContentArr" :disabled="operationType === 'view'"> |
| | | <el-checkbox-group v-if="qualificationList.length" v-model="form.maintenanceContentArr" |
| | | :disabled="operationType === 'view'"> |
| | | <el-checkbox v-for="city in qualificationList" :key="city.label" :label="city.label" |
| | | :value="city.label"></el-checkbox> |
| | | </el-checkbox-group> |
| | | <el-input v-else v-model="form.maintenanceContentText" :disabled="operationType === 'view'" |
| | | size="small" placeholder="请输入维护内容" style="width: 100%"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | } from "@/api/cnas/resourceDemand/device"; |
| | | import limsTable from "@/components/Table/lims-table.vue"; |
| | | import {selectUserCondition} from "@/api/system/user"; |
| | | import {saveBlobOrShowError} from '@/utils/saveBlob' |
| | | |
| | | export default { |
| | | name: '', |
| | |
| | | maintenanceDate: '', |
| | | maintenanceContentArr: [], |
| | | maintenanceContent: '', |
| | | maintenanceContentText: '', |
| | | maintenanceUserId: '', |
| | | remark: '', |
| | | }, |
| | |
| | | qualificationList: [], |
| | | rules: { |
| | | maintenanceDate: [{ required: true, message: '请选择维护日期', trigger: 'change' }], |
| | | maintenanceContentArr: [{ required: true, message: '请选择维护内容', trigger: 'change' }], |
| | | maintenanceContentArr: [{ |
| | | validator: (rule, value, callback) => { |
| | | if (this.qualificationList.length) { |
| | | if (!value || value.length === 0) { |
| | | return callback(new Error('请选择维护内容')) |
| | | } |
| | | } else if (!this.form.maintenanceContentText || !this.form.maintenanceContentText.trim()) { |
| | | return callback(new Error('请输入维护内容')) |
| | | } |
| | | callback() |
| | | }, |
| | | trigger: 'change' |
| | | }], |
| | | maintenanceUserId: [{ required: true, message: '请选择维护人', trigger: 'change' }], |
| | | }, |
| | | responsibleOptions: [], |
| | |
| | | }, |
| | | // 分页切换 |
| | | pagination(page) { |
| | | this.page.current = page.page |
| | | this.page.size = page.limit |
| | | this.getTableList() |
| | | }, |
| | |
| | | this.form.id = '' |
| | | if (this.operationType === 'edit') { |
| | | this.form = {...row} |
| | | this.form['maintenanceContentArr'] = this.form.maintenanceContent.split(',') |
| | | this.form['maintenanceContentArr'] = this.form.maintenanceContent ? this.form.maintenanceContent.split(',') : [] |
| | | this.form['maintenanceContentText'] = this.form.maintenanceContent || '' |
| | | } |
| | | }) |
| | | this.getDictS() |
| | |
| | | '制样室': 'sample_maintenance_content', |
| | | '低温实验室': 'hypothermia_maintenance_content', |
| | | }; |
| | | // 获取当前节点的实验室名称 |
| | | const name = this.clickNodeVal.parent.label; |
| | | // 取设备存放点名称作为映射键 |
| | | const name = this.clickNodeVal.storagePoint || '其他'; |
| | | // 根据映射关系获取对应的类型 |
| | | const type = labTypeMapping[name]; |
| | | if (!type) { |
| | | this.qualificationList = []; |
| | | return; |
| | | } |
| | | this.getDicts(type).then((response) => { |
| | | this.qualificationList = response.data.map((m) => { |
| | | return { |
| | |
| | | deviceId: this.clickNodeVal.value |
| | | }).then(res => { |
| | | this.outLoading = false |
| | | const blob = new Blob([res], { type: 'application/octet-stream' }); |
| | | this.$download.saveAs(blob, '设备维护保养.doc') |
| | | saveBlobOrShowError(res, '设备维护保养.doc', 'application/msword') |
| | | }).catch(() => { |
| | | this.outLoading = false |
| | | }) |
| | | |
| | | }, |
| | | handleDeleteClick(row) { |
| | | this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', { |
| | | this.$confirm('此操作将永久删除该条保养记录, 是否继续?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | |
| | | this.$refs.form.validate((valid) => { |
| | | if (valid) { |
| | | this.buttonLoading = true; |
| | | this.form.maintenanceContent = this.form.maintenanceContentArr.join(',') |
| | | this.form.maintenanceContent = this.qualificationList.length |
| | | ? this.form.maintenanceContentArr.join(',') |
| | | : (this.form.maintenanceContentText || '').trim() |
| | | this.form.deviceId = this.clickNodeVal.value |
| | | addDeviceMaintenance(this.form).then(res => { |
| | | this.buttonLoading = false; |