| | |
| | | :page="page" :tableLoading="tableLoading"></lims-table> |
| | | </div> |
| | | <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" v-model="usageTableDia" |
| | | title="设备保养计划表" width="80%" @close="closeDialog"> |
| | | title="设备使用授权表" width="80%" @close="closeDialog"> |
| | | <div style="display: flex;align-items: center;"> |
| | | <el-button size="small" type="primary" @click="addTableRow" v-if="operationType !== 'check'">添加</el-button> |
| | | <span style="width: 60px;margin-left: 10px">年份:</span> |
| | |
| | | clearable filterable multiple |
| | | :disabled="operationType === 'check'" |
| | | placeholder="请选择" size="small" style="width: 100%;"> |
| | | <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.id"> |
| | | <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.name"> |
| | | </el-option> |
| | | </el-select> |
| | | </template> |
| | |
| | | } from "@/api/cnas/resourceDemand/device"; |
| | | import {selectUserCondition} from "@/api/system/user"; |
| | | import {mapGetters} from "@/utils/store-compat"; |
| | | import {formatListDate} from './dateFormat' |
| | | import {saveBlobOrShowError} from '@/utils/saveBlob' |
| | | |
| | | export default { |
| | | name: '', |
| | |
| | | column: [ |
| | | { label: '计划年份', prop: 'impowerYear' }, |
| | | { label: '编制人', prop: 'compiler' }, |
| | | { label: '编制时间', prop: 'datePreparation' }, |
| | | { label: '编制时间', prop: 'datePreparation', formatData: val => formatListDate(val) }, |
| | | { label: '授权人', prop: 'audit' }, |
| | | { label: '授权日期', prop: 'auditDate' }, |
| | | { label: '授权日期', prop: 'auditDate', formatData: val => formatListDate(val) }, |
| | | { |
| | | dataType: 'tag', |
| | | label: '授权状态', |
| | |
| | | this.openDia('check', row); |
| | | }, |
| | | disabled: (row) => { |
| | | return row.status === 1 || this.userId !== row.auditId; |
| | | return row.status === 1 || this.userId != row.auditId; |
| | | }, |
| | | }, |
| | | { |
| | |
| | | }, |
| | | // 分页切换 |
| | | pagination(page) { |
| | | this.page.current = page.page |
| | | this.page.size = page.limit |
| | | this.getTableList() |
| | | }, |
| | |
| | | getImpowerDetail({ impowerId: this.impowerId }).then(res => { |
| | | if (res.code === 200) { |
| | | this.form = res.data |
| | | this.deviceImpowerDetails = this.form.deviceImpowerDetails |
| | | this.deviceImpowerDetails = this.form.deviceImpowerDetails || [] |
| | | this.deviceImpowerDetails.forEach(item => { |
| | | item['delegatedUserArr'] = item.delegatedUser.split(',') |
| | | item['delegatedUserArr'] = item.delegatedUser ? String(item.delegatedUser).split(',') : [] |
| | | }) |
| | | } |
| | | }).catch(error => { |
| | |
| | | }, |
| | | // 提交新增和修改 |
| | | submitForm() { |
| | | if (!this.form.impowerYear) { |
| | | this.$message.warning('请选择年份') |
| | | return |
| | | } |
| | | if (!this.deviceImpowerDetails.length) { |
| | | this.$message.warning('请添加设备') |
| | | return |
| | | } |
| | | const noDelegatee = this.deviceImpowerDetails.find(item => { |
| | | return !Array.isArray(item.delegatedUserArr) || item.delegatedUserArr.length === 0 |
| | | }) |
| | | if (noDelegatee) { |
| | | this.$message.warning(`请为设备“${noDelegatee.deviceName || ''}”选择被授权人`) |
| | | return |
| | | } |
| | | this.form.deviceImpowerDetails = this.HaveJson(this.deviceImpowerDetails) |
| | | this.form.deviceImpowerDetails.forEach((item) => { |
| | | item.delegatedUser = item.delegatedUserArr.join(',') |
| | | item.delegatedUser = Array.isArray(item.delegatedUserArr) ? item.delegatedUserArr.join(',') : '' |
| | | }) |
| | | this.submitFormLoading = true |
| | | if (this.operationType === 'add') { |
| | |
| | | }) |
| | | }, |
| | | openHandleOut (row) { |
| | | this.outLoading = true |
| | | exportDeviceImpower({ impowerId: row.impowerId }).then(res => { |
| | | this.outLoading = false |
| | | const blob = new Blob([res], { type: 'application/msword' }); |
| | | this.$download.saveAs(blob, '设备使用授权表' + '.docx') |
| | | saveBlobOrShowError(res, '设备使用授权表.docx', 'application/msword') |
| | | }).catch(() => { |
| | | this.outLoading = false |
| | | }) |
| | | }, |
| | | handleDeleteClick(row) { |