Commit 472a197f authored by jingnan's avatar jingnan 👀

胶漆调配记录修改

parent 38c525f3
...@@ -420,27 +420,36 @@ export default { ...@@ -420,27 +420,36 @@ export default {
this.$set(this.form, 'diluentLotNo', obj.lotNo) this.$set(this.form, 'diluentLotNo', obj.lotNo)
} else if (this.itemObj.attrKey === 'baseModelNo') { } else if (this.itemObj.attrKey === 'baseModelNo') {
this.$set(this.form, 'certificateNo', '') this.$set(this.form, 'certificateNo', '')
this.$set(this.form, 'lotNo', '')
} else { } else {
this.$set(this.form, this.itemObj.attrKey, value) this.$set(this.form, this.itemObj.attrKey, value)
this.changeRequest() this.changeRequest()
if (this.itemObj.attrKey === 'spec') { if (this.itemObj.attrKey === 'spec') {
this.$set(this.form, 'certificateNo', '')
this.$set(this.form, 'lotNo', '')
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() { setMixEndTime() {
if (this.form.mixStartTime) { if (this.form.mixStartTime) {
let rawTime = Date.parse(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.spec || this.form.spec === '/') ? 0 : Number(this.form.spec)
rawTime = rawTime + (1000 * 60 * 60 * addTime)// 增加3小时。 const resultDate = this.$utils.addMinutes(this.form.mixStartTime, addTime * 60)
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
this.$set(this.form, 'mixEndTime', resultDate) this.$set(this.form, 'mixEndTime', resultDate)
} }
}, },
......
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