人民医院前端

myTask.vue 12KB

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