Commit 91b3c387 authored by jingnan's avatar jingnan 👀

胶料调配剩余剩余施工期计算相关修改

parent 17d950b5
......@@ -120,6 +120,17 @@ export default {
this.setFormDataAttr('modelNo', 'disabled', !!(val && val.length))
}
}
},
'form.shellacDeploy': {
immediate: true,
deep: true,
handler(val) {
if (this.subTypeName === 'AssignCardLacquer') {
if (this.itemObj.attrKey === 'modelNo' || this.itemObj.attrKey === 'realityMark' || this.itemObj.attrKey === 'spec') {
this.setMixEndTime()
}
}
}
}
},
// 生命周期 - 创建完成(可以访问当前this 实例)
......@@ -342,7 +353,7 @@ export default {
},
{
'fieldName': 'spec',
'operator': 'LIKE',
'operator': 'EQ',
'value': this.basicData.spec || ''
},
{
......@@ -447,33 +458,22 @@ export default {
if (this.itemObj.attrKey === 'spec') {
this.$set(this.form, 'certificateNo', '')
this.$set(this.form, 'lotNo', '')
this.setMixEndTime()
// this.setMixEndTime()
} else if (this.itemObj.attrKey === 'modelNo' || this.itemObj.attrKey === 'realityMark') {
this.$set(this.form, 'certificateNo', '')
this.$set(this.form, 'lotNo', '')
this.setMixEndTime()
// this.setMixEndTime()
}
}
},
setMixEndTime() {
if (this.form.mixStartTime) {
// let rawTime = Date.parse(this.form.mixStartTime)// 把时间转换成毫秒
// const addTime = (!this.form.spec || this.form.spec === '/') ? 0 : Number(this.form.spec)
// rawTime = rawTime + (1000 * 60 * 60 * addTime)// 增加3小时。
// const newsTime = new Date(rawTime)// 时间重新格式化时间。
// const y = newsTime.getFullYear()
// const m = (newsTime.getMonth() + 1) < 10 ? '0' + (newsTime.getMonth() + 1) : (newsTime.getMonth() + 1)
// const d = newsTime.getDate()
// const h = newsTime.getHours() < 10 ? '0' + newsTime.getHours() : newsTime.getHours()
// const m2 = newsTime.getMinutes() < 10 ? '0' + newsTime.getMinutes() : newsTime.getMinutes()
// const s = newsTime.getSeconds() < 10 ? '0' + newsTime.getSeconds() : newsTime.getSeconds()
// const resultDate = y + '-' + m + '-' + d + ' ' + h + ':' + m2 + ':' + s
const addTime = (!this.form.spec || this.form.spec === '/') ? 0 : Number(this.form.spec)
const addTime = (!this.form.shellacDeploy || !this.form.shellacDeploy.constructionTime || this.form.shellacDeploy.constructionTime === '/') ? 0 : Number(this.form.shellacDeploy.constructionTime)
const resultDate = this.$utils.addMinutes(this.form.mixStartTime, addTime * 60)
this.$set(this.form, 'mixEndTime', resultDate)
// 设置剩余施工期
if (this.form.mixStartTime && this.form.validityStart) {
const diffTime = addTime - this.$utils.getTimeDifferenceInMinutes(this.form.mixStartTime, this.form.validityStart)
const diffTime = addTime * 60 - this.$utils.getTimeDifferenceInMinutes(this.form.mixStartTime, this.form.validityStart)
this.$set(this.form, 'leftWorkMinutes', diffTime)
}
}
......@@ -517,7 +517,7 @@ export default {
},
{
'fieldName': 'spec',
'operator': 'LIKE',
'operator': 'EQ',
'value': this.form.spec || ''
},
{
......@@ -558,12 +558,12 @@ export default {
},
{
'fieldName': 'spec',
'operator': 'LIKE',
'operator': 'EQ',
'value': spec
},
{
'fieldName': 'realityMark',
'operator': 'LIKE',
'operator': 'EQ',
'value': realityMark
},
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment