|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369 |
- <template>
- <view class="welcome">
- <view class="welT">基本信息</view>
- <view class="welBox">
- <!-- <input type="hidden" name="ID" value="" id="ID" /> -->
- <l-input title="学号" placeholder="请填写" :value="StuInfoFreshEntity.StuNo" disabled right />
- <l-input title="准考证号" placeholder="请填写" :value="StuInfoFreshEntity.zkzh" disabled right />
- <l-input title="考生号" placeholder="请填写" :value="StuInfoFreshEntity.ksh" disabled right />
- <l-input title="姓名" placeholder="请填写" :value="StuInfoFreshEntity.StuName" disabled right />
- <l-input title="性别" placeholder="请填写" :value="displayListItem(StuInfoFreshEntity, 'GenderNo')" disabled right />
- <l-input title="系别" placeholder="请填写" :value="StuInfoFreshEntity.DeptNo" disabled right />
- <l-input title="专业" placeholder="请填写" :value="StuInfoFreshEntity.MajorNo" disabled right />
- <l-input title="班级" placeholder="请填写" :value="StuInfoFreshEntity.ClassNo" disabled right />
- <l-input title="身份证号" placeholder="请填写" :value="StuInfoFreshEntity.IdentityCardNo" disabled right />
- <l-input title="出生日期" placeholder="请填写" :value="StuInfoFreshEntity.Birthday" disabled right />
- <l-input title="户口类别" placeholder="请填写" :value="StuInfoFreshEntity.ResidenceNo" disabled right />
- <l-input title="政治面貌" placeholder="请填写" :value="displayListItem(StuInfoFreshEntity, 'PartyFaceNo')" disabled right />
- </view>
- <!-- {{ StuInfoFreshEntity.GenderNo }} -->
- <!-- <view class="welLine"></view> -->
- <view class="welT" style="padding-top: 10px;">采集照片信息</view>
- <view class="welBox">
- <input type="hidden" id="Photo" value="" />
- <input id="files" type="file" accept="image/*" />
- <view class="welImgAdd">
- <!--<view id="welImgBtn">上传照片</view>-->
- <img id="PhotoImg" :src="imgSrc" alt="" />
- </view>
- <!--<view class="welText">说明:近期两寸免冠正面彩色照小于100K</view>-->
- </view>
- <view class="welLine"></view>
- <view class="welT" style="padding-top: 10px;">自然信息</view>
- <view class="welLine"></view>
- <view class="welBox"><l-input v-model="queryData.RegionNo" title="籍贯" placeholder="请填写" right /></view>
- <view class="welT" style="padding-top: 10px;">通讯信息</view>
- <view class="welLine"></view>
- <view class="welBox">
- <l-input v-model="queryData.FamilyAddress" title="家庭住址" placeholder="请填写" right />
- <l-input v-model="queryData.telephone" title="联系电话" placeholder="请填写" right />
- </view>
- <view class="welT" style="padding-top: 10px;">
- 家庭成员(直系家属)
- <text class="text-xxl cuIcon cuIcon-add" @click="add('StuInfoFreshFamilyEntities')"></text>
- </view>
- <view class="welBox" id="StuInfoFreshFamily" v-show="queryData.StuInfoFreshFamilyEntities.length != 0">
- <view class="welCon" v-for="(item, i) in queryData.StuInfoFreshFamilyEntities" :key='i'>
- <l-input v-model="item.Name" title="姓名" placeholder="请填写" right />
- <!-- <l-input v-model="item.Relation" title="" placeholder="请填写" right /> -->
- <l-select v-model="item.Relation" :range="dataSource.FamilyRelation" title="与本人关系" placeholder="请选择" />
- <l-select v-model="item.Sex" :range="dataSource.GenderNo" title="性别" placeholder="请选择" />
- <l-input v-model="item.Age" title="年龄" placeholder="请填写" right />
- <!-- <l-input v-model="item.Politicy" title="政治面貌" placeholder="请填写" right /> -->
- <l-select v-model="item.Politicy" :range="dataSource.PartyFaceNo" title="政治面貌" placeholder="请选择" />
- <view class="welDel" @click="del('StuInfoFreshFamilyEntities', i)"><text class="text-xxl cuIcon cuIcon-move"></text></view>
- </view>
- </view>
- <view class="welT" style="padding-top: 10px;">
- 紧急联系人
- <text class="text-xxl cuIcon cuIcon-add" @click="add('StuInfoFreshEmergePeopleEntities')"></text>
- </view>
- <view class="welBox" id="StuInfoFreshEmergePeople" v-show="queryData.StuInfoFreshEmergePeopleEntities.length != 0">
- <view class="welCon" v-for="(item, i) in queryData.StuInfoFreshEmergePeopleEntities" :key='i'>
- <l-input v-model="item.Name" title="姓名" placeholder="请填写" right />
- <l-input v-model="item.Relation" title="与本人关系" placeholder="请填写" right />
- <l-input v-model="item.Telephone" title="手机号码" placeholder="请填写" right />
- <l-input v-model="item.Mobile" title="座机号码" placeholder="请填写" right />
- <l-input v-model="item.Address" title="联系地址" placeholder="请填写" right />
- <view class="welDel" @click="del('StuInfoFreshEmergePeopleEntities', i)"><text class="text-xxl cuIcon cuIcon-move"></text></view>
- </view>
- </view>
- <view class="btn" @click="tapBtn">报到</view>
- </view>
- </template>
-
- <script>
- import moment from 'moment';
- import get from 'lodash/get';
- import set from 'lodash/set';
- import todayTime from '@/common/js/todayTime.js';
- export default {
- data() {
- return {
- pageInfo: '',
- imgSrc: '',
- scheme: {
- PartyFaceNo: {
- type: 'sourceData',
- dataSource: '1',
- dataSourceId: 'BCdPartyFace,partyface,partyfaceno'
- },
- GenderNo:{
- type: 'dataItem',
- dataType: 'dataDictionary'
- }
- },
- userInfo: {},
- dataSource:{
- GenderNo: Object.values(this.GET_GLOBAL('dataDictionary').usersex).map(t => ({ value: t.value, text: t.text })),
- FamilyRelation: Object.values(this.GET_GLOBAL('dataDictionary').FamilyRelation).map(t => ({ value: t.value, text: t.text })),
- PartyFaceNo:[]
- },
- StuInfoFreshFamilyEntities:{
- Name: '',
- Age: '',
- Sex: '1',
- Politicy: '01',
- Relation: '01'
- },
- StuInfoFreshEmergePeopleEntities:{
- Name: '',
- Relation: '',
- Telephone: '',
- Mobile: '',
- Address: ''
- },
- ID: '',
- queryData:{
- RegisterStatus: '1',
- ArriveDate: '',
- RegionNo: '',
- FamilyAddress: '',
- telephone: '',
- Photo: '',
- StuInfoFreshFamilyEntities:[],
- StuInfoFreshEmergePeopleEntities: []
- },
- StuInfoFreshEntity:{
-
- }
- };
- },
- methods: {
- init() {
- // console.log(this.API)
- let _this = this;
- Promise.all([
- this.FETCH_DATASOURCE('BCdPartyFace').then(data => {
- // console.log(data)
- this.dataSource.PartyFaceNo = data.data.map(t => ({
- text: t.partyface,
- value: t.partyfaceno
- }));
- }),
-
- () => {}
- ]);
- _this.LOADING('加载数据…');
- _this.pageInfo = _this.GET_PARAM(); //获取页面传递参数
- _this.HTTP_GET('StuInfoFresh/stuInfoFreshEntity', _this.pageInfo.StuNo, '加载数据时出错').then(res => {
- this.HIDE_LOADING();
- // console.log(res);
- _this.StuInfoFreshEntity = _this.COPY(res.StuInfoFreshEntity);
- _this.queryData.StuInfoFreshFamilyEntities = _this.COPY(res.StuInfoFreshFamilyList);
- _this.queryData.StuInfoFreshEmergePeopleEntities = _this.COPY(res.StuInfoFreshEmergePeopleList);
- _this.ID = res.StuInfoFreshEntity.ID;
- _this.queryData.Photo = res.StuInfoFreshEntity.Photo;
- _this.queryData.telephone = res.StuInfoFreshEntity.telephone;
- _this.queryData.FamilyAddress = res.StuInfoFreshEntity.FamilyAddress;
- _this.queryData.RegionNo = res.StuInfoFreshEntity.RegionNo;
- _this.imgSrc = this.API.slice(0,-1) + res.Url;
- });
- },
- tapBtn() {
- console.log(this.queryData)
- this.queryData.ArriveDate = todayTime.fmtDate().ymdhMins;
- let _postData = {
- keyValue: this.ID,
- strEntity: JSON.stringify(this.queryData)
- }
- this.LOADING('正在提交数据…');
- this.HTTP_POST('StuInfoFresh/save', _postData, '加载数据时出错').then(res => {
- this.HIDE_LOADING();
- console.log(res);
- if (res) {
- this.TOAST('保存成功');
- this.NAV_BACK()
- }
- });
- },
- add(str) {
- let jsons = this.COPY(this[str]);
- this.queryData[str].push(jsons)
- // console.log(this.queryData[str])
- },
- del(str, num) {
- this.queryData[str].splice(num, 1)
- },
-
- // 显示列表中的标题项
- displayListItem(item, field) {
- const fieldItem = this.scheme[field];
- const value = item[field];
- // console.log(Object.values(this.GET_GLOBAL('dataDictionary').usersex));
-
- switch (fieldItem.type) {
- case 'currentInfo':
- case 'organize':
- return fieldItem.dataType === 'time' ? value : get(this.GET_GLOBAL(fieldItem.dataType), `${value}.name`, '');
-
- case 'dataItem':
- const sex = this.dataSource[field].find(t => t.value === String(value));
- return get(sex, 'text', '');
-
- case 'sourceData':
- const BCdPartyFace = this.dataSource[field].find(t => t.value === String(value));
- return get(BCdPartyFace, 'text', '');
-
- case 'radio':
- case 'select':
- const selectItem = this.dataSource[field].find(t => t.value === String(value));
- return get(selectItem, 'text', '');
-
- case 'checkbox':
- if (!value || value.split(',').length <= 0) {
- return '';
- }
- const checkboxItems = value.split(',');
- return this.dataSource[field]
- .filter(t => checkboxItems.includes(t.value))
- .map(t => t.text)
- .join(',');
-
- case 'datetime':
- if (!value) {
- return '';
- }
- return moment(value).format(Number(fieldItem.dateformat) === 0 ? 'YYYY年 M月 D日' : 'YYYY-MM-DD HH:mm');
-
- default:
- return value === null || value === undefined ? '' : value;
- }
- }
- },
- created() {
- this.userInfo = this.GET_GLOBAL('loginUser'); //获取登录信息
- this.init();
- }
- };
- </script>
-
- <style lang="less" scoped>
- /deep/ .cu-form-group {
- min-height: 40px;
- }
- .welcome {
- padding: 1px 0px 20px;
- background: #fff;
- }
-
- .welT {
- font-size: 16px;
- margin-bottom: 10px;
- line-height: 26px;
- padding: 0 12px;
- }
-
- .welT text {
- width: 26px;
- height: 26px;
- line-height: 24px;
- border: 1px solid #efefef;
- border-radius: 4px;
- float: right;
- text-align: center;
- color: #999;
- }
-
- .welLine {
- height: 1px;
- background: #efefef;
- // margin: 10px -12px;
- }
-
- .welInput {
- overflow: hidden;
- font-size: 14px;
- margin-top: 10px;
- }
-
- .welInput span {
- float: left;
- width: 26%;
- text-align: right;
- line-height: 30px;
- }
-
- .welInput input {
- display: block;
- margin-left: 28%;
- width: 72%;
- border: 1px solid #efefef;
- border-radius: 4px;
- height: 30px;
- line-height: 28px;
- padding: 0 10px;
- margin-bottom: 0;
- }
-
- .welCon {
- padding: 10px;
- border: 1px solid #efefef;
- margin-top: 18px;
- border-radius: 4px;
- position: relative;
- }
-
- .welDel {
- position: absolute;
- top: -8px;
- left: -8px;
- background: #fff;
- }
-
- .welDel text {
- text-align: center;
- width: 26px;
- height: 26px;
- display: block;
- line-height: 24px;
- border: 1px solid #efefef;
- border-radius: 50%;
- }
-
- .welImgAdd {
- text-align: center;
- line-height: 0;
- }
-
- #files {
- opacity: 0;
- -webkit-opacity: 0;
- z-index: 9;
- display: none;
- }
-
- #welImgBtn {
- display: block;
- width: 110px;
- height: 30px;
- text-align: center;
- line-height: 26px;
- border: 2px solid #efefef;
- border-radius: 4px;
- font-size: 14px;
- color: #999;
- margin: 10px auto;
- cursor: pointer;
- }
- .welImgAdd {
- min-height: 110px;
- }
- #PhotoImg {
- width: 110px;
- height: 110px;
- }
-
- .btnBox {
- margin-top: 20px;
- text-align: center;
- }
- #saveBtn {
- margin: auto;
- margin-top: 25px;
- width: 92%;
- }
- #StuInfoFreshFamily,#StuInfoFreshEmergePeople{
- padding: 0 15px;
- }
- </style>
|