From a6b48280aa3f6265ea9aa71ef2d286b969451365 Mon Sep 17 00:00:00 2001 From: Melete Date: Thu, 16 Nov 2023 22:00:50 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E5=B7=A5=E8=89=BA=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.dev | 4 +- src/views/extend/processFlow/index.vue | 57 +++- .../components/ProcessBomList.vue | 138 +++++++-- .../components/ProcessDetail.vue | 263 ++++++++++-------- 4 files changed, 316 insertions(+), 146 deletions(-) diff --git a/.env.dev b/.env.dev index c9990cf5..7de6760a 100644 --- a/.env.dev +++ b/.env.dev @@ -12,8 +12,8 @@ ENV = 'development' VUE_APP_TITLE = MES系统 # 芋道管理系统/开发环境 -# VUE_APP_BASE_API = 'http://100.64.0.26:48082' -VUE_APP_BASE_API = 'http://192.168.0.33:48082' +VUE_APP_BASE_API = 'http://100.64.0.26:48082' +# VUE_APP_BASE_API = 'http://192.168.0.33:48082' # VUE_APP_BASE_API = 'http://192.168.4.173:48080' # VUE_APP_BASE_API = 'http://192.168.2.173:48080' # VUE_APP_BASE_API = 'http://192.168.1.49:48080' diff --git a/src/views/extend/processFlow/index.vue b/src/views/extend/processFlow/index.vue index 655bc680..d346b0d6 100644 --- a/src/views/extend/processFlow/index.vue +++ b/src/views/extend/processFlow/index.vue @@ -22,7 +22,9 @@ :line="item.lineName" :desc="item.remark" :isActive="item.enabled" - @edit="handleUpdate" /> + @edit="handleUpdate" + @copy="handleCopy" + @delete="handleDelete" /> - + 复制 - + 删除 @@ -255,6 +269,43 @@ export default { this.open = true; this.title = '修改工艺'; }, + async handleCopy(id) { + this.$confirm('确认拷贝操作?', '提示', { + confirmButtonText: '确 认', + cancelButtonText: '取 消', + }) + .then(async () => { + const { code } = await this.http( + '/extend/process-flow/copy', + 'post', + { + id, + } + ); + if (code == 0) { + this.$modal.msgSuccess('复制成功'); + this.getList(); + } + }) + .catch(() => console.info('操作取消')); + }, + async handleDelete(id) { + this.$confirm('确认删除这个工艺吗?', '提示', { + confirmButtonText: '确 认', + cancelButtonText: '取 消', + }) + .then(async () => { + const { code } = await this.http( + '/extend/process-flow/delete?id=' + id, + 'delete' + ); + if (code == 0) { + this.$modal.msgSuccess('删除成功'); + this.getList(); + } + }) + .catch(() => console.info('操作取消')); + }, submitForm() { this.$refs['form'].validate((valid) => { if (!valid) { diff --git a/src/views/extend/processFlowView/components/ProcessBomList.vue b/src/views/extend/processFlowView/components/ProcessBomList.vue index f0953184..904cb611 100644 --- a/src/views/extend/processFlowView/components/ProcessBomList.vue +++ b/src/views/extend/processFlowView/components/ProcessBomList.vue @@ -9,31 +9,66 @@
-
- + 分配设备 - +
- - - + + + +
@@ -44,11 +79,15 @@ export default { props: { currentDet: { type: Object, - default: null - } + default: null, + }, }, data() { return { + open: false, + eqList: [], + finalList: [], + choosedEquipments: [], searchBarFormConfig: [{ label: '工序下设备' }], tableProps: [ // { @@ -58,9 +97,9 @@ export default { // width: 180, // filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'), // }, - { prop: 'name', label: '设备名称' }, - { prop: 'code', label: '物料BOM' }, - { prop: 'remark', label: '参数BOM' }, + { prop: 'equipmentId', label: '设备名称' }, + { prop: 'materialName', label: '物料BOM' }, + { prop: 'valueName', label: '参数BOM' }, ], list: [], total: 0, @@ -69,7 +108,7 @@ export default { pageNo: 1, pageSize: 10, }, - searchText: '' + searchText: '', }; }, watch: { @@ -82,12 +121,46 @@ export default { } }, immediate: true, - deep: true - } + deep: true, + }, }, methods: { - handleEmitFun() { }, - handleTableBtnClick() { }, + renderFn(h,option) { + console.log(option) + return 1 + }, + async getEqList() { + console.log('currentDet', this.currentDet); + const { sectionId } = this.currentDet; + const { code, data } = await this.http( + 'base/core-equipment-bind-section/page', + 'get', + { workshopSectionId: sectionId, pageNo: 1, pageSize: 100 } + ); + if (code == 0) { + console.log('workshopSectionId', data); + + // 模拟数据 + this.eqList = [ + { equipmentId: 1, equipmentName: '设备1' }, + { equipmentId: 2, equipmentName: '设备2' }, + { equipmentId: 3, equipmentName: '设备3' }, + { equipmentId: 4, equipmentName: '设备4' }, + { equipmentId: 5, equipmentName: '设备5' }, + { equipmentId: 6, equipmentName: '设备6' }, + ]; // ].map((item) => ({ label: item.equipmentName, key: item.equipmentId })); + + + // 获取参数bom和物料bom + this.finalList = this.eqList.map((item) => { + // key: equipmentId-参数bomId + item.push({ key: item.equipmentId + '-' + '101', label: '参数bom1' }); + item.push({ key: item.equipmentId + '-' + '201', label: '物料bom1' }); + }); + } + }, + handleEmitFun() {}, + handleTableBtnClick() {}, put(payload) { return this.http(this.updateUrl, 'put', payload); }, @@ -106,23 +179,34 @@ export default { method, params: method === 'get' ? payload : null, data: method !== 'get' ? payload : null, - }) + }); }, - getList({ detId, detName, detDesc, flowId, sectionName } = {}) { - console.log('get list') - + async getList({ detId, detName, detDesc, flowId, sectionName } = {}) { + console.log('get list', detId, detName, flowId); + const { data, code } = await this.http( + '/extend/process-flow-det-equipment/page', + 'get', + { flowDetId: detId, ...this.queryParams } + ); + if (code == 0) { + this.list = data.list; + this.total = data.total; + } else { + this.list.splice(0); + this.total = 0; + } }, - getList() { - this.list = [ - { name: '1', code: 'bomg-1', remark: 'Tochter' }, - { name: '2', code: 'bomg-2', remark: 'Bruder' }, - { name: '3', code: 'bomg-3', remark: 'Kalt' }, - ] + async handleAddEquipment() { + this.open = true; + await this.getEqList(); + }, + cancel() { + this.open = false; }, clearList() { this.list = []; - } + }, }, }; diff --git a/src/views/extend/processFlowView/components/ProcessDetail.vue b/src/views/extend/processFlowView/components/ProcessDetail.vue index ed9a8689..8c2e2f78 100644 --- a/src/views/extend/processFlowView/components/ProcessDetail.vue +++ b/src/views/extend/processFlowView/components/ProcessDetail.vue @@ -9,25 +9,57 @@
-
- +
+ 撤销 - + 下一步 - - 刷新布局 - + + 刷新布局 + + 新建工序 - 编辑 + + 编辑 +
- @@ -36,11 +68,15 @@