Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 
 
 

374 rader
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 = res.StuInfoFreshEntity.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. }else{
  166. this.queryData.Photo = ""
  167. }
  168. this.HTTP_GET('StuInfoFresh/saveStuInfoFresh', this.queryData).then(res => {
  169. this.HIDE_LOADING();
  170. if (res) {
  171. this.TOAST('保存成功');
  172. }
  173. });
  174. },
  175. add(str) {
  176. let jsons = this.COPY(this[str]);
  177. this.queryData[str].push(jsons)
  178. // console.log(this.queryData[str])
  179. },
  180. del(str, num) {
  181. this.queryData[str].splice(num, 1)
  182. },
  183. refreshComponent(){
  184. // this.uploadVisiable = false
  185. this.$nextTick(()=>{
  186. this.uploadVisiable = true
  187. })
  188. },
  189. // 显示列表中的标题项
  190. displayListItem(item, field) {
  191. const fieldItem = this.scheme[field];
  192. const value = item[field];
  193. // console.log(Object.values(this.GET_GLOBAL('dataDictionary').usersex));
  194. switch (fieldItem.type) {
  195. case 'currentInfo':
  196. case 'organize':
  197. return fieldItem.dataType === 'time' ? value : get(this.GET_GLOBAL(fieldItem.dataType), `${value}.name`, '');
  198. case 'dataItem':
  199. const sex = this.dataSource[field].find(t => t.value === String(value));
  200. return get(sex, 'text', '');
  201. case 'sourceData':
  202. const BCdPartyFace = this.dataSource[field].find(t => t.value === String(value));
  203. return get(BCdPartyFace, 'text', '');
  204. case 'radio':
  205. case 'select':
  206. const selectItem = this.dataSource[field].find(t => t.value === String(value));
  207. return get(selectItem, 'text', '');
  208. case 'checkbox':
  209. if (!value || value.split(',').length <= 0) {
  210. return '';
  211. }
  212. const checkboxItems = value.split(',');
  213. return this.dataSource[field]
  214. .filter(t => checkboxItems.includes(t.value))
  215. .map(t => t.text)
  216. .join(',');
  217. case 'datetime':
  218. if (!value) {
  219. return '';
  220. }
  221. return moment(value).format(Number(fieldItem.dateformat) === 0 ? 'YYYY年 M月 D日' : 'YYYY-MM-DD HH:mm');
  222. default:
  223. return value === null || value === undefined ? '' : value;
  224. }
  225. }
  226. },
  227. created() {
  228. this.userInfo = this.GET_GLOBAL('loginUser'); //获取登录信息
  229. this.init();
  230. }
  231. };
  232. </script>
  233. <style lang="less" scoped>
  234. /deep/ .cu-form-group {
  235. min-height: 40px;
  236. }
  237. .welcome {
  238. padding: 1px 0px 20px;
  239. background: #fff;
  240. }
  241. .welT {
  242. font-size: 16px;
  243. margin-bottom: 10px;
  244. line-height: 26px;
  245. padding: 0 12px;
  246. }
  247. .welT text {
  248. width: 26px;
  249. height: 26px;
  250. line-height: 24px;
  251. border: 1px solid #efefef;
  252. border-radius: 4px;
  253. float: right;
  254. text-align: center;
  255. color: #999;
  256. }
  257. .welLine {
  258. height: 1px;
  259. background: #efefef;
  260. // margin: 10px -12px;
  261. }
  262. .welInput {
  263. overflow: hidden;
  264. font-size: 14px;
  265. margin-top: 10px;
  266. }
  267. .welInput span {
  268. float: left;
  269. width: 26%;
  270. text-align: right;
  271. line-height: 30px;
  272. }
  273. .welInput input {
  274. display: block;
  275. margin-left: 28%;
  276. width: 72%;
  277. border: 1px solid #efefef;
  278. border-radius: 4px;
  279. height: 30px;
  280. line-height: 28px;
  281. padding: 0 10px;
  282. margin-bottom: 0;
  283. }
  284. .welCon {
  285. padding: 10px;
  286. border: 1px solid #efefef;
  287. margin-top: 18px;
  288. border-radius: 4px;
  289. position: relative;
  290. }
  291. .welDel {
  292. position: absolute;
  293. top: -8px;
  294. left: -8px;
  295. background: #fff;
  296. }
  297. .welDel text {
  298. text-align: center;
  299. width: 26px;
  300. height: 26px;
  301. display: block;
  302. line-height: 24px;
  303. border: 1px solid #efefef;
  304. border-radius: 50%;
  305. }
  306. .welImgAdd {
  307. text-align: center;
  308. line-height: 0;
  309. }
  310. #files {
  311. opacity: 0;
  312. -webkit-opacity: 0;
  313. z-index: 9;
  314. display: none;
  315. }
  316. #welImgBtn {
  317. display: block;
  318. width: 110px;
  319. height: 30px;
  320. text-align: center;
  321. line-height: 26px;
  322. border: 2px solid #efefef;
  323. border-radius: 4px;
  324. font-size: 14px;
  325. color: #999;
  326. margin: 10px auto;
  327. cursor: pointer;
  328. }
  329. .welImgAdd {
  330. min-height: 110px;
  331. }
  332. #PhotoImg {
  333. width: 110px;
  334. height: 110px;
  335. }
  336. .btnBox {
  337. margin-top: 20px;
  338. text-align: center;
  339. }
  340. #saveBtn {
  341. margin: auto;
  342. margin-top: 25px;
  343. width: 92%;
  344. }
  345. #StuInfoFreshFamily,#StuInfoFreshEmergePeople{
  346. padding: 0 15px;
  347. }
  348. </style>