设备模块各标签页弹窗新增草稿自动保存与恢复:编辑或录入数据中途关闭/刷新页面,再次打开同一弹窗时自动恢复未保存的编辑内容(弹窗显示"已恢复上次未保存的编辑内容"提示),保存成功后草稿自动清除;新增 src/mixins/draftSave.js
同时清理设备死代码:management.vue 数采配置旧弹窗及其提交方法、calibration.vue 被注释的导出按钮、device.js 中 numberCollect/deviceMetricRecordExport 两个死接口定义
| | |
| | | }); |
| | | } |
| | | |
| | | // ç»´æ¤æ°éé
ç½® |
| | | export function numberCollect(data) { |
| | | return request({ |
| | | url: "/deviceScope/numberCollect", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | //设å¤é¢çº¦æ¥å£-å表 |
| | | export function getDeviceParameter(query) { |
| | | return request({ |
| | |
| | | return request({ |
| | | url: "/deviceMetricRecord/deleteDeviceMetricRecord", |
| | | method: "delete", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //è®¾å¤æ ¡å å¯¼åº |
| | | export function deviceMetricRecordExport(query) { |
| | | return request({ |
| | | url: "/deviceMetricRecord/deviceMetricRecordExport", |
| | | method: "get", |
| | | responseType: "blob", |
| | | params: query, |
| | | }); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | import cache from '@/plugins/cache' |
| | | import useUserStore from '@/store/modules/user' |
| | | |
| | | // å¼¹çªç¼è¾è稿èªå¨ä¿å/æ¢å¤ï¼ |
| | | // æå¼å¼¹çªæ¶æ³¨åå¯ä¸ä¸å¡ keyï¼è¡¨åææ¹å¨æ¶é²æåå
¥ localStorageï¼ |
| | | // å
³é/å页/å·æ°å忬¡æå¼åä¸å¼¹çªæ¶èªå¨æ¢å¤æªä¿åçå
容ï¼ä¿åæååè稿æ¸
é¤ã |
| | | export default { |
| | | data() { |
| | | return { |
| | | draftStates: {} |
| | | } |
| | | }, |
| | | created() { |
| | | this.draftBeforeUnload = () => { |
| | | this.draftFlushAll() |
| | | } |
| | | window.addEventListener('beforeunload', this.draftBeforeUnload) |
| | | }, |
| | | beforeUnmount() { |
| | | this.draftFlushAll() |
| | | window.removeEventListener('beforeunload', this.draftBeforeUnload) |
| | | }, |
| | | methods: { |
| | | // æå¼å¼¹çªã表å填好åè°ç¨ï¼ææªä¿åè稿åèªå¨æ¢å¤ |
| | | // bizKeyï¼å
¨å±å¯ä¸ä¸å¡åï¼formFieldï¼è¡¨ååæ®µå(å¦ 'form')ï¼recordIdï¼ç¼è¾ä¼ è®°å½idãæ°å¢ä¼ ä¸ä¸æï¼visibleFieldï¼å¼¹çªæ¾éåæ®µ(å¦ 'dialogVisible') |
| | | draftRestore(bizKey, formField, recordId, visibleField) { |
| | | const old = this.draftStates[bizKey] |
| | | if (old) { |
| | | this.draftTeardown(old) |
| | | } |
| | | let uid = '' |
| | | try { |
| | | uid = useUserStore().id || '' |
| | | } catch (e) { |
| | | } |
| | | const rid = (recordId === null || recordId === undefined || recordId === '') ? 'new' : recordId |
| | | const state = { |
| | | key: `limsDraft_${uid}_${bizKey}_${rid}`, |
| | | formField, |
| | | visibleField, |
| | | active: true, |
| | | timer: null, |
| | | baseline: '' |
| | | } |
| | | state.unwatchForm = this.$watch(formField, () => this.draftSchedule(state), { deep: true }) |
| | | if (visibleField) { |
| | | state.unwatchVisible = this.$watch(visibleField, (val) => { |
| | | if (!val) { |
| | | this.draftStop(bizKey) |
| | | } |
| | | }) |
| | | } |
| | | state.baseline = this.draftSnapshot(state) |
| | | this.draftStates[bizKey] = state |
| | | const raw = cache.local.get(state.key) |
| | | if (raw) { |
| | | try { |
| | | const draft = JSON.parse(raw) |
| | | const target = this[formField] |
| | | if (Array.isArray(target) && Array.isArray(draft)) { |
| | | target.splice(0, target.length, ...draft) |
| | | } else if (target && typeof target === 'object') { |
| | | Object.assign(target, draft) |
| | | } else { |
| | | this[formField] = draft |
| | | } |
| | | this.$message({ type: 'info', message: 'å·²æ¢å¤ä¸æ¬¡æªä¿åçç¼è¾å
容' }) |
| | | } catch (e) { |
| | | cache.local.remove(state.key) |
| | | } |
| | | } |
| | | }, |
| | | draftSnapshot(state) { |
| | | try { |
| | | return JSON.stringify(this[state.formField]) |
| | | } catch (e) { |
| | | return '' |
| | | } |
| | | }, |
| | | draftSchedule(state) { |
| | | if (!state.active) { |
| | | return |
| | | } |
| | | if (state.timer) { |
| | | clearTimeout(state.timer) |
| | | } |
| | | state.timer = setTimeout(() => { |
| | | state.timer = null |
| | | this.draftWrite(state, true) |
| | | }, 300) |
| | | }, |
| | | draftWrite(state, checkVisible) { |
| | | if (!state.active) { |
| | | return |
| | | } |
| | | if (checkVisible && state.visibleField && !this[state.visibleField]) { |
| | | return |
| | | } |
| | | const json = this.draftSnapshot(state) |
| | | if (json === '' || json === state.baseline) { |
| | | cache.local.remove(state.key) |
| | | } else { |
| | | cache.local.set(state.key, json) |
| | | } |
| | | }, |
| | | // ç¨æ·åæ¶/å
³éå¼¹çªæ¶è°ç¨(å¿
须卿¸
空表åä¹å) |
| | | draftStop(bizKey) { |
| | | const state = this.draftStates[bizKey] |
| | | if (!state || !state.active) { |
| | | return |
| | | } |
| | | if (state.timer) { |
| | | clearTimeout(state.timer) |
| | | state.timer = null |
| | | } |
| | | this.draftWrite(state, false) |
| | | this.draftTeardown(state) |
| | | }, |
| | | // ä¿åæååè°ç¨ |
| | | draftClear(bizKey) { |
| | | const state = this.draftStates[bizKey] |
| | | if (!state) { |
| | | return |
| | | } |
| | | if (state.timer) { |
| | | clearTimeout(state.timer) |
| | | state.timer = null |
| | | } |
| | | cache.local.remove(state.key) |
| | | this.draftTeardown(state) |
| | | }, |
| | | draftTeardown(state) { |
| | | state.active = false |
| | | if (state.unwatchForm) { |
| | | state.unwatchForm() |
| | | state.unwatchForm = null |
| | | } |
| | | if (state.unwatchVisible) { |
| | | state.unwatchVisible() |
| | | state.unwatchVisible = null |
| | | } |
| | | }, |
| | | draftFlushAll() { |
| | | Object.keys(this.draftStates).forEach((k) => { |
| | | const state = this.draftStates[k] |
| | | if (state && state.active) { |
| | | if (state.timer) { |
| | | clearTimeout(state.timer) |
| | | state.timer = null |
| | | } |
| | | this.draftWrite(state, true) |
| | | this.draftTeardown(state) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | |
| | | updateDeviceAcceptance, |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import { selectUserCondition } from "@/api/business/inspectionTask"; |
| | | import draftSave from '@/mixins/draftSave' |
| | | export default { |
| | | name: "acceptance-form", |
| | | // import å¼å
¥çç»ä»¶éè¦æ³¨å
¥å°å¯¹è±¡ä¸æè½ä½¿ç¨ |
| | | components: {}, |
| | | mixins: [draftSave], |
| | | data() { |
| | | // è¿éåæ¾æ°æ® |
| | | return { |
| | |
| | | this.getUserList() |
| | | if (this.form.acceptanceId) { |
| | | this.searchInfo() |
| | | } else if (this.operationType !== 'view') { |
| | | this.draftRestore('acceptanceForm', 'form', this.form.deviceId, 'dialogVisible') |
| | | } |
| | | }, |
| | | // æ¥è¯¢è¯¦æ
|
| | | searchInfo() { |
| | | getDeviceAcceptance({ acceptanceId: this.form.acceptanceId }).then(res => { |
| | | if (res.code === 200) { |
| | | const id = this.form.acceptanceId |
| | | this.form = { ...res.data } |
| | | if (this.operationType !== 'view') { |
| | | this.draftRestore('acceptanceForm', 'form', id, 'dialogVisible') |
| | | } |
| | | } |
| | | }).catch(error => { |
| | | console.error(error) |
| | |
| | | addDeviceAcceptance(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æ°å¢æå') |
| | | this.draftClear('acceptanceForm') |
| | | this.resetForm() |
| | | } |
| | | this.submitFormLoading = false |
| | |
| | | updateDeviceAcceptance(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('ä¿®æ¹æå') |
| | | this.draftClear('acceptanceForm') |
| | | this.resetForm() |
| | | } |
| | | this.submitFormLoading = false |
| | |
| | | }, |
| | | // å
³éå¼¹æ¡ |
| | | resetForm() { |
| | | this.draftStop('acceptanceForm') |
| | | this.dialogVisible = false |
| | | this.$emit('closeDialog') |
| | | }, |
| | |
| | | getDeviceAccidentReport, |
| | | addDeviceAccidentReport, |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import draftSave from '@/mixins/draftSave' |
| | | export default { |
| | | name: "accident-form", |
| | | // import å¼å
¥çç»ä»¶éè¦æ³¨å
¥å°å¯¹è±¡ä¸æè½ä½¿ç¨ |
| | | components: {}, |
| | | mixins: [draftSave], |
| | | data() { |
| | | // è¿éåæ¾æ°æ® |
| | | return { |
| | |
| | | this.getUserList() |
| | | if (this.form.accidentReportId) { |
| | | this.searchInfo() |
| | | } else { |
| | | this.draftRestore('accidentForm', 'form', this.form.deviceId, 'dialogVisible') |
| | | } |
| | | }, |
| | | // æ¥è¯¢è¯¦æ
|
| | | searchInfo() { |
| | | getDeviceAccidentReport({ accidentReportId: this.form.accidentReportId }).then(res => { |
| | | if (res.code === 200) { |
| | | const id = this.form.accidentReportId |
| | | this.form = { ...res.data } |
| | | this.draftRestore('accidentForm', 'form', id, 'dialogVisible') |
| | | if (res.data.isFinish === 0) { |
| | | if (this.form.assessorUserId) { |
| | | this.currentStep = 1 |
| | |
| | | addDeviceAccidentReport(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æ°å¢æå') |
| | | this.draftClear('accidentForm') |
| | | this.resetForm() |
| | | } |
| | | this.submitFormLoading = false |
| | |
| | | }, |
| | | // å
³éå¼¹æ¡ |
| | | resetForm() { |
| | | this.draftStop('accidentForm') |
| | | this.dialogVisible = false |
| | | this.$emit('closeDialog') |
| | | }, |
| | |
| | | getNoConfigProduct, |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import limsTable from "@/components/Table/lims-table.vue"; |
| | | import draftSave from '@/mixins/draftSave' |
| | | export default { |
| | | name: "dataAcquisitionConfig", |
| | | // import å¼å
¥çç»ä»¶éè¦æ³¨å
¥å°å¯¹è±¡ä¸æè½ä½¿ç¨ |
| | | components: {limsTable}, |
| | | mixins: [draftSave], |
| | | props: { |
| | | deviceId: { |
| | | type: Number, |
| | |
| | | this.configForm["sampleCode"] = res.data.sampleCode; |
| | | this.configForm["dbFileName"] = res.data.dbFileName; |
| | | this.configForm["fiberOpticRibbon"] = res.data.fiberOpticRibbon |
| | | this.$nextTick(() => { |
| | | this.draftRestore('acquisitionConfig4', 'configForm', this.deviceId, 'dialogVisible4') |
| | | }) |
| | | }) |
| | | }, |
| | | // æäº¤æä»¶é
ç½® |
| | |
| | | this.upLoad4 = true; |
| | | saveDeviceFileConfiguration({ deviceId: this.deviceId, ...obj }).then(res => { |
| | | if (res.code == 200) { |
| | | this.draftClear('acquisitionConfig4') |
| | | this.dialogVisible4 = false; |
| | | this.init(); |
| | | this.$message.success("æä½æå"); |
| | |
| | | }); |
| | | }); |
| | | } |
| | | this.$nextTick(() => { |
| | | this.draftRestore('acquisitionConfig3', 'configForm', row.structureItemParameterId, 'dialogVisible3') |
| | | this.draftRestore('acquisitionConfig3Domains', 'domains', row.structureItemParameterId, 'dialogVisible3') |
| | | }) |
| | | }); |
| | | }, |
| | | // æäº¤æ°éé
ç½® |
| | |
| | | dataConfigList: this.domains, |
| | | isDevice: false |
| | | }).then(res => { |
| | | this.draftClear('acquisitionConfig3') |
| | | this.draftClear('acquisitionConfig3Domains') |
| | | this.dialogVisible3 = false; |
| | | this.domains = [ |
| | | { |
| | |
| | | this.page.current = val; |
| | | }, |
| | | closeForm() { |
| | | this.draftStop('acquisitionConfig3') |
| | | this.draftStop('acquisitionConfig3Domains') |
| | | this.deleteList = []; |
| | | this.domains = [ |
| | | { |
| | |
| | | deviceScopeSearch, |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import { selectUserCondition } from "@/api/performance/class"; |
| | | import draftSave from '@/mixins/draftSave' |
| | | export default { |
| | | name: "addVerificationYearPlanDia", |
| | | // import å¼å
¥çç»ä»¶éè¦æ³¨å
¥å°å¯¹è±¡ä¸æè½ä½¿ç¨ |
| | | components: {}, |
| | | mixins: [draftSave], |
| | | data() { |
| | | // è¿éåæ¾æ°æ® |
| | | return { |
| | |
| | | examinePlanDetailsList: [], |
| | | } |
| | | this.examinePlanDetailsList = [] |
| | | this.$nextTick(() => { |
| | | this.draftRestore('addVerificationYearPlanDiaForm', 'form', '', 'applicationForm') |
| | | this.draftRestore('addVerificationYearPlanDiaRows', 'examinePlanDetailsList', '', 'applicationForm') |
| | | }) |
| | | } else { |
| | | this.getRowInfo(row) |
| | | } |
| | |
| | | this.form.planName = res.data.planName |
| | | this.form.planYear = res.data.planYear |
| | | this.form.planId = res.data.planId |
| | | this.$nextTick(() => { |
| | | this.draftRestore('addVerificationYearPlanDiaForm', 'form', this.form.planId, 'applicationForm') |
| | | this.draftRestore('addVerificationYearPlanDiaRows', 'examinePlanDetailsList', this.form.planId, 'applicationForm') |
| | | }) |
| | | } |
| | | }).catch(error => { |
| | | this.yearTableLoading = false |
| | |
| | | addDeviceExaminePlan(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æ°å¢æå') |
| | | this.draftClear('addVerificationYearPlanDiaForm') |
| | | this.draftClear('addVerificationYearPlanDiaRows') |
| | | this.closeDialog() |
| | | this.$emit('closeDia') |
| | | } |
| | |
| | | updateDeviceExaminePlan(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æ°å¢æå') |
| | | this.draftClear('addVerificationYearPlanDiaForm') |
| | | this.draftClear('addVerificationYearPlanDiaRows') |
| | | this.closeDialog() |
| | | this.$emit('closeDia') |
| | | } |
| | |
| | | } |
| | | }, |
| | | closeDialog() { |
| | | this.draftStop('addVerificationYearPlanDiaForm') |
| | | this.draftStop('addVerificationYearPlanDiaRows') |
| | | this.applicationForm = false |
| | | }, |
| | | // è·åææè®¾å¤ |
| | |
| | | deviceScopeSearch |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import Sortable from "sortablejs"; |
| | | import draftSave from '@/mixins/draftSave' |
| | | |
| | | export default { |
| | | name: "addYearPlanDia", |
| | | // import å¼å
¥çç»ä»¶éè¦æ³¨å
¥å°å¯¹è±¡ä¸æè½ä½¿ç¨ |
| | | components: {}, |
| | | mixins: [draftSave], |
| | | data() { |
| | | // è¿éåæ¾æ°æ® |
| | | return { |
| | |
| | | calibrationPlanDetailList: [], |
| | | } |
| | | this.calibrationPlanDetailList = [] |
| | | this.$nextTick(() => { |
| | | this.draftRestore('addYearPlanDiaForm', 'form', '', 'applicationForm') |
| | | this.draftRestore('addYearPlanDiaRows', 'calibrationPlanDetailList', '', 'applicationForm') |
| | | }) |
| | | } else { |
| | | this.getRowInfo(row) |
| | | } |
| | |
| | | this.form.planName = res.data.planName |
| | | this.form.planYear = res.data.planYear |
| | | this.form.planId = res.data.planId |
| | | this.$nextTick(() => { |
| | | this.draftRestore('addYearPlanDiaForm', 'form', this.form.planId, 'applicationForm') |
| | | this.draftRestore('addYearPlanDiaRows', 'calibrationPlanDetailList', this.form.planId, 'applicationForm') |
| | | }) |
| | | } |
| | | }).catch(err => { |
| | | this.yearTableLoading = false |
| | |
| | | addDeviceCalibrationPlan(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æ°å¢æå') |
| | | this.draftClear('addYearPlanDiaForm') |
| | | this.draftClear('addYearPlanDiaRows') |
| | | this.closeDialog() |
| | | this.$emit('closeDia') |
| | | } |
| | |
| | | updateDeviceCalibrationPlan(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æ°å¢æå') |
| | | this.draftClear('addYearPlanDiaForm') |
| | | this.draftClear('addYearPlanDiaRows') |
| | | this.closeDialog() |
| | | this.$emit('closeDia') |
| | | } |
| | |
| | | } |
| | | }, |
| | | closeDialog() { |
| | | this.draftStop('addYearPlanDiaForm') |
| | | this.draftStop('addYearPlanDiaRows') |
| | | this.applicationForm = false |
| | | }, |
| | | // è·åææè®¾å¤ |
| | |
| | | addDeviceExternalApply, |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import { selectUserCondition } from "@/api/business/inspectionTask"; |
| | | import draftSave from '@/mixins/draftSave' |
| | | export default { |
| | | name: "applicationForm", |
| | | // import å¼å
¥çç»ä»¶éè¦æ³¨å
¥å°å¯¹è±¡ä¸æè½ä½¿ç¨ |
| | | components: {}, |
| | | mixins: [draftSave], |
| | | data() { |
| | | // è¿éåæ¾æ°æ® |
| | | return { |
| | |
| | | this.getUserList() |
| | | if (this.form.externalApplyId) { |
| | | this.searchInfo() |
| | | } else { |
| | | this.$nextTick(() => { |
| | | this.draftRestore('applicationForm', 'form', '', 'dialogVisible') |
| | | }) |
| | | } |
| | | }, |
| | | // æ¥è¯¢è¯¦æ
|
| | | searchInfo() { |
| | | getDeviceExternalApply({ externalApplyId: this.form.externalApplyId }).then(res => { |
| | | if (res.code === 200) { |
| | | const externalApplyId = this.form.externalApplyId |
| | | this.form = { ...res.data } |
| | | if (res.data.isFinish === 0) { |
| | | if (this.form.departmentHeadUserId) { |
| | |
| | | this.currentStep = 4 |
| | | this.showStep = 3 |
| | | } |
| | | this.$nextTick(() => { |
| | | this.draftRestore('applicationForm', 'form', externalApplyId, 'dialogVisible') |
| | | }) |
| | | } |
| | | }).catch(error => { |
| | | console.error(error) |
| | |
| | | addDeviceExternalApply(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æ°å¢æå') |
| | | this.draftClear('applicationForm') |
| | | this.resetForm() |
| | | } |
| | | this.submitFormLoading = false |
| | |
| | | }, |
| | | // å
³éå¼¹æ¡ |
| | | resetForm() { |
| | | this.draftStop('applicationForm') |
| | | this.dialogVisible = false |
| | | this.$emit('closeDialog') |
| | | }, |
| | |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import { selectUserCondition } from "@/api/business/inspectionTask"; |
| | | import { mapGetters } from "@/utils/store-compat"; |
| | | import draftSave from '@/mixins/draftSave' |
| | | export default { |
| | | mixins: [draftSave], |
| | | props: { |
| | | clickNodeVal: { |
| | | type: Object, |
| | |
| | | }, |
| | | dialogVisible(newVal) { |
| | | if (!newVal) { |
| | | this.draftStop('borrow') |
| | | this.form = {} |
| | | this.currentStep = 0 // æ¥éª¤æ¡æ¾ç¤ºç¬¬å æ¥ |
| | | this.currentStepClick = 0 // ç¹å»æ¥éª¤æ¡åå |
| | |
| | | saveDeviceBorrow(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æäº¤æå') |
| | | this.draftClear('borrow') |
| | | this.dialogVisible = false |
| | | this.refreshTable() |
| | | } |
| | |
| | | this.currentStepClick = i |
| | | } |
| | | console.log(this.currentStepClick) |
| | | if (this.currentStep < 2) { |
| | | this.draftRestore('borrow', 'form', this.form.id, 'dialogVisible') |
| | | } |
| | | this.dialogVisible = true |
| | | } |
| | | }) |
| | |
| | | } |
| | | this.form.deviceName = this.clickNodeVal.label |
| | | this.form.deviceId = this.clickNodeVal.value |
| | | this.draftRestore('borrow', 'form', this.clickNodeVal.value, 'dialogVisible') |
| | | }, |
| | | //å¯¼åº |
| | | handleDown() { |
| | |
| | | <div class="btnS"> |
| | | <el-button size="small" type="primary" @click="calibrationMaintenance()">æ ¡å项ç®ç»´æ¤</el-button> |
| | | <el-button size="small" type="primary" @click="add('add')">æ·»å æ ¡åè®°å½</el-button> |
| | | <!-- <el-button size="small" type="primary" @click="handleDown">导åºExcel</el-button> --> |
| | | </div> |
| | | <div class="tables" style="margin-top: 10px;"> |
| | | <el-table :data="tableData" height="calc(100vh - 20em)" border> |
| | |
| | | deviceMetricRecordPage, |
| | | showDeviceMetricsCopy, |
| | | deleteDeviceMetricRecord, |
| | | deviceMetricRecordExport, |
| | | deleteCNASFile, |
| | | selectDeviceMetric, |
| | | deleteDeviceMetrics, |
| | |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import { selectQualifiedSupplierManagementPage } from '@/api/cnas/externalService/supplierManage/supplierManage' |
| | | import { mapGetters } from "@/utils/store-compat"; |
| | | import draftSave from '@/mixins/draftSave' |
| | | export default { |
| | | props: { |
| | | clickNodeVal: { |
| | |
| | | } |
| | | } |
| | | }, |
| | | mixins: [draftSave], |
| | | data() { |
| | | return { |
| | | value: "", |
| | |
| | | add(type) { |
| | | this.operationType = type |
| | | this.dialogVisible1 = true |
| | | this.getXmsg() |
| | | this.draftRestore('calibrationRecord', 'calibrationRecord', '', 'dialogVisible1') |
| | | this.getXmsg().then(() => { |
| | | this.draftRestore('calibrationRecordParams', 'calibrateParams', '', 'dialogVisible1') |
| | | }) |
| | | }, |
| | | // æ¥ç详æ
|
| | | handleViewClick(type, row) { |
| | |
| | | handleAttachmentClick(row) { |
| | | this.$download.saveAs(row.systemFileName, row.systemFileName) |
| | | }, |
| | | //å¯¼åº |
| | | handleDown() { |
| | | this.outLoading = true |
| | | deviceMetricRecordExport({ |
| | | deviceId: this.clickNodeVal.value, |
| | | type: 'calibrate' |
| | | }).then(res => { |
| | | this.outLoading = false |
| | | const blob = new Blob([res], { type: 'application/octet-stream' }); |
| | | this.$download.saveAs(blob, 'è®¾å¤æ ¡å.xlsx') |
| | | }) |
| | | }, |
| | | deleteFile() { |
| | | this.$confirm('æ¤æä½å°æ°¸ä¹
å 餿件, æ¯å¦ç»§ç»?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | |
| | | calibrationMaintenance() { |
| | | this.dialogVisible0 = true |
| | | this.getXmsg(); |
| | | this.$nextTick(() => { |
| | | this.draftRestore('calibrationMaintain', 'form0', this.clickNodeVal.value, 'dialogVisible0') |
| | | }) |
| | | }, |
| | | // è·åè®¾å¤æ ¡ååæ°tableä¿¡æ¯ |
| | | async getXmsg() { |
| | |
| | | if (res.code == 200) { |
| | | this.$message.success('ä¿åæå') |
| | | this.$refs['form0'].resetFields() |
| | | this.draftClear('calibrationMaintain') |
| | | this.draftRestore('calibrationMaintain', 'form0', this.clickNodeVal.value, 'dialogVisible0') |
| | | this.getXmsg() // å·æ°è®¾å¤æ ¡ååæ°è¡¨æ ¼ |
| | | } |
| | | this.calibrateParamsLoading = false |
| | |
| | | addOrUpdateDeviceMetricRecord(this.calibrationRecord).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æ·»å æå') |
| | | this.draftClear('calibrationRecord') |
| | | this.draftClear('calibrationRecordParams') |
| | | this.dialogVisible1 = false |
| | | this.getTableList(this.clickNodeVal.value) |
| | | } |
| | |
| | | }, |
| | | dialogVisible1(newVal) { |
| | | if (newVal === false) { |
| | | this.draftStop('calibrationRecord') |
| | | this.draftStop('calibrationRecordParams') |
| | | this.calibrateParams = [] |
| | | this.calibrationRecord = { |
| | | unitOfMeasure: '', // 计éåä½ |
| | |
| | | <script> |
| | | import file from '@/utils/file'; |
| | | import { mapGetters } from "@/utils/store-compat"; |
| | | import draftSave from '@/mixins/draftSave' |
| | | export default { |
| | | components: {}, |
| | | mixins: [draftSave], |
| | | props: { |
| | | clickNodeVal: { |
| | | type: Object, |
| | |
| | | // æ ¡å项ç®ç»´æ¤ |
| | | calibrationMaintenance() { |
| | | this.dialogVisible0 = true |
| | | this.draftRestore('checkMaintenanceDia', 'form0', this.clickNodeVal.value, 'dialogVisible0') |
| | | this.getXmsg(); |
| | | }, |
| | | addCalibrate() { |
| | |
| | | }).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('ä¿åæå') |
| | | this.draftClear('checkMaintenanceDia') |
| | | this.$refs['form0'].resetFields() |
| | | this.getXmsg() // å·æ°è®¾å¤æ ¡ååæ°è¡¨æ ¼ |
| | | } |
| | |
| | | }).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æ·»å æå') |
| | | this.draftClear('checkAddRecordDia') |
| | | this.dialogVisible1 = false |
| | | this.getTableList(this.clickNodeVal.value) |
| | | } |
| | |
| | | }) |
| | | }, |
| | | resetcalibrationRecord() { |
| | | this.draftStop('checkAddRecordDia') |
| | | this.$refs.calibrationRecord.resetFields() |
| | | }, |
| | | // éä»¶ä¸ä¼ |
| | |
| | | add(type) { |
| | | this.operationType = type |
| | | this.dialogVisible1 = true |
| | | this.draftRestore('checkAddRecordDia', 'calibrationRecord', this.clickNodeVal.value, 'dialogVisible1') |
| | | this.getXmsg() |
| | | }, |
| | | // æ¥ç详æ
|
| | |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import { selectUserCondition } from "@/api/performance/class"; |
| | | import {mapGetters} from "@/utils/store-compat"; |
| | | import draftSave from '@/mixins/draftSave' |
| | | export default { |
| | | name: "check-record", |
| | | // import å¼å
¥çç»ä»¶éè¦æ³¨å
¥å°å¯¹è±¡ä¸æè½ä½¿ç¨ |
| | | components: {}, |
| | | mixins: [draftSave], |
| | | data() { |
| | | // è¿éåæ¾æ°æ® |
| | | return { |
| | |
| | | this.currentStep = 2 |
| | | } |
| | | this.reviewUserId = this.form.reviewUserId |
| | | this.$nextTick(() => { |
| | | this.draftRestore('checkRecordForm', 'form', this.form.planDetailsId, 'dialogVisible') |
| | | this.draftRestore('checkRecordRows', 'recordDetailList', this.form.planDetailsId, 'dialogVisible') |
| | | }) |
| | | } |
| | | }).catch(error => { |
| | | console.error(error) |
| | |
| | | addExamineRecord(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æ°å¢æå') |
| | | this.draftClear('checkRecordForm') |
| | | this.draftClear('checkRecordRows') |
| | | this.resetForm() |
| | | } |
| | | this.submitFormLoading = false |
| | |
| | | reviewExamineRecord(params).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('å®¡æ ¸æå') |
| | | this.draftClear('checkRecordForm') |
| | | this.draftClear('checkRecordRows') |
| | | this.resetForm() |
| | | } |
| | | this.submitFormLoading = false |
| | |
| | | }) |
| | | }, |
| | | resetForm() { |
| | | this.draftStop('checkRecordForm') |
| | | this.draftStop('checkRecordRows') |
| | | this.dialogVisible = false |
| | | this.$emit('closeDialog1') |
| | | }, |
| | |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import { selectUserCondition } from "@/api/performance/class"; |
| | | import { mapGetters } from "@/utils/store-compat"; |
| | | import draftSave from '@/mixins/draftSave' |
| | | export default { |
| | | name: "equipment-calibration-plan", |
| | | // import å¼å
¥çç»ä»¶éè¦æ³¨å
¥å°å¯¹è±¡ä¸æè½ä½¿ç¨ |
| | | components: { AddVerificationYearPlanDia, AddYearPlanDia }, |
| | | mixins: [draftSave], |
| | | props: { |
| | | clickNodeVal: { |
| | | type: Object, |
| | |
| | | if (this.operationType !== 'add') { |
| | | this.$nextTick(() => { |
| | | this.form = this.HaveJson(row) |
| | | if (this.operationType !== 'view') { |
| | | this.draftRestore('equipmentCalibrationPlan', 'form', this.form.planDetailId, 'dialogVisible') |
| | | } |
| | | }) |
| | | } else { |
| | | this.form = { |
| | |
| | | planId: this.currentRow.planId, |
| | | planDetailId: '', |
| | | } |
| | | this.draftRestore('equipmentCalibrationPlan', 'form', this.form.planId, 'dialogVisible') |
| | | } |
| | | }, |
| | | // æäº¤è¡¨å |
| | |
| | | addDeviceCalibrationPlanDetail(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æ°å¢æå') |
| | | this.draftClear('equipmentCalibrationPlan') |
| | | this.dialogVisible = false |
| | | this.getYearTableData() |
| | | } |
| | |
| | | updateDeviceCalibrationPlanDetail(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æ°å¢æå') |
| | | this.draftClear('equipmentCalibrationPlan') |
| | | this.dialogVisible = false |
| | | this.getYearTableData() |
| | | } |
| | |
| | | }) |
| | | }, |
| | | resetForm() { |
| | | this.draftStop('equipmentCalibrationPlan') |
| | | this.$refs.modelForm.resetFields(); |
| | | this.dialogVisible = false |
| | | }, |
| | |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import { selectUserCondition } from "@/api/business/inspectionTask"; |
| | | import {mapGetters} from "@/utils/store-compat"; |
| | | import draftSave from '@/mixins/draftSave' |
| | | export default { |
| | | name: "equipment-check", |
| | | // import å¼å
¥çç»ä»¶éè¦æ³¨å
¥å°å¯¹è±¡ä¸æè½ä½¿ç¨ |
| | | components: {}, |
| | | mixins: [draftSave], |
| | | data() { |
| | | // è¿éåæ¾æ°æ® |
| | | return { |
| | |
| | | this.currentStep = 2 |
| | | } |
| | | this.reviewUserId = this.form.reviewUserId |
| | | if (this.currentStep === 0) { |
| | | this.draftRestore('equipmentCheck', 'form', this.form.planDetailsId, 'dialogVisible') |
| | | this.recordContrastDetailsList = this.form.recordContrastDetailsList || [] |
| | | } |
| | | } |
| | | }).catch(error => { |
| | | console.error(error) |
| | |
| | | addExamineRecordContrast(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æ°å¢æå') |
| | | this.draftClear('equipmentCheck') |
| | | this.resetForm() |
| | | } |
| | | this.submitFormLoading = false |
| | |
| | | reviewExamineRecordContrast(params).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('å®¡æ ¸æå') |
| | | this.draftClear('equipmentCheck') |
| | | this.resetForm() |
| | | } |
| | | this.submitFormLoading = false |
| | |
| | | }) |
| | | }, |
| | | resetForm() { |
| | | this.draftStop('equipmentCheck') |
| | | this.dialogVisible = false |
| | | this.$emit('closeDialog') |
| | | }, |
| | |
| | | } from "@/api/cnas/resourceDemand/device"; |
| | | import limsTable from "@/components/Table/lims-table.vue"; |
| | | import {selectUserCondition} from "@/api/system/user"; |
| | | import draftSave from '@/mixins/draftSave' |
| | | |
| | | export default { |
| | | name: '', |
| | | // import å¼å
¥çç»ä»¶éè¦æ³¨å
¥å°å¯¹è±¡ä¸æè½ä½¿ç¨ |
| | | components: {limsTable}, |
| | | mixins: [draftSave], |
| | | props: { |
| | | clickNodeVal: { |
| | | type: Object, |
| | |
| | | this.form = {...row} |
| | | this.form['maintenanceContentArr'] = this.form.maintenanceContent.split(',') |
| | | } |
| | | if (this.operationType !== 'view') { |
| | | this.draftRestore('equipmentMaintenance', 'form', this.operationType === 'edit' ? this.form.id : this.clickNodeVal.value, 'dialogVisible') |
| | | } |
| | | }) |
| | | this.getDictS() |
| | | this.getUserList() |
| | |
| | | addDeviceMaintenance(this.form).then(res => { |
| | | this.buttonLoading = false; |
| | | this.$message.success('æ°å¢æå') |
| | | this.draftClear('equipmentMaintenance') |
| | | this.closeDia() |
| | | this.getTableList() |
| | | }).catch(err => { |
| | |
| | | }) |
| | | }, |
| | | closeDia () { |
| | | this.draftStop('equipmentMaintenance') |
| | | this.$refs['form'].resetFields(); |
| | | this.dialogVisible = false |
| | | this.refreshTableList() |
| | |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import { selectUserCondition } from "@/api/business/inspectionTask"; |
| | | import { mapGetters } from "@/utils/store-compat"; |
| | | import draftSave from '@/mixins/draftSave' |
| | | export default { |
| | | name: "equipment-maintenance-plan", |
| | | // import å¼å
¥çç»ä»¶éè¦æ³¨å
¥å°å¯¹è±¡ä¸æè½ä½¿ç¨ |
| | | components: {}, |
| | | mixins: [draftSave], |
| | | props: { |
| | | clickNodeVal: { |
| | | type: Object, |
| | |
| | | if (res.code === 200) { |
| | | this.form = res.data |
| | | this.deviceMaintenancePlanDetails = this.form.deviceMaintenancePlanDetails |
| | | this.restoreMaintenancePlanDraft() |
| | | } |
| | | }).catch(error => { |
| | | console.error(error) |
| | | }) |
| | | } else { |
| | | this.restoreMaintenancePlanDraft() |
| | | } |
| | | this.getEquipOptions() |
| | | }, |
| | | restoreMaintenancePlanDraft() { |
| | | if (this.operationType === 'add' || this.operationType === 'edit') { |
| | | const rid = this.operationType === 'edit' ? this.maintenancePlanId : '' |
| | | this.draftRestore('maintenancePlanForm', 'form', rid, 'applicationForm') |
| | | this.draftRestore('maintenancePlanRows', 'deviceMaintenancePlanDetails', rid, 'applicationForm') |
| | | } |
| | | }, |
| | | // æ·»å è®¾å¤ |
| | | addTableRow() { |
| | |
| | | addMaintenancePlan(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æ°å¢æå') |
| | | this.draftClear('maintenancePlanForm') |
| | | this.draftClear('maintenancePlanRows') |
| | | this.applicationForm = false |
| | | this.getYearTableDetailData() |
| | | } |
| | |
| | | updateMaintenancePlan(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('ä¿®æ¹æå') |
| | | this.draftClear('maintenancePlanForm') |
| | | this.draftClear('maintenancePlanRows') |
| | | this.applicationForm = false |
| | | this.getYearTableDetailData() |
| | | } |
| | |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import { selectUserCondition } from "@/api/performance/class"; |
| | | import { mapGetters } from "@/utils/store-compat"; |
| | | import draftSave from '@/mixins/draftSave' |
| | | export default { |
| | | name: "equipment-verification-plan", |
| | | // import å¼å
¥çç»ä»¶éè¦æ³¨å
¥å°å¯¹è±¡ä¸æè½ä½¿ç¨ |
| | | components: { AddVerificationYearPlanDia, CheckRecord, EquipmentCheck }, |
| | | mixins: [draftSave], |
| | | props: { |
| | | clickNodeVal: { |
| | | type: Object, |
| | |
| | | if (this.operationType !== 'add') { |
| | | this.$nextTick(() => { |
| | | this.form = this.HaveJson(row) |
| | | if (this.operationType !== 'view') { |
| | | this.draftRestore('equipmentVerificationPlan', 'form', this.form.planDetailsId, 'dialogVisible') |
| | | } |
| | | }) |
| | | } else { |
| | | this.form = { |
| | |
| | | planId: this.currentRow.planId, |
| | | planDetailsId: '', |
| | | } |
| | | this.draftRestore('equipmentVerificationPlan', 'form', this.form.planId, 'dialogVisible') |
| | | } |
| | | }, |
| | | // æäº¤è¡¨å |
| | |
| | | addDeviceExaminePlanDetail(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æ°å¢æå') |
| | | this.draftClear('equipmentVerificationPlan') |
| | | this.dialogVisible = false |
| | | this.getYearTableData() |
| | | } |
| | |
| | | updateDeviceExaminePlanDetail(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æ°å¢æå') |
| | | this.draftClear('equipmentVerificationPlan') |
| | | this.dialogVisible = false |
| | | this.getYearTableData() |
| | | } |
| | |
| | | }) |
| | | }, |
| | | resetForm() { |
| | | this.draftStop('equipmentVerificationPlan') |
| | | this.$refs.modelForm.resetFields(); |
| | | this.dialogVisible = false |
| | | }, |
| | |
| | | addDeviceBreakdownMaintenance, |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import { selectUserCondition } from "@/api/business/inspectionTask"; |
| | | import draftSave from '@/mixins/draftSave' |
| | | export default { |
| | | name: "failure-form", |
| | | // import å¼å
¥çç»ä»¶éè¦æ³¨å
¥å°å¯¹è±¡ä¸æè½ä½¿ç¨ |
| | | components: {}, |
| | | mixins: [draftSave], |
| | | data() { |
| | | // è¿éåæ¾æ°æ® |
| | | return { |
| | |
| | | this.getUserList() |
| | | if (this.form.maintenanceId) { |
| | | this.searchInfo() |
| | | } else { |
| | | this.draftRestore('failureForm', 'form', this.form.deviceId, 'dialogVisible') |
| | | } |
| | | }, |
| | | // æ¥è¯¢è¯¦æ
|
| | |
| | | maintenanceId: this.form.maintenanceId |
| | | }).then(res => { |
| | | if (res.code === 200) { |
| | | const id = this.form.maintenanceId |
| | | this.form = { ...res.data } |
| | | this.draftRestore('failureForm', 'form', id, 'dialogVisible') |
| | | if (this.form.isFinish === 0) { |
| | | if (this.form.departmentHeadUserId) { |
| | | this.currentStep = 1 |
| | |
| | | addDeviceBreakdownMaintenance(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æ°å¢æå') |
| | | this.draftClear('failureForm') |
| | | this.resetForm() |
| | | } |
| | | this.submitFormLoading = false |
| | |
| | | }, |
| | | // å
³éå¼¹æ¡ |
| | | resetForm() { |
| | | this.draftStop('failureForm') |
| | | this.dialogVisible = false |
| | | this.$emit('closeDialog') |
| | | }, |
| | |
| | | <script> |
| | | import { dateFormat } from '@/utils/date' |
| | | import { mapGetters } from "@/utils/store-compat"; |
| | | import draftSave from '@/mixins/draftSave' |
| | | export default { |
| | | mixins: [draftSave], |
| | | props: { |
| | | clickNodeVal: { |
| | | type: Object, |
| | |
| | | }).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æäº¤æå') |
| | | this.draftClear('fault') |
| | | this.getTableList(this.clickNodeVal.value) |
| | | this.dialogVisible = false |
| | | } |
| | |
| | | this.form.manufacturer = res.data.manufacturer |
| | | this.form.specificationModel = res.data.specificationModel |
| | | this.form.managementNumber = res.data.managementNumber |
| | | if (!this.form.id) { |
| | | this.draftRestore('fault', 'form', this.clickNodeVal.value, 'dialogVisible') |
| | | } else if (this.currentStep === 0) { |
| | | this.draftRestore('fault', 'form', this.form.id, 'dialogVisible') |
| | | } |
| | | }); |
| | | // è·åè´è´£äººä¿¡æ¯ |
| | | this.getUserList() |
| | |
| | | }, |
| | | dialogVisible(newVal) { |
| | | if (!newVal) { |
| | | this.draftStop('fault') |
| | | this.form = {} |
| | | this.closeLoading() |
| | | this.currentStep = 0 // æ¥éª¤æ¡æ¾ç¤ºç¬¬å æ¥ |
| | |
| | | <h4><span class="line"></span><span>è®¾å¤æ¡£æ¡</span></h4> |
| | | <div class="btns"> |
| | | <el-button type="primary" size="small" @click="openEditForm" style="">修订档æ¡</el-button> |
| | | <el-button type="primary" size="small" @click="dialogVisible1 = true" style="">æ·»å éä»¶</el-button> |
| | | <el-button type="primary" size="small" @click="openAddFileDia" style="">æ·»å éä»¶</el-button> |
| | | <el-button type="primary" size="small" @click="deviceDialog = true" style="">æ¥ç设å¤äºç»´ç </el-button> |
| | | <el-button type="primary" size="small" @click="handleDownOne" style="">导åº</el-button> |
| | | </div> |
| | |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import { selectUserCondition } from "@/api/business/inspectionTask"; |
| | | import { selectQualifiedSupplierManagementPage } from '@/api/cnas/externalService/supplierManage/supplierManage' |
| | | import draftSave from '@/mixins/draftSave' |
| | | export default { |
| | | mixins: [draftSave], |
| | | props: { |
| | | clickNodeVal: { |
| | | type: Object, |
| | |
| | | }) |
| | | this.fileList.push(obj) |
| | | } |
| | | this.draftRestore('fileAdd', 'addFile', row.id, 'dialogVisible1') |
| | | }, |
| | | // æå¼æ·»å éä»¶å¼¹çª |
| | | openAddFileDia() { |
| | | this.dialogVisible1 = true |
| | | this.$nextTick(() => { |
| | | this.draftRestore('fileAdd', 'addFile', this.clickNodeVal.value, 'dialogVisible1') |
| | | }) |
| | | }, |
| | | handleDeleteClick(row) { |
| | | // å é¤é»è¾ |
| | |
| | | updateDocument(this.addFile).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æ´æ°æå') |
| | | this.draftClear('fileAdd') |
| | | this.dialogVisible1 = false; |
| | | this.getPage() |
| | | } |
| | |
| | | addDocument(this.addFile).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('ä¿åæå') |
| | | this.draftClear('fileAdd') |
| | | this.dialogVisible1 = false; |
| | | this.getPage() |
| | | } |
| | |
| | | this.editData = JSON.parse(JSON.stringify(this.Mdata)) |
| | | this.$nextTick(() => { |
| | | this.dialogVisible = true |
| | | this.draftRestore('fileRevision', 'editData', this.clickNodeVal.value, 'dialogVisible') |
| | | }) |
| | | }, |
| | | // 䏿¬¡æ¥æ = æè¿æ¥æ + å¨æï¼æï¼ï¼èªå¨è®¡ç® |
| | |
| | | upDeviceParameter(formData).then(res => { |
| | | this.$message.success('ä¿®æ¹æå') |
| | | this.upLoad = false |
| | | this.draftClear('fileRevision') |
| | | this.getList(this.clickNodeVal.value) |
| | | this.dialogVisible = false |
| | | }).catch(e => { |
| | |
| | | }, |
| | | dialogVisible1(newVal) { |
| | | if (newVal == false) { |
| | | this.draftStop('fileAdd') |
| | | this.isAddFileUpdate = false |
| | | this.addFile = {} |
| | | this.fileList = [] |
| | |
| | | reviewDeviceInspectionRecord, |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import { selectUserCondition } from "@/api/business/inspectionTask"; |
| | | import draftSave from '@/mixins/draftSave' |
| | | export default { |
| | | name: "inspection-form", |
| | | // import å¼å
¥çç»ä»¶éè¦æ³¨å
¥å°å¯¹è±¡ä¸æè½ä½¿ç¨ |
| | | components: {}, |
| | | mixins: [draftSave], |
| | | data() { |
| | | // è¿éåæ¾æ°æ® |
| | | return { |
| | |
| | | this.getUserList() |
| | | if (this.form.inspectionRecordId) { |
| | | this.searchInfo() |
| | | } else if (this.operationType !== 'check') { |
| | | this.draftRestore('inspectionForm', 'form', this.form.deviceId, 'dialogVisible') |
| | | } |
| | | }, |
| | | searchInfo() { |
| | |
| | | inspectionRecordId: this.form.inspectionRecordId |
| | | }).then(res => { |
| | | if (res.code === 200) { |
| | | const id = this.form.inspectionRecordId |
| | | this.form = { ...res.data } |
| | | this.details = this.form.details || [] |
| | | if (this.operationType !== 'check') { |
| | | this.draftRestore('inspectionForm', 'form', id, 'dialogVisible') |
| | | } |
| | | } |
| | | }).catch(error => { |
| | | console.error(error) |
| | |
| | | addDeviceInspectionRecord(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æ°å¢æå') |
| | | this.draftClear('inspectionForm') |
| | | this.resetForm() |
| | | } |
| | | this.submitFormLoading = false |
| | |
| | | updateDeviceInspectionRecord(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æ°å¢æå') |
| | | this.draftClear('inspectionForm') |
| | | this.resetForm() |
| | | } |
| | | this.submitFormLoading = false |
| | |
| | | }) |
| | | }, |
| | | resetForm() { |
| | | this.draftStop('inspectionForm') |
| | | this.dialogVisible = false |
| | | this.$emit('closeDialog') |
| | | }, |
| | |
| | | </el-form> |
| | | </div> |
| | | <div> |
| | | <el-button size="small" type="primary" @click="dialogVisible2 = true">æ°å¢</el-button> |
| | | <el-button size="small" type="primary" @click="openAdd2">æ°å¢</el-button> |
| | | <el-button size="small" type="primary" @click="handleDownOne">导åº</el-button> |
| | | </div> |
| | | </div> |
| | |
| | | </el-row> |
| | | </span></template> |
| | | </el-dialog> |
| | | <el-dialog title="æ°éé
ç½®" v-model="dialogVisible3" width="400px"> |
| | | <div class="search_thing" style="margin-bottom: 14px;"> |
| | | <div class="search_label"><span style="color:red;margin-right: 4px;">*</span>IPï¼</div> |
| | | <el-input size="small" placeholder="请è¾å
¥" clearable v-model="configForm.ip"></el-input> |
| | | </div> |
| | | <div class="search_thing" style="margin-bottom: 14px;"> |
| | | <div class="search_label"><span style="color:red;margin-right: 4px;">*</span>ééå°åï¼</div> |
| | | <el-input size="small" placeholder="请è¾å
¥" clearable v-model="configForm.collectUrl"></el-input> |
| | | </div> |
| | | <div class="search_thing" style="margin-bottom: 14px;"> |
| | | <div class="search_label"><span style="color:red;margin-right: 4px;">*</span>å¨åå°åï¼</div> |
| | | <el-input size="small" placeholder="请è¾å
¥" clearable v-model="configForm.storageUrl"></el-input> |
| | | </div> |
| | | <div class="search_thing" style="margin-bottom: 14px;"> |
| | | <div class="search_label"><span style="color:red;margin-right: 4px;">*</span>åç
§ï¼</div> |
| | | <el-input size="small" placeholder="请è¾å
¥" clearable v-model="configForm.refer"></el-input> |
| | | </div> |
| | | <div class="search_thing" style="margin-bottom: 14px;"> |
| | | <div class="search_label"><span style="color:red;margin-right: 4px;">*</span>Xï¼</div> |
| | | <el-input size="small" placeholder="请è¾å
¥" clearable v-model="configForm.x"></el-input> |
| | | </div> |
| | | <div class="search_thing" style="margin-bottom: 14px;"> |
| | | <div class="search_label"><span style="color:red;margin-right: 4px;">*</span>Yï¼</div> |
| | | <el-input size="small" placeholder="请è¾å
¥" clearable v-model="configForm.y"></el-input> |
| | | </div> |
| | | <div class="search_thing"> |
| | | <div class="search_label">å
¬å¼ï¼</div> |
| | | <el-input size="small" placeholder="请è¾å
¥" clearable v-model="configForm.formula"></el-input> |
| | | </div> |
| | | <template #footer><span class="dialog-footer"> |
| | | <el-row justify="end"> |
| | | <el-button @click="dialogVisible3 = false">å æ¶</el-button> |
| | | <el-button type="primary" @click="submitForm3" :loading="upLoad3">ç¡® å®</el-button> |
| | | </el-row> |
| | | </span></template> |
| | | </el-dialog> |
| | | <dataAcquisitionConfig v-if="showData" :deviceId="deviceId" /> |
| | | </div> |
| | | </template> |
| | |
| | | getInsProduction, |
| | | upDeviceParameter, |
| | | addDeviceParameter, |
| | | numberCollect, |
| | | getDeviceParameter, |
| | | delDeviceParameter, |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import { selectUserCondition } from "@/api/business/inspectionTask"; |
| | | import dayjs from 'dayjs' |
| | | import { selectQualifiedSupplierManagementPage } from '@/api/cnas/externalService/supplierManage/supplierManage' |
| | | import draftSave from '@/mixins/draftSave' |
| | | export default { |
| | | props: { |
| | | clickNodeVal: { |
| | |
| | | limsTable, |
| | | dataAcquisitionConfig, |
| | | }, |
| | | mixins: [draftSave], |
| | | data() { |
| | | return { |
| | | dateFormat: 'yyyy-MM-dd', |
| | |
| | | deviceStatusList: [], |
| | | upLoad: false, |
| | | upLoad2: false, |
| | | dialogVisible3: false, |
| | | upLoad3: false, |
| | | configForm: {}, |
| | | queryParams: {}, |
| | | tableData: [], |
| | | column: [ |
| | |
| | | }) |
| | | }) |
| | | }, |
| | | openAdd2() { |
| | | this.dialogVisible2 = true |
| | | this.$nextTick(() => { |
| | | this.draftRestore('managementAdd', 'formData2', '', 'dialogVisible2') |
| | | }) |
| | | }, |
| | | handleClose() { |
| | | this.draftStop('management') |
| | | this.formData = { |
| | | authorizedPerson: [] |
| | | } |
| | |
| | | this.upLoad = false; |
| | | }, |
| | | handleClose2() { |
| | | this.draftStop('managementAdd') |
| | | this.formData = { |
| | | authorizedPerson: [] |
| | | } |
| | |
| | | this.formData[key] = `${this.formData[key]} 00:00:00` |
| | | } |
| | | }) |
| | | this.draftRestore('management', 'formData', this.formData.id, 'dialogVisible') |
| | | }, |
| | | beforeUpload(file) { |
| | | if (file.size > 1024 * 1024 * 10) { |
| | |
| | | this.$message.success('ä¿®æ¹æå') |
| | | this.upLoad = false |
| | | this.refreshTable('page') |
| | | this.draftClear('management') |
| | | this.dialogVisible = false |
| | | }).catch(e => { |
| | | this.$message.error('ä¿®æ¹å¤±è´¥') |
| | |
| | | this.$message.success('æäº¤æå') |
| | | this.upLoad2 = false |
| | | this.refreshTable('page') |
| | | this.draftClear('managementAdd') |
| | | this.dialogVisible2 = false |
| | | this.formData2 = { |
| | | imageUpload: '', |
| | |
| | | closeDataVue() { |
| | | this.clickSidebar(this.clickNodeVal) |
| | | this.showData = false |
| | | }, |
| | | submitForm3() { |
| | | if (!this.configForm.ip) { |
| | | this.$message.error('请填åIP'); |
| | | return |
| | | } |
| | | if (!this.configForm.collectUrl) { |
| | | this.$message.error('请填åééå°å'); |
| | | return |
| | | } |
| | | if (!this.configForm.storageUrl) { |
| | | this.$message.error('请填åå¨åå°å'); |
| | | return |
| | | } |
| | | if (!this.configForm.refer) { |
| | | this.$message.error('请填ååç
§'); |
| | | return |
| | | } |
| | | if (!this.configForm.x) { |
| | | this.$message.error('请填åX'); |
| | | return |
| | | } |
| | | if (!this.configForm.y) { |
| | | this.$message.error('请填åY'); |
| | | return |
| | | } |
| | | |
| | | this.upLoad3 = true |
| | | numberCollect(this.configForm).then(res => { |
| | | this.upLoad3 = false |
| | | this.$message.success('æä½æå') |
| | | this.refreshTable('page') |
| | | this.dialogVisible3 = false |
| | | }).catch(e => { |
| | | this.$message.error('æä½å¤±è´¥') |
| | | this.dialogVisible3 = false |
| | | this.upLoad3 = false |
| | | }) |
| | | }, |
| | | // ç¹å»ä¾§è¾¹æ å·æ° |
| | | clickSidebar(clickNodeVal) { |
| | |
| | | <div> |
| | | <div style="margin: 10px 0;text-align: right"> |
| | | <el-button size="small" type="primary" @click="getList">å·æ°</el-button> |
| | | <el-button size="small" type="primary" @click="dialogVisible = true">åæ§ç³è¯·</el-button> |
| | | <el-button size="small" type="primary" @click="openInstructionDia">åæ§ç³è¯·</el-button> |
| | | </div> |
| | | <el-table :data="tableData" border height="calc(100vh - 18em)" |
| | | > |
| | |
| | | pageByPageQueryOfHomeworkInstructions, |
| | | selectDeviceParameter, |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import draftSave from '@/mixins/draftSave' |
| | | export default { |
| | | mixins: [draftSave], |
| | | props: { |
| | | clickNodeVal: { |
| | | type: Object, |
| | |
| | | }, |
| | | dialogVisible(newVal) { |
| | | if (newVal === false) { |
| | | this.draftStop('instructionForm') |
| | | this.draftStop('instructionRows') |
| | | this.instructionForm = {} |
| | | this.documentTableData = [] |
| | | this.fileList1 = [] |
| | |
| | | this.documentTableData.forEach((v, k) => { |
| | | v.index = k |
| | | }) |
| | | this.draftRestore('instructionForm', 'instructionForm', row.instructionId, 'dialogVisible') |
| | | this.draftRestore('instructionRows', 'documentTableData', row.instructionId, 'dialogVisible') |
| | | } |
| | | }) |
| | | }, |
| | | // æå¼åæ§ç³è¯·å¼¹çªï¼æ°å¢ï¼ |
| | | openInstructionDia() { |
| | | this.dialogVisible = true |
| | | this.$nextTick(() => { |
| | | this.draftRestore('instructionForm', 'instructionForm', '', 'dialogVisible') |
| | | this.draftRestore('instructionRows', 'documentTableData', '', 'dialogVisible') |
| | | }) |
| | | }, |
| | | handleSizeChange(val) { |
| | |
| | | newHomeworkGuidebookAdded(this.instructionForm).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æä½æåï¼') |
| | | this.draftClear('instructionForm') |
| | | this.draftClear('instructionRows') |
| | | this.dialogVisible = false |
| | | this.getList() |
| | | } |
| | |
| | | addFile() { |
| | | this.$refs.form.validate((valid) => { |
| | | if (valid) { |
| | | this.draftClear('instructionRowForm') |
| | | if (this.tableDataIndex !== undefined) { |
| | | this.documentTableData[this.tableDataIndex] = this.form |
| | | this.dialogVisible1 = false; |
| | |
| | | this.form.deviceName = this.clickNodeVal.label |
| | | this.onDeviceNameChange() |
| | | this.fileList = [] |
| | | |
| | | this.draftRestore('instructionRowForm', 'form', '', 'dialogVisible1') |
| | | }, |
| | | editFun(row, index) { |
| | | this.form = { ...row } |
| | |
| | | this.fileList.push({ name: this.form.fileName }) |
| | | } |
| | | this.dialogVisible1 = true |
| | | this.draftRestore('instructionRowForm', 'form', row.id !== undefined ? row.id : ('row' + index), 'dialogVisible1') |
| | | }, |
| | | closeDia() { |
| | | this.draftStop('instructionRowForm') |
| | | this.dialogVisible1 = false |
| | | this.$refs['form'].resetFields() |
| | | this.fileList = [] |
| | |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import { selectUserCondition } from "@/api/business/inspectionTask"; |
| | | import { mapGetters } from "@/utils/store-compat"; |
| | | import draftSave from '@/mixins/draftSave' |
| | | export default { |
| | | name: "quantity-value-traceability-plan", |
| | | // import å¼å
¥çç»ä»¶éè¦æ³¨å
¥å°å¯¹è±¡ä¸æè½ä½¿ç¨ |
| | | components: {}, |
| | | mixins: [draftSave], |
| | | props: { |
| | | clickNodeVal: { |
| | | type: Object, |
| | |
| | | if (res.code === 200) { |
| | | this.form = res.data |
| | | this.deviceTraceabilityManagementDetails = this.form.deviceTraceabilityManagementDetails |
| | | this.restoreTraceabilityDraft() |
| | | } |
| | | }).catch(error => { |
| | | console.error(error) |
| | | this.yearTableLoading = false |
| | | }) |
| | | } else { |
| | | this.restoreTraceabilityDraft() |
| | | } |
| | | }, |
| | | restoreTraceabilityDraft() { |
| | | if (this.operationType === 'add' || this.operationType === 'edit') { |
| | | const rid = this.operationType === 'edit' ? this.traceabilityManagementId : '' |
| | | this.draftRestore('traceabilityForm', 'form', rid, 'applicationForm') |
| | | this.draftRestore('traceabilityRows', 'deviceTraceabilityManagementDetails', rid, 'applicationForm') |
| | | } |
| | | }, |
| | | // æ·»å è®¾å¤ |
| | |
| | | addTraceabilityManagement(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æ°å¢æå') |
| | | this.draftClear('traceabilityForm') |
| | | this.draftClear('traceabilityRows') |
| | | this.applicationForm = false |
| | | this.getYearTableDetailData() |
| | | } |
| | |
| | | updateTraceabilityManagement(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('ä¿®æ¹æå') |
| | | this.draftClear('traceabilityForm') |
| | | this.draftClear('traceabilityRows') |
| | | this.applicationForm = false |
| | | this.getYearTableDetailData() |
| | | } |
| | |
| | | deleteDeviceRecord, |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import { selectUserCondition } from "@/api/business/inspectionTask"; |
| | | import draftSave from '@/mixins/draftSave' |
| | | export default { |
| | | mixins: [draftSave], |
| | | props: { |
| | | clickNodeVal: { |
| | | type: Object, |
| | |
| | | this.form.managementNumber = res.data.managementNumber |
| | | this.$nextTick(() => { |
| | | this.$refs['form'].clearValidate() |
| | | this.draftRestore('record', 'form', '', 'dialogVisible') |
| | | }) |
| | | }); |
| | | }, |
| | |
| | | if (res.code == 200) { |
| | | this.$message.success('æ°å¢æå') |
| | | this.getTableList(this.clickNodeVal.value) |
| | | this.draftClear('record') |
| | | this.dialogVisible = false |
| | | } |
| | | }) |
| | |
| | | if (res.code == 200) { |
| | | this.$message.success('ä¿®æ¹æå') |
| | | this.getTableList(this.clickNodeVal.value) |
| | | this.draftClear('record') |
| | | this.dialogVisible = false |
| | | } |
| | | }) |
| | |
| | | list.push(row.useStartDate) |
| | | list.push(row.useEndDate) |
| | | this.form['useDateList'] = list |
| | | if (type === 'edit') { |
| | | this.draftRestore('record', 'form', this.form.id, 'dialogVisible') |
| | | } |
| | | }, |
| | | handleDeleteClick(index, row) { |
| | | this.$confirm('æ¤æä½å°æ°¸ä¹
å é¤è¯¥æä»¶, æ¯å¦ç»§ç»?', 'æç¤º', { |
| | |
| | | }, |
| | | dialogVisible(newVal) { |
| | | if (newVal === false) { |
| | | this.draftStop('record') |
| | | this.form = { |
| | | // deviceId:'', |
| | | sampleCode: '', |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import draftSave from '@/mixins/draftSave' |
| | | export default { |
| | | mixins: [draftSave], |
| | | props: { |
| | | clickNodeVal: { |
| | | type: Object, |
| | |
| | | this.addReservation.reservationTime = this.yuyuetime + " " + this.yuyue.time; |
| | | this.addReservation.specificTime = this.yuyue.time; |
| | | this.addReservation.deviceNumber = 'TX-ABC-01'+Math.floor(Math.random() * 10 + 1); |
| | | this.draftRestore('reservation', 'addReservation', this.yuyue.id + '_' + this.yuyuetime, 'addVisiable') |
| | | }, |
| | | handleSelectionChange(selected) { |
| | | this.selectedRow = selected.length > 0 ? selected : null; |
| | |
| | | this.$axios.post(this.$api.deviceReservate.save, this.addReservation).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('ä¿åæå') |
| | | this.draftClear('reservation') |
| | | this.addVisiable = false |
| | | this.getList(); |
| | | this.query(); |
| | |
| | | addDeviceScrapped, |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import { selectUserCondition } from "@/api/business/inspectionTask"; |
| | | import draftSave from '@/mixins/draftSave' |
| | | export default { |
| | | name: "scrapApplicationForm", |
| | | // import å¼å
¥çç»ä»¶éè¦æ³¨å
¥å°å¯¹è±¡ä¸æè½ä½¿ç¨ |
| | | components: {}, |
| | | mixins: [draftSave], |
| | | data() { |
| | | // è¿éåæ¾æ°æ® |
| | | return { |
| | |
| | | this.getUserList() |
| | | if (this.form.scrappedId) { |
| | | this.searchInfo() |
| | | } else { |
| | | this.draftRestore('scrapApplicationForm', 'form', this.form.deviceId, 'dialogVisible') |
| | | } |
| | | }, |
| | | // æ¥è¯¢è¯¦æ
|
| | |
| | | scrappedId: this.form.scrappedId |
| | | }).then(res => { |
| | | if (res.code === 200) { |
| | | const id = this.form.scrappedId |
| | | this.form = { ...res.data } |
| | | this.draftRestore('scrapApplicationForm', 'form', id, 'dialogVisible') |
| | | if (this.form.isFinish === 0) { |
| | | if (this.form.departmentHeadUserId) { |
| | | this.currentStep = 1 |
| | |
| | | addDeviceScrapped(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æ°å¢æå') |
| | | this.draftClear('scrapApplicationForm') |
| | | this.resetForm() |
| | | } |
| | | this.submitFormLoading = false |
| | |
| | | }, |
| | | // å
³éå¼¹æ¡ |
| | | resetForm() { |
| | | this.draftStop('scrapApplicationForm') |
| | | this.dialogVisible = false |
| | | this.$emit('closeDialog') |
| | | }, |
| | |
| | | import { selectUserCondition } from "@/api/business/inspectionTask"; |
| | | import { dateFormat } from '@/utils/date' |
| | | import { mapGetters } from "@/utils/store-compat"; |
| | | import draftSave from '@/mixins/draftSave' |
| | | export default { |
| | | mixins: [draftSave], |
| | | props: { |
| | | clickNodeVal: { |
| | | type: Object, |
| | |
| | | if (res.code == 200) { |
| | | this.$message.success('æäº¤æå') |
| | | this.getDeviceStatePage(this.clickNodeVal.value) |
| | | this.draftClear('deviceState') |
| | | this.dialogVisible = false |
| | | this.closeLoading() |
| | | } |
| | |
| | | this.form.managementNumber = res.data.managementNumber |
| | | this.$nextTick(() => { |
| | | this.$refs['form'].clearValidate() |
| | | if (!this.form.stateId) { |
| | | this.draftRestore('deviceState', 'form', '', 'dialogVisible') |
| | | } |
| | | }) |
| | | }); |
| | | // è·åè´è´£äººä¿¡æ¯ |
| | |
| | | this.currentStepClick = this.currentStep === 4 ? 0 : this.currentStep |
| | | this.$nextTick(() => { |
| | | this.$refs['form'].clearValidate() |
| | | if (this.currentStep === 0) { |
| | | this.draftRestore('deviceState', 'form', this.form.stateId, 'dialogVisible') |
| | | } |
| | | }) |
| | | this.dialogVisible = true |
| | | }, |
| | |
| | | }, |
| | | dialogVisible(newVal) { |
| | | if (!newVal) { |
| | | this.draftStop('deviceState') |
| | | this.form = { |
| | | } |
| | | this.closeLoading() |
| | |
| | | } from "@/api/cnas/resourceDemand/device"; |
| | | import {selectUserCondition} from "@/api/system/user"; |
| | | import {mapGetters} from "@/utils/store-compat"; |
| | | import draftSave from '@/mixins/draftSave' |
| | | |
| | | export default { |
| | | name: '', |
| | | // import å¼å
¥çç»ä»¶éè¦æ³¨å
¥å°å¯¹è±¡ä¸æè½ä½¿ç¨ |
| | | components: {limsTable}, |
| | | mixins: [draftSave], |
| | | props: { |
| | | clickNodeVal: { |
| | | type: Object, |
| | |
| | | this.deviceImpowerDetails.forEach(item => { |
| | | item['delegatedUserArr'] = item.delegatedUser.split(',') |
| | | }) |
| | | this.restoreImpowerDraft() |
| | | } |
| | | }).catch(error => { |
| | | console.error(error) |
| | | }) |
| | | } else { |
| | | this.restoreImpowerDraft() |
| | | } |
| | | this.getEquipOptions() |
| | | this.getUserList() |
| | | }, |
| | | restoreImpowerDraft() { |
| | | if (this.operationType === 'add' || this.operationType === 'edit') { |
| | | const rid = this.operationType === 'edit' ? this.impowerId : '' |
| | | this.draftRestore('usageAuthorizationForm', 'form', rid, 'usageTableDia') |
| | | this.draftRestore('usageAuthorizationRows', 'deviceImpowerDetails', rid, 'usageTableDia') |
| | | } |
| | | }, |
| | | closeDialog () { |
| | | this.usageTableDia = false |
| | |
| | | addImpower(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('æ°å¢æå') |
| | | this.draftClear('usageAuthorizationForm') |
| | | this.draftClear('usageAuthorizationRows') |
| | | this.usageTableDia = false |
| | | this.refreshTableList() |
| | | } |
| | |
| | | updateImpower(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('ä¿®æ¹æå') |
| | | this.draftClear('usageAuthorizationForm') |
| | | this.draftClear('usageAuthorizationRows') |
| | | this.usageTableDia = false |
| | | this.refreshTableList() |
| | | } |