|
|
@@ -6,7 +6,7 @@
|
|
|
<el-form label-width="90px" label-suffix=":" label-position="right">
|
|
|
|
|
|
<el-form-item label="分配机构">
|
|
|
- <org-tree-select @selectNode="queryNode"></org-tree-select>
|
|
|
+ <org-tree-select ref="orgTreeSelect" @selectNode="queryNode"></org-tree-select>
|
|
|
</el-form-item >
|
|
|
<el-form-item label="调整日期">
|
|
|
<el-button type="primary" @click="addData">新增日期</el-button>
|
|
|
@@ -222,8 +222,9 @@ export default {
|
|
|
this.$message.error(`日期不能为空`);
|
|
|
return;
|
|
|
}
|
|
|
- const ds = this.parseTime(other.date,"YYYY-MM-DD");
|
|
|
- if (!other.disabled && !other.isEnable) {
|
|
|
+ const ds = this.formatTime(other.date,"YYYY-MM-DD");
|
|
|
+ console.log(other,'ds')
|
|
|
+ if ( !other.isEnable === null && !other.disabled ) {
|
|
|
this.$message.error(`${ds}未进行配置`);
|
|
|
return;
|
|
|
}
|
|
|
@@ -265,6 +266,7 @@ export default {
|
|
|
this.isShow = false;
|
|
|
this.workTimeList = [];
|
|
|
this.orgIdList=[];
|
|
|
+ this.$refs['orgTreeSelect'].clear();
|
|
|
},
|
|
|
onEnableChange(workTime) {
|
|
|
if (!workTime.isEnable) {
|
|
|
@@ -279,9 +281,11 @@ export default {
|
|
|
async onSubmit() {
|
|
|
//判断是否有重复的日期
|
|
|
let dateList = [];
|
|
|
- for (let v of this.workTimeList) {
|
|
|
+ let workTimeList = JSON.parse(JSON.stringify(this.workTimeList))
|
|
|
+ for (let v of workTimeList) {
|
|
|
if (v.date) {
|
|
|
let date = this.formatTime(v.date,"YYYY-MM-DD");
|
|
|
+ v.ymdDate = date;
|
|
|
if (dateList.indexOf(date) > -1) {
|
|
|
this.$message.error(`日期: ${date} 重复`);
|
|
|
return;
|
|
|
@@ -290,14 +294,14 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
// 校验
|
|
|
- for (let workTime of this.workTimeList) {
|
|
|
+ for (let workTime of workTimeList) {
|
|
|
if (!this.check(workTime)) {
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
let data = {
|
|
|
orgIdList:this.orgIdList,
|
|
|
- workTimeList:this.workTimeList
|
|
|
+ workTimeList:workTimeList
|
|
|
}
|
|
|
addWorkTimeDay(data).then(res=>{
|
|
|
this.$emit("success");
|