人民医院前端

myTask.vue 17KB

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