diff --git a/.env.dev b/.env.dev index e86bf076..e6eafbc1 100644 --- a/.env.dev +++ b/.env.dev @@ -20,9 +20,10 @@ VUE_APP_TITLE = MES系统 # VUE_APP_BASE_API = 'http://192.168.1.8:48082' # VUE_APP_BASE_API = 'http://192.168.4.159:48080' # VUE_APP_BASE_API = 'http://192.168.1.104:48082' -VUE_APP_BASE_API = 'http://192.168.0.33:48082' +# VUE_APP_BASE_API = 'http://192.168.0.33:48082' # VUE_APP_BASE_API = 'http://192.168.1.62:48082' # VUE_APP_BASE_API = 'http://192.168.1.78:48082' +VUE_APP_BASE_API = 'http://192.168.1.47:48082' # socket地址 VUE_APP_Socket_API = 'ws://192.168.0.30:8888' VUE_APP_Socket_Dcs_API = 'ws://10.70.180.10:8081' diff --git a/src/views/specialEquipment/check/Content-add.vue b/src/views/specialEquipment/check/Content-add.vue index b245bc9d..21f1f702 100644 --- a/src/views/specialEquipment/check/Content-add.vue +++ b/src/views/specialEquipment/check/Content-add.vue @@ -157,12 +157,12 @@ export default { } catch (err) {} if (!valid) return; - let confirmed = false; - try { - confirmed = await this.getConfirmed(); - } catch (err) { - confirmed = false; - } + // let confirmed = false; + // try { + // confirmed = await this.getConfirmed(); + // } catch (err) { + // confirmed = false; + // } const res = await this.$axios({ url: '/base/equipment-check-order' + @@ -171,7 +171,8 @@ export default { data: { ...this.dataForm, special: true, - status: confirmed ? 2 : 1, + status: 1, + // status: confirmed ? 2 : 1, groupClass: this.dataForm.groupClass.join(','), checkPerson: this.$store.getters.userId, }, @@ -179,7 +180,9 @@ export default { if (res.code == 0) { this.$emit('refreshDataList'); this.$message.success(this.dataForm.id ? '更新成功' : '创建成功'); + return res.data; } + return null; }, }, }; diff --git a/src/views/specialEquipment/check/Content-add_detail.vue b/src/views/specialEquipment/check/Content-add_detail.vue new file mode 100644 index 00000000..d3f55e01 --- /dev/null +++ b/src/views/specialEquipment/check/Content-add_detail.vue @@ -0,0 +1,515 @@ + + + + + + + diff --git a/src/views/specialEquipment/check/Content-edit.vue b/src/views/specialEquipment/check/Content-edit.vue index 95082642..67f45456 100644 --- a/src/views/specialEquipment/check/Content-edit.vue +++ b/src/views/specialEquipment/check/Content-edit.vue @@ -14,7 +14,7 @@ custom-class="mes-drawer" size="60%" @closed="$emit('destroy')"> - 编辑 + {{ disableEdit ? '详情' : '编辑' }}
@@ -129,7 +129,7 @@
@@ -146,7 +146,7 @@ @@ -234,20 +234,6 @@ export default { formLoading: false, departmentList: [], inspectorOptions: [], - attrTableProps: [ - { - prop: 'equipmentName', - label: '设备名称', - }, - { - prop: 'program', - label: '巡检项目', - }, - { - prop: 'checkResult', - label: '巡检结果', - }, - ], attrList: [], attrTotal: 0, attrTitle: '', @@ -339,6 +325,66 @@ export default { value: item.id, })); }, + disableModifyDetail() { + return this.form && this.form.confirmTimeLimit != undefined; + }, + attrTableProps() { + return [ + { + prop: 'equipmentName', + label: '设备名称', + }, + { + prop: 'program', + label: '巡检项目', + }, + { + prop: 'checkResult', + label: '巡检结果', + subcomponent: this.disableModifyDetail + ? { + name: 'TableCellInput', + props: ['injectData'], + data() { + return { + inputvalue: null, + }; + }, + mounted() { + this.inputvalue = this.injectData.checkResult; + }, + methods: { + async handleValueChange(newCheckResult) { + document.body.style.cursor = 'wait'; + await this.$axios({ + url: '/base/equipment-check-order-det/update', + method: 'put', + data: { + orderId: this.injectData.orderId, + equipmentId: this.injectData.equipmentId, + program: this.injectData.program, + id: this.injectData.id, + checkResult: newCheckResult, + }, + }); + document.body.style.cursor = 'default'; + }, + }, + render: function (h) { + return ( + + ); + }, + } + : null, + }, + ]; + }, }, mounted() { this.formLoading = true; @@ -399,6 +445,7 @@ export default { }, async getInfo(row) { + console.log('row', row); const res = await this.$axios( '/base/equipment-check-order/get?id=' + row.id ); diff --git a/src/views/specialEquipment/check/Content.vue b/src/views/specialEquipment/check/Content.vue index 7044619a..06c1bae4 100644 --- a/src/views/specialEquipment/check/Content.vue +++ b/src/views/specialEquipment/check/Content.vue @@ -41,17 +41,17 @@ - - - + +
@@ -62,14 +62,16 @@ import add from './Content-add.vue'; import { parseTime } from '../../core/mixins/code-filter'; import CheckOrderListTable from './CheckOrderListTable.vue'; import edit from './Content-edit.vue'; +import AddCheckDet from './Content-add_detail.vue'; export default { name: 'SpecialEquipmentCheckConfig', - components: { addOrUpdata, add, edit, CheckOrderListTable }, + components: { addOrUpdata, add, edit, AddCheckDet, CheckOrderListTable }, mixins: [basicPageMixin], data() { return { editOpen: false, + detOpen: false, addOrUpdateVisible: false, addOrEditTitle: '', searchBarKeys: ['name'], @@ -188,8 +190,19 @@ export default { this.getList(); }, methods: { - handleSubmit() { - this.$refs.add.dataFormSubmit(); + async handleSubmit() { + const id = await this.$refs.add.dataFormSubmit(); + + setTimeout(() => { + this.handleAddDetail(id); + }, 500); + }, + + handleAddDetail(id) { + this.detOpen = true; + this.$nextTick(() => { + this.$refs['content-detail'].init({ id }); + }); }, successSubmit() {