|
|
|
@ -52,6 +52,32 @@ export default { |
|
|
|
itemList1: [], |
|
|
|
itemList2: [], |
|
|
|
roleList: [], |
|
|
|
pickerOptionsMul: { |
|
|
|
disabledDate: (time) => { |
|
|
|
// if ( !Array.isArray(this.saveData.selectedDates)) { |
|
|
|
// // 如果 selectedDates 是 null 或不是数组,返回默认的禁用逻辑 |
|
|
|
// return time.getTime() > new Date().getTime(); |
|
|
|
// } |
|
|
|
// 禁止选择当前日期之后的时间 |
|
|
|
// if (time.getTime() > new Date().getTime()) { |
|
|
|
// return true; |
|
|
|
// } |
|
|
|
if (this.saveData.selectedDates==null){ |
|
|
|
return false |
|
|
|
} |
|
|
|
|
|
|
|
// 禁止选择除了已选择的日期之外的其他日期(如果已选择的日期数量达到最大限制) |
|
|
|
if (this.saveData.selectedDates.length >= 31) { |
|
|
|
// 检查传入的日期是否在已选择的日期数组中 |
|
|
|
return !this.saveData.selectedDates.some(date => { |
|
|
|
return date.getTime() == time.getTime(); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
// 如果没有达到最大限制,允许选择任何日期 |
|
|
|
return false; |
|
|
|
} |
|
|
|
}, |
|
|
|
queryParams: { |
|
|
|
site: '', |
|
|
|
classesCode:'', |
|
|
|
@ -66,10 +92,11 @@ export default { |
|
|
|
purchaseOrderNo:'', |
|
|
|
isExport:'', |
|
|
|
exportBy:'', |
|
|
|
exportTime:null, |
|
|
|
status:'' |
|
|
|
exportTime:null |
|
|
|
}, |
|
|
|
saveData:{ |
|
|
|
selectedDates: [], |
|
|
|
insertType:true, |
|
|
|
checkbox1: false, |
|
|
|
checkbox2: false |
|
|
|
}, |
|
|
|
@ -80,7 +107,6 @@ export default { |
|
|
|
dataList: [], |
|
|
|
dataListHead:[], |
|
|
|
queryLoading: false, |
|
|
|
saveErrorFlag: false, |
|
|
|
total:0, |
|
|
|
totalHead:0, |
|
|
|
queryLineRow:{}, |
|
|
|
@ -278,6 +304,11 @@ export default { |
|
|
|
getPeopleList(){ |
|
|
|
this.insertSchedulingFlag = true |
|
|
|
this.recordAddPeoPleFlag = true |
|
|
|
//默认查询 角色:机修人员 |
|
|
|
let filterList = this.roleList.filter(item => item.roleName === '机修人员') |
|
|
|
if (filterList.length > 0) { |
|
|
|
this.$set(this.detailData, 'roleId', filterList[0].roleId) |
|
|
|
} |
|
|
|
this.getOperatorList() |
|
|
|
this.fastAddFlag = true |
|
|
|
}, |
|
|
|
@ -288,11 +319,6 @@ export default { |
|
|
|
} else { |
|
|
|
this.detailData.bu = this.saveData.bu |
|
|
|
} |
|
|
|
//默认查询 角色:机修人员 |
|
|
|
let filterList = this.roleList.filter(item => item.roleName === '机修人员') |
|
|
|
if (filterList.length > 0) { |
|
|
|
this.detailData.roleId = filterList[0].roleId |
|
|
|
} |
|
|
|
// 查询人员 |
|
|
|
await getOperatorList(this.detailData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
@ -509,12 +535,18 @@ export default { |
|
|
|
}, |
|
|
|
saveScheduling(){ |
|
|
|
this.saveData = {} |
|
|
|
this.$set(this.saveData,'selectedDates',[]) |
|
|
|
this.peopleList = [] |
|
|
|
this.classesList2 = [] |
|
|
|
this.saveSchedulingFlag = true; |
|
|
|
this.recordAddPeoPleFlag = false |
|
|
|
}, |
|
|
|
async saveHeaderFunction(){ |
|
|
|
|
|
|
|
if (this.saveData.insertType == null || this.saveData.insertType === ''){ |
|
|
|
this.$message.warning("请选择新增类型") |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.saveData.bu == null || this.saveData.bu === ''){ |
|
|
|
this.$message.warning("请选择BU") |
|
|
|
return |
|
|
|
@ -523,18 +555,26 @@ export default { |
|
|
|
this.$message.warning("请选择班次") |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.saveData.startDate == null || this.saveData.startDate === ''){ |
|
|
|
this.$message.warning("请选择开始日期") |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.saveData.endDate == null || this.saveData.endDate === ''){ |
|
|
|
this.$message.warning("请选择结束日期") |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.saveData.endDate < this.saveData.startDate){ |
|
|
|
this.$message.warning("结束日期不能小于开始日期") |
|
|
|
return |
|
|
|
if (this.saveData.insertType){ |
|
|
|
if (this.saveData.startDate == null || this.saveData.startDate === ''){ |
|
|
|
this.$message.warning("请选择开始日期") |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.saveData.endDate == null || this.saveData.endDate === ''){ |
|
|
|
this.$message.warning("请选择结束日期") |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.saveData.endDate < this.saveData.startDate){ |
|
|
|
this.$message.warning("结束日期不能小于开始日期") |
|
|
|
return |
|
|
|
} |
|
|
|
}else { |
|
|
|
if (this.saveData.selectedDates == null || this.saveData.selectedDates.length < 1){ |
|
|
|
this.$message.warning("请选择具体日期") |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
this.queryLoading= true; |
|
|
|
let tempData = { |
|
|
|
...this.saveData, |
|
|
|
@ -543,17 +583,12 @@ export default { |
|
|
|
await saveSchedulingHeader(tempData).then(({data})=>{ |
|
|
|
if (data.code==0){ |
|
|
|
this.$message.success(data.msg) |
|
|
|
this.queryLoading = false |
|
|
|
} else { |
|
|
|
this.saveSchedulingFlag = false; |
|
|
|
}else{ |
|
|
|
this.$message.error(data.msg) |
|
|
|
this.saveErrorFlag = true |
|
|
|
this.queryLoading = false |
|
|
|
} |
|
|
|
}).catch(()=>{ |
|
|
|
}) |
|
|
|
if (this.saveErrorFlag){ |
|
|
|
return |
|
|
|
} |
|
|
|
this.saveSchedulingFlag = false; |
|
|
|
this.queryLoading = false |
|
|
|
this.handleQuery(); |
|
|
|
}, |
|
|
|
@ -574,6 +609,11 @@ export default { |
|
|
|
this.itemSelections1 = null |
|
|
|
this.itemSelections2 = null |
|
|
|
this.itemList2 = this.peopleList |
|
|
|
//默认查询 角色:机修人员 |
|
|
|
let filterList = this.roleList.filter(item => item.roleName === '机修人员') |
|
|
|
if (filterList.length > 0) { |
|
|
|
this.$set(this.detailData, 'roleId', filterList[0].roleId) |
|
|
|
} |
|
|
|
this.getOperatorList() |
|
|
|
this.fastAddFlag = true |
|
|
|
}, |
|
|
|
@ -812,7 +852,7 @@ export default { |
|
|
|
<el-dialog :close-on-click-modal="false" :close-on-press-escape="false" v-drag title="新增班次" :visible.sync="saveSchedulingFlag" width="420px"> |
|
|
|
<el-form :inline="true" label-position="top"> |
|
|
|
<el-form-item label="BU" prop="bu" > |
|
|
|
<el-select v-model="saveData.bu" placeholder="请选择" @change="insertBUChanged()" style="width: 221px"> |
|
|
|
<el-select v-model="saveData.bu" placeholder="请选择" @change="insertBUChanged()" style="width: 293px"> |
|
|
|
<el-option |
|
|
|
v-for = "i in userBuList" |
|
|
|
:key = "i.buNo" |
|
|
|
@ -825,6 +865,14 @@ export default { |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-form :inline="true" label-position="top"> |
|
|
|
<el-form-item label="新增类型"> |
|
|
|
<el-select v-model="saveData.insertType" placeholder="请选择"> |
|
|
|
<el-option label="日期区间" :value="true"></el-option> |
|
|
|
<el-option label="具体日期" :value="false"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="班次"> |
|
|
|
<el-select v-model="saveData.classesCode" placeholder="请选择" clearable > |
|
|
|
<el-option |
|
|
|
@ -836,7 +884,7 @@ export default { |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-form :inline="true" label-position="top"> |
|
|
|
<el-form :inline="true" label-position="top" v-if="this.saveData.insertType"> |
|
|
|
<el-form-item label="开始日期" > |
|
|
|
<el-date-picker |
|
|
|
v-model="saveData.startDate" |
|
|
|
@ -862,6 +910,18 @@ export default { |
|
|
|
<el-checkbox v-model="saveData.checkbox2">包含周日</el-checkbox> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-form :inline="true" label-position="top" v-if="this.saveData.insertType==false"> |
|
|
|
<el-form-item label="具体日期选择" > |
|
|
|
<el-date-picker |
|
|
|
:clearable="true" |
|
|
|
style="width:350px;" |
|
|
|
v-model="saveData.selectedDates" |
|
|
|
type="dates" |
|
|
|
:picker-options="pickerOptionsMul" |
|
|
|
placeholder="选择日期"> |
|
|
|
</el-date-picker> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-form :inline="true" label-position="top"> |
|
|
|
<el-form-item :label="' '"> |
|
|
|
<el-button type="primary" @click="addPeopleModal()">新增</el-button> |
|
|
|
|