|
|
|
@ -165,13 +165,20 @@ |
|
|
|
<el-form-item :label="'日历描述:'"> |
|
|
|
<el-input v-model="maintainCalendarSearchData.calendarDesc" style="width: 130px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="'起始时间:'"> |
|
|
|
<el-form-item :label="'起始日期:'"> |
|
|
|
<el-date-picker |
|
|
|
style="width: 130px" |
|
|
|
v-model="maintainCalendarSearchData.startDate" |
|
|
|
value-format="yyyy-MM-dd" |
|
|
|
placeholder="选择日期"> |
|
|
|
</el-date-picker> |
|
|
|
- |
|
|
|
<el-date-picker |
|
|
|
style="width: 130px" |
|
|
|
v-model="maintainCalendarSearchData.endDate" |
|
|
|
value-format="yyyy-MM-dd" |
|
|
|
placeholder="选择日期"> |
|
|
|
</el-date-picker> |
|
|
|
</el-form-item> |
|
|
|
<!-- <el-form-item :label="'至:'">--> |
|
|
|
<!-- <el-date-picker--> |
|
|
|
@ -226,29 +233,18 @@ |
|
|
|
align="center" |
|
|
|
width="30px"> |
|
|
|
</el-table-column> |
|
|
|
<!-- <el-table-column--> |
|
|
|
<!-- v-for="(item,index) in maintainColumnList2" :key="index"--> |
|
|
|
<!-- :prop="item.columnProp"--> |
|
|
|
<!-- :header-align="item.headerAlign"--> |
|
|
|
<!-- :align="item.align"--> |
|
|
|
<!-- :min-width="item.width"--> |
|
|
|
<!-- :vertical-align="'middle'"--> |
|
|
|
<!-- :label="item.columnLabel"--> |
|
|
|
<!-- :formatter="getSelections">--> |
|
|
|
<!-- <template slot-scope="scope">--> |
|
|
|
<!-- <el-select v-model="item.columnProp" placeholder="请选择" style="height: 12px;padding: 0px " filterable allow-create>--> |
|
|
|
<!-- <el-option v-for="item2 in selectList " :key="index" :label="item2.label" :value="item2.value">--> |
|
|
|
<!-- </el-option>--> |
|
|
|
<!-- </el-select>--> |
|
|
|
<!-- </template>--> |
|
|
|
<!-- </el-table-column>--> |
|
|
|
<el-table-column |
|
|
|
prop="val0" |
|
|
|
header-align="center" |
|
|
|
align="left" |
|
|
|
:label="this.timeArray[0]"> |
|
|
|
v-for="(item,index) in maintainColumnList2" :key="item.columnProp" |
|
|
|
:prop="item.columnProp" |
|
|
|
:header-align="item.headerAlign" |
|
|
|
:align="item.align" |
|
|
|
:min-width="item.width" |
|
|
|
:vertical-align="'middle'" |
|
|
|
:label="item.columnLabel" |
|
|
|
:formatter="getSelections"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-select v-model="scope.row.val0" placeholder="请选择" style="height: 12px;padding: 0px " filterable |
|
|
|
<el-select v-model="scope.row[item.columnProp]" placeholder="请选择" style="height: 12px;padding: 0px " |
|
|
|
filterable |
|
|
|
allow-create> |
|
|
|
<el-option v-for="(item,index) in selectList " :key="index" :label="item.label" :value="item.value"> |
|
|
|
|
|
|
|
@ -256,96 +252,110 @@ |
|
|
|
</el-select> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="val1" |
|
|
|
header-align="center" |
|
|
|
align="left" |
|
|
|
:label="this.timeArray[1]"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-select v-model="scope.row.val1" placeholder="请选择" style="height: 12px;padding: 0px " filterable |
|
|
|
allow-create> |
|
|
|
|
|
|
|
<el-option v-for="(item,index) in selectList " :key="index" :label="item.label" :value="item.value"> |
|
|
|
|
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="val2" |
|
|
|
header-align="center" |
|
|
|
align="left" |
|
|
|
:label="this.timeArray[2]"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-select v-model="scope.row.val2" placeholder="请选择" style="height: 12px;padding: 0px " filterable |
|
|
|
allow-create> |
|
|
|
|
|
|
|
<el-option v-for="(item,index) in selectList " :key="index" :label="item.label" :value="item.value"> |
|
|
|
|
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="val3" |
|
|
|
header-align="center" |
|
|
|
align="left" |
|
|
|
:label="this.timeArray[3]"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-select v-model="scope.row.val3" placeholder="请选择" style="height: 12px;padding: 0px " filterable |
|
|
|
allow-create> |
|
|
|
|
|
|
|
<el-option v-for="(item,index) in selectList " :key="index" :label="item.label" :value="item.value"> |
|
|
|
|
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="val4" |
|
|
|
header-align="center" |
|
|
|
align="left" |
|
|
|
:label="this.timeArray[4]"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-select v-model="scope.row.val4" placeholder="请选择" style="height: 12px;padding: 0px " filterable |
|
|
|
allow-create> |
|
|
|
|
|
|
|
<el-option v-for="(item,index) in selectList " :key="index" :label="item.label" :value="item.value"> |
|
|
|
|
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="val5" |
|
|
|
header-align="center" |
|
|
|
align="left" |
|
|
|
:label="this.timeArray[5]"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-select v-model="scope.row.val5" placeholder="请选择" style="height: 12px;padding: 0px " filterable |
|
|
|
allow-create> |
|
|
|
|
|
|
|
<el-option v-for="(item,index) in selectList " :key="index" :label="item.label" :value="item.value"> |
|
|
|
|
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="val6" |
|
|
|
header-align="center" |
|
|
|
align="left" |
|
|
|
:label="this.timeArray[6]"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-select v-model="scope.row.val6" placeholder="请选择" style="height: 12px;padding: 0px " filterable |
|
|
|
allow-create> |
|
|
|
|
|
|
|
<el-option v-for="(item,index) in selectList " :key="index" :label="item.label" :value="item.value"> |
|
|
|
|
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<!-- <el-table-column--> |
|
|
|
<!-- prop="val0"--> |
|
|
|
<!-- header-align="center"--> |
|
|
|
<!-- align="left"--> |
|
|
|
<!-- :label="this.timeArray[0]">--> |
|
|
|
<!-- <template slot-scope="scope">--> |
|
|
|
<!-- <el-select v-model="scope.row.val0" placeholder="请选择" style="height: 12px;padding: 0px " filterable--> |
|
|
|
<!-- allow-create>--> |
|
|
|
<!-- <el-option v-for="(item,index) in selectList " :key="index" :label="item.label" :value="item.value">--> |
|
|
|
|
|
|
|
<!-- </el-option>--> |
|
|
|
<!-- </el-select>--> |
|
|
|
<!-- </template>--> |
|
|
|
<!-- </el-table-column>--> |
|
|
|
<!-- <el-table-column--> |
|
|
|
<!-- prop="val1"--> |
|
|
|
<!-- header-align="center"--> |
|
|
|
<!-- align="left"--> |
|
|
|
<!-- :label="this.timeArray[1]">--> |
|
|
|
<!-- <template slot-scope="scope">--> |
|
|
|
<!-- <el-select v-model="scope.row.val1" placeholder="请选择" style="height: 12px;padding: 0px " filterable--> |
|
|
|
<!-- allow-create>--> |
|
|
|
<!-- --> |
|
|
|
<!-- <el-option v-for="(item,index) in selectList " :key="index" :label="item.label" :value="item.value">--> |
|
|
|
<!-- --> |
|
|
|
<!-- </el-option>--> |
|
|
|
<!-- </el-select>--> |
|
|
|
<!-- </template>--> |
|
|
|
<!-- </el-table-column>--> |
|
|
|
<!-- <el-table-column--> |
|
|
|
<!-- prop="val2"--> |
|
|
|
<!-- header-align="center"--> |
|
|
|
<!-- align="left"--> |
|
|
|
<!-- :label="this.timeArray[2]">--> |
|
|
|
<!-- <template slot-scope="scope">--> |
|
|
|
<!-- <el-select v-model="scope.row.val2" placeholder="请选择" style="height: 12px;padding: 0px " filterable--> |
|
|
|
<!-- allow-create>--> |
|
|
|
<!-- --> |
|
|
|
<!-- <el-option v-for="(item,index) in selectList " :key="index" :label="item.label" :value="item.value">--> |
|
|
|
<!-- --> |
|
|
|
<!-- </el-option>--> |
|
|
|
<!-- </el-select>--> |
|
|
|
<!-- </template>--> |
|
|
|
<!-- </el-table-column>--> |
|
|
|
<!-- <el-table-column--> |
|
|
|
<!-- prop="val3"--> |
|
|
|
<!-- header-align="center"--> |
|
|
|
<!-- align="left"--> |
|
|
|
<!-- :label="this.timeArray[3]">--> |
|
|
|
<!-- <template slot-scope="scope">--> |
|
|
|
<!-- <el-select v-model="scope.row.val3" placeholder="请选择" style="height: 12px;padding: 0px " filterable--> |
|
|
|
<!-- allow-create>--> |
|
|
|
<!-- --> |
|
|
|
<!-- <el-option v-for="(item,index) in selectList " :key="index" :label="item.label" :value="item.value">--> |
|
|
|
<!-- --> |
|
|
|
<!-- </el-option>--> |
|
|
|
<!-- </el-select>--> |
|
|
|
<!-- </template>--> |
|
|
|
<!-- </el-table-column>--> |
|
|
|
<!-- <el-table-column--> |
|
|
|
<!-- prop="val4"--> |
|
|
|
<!-- header-align="center"--> |
|
|
|
<!-- align="left"--> |
|
|
|
<!-- :label="this.timeArray[4]">--> |
|
|
|
<!-- <template slot-scope="scope">--> |
|
|
|
<!-- <el-select v-model="scope.row.val4" placeholder="请选择" style="height: 12px;padding: 0px " filterable--> |
|
|
|
<!-- allow-create>--> |
|
|
|
<!-- --> |
|
|
|
<!-- <el-option v-for="(item,index) in selectList " :key="index" :label="item.label" :value="item.value">--> |
|
|
|
<!-- --> |
|
|
|
<!-- </el-option>--> |
|
|
|
<!-- </el-select>--> |
|
|
|
<!-- </template>--> |
|
|
|
<!-- </el-table-column>--> |
|
|
|
<!-- <el-table-column--> |
|
|
|
<!-- prop="val5"--> |
|
|
|
<!-- header-align="center"--> |
|
|
|
<!-- align="left"--> |
|
|
|
<!-- :label="this.timeArray[5]">--> |
|
|
|
<!-- <template slot-scope="scope">--> |
|
|
|
<!-- <el-select v-model="scope.row.val5" placeholder="请选择" style="height: 12px;padding: 0px " filterable--> |
|
|
|
<!-- allow-create>--> |
|
|
|
<!-- --> |
|
|
|
<!-- <el-option v-for="(item,index) in selectList " :key="index" :label="item.label" :value="item.value">--> |
|
|
|
<!-- --> |
|
|
|
<!-- </el-option>--> |
|
|
|
<!-- </el-select>--> |
|
|
|
<!-- </template>--> |
|
|
|
<!-- </el-table-column>--> |
|
|
|
<!-- <el-table-column--> |
|
|
|
<!-- prop="val6"--> |
|
|
|
<!-- header-align="center"--> |
|
|
|
<!-- align="left"--> |
|
|
|
<!-- :label="this.timeArray[6]">--> |
|
|
|
<!-- <template slot-scope="scope">--> |
|
|
|
<!-- <el-select v-model="scope.row.val6" placeholder="请选择" style="height: 12px;padding: 0px " filterable--> |
|
|
|
<!-- allow-create>--> |
|
|
|
<!-- --> |
|
|
|
<!-- <el-option v-for="(item,index) in selectList " :key="index" :label="item.label" :value="item.value">--> |
|
|
|
<!-- --> |
|
|
|
<!-- </el-option>--> |
|
|
|
<!-- </el-select>--> |
|
|
|
<!-- </template>--> |
|
|
|
<!-- </el-table-column>--> |
|
|
|
</el-table> |
|
|
|
</div> |
|
|
|
<el-footer style="height:40px;margin-top: 20px;text-align:center"> |
|
|
|
@ -1208,33 +1218,29 @@ export default { |
|
|
|
this.dataList2 = data.rows |
|
|
|
}) |
|
|
|
}, |
|
|
|
maintainCalendar() { |
|
|
|
async maintainCalendar() { |
|
|
|
this.getSelectData(); |
|
|
|
this.maintainCalendarSearchData.calendarId = ''; |
|
|
|
this.maintainCalendarSearchData.calendarDesc = ''; |
|
|
|
this.maintainCalendarSearchData.startDate = this.GetDateStr(0); |
|
|
|
this.maintainCalendarSearchData.endDate = this.GetDateStr(7); |
|
|
|
this.refreshModel(); |
|
|
|
this.maintainCalendarSearchData.endDate = this.GetDateStr(6); |
|
|
|
await this.refreshModel(); |
|
|
|
this.maintainCalendarFlag = true; |
|
|
|
}, |
|
|
|
refreshModel() { |
|
|
|
this.getAll(); |
|
|
|
async refreshModel() { |
|
|
|
await this.getAll(); |
|
|
|
let mainData = { |
|
|
|
site: this.$store.state.user.site.toString(), |
|
|
|
calendarId: this.maintainCalendarSearchData.calendarId, |
|
|
|
calendarDesc: this.maintainCalendarSearchData.calendarDesc, |
|
|
|
} |
|
|
|
getCalendarData(mainData).then(({data}) => { |
|
|
|
await getCalendarData(mainData).then(({data}) => { |
|
|
|
let list = data.rows; |
|
|
|
if (list.length > 0) { |
|
|
|
for (let i = 0; i < list.length; i++) { |
|
|
|
list[i].val0 = this.maintainCalendarSearchData.datetype; |
|
|
|
list[i].val1 = this.maintainCalendarSearchData.datetype; |
|
|
|
list[i].val2 = this.maintainCalendarSearchData.datetype; |
|
|
|
list[i].val3 = this.maintainCalendarSearchData.datetype; |
|
|
|
list[i].val4 = this.maintainCalendarSearchData.datetype; |
|
|
|
list[i].val5 = this.maintainCalendarSearchData.datetype; |
|
|
|
list[i].val6 = this.maintainCalendarSearchData.datetype; |
|
|
|
for ( let f = 0; f < this.maintainColumnList2.length ; f++ ){ |
|
|
|
list[i][this.maintainColumnList2[f].columnProp] = this.maintainCalendarSearchData.datetype; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
this.dataList3 = list; |
|
|
|
@ -1274,8 +1280,33 @@ export default { |
|
|
|
var d = dd.getDate() < 10 ? "0" + dd.getDate() : dd.getDate();//获取当前几号,不足10补0 |
|
|
|
return y + "-" + m + "-" + d; |
|
|
|
}, |
|
|
|
//获取区间所有时间并生成动态列 |
|
|
|
// 2022-12-05 sxm 改 |
|
|
|
getAll() { |
|
|
|
let days = this.dayjs(this.maintainCalendarSearchData.endDate).diff(this.maintainCalendarSearchData.startDate, 'day'); |
|
|
|
if (days < 0 || days > 31) { |
|
|
|
this.$message.warning('批量维护工作日历天数为 [1-31] 天, 切开始日期不能晚于结束日期!') |
|
|
|
return; |
|
|
|
} |
|
|
|
let newColumn = [] |
|
|
|
this.timeArray = [] |
|
|
|
for (let i = 0; i <= days; i++) { |
|
|
|
let columnProp = "val" + i; |
|
|
|
let columnLabel = this.dayjs(this.maintainCalendarSearchData.startDate).add(i, 'day').format('YYYY-MM-DD') |
|
|
|
let column = { |
|
|
|
columnProp: columnProp, |
|
|
|
headerAlign: 'center', |
|
|
|
align: 'left', |
|
|
|
width: '100px', |
|
|
|
columnLabel: columnLabel, |
|
|
|
value: '', |
|
|
|
} |
|
|
|
newColumn.push(column) |
|
|
|
this.timeArray.push(columnLabel) |
|
|
|
} |
|
|
|
this.maintainColumnList2 = newColumn |
|
|
|
}, |
|
|
|
//获取区间所有时间并生成动态列 |
|
|
|
getAll1() { |
|
|
|
let begin = this.maintainCalendarSearchData.startDate; |
|
|
|
var dd = new Date(begin); |
|
|
|
dd.setDate(dd.getDate() + 6);//获取AddDayCount天后的日期 |
|
|
|
@ -1518,17 +1549,17 @@ export default { |
|
|
|
// 保存修改后的班次信息 |
|
|
|
updateWorkingCalendar() { |
|
|
|
this.workingCalendar.excepttime1 = parseInt(this.dayjs(this.workingCalendar.scheduledate + ' ' + this.workingCalendar.exceptexacttime1 + ':00').format('H')) |
|
|
|
+ parseFloat(this.dayjs(this.workingCalendar.scheduledate + ' ' + this.workingCalendar.exceptexacttime1 + ':00').format('mm'))/60 |
|
|
|
+ parseFloat(this.dayjs(this.workingCalendar.scheduledate + ' ' + this.workingCalendar.exceptexacttime1 + ':00').format('mm')) / 60 |
|
|
|
this.workingCalendar.excepttime2 = parseInt(this.dayjs(this.workingCalendar.scheduledate + ' ' + this.workingCalendar.exceptexacttime2 + ':00').format('H')) |
|
|
|
+ parseFloat(this.dayjs(this.workingCalendar.scheduledate + ' ' + this.workingCalendar.exceptexacttime2 + ':00').format('mm'))/60 |
|
|
|
+ parseFloat(this.dayjs(this.workingCalendar.scheduledate + ' ' + this.workingCalendar.exceptexacttime2 + ':00').format('mm')) / 60 |
|
|
|
this.workingCalendar.excepttime3 = parseInt(this.dayjs(this.workingCalendar.scheduledate + ' ' + this.workingCalendar.exceptexacttime3 + ':00').format('H')) |
|
|
|
+ parseFloat(this.dayjs(this.workingCalendar.scheduledate + ' ' + this.workingCalendar.exceptexacttime3 + ':00').format('mm'))/60 |
|
|
|
+ parseFloat(this.dayjs(this.workingCalendar.scheduledate + ' ' + this.workingCalendar.exceptexacttime3 + ':00').format('mm')) / 60 |
|
|
|
this.workingCalendar.excepttime4 = parseInt(this.dayjs(this.workingCalendar.scheduledate + ' ' + this.workingCalendar.exceptexacttime4 + ':00').format('H')) |
|
|
|
+ parseFloat(this.dayjs(this.workingCalendar.scheduledate + ' ' + this.workingCalendar.exceptexacttime4 + ':00').format('mm'))/60 |
|
|
|
+ parseFloat(this.dayjs(this.workingCalendar.scheduledate + ' ' + this.workingCalendar.exceptexacttime4 + ':00').format('mm')) / 60 |
|
|
|
this.workingCalendar.excepttime5 = parseInt(this.dayjs(this.workingCalendar.scheduledate + ' ' + this.workingCalendar.exceptexacttime5 + ':00').format('H')) |
|
|
|
+ parseFloat(this.dayjs(this.workingCalendar.scheduledate + ' ' + this.workingCalendar.exceptexacttime5 + ':00').format('mm'))/60 |
|
|
|
+ parseFloat(this.dayjs(this.workingCalendar.scheduledate + ' ' + this.workingCalendar.exceptexacttime5 + ':00').format('mm')) / 60 |
|
|
|
this.workingCalendar.excepttime6 = parseInt(this.dayjs(this.workingCalendar.scheduledate + ' ' + this.workingCalendar.exceptexacttime6 + ':00').format('H')) |
|
|
|
+ parseFloat(this.dayjs(this.workingCalendar.scheduledate + ' ' + this.workingCalendar.exceptexacttime6 + ':00').format('mm'))/60 |
|
|
|
+ parseFloat(this.dayjs(this.workingCalendar.scheduledate + ' ' + this.workingCalendar.exceptexacttime6 + ':00').format('mm')) / 60 |
|
|
|
updateWorkingCalendar(this.workingCalendar).then(({data}) => { |
|
|
|
if (data && data.code == 0) { |
|
|
|
this.$message.success(data.msg) |
|
|
|
|