作者 雷海东

生产计划查看、派工

@@ -169,12 +169,12 @@ export default { @@ -169,12 +169,12 @@ export default {
169 if (ress) { 169 if (ress) {
170 //如果已派工时为0总工时*工时比例,否则(总工时-已派工时)*工时比例 170 //如果已派工时为0总工时*工时比例,否则(总工时-已派工时)*工时比例
171 console.log(record.dispatchedWorkingHours) 171 console.log(record.dispatchedWorkingHours)
172 - if (record.dispatchedWorkingHours <= 0) { 172 + if (record.dispatchedWorkingHours <= 0 || record.dispatchedWorkingHours==='') {
173 console.log('aa', ress.result) 173 console.log('aa', ress.result)
174 console.log(record.totalWorkingHours) 174 console.log(record.totalWorkingHours)
175 // 将获取到的工序列表添加到数据源中 175 // 将获取到的工序列表添加到数据源中
176 this.res = ress.result.map((item) => ({ 176 this.res = ress.result.map((item) => ({
177 - workingProcedure: item.gongxu, 177 + workingProcedure: item.gongxu + " (" + (item.bili * 100).toFixed() + "%)",
178 undertaker: '', // 初始为空,等待用户输入 178 undertaker: '', // 初始为空,等待用户输入
179 workHours: parseFloat((record.totalWorkingHours * item.bili).toFixed(2)) 179 workHours: parseFloat((record.totalWorkingHours * item.bili).toFixed(2))
180 .toString() 180 .toString()
@@ -213,6 +213,9 @@ export default { @@ -213,6 +213,9 @@ export default {
213 this.$refs.form.validate((valid) => { 213 this.$refs.form.validate((valid) => {
214 if (valid) { 214 if (valid) {
215 if (!this.res.some((record) => !record.undertaker) && !this.res.some((record)=>!record.workHours)) { 215 if (!this.res.some((record) => !record.undertaker) && !this.res.some((record)=>!record.workHours)) {
  216 + // 检查是否所有输入框的值都是数字
  217 + const allNumeric = this.res.every((record) => /^\d+(\.\d+)?$/.test(record.workHours));
  218 + if(allNumeric){
216 that.confirmLoading = true 219 that.confirmLoading = true
217 console.log('res:', this.res) 220 console.log('res:', this.res)
218 // 使用 reduce 方法累加工时字段值 221 // 使用 reduce 方法累加工时字段值
@@ -221,6 +224,10 @@ export default { @@ -221,6 +224,10 @@ export default {
221 return acc + parseFloat(current.workHours) 224 return acc + parseFloat(current.workHours)
222 }, 0) 225 }, 0)
223 console.log(this.panduan.dispatchedWorkingHours) 226 console.log(this.panduan.dispatchedWorkingHours)
  227 + if(this.panduan.dispatchedWorkingHours==='' || this.panduan.dispatchedWorkingHours===null){
  228 + this.panduan.dispatchedWorkingHours=0
  229 + }
  230 + console.log(this.panduan.dispatchedWorkingHours)
224 const zongpaifa = parseFloat(this.panduan.dispatchedWorkingHours) + zong 231 const zongpaifa = parseFloat(this.panduan.dispatchedWorkingHours) + zong
225 console.log('派发工时和:', zong) 232 console.log('派发工时和:', zong)
226 console.log('已派发工时:', zongpaifa) 233 console.log('已派发工时:', zongpaifa)
@@ -241,6 +248,10 @@ export default { @@ -241,6 +248,10 @@ export default {
241 that.$message.error('派发工时超过总工时') 248 that.$message.error('派发工时超过总工时')
242 that.confirmLoading = false 249 that.confirmLoading = false
243 } 250 }
  251 + }else{
  252 + that.$message.error('工时格式错误')
  253 + that.confirmLoading = false
  254 + }
244 } else { 255 } else {
245 that.$message.error('页面字段不能为空') 256 that.$message.error('页面字段不能为空')
246 that.confirmLoading = false 257 that.confirmLoading = false
@@ -202,6 +202,7 @@ export default { @@ -202,6 +202,7 @@ export default {
202 queryBynumber: '/production/tblProductionPlan/queryBynumber', 202 queryBynumber: '/production/tblProductionPlan/queryBynumber',
203 querygx: '/production/tblProductionPlan/querygx', 203 querygx: '/production/tblProductionPlan/querygx',
204 list: "/order_form/tblOrderForm/list", 204 list: "/order_form/tblOrderForm/list",
  205 + queryByType: '/production/tblProductTypeGongxu/queryByType',
205 }, 206 },
206 } 207 }
207 }, 208 },
@@ -233,6 +234,11 @@ export default { @@ -233,6 +234,11 @@ export default {
233 }else if(this.model.productType === '附属钢'){ 234 }else if(this.model.productType === '附属钢'){
234 this.model.productType= 'FS' 235 this.model.productType= 'FS'
235 } 236 }
  237 + // gongxuList(this.url.queryByType, { productTypeId: productType }).then((ress) => {
  238 + // if(ress){
  239 +
  240 + // }
  241 + // })
236 querygx(this.url.querygx, this.model).then((res) => { 242 querygx(this.url.querygx, this.model).then((res) => {
237 console.log('工序订单号:', orderId) 243 console.log('工序订单号:', orderId)
238 console.log('工序产品类型:', productType) 244 console.log('工序产品类型:', productType)
@@ -39,7 +39,7 @@ @@ -39,7 +39,7 @@
39 yanshouList (record) { 39 yanshouList (record) {
40 this.visible=true 40 this.visible=true
41 this.$nextTick(()=>{ 41 this.$nextTick(()=>{
42 - this.$refs.realForm.yanshouList(record.orderNumber); 42 + this.$refs.realForm.yanshouList(record);
43 }); 43 });
44 }, 44 },
45 close () { 45 close () {
@@ -101,8 +101,8 @@ export default { @@ -101,8 +101,8 @@ export default {
101 }, 101 },
102 methods: { 102 methods: {
103 yanshouList(record){ 103 yanshouList(record){
104 - console.log(record.orderNumber)  
105 - yanshouList(this.url.queryByNumber,{orderNumber:record.orderNumber}).then((res) =>{ 104 + console.log(record.orderId)
  105 + yanshouList(this.url.queryByNumber,{orderNumber:record.orderId}).then((res) =>{
106 if(res){ 106 if(res){
107 this.res=res.result 107 this.res=res.result
108 } 108 }