Browse Source

baseline

master
han\hanst 2 days ago
parent
commit
da73243fa7
  1. 65
      src/views/modules/sampleTracking/projectProofTracking.vue

65
src/views/modules/sampleTracking/projectProofTracking.vue

@ -1076,6 +1076,18 @@
type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期"
style="width: 100%"
@change="handleProofDialogRequiredDeliveryDateChange">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="Baseline">
<el-date-picker
v-model="proofDialogData.baseline"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期"
style="width: 100%">
</el-date-picker>
</el-form-item>
@ -1091,14 +1103,14 @@
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="16">
<el-col :span="6">
<el-form-item label="Importance">
<el-checkbox v-model="proofDialogData.importance" true-label="Y" false-label="N"></el-checkbox>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="16">
<el-col :span="24">
<el-col :span="18">
<el-form-item label="备注">
<el-input v-model="proofDialogData.remark" style="width: 100%" ></el-input>
</el-form-item>
@ -4073,6 +4085,7 @@ export default {
proofingNumber: '',
planStartDate: '',
requiredDeliveryDate: '',
baseline: '',
actualityDeliveryDate: '',
pmInqueryTime: '',
importance: 'N',
@ -4636,7 +4649,7 @@ export default {
handleOneKeyProofingNoChange (proofingNo) {
const selectedNo = this.isBlankValue(proofingNo) ? '' : String(proofingNo).trim()
if (this.oneKeyDialogMode !== 'create') {
// /
//
if (!selectedNo) {
this.oneKeyForm.proofingNo = ''
return
@ -4644,6 +4657,7 @@ export default {
const matchedInEdit = this.oneKeyProofingApplyOptions.find(item => item && item.applyNo === selectedNo)
if (matchedInEdit) {
this.oneKeyForm.proofingNo = matchedInEdit.applyNo
this.fillEmptyOneKeyProofingDatesFromApply(matchedInEdit)
}
return
}
@ -4662,6 +4676,23 @@ export default {
this.oneKeyForm.planStartDate = matched.createTime || ''
this.syncOneKeyBaselineByRequiredDeliveryDate(this.oneKeyForm.requiredDeliveryDate, false)
},
fillEmptyOneKeyProofingDatesFromApply (matched) {
if (!matched) {
return
}
let filledRequiredDate = false
if (this.isBlankValue(this.oneKeyForm.requiredDeliveryDate)) {
this.oneKeyForm.requiredDeliveryDate = matched.expectedFinishDate || ''
filledRequiredDate = true
}
if (this.isBlankValue(this.oneKeyForm.planStartDate)) {
this.oneKeyForm.planStartDate = matched.createTime || ''
}
// baseline baseline
if (filledRequiredDate) {
this.syncOneKeyBaselineByRequiredDeliveryDate(this.oneKeyForm.requiredDeliveryDate, false)
}
},
handleOneKeyRequiredDeliveryDateChange (dateVal) {
this.syncOneKeyBaselineByRequiredDeliveryDate(dateVal, false)
},
@ -4745,6 +4776,21 @@ export default {
this.proofDialogData.requiredDeliveryDate = matched.expectedFinishDate || ''
//
this.proofDialogData.planStartDate = matched.createTime || ''
this.syncProofDialogBaselineByRequiredDeliveryDate(this.proofDialogData.requiredDeliveryDate, false)
},
handleProofDialogRequiredDeliveryDateChange (dateVal) {
this.syncProofDialogBaselineByRequiredDeliveryDate(dateVal, false)
},
syncProofDialogBaselineByRequiredDeliveryDate (requiredDeliveryDate, forceSync) {
const normalizedRequiredDate = this.formatDate(requiredDeliveryDate)
if (!normalizedRequiredDate) {
return
}
const normalizedBaseline = this.formatDate(this.proofDialogData.baseline)
if (forceSync || !normalizedBaseline) {
// baseline
this.proofDialogData.baseline = normalizedRequiredDate
}
},
loadProofDialogApplyOptions (projectNo) {
const normalizedProjectNo = this.normalizeProjectNo(projectNo)
@ -5523,6 +5569,7 @@ export default {
proofingNumber: '',
planStartDate: '',
requiredDeliveryDate: '',
baseline: '',
actualityDeliveryDate: '',
pmInqueryTime: '',
importance: 'N',
@ -5747,6 +5794,15 @@ export default {
}
return true
},
resolveProofDialogBaseline () {
const baseline = this.formatDate(this.proofDialogData.baseline)
if (baseline) {
return baseline
}
// baseline
const requiredDeliveryDate = this.formatDate(this.proofDialogData.requiredDeliveryDate)
return requiredDeliveryDate || null
},
buildProofPayload () {
return {
site: this.proofDialogData.site,
@ -5762,6 +5818,7 @@ export default {
proofingNumber: Number(this.proofDialogData.proofingNumber),
planStartDate: this.proofDialogData.planStartDate,
requiredDeliveryDate: this.proofDialogData.requiredDeliveryDate,
baseline: this.resolveProofDialogBaseline(),
actualityDeliveryDate: this.proofDialogData.actualityDeliveryDate || null,
pmInqueryTime: this.isBlankValue(this.proofDialogData.pmInqueryTime) ? null : this.proofDialogData.pmInqueryTime,
importance: this.normalizeImportanceValue(this.proofDialogData.importance),

Loading…
Cancel
Save