人民医院前端

myTask.vue 15KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588
  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") === "GLY") {
  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. arr.push({
  169. deptid: str.split(",")[i],
  170. deptname: this.$mHelper.findParents(this.departList, str.split(",")[i])
  171. })
  172. if (uni.getStorageSync('deptId') == str.split(",")[i]) {
  173. this.current = i;
  174. }
  175. }
  176. this.allowData = arr
  177. }
  178. this.$nextTick(function() {
  179. this.$refs.inputDialogs.open()
  180. })
  181. })
  182. }
  183. // this.updatePass()
  184. // this.isLongPass()
  185. // uni.hideTabBar()
  186. },
  187. methods: {
  188. updatePass(){
  189. const reg = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,20}$/;
  190. const pass = uni.getStorageSync('loginpass');
  191. if (!reg.test(pass)) {
  192. uni.showModal({
  193. title: '提示',
  194. content: '您的密码不符合规范,请更新密码!',
  195. showCancel: false,
  196. success: function(res) {
  197. if (res.confirm) {
  198. uni.navigateTo({
  199. url: "/pages/setting/fontSizeSettingPass/fontSizeSettingPass"
  200. })
  201. } else if (res.cancel) {
  202. console.log('取消');
  203. }
  204. }
  205. });
  206. }
  207. },
  208. isLongPass(){
  209. const params = {}
  210. this.$http.get('UserAccount/GetUserPasswordTime', params).then(res => {
  211. if (res.state == "success") {
  212. if(res.data == 1){
  213. uni.showModal({
  214. title: '提示',
  215. content: '您的密码已经超三个月未修改,请更新密码!',
  216. showCancel: false,
  217. success: function(res) {
  218. if (res.confirm) {
  219. uni.navigateTo({
  220. url: "/pages/setting/fontSizeSettingPass/fontSizeSettingPass"
  221. })
  222. } else if (res.cancel) {
  223. console.log('取消');
  224. }
  225. }
  226. });
  227. }
  228. }
  229. })
  230. },
  231. radioChange: function(evt) {
  232. this.onchangedept = evt.detail.value;
  233. console.log(evt.detail.value)
  234. for (let i = 0; i < this.allowData.length; i++) {
  235. if (this.allowData[i].deptid === evt.detail.value) {
  236. this.current = i;
  237. break;
  238. }
  239. }
  240. },
  241. selectionChange(e) {
  242. this.selectedIndexs = e.detail.index
  243. this.onchangedept = this.allowData[e.detail.index].deptid
  244. console.log(this.allowData[e.detail.index])
  245. },
  246. dialogInputConfirm() {
  247. // if (this.selectedIndexs.length != 1) {
  248. // this.$mHelper.toast("请选择一行数据");
  249. // return;
  250. // }
  251. const params = {
  252. deptId: this.onchangedept || uni.getStorageSync('deptId'),
  253. userid: this.$store.getters.userId || uni.getStorageSync('userId')
  254. }
  255. this.$http.get('UserAccount/ChangeDeptId', params).then(res => {
  256. if (res.state == "success") {
  257. this.$mHelper.toast(res.message);
  258. this.$refs.inputDialogs.close()
  259. this.$mStore.dispatch("GetInfo").then((e) => {
  260. if (e.data.Dept) {
  261. uni.setStorageSync('deptId', e.data.Dept.F_DeptId)
  262. uni.setStorageSync('deptName', e.data.Dept.F_DeptName)
  263. }
  264. })
  265. }
  266. })
  267. },
  268. init() {
  269. // #ifdef APP-PLUS
  270. let timer
  271. timer = setInterval(() => {
  272. plus.push.getClientInfoAsync((info) => {
  273. let cid = info["clientid"];
  274. if (cid) {
  275. clearInterval(timer)
  276. this.clienGet(cid) //获取cid
  277. }
  278. });
  279. }, 5000)
  280. this.upData()
  281. // #endif
  282. this.bannnerData = this.$mConstDataConfig.bannnerData
  283. this.getMenuPermissions() //获取用户权限
  284. },
  285. //重新存储部门数据
  286. // getStodept(){
  287. // this.$mStore.dispatch("GetInfo").then((e)=>{
  288. // if(e.data.Dept){
  289. // uni.setStorageSync('deptId', e.data.Dept.F_DeptId)
  290. // uni.setStorageSync('deptName', e.data.Dept.F_DeptName)
  291. // }
  292. // })
  293. // },
  294. saveDept() {
  295. pageData.getDet((res, data) => {
  296. this.departList = data
  297. uni.setStorageSync('deptTreeData', JSON.stringify(res))
  298. uni.setStorageSync('deptAllList', JSON.stringify(data))
  299. })
  300. },
  301. changeStore() {
  302. this.$mStore.dispatch("STATE", 3)
  303. },
  304. workOrderListClick(item) {
  305. uni.navigateTo({
  306. url: item.navigateToUrl,
  307. })
  308. },
  309. clienGet(cid) {
  310. let apptype
  311. if (plus.device.model.indexOf('iPhone') > -1) {
  312. apptype = 2;
  313. } else {
  314. apptype = 1;
  315. }
  316. const params = {
  317. apptype: apptype,
  318. clientid: cid,
  319. token: uni.getStorageSync("token"),
  320. }
  321. this.$http.get("PushMessage/PutAppClientIdAsync", params).then((response) => {
  322. if (response.state.toLowerCase() === "success") {
  323. let data = response.message
  324. }
  325. })
  326. .catch((e) => {
  327. console.log(e)
  328. })
  329. },
  330. upData() {
  331. plus.runtime.getProperty(plus.runtime.appid, function(wgtinfo) {
  332. uni.setStorageSync('versionCode', wgtinfo.version)
  333. });
  334. let typeUp = ''
  335. if (plus.device.model.indexOf('iPhone') > -1) {
  336. typeUp = 1;
  337. } else {
  338. typeUp = 0;
  339. }
  340. const params = {
  341. type: typeUp,
  342. isNew: true,
  343. }
  344. this.$http.get('/ApplicationsVersion/GetAndroid', params).then((response) => {
  345. if (response.state == "success") {
  346. let data = response.data
  347. console.log(data)
  348. //NewCode_ = data.data.F_VersionCode;
  349. const nowVersionCode = uni.getStorageSync('versionCode')
  350. const serveVersionCode = data.F_VersionCode
  351. console.log(nowVersionCode + "---" + serveVersionCode)
  352. if (nowVersionCode !== serveVersionCode) {
  353. if (typeUp === 0) {
  354. uni.showModal({
  355. title: '更新',
  356. content: '是否更新',
  357. showCancel: false,
  358. success: function(res) {
  359. if (res.confirm) {
  360. plus.runtime.openURL(data.FileUrl[0].F_FileUrl, err => {
  361. plus.runtime.openURL(data.FileUrl[0]
  362. .F_FileUrl);
  363. }, 'com.android.browser');
  364. } else if (res.cancel) {
  365. this.$mHelper.toast("取消更新");
  366. }
  367. }
  368. });
  369. } else if (typeUp === 1) {
  370. uni.showModal({
  371. title: '更新',
  372. content: '是否更新',
  373. showCancel: false,
  374. success: function(res) {
  375. if (res.confirm) {
  376. plus.runtime.openURL(data.F_Url);
  377. } else if (res.cancel) {
  378. this.$mHelper.toast("取消更新");
  379. }
  380. }
  381. });
  382. }
  383. }
  384. }
  385. }).catch((e) => {
  386. console.log(e);
  387. })
  388. },
  389. getMenuPermissions() {
  390. let code = uni.getStorageSync("roleCode")
  391. this.$http.get("InternalMessages/GetCount").then((response) => {
  392. if (response.state.toLowerCase() === "success") {
  393. if (response.IsRead == 1) {
  394. uni.showTabBarRedDot({
  395. index: 2
  396. })
  397. } else {
  398. uni.hideTabBarRedDot({
  399. index: 2
  400. })
  401. }
  402. }
  403. })
  404. .catch((e) => {
  405. console.log(e)
  406. })
  407. this.$http.get("Index/GetMenu").then((response) => {
  408. if (response.state.toLowerCase() === "success") {
  409. if (response.data.length > 0) {
  410. this.orderListData = listUrl.getMenuData(response.data, code)
  411. console.log(this.orderListData)
  412. }
  413. }
  414. })
  415. .catch((e) => {
  416. console.log(e)
  417. })
  418. },
  419. },
  420. }
  421. </script>
  422. <style lang="scss">
  423. /deep/.uni-dialog-content {
  424. margin: 0;
  425. padding: 0;
  426. }
  427. .yydepttit {
  428. display: inline-block;
  429. width: 85%;
  430. text-align: center;
  431. font-size: 14px;
  432. vertical-align: middle;
  433. // height: 24px;
  434. }
  435. .equipmentInfo {
  436. width: 100%;
  437. margin-top: 15px;
  438. border: 1px solid rgb(229, 229, 229);
  439. box-shadow: 0px 4px 16px 0px rgba(69, 91, 99, 0.05);
  440. margin-bottom: 20px;
  441. border-radius: 5px;
  442. .trCon {
  443. width: 100%;
  444. // font-size: 14px;
  445. .tdCon {
  446. display: inline-block;
  447. padding: 10px 0px;
  448. color: rgb(102, 102, 102);
  449. width: 48%;
  450. padding-right: 5px;
  451. text-align: center;
  452. }
  453. }
  454. }
  455. .uni-margin-wrap {
  456. width: 690rpx;
  457. width: 100%;
  458. }
  459. .swiper {
  460. height: 225px;
  461. image {
  462. width: 100%;
  463. height: 100%;
  464. }
  465. }
  466. .orderManage {
  467. .orderTit {
  468. margin-top: 15rpx;
  469. width: 100%;
  470. height: 80rpx;
  471. line-height: 80rpx;
  472. background: #ffffff;
  473. display: flex;
  474. border-bottom: 1rpx solid #eeeeee;
  475. text {
  476. font-size: 1rem;
  477. }
  478. image {
  479. width: 24rpx;
  480. height: 24rpx;
  481. padding: 8rpx;
  482. border-radius: 12px;
  483. background: #1972c2;
  484. margin: 20rpx 10rpx 20rpx 26rpx;
  485. }
  486. }
  487. .orderCon {
  488. background: #ffffff;
  489. display: flex;
  490. flex-wrap: wrap;
  491. .orderList {
  492. width: 186rpx;
  493. height: 206rpx;
  494. text-align: center;
  495. border-right: 2rpx solid #eeeeee;
  496. border-bottom: 2rpx solid #eeeeee;
  497. image {
  498. width: 40rpx;
  499. height: 40rpx;
  500. margin: 0 auto;
  501. display: block;
  502. border-radius: 35rpx;
  503. padding: 15rpx;
  504. margin-top: 45rpx;
  505. }
  506. text {
  507. line-height: 60rpx;
  508. }
  509. }
  510. .orderList:nth-child(4n + 4) {
  511. border-right: none;
  512. }
  513. .orderList:last-child {
  514. border-right: none;
  515. }
  516. }
  517. .notification {
  518. background: #ffffff;
  519. margin-bottom: 100rpx;
  520. display: flex;
  521. flex-wrap: wrap;
  522. border-bottom: 1rpx solid #eeeeee;
  523. .notifiList {
  524. width: 375rpx;
  525. height: 172rpx;
  526. padding: 46rpx 30rpx 46rpx 30rpx;
  527. text-align: left;
  528. border-right: 1rpx solid #eeeeee;
  529. border-bottom: 1rpx solid #eeeeee;
  530. box-sizing: border-box;
  531. display: flex;
  532. image {
  533. width: 48rpx;
  534. height: 48rpx;
  535. box-sizing: border-box;
  536. border-radius: 24rpx;
  537. padding: 10rpx;
  538. margin: 19rpx;
  539. }
  540. text {
  541. font-size: 24rpx;
  542. line-height: 30rpx;
  543. }
  544. }
  545. .notifiList:nth-child(2n + 2) {
  546. border-right: none;
  547. }
  548. }
  549. }
  550. </style>