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

Loading…
Cancel
Save