|
|
|
@ -205,6 +205,7 @@ |
|
|
|
<van-date-picker |
|
|
|
type="time" |
|
|
|
v-model="data.currentDate" |
|
|
|
:min-date="data.minDate" |
|
|
|
@confirm="onConfirm" |
|
|
|
@cancel="data.showTimePicker = false" |
|
|
|
/> |
|
|
|
@ -299,10 +300,11 @@ const data = reactive({ |
|
|
|
lawFieldShow: false, |
|
|
|
lawField_columns: [], |
|
|
|
lawFieldText:"", |
|
|
|
tempDate: null, |
|
|
|
currentDate: [], |
|
|
|
showTimePicker: false, |
|
|
|
minDate:null, |
|
|
|
maxDate:null, |
|
|
|
minDate: null, |
|
|
|
maxDate: null, |
|
|
|
}); |
|
|
|
var fileSize = 0; |
|
|
|
//保存参数 |
|
|
|
@ -410,7 +412,6 @@ onMounted(() =>{ |
|
|
|
submitData.checkCss = route?.query?.checkCss; |
|
|
|
data.isNoScan = route?.query?.isNoScan; |
|
|
|
|
|
|
|
currentDate(); |
|
|
|
// let dateLimit = new Date(); |
|
|
|
// data.maxDate = new Date(this.$moment(dateLimit).format('YYYY/MM/DD')); |
|
|
|
|
|
|
|
@ -446,7 +447,9 @@ onMounted(() =>{ |
|
|
|
// getLinkageByValueAndParentId("law_item", "100"); |
|
|
|
getLinkageByValueAndParentId("check_item", "100"); |
|
|
|
//初始化时间 |
|
|
|
submitData.enforcementTime = formattedTime(new Date()); |
|
|
|
currentDate(); |
|
|
|
// getDateScpoe(); |
|
|
|
// submitData.enforcementTime = formattedTime(new Date()); |
|
|
|
// getDict({},success =>{ |
|
|
|
|
|
|
|
// },error =>{}); |
|
|
|
@ -654,12 +657,41 @@ const currentDate =() => { |
|
|
|
const month = (now.getMonth() + 1).toString().padStart(2, '0'); |
|
|
|
const day = now.getDate().toString().padStart(2, '0'); |
|
|
|
data.currentDate = [year, month, day] |
|
|
|
console.log("function currentDate -----: ",year, month, day); |
|
|
|
} |
|
|
|
|
|
|
|
const getDateScpoe =() => { |
|
|
|
let date = new Date(); |
|
|
|
let frontDate = new Date() |
|
|
|
let year = date.getFullYear(); |
|
|
|
frontDate.setDate(frontDate.getDate() - 5)//前7天减7,前N天减N |
|
|
|
let dateArr1 = [frontDate.getMonth() + 1,frontDate.getDate()]; |
|
|
|
let dateArr2 = [date.getMonth() + 1,date.getDate()]; |
|
|
|
//开始格式是M,经过以下循环变为MM |
|
|
|
for (let i = 0; i < dateArr1.length; i++) { |
|
|
|
if (dateArr1[i] >= 1 && dateArr1[i] <= 9) { |
|
|
|
dateArr1[i] = "0" + dateArr1[i]; |
|
|
|
} |
|
|
|
} |
|
|
|
for (let i = 0; i < dateArr2.length; i++) { |
|
|
|
if (dateArr2[i] >= 1 && dateArr2[i] <= 9) { |
|
|
|
dateArr2[i] = "0" + dateArr2[i]; |
|
|
|
} |
|
|
|
} |
|
|
|
data.minDate = new Date(year, dateArr1[0], dateArr1[1]); |
|
|
|
data.maxDate = new Date(year, dateArr2[0], dateArr2[1]); |
|
|
|
let strDate1 =year +"/" + dateArr1[0] +"/" +dateArr1[1] +" " |
|
|
|
let strDate2 =year +"/" + dateArr2[0] +"/" +dateArr2[1] +" " |
|
|
|
let time_list = [strDate1,strDate2] //[2023-08-31,2023-09-07] |
|
|
|
console.log("getDateScpoe ----- ", time_list); |
|
|
|
console.log("function getMinDate -----: ",year, month, day) |
|
|
|
console.log("function getMaxDate -----: ",year, month, day) |
|
|
|
} |
|
|
|
|
|
|
|
const onConfirm = (time) => { |
|
|
|
if (time != null) { |
|
|
|
var times = time.selectedValues; |
|
|
|
submitData.checkTime = times[0] + "-" + times[1] + "-" + times[2]; |
|
|
|
submitData.enforcementTime = times[0] + "-" + times[1] + "-" + times[2]; |
|
|
|
data.tempDate = times[1] + "月" + times[2] + "号"; |
|
|
|
} |
|
|
|
data.showTimePicker = false; |
|
|
|
|