|
|
|
|
@ -370,7 +370,7 @@ export default { |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
getDays().then(res => { |
|
|
|
|
console.log(res) |
|
|
|
|
// console.log(res) |
|
|
|
|
this.deadline = res.data.data[0].dictValue |
|
|
|
|
if (this.userInfo.role_name !== 'hospital') { |
|
|
|
|
// this.isShowHos = true |
|
|
|
|
@ -463,7 +463,7 @@ export default { |
|
|
|
|
// }) |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
console.log(this.deadline) |
|
|
|
|
// console.log(this.deadline) |
|
|
|
|
this.selectDay = new Date().getTime() + 3600 * 1000 * 24 * (this.deadline - 1); |
|
|
|
|
// console.log(new Date(this.selectDay)) |
|
|
|
|
this.isShowHos = false |
|
|
|
|
@ -520,7 +520,7 @@ export default { |
|
|
|
|
let index = item1.timeFrame.indexOf(":"); |
|
|
|
|
let index1 = item1.timeFrame.indexOf("-"); |
|
|
|
|
let tmp = (parseInt(item1.timeFrame.slice(0, item1.timeFrame.indexOf(":"))) + 12) + item1.timeFrame.slice(item1.timeFrame.indexOf(":")); |
|
|
|
|
let tmp1 = tmp.substring(0, index1 + 2) + (parseInt(tmp.substring(index1 + 2, tmp.indexOf(":", index + 2))) + 12) + tmp.substring(tmp.indexOf(":", index + 2)) |
|
|
|
|
let tmp1 = tmp.substring(0, index1 + 1) + (parseInt(tmp.substring(index1 + 2, tmp.indexOf(":", index + 2))) + 12) + tmp.substring(tmp.indexOf(":", index + 2)) |
|
|
|
|
item1.timeFrame = tmp1.replace('-', ',') |
|
|
|
|
item.addForm.addData1.push({ |
|
|
|
|
num: item1.numberNum, |
|
|
|
|
@ -636,12 +636,12 @@ export default { |
|
|
|
|
} else { |
|
|
|
|
this.deptName = this.userInfo.dept_id |
|
|
|
|
} |
|
|
|
|
let tmp = this.tabArr.find(item => item.addForm.addData.length != 0) |
|
|
|
|
let tmp1 = this.tabArr.find(item => item.addForm.addData1.length != 0) |
|
|
|
|
let tmp = this.tabArr.find(item => item.addForm.addData.length != 0) //上午时段数据是否为空 |
|
|
|
|
let tmp1 = this.tabArr.find(item => item.addForm.addData1.length != 0) //上午时段数据是否为空 |
|
|
|
|
let amArr = [] |
|
|
|
|
let amTimeValite = '' |
|
|
|
|
let pmArr = [] |
|
|
|
|
let pmTimeValite = '' |
|
|
|
|
let pmTimeValite = ''; |
|
|
|
|
this.tabArr.map(item => { |
|
|
|
|
item.addForm.addData.map(item1 => { |
|
|
|
|
amArr = amArr.concat(item1.timerange.replaceAll('am', '').split(',')) |
|
|
|
|
@ -650,22 +650,29 @@ export default { |
|
|
|
|
pmArr = pmArr.concat(item1.timerange.replaceAll('am', '').split(',')) |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
amTimeValite = amArr.find(item => item > '12:00') |
|
|
|
|
pmTimeValite = pmArr.find(item => item < '12:00') |
|
|
|
|
let amRepeat = this.tabArr.find(item => item.addForm.addData.length > new Set(item.addForm.addData.map(item=>item.timerange.replaceAll('am',''))).size) |
|
|
|
|
let pmRepeat = this.tabArr.find(item => item.addForm.addData1.length > new Set(item.addForm.addData1.map(item=>item.timerange)).size) |
|
|
|
|
amTimeValite = amArr.find(item => item > '12:00') //上午放号是否包含下午的时段 |
|
|
|
|
pmTimeValite = pmArr.find(item => item < '12:00') //下午放号是否包含上午的时段 |
|
|
|
|
let timerangeValite = this.tabArr.find(item => item.addForm.addData.find(item2 => item2.timerange == '')) //时段是否为空 |
|
|
|
|
let numValite = this.tabArr.find(item => item.addForm.addData.find(item2 => item2.num == undefined)) //数量是否为空 |
|
|
|
|
let timerangeValite1 = this.tabArr.find(item => item.addForm.addData1.find(item2 => item2.timerange == '')) //时段是否为空 |
|
|
|
|
let numValite1 = this.tabArr.find(item => item.addForm.addData1.find(item2 => item2.num == undefined)) //数量是否为空 |
|
|
|
|
if (tmp == undefined && tmp1 == undefined) { |
|
|
|
|
this.$message.error('请至少添加一条数据'); |
|
|
|
|
// done() |
|
|
|
|
} else if (this.count == 0) { |
|
|
|
|
this.$message.error('号源数量不可为0'); |
|
|
|
|
console.log(this.tabArr) |
|
|
|
|
// done() |
|
|
|
|
} else if (amTimeValite) { |
|
|
|
|
this.$message.error('预约上午时段不可选择下午时间'); |
|
|
|
|
// done() |
|
|
|
|
} else if (pmTimeValite) { |
|
|
|
|
this.$message.error('预约下午时段不可选择上午时间'); |
|
|
|
|
// done() |
|
|
|
|
} |
|
|
|
|
}else if(timerangeValite || timerangeValite1){ |
|
|
|
|
this.$message.error('预约时段不可为空'); |
|
|
|
|
}else if(numValite || numValite1){ |
|
|
|
|
this.$message.error('放号数量不可为空'); |
|
|
|
|
}else if(amRepeat || pmRepeat){ |
|
|
|
|
this.$message.error('不可对重复时段进行放号'); |
|
|
|
|
}else if (this.count == 0) { |
|
|
|
|
this.$message.error('号源数量不可为0'); |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
if (this.isEdit) { |
|
|
|
|
this.$confirm(`是否对此时段号源进行增加号源数量变更?`, '提示', { |
|
|
|
|
@ -717,31 +724,31 @@ export default { |
|
|
|
|
detailList: [] |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
if (this.isEdit) { |
|
|
|
|
this.tabArr.map(item => { |
|
|
|
|
configListVOS.map(item1 => { |
|
|
|
|
if (item1.project == item.dictValue) { |
|
|
|
|
item.addForm.addData.map(item2 => { |
|
|
|
|
item1.detailList.push({ |
|
|
|
|
period: '上午', |
|
|
|
|
timeFrame: item2.timerange.replace(",", "-").replaceAll('am', ''), |
|
|
|
|
numberNum: item2.num, |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
item.addForm.addData1.map(item3 => { |
|
|
|
|
let startTime = ((parseInt(item3.timerange.substr(0, 2)) - 12) < 10 ? '0' + (parseInt(item3.timerange.substr(0, 2)) - 12) : (parseInt(item3.timerange.substr(0, 2)) - 12)) + item3.timerange.substr(2, 3); |
|
|
|
|
let endTime = ((parseInt(item3.timerange.substr(6, 7)) - 12) < 10 ? '0' + (parseInt(item3.timerange.substr(6, 7)) - 12) : (parseInt(item3.timerange.substr(6, 7)) - 12)) + item3.timerange.substr(8, 9) |
|
|
|
|
item1.detailList.push({ |
|
|
|
|
period: '下午', |
|
|
|
|
timeFrame: startTime + '-' + endTime, |
|
|
|
|
numberNum: item3.num, |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
values.configListVOS = configListVOS |
|
|
|
|
} else { |
|
|
|
|
// if (this.isEdit) { |
|
|
|
|
// this.tabArr.map(item => { |
|
|
|
|
// configListVOS.map(item1 => { |
|
|
|
|
// if (item1.project == item.dictValue) { |
|
|
|
|
// item.addForm.addData.map(item2 => { |
|
|
|
|
// item1.detailList.push({ |
|
|
|
|
// period: '上午', |
|
|
|
|
// timeFrame: item2.timerange.replace(",", "-").replaceAll('am', ''), |
|
|
|
|
// numberNum: item2.num, |
|
|
|
|
// }) |
|
|
|
|
// }) |
|
|
|
|
// item.addForm.addData1.map(item3 => { |
|
|
|
|
// let startTime = ((parseInt(item3.timerange.substr(0, 2)) - 12) < 10 ? '0' + (parseInt(item3.timerange.substr(0, 2)) - 12) : (parseInt(item3.timerange.substr(0, 2)) - 12)) + item3.timerange.substr(2, 3); |
|
|
|
|
// let endTime = ((parseInt(item3.timerange.substr(6, 7)) - 12) < 10 ? '0' + (parseInt(item3.timerange.substr(6, 7)) - 12) : (parseInt(item3.timerange.substr(6, 7)) - 12)) + item3.timerange.substr(8, 9) |
|
|
|
|
// item1.detailList.push({ |
|
|
|
|
// period: '下午', |
|
|
|
|
// timeFrame: startTime + '-' + endTime, |
|
|
|
|
// numberNum: item3.num, |
|
|
|
|
// }) |
|
|
|
|
// }) |
|
|
|
|
// } |
|
|
|
|
// }) |
|
|
|
|
// }) |
|
|
|
|
// values.configListVOS = configListVOS |
|
|
|
|
// } else { |
|
|
|
|
this.tabArr.map(item => { |
|
|
|
|
configListVOS.map(item1 => { |
|
|
|
|
if (item1.project == item.dictValue) { |
|
|
|
|
@ -770,10 +777,9 @@ export default { |
|
|
|
|
}) |
|
|
|
|
configListVOS = configListVOS.filter(item => item.detailList.length !== 0); |
|
|
|
|
values.configListVOS = configListVOS |
|
|
|
|
} |
|
|
|
|
// } |
|
|
|
|
console.log(values) |
|
|
|
|
addExamProject(values).then(res => { |
|
|
|
|
console.log(res) |
|
|
|
|
if (res.data.code == 200) { |
|
|
|
|
this.$message.success('放号成功'); |
|
|
|
|
this.onLoad(this.page) |
|
|
|
|
@ -794,7 +800,7 @@ export default { |
|
|
|
|
done(); |
|
|
|
|
}, |
|
|
|
|
searchChange(params, done) { |
|
|
|
|
console.log(params) |
|
|
|
|
// console.log(params) |
|
|
|
|
this.query = params; |
|
|
|
|
this.page.currentPage = 1; |
|
|
|
|
this.onLoad(this.page, params); |
|
|
|
|
|