人民医院前端

myTask.vue 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436
  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.$mStore.dispatch("GetInfo").then((e)=>{
  133. if(e.data.Dept){
  134. uni.setStorageSync('deptId', e.data.Dept.F_DeptId)
  135. uni.setStorageSync('deptName', e.data.Dept.F_DeptName)
  136. }
  137. })
  138. },
  139. init() {
  140. // #ifdef APP-PLUS
  141. let timer
  142. timer = setInterval(() => {
  143. plus.push.getClientInfoAsync((info) => {
  144. let cid = info["clientid"];
  145. if (cid) {
  146. clearInterval(timer)
  147. this.clienGet(cid) //获取cid
  148. }
  149. });
  150. }, 5000)
  151. this.upData()
  152. // #endif
  153. this.bannnerData = this.$mConstDataConfig.bannnerData
  154. this.getMenuPermissions() //获取用户权限
  155. },
  156. saveDept() {
  157. pageData.getDet((res, data) => {
  158. this.departList = data
  159. uni.setStorageSync('deptTreeData', JSON.stringify(res))
  160. uni.setStorageSync('deptAllList', JSON.stringify(data))
  161. })
  162. },
  163. changeStore() {
  164. this.$mStore.dispatch("STATE", 3)
  165. },
  166. workOrderListClick(item) {
  167. uni.navigateTo({
  168. url: item.navigateToUrl,
  169. })
  170. },
  171. clienGet(cid) {
  172. let apptype
  173. if (plus.device.model.indexOf('iPhone') > -1) {
  174. apptype = 2;
  175. } else {
  176. apptype = 1;
  177. }
  178. const params = {
  179. apptype: apptype,
  180. clientid: cid,
  181. token: uni.getStorageSync("token"),
  182. }
  183. this.$http.get("PushMessage/PutAppClientIdAsync", params).then((response) => {
  184. if (response.state.toLowerCase() === "success") {
  185. let data = response.message
  186. }
  187. })
  188. .catch((e) => {
  189. console.log(e)
  190. })
  191. },
  192. upData() {
  193. plus.runtime.getProperty(plus.runtime.appid, function(wgtinfo) {
  194. uni.setStorageSync('versionCode', wgtinfo.version)
  195. });
  196. let typeUp = ''
  197. if (plus.device.model.indexOf('iPhone') > -1) {
  198. typeUp = 1;
  199. } else {
  200. typeUp = 0;
  201. }
  202. const params = {
  203. type: typeUp,
  204. isNew: true,
  205. }
  206. this.$http.get('/ApplicationsVersion/GetAndroid', params).then((response) => {
  207. if (response.state == "success") {
  208. let data = response.data
  209. console.log(data)
  210. //NewCode_ = data.data.F_VersionCode;
  211. const nowVersionCode = uni.getStorageSync('versionCode')
  212. const serveVersionCode = data.F_VersionCode
  213. console.log(nowVersionCode + "---" + serveVersionCode)
  214. if (nowVersionCode !== serveVersionCode) {
  215. if (typeUp === 0) {
  216. plus.runtime.openURL(data.FileUrl[0].F_FileUrl, err => {
  217. plus.runtime.openURL(data.FileUrl[0].F_FileUrl);
  218. }, 'com.android.browser');
  219. // uni.showModal({
  220. // title: '更新',
  221. // content: '是否更新',
  222. // success: function (res) {
  223. // if (res.confirm) {
  224. // console.log(data.F_FileUrl)
  225. // } else if (res.cancel) {
  226. // this.$mHelper.toast("取消更新");
  227. // }
  228. // }
  229. // });
  230. } else if (typeUp === 1) {
  231. plus.runtime.openURL(data.F_Url);
  232. // uni.showModal({
  233. // title: '更新',
  234. // content: '是否更新',
  235. // success: function (res) {
  236. // if (res.confirm) {
  237. // plus.runtime.openURL(data.F_Url);
  238. // } else if (res.cancel) {
  239. // this.$mHelper.toast("取消更新");
  240. // }
  241. // }
  242. // });
  243. }
  244. }
  245. }
  246. }).catch((e) => {
  247. console.log(e);
  248. })
  249. },
  250. getMenuPermissions() {
  251. let code = uni.getStorageSync("roleCode")
  252. this.$http.get("InternalMessages/GetCount").then((response) => {
  253. if (response.state.toLowerCase() === "success") {
  254. if (response.IsRead == 1) {
  255. uni.showTabBarRedDot({
  256. index: 2
  257. })
  258. } else {
  259. uni.hideTabBarRedDot({
  260. index: 2
  261. })
  262. }
  263. }
  264. })
  265. .catch((e) => {
  266. console.log(e)
  267. })
  268. this.$http.get("Index/GetMenu").then((response) => {
  269. if (response.state.toLowerCase() === "success") {
  270. if (response.data.length>0) {
  271. this.orderListData = listUrl.getMenuData(response.data,code)
  272. // console.log(this.orderListData)
  273. }
  274. }
  275. })
  276. .catch((e) => {
  277. console.log(e)
  278. })
  279. },
  280. },
  281. }
  282. </script>
  283. <style lang="scss">
  284. .equipmentInfo {
  285. width: 100%;
  286. margin-top: 15px;
  287. border: 1px solid rgb(229, 229, 229);
  288. box-shadow: 0px 4px 16px 0px rgba(69, 91, 99, 0.05);
  289. margin-bottom: 20px;
  290. border-radius: 5px;
  291. .trCon {
  292. width: 100%;
  293. // font-size: 14px;
  294. .tdCon {
  295. display: inline-block;
  296. padding: 10px 0px;
  297. color: rgb(102, 102, 102);
  298. width: 48%;
  299. padding-right: 5px;
  300. text-align: center;
  301. }
  302. }
  303. }
  304. .uni-margin-wrap {
  305. width: 690rpx;
  306. width: 100%;
  307. }
  308. .swiper {
  309. height: 225px;
  310. image {
  311. width: 100%;
  312. height: 100%;
  313. }
  314. }
  315. .orderManage {
  316. .orderTit {
  317. margin-top: 15rpx;
  318. width: 100%;
  319. height: 80rpx;
  320. line-height: 80rpx;
  321. background: #ffffff;
  322. display: flex;
  323. border-bottom: 1rpx solid #eeeeee;
  324. text {
  325. font-size: 1rem;
  326. }
  327. image {
  328. width: 24rpx;
  329. height: 24rpx;
  330. padding: 8rpx;
  331. border-radius: 12px;
  332. background: #1972c2;
  333. margin: 20rpx 10rpx 20rpx 26rpx;
  334. }
  335. }
  336. .orderCon {
  337. background: #ffffff;
  338. display: flex;
  339. flex-wrap: wrap;
  340. .orderList {
  341. width: 186rpx;
  342. height: 206rpx;
  343. text-align: center;
  344. border-right: 2rpx solid #eeeeee;
  345. border-bottom: 2rpx solid #eeeeee;
  346. image {
  347. width: 40rpx;
  348. height: 40rpx;
  349. margin: 0 auto;
  350. display: block;
  351. border-radius: 35rpx;
  352. padding: 15rpx;
  353. margin-top: 45rpx;
  354. }
  355. text {
  356. line-height: 60rpx;
  357. }
  358. }
  359. .orderList:nth-child(4n + 4) {
  360. border-right: none;
  361. }
  362. .orderList:last-child {
  363. border-right: none;
  364. }
  365. }
  366. .notification {
  367. background: #ffffff;
  368. margin-bottom: 100rpx;
  369. display: flex;
  370. flex-wrap: wrap;
  371. border-bottom: 1rpx solid #eeeeee;
  372. .notifiList {
  373. width: 375rpx;
  374. height: 172rpx;
  375. padding: 46rpx 30rpx 46rpx 30rpx;
  376. text-align: left;
  377. border-right: 1rpx solid #eeeeee;
  378. border-bottom: 1rpx solid #eeeeee;
  379. box-sizing: border-box;
  380. display: flex;
  381. image {
  382. width: 48rpx;
  383. height: 48rpx;
  384. box-sizing: border-box;
  385. border-radius: 24rpx;
  386. padding: 10rpx;
  387. margin: 19rpx;
  388. }
  389. text {
  390. font-size: 24rpx;
  391. line-height: 30rpx;
  392. }
  393. }
  394. .notifiList:nth-child(2n + 2) {
  395. border-right: none;
  396. }
  397. }
  398. }
  399. </style>