supplementary.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440
  1. <template>
  2. <div class="bgColor">
  3. <div class="head">
  4. <div class="img"></div>
  5. <div class="name">{{ loginUser.name }}</div>
  6. </div>
  7. <div class="myMessage">
  8. <div class="label">个人信息</div>
  9. <ul>
  10. <li>
  11. <div>姓名</div>
  12. <div>{{ loginUser.name || "暂无" }}</div>
  13. </li>
  14. <li>
  15. <div>工号</div>
  16. <div>{{ loginUser.account || "暂无" }}</div>
  17. </li>
  18. <li>
  19. <div>联系电话</div>
  20. <div class="factionAdd" @click="toModify('mphone')">
  21. <span>{{ loginUser.mphone || "暂无" }}</span>
  22. <i class="iconfont icon-moren"></i>
  23. </div>
  24. </li>
  25. <li class="myArea">
  26. <div>区域地点</div>
  27. <div>
  28. <cube-button @click="showCascadePicker">
  29. {{ areaData || "暂无" }}
  30. <i class="iconfont icon-moren"></i>
  31. </cube-button>
  32. </div>
  33. </li>
  34. <li>
  35. <div>详细地址</div>
  36. <div class="factionAdd" @click="toModify('houseNumber')">
  37. <span>{{ loginUser.houseNumber || "暂无" }}</span>
  38. <i class="iconfont icon-moren"></i>
  39. </div>
  40. </li>
  41. </ul>
  42. </div>
  43. <div class="goToSystem" @click="goToSystem">进入系统</div>
  44. <promp-ting
  45. :conents="promptingConent"
  46. :status="promptingStatus"
  47. ></promp-ting>
  48. </div>
  49. </template>
  50. <script>
  51. import "./../../static/css/iconfont.js";
  52. import PrompTing from "./../views/prompting.vue";
  53. export default {
  54. data() {
  55. return {
  56. repairMain: null,
  57. loginUser: JSON.parse(localStorage.getItem("loginUser")),
  58. incidentStateData: "",
  59. treeData: [],
  60. areaData: "",
  61. promptingConent: "",
  62. promptingStatus: ""
  63. };
  64. },
  65. methods: {
  66. loginNext() {
  67. // seimin
  68. // 获取报修主体
  69. this.$http
  70. .post("service/sysinfo/data/fetchDataList/systemConfiguration", {
  71. idx: 0,
  72. sum: 1000,
  73. systemConfiguration: { keyconfig: "repairMain" }
  74. })
  75. .then(result => {
  76. if (result.data.status == 200) {
  77. var repairMain = result.data.list[0];
  78. window.localStorage.setItem(
  79. "repairMain",
  80. JSON.stringify(repairMain)
  81. );
  82. // 获取是否自动建单
  83. this.$http
  84. .post("service/sysinfo/data/fetchDataList/systemConfiguration", {
  85. idx: 0,
  86. sum: 1000,
  87. systemConfiguration: { keyconfig: "reqHasCategory" }
  88. })
  89. .then(result => {
  90. if (result.data.status == 200) {
  91. var reqHasCategory = result.data.list[0];
  92. window.localStorage.setItem(
  93. "reqHasCategory",
  94. JSON.stringify(reqHasCategory)
  95. );
  96. this.$router.push({ path: "/main" });
  97. }
  98. });
  99. }
  100. });
  101. // seimin
  102. },
  103. goToSystem() {
  104. if (!this.loginUser.mphone) {
  105. this.$createDialog({
  106. type: "alert",
  107. content: "联系电话不能为空",
  108. icon: "cubeic-wrong"
  109. }).show();
  110. } else if (!this.areaData) {
  111. this.$createDialog({
  112. type: "alert",
  113. content: "区域地点不能为空",
  114. icon: "cubeic-wrong"
  115. }).show();
  116. } else {
  117. this.loginNext();
  118. }
  119. },
  120. toModify(data) {
  121. this.$router.push({
  122. name: "MyModify",
  123. params: {
  124. data
  125. }
  126. });
  127. },
  128. getUserAreaData() {
  129. if (this.loginUser.place) {
  130. this.areaData =
  131. this.loginUser.place.area.area + " " + this.loginUser.place.place;
  132. }
  133. },
  134. toIncidentList(res) {
  135. this.$router.push({
  136. name: "IncidentList",
  137. params: {
  138. state: res
  139. }
  140. });
  141. },
  142. getIncidentData() {
  143. var that = this;
  144. this.$http
  145. .post("service/apply/bpm/fetchServiceTasks", {
  146. assignee: that.loginUser.account,
  147. idx: 0,
  148. sum: 9999
  149. })
  150. .then(function(res) {
  151. that.incidentStateData = res.data;
  152. });
  153. },
  154. getAreaData() {
  155. var that = this;
  156. this.$http
  157. .post("service/user/data/fetchDataList/area", {
  158. idx: 0,
  159. sum: 1000,
  160. area: {
  161. wechatArea: true
  162. }
  163. })
  164. .then(function(res) {
  165. var data = res.data.list;
  166. for (var i = 0; i < data.length; i++) {
  167. that.treeData.push({
  168. text: data[i].area,
  169. value: data[i].id,
  170. children: []
  171. });
  172. }
  173. });
  174. },
  175. getPlaceData() {
  176. var that = this;
  177. this.$http
  178. .post("service/user/data/fetchDataList/place", {
  179. idx: 0,
  180. sum: 1000,
  181. area: {
  182. wechatAreaId: ""
  183. }
  184. })
  185. .then(function(res) {
  186. var data = res.data.list;
  187. for (var i = 0; i < data.length; i++) {
  188. for (var j = 0; j < that.treeData.length; j++) {
  189. if (data[i].area.id == that.treeData[j].value) {
  190. that.treeData[j].children.push({
  191. text: data[i].place,
  192. value: data[i].id
  193. });
  194. }
  195. }
  196. }
  197. that.cascadePicker = that.$createCascadePicker({
  198. title: "请选择区域地点",
  199. data: that.treeData,
  200. selectedIndex: [0, 0],
  201. onSelect: that.selectHandle,
  202. onCancel: that.cancelHandle
  203. });
  204. });
  205. },
  206. showCascadePicker() {
  207. this.cascadePicker.show();
  208. },
  209. selectHandle(selectedVal, selectedIndex, selectedText) {
  210. var that = this;
  211. this.$http
  212. .get(
  213. "service/user/updPlace/" + this.loginUser.id + "/" + selectedVal[1],
  214. {}
  215. )
  216. .then(function(res) {
  217. if (res.status == 200) {
  218. that.promptingConent = "恭喜您,修改区域地点成功!";
  219. that.promptingStatus = true;
  220. $("#fade").fadeIn();
  221. setTimeout(function() {
  222. $("#fade").fadeOut();
  223. }, 2000);
  224. if (!that.loginUser.place) {
  225. that.loginUser.place = {
  226. area: {}
  227. };
  228. }
  229. that.loginUser.place.id = selectedVal[1];
  230. that.loginUser.place.area.id = selectedVal[0];
  231. that.loginUser.place.place = selectedText[1];
  232. that.loginUser.place.area.area = selectedText[0];
  233. var loginUserStr = JSON.stringify(that.loginUser);
  234. localStorage.setItem("loginUser", loginUserStr);
  235. that.areaData = selectedText[0] + " " + selectedText[1];
  236. } else {
  237. that.promptingConent = "对不起,修改失败,请稍后再试!";
  238. that.promptingStatus = false;
  239. $("#fade").fadeIn();
  240. setTimeout(function() {
  241. $("#fade").fadeOut();
  242. }, 2000);
  243. }
  244. });
  245. },
  246. cancelHandle() {}
  247. },
  248. created() {
  249. this.getUserAreaData();
  250. this.getAreaData();
  251. this.getPlaceData();
  252. this.getIncidentData();
  253. // 获取报修主体
  254. this.repairMain = JSON.parse(localStorage.getItem("repairMain"));
  255. },
  256. mounted() {
  257. // this.cascadePicker = this.$createCascadePicker({
  258. // title: '请选择区域地点',
  259. // data: this.treeData,
  260. // selectedIndex: [0,0],
  261. // onSelect: this.selectHandle,
  262. // onCancel: this.cancelHandle
  263. // })
  264. },
  265. components: {
  266. PrompTing
  267. }
  268. };
  269. </script>
  270. <style scoped>
  271. .goToSystem {
  272. position: fixed;
  273. left: 50%;
  274. bottom: 0;
  275. transform: translateX(-50%);
  276. width: 90%;
  277. height: 1rem;
  278. background-color: #005395;
  279. border-radius: 10px;
  280. line-height: 1rem;
  281. color: white;
  282. font-size: 0.36rem;
  283. text-align: center;
  284. }
  285. .bgColor {
  286. background-color: white;
  287. }
  288. .icon {
  289. width: 1em;
  290. height: 1em;
  291. vertical-align: -0.15em;
  292. fill: currentColor;
  293. overflow: hidden;
  294. }
  295. .label {
  296. background-color: rgb(238, 238, 238);
  297. height: 0.6rem;
  298. line-height: 0.6rem;
  299. padding-left: 0.2rem;
  300. font-size: 0.24rem;
  301. color: #666666;
  302. border-top: 0.01rem rgb(223, 222, 222) solid;
  303. border-bottom: 0.01rem rgb(223, 222, 222) solid;
  304. }
  305. /* 头像 */
  306. .head {
  307. height: 2.4rem;
  308. background: linear-gradient(#005395, #226ca8);
  309. padding-top: 0.3rem;
  310. }
  311. .head .img {
  312. width: 1.36rem;
  313. height: 1.36rem;
  314. border-radius: 50%;
  315. margin: 0 auto;
  316. overflow: hidden;
  317. background: url(./../../static/images/avatar-1-big.jpg);
  318. background-size: contain;
  319. }
  320. .head .name {
  321. font-size: 0.32rem;
  322. text-align: center;
  323. margin-top: 0.2rem;
  324. color: #ffffff;
  325. }
  326. /* 个人信息 */
  327. /* .myMessage { */
  328. /* background-color: rgb(242, 242, 242); */
  329. /* margin-top: .2rem */
  330. /* } */
  331. .myMessage li {
  332. border-bottom: 0.01rem rgb(223, 222, 222) solid;
  333. display: flex;
  334. justify-content: space-between;
  335. align-items: center;
  336. /* padding: .2rem .28rem */
  337. /* height: .88rem; */
  338. /* line-height: .88rem; */
  339. line-height: 0.4rem;
  340. padding: 0.24rem 0.24rem;
  341. }
  342. .myMessage li div:nth-child(1) {
  343. width: 35%;
  344. font-size: 0.32rem;
  345. }
  346. .myMessage li div:nth-child(2) {
  347. width: 55%;
  348. display: flex;
  349. justify-content: flex-end;
  350. font-size: 0.32rem;
  351. /* line-height: .3rem */
  352. }
  353. .factionAdd {
  354. display: flex;
  355. justify-content: space-between;
  356. align-items: center;
  357. }
  358. .factionAdd span {
  359. display: inline-block;
  360. width: 90%;
  361. text-align: right;
  362. }
  363. .factionAdd i {
  364. display: inline-block;
  365. font-size: 0.34rem;
  366. width: 12%;
  367. }
  368. /* 我的报修 */
  369. /* .myRapir {
  370. margin-top: .2rem
  371. } */
  372. .myRapir .tit {
  373. /* background-color: rgb(242, 242, 242); */
  374. height: 0.88rem;
  375. line-height: 0.88rem;
  376. display: flex;
  377. padding: 0 0.24rem;
  378. font-size: 0.32rem;
  379. justify-content: space-between;
  380. border-bottom: 0.01rem rgb(223, 222, 222) solid;
  381. }
  382. .rapirMessage {
  383. display: flex;
  384. height: 1.4rem;
  385. border-bottom: 0.01rem rgb(223, 222, 222) solid;
  386. }
  387. .rapirMessage .status {
  388. width: 16.5%;
  389. border-left: 0.01rem rgb(223, 222, 222) solid;
  390. display: flex;
  391. align-items: center;
  392. justify-content: center;
  393. flex-direction: column;
  394. }
  395. .rapirMessage .status div:nth-child(1) {
  396. width: 100%;
  397. text-align: center;
  398. }
  399. .rapirMessage .status div:nth-child(1) svg {
  400. width: 0.48rem;
  401. height: 0.48rem;
  402. }
  403. .rapirMessage .status div:nth-child(2) {
  404. margin-top: 0.2rem;
  405. display: flex;
  406. align-items: center;
  407. }
  408. .rapirMessage .status div:nth-child(2) span:nth-child(1) {
  409. font-size: 0.24rem;
  410. color: #333333;
  411. }
  412. .rapirMessage .status div:nth-child(2) span:nth-child(2) {
  413. display: inline-block;
  414. margin-left: 0.08rem;
  415. font-size: 0.32rem;
  416. }
  417. </style>
  418. <style>
  419. .myArea .cube-btn {
  420. padding: 0 !important;
  421. background-color: white !important;
  422. color: #333333 !important;
  423. text-align: right !important;
  424. overflow: hidden;
  425. white-space: nowrap;
  426. text-overflow: ellipsis;
  427. }
  428. </style>