diff --git a/.env.dev b/.env.dev index c9990cf5..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' @@ -21,6 +21,10 @@ VUE_APP_BASE_API = 'http://192.168.0.33:48082' # VUE_APP_BASE_API = 'http://192.168.4.159:48080' # VUE_APP_BASE_API = 'http://192.168.1.56:48080' # VUE_APP_BASE_API = 'http://192.168.4.159:48080' + +# 积木报表指向地址 +VUE_APP_JIMU_API = 'http://192.168.0.33:48082' + # 路由懒加载 VUE_CLI_BABEL_TRANSPILE_MODULES = true diff --git a/.env.prod b/.env.prod index 70b8fb4a..4fa71c08 100644 --- a/.env.prod +++ b/.env.prod @@ -12,7 +12,10 @@ ENV = 'production' VUE_APP_TITLE = MES系统 # 芋道管理系统/生产环境 -VUE_APP_BASE_API = 'http://192.168.0.33:48082' +VUE_APP_BASE_API = '/prod-api' + +# 积木报表指向地址 +VUE_APP_JIMU_API = 'http://192.168.0.33:48082' # 根据服务器或域名修改 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..69bf868c 100644 --- a/src/views/extend/processFlowView/components/ProcessBomList.vue +++ b/src/views/extend/processFlowView/components/ProcessBomList.vue @@ -9,31 +9,69 @@
-
- + 分配设备 - +
- - - + + + + + +
@@ -44,23 +82,20 @@ 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: 'name', label: '设备名称' }, - { prop: 'code', label: '物料BOM' }, - { prop: 'remark', label: '参数BOM' }, + { prop: 'equipmentId', label: '设备名称' }, + { prop: 'materialName', label: '物料BOM' }, + { prop: 'valueName', label: '参数BOM' }, ], list: [], total: 0, @@ -82,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); }, @@ -106,23 +184,34 @@ export default { method, params: method === 'get' ? payload : null, data: method !== 'get' ? payload : null, - }) + }); }, - - getList({ detId, detName, detDesc, flowId, sectionName } = {}) { - console.log('get list') - + submitForm() {}, + 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..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 @@