diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/common/custompage.js b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/common/custompage.js index e955e0c76..e4f24fcbb 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/common/custompage.js +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/common/custompage.js @@ -361,6 +361,9 @@ export default { case 'select': if (!val || !dataSource.map(t => t.value).includes(String(val))) { return '' } return String(val) + case 'selectNoMap': + if (!val) { return '' } + return String(val) case 'checkbox': if (!val) { return [] } diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/LogisticsManagement/Acc_DailyAssess/list.vue b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/LogisticsManagement/Acc_DailyAssess/list.vue index 3f7351125..7c056cd5e 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/LogisticsManagement/Acc_DailyAssess/list.vue +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/LogisticsManagement/Acc_DailyAssess/list.vue @@ -11,7 +11,7 @@ - + 专业部: {{ displayListItem(item, 'DeptNo') }} @@ -22,7 +22,7 @@ 班级: {{ displayListItem(item, 'ClassNo') }} - + 宿舍楼: {{ displayListItem(item, 'Dormitory') }} @@ -94,28 +94,6 @@ ref="datefilter" class="margin-bottom" /> - - - - + + + + {return b.classno-a.classno}).map(t => ({ text: t.classname, value: t.classno })) }), this.FETCH_DATASOURCE('Acc_DormitoryData').then(result => { - this.dataSource.Dormitory = result.data.sort((a,b)=>{return a.parentid-b.parentid}).map(t => ({ text: t.name, value: t.id })) - }), - this.FETCH_DATASOURCE('Acc_UnitData').then(result => { - this.dataSource.Unit = result.data.sort((a,b)=>{return a.parentid-b.parentid}).map(t => ({ text: t.name, value: t.id })) - }), - this.FETCH_DATASOURCE('Acc_FloorData').then(result => { - this.dataSource.Floor = result.data.sort((a,b)=>{return a.parentid-b.parentid}).map(t => ({ text: t.name, value: t.id })) + this.dataSource.Dormitory = result.data.sort((a,b)=>{return a.parentid-b.parentid}).sort((a,b)=>{return a.dno - b.dno}).map(t => ({ text: t.name, value: t.id })) }), - this.FETCH_DATASOURCE('Acc_RoomData').then(result => { - this.dataSource.RId = result.data.sort((a,b)=>{return a.parentid-b.parentid}).map(t => ({ text: t.name, value: t.id })) - }), + // this.FETCH_DATASOURCE('Acc_UnitData').then(result => { + // this.dataSource.Unit = result.data.sort((a,b)=>{return a.dno - b.dno}).map(t => ({ text: t.name, value: t.id })) + // }), + // this.FETCH_DATASOURCE('Acc_FloorData').then(result => { + // this.dataSource.Floor = result.data.sort((a,b)=>{return a.dno - b.dno}).map(t => ({ text: t.name, value: t.id })) + // }), + // this.FETCH_DATASOURCE('Acc_RoomData').then(result => { + // this.dataSource.RId = result.data.sort((a,b)=>{return a.dno - b.dno}).map(t => ({ text: t.name, value: t.id })) + // }), + this.FETCH_DATASOURCE('Acc_UnitData').then(result => { + this.UnitAll = result.data.sort((a,b)=>{return a.dno - b.dno}).map(t => ({ text: t.name, value: t.id,parentid:t.parentid })) + this.dataSource.Unit = this.COPY(this.UnitAll) + }), + this.FETCH_DATASOURCE('Acc_FloorData').then(result => { + this.FloorAll = result.data.sort((a,b)=>{return a.dno - b.dno}).map(t => ({ text: t.name, value: t.id,parentid:t.parentid })) + this.dataSource.Floor = this.COPY(this.FloorAll) + }), + this.FETCH_DATASOURCE('Acc_RoomData').then(result => { + this.RIdAll = result.data.sort((a,b)=>{return a.dno - b.dno}).map(t => ({ text: t.name, value: t.id,parentid:t.parentid })) + this.dataSource.RId = this.COPY(this.RIdAll ) + }), this.FETCH_DATASOURCE('StuInfoBasic').then(result => { this.dataSource.StuNo = result.data.map(t => ({ text: t.stuname, value: t.stuno })) }), @@ -298,7 +313,7 @@ export default { }, // 拉取列表 - async fetchList() { + async fetchList(isConcat=true) { if (this.page > this.total) { return } const result = await this.HTTP_GET( '/Learun/adms/LogisticsManagement/Acc_DailyAssess/pagelist', @@ -315,7 +330,7 @@ export default { this.total = result.total this.page = result.page + 1 - this.list = this.list.concat(result.rows) + this.list = isConcat?this.list.concat(result.rows):result.rows this.tips = `已加载 ${Math.min(result.page, result.total)} / ${result.total} 页,共 ${result.records} 项` this.loadState = result.page >= result.total ? '已加载所有项目' : '向下翻以加载更多' @@ -327,7 +342,7 @@ export default { this.total = 2 this.list = [] - await this.fetchList() + await this.fetchList(false) }, // 列表下拉 @@ -352,13 +367,14 @@ export default { Object.assign(result, mapValues(queryObj, t => (Array.isArray(t) ? t.join(',') : t))) this.searchData = result - await this.refreshList() + await this.refreshList(false) }, // 点击「清空查询条件」按钮 reset() { - this.$refs.datefilter.changeDateRange('all') + // this.$refs.datefilter.changeDateRange('all') this.queryData = this.COPY(this.defaultQueryData) + // this.queryJson = {} this.searchChange() }, @@ -424,7 +440,7 @@ export default { //多条件查询:专业部改变事件 async DeptNoChange(){ - if (this.queryData.DeptNo != null && this.queryData.DeptNo!=undefined && this.queryData.DeptNo != "") { + if (this.queryData.DeptNo) { this.FETCH_DATASOURCE('CdMajorInfo').then(result => { this.dataSource.MajorNo = result.data.sort((a,b)=>{return a.majorno-b.majorno}).filter(t=>t.deptno===this.queryData.DeptNo).map(t => ({ text: t.majorname, value: t.majorno })) }) @@ -439,7 +455,7 @@ export default { }, //多条件查询:专业改变事件 async MajorNoChange(){ - if (this.queryData.MajorNo != null && this.queryData.MajorNo!=undefined && this.queryData.MajorNo != "") { + if (this.queryData.MajorNo) { this.FETCH_DATASOURCE('bjsj').then(result => { this.dataSource.ClassNo = result.data.sort((a,b)=>{return b.classno-a.classno}).filter(t=>t.majorno===this.queryData.MajorNo).map(t => ({ text: t.classname, value: t.classno })) }) @@ -454,13 +470,15 @@ export default { //多条件查询:宿舍楼改变事件 async DormitoryChange(){ if (this.queryData.Dormitory != null && this.queryData.Dormitory!=undefined && this.queryData.Dormitory != "") { - this.FETCH_DATASOURCE('Acc_UnitData').then(result => { - this.dataSource.Unit = result.data.sort((a,b)=>{return a.dno-b.dno}).filter(t=>t.parentid===this.queryData.Dormitory).map(t => ({ text: t.name, value: t.id })) - }) + // this.FETCH_DATASOURCE('Acc_UnitData').then(result => { + // this.dataSource.Unit = result.data.sort((a,b)=>{return a.dno-b.dno}).filter(t=>t.parentid===this.queryData.Dormitory).map(t => ({ text: t.name, value: t.id })) + // }) + this.dataSource.Unit = this.UnitAll.filter(t=>t.parentid===this.queryData.Dormitory) }else{ - this.FETCH_DATASOURCE('Acc_UnitData').then(result => { - this.dataSource.Unit = result.data.sort((a,b)=>{return a.parentid-b.parentid}).map(t => ({ text: t.name, value: t.id })) - }) + // this.FETCH_DATASOURCE('Acc_UnitData').then(result => { + // this.dataSource.Unit = result.data.sort((a,b)=>{return a.parentid-b.parentid}).map(t => ({ text: t.name, value: t.id })) + // }) + this.dataSource.Unit = this.UnitAll } this.queryData.Unit=''; this.queryData.Floor=''; @@ -470,13 +488,15 @@ export default { //多条件查询:单元改变事件 async UnitChange(){ if (this.queryData.Unit != null && this.queryData.Unit!=undefined && this.queryData.Unit != "") { - this.FETCH_DATASOURCE('Acc_FloorData').then(result => { - this.dataSource.Floor = result.data.sort((a,b)=>{return a.dno-b.dno}).filter(t=>t.parentid===this.queryData.Unit).map(t => ({ text: t.name, value: t.id })) - }) + // this.FETCH_DATASOURCE('Acc_FloorData').then(result => { + // this.dataSource.Floor = result.data.sort((a,b)=>{return a.dno-b.dno}).filter(t=>t.parentid===this.queryData.Unit).map(t => ({ text: t.name, value: t.id })) + // }) + this.dataSource.Floor = this.FloorAll.filter(t=>t.parentid===this.queryData.Unit) }else{ - this.FETCH_DATASOURCE('Acc_FloorData').then(result => { - this.dataSource.Floor = result.data.sort((a,b)=>{return a.parentid-b.parentid}).map(t => ({ text: t.name, value: t.id })) - }) + // this.FETCH_DATASOURCE('Acc_FloorData').then(result => { + // this.dataSource.Floor = result.data.sort((a,b)=>{return a.parentid-b.parentid}).map(t => ({ text: t.name, value: t.id })) + // }) + this.dataSource.Floor = this.FloorAll } this.queryData.Floor=''; this.queryData.RId=''; @@ -485,13 +505,15 @@ export default { //多条件查询:楼层改变事件 async FloorChange(){ if (this.queryData.Floor != null && this.queryData.Floor!=undefined && this.queryData.Floor != "") { - this.FETCH_DATASOURCE('Acc_RoomData').then(result => { - this.dataSource.RId = result.data.sort((a,b)=>{return a.dno-b.dno}).filter(t=>t.parentid===this.queryData.Floor).map(t => ({ text: t.name, value: t.id })) - }) + // this.FETCH_DATASOURCE('Acc_RoomData').then(result => { + // this.dataSource.RId = result.data.sort((a,b)=>{return a.dno-b.dno}).filter(t=>t.parentid===this.queryData.Floor).map(t => ({ text: t.name, value: t.id })) + // }) + this.dataSource.RId = this.RIdAll.filter(t=>t.parentid===this.queryData.Floor) }else{ - this.FETCH_DATASOURCE('Acc_RoomData').then(result => { - this.dataSource.RId = result.data.sort((a,b)=>{return a.parentid-b.parentid}).map(t => ({ text: t.name, value: t.id })) - }) + // this.FETCH_DATASOURCE('Acc_RoomData').then(result => { + // this.dataSource.RId = result.data.sort((a,b)=>{return a.parentid-b.parentid}).map(t => ({ text: t.name, value: t.id })) + // }) + this.dataSource.RId = this.RIdAll } this.queryData.RId=''; this.searchChange() diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/LogisticsManagement/Acc_DailyAssess/single.vue b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/LogisticsManagement/Acc_DailyAssess/single.vue index b4f4404d1..071561669 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/LogisticsManagement/Acc_DailyAssess/single.vue +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/LogisticsManagement/Acc_DailyAssess/single.vue @@ -33,11 +33,12 @@ :value="getValue('Acc_DailyAssess.RId')" :disabled="!edit" :range="dataSource.Acc_DailyAssess.RId" + @change="RIdChange" title="宿舍" required /> - + /> --> - - - + --> + @@ -158,13 +166,13 @@ import get from 'lodash/get' import set from 'lodash/set' import moment from 'moment' import customPageMixins from '@/common/custompage.js' -import uploadFile from '@/components/upload-file2.vue' +// import uploadFile from '@/components/upload-file2.vue' export default { mixins: [customPageMixins], - components:{ - uploadFile, - }, + // components:{ + // uploadFile, + // }, data() { return { // 页面相关参数 @@ -172,9 +180,10 @@ export default { mode: null, edit: null, ready: false, - fileList:[],//附件列表 - folderId:null,//附件随机文件夹id - fileTitle:'附件上传',//附件label值 + // fileList:[],//附件列表 + // folderId:null,//附件随机文件夹id + // fileTitle:'附件上传',//附件label值 + // 表单数据 current: {}, @@ -183,21 +192,21 @@ export default { // 表单项数据结构 scheme: { Acc_DailyAssess: { - DeptNo: { type: 'select', title: '专业部', dataSource: '1', dataSourceId: 'CdDeptInfo,deptname,deptno', verify: 'NotNull' }, - MajorNo: { type: 'select', title: '专业', dataSource: '1', dataSourceId: 'CdMajorInfo,majorname,majorno', verify: 'NotNull' }, - ClassNo: { type: 'select', title: '班级', dataSource: '1', dataSourceId: 'bjsj,classname,classno', verify: 'NotNull' }, + // DeptNo: { type: 'select', title: '专业部', dataSource: '1', dataSourceId: 'CdDeptInfo,deptname,deptno' }, + // MajorNo: { type: 'select', title: '专业', dataSource: '1', dataSourceId: 'CdMajorInfo,majorname,majorno' }, + // ClassNo: { type: 'select', title: '班级', dataSource: '1', dataSourceId: 'bjsj,classname,classno' }, Dormitory: { type: 'select', title: '宿舍楼', dataSource: '1', dataSourceId: 'Acc_DormitoryData,name,id', verify: 'NotNull' }, - Unit: { type: 'select', title: '单元', dataSource: '1', dataSourceId: 'Acc_UnitData,name,id', verify: 'NotNull' }, - Floor: { type: 'select', title: '楼层', dataSource: '1', dataSourceId: 'Acc_FloorData,name,id' , verify: 'NotNull' }, - RId: { type: 'select', title: '宿舍', dataSource: '1', dataSourceId: 'Acc_RoomData,name,id' , verify: 'NotNull'}, - StuNo: { type: 'select', title: '学生', dataSource: '1', dataSourceId: 'StuInfoBasic,stuname,stuno', verify: 'NotNull' }, - Date: { type: 'datetime', title: '日期', dateformat: '0' , verify: 'NotNull'}, + Unit: { type: 'selectNoMap', title: '单元', dataSource: '1', dataSourceId: 'Acc_UnitData,name,id', verify: 'NotNull' }, + Floor: { type: 'selectNoMap', title: '楼层', dataSource: '1', dataSourceId: 'Acc_FloorData,name,id' , verify: 'NotNull' }, + RId: { type: 'selectNoMap', title: '宿舍', dataSource: '1', dataSourceId: 'Acc_RoomData,name,id' , verify: 'NotNull'}, + StuNo: { type: 'selectNoMap', title: '学生', dataSource: '1', dataSourceId: 'StuInfoBasic,stuname,stuno', verify: 'NotNull' }, + Date: { type: 'date', title: '日期', dateformat: '0' , verify: 'NotNull'}, AddScoreHealth: { type: 'text', title: '卫生奖分' }, MinusScoreHealth: { type: 'text', title: '卫生扣分' }, AddScore: { type: 'text', title: '纪律奖分' }, MinusScore: { type: 'text', title: '纪律扣分' }, Reason: { type: 'textarea', title: '奖扣分原因' , verify: 'NotNull'}, - Files: { type: "text", title: "附件上传" }, + Files: { type: "upload", title: "附件上传" }, }, }, @@ -217,7 +226,12 @@ export default { } , - StuNoAll:[], + show:true, + + // StuNoAll:[], + FloorAll:[], + RIdAll:[], + DeptNoAll:[], } }, @@ -228,7 +242,7 @@ export default { methods: { // 页面初始化 async init(type, id) { - this.folderId=this.GUID(); + // this.folderId=this.GUID(); // console.log('附件随机文件夹id:'+this.folderId); this.LOADING('加载数据中...') @@ -239,37 +253,40 @@ export default { // 拉取表单数据,同时拉取所有来自数据源的选单数据 await Promise.all([ - this.FETCH_DATASOURCE('CdDeptInfo').then(result => { - this.dataSource.Acc_DailyAssess.DeptNo = result.data.sort((a,b)=>{return a.deptsort-b.deptsort}).map(t => ({ text: t.deptname, value: t.deptno })) - }), - this.FETCH_DATASOURCE('CdMajorInfo').then(result => { - this.dataSource.Acc_DailyAssess.MajorNo = result.data.sort((a,b)=>{return a.majorno-b.majorno}).map(t => ({ text: t.majorname, value: t.majorno })) - }), - this.FETCH_DATASOURCE('bjsj').then(result => { + // this.FETCH_DATASOURCE('CdDeptInfo').then(result => { + // this.DeptNoAll = result.data.sort((a,b)=>{return a.deptsort-b.deptsort}).map(t => ({ text: t.deptname, value: t.deptno,parentid:t.parentid,id:t.deptid })) + // this.dataSource.Acc_DailyAssess.DeptNo = result.data.sort((a,b)=>{return a.deptsort-b.deptsort}).map(t => ({ text: t.deptname, value: t.deptno })) + // }), + this.FETCH_DATASOURCE('CdMajorInfo').then(result => { + this.dataSource.Acc_DailyAssess.MajorNo = result.data.sort((a,b)=>{return a.majorno-b.majorno}).map(t => ({ text: t.majorname, value: t.majorno })) + }), + this.FETCH_DATASOURCE('bjsj').then(result => { this.dataSource.Acc_DailyAssess.ClassNo = result.data.sort((a,b)=>{return b.classno-a.classno}).map(t => ({ text: t.classname, value: t.classno })) }), - this.FETCH_DATASOURCE('Acc_DormitoryData').then(result => { - this.dataSource.Acc_DailyAssess.Dormitory = result.data.sort((a,b)=>{return a.parentid-b.parentid}).map(t => ({ text: t.name, value: t.id })) + this.FETCH_DATASOURCE('Acc_DormitoryData').then(result => { + this.dataSource.Acc_DailyAssess.Dormitory = result.data.sort((a,b)=>{return a.parentid - b.parentid}).sort((a,b)=>{return a.dno - b.dno}).map(t => ({ text: t.name, value: t.id })) }), - this.FETCH_DATASOURCE('Acc_UnitData').then(result => { - this.dataSource.Acc_DailyAssess.Unit = result.data.sort((a,b)=>{return a.parentid-b.parentid}).map(t => ({ text: t.name, value: t.id })) + this.FETCH_DATASOURCE('Acc_UnitData').then(result => { + this.UnitAll = result.data.sort((a,b)=>{return a.dno - b.dno}).map(t => ({ text: t.name, value: t.id,parentid:t.parentid })) + // this.dataSource.Acc_DailyAssess.Unit = result.data.sort((a,b)=>{return a.parentid-b.parentid}).map(t => ({ text: t.name, value: t.id })) }), - this.FETCH_DATASOURCE('Acc_FloorData').then(result => { - this.dataSource.Acc_DailyAssess.Floor = result.data.sort((a,b)=>{return a.parentid-b.parentid}).map(t => ({ text: t.name, value: t.id })) + this.FETCH_DATASOURCE('Acc_FloorData').then(result => { + this.FloorAll = result.data.sort((a,b)=>{return a.dno - b.dno}).map(t => ({ text: t.name, value: t.id,parentid:t.parentid })) + // this.dataSource.Acc_DailyAssess.Floor = result.data.sort((a,b)=>{return a.parentid-b.parentid}).map(t => ({ text: t.name, value: t.id })) }), - this.FETCH_DATASOURCE('Acc_RoomData').then(result => { - this.dataSource.Acc_DailyAssess.RId = result.data.sort((a,b)=>{return a.parentid-b.parentid}).map(t => ({ text: t.name, value: t.id })) - }), - this.FETCH_DATASOURCE('StuInfoBasic').then(result => { - this.dataSource.Acc_DailyAssess.StuNo = result.data.map(t => ({ text: t.stuname, value: t.stuno,classno:t.classno })) - this.StuNoAll = JSON.parse(JSON.stringify(this.dataSource.Acc_DailyAssess.StuNo)) + this.FETCH_DATASOURCE('Acc_RoomData').then(result => { + this.RIdAll = result.data.sort((a,b)=>{return a.dno - b.dno}).map(t => ({ text: t.name, value: t.id,parentid:t.parentid })) + // this.dataSource.Acc_DailyAssess.RId = result.data.sort((a,b)=>{return a.parentid-b.parentid}).map(t => ({ text: t.name, value: t.id })) }), + // this.FETCH_DATASOURCE('StuInfoBasic').then(result => { + // this.dataSource.Acc_DailyAssess.StuNo = result.data.map(t => ({ text: t.stuname, value: t.stuno,classno:t.classno })) + // this.StuNoAll = JSON.parse(JSON.stringify(this.dataSource.Acc_DailyAssess.StuNo)) + // }), () => {} ]) await this.fetchForm() - this.ready = true this.HIDE_LOADING() }, @@ -283,19 +300,25 @@ export default { const result = await this.HTTP_GET('learun/adms/LogisticsManagement/Acc_DailyAssess/form', this.id) this.origin = await this.formatFormData(result) } - this.current = this.COPY(this.origin) + this.current = this.COPY(this.origin) + + this.DormitoryChange(false) + this.UnitChange(false) + this.FloorChange(false) + this.RIdChange(false) - //加载附件值数据 - // console.log('附件值赋值前:'+this.getValue('Acc_DailyAssess.Files')); - if (this.getValue('Acc_DailyAssess.Files') == ""||this.getValue('Acc_DailyAssess.Files') == undefined ||this.getValue('Acc_DailyAssess.Files') == null) { - this.setValue('Acc_DailyAssess.Files',this.folderId); - // console.log('附件值赋值后:'+this.getValue('Acc_DailyAssess.Files')); - }else{ - this.folderId=this.getValue('Acc_DailyAssess.Files'); - // console.log('文件夹id赋值后:'+this.folderId); - //请求‘获取附件列表’接口 - this.fileList = await this.FETCH_FILEList(this.getValue('Acc_DailyAssess.Files')); - } + + // //加载附件值数据 + // // console.log('附件值赋值前:'+this.getValue('Acc_DailyAssess.Files')); + // if (this.getValue('Acc_DailyAssess.Files') == ""||this.getValue('Acc_DailyAssess.Files') == undefined ||this.getValue('Acc_DailyAssess.Files') == null) { + // this.setValue('Acc_DailyAssess.Files',this.folderId); + // // console.log('附件值赋值后:'+this.getValue('Acc_DailyAssess.Files')); + // }else{ + // this.folderId=this.getValue('Acc_DailyAssess.Files'); + // // console.log('文件夹id赋值后:'+this.folderId); + // //请求‘获取附件列表’接口 + // this.fileList = await this.FETCH_FILEList(this.getValue('Acc_DailyAssess.Files')); + // } // console.log('origin:'+JSON.stringify(this.origin) ) // console.log('current:'+JSON.stringify(this.current)) @@ -326,9 +349,9 @@ export default { this.LOADING('正在提交...') - const postData = await this.getPostData(this.id) - console.log('页面提交数据:'+JSON.stringify(postData)); - + let postData = await this.getPostData(this.id) + postData.strEntity = JSON.stringify({...JSON.parse(postData.strEntity),keyValue:JSON.parse(postData.strEntity).RId}) + console.log('页面提交数据:',postData,JSON.parse(postData.strEntity)); this.HTTP_POST('learun/adms/LogisticsManagement/Acc_DailyAssess/save', postData, '表单提交保存失败').then(success => { this.HIDE_LOADING() if (!success) { @@ -373,94 +396,138 @@ export default { set(this.current, path, val) }, - //多条件查询:宿舍楼改变事件 - async DormitoryChange(){ - if (this.getValue('Acc_DailyAssess.Dormitory') != null && this.getValue('Acc_DailyAssess.Dormitory') !=undefined && this.getValue('Acc_DailyAssess.Dormitory') != "") { - this.FETCH_DATASOURCE('Acc_UnitData').then(result => { - this.dataSource.Acc_DailyAssess.Unit = result.data.sort((a,b)=>{return a.dno-b.dno}).filter(t=>t.parentid===this.getValue('Acc_DailyAssess.Dormitory') ).map(t => ({ text: t.name, value: t.id })) - }) + //楼栋改变事件 + async DormitoryChange(reset=true){ + // if (this.getValue('Acc_DailyAssess.Dormitory') != null && this.getValue('Acc_DailyAssess.Dormitory') !=undefined && this.getValue('Acc_DailyAssess.Dormitory') != "") { + // this.FETCH_DATASOURCE('Acc_UnitData').then(result => { + // this.dataSource.Acc_DailyAssess.Unit = result.data.sort((a,b)=>{return a.dno-b.dno}).filter(t=>t.parentid===this.getValue('Acc_DailyAssess.Dormitory') ).map(t => ({ text: t.name, value: t.id })) + // }) + // }else{ + // this.FETCH_DATASOURCE('Acc_UnitData').then(result => { + // this.dataSource.Acc_DailyAssess.Unit = result.data.sort((a,b)=>{return a.parentid-b.parentid}).map(t => ({ text: t.name, value: t.id })) + // }) + // } + if (this.getValue('Acc_DailyAssess.Dormitory')){ + this.dataSource.Acc_DailyAssess.Unit = this.UnitAll.filter(t=>t.parentid == this.getValue('Acc_DailyAssess.Dormitory')) }else{ - this.FETCH_DATASOURCE('Acc_UnitData').then(result => { - this.dataSource.Acc_DailyAssess.Unit = result.data.sort((a,b)=>{return a.parentid-b.parentid}).map(t => ({ text: t.name, value: t.id })) - }) + this.dataSource.Acc_DailyAssess.Unit = [] } + console.log(this.getValue('Acc_DailyAssess.Dormitory'),this.getValue('Acc_DailyAssess.Unit'),this.dataSource.Acc_DailyAssess.Unit) + if(!reset)return this.setValue('Acc_DailyAssess.Unit',''); this.setValue('Acc_DailyAssess.Floor',''); this.setValue('Acc_DailyAssess.RId',''); },//多条件查询:单元改变事件 - async UnitChange(){ - if (this.getValue('Acc_DailyAssess.Unit') != null && this.getValue('Acc_DailyAssess.Unit')!=undefined && this.getValue('Acc_DailyAssess.Unit')!= "") { - this.FETCH_DATASOURCE('Acc_FloorData').then(result => { - this.dataSource.Acc_DailyAssess.Floor = result.data.sort((a,b)=>{return a.dno-b.dno}).filter(t=>t.parentid===this.getValue('Acc_DailyAssess.Unit')).map(t => ({ text: t.name, value: t.id })) - }) + // 单元改变事件 + async UnitChange(reset=true){ + // if (this.getValue('Acc_DailyAssess.Unit') != null && this.getValue('Acc_DailyAssess.Unit')!=undefined && this.getValue('Acc_DailyAssess.Unit')!= "") { + // this.FETCH_DATASOURCE('Acc_FloorData').then(result => { + // this.dataSource.Acc_DailyAssess.Floor = result.data.sort((a,b)=>{return a.dno-b.dno}).filter(t=>t.parentid===this.getValue('Acc_DailyAssess.Unit')).map(t => ({ text: t.name, value: t.id })) + // }) + // }else{ + // this.FETCH_DATASOURCE('Acc_FloorData').then(result => { + // this.dataSource.Acc_DailyAssess.Floor = result.data.sort((a,b)=>{return a.parentid-b.parentid}).map(t => ({ text: t.name, value: t.id })) + // }) + // } + if (this.getValue('Acc_DailyAssess.Unit')){ + this.dataSource.Acc_DailyAssess.Floor = this.FloorAll.filter(t=>t.parentid == this.getValue('Acc_DailyAssess.Unit')) }else{ - this.FETCH_DATASOURCE('Acc_FloorData').then(result => { - this.dataSource.Acc_DailyAssess.Floor = result.data.sort((a,b)=>{return a.parentid-b.parentid}).map(t => ({ text: t.name, value: t.id })) - }) + this.dataSource.Acc_DailyAssess.Floor = [] } + if(!reset)return this.setValue('Acc_DailyAssess.Floor',''); this.setValue('Acc_DailyAssess.RId',''); }, - //多条件查询:楼层改变事件 - async FloorChange(){ - if (this.getValue('Acc_DailyAssess.Floor') != null && this.getValue('Acc_DailyAssess.Floor')!=undefined && this.getValue('Acc_DailyAssess.Floor') != "") { - this.FETCH_DATASOURCE('Acc_RoomData').then(result => { - this.dataSource.Acc_DailyAssess.RId = result.data.sort((a,b)=>{return a.dno-b.dno}).filter(t=>t.parentid===this.getValue('Acc_DailyAssess.Floor')).map(t => ({ text: t.name, value: t.id })) - }) + //楼层改变事件 + async FloorChange(reset=true){ + // if (this.getValue('Acc_DailyAssess.Floor') != null && this.getValue('Acc_DailyAssess.Floor')!=undefined && this.getValue('Acc_DailyAssess.Floor') != "") { + // this.FETCH_DATASOURCE('Acc_RoomData').then(result => { + // this.dataSource.Acc_DailyAssess.RId = result.data.sort((a,b)=>{return a.dno-b.dno}).filter(t=>t.parentid===this.getValue('Acc_DailyAssess.Floor')).map(t => ({ text: t.name, value: t.id })) + // }) + // }else{ + // this.FETCH_DATASOURCE('Acc_RoomData').then(result => { + // this.dataSource.Acc_DailyAssess.RId = result.data.sort((a,b)=>{return a.parentid-b.parentid}).map(t => ({ text: t.name, value: t.id })) + // }) + // } + if (this.getValue('Acc_DailyAssess.Floor')){ + this.dataSource.Acc_DailyAssess.RId = this.RIdAll.filter(t=>t.parentid == this.getValue('Acc_DailyAssess.Floor')) }else{ - this.FETCH_DATASOURCE('Acc_RoomData').then(result => { - this.dataSource.Acc_DailyAssess.RId = result.data.sort((a,b)=>{return a.parentid-b.parentid}).map(t => ({ text: t.name, value: t.id })) - }) + this.dataSource.Acc_DailyAssess.RId = [] } + if(!reset)return this.setValue('Acc_DailyAssess.RId',''); }, - //多条件查询:专业部改变事件 - async DeptNoChange(){ - if (this.getValue('Acc_DailyAssess.DeptNo') != null && this.getValue('Acc_DailyAssess.DeptNo')!=undefined && this.getValue('Acc_DailyAssess.DeptNo') != "") { - this.FETCH_DATASOURCE('CdMajorInfo').then(result => { - this.dataSource.Acc_DailyAssess.MajorNo = result.data.sort((a,b)=>{return a.majorno-b.majorno}).filter(t=>t.deptno===this.getValue('Acc_DailyAssess.DeptNo')).map(t => ({ text: t.majorname, value: t.majorno })) + // 宿舍改变事件 + async RIdChange(reset=true){ + // if (this.getValue('Acc_DailyAssess.RId')){ + // console.log(this.DeptNoAll,this.getValue('Acc_DailyAssess.RId')) + // this.dataSource.Acc_DailyAssess.DeptNo = this.DeptNoAll.filter(t=>t.parentid == this.getValue('Acc_DailyAssess.RId')) + // }else{ + // this.dataSource.Acc_DailyAssess.DeptNo = [] + // } + // this.setValue('Acc_DailyAssess.DeptNo',''); + if(this.getValue('Acc_DailyAssess.RId')){ + await this.HTTP_GET('/Learun/adms/LogisticsManagement/Acc_DailyAssess/getdormstu',{keyValue:this.getValue('Acc_DailyAssess.RId')}).then(success=>{ + let data = success||[] + this.dataSource.Acc_DailyAssess.StuNo = data.map(t=>{return{value:t.StudentID,text:t.StuName||''}}) }) }else{ - this.FETCH_DATASOURCE('CdMajorInfo').then(result => { - this.dataSource.Acc_DailyAssess.MajorNo = result.data.sort((a,b)=>{return a.majorno-b.majorno}).map(t => ({ text: t.majorname, value: t.majorno })) - }) + this.dataSource.Acc_DailyAssess.StuNo = [] } - this.setValue('Acc_DailyAssess.MajorNo',''); - this.setValue('Acc_DailyAssess.ClassNo',''); - this.setValue('Acc_DailyAssess.StuNo',''); - }, - //多条件查询:专业改变事件 - async MajorNoChange(){ - if (this.getValue('Acc_DailyAssess.MajorNo') != null && this.getValue('Acc_DailyAssess.MajorNo')!=undefined && this.getValue('Acc_DailyAssess.MajorNo') != "") { - this.FETCH_DATASOURCE('bjsj').then(result => { - this.dataSource.Acc_DailyAssess.ClassNo = result.data.sort((a,b)=>{return b.classno-a.classno}).filter(t=>t.majorno===this.getValue('Acc_DailyAssess.MajorNo')).map(t => ({ text: t.classname, value: t.classno })) - }) - }else{ - this.FETCH_DATASOURCE('bjsj').then(result => { - this.dataSource.Acc_DailyAssess.ClassNo = result.data.sort((a,b)=>{return b.classno-a.classno}).map(t => ({ text: t.classname, value: t.classno })) + if(!reset){ + this.show = false + setTimeout(()=>{ + this.show = true }) + return } - this.setValue('Acc_DailyAssess.ClassNo',''); this.setValue('Acc_DailyAssess.StuNo',''); }, - //多条件查询:班级改变事件 - async ClassNoChange(){ - if (!this.getValue('Acc_DailyAssess.ClassNo')) { - // this.FETCH_DATASOURCE('StuInfoBasic').then(result => { - // this.dataSource.Acc_DailyAssess.StuNo = result.data.filter(t=>t.classno===this.getValue('Acc_DailyAssess.ClassNo')).map(t => ({ text: t.stuname, value: t.stuno })) - // }) - this.dataSource.Acc_DailyAssess.StuNo = this.StuNoAll + // //多条件查询:专业部改变事件 + // async DeptNoChange(){ + // if (this.getValue('Acc_DailyAssess.DeptNo') != null && this.getValue('Acc_DailyAssess.DeptNo')!=undefined && this.getValue('Acc_DailyAssess.DeptNo') != "") { + // this.FETCH_DATASOURCE('CdMajorInfo').then(result => { + // this.dataSource.Acc_DailyAssess.MajorNo = result.data.sort((a,b)=>{return a.majorno-b.majorno}).filter(t=>t.deptno===this.getValue('Acc_DailyAssess.DeptNo')).map(t => ({ text: t.majorname, value: t.majorno })) + // }) + // }else{ + // this.FETCH_DATASOURCE('CdMajorInfo').then(result => { + // this.dataSource.Acc_DailyAssess.MajorNo = result.data.sort((a,b)=>{return a.majorno-b.majorno}).map(t => ({ text: t.majorname, value: t.majorno })) + // }) + // } + // this.setValue('Acc_DailyAssess.MajorNo',''); + // this.setValue('Acc_DailyAssess.ClassNo',''); + // this.setValue('Acc_DailyAssess.StuNo',''); + // }, + // //多条件查询:专业改变事件 + // async MajorNoChange(){ + // if (this.getValue('Acc_DailyAssess.MajorNo') != null && this.getValue('Acc_DailyAssess.MajorNo')!=undefined && this.getValue('Acc_DailyAssess.MajorNo') != "") { + // this.FETCH_DATASOURCE('bjsj').then(result => { + // this.dataSource.Acc_DailyAssess.ClassNo = result.data.sort((a,b)=>{return b.classno-a.classno}).filter(t=>t.majorno===this.getValue('Acc_DailyAssess.MajorNo')).map(t => ({ text: t.classname, value: t.classno })) + // }) + // }else{ + // this.FETCH_DATASOURCE('bjsj').then(result => { + // this.dataSource.Acc_DailyAssess.ClassNo = result.data.sort((a,b)=>{return b.classno-a.classno}).map(t => ({ text: t.classname, value: t.classno })) + // }) + // } + // this.setValue('Acc_DailyAssess.ClassNo',''); + // this.setValue('Acc_DailyAssess.StuNo',''); + // }, + // //多条件查询:班级改变事件 + // async ClassNoChange(){ + // if (!this.getValue('Acc_DailyAssess.ClassNo')) { + // // this.FETCH_DATASOURCE('StuInfoBasic').then(result => { + // // this.dataSource.Acc_DailyAssess.StuNo = result.data.filter(t=>t.classno===this.getValue('Acc_DailyAssess.ClassNo')).map(t => ({ text: t.stuname, value: t.stuno })) + // // }) + // this.dataSource.Acc_DailyAssess.StuNo = this.StuNoAll - }else{ - // this.FETCH_DATASOURCE('StuInfoBasic').then(result => { - // this.dataSource.Acc_DailyAssess.StuNo = result.data.map(t => ({ text: t.stuname, value: t.stuno })) - // }) - this.dataSource.Acc_DailyAssess.StuNo = this.StuNoAll.filter(t=>t.classno == this.getValue('Acc_DailyAssess.ClassNo')) - } - this.setValue('Acc_DailyAssess.StuNo',''); - }, - - + // }else{ + // // this.FETCH_DATASOURCE('StuInfoBasic').then(result => { + // // this.dataSource.Acc_DailyAssess.StuNo = result.data.map(t => ({ text: t.stuname, value: t.stuno })) + // // }) + // this.dataSource.Acc_DailyAssess.StuNo = this.StuNoAll.filter(t=>t.classno == this.getValue('Acc_DailyAssess.ClassNo')) + // } + // this.setValue('Acc_DailyAssess.StuNo',''); + // }, } } \ No newline at end of file