车数逻辑V1

yangwl
wws 1 year ago
parent f8bf387097
commit 0c17788c1b

@ -432,7 +432,7 @@
<el-col :offset="1" :span="7"> <el-col :offset="1" :span="7">
<!-- 车数 --> <!-- 车数 -->
<el-form-item size="small" label="分配车数:"> <el-form-item size="small" label="分配车数:">
<el-input required type="number" @input="changeCarNum" v-model="splitForm.carNum"></el-input> <el-input required disabled type="number" @input="changeCarNum" v-model="splitForm.carNum"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -516,6 +516,8 @@ export default {
}, },
data() { data() {
return { return {
//
converCarNum: null,
// - // -
workShift: [], workShift: [],
// //
@ -651,6 +653,17 @@ export default {
}, },
// - // -
splitNumChange(e) { splitNumChange(e) {
// -
if (this.splitForm.routeCode == null) {
console.log("请先选择工艺")
this.$message({
message: "请先选择工艺!",
type: "warning"
})
this.splitForm.splitNum = null
return
}
console.log("变换了拆分数量")
// //
if (e <= 0) { if (e <= 0) {
this.$message({ this.$message({
@ -684,7 +697,18 @@ export default {
this.proLoading = false // false this.proLoading = false // false
}) })
} }
this.product = this.productData[0] this.product = this.productData[0];
//
console.log("车数逻辑------>")
if (this.converCarNum != null) {
this.splitForm.carNum = Math.ceil(this.splitForm.splitNum / this.converCarNum);
}else {
this.$message({
message: '获取车数换算值异常!',
type: 'error'
})
}
}, },
// - // -
checkDate(e) { checkDate(e) {
@ -880,6 +904,10 @@ export default {
changeRoute(routeCode) { changeRoute(routeCode) {
// //
getProEquipment(routeCode).then(response => { getProEquipment(routeCode).then(response => {
//
this.converCarNum = null;
this.eRouteOptions = response.data this.eRouteOptions = response.data
// //
let selectAll = []; let selectAll = [];
@ -895,6 +923,13 @@ export default {
} }
}) })
this.splitForm.prodLineCodeArray = selectAll this.splitForm.prodLineCodeArray = selectAll
//
for (let i = 0; i < this.routes.length; i++) {
if (this.routes[i].routeCode == routeCode) {
this.converCarNum = this.routes[i].carNumUnit;
}
}
}) })
}, },
// - // -

@ -467,6 +467,8 @@ export default {
dicts: ['product_type', 'workorder_type', 'shift_type'], dicts: ['product_type', 'workorder_type', 'shift_type'],
data() { data() {
return { return {
//
converCarNum: null,
// //
checkType: false, checkType: false,
// 线code // 线code
@ -686,6 +688,7 @@ export default {
carNum: null carNum: null
} }
this.formFields = [] this.formFields = []
this.converCarNum = null;
// //
this.splitForm.productDate = new Date() this.splitForm.productDate = new Date()
@ -695,10 +698,22 @@ export default {
}) })
// //
getProRoutes(this.selectWork.productCode).then(response => { getProRoutes(this.selectWork.productCode).then(response => {
console.log("这里是选中工单信息")
console.log(this.selectWork)
console.log("这里是开始获取工艺信息")
console.log(response.data)
this.routes = response.data this.routes = response.data
getProEquipment(this.selectWork.routeCode).then(response => { getProEquipment(this.selectWork.routeCode).then(response => {
this.proline = response.data this.proline = response.data
}) })
//
for (let i = 0; i < this.routes.length; i++) {
if (this.routes[i].routeCode == this.selectWork.routeCode) {
this.converCarNum = this.routes[i].carNumUnit;
}
}
console.log("车数设置成功")
console.log(this.converCarNum)
}) })
// //
getProEquipment(this.selectWork.routeCode).then(response2 => { getProEquipment(this.selectWork.routeCode).then(response2 => {
@ -795,11 +810,23 @@ export default {
} }
}, },
// - // -
routeChange(e) { routeChange(routeCode) {
getProEquipment(e).then(response => { console.log("工艺变更")
console.log(routeCode)
getProEquipment(routeCode).then(response => {
this.eRouteOptions = response.data this.eRouteOptions = response.data
}) })
this.workForm.routeCode = e this.workForm.routeCode = routeCode
//
for (let i = 0; i < this.routes.length; i++) {
if (this.routes[i].routeCode == routeCode) {
this.converCarNum = this.routes[i].carNumUnit;
}
}
console.log("设置好车数换算值")
console.log(this.converCarNum)
}, },
// - // -
shiftChange(e) { shiftChange(e) {

Loading…
Cancel
Save