diff --git a/.env.dev b/.env.dev index 72b44389..5e7d20c9 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 d2a879e1..69bf868c 100644 --- a/src/views/extend/processFlowView/components/ProcessBomList.vue +++ b/src/views/extend/processFlowView/components/ProcessBomList.vue @@ -9,42 +9,68 @@
-
- + 分配设备 - +
- - - - - + - 123 + dialogTitle="选择设备" + :dialogVisible="open" + @close="cancel" + @cancel="cancel" + @confirm="submitForm"> + + +
@@ -56,20 +82,17 @@ export default { props: { currentDet: { type: Object, - default: null - } + default: null, + }, }, data() { return { + open: false, + eqList: [], + finalList: [], + choosedEquipments: [], searchBarFormConfig: [{ label: '工序下设备' }], tableProps: [ - // { - // prop: 'createTime', - // label: '添加时间', - // fixed: true, - // width: 180, - // filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'), - // }, { prop: 'equipmentId', label: '设备名称' }, { prop: 'materialName', label: '物料BOM' }, { prop: 'valueName', label: '参数BOM' }, @@ -81,10 +104,7 @@ export default { pageNo: 1, pageSize: 10, }, - searchText: '', - eqTitle: '分配设备', - centervisible: false, - pageUrl: '/extend/process-flow-det-equipment/page' + searchText: '' }; }, watch: { @@ -97,12 +117,55 @@ 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 + // 需调用参数bom接口和 物料bom接口 + this.finalList = this.eqList.map((item) => { + item.sub = []; + // key: equipmentId-参数bomId + item.sub.push({ + key: item.equipmentId + '-' + '101', + label: '参数bom1', + }); + item.sub.push({ + key: item.equipmentId + '-' + '201', + label: '物料bom1', + }); + + return item; + }); + } + }, + handleEmitFun() {}, + handleTableBtnClick() {}, put(payload) { return this.http(this.updateUrl, 'put', payload); }, @@ -121,43 +184,34 @@ export default { method, params: method === 'get' ? payload : null, data: method !== 'get' ? payload : null, - }) + }); }, - + submitForm() {}, async getList({ detId, detName, detDesc, flowId, sectionName } = {}) { - const { code, data } = await this.recv({ pageNn: 1, pageSize: 100, flowDetId: detId }); + 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) { - if (data) { - this.list = data.list - } - return { cells: [] }; + this.list = data.list; + this.total = data.total; + } else { + this.list.splice(0); + this.total = 0; } - return Promise.reject(this.infoUrl + ' 接口出错!'); }, - - // getList({ detId, detName, detDesc, flowId, sectionName } = {}) { - // console.log('get list') - - // }, - // getList() { - // this.list = [ - // { name: '1', code: 'bomg-1', remark: 'Tochter' }, - // { name: '2', code: 'bomg-2', remark: 'Bruder' }, - // { name: '3', code: 'bomg-3', remark: 'Kalt' }, - // ] - // }, - clearList() { - this.list = []; + async handleAddEquipment() { + this.open = true; + await this.getEqList(); }, - handleEqBtn() { - this.centervisible = true + cancel() { + this.open = false; }, - handleConfirm() { - this.centervisible = false + clearList() { + this.list = []; }, - handleCancel() { - this.centervisible = false - } }, }; diff --git a/src/views/extend/processFlowView/components/ProcessDetail.vue b/src/views/extend/processFlowView/components/ProcessDetail.vue index 6aab498b..b1f71270 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 @@