You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

372 lines
11 KiB

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