fix: 出厂日期可以晚于采购日期与到货日期

This commit is contained in:
binbin_pan 2024-06-25 15:52:53 +08:00
parent f75f3107ea
commit 67d7bea4ce
1 changed files with 32 additions and 1 deletions

View File

@ -30,6 +30,14 @@
value-format="yyyy-MM-dd"
type="date"
placeholder="出厂日期"
:picker-options="{
//
disabledDate: time => {
const currentDate = new Date(maForm.purchaseTime || new Date())
currentDate.setDate(currentDate.getDate() - 1)
return time.getTime() > currentDate.getTime()
}
}"
@change="changeTime"
></el-date-picker>
</el-form-item>
@ -67,6 +75,7 @@
value-format="yyyy-MM-dd"
type="date"
placeholder="请选择采购日期"
@change="changeTimePurchase"
></el-date-picker>
</el-form-item>
<el-form-item label="到货日期" prop="arrivalTime">
@ -74,9 +83,16 @@
v-model="maForm.arrivalTime"
style="width: 240px"
value-format="yyyy-MM-dd"
:picker-options="pickerOptions"
type="date"
placeholder="请选择到货日期"
:picker-options="{
//
disabledDate: time => {
const currentDate = new Date(maForm.purchaseTime || new Date())
currentDate.setDate(currentDate.getDate())
return time.getTime() < currentDate.getTime()
}
}"
></el-date-picker>
</el-form-item>
<el-form-item label="采购员" prop="purchaser">
@ -202,6 +218,14 @@
type="date"
range-separator="-"
placeholder="出厂日期"
:picker-options="{
//
disabledDate: time => {
const currentDate = new Date(maForm.purchaseTime || new Date())
currentDate.setDate(currentDate.getDate() - 1)
return time.getTime() > currentDate.getTime()
}
}"
></el-date-picker>
</template>
</el-table-column>
@ -703,6 +727,13 @@ export default {
// ...this.queryParams
// }, `role_${new Date().getTime()}.xlsx`)
},
//
changeTimePurchase() {
this.queryParams.productionTime = ''
this.equipmentList.forEach((item) => {
this.$set(item, 'productionTime', '')
})
},
},
}
</script>