人民医院前端

myTask.vue 17KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637
  1. <template>
  2. <view style="overflow: hidden;">
  3. <page-meta :root-font-size="getFontSizeValue"></page-meta>
  4. <view class="uni-margin-wrap">
  5. <swiper class="swiper" circular :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval"
  6. :duration="duration">
  7. <swiper-item v-for="item in bannnerData" :key="item.id">
  8. <image :src="item.imgPath" mode=""></image>
  9. </swiper-item>
  10. </swiper>
  11. </view>
  12. <view class="orderManage">
  13. <view v-show="orderListData.filter(val=>val.type === 1).length !== 0" class="orderTit" style="padding-left: 15px;color: rgb(126, 131, 125);">
  14. <text style="width: 4px;background-color: rgb(26, 188, 156);height: 20px;margin-top: 10px;margin-right: 5px;"></text>
  15. <text>报工模块</text>
  16. </view>
  17. <view class="orderCon">
  18. <view class="orderList" v-show="item.type === 1" v-for="item in orderListData" :key="item.id" @click="workOrderListClick(item)">
  19. <image :style="{ background: item.imageBg }" :src="item.imagePath" mode=""></image>
  20. <text>{{ item.text }}</text>
  21. </view>
  22. </view>
  23. <view v-show="orderListData.filter(val=>val.type === 2).length !== 0" class="orderTit" style="padding-left: 15px;color: rgb(126, 131, 125);">
  24. <text style="width: 4px;background-color: rgb(255, 170, 0);height: 20px;margin-top: 10px;margin-right: 5px;"></text>
  25. <text>接单模块</text>
  26. </view>
  27. <view class="orderCon">
  28. <view class="orderList" v-show="item.type === 2" v-for="item in orderListData" :key="item.id" @click="workOrderListClick(item)">
  29. <image :style="{ background: item.imageBg }" :src="item.imagePath" mode=""></image>
  30. <text>{{ item.text }}</text>
  31. </view>
  32. </view>
  33. <view v-if="isgly==1" class="orderTit" style="padding-left: 15px;color: rgb(126, 131, 125);">
  34. <text
  35. style="width: 4px;background-color: rgb(26, 188, 156);height: 20px;margin-top: 10px;margin-right: 5px;"></text>
  36. <text>报表模块</text>
  37. </view>
  38. <view v-if="isgly==1" class="orderCon">
  39. <view class="orderList" v-for="item in reportListData" :key="item.id" @click="workOrderListClick(item)">
  40. <image :style="{ background: item.imageBg }" :src="item.imagePath" mode=""></image>
  41. <text>{{ item.text }}</text>
  42. </view>
  43. <view class="orderList" v-show="item.type === 3" v-for="item in orderListData" :key="item.id" @click="workOrderListClick(item)">
  44. <image :style="{ background: item.imageBg }" :src="item.imagePath" mode=""></image>
  45. <text>{{ item.text }}</text>
  46. </view>
  47. </view>
  48. <view class="orderTit" @click="changeStore" v-if="noticState">
  49. <image style="background: #ff9600" src="/static/icon_noticefi.png"></image>
  50. <text>公告通知</text>
  51. </view>
  52. <view class="notification">
  53. <view class="notifiList" v-for="item in noticListData" :key="item.id">
  54. <image :style="{ background: item.imageBg }" :src="item.imagePath" mode=""></image>
  55. <view class="">
  56. <text>{{ item.textTit }}</text>
  57. <text>{{ item.textCon }}</text>
  58. </view>
  59. </view>
  60. </view>
  61. </view>
  62. <!-- 弹框 -->
  63. <view>
  64. <uni-popup ref="inputDialogs" type="dialog">
  65. <uni-popup-dialog ref="inputClose" mode="input" :title="title" @confirm="dialogInputConfirm">
  66. <view style="height: 600rpx;overflow-y: auto;">
  67. <radio-group @change="radioChange" style="width: 100%;height: 600rpx;">
  68. <label class="uni-list-cell uni-list-cell-pd" v-for="(item, index) in allowData"
  69. :key="index">
  70. <view v-show="item.deptname"
  71. style="width:100%;line-height: 24px;color: #606266;margin-bottom: 10px;">
  72. <radio style="width: 30px;" :value="item.deptid" :checked="index === current" />
  73. <text class="yydepttit">{{ item.deptname }}</text>
  74. </view>
  75. </label>
  76. </radio-group>
  77. <!-- <uni-table style="height: 600rpx;" ref="table" border stripe emptyText="暂无更多数据">
  78. <uni-tr>
  79. <uni-th align="center">请选择</uni-th>
  80. </uni-tr>
  81. <uni-tr>
  82. <uni-td align="center">
  83. <radio-group @change="radioChange" style="width: 100%;">
  84. <label class="uni-list-cell uni-list-cell-pd" v-for="(item, index) in allowData"
  85. :key="index">
  86. <view style="padding: 5px 0;position: relative;width: 100%;">
  87. <radio style="width: 30px;position: absolute;left: 0;"
  88. :value="item.deptid" :checked="index === current" />
  89. <text style="margin-left: 15px;display: inline-block;width: 80%;">{{ $mHelper.findParents(departList, item.deptid) }}</text>
  90. </view>
  91. </label>
  92. </radio-group>
  93. </uni-td>
  94. </uni-tr>
  95. </uni-table> -->
  96. </view>
  97. </uni-popup-dialog>
  98. </uni-popup>
  99. </view>
  100. </view>
  101. </template>
  102. <script>
  103. import {
  104. mapGetters
  105. } from "vuex"
  106. import store from '@/store';
  107. import {
  108. getToken
  109. } from '@/utils/auth'
  110. import listUrl from '@/utils/listUrl.js'
  111. import pageData from '../myTask/repairList/addRepair/pageData.js'
  112. export default {
  113. data() {
  114. return {
  115. isgly: 0,
  116. indicatorDots: true,
  117. getFontSizeValue: '1rem',
  118. autoplay: true,
  119. interval: 2000,
  120. noticState: false,
  121. duration: 500,
  122. bannnerData: [],
  123. orderListData: [],
  124. reportListData: [{
  125. id: "15",
  126. imagePath: "../../static/icon_ri.png",
  127. imageBg: "#00c3c3",
  128. text: "日报", //WorkOrder/GetLDDealList
  129. navigateToUrl: "/pages/myTask/reportForm/reportForm?reportType=0",
  130. },
  131. {
  132. id: "16",
  133. imagePath: "../../static/icon_yue.png",
  134. imageBg: "#00c3c3",
  135. text: "月报", //WorkOrder/GetLDDealList
  136. navigateToUrl: "/pages/myTask/reportForm/reportForm?reportType=1",
  137. },
  138. {
  139. id: "17",
  140. imagePath: "../../static/icon_rili.png",
  141. imageBg: "#00c3c3",
  142. text: "实时数据", //WorkOrder/GetLDDealList
  143. navigateToUrl: "/pages/myTask/reportForm/reportForm?reportType=2",
  144. },
  145. // {
  146. // id: "18",
  147. // imagePath: "../../static/data1.png",
  148. // imageBg: "#62c7f5",
  149. // text: "运维指标", //WorkOrder/GetLDDealList
  150. // navigateToUrl: "/pages/myTask/opertraget/opertraget",
  151. // },
  152. ],
  153. noticListData: [],
  154. departList: [],
  155. allowData: [],
  156. title: "允用科室",
  157. selectedIndexs: [],
  158. current: "",
  159. onchangedept: ''
  160. }
  161. },
  162. computed: {
  163. ...mapGetters([
  164. "State",
  165. "userId",
  166. "deptId"
  167. ])
  168. },
  169. onLoad() {
  170. // this.getStodept()
  171. this.init()
  172. this.saveDept()
  173. this.getFontSizeValue = uni.getStorageSync('fontSizeValue') + 'rem'
  174. // this.getFontSizeValue = '1.5rem'
  175. if (uni.getStorageSync("roleCode") === "APRY") {
  176. uni.hideTabBar()
  177. }
  178. if (uni.getStorageSync("roleCode") === "BMZG" || uni.getStorageSync("roleCode") === "WXBZZ") {
  179. this.isgly = 1
  180. }
  181. console.log(uni.getStorageSync("isAllow"))
  182. if (uni.getStorageSync("isAllow") === "1") {
  183. var str = uni.getStorageSync('storageAllowUserDept') //获取允用科室ids
  184. var arr = []
  185. pageData.getDet((res, data) => {
  186. this.departList = data
  187. if (str.indexOf(',') >= 0) {
  188. for (var i = 0; i < str.split(",").length; i++) {
  189. if (uni.getStorageSync('deptId') == str.split(",")[i]) {
  190. this.current = 0;
  191. arr.unshift({
  192. deptid: str.split(",")[i],
  193. deptname: this.$mHelper.findParents(this.departList, str.split(",")[i])
  194. })
  195. }else{
  196. arr.push({
  197. deptid: str.split(",")[i],
  198. deptname: this.$mHelper.findParents(this.departList, str.split(",")[i])
  199. })
  200. }
  201. }
  202. this.allowData = arr
  203. }
  204. this.$nextTick(function() {
  205. this.$refs.inputDialogs.open()
  206. })
  207. })
  208. }
  209. // this.updatePass()
  210. // this.isLongPass()
  211. // uni.hideTabBar()
  212. },
  213. methods: {
  214. updatePass(){
  215. const reg = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,20}$/;
  216. const pass = uni.getStorageSync('loginpass');
  217. if (!reg.test(pass)) {
  218. uni.showModal({
  219. title: '提示',
  220. content: '您的密码不符合规范,请更新密码!',
  221. showCancel: false,
  222. success: function(res) {
  223. if (res.confirm) {
  224. uni.navigateTo({
  225. url: "/pages/setting/fontSizeSettingPass/fontSizeSettingPass"
  226. })
  227. } else if (res.cancel) {
  228. console.log('取消');
  229. }
  230. }
  231. });
  232. }
  233. },
  234. isLongPass(){
  235. const params = {}
  236. this.$http.get('UserAccount/GetUserPasswordTime', params).then(res => {
  237. if (res.state == "success") {
  238. if(res.data == 1){
  239. uni.showModal({
  240. title: '提示',
  241. content: '您的密码已经超三个月未修改,请更新密码!',
  242. showCancel: false,
  243. success: function(res) {
  244. if (res.confirm) {
  245. uni.navigateTo({
  246. url: "/pages/setting/fontSizeSettingPass/fontSizeSettingPass"
  247. })
  248. } else if (res.cancel) {
  249. console.log('取消');
  250. }
  251. }
  252. });
  253. }
  254. }
  255. })
  256. },
  257. radioChange: function(evt) {
  258. this.onchangedept = evt.detail.value;
  259. console.log(evt.detail.value)
  260. for (let i = 0; i < this.allowData.length; i++) {
  261. if (this.allowData[i].deptid === evt.detail.value) {
  262. this.current = i;
  263. break;
  264. }
  265. }
  266. },
  267. selectionChange(e) {
  268. this.selectedIndexs = e.detail.index
  269. this.onchangedept = this.allowData[e.detail.index].deptid
  270. console.log(this.allowData[e.detail.index])
  271. },
  272. dialogInputConfirm() {
  273. // if (this.selectedIndexs.length != 1) {
  274. // this.$mHelper.toast("请选择一行数据");
  275. // return;
  276. // }
  277. const params = {
  278. deptId: this.onchangedept || uni.getStorageSync('deptId'),
  279. userid: this.$store.getters.userId || uni.getStorageSync('userId')
  280. }
  281. this.$http.get('UserAccount/ChangeDeptId', params).then(res => {
  282. if (res.state == "success") {
  283. this.$mHelper.toast(res.message);
  284. this.$refs.inputDialogs.close()
  285. this.$mStore.dispatch("GetInfo").then((e) => {
  286. if (e.data.Dept) {
  287. uni.setStorageSync('deptId', e.data.Dept.F_DeptId)
  288. uni.setStorageSync('deptName', e.data.Dept.F_DeptName)
  289. }
  290. })
  291. }
  292. })
  293. },
  294. init() {
  295. // #ifdef APP-PLUS
  296. let timer
  297. timer = setInterval(() => {
  298. plus.push.getClientInfoAsync((info) => {
  299. let cid = info["clientid"];
  300. if (cid) {
  301. clearInterval(timer)
  302. this.clienGet(cid) //获取cid
  303. }
  304. });
  305. }, 5000)
  306. this.upData()
  307. // #endif
  308. this.bannnerData = this.$mConstDataConfig.bannnerData
  309. this.getMenuPermissions() //获取用户权限
  310. },
  311. //重新存储部门数据
  312. // getStodept(){
  313. // this.$mStore.dispatch("GetInfo").then((e)=>{
  314. // if(e.data.Dept){
  315. // uni.setStorageSync('deptId', e.data.Dept.F_DeptId)
  316. // uni.setStorageSync('deptName', e.data.Dept.F_DeptName)
  317. // }
  318. // })
  319. // },
  320. saveDept() {
  321. pageData.getDet((res, data) => {
  322. this.departList = data
  323. uni.setStorageSync('deptTreeData', JSON.stringify(res))
  324. uni.setStorageSync('deptAllList', JSON.stringify(data))
  325. })
  326. },
  327. changeStore() {
  328. this.$mStore.dispatch("STATE", 3)
  329. },
  330. workOrderListClick(item) {
  331. uni.navigateTo({
  332. url: item.navigateToUrl,
  333. })
  334. },
  335. clienGet(cid) {
  336. let apptype
  337. if (plus.device.model.indexOf('iPhone') > -1) {
  338. apptype = 2;
  339. } else {
  340. apptype = 1;
  341. }
  342. const params = {
  343. apptype: apptype,
  344. clientid: cid,
  345. token: uni.getStorageSync("token"),
  346. }
  347. this.$http.get("PushMessage/PutAppClientIdAsync", params).then((response) => {
  348. if (response.state.toLowerCase() === "success") {
  349. console.log(cid)
  350. let data = response.message
  351. }
  352. })
  353. .catch((e) => {
  354. console.log(e)
  355. })
  356. },
  357. upData() {
  358. plus.runtime.getProperty(plus.runtime.appid, function(wgtinfo) {
  359. uni.setStorageSync('versionCode', wgtinfo.version)
  360. });
  361. let typeUp = ''
  362. if (plus.device.model.indexOf('iPhone') > -1) {
  363. typeUp = 1;
  364. } else {
  365. typeUp = 0;
  366. }
  367. const params = {
  368. type: typeUp,
  369. isNew: true,
  370. }
  371. this.$http.get('/ApplicationsVersion/GetAndroid', params).then((response) => {
  372. if (response.state == "success") {
  373. let data = response.data
  374. console.log(data)
  375. //NewCode_ = data.data.F_VersionCode;
  376. const nowVersionCode = uni.getStorageSync('versionCode')
  377. const serveVersionCode = data.F_VersionCode
  378. console.log(nowVersionCode + "---" + serveVersionCode)
  379. if (nowVersionCode !== serveVersionCode) {
  380. if (typeUp === 0) {
  381. uni.showModal({
  382. title: '更新',
  383. content: '是否更新',
  384. showCancel: false,
  385. success: function(res) {
  386. if (res.confirm) {
  387. plus.runtime.openURL(data.FileUrl[0].F_FileUrl, err => {
  388. plus.runtime.openURL(data.FileUrl[0].F_FileUrl);
  389. }, 'com.android.browser');
  390. } else if (res.cancel) {
  391. this.$mHelper.toast("取消更新");
  392. }
  393. }
  394. });
  395. } else if (typeUp === 1) {
  396. uni.showModal({
  397. title: '更新',
  398. content: '是否更新',
  399. showCancel: false,
  400. success: function(res) {
  401. if (res.confirm) {
  402. plus.runtime.openURL(data.F_Url);
  403. } else if (res.cancel) {
  404. this.$mHelper.toast("取消更新");
  405. }
  406. }
  407. });
  408. }
  409. }
  410. }
  411. }).catch((e) => {
  412. console.log(e);
  413. })
  414. },
  415. getMenuPermissions() {
  416. let code = uni.getStorageSync("roleCode")
  417. this.$http.get("InternalMessages/GetCount").then((response) => {
  418. if (response.state.toLowerCase() === "success") {
  419. if (response.IsRead == 1) {
  420. uni.showTabBarRedDot({
  421. index: 2
  422. })
  423. } else {
  424. uni.hideTabBarRedDot({
  425. index: 2
  426. })
  427. }
  428. }
  429. })
  430. .catch((e) => {
  431. console.log(e)
  432. })
  433. this.$http.get("Index/GetMenu").then((response) => {
  434. if (response.state.toLowerCase() === "success") {
  435. if (response.data.length > 0) {
  436. this.orderListData = listUrl.getMenuData(response.data, code)
  437. console.log(this.orderListData)
  438. if (uni.getStorageSync("roleCode") === "GLY" || uni.getStorageSync("roleCode") === "DDBZ" || uni.getStorageSync("roleCode") === "BMZG") {
  439. this.orderListData.push({
  440. type : 3,
  441. id: "18",
  442. imagePath: "../../static/data1.png",
  443. imageBg: "#62c7f5",
  444. text: "运维指标",
  445. navigateToUrl: "/pages/myTask/opertraget/opertraget"
  446. })
  447. }
  448. }
  449. }
  450. })
  451. .catch((e) => {
  452. console.log(e)
  453. })
  454. },
  455. },
  456. }
  457. </script>
  458. <style lang="scss">
  459. /deep/.uni-dialog-content {
  460. margin: 0;
  461. padding: 0;
  462. }
  463. .yydepttit {
  464. display: inline-block;
  465. width: 85%;
  466. text-align: center;
  467. font-size: 14px;
  468. vertical-align: middle;
  469. // height: 24px;
  470. }
  471. .equipmentInfo {
  472. width: 100%;
  473. margin-top: 15px;
  474. border: 1px solid rgb(229, 229, 229);
  475. box-shadow: 0px 4px 16px 0px rgba(69, 91, 99, 0.05);
  476. margin-bottom: 20px;
  477. border-radius: 5px;
  478. .trCon {
  479. width: 100%;
  480. // font-size: 14px;
  481. .tdCon {
  482. display: inline-block;
  483. padding: 10px 0px;
  484. color: rgb(102, 102, 102);
  485. width: 48%;
  486. padding-right: 5px;
  487. text-align: center;
  488. }
  489. }
  490. }
  491. .uni-margin-wrap {
  492. width: 690rpx;
  493. width: 100%;
  494. }
  495. .swiper {
  496. height: 225px;
  497. image {
  498. width: 100%;
  499. height: 100%;
  500. }
  501. }
  502. .orderManage {
  503. .orderTit {
  504. margin-top: 15rpx;
  505. width: 100%;
  506. height: 80rpx;
  507. line-height: 80rpx;
  508. background: #ffffff;
  509. display: flex;
  510. border-bottom: 1rpx solid #eeeeee;
  511. text {
  512. font-size: 1rem;
  513. }
  514. image {
  515. width: 24rpx;
  516. height: 24rpx;
  517. padding: 8rpx;
  518. border-radius: 12px;
  519. background: #1972c2;
  520. margin: 20rpx 10rpx 20rpx 26rpx;
  521. }
  522. }
  523. .orderCon {
  524. background: #ffffff;
  525. display: flex;
  526. flex-wrap: wrap;
  527. .orderList {
  528. width: 186rpx;
  529. height: 206rpx;
  530. text-align: center;
  531. border-right: 2rpx solid #eeeeee;
  532. border-bottom: 2rpx solid #eeeeee;
  533. image {
  534. width: 40rpx;
  535. height: 40rpx;
  536. margin: 0 auto;
  537. display: block;
  538. border-radius: 35rpx;
  539. padding: 15rpx;
  540. margin-top: 45rpx;
  541. }
  542. text {
  543. line-height: 60rpx;
  544. }
  545. }
  546. .orderList:nth-child(4n + 4) {
  547. border-right: none;
  548. }
  549. .orderList:last-child {
  550. border-right: none;
  551. }
  552. }
  553. .notification {
  554. background: #ffffff;
  555. margin-bottom: 100rpx;
  556. display: flex;
  557. flex-wrap: wrap;
  558. border-bottom: 1rpx solid #eeeeee;
  559. .notifiList {
  560. width: 375rpx;
  561. height: 172rpx;
  562. padding: 46rpx 30rpx 46rpx 30rpx;
  563. text-align: left;
  564. border-right: 1rpx solid #eeeeee;
  565. border-bottom: 1rpx solid #eeeeee;
  566. box-sizing: border-box;
  567. display: flex;
  568. image {
  569. width: 48rpx;
  570. height: 48rpx;
  571. box-sizing: border-box;
  572. border-radius: 24rpx;
  573. padding: 10rpx;
  574. margin: 19rpx;
  575. }
  576. text {
  577. font-size: 24rpx;
  578. line-height: 30rpx;
  579. }
  580. }
  581. .notifiList:nth-child(2n + 2) {
  582. border-right: none;
  583. }
  584. }
  585. }
  586. </style>