人民医院前端

myTask.vue 12KB

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