人民医院前端

myTask.vue 15KB

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