diff --git a/.env.dev b/.env.dev index 7ff595c7..8eeaadd4 100644 --- a/.env.dev +++ b/.env.dev @@ -14,16 +14,13 @@ VUE_APP_TITLE = MES系统 # 芋道管理系统/开发环境 # VUE_APP_BASE_API = 'http://100.64.0.26:48082' # VUE_APP_BASE_API = 'http://10.70.2.2:8080' -# 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.1.20:48080' # VUE_APP_BASE_API = 'http://192.168.2.173:48080' # VUE_APP_BASE_API = 'http://192.168.1.49:48082' # 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.30:8888' 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.78:48082' diff --git a/src/api/base/orderGroup.js b/src/api/base/orderGroup.js new file mode 100644 index 00000000..5751107f --- /dev/null +++ b/src/api/base/orderGroup.js @@ -0,0 +1,72 @@ +import request from '@/utils/request' +// 获得集团订单分页 +export function getOrderGroupPage(query) { + return request({ + url: '/base/order-group/page', + method: 'get', + params: query + }) +} + +// 获得集团订单 +export function getOrderGroup(query) { + return request({ + url: '/base/order-group/get', + method: 'get', + params: query + }) +} + +// 更新集团订单 +export function updateOrderGroup(data) { + return request({ + url: '/base/order-group/update', + method: 'put', + data: data + }) +} + +// 创建集团订单 +export function createOrderGroup(data) { + return request({ + url: '/base/order-group/create', + method: 'post', + data: data + }) +} + +// 修改集团订单状态,结束-终止-作废用 +export function groupOrderStatusSet(data) { + return request({ + url: '/base/order-group/groupOrderStatusSet', + method: 'put', + data: data + }) +} + +// 获得集团订单详情 +export function orderGroupDetail(query) { + return request({ + url: '/base/order-group/getDetail', + method: 'get', + params: query + }) +} + +// 创建集团订单与厂务订单表关联表 一对多 +export function orderConGroupOrder(data) { + return request({ + url: '/base/order-con-group-order/create', + method: 'post', + data: data + }) +} + +// 订单监控 +export function orderGroupMonitor(query) { + return request({ + url: '/base/order-group/orderGroupMonitor', + method: 'get', + params: query + }) +} diff --git a/src/api/base/orderManage.js b/src/api/base/orderManage.js index 9933c9b7..732e13c7 100644 --- a/src/api/base/orderManage.js +++ b/src/api/base/orderManage.js @@ -8,6 +8,23 @@ export function orderList(query) { }) } +// 获得订单列表 +export function getOrderList(query) { + return request({ + url: '/base/order/list', + method: 'get', + params: query + }) +} + +// 获得订单列表 +export function getFreeOrderList() { + return request({ + url: '/base/order/getFreeOrderList', + method: 'get' + }) +} + // 条件获得工单列表 export function workOrderList(query) { return request({ @@ -86,6 +103,15 @@ export function orderDelete(query) { }) } +// 修改订单状态,结束-终止-作废用 +export function orderStatusSet(data) { + return request({ + url: '/base/order/orderStatusSet', + method: 'put', + data: data + }) +} + // 下发订单,绑定的穿工单id,新建不传 export function orderIssue(data) { return request({ @@ -104,24 +130,6 @@ export function getWorkOrderById(query) { }) } -// 订单监控 -export function orderMonitor(query) { - return request({ - url: '/base/order/orderMonitor', - method: 'get', - params: query - }) -} - -// 获取订单绑定的工单和数量信息,可传订单id列表,map索引为订单id -export function orderAssignmentList(query) { - return request({ - url: '/base/order/orderAssignmentList', - method: 'get', - params: query - }) -} - // 获得所有客户列表 export function customerList() { return request({ diff --git a/src/views/order/base/orderGroup/components/bindOrder.vue b/src/views/order/base/orderGroup/components/bindOrder.vue new file mode 100644 index 00000000..1d0eebd3 --- /dev/null +++ b/src/views/order/base/orderGroup/components/bindOrder.vue @@ -0,0 +1,156 @@ + + \ No newline at end of file diff --git a/src/views/order/base/orderGroup/components/orderGroupAdd.vue b/src/views/order/base/orderGroup/components/orderGroupAdd.vue new file mode 100644 index 00000000..1c272dfb --- /dev/null +++ b/src/views/order/base/orderGroup/components/orderGroupAdd.vue @@ -0,0 +1,197 @@ + + \ No newline at end of file diff --git a/src/views/order/base/orderGroup/index.vue b/src/views/order/base/orderGroup/index.vue new file mode 100644 index 00000000..c14e840b --- /dev/null +++ b/src/views/order/base/orderGroup/index.vue @@ -0,0 +1,445 @@ + + \ No newline at end of file diff --git a/src/views/order/base/orderGroup/orderGroupDetailData.vue b/src/views/order/base/orderGroup/orderGroupDetailData.vue new file mode 100644 index 00000000..ca0e3132 --- /dev/null +++ b/src/views/order/base/orderGroup/orderGroupDetailData.vue @@ -0,0 +1,339 @@ + + + \ No newline at end of file diff --git a/src/views/order/base/orderManage/components/addWorkOrder.vue b/src/views/order/base/orderManage/components/addWorkOrder.vue index 45f2a62e..27420779 100644 --- a/src/views/order/base/orderManage/components/addWorkOrder.vue +++ b/src/views/order/base/orderManage/components/addWorkOrder.vue @@ -27,14 +27,19 @@ - {{ item.name }} - {{ item.specifications }} + + + + + + + - - + + - + - - - + @@ -117,30 +120,42 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + @@ -159,6 +174,7 @@ export default { name: '', code: '', planProductId: '', + specifications: '', planStartTime: '', planFinishTime: '', planAssignQuantity: 0, @@ -167,6 +183,7 @@ export default { materialMethod: 1, priority: '', productLineId: [], + roomNameDict: '', type: '', workers: '', planAssignmentQuantity: '' @@ -176,7 +193,9 @@ export default { planProductId: [{ required: true, message: "产品名称不能为空", trigger: "change" }], planAssignQuantity: [{ required: true, message: "计划投入数量不能为空", trigger: "blur" }], planQuantity: [{ required: true, message: "计划生产数量不能为空", trigger: "blur" }], + materialMethod: [{ required: true, message: "物料计算方式不能为空", trigger: "change" }], productLineId: [{ required: true, message: "产线不能为空", trigger: "change" }], + roomNameDict: [{ required: true, message: "负责车间不能为空", trigger: "change" }], planAssignmentQuantity: [{ required: true, message: "计划分配订单量不能为空", trigger: "blur" }] }, productList: [], @@ -202,8 +221,8 @@ export default { this.form.code = res.data || '' }) this.form.planProductId = data.planProductId - this.form.processFlowId = data.processFlowId - this.form.materialMethod = data.materialMethod + // this.form.processFlowId = data.processFlowId + // this.form.materialMethod = data.materialMethod }else{//绑定 this.isBind = true } @@ -212,6 +231,9 @@ export default { // 产品 getProductAll().then(res => { this.productList = res.data || [] + if (this.form.planProductId) { + this.getSpecifications(this.form.planProductId) + } }) // 产线 getLineAll().then(res => { @@ -228,44 +250,60 @@ export default { this.workOrderList = res.data || [] }) }, + // 物料变动 + selectMethod(val) { + if (val === 2 && !this.form.processFlowId ) { + this.form.materialMethod = 1 + this.$modal.msgError("请先选择关联工艺"); + }else if (val === 1) { + this.form.processFlowId = '' + } + }, addWorkOrderSubmit() { - this.$refs['addWorkOrder'].validate((valid) => { - if (valid) { - if (this.isBind) { - //绑定工单 - orderIssue({ - workOrderId: this.form.workOrderId, - orderId: this.form.orderId, - planAssignmentQuantity: this.form.planAssignmentQuantity - }).then((res) => { - if (res.code === 0) { - this.$modal.msgSuccess("操作成功") - this.$emit('addWorkOrderSubmit') - } - }) - } else { - // 新增工单 - let _this = this - _this.form.planStartTime = _this.planStartTime ? new Date(_this.planStartTime).valueOf() : '' - _this.form.planFinishTime = _this.planFinishTime ? new Date(_this.planFinishTime).valueOf() : '' - orderIssue({ ..._this.form }).then(res => { - if (res.code === 0) { - _this.$modal.msgSuccess("操作成功") - let name = this.form.name - _this.$emit('addWorkOrderSubmit') - // 询问是否添加预使用主原料 - _this.$modal.confirm('是否添加预使用主原料信息?').then(function() { - _this.$router.push({ - path: '/core/core-work-order?workOrderName='+encodeURI(name) - }) - }) - } - }) - } - } else { + if (this.isBind) {//绑定工单 + if (!this.form.workOrderId) { + this.$modal.msgError("工单名称不能为空"); return false } - }) + if (!this.form.planAssignmentQuantity) { + this.$modal.msgError("计划分配订单量不能为空"); + return false + } + orderIssue({ + workOrderId: this.form.workOrderId, + orderId: this.form.orderId, + planAssignmentQuantity: this.form.planAssignmentQuantity + }).then((res) => { + if (res.code === 0) { + this.$modal.msgSuccess("操作成功") + this.$emit('addWorkOrderSubmit') + } + }) + }else{// 新增工单 + this.$refs['addWorkOrder'].validate((valid) => { + if (valid) { + // 新增工单 + let _this = this + _this.form.planStartTime = _this.planStartTime ? new Date(_this.planStartTime).valueOf() : '' + _this.form.planFinishTime = _this.planFinishTime ? new Date(_this.planFinishTime).valueOf() : '' + orderIssue({ ..._this.form }).then(res => { + if (res.code === 0) { + _this.$modal.msgSuccess("操作成功") + let name = this.form.name + _this.$emit('addWorkOrderSubmit') + // 询问是否添加预使用主原料 + _this.$modal.confirm('是否添加预使用主原料信息?').then(function() { + _this.$router.push({ + path: '/core/core-work-order?workOrderName='+encodeURI(name) + }) + }) + } + }) + } else { + return false + } + }) + } }, formClear() { this.$refs.addWorkOrder.resetFields() @@ -295,9 +333,23 @@ export default { this.form.productLineId = res.data.productLineIds this.form.type = res.data.type this.form.workers = res.data.workers + this.form.roomNameDict = (res.data.roomNameDict || res.data.roomNameDict === 0) ? res.data.roomNameDict + '' : '' + setTimeout(() => { + this.getSpecifications(this.form.planProductId) + }, 300); } }) } + }, + // 获取产品规格 + getSpecifications(val) { + for (let i of this.productList) { + if (i.id === val) { + this.form.specifications = i.specifications + return + } + } + this.form.specifications = '' } } } diff --git a/src/views/order/base/orderManage/components/orderAdd.vue b/src/views/order/base/orderManage/components/orderAdd.vue index df871a9e..df3a8fb2 100644 --- a/src/views/order/base/orderManage/components/orderAdd.vue +++ b/src/views/order/base/orderManage/components/orderAdd.vue @@ -7,7 +7,7 @@ - + @@ -16,39 +16,6 @@ - - - - - {{ item.name }} - {{ item.specifications }} - - - - - - - - - - - - - - - - - - - @@ -61,30 +28,13 @@ - - - - - - - - - - - - - - - + + @@ -93,11 +43,8 @@ - - - - - + + @@ -112,8 +59,6 @@ - - - + + + - + \ No newline at end of file diff --git a/src/views/order/base/orderManage/index.vue b/src/views/order/base/orderManage/index.vue index b398b76e..4b46ebd9 100644 --- a/src/views/order/base/orderManage/index.vue +++ b/src/views/order/base/orderManage/index.vue @@ -17,7 +17,7 @@