人民医院前端

myTask.vue 15KB

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