xuechunyuan 3 years ago
commit 55e538d152
  1. 21
      src/api/booknumber/booknumber.js
  2. 386
      src/views/booknumber/index.vue

@ -0,0 +1,21 @@
import request from "@/router/axios";
export const getList = (current, size, params) => {
return request({
url: "/api/blade-business/apm-config/page",
method: "get",
params: {
...params,
current,
size,
},
});
};
// 获取体检项目
export const getExamProject = () => {
return request({
url: "/api/blade-system/dict-biz/get-hc-project",
method: "get",
});
};

@ -39,25 +39,14 @@
</div>
<div class="tab_box" v-show="isShow">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="单眼视力" name="first">
<el-tab-pane :label="item.dictValue" :name="item.dictKey" v-for="item in tabArr" :key="item.dictValue">
<div class="form_box">
<div class="monment_txt">上午</div>
<avue-form :option="addOption" v-model="addForm">
<!-- <template slot-scope="{row}" slot="input">
<el-tag>{{row.input}}</el-tag>
</template> -->
</avue-form>
<div class="monment_txt">下午</div>
<avue-form :option="addOption1" v-model="addForm1">
<!-- <template slot-scope="{row}" slot="input">
<el-tag>{{row.input}}</el-tag>
</template> -->
</avue-form>
<avue-form :option="item.addOption" v-model="item.addForm"></avue-form>
<!-- <div class="monment_txt">下午</div>
<avue-form :option="item.addOption1" v-model="item.addForm1"></avue-form> -->
</div>
</el-tab-pane>
<el-tab-pane label="听力" name="second">听力</el-tab-pane>
<el-tab-pane label="四肢" name="third">四肢</el-tab-pane>
</el-tabs>
</div>
<div v-show="!isShow">
@ -73,24 +62,15 @@
</div>
<div class="button_box">
<el-button>取消</el-button>
<el-button type="primary" @click="submitForm">提交</el-button>
<el-button type="primary" @click="submitForm(activeName)">提交</el-button>
</div>
</el-drawer>
</basic-container>
</template>
<script>
import {
getLazyList,
remove,
update,
add,
getDept,
getDeptTree
} from "@/api/system/dept";
import { mapGetters } from "vuex";
import website from '@/config/website';
import {getList,getExamProject} from "@/api/booknumber/booknumber";
import {getUserInfo} from '@/api/system/user'
export default {
data() {
return {
@ -107,97 +87,16 @@ export default {
currentPage: 1,
total: 0,
},
isShow:false,
isShow:true,
addForm: {
addData: [
{
timeFrame: 1,
timeFrame: 1
},
{
timeFrame: 2,
timeFrame: 2
}
]
addData: []
},
addForm1: {
addData: [
{
input: 1,
select: 1
},
{
input: 2,
select: 2
}
]
},
addOption:{
emptyBtn:false,
submitBtn:false,
column: [
{
prop: 'addData',
type: 'dynamic',
span:24,
children: {
align: 'center',
headerAlign: 'center',
column: [
{
label: "时段设置",
prop:'timerange',
type: 'timerange',
format:'hh:mm a',
valueFormat:'HH:mm',
popperClass:'time',
},
{
label:'放号数量',
prop:'num',
controlsPosition:'',
type:'number',
min:1,
span:10,
}
]
}
},
]
addData: []
},
addOption1:{
emptyBtn:false,
submitBtn:false,
column: [
{
prop: 'addData',
type: 'dynamic',
span:24,
children: {
align: 'center',
headerAlign: 'center',
column: [
{
label: "时段设置",
prop:'timerange',
type: 'timerange',
format:'hh:mm a',
valueFormat:'HH:mm',
popperClass:'time',
},
{
label:'放号数量',
prop:'num',
controlsPosition:'',
type:'number',
min:1,
}
]
}
},
]
},
activeName: 'first',
addOption:{},
addOption1:{},
activeName: '',
isNumber:false,
option: {
height: 'auto',
@ -230,7 +129,7 @@ export default {
format: "yyyy-MM-dd",
valueFormat: "yyyy-MM-dd",
search: true,
searchValue:'2022-02-09',
searchValue:new Date().getFullYear() + '-' + ((new Date().getMonth() + 1) < 10 ? '0' + (new Date().getMonth() + 1) : ((new Date().getMonth() + 1))) + '-' + (new Date().getDate() < 10 ? '0' + new Date().getDate() : new Date().getDate()),
searchClearable:false
},
{
@ -241,24 +140,12 @@ export default {
dicData:[
{
label:'全部',
value:0
value:'全部'
},
{
label:'视力',
value:1
},
{
label:'听力',
value:2
},
{
label:'四肢',
value:3
}
],
search: true,
searchValue:'全部',
viewDisplay:false,
searchValue:0,
},
{
label:'放号时段',
@ -279,11 +166,136 @@ export default {
},
data: [],
count:0,
dayArr:[]
dayArr:[],
depId:'',
tabArr:[],
tabsArr:[]
};
},
computed: {
},
mounted() {
getExamProject().then(res =>{
res.data.data.map((item,index) =>{
this.option.column[2].dicData.push({
label:item.dictValue,
value:item.dictValue,
})
this.tabArr.push({
dictValue:item.dictValue,
dictKey:item.dictKey,
addForm: {
addData: [
{
timerange: '08:00am,08:30am',
num: 1
},
{
timerange: '08:30am,09:00am',
num: 1
},
{
timerange: '09:00am,09:30am',
num: 1
},
{
timerange: '09:30am,10:00am',
num: 1
}
],
addData1: [
{
timerange: '13:00,13:30',
num: 1
},
{
timerange: '13:30,14:00',
num: 1
},
{
timerange: '14:00,14:30',
num: 1
},
{
timerange: '14:30,15:00',
num: 1
}
]
},
addOption:{
emptyBtn:false,
submitBtn:false,
column: [
{
label:'上午',
prop: 'addData',
type: 'dynamic',
span:24,
children: {
align: 'center',
headerAlign: 'center',
column: [
{
label: "时段设置",
prop:'timerange',
type: 'timerange',
format:'hh:mm a',
valueFormat:'HH:mm',
popperClass:'time',
rules: [
{
required: true,
message: '请输入姓名',
trigger: 'blur'
}
]
},
{
label:'放号数量',
prop:'num',
controlsPosition:'',
type:'number',
min:1,
span:10,
}
]
}
},
{
label:'下午',
prop: 'addData1',
type: 'dynamic',
span:24,
children: {
align: 'center',
headerAlign: 'center',
column: [
{
label: "时段设置",
prop:'timerange',
type: 'timerange',
format:'hh:mm a',
valueFormat:'HH:mm',
popperClass:'time',
},
{
label:'放号数量',
prop:'num',
controlsPosition:'',
type:'number',
min:1,
span:10,
}
]
}
},
]
},
})
})
})
},
methods: {
clickCalc(day){
@ -311,34 +323,51 @@ export default {
// }
done();
},
// handleClick(){},
submitForm(){
this.count = 0
this.addForm.addData.map(item =>{
console.log(item)
this.count += item.num
})
this.addForm1.addData.map(item =>{
this.count += item.num
})
let tmp = this.addForm.addData.find(item =>{item.timerange !== ''})
let tmp1 = this.addForm1.addData.find(item =>{item.timerange !== ''})
console.log(tmp)
console.log(tmp1)
if(!tmp && !tmp1){
this.$message.error('请设置时段')
}else{
console.log(tmp)
handleClick(tab, event){
this.addForm = {
addData:[]
};
this.addForm1 = {
addData:[]
}
},
submitForm(value){
this.count = 0;
// let tmp = this.tabArr.find(item => item.dictKey = value);
// let tmp1 = tmp.addForm.addData.find(item => item.timerange !== '' && item.num !== undefined)
// let tmp2 = tmp.addForm.addData1.find(item => item.timerange !== '' && item.num !== undefined)
// if(!tmp1 && !tmp2){
// this.$message.error('')
// }else{
// tmp.addForm.addData.map(item =>{
// if(item.timerange !== '' && item.num == undefined){
// this.$message.error('')
// }else if(item.timerange == '' && item.num !== undefined){
// this.$message.error('')
// }
// console.log(tmp)
// this.count += item.num;
// })
// tmp.addForm.addData1.map(item =>{
// if(item.timerange !== '' && item.num == undefined){
// this.$message.error('')
// }else if(item.timerange == '' && item.num !== undefined){
// this.$message.error('')
// }else{
// this.count += item.num;
// // this.addForm1 = tmp.addForm.addData1
// }
// })
// }
// // console.log(this.addForm,this.addForm1)
},
closeDraw(){
this.isNumber = false
},
addNumber(){
this.activeName = this.tabArr[0].dictKey;
this.isNumber = true;
this.dayArr = []
console.log(this.calValue)
this.addForm = {
addData:[
{
@ -359,6 +388,12 @@ export default {
// column.addDisabled = false;
done();
},
searchChange(params, done) {
this.query = params;
this.page.currentPage = 1;
this.onLoad(this.page, params);
done();
},
currentChange(currentPage) {
this.page.currentPage = currentPage;
},
@ -369,29 +404,32 @@ export default {
this.onLoad(this.page, this.query);
},
onLoad(page, params = {}) {
this.loading = true;
this.data = [
{regName:'视力',releaseTime:'2023-02-10',
itemArr:[
{ monment:'上午',time:'9:00-9:30',count:4,people:4},
{ monment:'上午',time:'9:30-10:00',count:4,people:0},
{ monment:'上午',time:'10:00-10:30',count:4,people:1},
]},
{regName:'听力',releaseTime:'2023-02-10',
itemArr:[
{ monment:'上午',time:'9:00-9:30',count:4,people:3},
{ monment:'上午',time:'9:30-10:00',count:4,people:3},
{ monment:'上午',time:'10:00-10:30',count:4,people:3},
]},
{regName:'四肢',releaseTime:'2023-02-10',
itemArr:[
{ monment:'上午',time:'9:00-9:30',count:4,people:3},
{ monment:'上午',time:'9:30-10:00',count:4,people:3},
{ monment:'上午',time:'10:00-10:30',count:4,people:3},
]},
]
this.loading = false;
this.page.total = this.data.length
const { releaseTime,project, } = this.query;
let values = {};
getUserInfo().then(res =>{
this.depId = res.data.data.id;
if(releaseTime){
values = {
startTime:this.query.releaseTime,
endTime:this.query.releaseTime,
project:this.query.projectName == '全部' ? '' : this.query.projectName,
createDept:this.depId
};
}else{
values = {
startTime : new Date().getFullYear() + '-' + ((new Date().getMonth() + 1) < 10 ? '0' + (new Date().getMonth() + 1) : ((new Date().getMonth() + 1))) + '-' + (new Date().getDate() < 10 ? '0' + new Date().getDate() : new Date().getDate()),
endTime : new Date().getFullYear() + '-' + ((new Date().getMonth() + 1) < 10 ? '0' + (new Date().getMonth() + 1) : ((new Date().getMonth() + 1))) + '-' + (new Date().getDate() < 10 ? '0' + new Date().getDate() : new Date().getDate()),
createDept:this.depId,
project:''
}
}
getList(page.currentPage, page.pageSize,values).then(res =>{
const data = res.data.data;
this.page.total = data.total;
this.data = data.records;
this.loading = false;
})
})
},
}
};

Loading…
Cancel
Save