人民医院前端

myTask.vue 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442
  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 class="orderTit" @click="changeStore" v-if="noticState">
  25. <image style="background: #ff9600" src="/static/icon_noticefi.png"></image>
  26. <text>公告通知</text>
  27. </view>
  28. <view class="notification">
  29. <view class="notifiList" v-for="item in noticListData" :key="item.id">
  30. <image :style="{ background: item.imageBg }" :src="item.imagePath" mode=""></image>
  31. <view class="">
  32. <text>{{ item.textTit }}</text>
  33. <text>{{ item.textCon }}</text>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. <!-- 弹框 -->
  39. <view>
  40. <uni-popup ref="inputDialogs" type="dialog">
  41. <uni-popup-dialog ref="inputClose" mode="input" :title="title" @confirm="dialogInputConfirm">
  42. <view style="width:100%;">
  43. <uni-table ref="table" border stripe type="selection" emptyText="暂无更多数据"
  44. @selection-change="selectionChange">
  45. <uni-tr>
  46. <uni-th align="center">科室</uni-th>
  47. </uni-tr>
  48. <uni-tr v-for="(item, index) in allowData" :key="index">
  49. <uni-td align="center">{{ $mHelper.findParents(departList, item.deptid) }}</uni-td>
  50. </uni-tr>
  51. </uni-table>
  52. </view>
  53. </uni-popup-dialog>
  54. </uni-popup>
  55. </view>
  56. </view>
  57. </template>
  58. <script>
  59. import {
  60. mapGetters
  61. } from "vuex"
  62. import store from '@/store';
  63. import {
  64. getToken
  65. } from '@/utils/auth'
  66. import listUrl from '@/utils/listUrl.js'
  67. import pageData from '../myTask/repairList/addRepair/pageData.js'
  68. export default {
  69. data() {
  70. return {
  71. indicatorDots: true,
  72. getFontSizeValue: '1rem',
  73. autoplay: true,
  74. interval: 2000,
  75. noticState: false,
  76. duration: 500,
  77. bannnerData: [],
  78. orderListData: [],
  79. noticListData: [],
  80. departList: [],
  81. allowData: [],
  82. title: "允用科室",
  83. selectedIndexs:[],
  84. onchangedept: ''
  85. }
  86. },
  87. computed: {
  88. ...mapGetters(["State"]),
  89. },
  90. onLoad() {
  91. this.init()
  92. this.saveDept()
  93. this.getFontSizeValue = uni.getStorageSync('fontSizeValue') + 'rem'
  94. // this.getFontSizeValue = '1.5rem'
  95. if (uni.getStorageSync("roleCode") === "APRY") {
  96. uni.hideTabBar()
  97. }
  98. if (uni.getStorageSync("isAllow") === "1") {
  99. var str = uni.getStorageSync('storageAllowUserDept') //获取允用科室ids
  100. var arr = []
  101. if (str.indexOf(',') >= 0) {
  102. for (var i = 0; i < str.split(",").length; i++) {
  103. arr.push({
  104. deptname: "",
  105. deptid: str.split(",")[i]
  106. })
  107. }
  108. this.allowData = arr
  109. }
  110. this.$nextTick(function() {
  111. // DOM 更新了
  112. this.$refs.inputDialogs.open()
  113. })
  114. }
  115. // uni.hideTabBar()
  116. },
  117. methods: {
  118. selectionChange(e){
  119. this.selectedIndexs = e.detail.index
  120. this.onchangedept = this.allowData[e.detail.index].deptid
  121. console.log(this.allowData[e.detail.index])
  122. },
  123. dialogInputConfirm(){
  124. if(this.selectedIndexs.length!=1){
  125. this.$mHelper.toast("请选择一行数据");
  126. return;
  127. }
  128. const params={
  129. deptId:this.onchangedept,
  130. userid:uni.getStorageSync('userId')
  131. }
  132. this.$http.get('UserAccount/ChangeDeptId', params).then(res=>{
  133. if(res.state == "success"){
  134. this.$mHelper.toast(res.message);
  135. this.$refs.inputDialogs.close()
  136. this.$mStore.dispatch("GetInfo").then((e)=>{
  137. if(e.data.Dept){
  138. uni.setStorageSync('deptId', e.data.Dept.F_DeptId)
  139. uni.setStorageSync('deptName', e.data.Dept.F_DeptName)
  140. }
  141. })
  142. }
  143. })
  144. },
  145. init() {
  146. // #ifdef APP-PLUS
  147. let timer
  148. timer = setInterval(() => {
  149. plus.push.getClientInfoAsync((info) => {
  150. let cid = info["clientid"];
  151. if (cid) {
  152. clearInterval(timer)
  153. this.clienGet(cid) //获取cid
  154. }
  155. });
  156. }, 5000)
  157. this.upData()
  158. // #endif
  159. this.bannnerData = this.$mConstDataConfig.bannnerData
  160. this.getMenuPermissions() //获取用户权限
  161. },
  162. saveDept() {
  163. pageData.getDet((res, data) => {
  164. this.departList = data
  165. uni.setStorageSync('deptTreeData', JSON.stringify(res))
  166. uni.setStorageSync('deptAllList', JSON.stringify(data))
  167. })
  168. },
  169. changeStore() {
  170. this.$mStore.dispatch("STATE", 3)
  171. },
  172. workOrderListClick(item) {
  173. uni.navigateTo({
  174. url: item.navigateToUrl,
  175. })
  176. },
  177. clienGet(cid) {
  178. let apptype
  179. if (plus.device.model.indexOf('iPhone') > -1) {
  180. apptype = 2;
  181. } else {
  182. apptype = 1;
  183. }
  184. const params = {
  185. apptype: apptype,
  186. clientid: cid,
  187. token: uni.getStorageSync("token"),
  188. }
  189. this.$http.get("PushMessage/PutAppClientIdAsync", params).then((response) => {
  190. if (response.state.toLowerCase() === "success") {
  191. let data = response.message
  192. }
  193. })
  194. .catch((e) => {
  195. console.log(e)
  196. })
  197. },
  198. upData() {
  199. plus.runtime.getProperty(plus.runtime.appid, function(wgtinfo) {
  200. uni.setStorageSync('versionCode', wgtinfo.version)
  201. });
  202. let typeUp = ''
  203. if (plus.device.model.indexOf('iPhone') > -1) {
  204. typeUp = 1;
  205. } else {
  206. typeUp = 0;
  207. }
  208. const params = {
  209. type: typeUp,
  210. isNew: true,
  211. }
  212. this.$http.get('/ApplicationsVersion/GetAndroid', params).then((response) => {
  213. if (response.state == "success") {
  214. let data = response.data
  215. console.log(data)
  216. //NewCode_ = data.data.F_VersionCode;
  217. const nowVersionCode = uni.getStorageSync('versionCode')
  218. const serveVersionCode = data.F_VersionCode
  219. console.log(nowVersionCode + "---" + serveVersionCode)
  220. if (nowVersionCode !== serveVersionCode) {
  221. if (typeUp === 0) {
  222. plus.runtime.openURL(data.FileUrl[0].F_FileUrl, err => {
  223. plus.runtime.openURL(data.FileUrl[0].F_FileUrl);
  224. }, 'com.android.browser');
  225. // uni.showModal({
  226. // title: '更新',
  227. // content: '是否更新',
  228. // success: function (res) {
  229. // if (res.confirm) {
  230. // console.log(data.F_FileUrl)
  231. // } else if (res.cancel) {
  232. // this.$mHelper.toast("取消更新");
  233. // }
  234. // }
  235. // });
  236. } else if (typeUp === 1) {
  237. plus.runtime.openURL(data.F_Url);
  238. // uni.showModal({
  239. // title: '更新',
  240. // content: '是否更新',
  241. // success: function (res) {
  242. // if (res.confirm) {
  243. // plus.runtime.openURL(data.F_Url);
  244. // } else if (res.cancel) {
  245. // this.$mHelper.toast("取消更新");
  246. // }
  247. // }
  248. // });
  249. }
  250. }
  251. }
  252. }).catch((e) => {
  253. console.log(e);
  254. })
  255. },
  256. getMenuPermissions() {
  257. let code = uni.getStorageSync("roleCode")
  258. this.$http.get("InternalMessages/GetCount").then((response) => {
  259. if (response.state.toLowerCase() === "success") {
  260. if (response.IsRead == 1) {
  261. uni.showTabBarRedDot({
  262. index: 2
  263. })
  264. } else {
  265. uni.hideTabBarRedDot({
  266. index: 2
  267. })
  268. }
  269. }
  270. })
  271. .catch((e) => {
  272. console.log(e)
  273. })
  274. this.$http.get("Index/GetMenu").then((response) => {
  275. if (response.state.toLowerCase() === "success") {
  276. if (response.data.length>0) {
  277. this.orderListData = listUrl.getMenuData(response.data,code)
  278. // console.log(this.orderListData)
  279. }
  280. }
  281. })
  282. .catch((e) => {
  283. console.log(e)
  284. })
  285. },
  286. },
  287. }
  288. </script>
  289. <style lang="scss">
  290. .equipmentInfo {
  291. width: 100%;
  292. margin-top: 15px;
  293. border: 1px solid rgb(229, 229, 229);
  294. box-shadow: 0px 4px 16px 0px rgba(69, 91, 99, 0.05);
  295. margin-bottom: 20px;
  296. border-radius: 5px;
  297. .trCon {
  298. width: 100%;
  299. // font-size: 14px;
  300. .tdCon {
  301. display: inline-block;
  302. padding: 10px 0px;
  303. color: rgb(102, 102, 102);
  304. width: 48%;
  305. padding-right: 5px;
  306. text-align: center;
  307. }
  308. }
  309. }
  310. .uni-margin-wrap {
  311. width: 690rpx;
  312. width: 100%;
  313. }
  314. .swiper {
  315. height: 225px;
  316. image {
  317. width: 100%;
  318. height: 100%;
  319. }
  320. }
  321. .orderManage {
  322. .orderTit {
  323. margin-top: 15rpx;
  324. width: 100%;
  325. height: 80rpx;
  326. line-height: 80rpx;
  327. background: #ffffff;
  328. display: flex;
  329. border-bottom: 1rpx solid #eeeeee;
  330. text {
  331. font-size: 1rem;
  332. }
  333. image {
  334. width: 24rpx;
  335. height: 24rpx;
  336. padding: 8rpx;
  337. border-radius: 12px;
  338. background: #1972c2;
  339. margin: 20rpx 10rpx 20rpx 26rpx;
  340. }
  341. }
  342. .orderCon {
  343. background: #ffffff;
  344. display: flex;
  345. flex-wrap: wrap;
  346. .orderList {
  347. width: 186rpx;
  348. height: 206rpx;
  349. text-align: center;
  350. border-right: 2rpx solid #eeeeee;
  351. border-bottom: 2rpx solid #eeeeee;
  352. image {
  353. width: 40rpx;
  354. height: 40rpx;
  355. margin: 0 auto;
  356. display: block;
  357. border-radius: 35rpx;
  358. padding: 15rpx;
  359. margin-top: 45rpx;
  360. }
  361. text {
  362. line-height: 60rpx;
  363. }
  364. }
  365. .orderList:nth-child(4n + 4) {
  366. border-right: none;
  367. }
  368. .orderList:last-child {
  369. border-right: none;
  370. }
  371. }
  372. .notification {
  373. background: #ffffff;
  374. margin-bottom: 100rpx;
  375. display: flex;
  376. flex-wrap: wrap;
  377. border-bottom: 1rpx solid #eeeeee;
  378. .notifiList {
  379. width: 375rpx;
  380. height: 172rpx;
  381. padding: 46rpx 30rpx 46rpx 30rpx;
  382. text-align: left;
  383. border-right: 1rpx solid #eeeeee;
  384. border-bottom: 1rpx solid #eeeeee;
  385. box-sizing: border-box;
  386. display: flex;
  387. image {
  388. width: 48rpx;
  389. height: 48rpx;
  390. box-sizing: border-box;
  391. border-radius: 24rpx;
  392. padding: 10rpx;
  393. margin: 19rpx;
  394. }
  395. text {
  396. font-size: 24rpx;
  397. line-height: 30rpx;
  398. }
  399. }
  400. .notifiList:nth-child(2n + 2) {
  401. border-right: none;
  402. }
  403. }
  404. }
  405. </style>