|
@ -13,7 +13,7 @@ |
|
|
:value="item.value" |
|
|
:value="item.value" |
|
|
/> |
|
|
/> |
|
|
</el-select> |
|
|
</el-select> |
|
|
<ButtonBaseMore :Butttondata="HeadButttondata" @button-base-click="buttonTableClick($event,row)" /> |
|
|
<ButtonBaseMore :Butttondata="HeadButttondata" @button-base-click="buttonBaseClick($event,row)" /> |
|
|
</div> |
|
|
</div> |
|
|
<el-button size="small" text @click="selectDate('prev-month',date)"> |
|
|
<el-button size="small" text @click="selectDate('prev-month',date)"> |
|
|
<Icon icon="ep:arrow-left" size="18px"/> |
|
|
<Icon icon="ep:arrow-left" size="18px"/> |
|
@ -136,7 +136,10 @@ const openForm = (type: string, row?: any) => { |
|
|
} |
|
|
} |
|
|
const handleDateChange=async(value)=> { |
|
|
const handleDateChange=async(value)=> { |
|
|
if (value && value.length === 2) { |
|
|
if (value && value.length === 2) { |
|
|
|
|
|
console.log(value) |
|
|
const [start, end] = value; |
|
|
const [start, end] = value; |
|
|
|
|
|
console.log(start) |
|
|
|
|
|
console.log(end) |
|
|
let middleDays = (end - start) / (24 * 60 * 60 * 1000) - 1; |
|
|
let middleDays = (end - start) / (24 * 60 * 60 * 1000) - 1; |
|
|
if (middleDays > 0) { |
|
|
if (middleDays > 0) { |
|
|
let middleDates = []; |
|
|
let middleDates = []; |
|
@ -144,6 +147,7 @@ const handleDateChange=async(value)=> { |
|
|
let middleDate = new Date(start.getTime() + i * 24 * 60 * 60 * 1000); |
|
|
let middleDate = new Date(start.getTime() + i * 24 * 60 * 60 * 1000); |
|
|
middleDates.push(formatDate(middleDate, 'YYYY-MM-DD')); |
|
|
middleDates.push(formatDate(middleDate, 'YYYY-MM-DD')); |
|
|
} |
|
|
} |
|
|
|
|
|
console.log([formatDate(start, 'YYYY-MM-DD'), ...middleDates, formatDate(end, 'YYYY-MM-DD')]) |
|
|
return [formatDate(start, 'YYYY-MM-DD'), ...middleDates, formatDate(end, 'YYYY-MM-DD')]; |
|
|
return [formatDate(start, 'YYYY-MM-DD'), ...middleDates, formatDate(end, 'YYYY-MM-DD')]; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -152,28 +156,6 @@ const handleDateChange=async(value)=> { |
|
|
// form表单提交 |
|
|
// form表单提交 |
|
|
const formsSuccess = async (formType, data) => { |
|
|
const formsSuccess = async (formType, data) => { |
|
|
console.log(data) |
|
|
console.log(data) |
|
|
const dateArray = await handleDateChange(data.calendarDate) |
|
|
|
|
|
datesInCurrentMonth.value.forEach(item => { |
|
|
|
|
|
dateArray.forEach(cur => { |
|
|
|
|
|
if (item.day == cur) { |
|
|
|
|
|
item.isHideMoon = true |
|
|
|
|
|
item.isHideSun = true |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
return |
|
|
|
|
|
var isHave =ReceivedCalendar.allSchemas.formSchema.some(function (item) { |
|
|
|
|
|
return item.field === 'activeTime' || item.field === 'expireTime'; |
|
|
|
|
|
}); |
|
|
|
|
|
if(isHave){ |
|
|
|
|
|
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){ |
|
|
|
|
|
message.error('失效时间要大于生效时间') |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if(data.activeTime==0)data.activeTime = null; |
|
|
|
|
|
if(data.expireTime==0)data.expireTime = null; |
|
|
|
|
|
if (formType === 'create') { |
|
|
if (formType === 'create') { |
|
|
await ReceivedCalendarApi.createReceivedCalendar(data) |
|
|
await ReceivedCalendarApi.createReceivedCalendar(data) |
|
|
message.success(t('common.createSuccess')) |
|
|
message.success(t('common.createSuccess')) |
|
@ -182,9 +164,10 @@ const formsSuccess = async (formType, data) => { |
|
|
message.success(t('common.updateSuccess')) |
|
|
message.success(t('common.updateSuccess')) |
|
|
} |
|
|
} |
|
|
basicFormRef.value.dialogVisible = false |
|
|
basicFormRef.value.dialogVisible = false |
|
|
getList() |
|
|
getData() |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 刪除班次 |
|
|
// 刪除班次 |
|
|
const deleteShift=(day,type) =>{ |
|
|
const deleteShift=(day,type) =>{ |
|
|
console.log(dayData.value) |
|
|
console.log(dayData.value) |
|
|