userDetails.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. <template>
  2. <view class="details">
  3. <nav>
  4. <view class="pull-down">
  5. <!-- <u-icon @click="$goBack(1, 1)" name="arrow-leftward" size="20" color="#fff"></u-icon> -->
  6. <uni-icons @click="$goBack(1, 1)" type="arrow-left" size="30" color="#fff"></uni-icons>
  7. <text class="text">青田干部信息管理系统</text>
  8. </view>
  9. </nav>
  10. <view class="tableBox">
  11. <table cellspacing="0" cellpadding="0" bordercolor="black">
  12. <tr>
  13. <td class="title">姓 名</td>
  14. <td>{{data.S_Name}}</td>
  15. <td class="title">性 别</td>
  16. <td>{{data.S_Sex}}</td>
  17. <td class="title">出生年月<br />(岁)</td>
  18. <td>{{data.S_BirthDate}}<br />({{getAge(data.S_BirthDate)}}岁)</td>
  19. <td rowspan="4">
  20. <image class="img" :src="data.txSrc" mode="widthFix"></image>
  21. </td>
  22. </tr>
  23. <tr>
  24. <td class="title">民 族</td>
  25. <td>{{data.S_Nation}}</td>
  26. <td class="title">籍 贯</td>
  27. <td>{{data.S_NativePlace}}</td>
  28. <td class="title">出生地</td>
  29. <td>{{data.S_Birthplace}}</td>
  30. </tr>
  31. <tr>
  32. <td class="title">入 党<br />时 间</td>
  33. <td>{{data.S_JoinPartyTime}}</td>
  34. <td class="title">参加工<br />作时间</td>
  35. <td>{{data.S_WorkDate}}</td>
  36. <td class="title">健康状况</td>
  37. <td>{{data.S_Health}}</td>
  38. </tr>
  39. <tr>
  40. <td class="title">专业技<br />术职务</td>
  41. <td colspan="2">{{data.S_Profession}}</td>
  42. <td class="title">熟悉专业<br />有何特长</td>
  43. <td colspan="2">{{data.S_Speciality}}</td>
  44. </tr>
  45. <tr>
  46. <td class="title" rowspan="2">学 历<br />学 位</td>
  47. <td class="title">全日制<br />教 育</td>
  48. <td colspan="2">{{data.S_FullTimeEducation}}<br />{{data.S_FullTimeDegree}}</td>
  49. <td class="title">毕业院校<br />系及专业</td>
  50. <td colspan="2">{{data.S_FullTimeSchool}}<br />{{data.S_FullTimeAcademy}}</td>
  51. </tr>
  52. <tr>
  53. <td class="title">在 职<br />教 育</td>
  54. <td colspan="2">{{data.S_MaxEdu}}<br />{{data.S_MaxDeg}}</td>
  55. <td class="title">毕业院校<br />系及专业</td>
  56. <td colspan="2">{{data.S_JobSchool}}<br />{{data.S_JobAcademy}}</td>
  57. </tr>
  58. <tr>
  59. <td class="title" colspan="2">现任职务</td>
  60. <td colspan="5" class="left">{{data.S_FullPost}}</td>
  61. </tr>
  62. <tr>
  63. <td class="title">简<br />历</td>
  64. <td colspan="6" class="left">
  65. <view class="li" v-for="(v,i) in data.S_Resume" :key="i">
  66. <view class="time">{{v.a}}</view>
  67. <view>{{v.b}}</view>
  68. </view>
  69. </td>
  70. </tr>
  71. <tr>
  72. <td class="title">奖 惩<br />情 况</td>
  73. <td colspan="6" class="left" style="line-height: 60rpx;">{{data.S_Rewards}}</td>
  74. </tr>
  75. <tr>
  76. <td class="title">年 度<br />考 核<br />结 果</td>
  77. <td colspan="6">{{data.S_Assess}}</td>
  78. </tr>
  79. <tr>
  80. <td class="title" rowspan="12">家 庭<br />主 要<br />成 员<br />及<br />重 要<br />社 会<br />关 系</td>
  81. <td class="title">称谓</td>
  82. <td class="title">姓名</td>
  83. <td class="title">出生年月</td>
  84. <td class="title">政治面貌</td>
  85. <td class="title" colspan="2">工作单位及职务</td>
  86. </tr>
  87. <tr v-for="(v,i) in relation" :key="i">
  88. <td>{{v.F_Relation}}</td>
  89. <td>{{v.F_Name}}</td>
  90. <td>{{v.F_BirthDate}}</td>
  91. <td>{{v.F_PoliticsStatus}}</td>
  92. <td colspan="2">{{v.F_UnitAndPost}}</td>
  93. </tr>
  94. </table>
  95. </view>
  96. </view>
  97. </template>
  98. <script>
  99. import sqlLite from '../../utils/sqllite-utils.js';
  100. export default {
  101. data() {
  102. return {
  103. data: {},
  104. // 家属
  105. relationAll: [],
  106. // 当前家属
  107. relation: []
  108. };
  109. },
  110. created() {
  111. // this.relationAll = res
  112. uni.getStorage({
  113. key: 'det',
  114. success: (res) => {
  115. res.data.S_Resume = this.f4(res.data.S_Resume)
  116. this.data = res.data
  117. this.getRelationData()
  118. // -------------------------------
  119. // this.getRelation()
  120. uni.removeStorage({
  121. key: 'det',
  122. });
  123. }
  124. });
  125. },
  126. methods: {
  127. // 年龄
  128. getAge(val) {
  129. if (val) {
  130. let currentYear = new Date().getFullYear() //当前的年份
  131. let calculationYear = new Date(val).getFullYear() //计算的年份
  132. const wholeTime = currentYear + val.substring(4) //周岁时间
  133. const calculationAge = currentYear - calculationYear //按照年份计算的年龄
  134. //判断是否过了生日
  135. if (new Date().getTime() > new Date(wholeTime).getTime()) {
  136. return calculationAge
  137. } else {
  138. return calculationAge - 1
  139. }
  140. } else {
  141. return ''
  142. }
  143. },
  144. // 获取家属
  145. getRelationData() {
  146. sqlLite.selectFromTable(
  147. 'SELECT F_Name,F_Relation,F_BirthDate,F_PoliticsStatus,F_UnitAndPost FROM Biz_Family WHERE StaffId = ' +
  148. this.data.StaffId + ' ORDER BY F_Order ASC'
  149. ).then((date) => {
  150. this.relation = date
  151. })
  152. .catch((e) => {
  153. uni.showToast({
  154. title: '查询失败',
  155. icon: 'none'
  156. })
  157. })
  158. },
  159. // 获取当前家属
  160. getRelation() {
  161. this.relation = this.relationAll.filter(v => {
  162. return v.StaffId == this.data.StaffId
  163. })
  164. },
  165. f4(data) {
  166. let arr = data.split("\r\n");
  167. let strArr = [];
  168. arr.forEach((v, i) => {
  169. strArr[i] = {
  170. a: v.slice(0, 16),
  171. b: v.slice(16)
  172. }
  173. })
  174. return strArr
  175. // console.log(strArr);
  176. }
  177. }
  178. }
  179. </script>
  180. <style lang="scss" scoped>
  181. .details {
  182. width: 100%;
  183. height: 100%;
  184. nav {
  185. width: 100%;
  186. height: 10%;
  187. background-color: #6dbeeb;
  188. color: #fff;
  189. padding: 0 40rpx;
  190. display: flex;
  191. justify-content: space-between;
  192. align-items: center;
  193. .pull-down {
  194. font-size: 30rpx;
  195. display: flex;
  196. align-items: center;
  197. .text {
  198. margin-left: 40rpx;
  199. font-size: 36rpx;
  200. }
  201. }
  202. }
  203. }
  204. .tableBox {
  205. padding: 20rpx;
  206. // margin: 30rpx;
  207. // border: 1px solid #707070;
  208. height: 90%;
  209. overflow-y: scroll;
  210. }
  211. table {
  212. width: 100%;
  213. border: 1px solid #707070;
  214. table-layout: fixed;
  215. tr {
  216. td {
  217. border: 1px solid #cacaca;
  218. width: 14%;
  219. height: 80rpx;
  220. text-align: center;
  221. font-size: 38rpx;
  222. white-space: pre-line;
  223. .img {
  224. width: 90%;
  225. height: 75%;
  226. }
  227. }
  228. .left {
  229. text-align: left;
  230. padding: 20rpx;
  231. overflow: hidden;
  232. .li {
  233. display: flex;
  234. line-height: 60rpx;
  235. .time {
  236. min-width: 350rpx;
  237. }
  238. }
  239. }
  240. .title {
  241. background-color: #f5f5f5;
  242. }
  243. }
  244. }
  245. </style>