作者 雷海东

生产计划查看、派工

... ... @@ -169,12 +169,12 @@ export default {
if (ress) {
//如果已派工时为0总工时*工时比例,否则(总工时-已派工时)*工时比例
console.log(record.dispatchedWorkingHours)
if (record.dispatchedWorkingHours <= 0) {
if (record.dispatchedWorkingHours <= 0 || record.dispatchedWorkingHours==='') {
console.log('aa', ress.result)
console.log(record.totalWorkingHours)
// 将获取到的工序列表添加到数据源中
this.res = ress.result.map((item) => ({
workingProcedure: item.gongxu,
workingProcedure: item.gongxu + " (" + (item.bili * 100).toFixed() + "%)",
undertaker: '', // 初始为空,等待用户输入
workHours: parseFloat((record.totalWorkingHours * item.bili).toFixed(2))
.toString()
... ... @@ -213,6 +213,9 @@ export default {
this.$refs.form.validate((valid) => {
if (valid) {
if (!this.res.some((record) => !record.undertaker) && !this.res.some((record)=>!record.workHours)) {
// 检查是否所有输入框的值都是数字
const allNumeric = this.res.every((record) => /^\d+(\.\d+)?$/.test(record.workHours));
if(allNumeric){
that.confirmLoading = true
console.log('res:', this.res)
// 使用 reduce 方法累加工时字段值
... ... @@ -221,6 +224,10 @@ export default {
return acc + parseFloat(current.workHours)
}, 0)
console.log(this.panduan.dispatchedWorkingHours)
if(this.panduan.dispatchedWorkingHours==='' || this.panduan.dispatchedWorkingHours===null){
this.panduan.dispatchedWorkingHours=0
}
console.log(this.panduan.dispatchedWorkingHours)
const zongpaifa = parseFloat(this.panduan.dispatchedWorkingHours) + zong
console.log('派发工时和:', zong)
console.log('已派发工时:', zongpaifa)
... ... @@ -241,6 +248,10 @@ export default {
that.$message.error('派发工时超过总工时')
that.confirmLoading = false
}
}else{
that.$message.error('工时格式错误')
that.confirmLoading = false
}
} else {
that.$message.error('页面字段不能为空')
that.confirmLoading = false
... ...
... ... @@ -202,6 +202,7 @@ export default {
queryBynumber: '/production/tblProductionPlan/queryBynumber',
querygx: '/production/tblProductionPlan/querygx',
list: "/order_form/tblOrderForm/list",
queryByType: '/production/tblProductTypeGongxu/queryByType',
},
}
},
... ... @@ -233,6 +234,11 @@ export default {
}else if(this.model.productType === '附属钢'){
this.model.productType= 'FS'
}
// gongxuList(this.url.queryByType, { productTypeId: productType }).then((ress) => {
// if(ress){
// }
// })
querygx(this.url.querygx, this.model).then((res) => {
console.log('工序订单号:', orderId)
console.log('工序产品类型:', productType)
... ...
... ... @@ -39,7 +39,7 @@
yanshouList (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.yanshouList(record.orderNumber);
this.$refs.realForm.yanshouList(record);
});
},
close () {
... ...
... ... @@ -101,8 +101,8 @@ export default {
},
methods: {
yanshouList(record){
console.log(record.orderNumber)
yanshouList(this.url.queryByNumber,{orderNumber:record.orderNumber}).then((res) =>{
console.log(record.orderId)
yanshouList(this.url.queryByNumber,{orderNumber:record.orderId}).then((res) =>{
if(res){
this.res=res.result
}
... ...