Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

4 лет назад
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369
  1. <template>
  2. <view class="welcome">
  3. <view class="welT">基本信息</view>
  4. <view class="welBox">
  5. <!-- <input type="hidden" name="ID" value="" id="ID" /> -->
  6. <l-input title="学号" placeholder="请填写" :value="StuInfoFreshEntity.StuNo" disabled right />
  7. <l-input title="准考证号" placeholder="请填写" :value="StuInfoFreshEntity.zkzh" disabled right />
  8. <l-input title="考生号" placeholder="请填写" :value="StuInfoFreshEntity.ksh" disabled right />
  9. <l-input title="姓名" placeholder="请填写" :value="StuInfoFreshEntity.StuName" disabled right />
  10. <l-input title="性别" placeholder="请填写" :value="displayListItem(StuInfoFreshEntity, 'GenderNo')" disabled right />
  11. <l-input title="系别" placeholder="请填写" :value="StuInfoFreshEntity.DeptNo" disabled right />
  12. <l-input title="专业" placeholder="请填写" :value="StuInfoFreshEntity.MajorNo" disabled right />
  13. <l-input title="班级" placeholder="请填写" :value="StuInfoFreshEntity.ClassNo" disabled right />
  14. <l-input title="身份证号" placeholder="请填写" :value="StuInfoFreshEntity.IdentityCardNo" disabled right />
  15. <l-input title="出生日期" placeholder="请填写" :value="StuInfoFreshEntity.Birthday" disabled right />
  16. <l-input title="户口类别" placeholder="请填写" :value="StuInfoFreshEntity.ResidenceNo" disabled right />
  17. <l-input title="政治面貌" placeholder="请填写" :value="displayListItem(StuInfoFreshEntity, 'PartyFaceNo')" disabled right />
  18. </view>
  19. <!-- {{ StuInfoFreshEntity.GenderNo }} -->
  20. <!-- <view class="welLine"></view> -->
  21. <view class="welT" style="padding-top: 10px;">采集照片信息</view>
  22. <view class="welBox">
  23. <input type="hidden" id="Photo" value="" />
  24. <input id="files" type="file" accept="image/*" />
  25. <view class="welImgAdd">
  26. <!--<view id="welImgBtn">上传照片</view>-->
  27. <img id="PhotoImg" :src="imgSrc" alt="" />
  28. </view>
  29. <!--<view class="welText">说明:近期两寸免冠正面彩色照小于100K</view>-->
  30. </view>
  31. <view class="welLine"></view>
  32. <view class="welT" style="padding-top: 10px;">自然信息</view>
  33. <view class="welLine"></view>
  34. <view class="welBox"><l-input v-model="queryData.RegionNo" title="籍贯" placeholder="请填写" right /></view>
  35. <view class="welT" style="padding-top: 10px;">通讯信息</view>
  36. <view class="welLine"></view>
  37. <view class="welBox">
  38. <l-input v-model="queryData.FamilyAddress" title="家庭住址" placeholder="请填写" right />
  39. <l-input v-model="queryData.telephone" title="联系电话" placeholder="请填写" right />
  40. </view>
  41. <view class="welT" style="padding-top: 10px;">
  42. 家庭成员(直系家属)
  43. <text class="text-xxl cuIcon cuIcon-add" @click="add('StuInfoFreshFamilyEntities')"></text>
  44. </view>
  45. <view class="welBox" id="StuInfoFreshFamily" v-show="queryData.StuInfoFreshFamilyEntities.length != 0">
  46. <view class="welCon" v-for="(item, i) in queryData.StuInfoFreshFamilyEntities" :key='i'>
  47. <l-input v-model="item.Name" title="姓名" placeholder="请填写" right />
  48. <!-- <l-input v-model="item.Relation" title="" placeholder="请填写" right /> -->
  49. <l-select v-model="item.Relation" :range="dataSource.FamilyRelation" title="与本人关系" placeholder="请选择" />
  50. <l-select v-model="item.Sex" :range="dataSource.GenderNo" title="性别" placeholder="请选择" />
  51. <l-input v-model="item.Age" title="年龄" placeholder="请填写" right />
  52. <!-- <l-input v-model="item.Politicy" title="政治面貌" placeholder="请填写" right /> -->
  53. <l-select v-model="item.Politicy" :range="dataSource.PartyFaceNo" title="政治面貌" placeholder="请选择" />
  54. <view class="welDel" @click="del('StuInfoFreshFamilyEntities', i)"><text class="text-xxl cuIcon cuIcon-move"></text></view>
  55. </view>
  56. </view>
  57. <view class="welT" style="padding-top: 10px;">
  58. 紧急联系人
  59. <text class="text-xxl cuIcon cuIcon-add" @click="add('StuInfoFreshEmergePeopleEntities')"></text>
  60. </view>
  61. <view class="welBox" id="StuInfoFreshEmergePeople" v-show="queryData.StuInfoFreshEmergePeopleEntities.length != 0">
  62. <view class="welCon" v-for="(item, i) in queryData.StuInfoFreshEmergePeopleEntities" :key='i'>
  63. <l-input v-model="item.Name" title="姓名" placeholder="请填写" right />
  64. <l-input v-model="item.Relation" title="与本人关系" placeholder="请填写" right />
  65. <l-input v-model="item.Telephone" title="手机号码" placeholder="请填写" right />
  66. <l-input v-model="item.Mobile" title="座机号码" placeholder="请填写" right />
  67. <l-input v-model="item.Address" title="联系地址" placeholder="请填写" right />
  68. <view class="welDel" @click="del('StuInfoFreshEmergePeopleEntities', i)"><text class="text-xxl cuIcon cuIcon-move"></text></view>
  69. </view>
  70. </view>
  71. <view class="btn" @click="tapBtn">报到</view>
  72. </view>
  73. </template>
  74. <script>
  75. import moment from 'moment';
  76. import get from 'lodash/get';
  77. import set from 'lodash/set';
  78. import todayTime from '@/common/js/todayTime.js';
  79. export default {
  80. data() {
  81. return {
  82. pageInfo: '',
  83. imgSrc: '',
  84. scheme: {
  85. PartyFaceNo: {
  86. type: 'sourceData',
  87. dataSource: '1',
  88. dataSourceId: 'BCdPartyFace,partyface,partyfaceno'
  89. },
  90. GenderNo:{
  91. type: 'dataItem',
  92. dataType: 'dataDictionary'
  93. }
  94. },
  95. userInfo: {},
  96. dataSource:{
  97. GenderNo: Object.values(this.GET_GLOBAL('dataDictionary').usersex).map(t => ({ value: t.value, text: t.text })),
  98. FamilyRelation: Object.values(this.GET_GLOBAL('dataDictionary').FamilyRelation).map(t => ({ value: t.value, text: t.text })),
  99. PartyFaceNo:[]
  100. },
  101. StuInfoFreshFamilyEntities:{
  102. Name: '',
  103. Age: '',
  104. Sex: '1',
  105. Politicy: '01',
  106. Relation: '01'
  107. },
  108. StuInfoFreshEmergePeopleEntities:{
  109. Name: '',
  110. Relation: '',
  111. Telephone: '',
  112. Mobile: '',
  113. Address: ''
  114. },
  115. ID: '',
  116. queryData:{
  117. RegisterStatus: '1',
  118. ArriveDate: '',
  119. RegionNo: '',
  120. FamilyAddress: '',
  121. telephone: '',
  122. Photo: '',
  123. StuInfoFreshFamilyEntities:[],
  124. StuInfoFreshEmergePeopleEntities: []
  125. },
  126. StuInfoFreshEntity:{
  127. }
  128. };
  129. },
  130. methods: {
  131. init() {
  132. // console.log(this.API)
  133. let _this = this;
  134. Promise.all([
  135. this.FETCH_DATASOURCE('BCdPartyFace').then(data => {
  136. // console.log(data)
  137. this.dataSource.PartyFaceNo = data.data.map(t => ({
  138. text: t.partyface,
  139. value: t.partyfaceno
  140. }));
  141. }),
  142. () => {}
  143. ]);
  144. _this.LOADING('加载数据…');
  145. _this.pageInfo = _this.GET_PARAM(); //获取页面传递参数
  146. _this.HTTP_GET('StuInfoFresh/stuInfoFreshEntity', _this.pageInfo.StuNo, '加载数据时出错').then(res => {
  147. this.HIDE_LOADING();
  148. // console.log(res);
  149. _this.StuInfoFreshEntity = _this.COPY(res.StuInfoFreshEntity);
  150. _this.queryData.StuInfoFreshFamilyEntities = _this.COPY(res.StuInfoFreshFamilyList);
  151. _this.queryData.StuInfoFreshEmergePeopleEntities = _this.COPY(res.StuInfoFreshEmergePeopleList);
  152. _this.ID = res.StuInfoFreshEntity.ID;
  153. _this.queryData.Photo = res.StuInfoFreshEntity.Photo;
  154. _this.queryData.telephone = res.StuInfoFreshEntity.telephone;
  155. _this.queryData.FamilyAddress = res.StuInfoFreshEntity.FamilyAddress;
  156. _this.queryData.RegionNo = res.StuInfoFreshEntity.RegionNo;
  157. _this.imgSrc = this.API.slice(0,-1) + res.Url;
  158. });
  159. },
  160. tapBtn() {
  161. console.log(this.queryData)
  162. this.queryData.ArriveDate = todayTime.fmtDate().ymdhMins;
  163. let _postData = {
  164. keyValue: this.ID,
  165. strEntity: JSON.stringify(this.queryData)
  166. }
  167. this.LOADING('正在提交数据…');
  168. this.HTTP_POST('StuInfoFresh/save', _postData, '加载数据时出错').then(res => {
  169. this.HIDE_LOADING();
  170. console.log(res);
  171. if (res) {
  172. this.TOAST('保存成功');
  173. this.NAV_BACK()
  174. }
  175. });
  176. },
  177. add(str) {
  178. let jsons = this.COPY(this[str]);
  179. this.queryData[str].push(jsons)
  180. // console.log(this.queryData[str])
  181. },
  182. del(str, num) {
  183. this.queryData[str].splice(num, 1)
  184. },
  185. // 显示列表中的标题项
  186. displayListItem(item, field) {
  187. const fieldItem = this.scheme[field];
  188. const value = item[field];
  189. // console.log(Object.values(this.GET_GLOBAL('dataDictionary').usersex));
  190. switch (fieldItem.type) {
  191. case 'currentInfo':
  192. case 'organize':
  193. return fieldItem.dataType === 'time' ? value : get(this.GET_GLOBAL(fieldItem.dataType), `${value}.name`, '');
  194. case 'dataItem':
  195. const sex = this.dataSource[field].find(t => t.value === String(value));
  196. return get(sex, 'text', '');
  197. case 'sourceData':
  198. const BCdPartyFace = this.dataSource[field].find(t => t.value === String(value));
  199. return get(BCdPartyFace, 'text', '');
  200. case 'radio':
  201. case 'select':
  202. const selectItem = this.dataSource[field].find(t => t.value === String(value));
  203. return get(selectItem, 'text', '');
  204. case 'checkbox':
  205. if (!value || value.split(',').length <= 0) {
  206. return '';
  207. }
  208. const checkboxItems = value.split(',');
  209. return this.dataSource[field]
  210. .filter(t => checkboxItems.includes(t.value))
  211. .map(t => t.text)
  212. .join(',');
  213. case 'datetime':
  214. if (!value) {
  215. return '';
  216. }
  217. return moment(value).format(Number(fieldItem.dateformat) === 0 ? 'YYYY年 M月 D日' : 'YYYY-MM-DD HH:mm');
  218. default:
  219. return value === null || value === undefined ? '' : value;
  220. }
  221. }
  222. },
  223. created() {
  224. this.userInfo = this.GET_GLOBAL('loginUser'); //获取登录信息
  225. this.init();
  226. }
  227. };
  228. </script>
  229. <style lang="less" scoped>
  230. /deep/ .cu-form-group {
  231. min-height: 40px;
  232. }
  233. .welcome {
  234. padding: 1px 0px 20px;
  235. background: #fff;
  236. }
  237. .welT {
  238. font-size: 16px;
  239. margin-bottom: 10px;
  240. line-height: 26px;
  241. padding: 0 12px;
  242. }
  243. .welT text {
  244. width: 26px;
  245. height: 26px;
  246. line-height: 24px;
  247. border: 1px solid #efefef;
  248. border-radius: 4px;
  249. float: right;
  250. text-align: center;
  251. color: #999;
  252. }
  253. .welLine {
  254. height: 1px;
  255. background: #efefef;
  256. // margin: 10px -12px;
  257. }
  258. .welInput {
  259. overflow: hidden;
  260. font-size: 14px;
  261. margin-top: 10px;
  262. }
  263. .welInput span {
  264. float: left;
  265. width: 26%;
  266. text-align: right;
  267. line-height: 30px;
  268. }
  269. .welInput input {
  270. display: block;
  271. margin-left: 28%;
  272. width: 72%;
  273. border: 1px solid #efefef;
  274. border-radius: 4px;
  275. height: 30px;
  276. line-height: 28px;
  277. padding: 0 10px;
  278. margin-bottom: 0;
  279. }
  280. .welCon {
  281. padding: 10px;
  282. border: 1px solid #efefef;
  283. margin-top: 18px;
  284. border-radius: 4px;
  285. position: relative;
  286. }
  287. .welDel {
  288. position: absolute;
  289. top: -8px;
  290. left: -8px;
  291. background: #fff;
  292. }
  293. .welDel text {
  294. text-align: center;
  295. width: 26px;
  296. height: 26px;
  297. display: block;
  298. line-height: 24px;
  299. border: 1px solid #efefef;
  300. border-radius: 50%;
  301. }
  302. .welImgAdd {
  303. text-align: center;
  304. line-height: 0;
  305. }
  306. #files {
  307. opacity: 0;
  308. -webkit-opacity: 0;
  309. z-index: 9;
  310. display: none;
  311. }
  312. #welImgBtn {
  313. display: block;
  314. width: 110px;
  315. height: 30px;
  316. text-align: center;
  317. line-height: 26px;
  318. border: 2px solid #efefef;
  319. border-radius: 4px;
  320. font-size: 14px;
  321. color: #999;
  322. margin: 10px auto;
  323. cursor: pointer;
  324. }
  325. .welImgAdd {
  326. min-height: 110px;
  327. }
  328. #PhotoImg {
  329. width: 110px;
  330. height: 110px;
  331. }
  332. .btnBox {
  333. margin-top: 20px;
  334. text-align: center;
  335. }
  336. #saveBtn {
  337. margin: auto;
  338. margin-top: 25px;
  339. width: 92%;
  340. }
  341. #StuInfoFreshFamily,#StuInfoFreshEmergePeople{
  342. padding: 0 15px;
  343. }
  344. </style>