From 0f8a0106e041a6e4fe81429c8ab0a56d9a7ee675 Mon Sep 17 00:00:00 2001 From: ruanqi Date: Mon, 6 Sep 2021 09:26:04 +0800 Subject: [PATCH] =?UTF-8?q?0906=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/index.js | 4 +- src/api/production.js | 1 + src/views/modules/production/dailyPlan.vue | 164 +++++++++++++++++++-- static/config/index.js | 2 +- 4 files changed, 159 insertions(+), 12 deletions(-) diff --git a/config/index.js b/config/index.js index 7b85bdb..2984559 100644 --- a/config/index.js +++ b/config/index.js @@ -13,7 +13,7 @@ module.exports = { // 代理列表, 是否开启代理通过[./dev.env.js]配置 proxyTable: devEnv.OPEN_PROXY === false ? {} : { '/proxyApi': { - target: 'http://192.168.1.110:9090', + target: 'http://192.168.1.130:9090', changeOrigin: true, pathRewrite: { // 把 /proxyApi 替换成 / @@ -23,7 +23,7 @@ module.exports = { }, // Various Dev Server settings - host: '192.168.1.110', // can be overwritten by process.env.HOST + host: '192.168.1.130', // can be overwritten by process.env.HOST port: 8002, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined autoOpenBrowser: true, errorOverlay: true, diff --git a/src/api/production.js b/src/api/production.js index c2d4a3b..67dbf5e 100644 --- a/src/api/production.js +++ b/src/api/production.js @@ -10,6 +10,7 @@ export const getSchedulingSize=data => createAPI(`dailyPlan/getSchedulingSize`, //保存和修改日计划 export const savePlan=data => createAPI(`dailyPlan/savePlan`, 'post', data); +export const savePlans=data => createAPI(`dailyPlan/savePlans`, 'post', data); //排产清单table export const getWorkPlanData=data => createAPI(`dailyPlan/getWorkPlanData`, 'post', data); diff --git a/src/views/modules/production/dailyPlan.vue b/src/views/modules/production/dailyPlan.vue index c5152b0..5824575 100644 --- a/src/views/modules/production/dailyPlan.vue +++ b/src/views/modules/production/dailyPlan.vue @@ -175,7 +175,7 @@ - + @@ -192,7 +192,8 @@ - 新增 + 批量新增 + 新增 + + + + + + + + + + + + + + + + + + 保存 + 关闭 + + + @@ -282,7 +310,8 @@ getSchedulingSize, savePlan, getWorkPlanData, - delPlan + delPlan, + savePlans } from '@/api/production.js' export default { @@ -290,7 +319,7 @@ data () { return { - + schedulingsFlag: false, // 维护日计划界面 schedulingModalFlag: false, scheduleTableData: [], @@ -306,7 +335,21 @@ orderNo: '', orderDate: '', orderQty: '', - + userName: this.$store.state.user.name, + lotSize: '', + planStartDate: '', + needDate: '', + site: this.$store.state.user.site, + productionType: '生产订单', + planAdd: 0, + partNo: '' + }, + scheduledingsData: { + orderNo: '', + orderDate: '', + orderQty: '', + qty: '', + dayQty: '', userName: this.$store.state.user.name, lotSize: '', planStartDate: '', @@ -365,7 +408,25 @@ this.schedulingModalFlag = true }, - + schedulings(){ + if (this.scheduledModelData.unSchedulingSize == 0) { + this.$alert('该日计划已排产完毕无需新增!', '错误', { + confirmButtonText: '确定' + }) + return false + } + this.scheduledingsData.userName = this.$store.state.user.name + this.scheduledingsData.planStartDate = this.scheduledModelData.planStartDate + this.scheduledingsData.needDate = this.scheduledModelData.needDate + this.scheduledingsData.orderNo = this.scheduledModelData.orderNo + this.scheduledingsData.orderDate = this.scheduledModelData.planStartDate + this.scheduledingsData.planAdd = 0 + this.scheduledingsData.orderQty = '' + this.scheduledingsData.qty='' + this.scheduledingsData.dayQty='' + this.scheduledingsData.orderQty='' + this.schedulingsFlag = true + }, // 排产信息界面 openScheduleModel (row) { if (row.status == '已计划' || row.status == '已取消' || row.status == '已关闭') { @@ -381,6 +442,8 @@ }) this.scheduledingData.lotSize = row.lotSize this.scheduledingData.partNo = row.partNo + this.scheduledingsData.lotSize = row.lotSize + this.scheduledingsData.partNo = row.partNo this.scheduledModelData.needDate = row.needDate this.scheduledModelData.planStartDate = row.planStartDate this.scheduledModelData.orderNo = row.orderNo @@ -417,9 +480,6 @@ return false } - - // this.scheduledingData.orderDate = this.format(this.scheduledingData.orderDate,'yyyy-MM-dd') - savePlan(this.scheduledingData).then(({data}) => { if (data && data.code === 0) { this.scheduledModelData.schedulingSize = data.schedulingSize @@ -445,6 +505,83 @@ } }) }, + plansSave(){ + if (this.scheduledingsData.orderDate == '' || this.scheduledingsData.orderDate == null) { + this.$alert('请选择计划日期!', '错误', { + confirmButtonText: '确定' + }) + return false + } + if (this.scheduledingsData.qty == '' || this.scheduledingsData.qty == null) { + this.$alert('请输入排产总数!', '错误', { + confirmButtonText: '确定' + }) + return false + } + if (this.scheduledingsData.dayQty == '' || this.scheduledingsData.dayQty == null) { + this.$alert('请输入计划天数!', '错误', { + confirmButtonText: '确定' + }) + return false + } + if (this.scheduledingsData.qty <= 0) { + this.$alert('排产总数量必须大于0!', '错误', { + confirmButtonText: '确定' + }) + return false + } + if (this.scheduledModelData.unSchedulingSize { + if (data && data.code === 0) { + this.scheduledModelData.schedulingSize = data.schedulingSize + this.scheduledModelData.unSchedulingSize = this.scheduledingData.lotSize - data.schedulingSize + this.schedulingModalFlag = false + let data1 = {orderNo: this.scheduledModelData.orderNo} + getWorkPlanData(data1).then(({data}) => { + this.scheduleTableData = data.rows + }) + this.getData(); + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + + onClose: () => { + } + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }, planSaveOn () { if (this.scheduledingData.orderDate == '' || this.scheduledingData.orderDate == null) { this.$alert('请选择计划日期!', '错误', { @@ -551,6 +688,15 @@ // let haha= new Date(y+"-"+m+"-"+d); return y+"-"+m+"-"+d; }, + getLastDay(dateTime){ + var dd =new Date(dateTime); + dd.setDate(dd.getDate()-1);//获取1天后的日期 + var y = dd.getFullYear(); + var m = (dd.getMonth()+1)<10?"0"+(dd.getMonth()+1):(dd.getMonth()+1);//获取当前月份的日期,不足10补0 + var d = dd.getDate()<10?"0"+dd.getDate():dd.getDate();//获取当前几号,不足10补0 + // let haha= new Date(y+"-"+m+"-"+d); + return y+"-"+m+"-"+d; + }, getTime (date) { if (date == '') { return '' diff --git a/static/config/index.js b/static/config/index.js index 191e552..6357957 100644 --- a/static/config/index.js +++ b/static/config/index.js @@ -5,7 +5,7 @@ window.SITE_CONFIG = {}; // api接口请求地址 - window.SITE_CONFIG['baseUrl'] = 'http://192.168.1.110:9090/'; + window.SITE_CONFIG['baseUrl'] = 'http://192.168.1.130:9090/'; // cdn地址 = 域名 + 版本号 window.SITE_CONFIG['domain'] = './'; // 域名