teamInfo.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478
  1. <template>
  2. <view>
  3. <u-navbar title="成员信息" title-color="#101010">
  4. </u-navbar>
  5. <view class="list">
  6. <view class="item">
  7. <view class="name">
  8. 头像
  9. </view>
  10. <view class="value">
  11. <view class="goto " >
  12. <view class="photo">
  13. <img class="img" :src="addInfo.image" v-if="addInfo.image" alt="">
  14. </view>
  15. </view>
  16. </view>
  17. </view>
  18. <view class="item">
  19. <view class="name">
  20. 成员姓名
  21. </view>
  22. <view class="value">
  23. {{addInfo.name}}
  24. </view>
  25. </view>
  26. <view class="item">
  27. <view class="name">
  28. 登录手机号
  29. </view>
  30. <view class="value">
  31. {{addInfo.phone}}
  32. </view>
  33. </view>
  34. <view class="item">
  35. <view class="name">
  36. 岗位
  37. </view>
  38. <view class="value">
  39. {{addInfo.roleName}}
  40. </view>
  41. </view>
  42. </view>
  43. <view class="list">
  44. <view class="item">
  45. <view class="name">
  46. 场站关联管理
  47. </view>
  48. <view class="value" @click="gotoUrl('/pages/team/stationMy?id='+id)" >
  49. <span class="totalPage">{{totalPage}}</span>
  50. <u-icon name="arrow-right" size="24" color="#BBBBBB" ></u-icon>
  51. </view>
  52. </view>
  53. </view>
  54. <view class="floating-button">
  55. <view class="button button2" @click="del" v-if="isMy">
  56. 删除信息
  57. </view>
  58. <view class="button button1" @click="submit">
  59. 修改用户信息
  60. </view>
  61. </view>
  62. </view>
  63. </template>
  64. <script>
  65. import * as API from '@/apis/pagejs/pagesTeam.js'
  66. export default {
  67. data() {
  68. return {
  69. id:"",
  70. codeList: [],
  71. roleId: "",
  72. roleName:"",
  73. totalPage:0,
  74. addInfo: {
  75. image: "",
  76. roleName: "XJ"
  77. },
  78. isMy:true,
  79. };
  80. },
  81. onLoad(op) {
  82. if(op.id){
  83. this.id=op.id
  84. }
  85. if(this.jphelp.getPersonInfo().id==this.id){
  86. this.isMy=false
  87. }
  88. },
  89. onShow() {
  90. this.getInfo()
  91. this.getteamUserStation()
  92. },
  93. methods: {
  94. del() {
  95. uni.showModal({
  96. title:"提示",
  97. content: "请确认是否删除用户",
  98. success: (res1) => {
  99. if (res1.confirm) {
  100. this.delApi()
  101. } else if (res1.cancel) {
  102. //('用户点击取消');
  103. }
  104. }
  105. })
  106. },
  107. delApi() {
  108. API.delUser({
  109. id:this.id
  110. }).then((res) => {
  111. uni.showModal({
  112. title: '提示',
  113. showCancel: false,
  114. content: "操作成功",
  115. success: res1 => {
  116. if (res1.confirm) {
  117. uni.navigateBack()
  118. } else if (res1.cancel) {
  119. //('用户点击取消');
  120. }
  121. }
  122. })
  123. }).catch(error => {
  124. uni.hideLoading();
  125. uni.showToast({
  126. title: error,
  127. icon: "none"
  128. })
  129. })
  130. }
  131. ,
  132. getteamUserStation() {
  133. API.teamUserStation({
  134. id:this.id
  135. }).then((res) => {
  136. this.totalPage=res.data.recordsTotal
  137. }).catch(error => {
  138. uni.hideLoading();
  139. uni.showToast({
  140. title: error,
  141. icon: "none"
  142. })
  143. })
  144. },
  145. getInfo() {
  146. API.teamUser({
  147. id:this.id
  148. }).then((res) => {
  149. this.addInfo=res.data.user
  150. // this.findByCatalogName({
  151. // catalogName: '巡检角色'
  152. // }, "codeList")
  153. }).catch(error => {
  154. uni.hideLoading();
  155. uni.showToast({
  156. title: error,
  157. icon: "none"
  158. })
  159. })
  160. },
  161. findByCatalogName(obj, listName) {
  162. API.findByCatalogName(obj).then((res) => {
  163. var arr = res.data.dataDictionaryList
  164. this.codeList = arr
  165. this.codeList.forEach(item=>{
  166. if(this.addInfo.role==item.value){
  167. this.roleName=item.name
  168. }
  169. })
  170. }).catch(error => {
  171. uni.hideLoading();
  172. uni.showToast({
  173. title: error,
  174. icon: "none"
  175. })
  176. })
  177. },
  178. uploadPhoto() {
  179. let _self = this;
  180. const crop = {
  181. quality: 100,
  182. width: 600,
  183. height: 600,
  184. resize: true
  185. };
  186. // 上传图片
  187. uni.chooseImage({
  188. count: 1,
  189. crop,
  190. success: async (res) => {
  191. //(res);
  192. let tempFile = res.tempFiles[0];
  193. var filePath = res.tempFilePaths[0]
  194. let fileData = await new Promise((callback) => {
  195. uni.navigateTo({
  196. url: '/pages/myTab/cropImage?path=' + filePath +
  197. `&options=${JSON.stringify(crop)}`,
  198. animationType: "fade-in",
  199. events: {
  200. success: url => {
  201. callback(url)
  202. }
  203. }
  204. });
  205. })
  206. this.saveRecordConfirmMethod(fileData);
  207. }
  208. });
  209. },
  210. saveRecordConfirmMethod(fileData) {
  211. var token = this.jphelp.getToken()
  212. uni.uploadFile({
  213. url: process.jphelp.BASE_URL + "uploadPicture", //仅为示例,非真实的接口地址
  214. filePath: fileData,
  215. header: {
  216. 'Authorization': token,
  217. //'Content-Type': 'multipart/form-data',
  218. 'X-Requested-With': 'XMLHttpRequest',
  219. // 'content-type': 'multipart/form-data'
  220. },
  221. name: 'photoFile',
  222. formData: {
  223. subFolder: "headimg"
  224. },
  225. success: (uploadFileRes) => {
  226. var obj = JSON.parse(uploadFileRes.data)
  227. //.log(obj);
  228. //this.src = obj.data;
  229. this.addInfo.image = obj.data;
  230. this.$forceUpdate()
  231. //this.updatePersonInformation();
  232. // uni.hideLoading();
  233. }
  234. });
  235. },
  236. submit() {
  237. uni.navigateTo({
  238. url:"/pages/team/teamAdd?id="+this.id
  239. })
  240. },
  241. }
  242. }
  243. </script>
  244. <style lang="scss">
  245. .totalPage{
  246. padding: 0 36rpx;
  247. margin-right: 16rpx;
  248. line-height: 40rpx;
  249. border-radius: 50px;
  250. background-color: rgba(22,119,255,1);
  251. color: rgba(255, 255, 255, 1);
  252. font-size: 28rpx;
  253. text-align: center;
  254. }
  255. .jpmain {
  256. padding-bottom: 120rpx;
  257. }
  258. .list {
  259. background-color: rgba(255, 255, 255, 1);
  260. margin: 20rpx 0;
  261. .item:not(:last-child) {
  262. border-bottom: 2rpx solid rgba(232, 232, 232, 1);
  263. }
  264. .item {
  265. padding: 24rpx;
  266. display: flex;
  267. align-items: center;
  268. justify-content: space-between;
  269. .name {
  270. width: 40%;
  271. font-size: 32rpx;
  272. color: #777777;
  273. span {
  274. color: red
  275. }
  276. white-space: pre;
  277. }
  278. .value {
  279. font-size: 32rpx;
  280. width: 60%;
  281. display: flex;
  282. justify-content: flex-end;
  283. input::placeholder {
  284. color: #AAAAAA;
  285. }
  286. .img {
  287. width: 40rpx;
  288. height: 40rpx;
  289. }
  290. .textarea {
  291. background-color: rgba(241, 242, 245, 1);
  292. width: 100%;
  293. border-radius: 8rpx;
  294. }
  295. }
  296. }
  297. .item-plus {
  298. flex-direction: column;
  299. .value,
  300. .name {
  301. width: 100%;
  302. }
  303. .name {
  304. padding-bottom: 32rpx;
  305. }
  306. }
  307. }
  308. .floating-button {
  309. z-index: 999;
  310. position: fixed;
  311. bottom: 0;
  312. width: 100%;
  313. display: flex;
  314. height: 120rpx;
  315. justify-content: space-around;
  316. background-color: rgba(255, 255, 255, 1);
  317. .button {
  318. margin-top: 24rpx;
  319. border-radius: 50px;
  320. height: 80rpx;
  321. width: 80%;
  322. display: flex;
  323. align-items: center;
  324. justify-content: center;
  325. padding: 12rpx;
  326. background-color: rgba(22, 119, 255, 1);
  327. color: rgba(255, 255, 255, 1);
  328. font-size: 32rpx;
  329. }
  330. .button2{
  331. width: 35%;
  332. background-color: rgba(222,225,228,1);
  333. color: rgba(51,51,51,1);
  334. }
  335. .button1{
  336. width: 60%;
  337. }
  338. }
  339. .goto {
  340. display: flex;
  341. align-items: center;
  342. color: rgba(119, 119, 119, 1);
  343. width: 100%;
  344. justify-content: end;
  345. .photo {
  346. border-radius: 50px;
  347. background-color: rgba(229, 229, 229, 1);
  348. height: 80rpx;
  349. width: 80rpx;
  350. overflow: hidden;
  351. .img {
  352. width: 100% !important;
  353. height: 100% !important;
  354. }
  355. }
  356. }
  357. .radiolist{
  358. .radioitem{
  359. padding: 24rpx;
  360. display: flex;
  361. width: 300%;
  362. align-items: center;
  363. justify-content: space-between;
  364. }
  365. .radioitem:not(:last-child) {
  366. border-bottom: 2rpx solid rgba(232, 232, 232, 1);
  367. }
  368. }
  369. .rightslot{
  370. margin-right: 16rpx;
  371. color: red;
  372. }
  373. </style>