fix: 出厂日期可以晚于采购日期与到货日期
This commit is contained in:
parent
f75f3107ea
commit
67d7bea4ce
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue