| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637 |
- <template>
- <view style="overflow: hidden;">
- <page-meta :root-font-size="getFontSizeValue"></page-meta>
- <view class="uni-margin-wrap">
- <swiper class="swiper" circular :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval"
- :duration="duration">
- <swiper-item v-for="item in bannnerData" :key="item.id">
- <image :src="item.imgPath" mode=""></image>
- </swiper-item>
- </swiper>
- </view>
- <view class="orderManage">
- <view v-show="orderListData.filter(val=>val.type === 1).length !== 0" class="orderTit" style="padding-left: 15px;color: rgb(126, 131, 125);">
- <text style="width: 4px;background-color: rgb(26, 188, 156);height: 20px;margin-top: 10px;margin-right: 5px;"></text>
- <text>报工模块</text>
- </view>
- <view class="orderCon">
- <view class="orderList" v-show="item.type === 1" v-for="item in orderListData" :key="item.id" @click="workOrderListClick(item)">
- <image :style="{ background: item.imageBg }" :src="item.imagePath" mode=""></image>
- <text>{{ item.text }}</text>
- </view>
- </view>
-
- <view v-show="orderListData.filter(val=>val.type === 2).length !== 0" class="orderTit" style="padding-left: 15px;color: rgb(126, 131, 125);">
- <text style="width: 4px;background-color: rgb(255, 170, 0);height: 20px;margin-top: 10px;margin-right: 5px;"></text>
- <text>接单模块</text>
- </view>
- <view class="orderCon">
- <view class="orderList" v-show="item.type === 2" v-for="item in orderListData" :key="item.id" @click="workOrderListClick(item)">
- <image :style="{ background: item.imageBg }" :src="item.imagePath" mode=""></image>
- <text>{{ item.text }}</text>
- </view>
- </view>
-
-
- <view v-if="isgly==1" class="orderTit" style="padding-left: 15px;color: rgb(126, 131, 125);">
- <text
- style="width: 4px;background-color: rgb(26, 188, 156);height: 20px;margin-top: 10px;margin-right: 5px;"></text>
- <text>报表模块</text>
- </view>
- <view v-if="isgly==1" class="orderCon">
-
- <view class="orderList" v-for="item in reportListData" :key="item.id" @click="workOrderListClick(item)">
- <image :style="{ background: item.imageBg }" :src="item.imagePath" mode=""></image>
- <text>{{ item.text }}</text>
- </view>
-
- <view class="orderList" v-show="item.type === 3" v-for="item in orderListData" :key="item.id" @click="workOrderListClick(item)">
- <image :style="{ background: item.imageBg }" :src="item.imagePath" mode=""></image>
- <text>{{ item.text }}</text>
- </view>
-
- </view>
- <view class="orderTit" @click="changeStore" v-if="noticState">
- <image style="background: #ff9600" src="/static/icon_noticefi.png"></image>
- <text>公告通知</text>
- </view>
- <view class="notification">
- <view class="notifiList" v-for="item in noticListData" :key="item.id">
- <image :style="{ background: item.imageBg }" :src="item.imagePath" mode=""></image>
- <view class="">
- <text>{{ item.textTit }}</text>
- <text>{{ item.textCon }}</text>
- </view>
- </view>
- </view>
- </view>
- <!-- 弹框 -->
- <view>
- <uni-popup ref="inputDialogs" type="dialog">
- <uni-popup-dialog ref="inputClose" mode="input" :title="title" @confirm="dialogInputConfirm">
- <view style="height: 600rpx;overflow-y: auto;">
- <radio-group @change="radioChange" style="width: 100%;height: 600rpx;">
- <label class="uni-list-cell uni-list-cell-pd" v-for="(item, index) in allowData"
- :key="index">
- <view v-show="item.deptname"
- style="width:100%;line-height: 24px;color: #606266;margin-bottom: 10px;">
- <radio style="width: 30px;" :value="item.deptid" :checked="index === current" />
- <text class="yydepttit">{{ item.deptname }}</text>
- </view>
- </label>
- </radio-group>
- <!-- <uni-table style="height: 600rpx;" ref="table" border stripe emptyText="暂无更多数据">
- <uni-tr>
- <uni-th align="center">请选择</uni-th>
- </uni-tr>
- <uni-tr>
- <uni-td align="center">
- <radio-group @change="radioChange" style="width: 100%;">
- <label class="uni-list-cell uni-list-cell-pd" v-for="(item, index) in allowData"
- :key="index">
- <view style="padding: 5px 0;position: relative;width: 100%;">
- <radio style="width: 30px;position: absolute;left: 0;"
- :value="item.deptid" :checked="index === current" />
- <text style="margin-left: 15px;display: inline-block;width: 80%;">{{ $mHelper.findParents(departList, item.deptid) }}</text>
- </view>
- </label>
- </radio-group>
- </uni-td>
- </uni-tr>
- </uni-table> -->
- </view>
- </uni-popup-dialog>
- </uni-popup>
- </view>
- </view>
- </template>
- <script>
- import {
- mapGetters
- } from "vuex"
- import store from '@/store';
- import {
- getToken
- } from '@/utils/auth'
- import listUrl from '@/utils/listUrl.js'
- import pageData from '../myTask/repairList/addRepair/pageData.js'
- export default {
- data() {
- return {
- isgly: 0,
- indicatorDots: true,
- getFontSizeValue: '1rem',
- autoplay: true,
- interval: 2000,
- noticState: false,
- duration: 500,
- bannnerData: [],
- orderListData: [],
- reportListData: [{
- id: "15",
- imagePath: "../../static/icon_ri.png",
- imageBg: "#00c3c3",
- text: "日报", //WorkOrder/GetLDDealList
- navigateToUrl: "/pages/myTask/reportForm/reportForm?reportType=0",
- },
- {
- id: "16",
- imagePath: "../../static/icon_yue.png",
- imageBg: "#00c3c3",
- text: "月报", //WorkOrder/GetLDDealList
- navigateToUrl: "/pages/myTask/reportForm/reportForm?reportType=1",
- },
- {
- id: "17",
- imagePath: "../../static/icon_rili.png",
- imageBg: "#00c3c3",
- text: "实时数据", //WorkOrder/GetLDDealList
- navigateToUrl: "/pages/myTask/reportForm/reportForm?reportType=2",
- },
- // {
- // id: "18",
- // imagePath: "../../static/data1.png",
- // imageBg: "#62c7f5",
- // text: "运维指标", //WorkOrder/GetLDDealList
- // navigateToUrl: "/pages/myTask/opertraget/opertraget",
- // },
- ],
- noticListData: [],
- departList: [],
- allowData: [],
- title: "允用科室",
- selectedIndexs: [],
- current: "",
- onchangedept: ''
- }
- },
- computed: {
- ...mapGetters([
- "State",
- "userId",
- "deptId"
- ])
- },
- onLoad() {
- // this.getStodept()
- this.init()
- this.saveDept()
- this.getFontSizeValue = uni.getStorageSync('fontSizeValue') + 'rem'
- // this.getFontSizeValue = '1.5rem'
- if (uni.getStorageSync("roleCode") === "APRY") {
- uni.hideTabBar()
- }
-
-
- if (uni.getStorageSync("roleCode") === "BMZG" || uni.getStorageSync("roleCode") === "WXBZZ") {
- this.isgly = 1
- }
-
-
- console.log(uni.getStorageSync("isAllow"))
- if (uni.getStorageSync("isAllow") === "1") {
- var str = uni.getStorageSync('storageAllowUserDept') //获取允用科室ids
- var arr = []
- pageData.getDet((res, data) => {
- this.departList = data
- if (str.indexOf(',') >= 0) {
- for (var i = 0; i < str.split(",").length; i++) {
- if (uni.getStorageSync('deptId') == str.split(",")[i]) {
- this.current = 0;
- arr.unshift({
- deptid: str.split(",")[i],
- deptname: this.$mHelper.findParents(this.departList, str.split(",")[i])
- })
- }else{
- arr.push({
- deptid: str.split(",")[i],
- deptname: this.$mHelper.findParents(this.departList, str.split(",")[i])
- })
- }
- }
- this.allowData = arr
- }
- this.$nextTick(function() {
- this.$refs.inputDialogs.open()
- })
- })
- }
- // this.updatePass()
- // this.isLongPass()
- // uni.hideTabBar()
- },
- methods: {
- updatePass(){
- const reg = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,20}$/;
- const pass = uni.getStorageSync('loginpass');
- if (!reg.test(pass)) {
- uni.showModal({
- title: '提示',
- content: '您的密码不符合规范,请更新密码!',
- showCancel: false,
- success: function(res) {
- if (res.confirm) {
- uni.navigateTo({
- url: "/pages/setting/fontSizeSettingPass/fontSizeSettingPass"
- })
- } else if (res.cancel) {
- console.log('取消');
- }
- }
- });
- }
- },
- isLongPass(){
- const params = {}
- this.$http.get('UserAccount/GetUserPasswordTime', params).then(res => {
- if (res.state == "success") {
- if(res.data == 1){
- uni.showModal({
- title: '提示',
- content: '您的密码已经超三个月未修改,请更新密码!',
- showCancel: false,
- success: function(res) {
- if (res.confirm) {
- uni.navigateTo({
- url: "/pages/setting/fontSizeSettingPass/fontSizeSettingPass"
- })
- } else if (res.cancel) {
- console.log('取消');
- }
- }
- });
- }
- }
- })
- },
- radioChange: function(evt) {
- this.onchangedept = evt.detail.value;
- console.log(evt.detail.value)
- for (let i = 0; i < this.allowData.length; i++) {
- if (this.allowData[i].deptid === evt.detail.value) {
- this.current = i;
- break;
- }
- }
- },
- selectionChange(e) {
- this.selectedIndexs = e.detail.index
- this.onchangedept = this.allowData[e.detail.index].deptid
- console.log(this.allowData[e.detail.index])
- },
- dialogInputConfirm() {
- // if (this.selectedIndexs.length != 1) {
- // this.$mHelper.toast("请选择一行数据");
- // return;
- // }
- const params = {
- deptId: this.onchangedept || uni.getStorageSync('deptId'),
- userid: this.$store.getters.userId || uni.getStorageSync('userId')
- }
- this.$http.get('UserAccount/ChangeDeptId', params).then(res => {
- if (res.state == "success") {
- this.$mHelper.toast(res.message);
- this.$refs.inputDialogs.close()
- this.$mStore.dispatch("GetInfo").then((e) => {
- if (e.data.Dept) {
- uni.setStorageSync('deptId', e.data.Dept.F_DeptId)
- uni.setStorageSync('deptName', e.data.Dept.F_DeptName)
- }
- })
- }
- })
- },
- init() {
- // #ifdef APP-PLUS
- let timer
- timer = setInterval(() => {
- plus.push.getClientInfoAsync((info) => {
- let cid = info["clientid"];
- if (cid) {
- clearInterval(timer)
-
- this.clienGet(cid) //获取cid
- }
- });
- }, 5000)
- this.upData()
- // #endif
- this.bannnerData = this.$mConstDataConfig.bannnerData
- this.getMenuPermissions() //获取用户权限
- },
- //重新存储部门数据
- // getStodept(){
- // this.$mStore.dispatch("GetInfo").then((e)=>{
- // if(e.data.Dept){
- // uni.setStorageSync('deptId', e.data.Dept.F_DeptId)
- // uni.setStorageSync('deptName', e.data.Dept.F_DeptName)
- // }
- // })
- // },
- saveDept() {
- pageData.getDet((res, data) => {
- this.departList = data
- uni.setStorageSync('deptTreeData', JSON.stringify(res))
- uni.setStorageSync('deptAllList', JSON.stringify(data))
- })
- },
- changeStore() {
- this.$mStore.dispatch("STATE", 3)
- },
- workOrderListClick(item) {
- uni.navigateTo({
- url: item.navigateToUrl,
- })
- },
- clienGet(cid) {
- let apptype
- if (plus.device.model.indexOf('iPhone') > -1) {
- apptype = 2;
- } else {
- apptype = 1;
- }
- const params = {
- apptype: apptype,
- clientid: cid,
- token: uni.getStorageSync("token"),
- }
- this.$http.get("PushMessage/PutAppClientIdAsync", params).then((response) => {
- if (response.state.toLowerCase() === "success") {
- console.log(cid)
- let data = response.message
- }
- })
- .catch((e) => {
- console.log(e)
- })
- },
- upData() {
- plus.runtime.getProperty(plus.runtime.appid, function(wgtinfo) {
- uni.setStorageSync('versionCode', wgtinfo.version)
- });
- let typeUp = ''
- if (plus.device.model.indexOf('iPhone') > -1) {
- typeUp = 1;
- } else {
- typeUp = 0;
- }
- const params = {
- type: typeUp,
- isNew: true,
- }
- this.$http.get('/ApplicationsVersion/GetAndroid', params).then((response) => {
- if (response.state == "success") {
- let data = response.data
- console.log(data)
- //NewCode_ = data.data.F_VersionCode;
- const nowVersionCode = uni.getStorageSync('versionCode')
- const serveVersionCode = data.F_VersionCode
- console.log(nowVersionCode + "---" + serveVersionCode)
- if (nowVersionCode !== serveVersionCode) {
- if (typeUp === 0) {
- uni.showModal({
- title: '更新',
- content: '是否更新',
- showCancel: false,
- success: function(res) {
- if (res.confirm) {
- plus.runtime.openURL(data.FileUrl[0].F_FileUrl, err => {
- plus.runtime.openURL(data.FileUrl[0].F_FileUrl);
- }, 'com.android.browser');
- } else if (res.cancel) {
- this.$mHelper.toast("取消更新");
- }
- }
- });
- } else if (typeUp === 1) {
- uni.showModal({
- title: '更新',
- content: '是否更新',
- showCancel: false,
- success: function(res) {
- if (res.confirm) {
- plus.runtime.openURL(data.F_Url);
- } else if (res.cancel) {
- this.$mHelper.toast("取消更新");
- }
- }
- });
- }
- }
- }
- }).catch((e) => {
- console.log(e);
- })
- },
- getMenuPermissions() {
- let code = uni.getStorageSync("roleCode")
- this.$http.get("InternalMessages/GetCount").then((response) => {
- if (response.state.toLowerCase() === "success") {
- if (response.IsRead == 1) {
- uni.showTabBarRedDot({
- index: 2
- })
- } else {
- uni.hideTabBarRedDot({
- index: 2
- })
- }
- }
- })
- .catch((e) => {
- console.log(e)
- })
- this.$http.get("Index/GetMenu").then((response) => {
- if (response.state.toLowerCase() === "success") {
- if (response.data.length > 0) {
- this.orderListData = listUrl.getMenuData(response.data, code)
- console.log(this.orderListData)
- if (uni.getStorageSync("roleCode") === "GLY" || uni.getStorageSync("roleCode") === "DDBZ" || uni.getStorageSync("roleCode") === "BMZG") {
- this.orderListData.push({
- type : 3,
- id: "18",
- imagePath: "../../static/data1.png",
- imageBg: "#62c7f5",
- text: "运维指标",
- navigateToUrl: "/pages/myTask/opertraget/opertraget"
- })
- }
- }
- }
- })
- .catch((e) => {
- console.log(e)
- })
- },
- },
- }
- </script>
- <style lang="scss">
- /deep/.uni-dialog-content {
- margin: 0;
- padding: 0;
- }
- .yydepttit {
- display: inline-block;
- width: 85%;
- text-align: center;
- font-size: 14px;
- vertical-align: middle;
- // height: 24px;
- }
- .equipmentInfo {
- width: 100%;
- margin-top: 15px;
- border: 1px solid rgb(229, 229, 229);
- box-shadow: 0px 4px 16px 0px rgba(69, 91, 99, 0.05);
- margin-bottom: 20px;
- border-radius: 5px;
- .trCon {
- width: 100%;
- // font-size: 14px;
- .tdCon {
- display: inline-block;
- padding: 10px 0px;
- color: rgb(102, 102, 102);
- width: 48%;
- padding-right: 5px;
- text-align: center;
- }
- }
- }
- .uni-margin-wrap {
- width: 690rpx;
- width: 100%;
- }
- .swiper {
- height: 225px;
- image {
- width: 100%;
- height: 100%;
- }
- }
- .orderManage {
- .orderTit {
- margin-top: 15rpx;
- width: 100%;
- height: 80rpx;
- line-height: 80rpx;
- background: #ffffff;
- display: flex;
- border-bottom: 1rpx solid #eeeeee;
- text {
- font-size: 1rem;
- }
- image {
- width: 24rpx;
- height: 24rpx;
- padding: 8rpx;
- border-radius: 12px;
- background: #1972c2;
- margin: 20rpx 10rpx 20rpx 26rpx;
- }
- }
- .orderCon {
- background: #ffffff;
- display: flex;
- flex-wrap: wrap;
- .orderList {
- width: 186rpx;
- height: 206rpx;
- text-align: center;
- border-right: 2rpx solid #eeeeee;
- border-bottom: 2rpx solid #eeeeee;
- image {
- width: 40rpx;
- height: 40rpx;
- margin: 0 auto;
- display: block;
- border-radius: 35rpx;
- padding: 15rpx;
- margin-top: 45rpx;
- }
- text {
- line-height: 60rpx;
- }
- }
- .orderList:nth-child(4n + 4) {
- border-right: none;
- }
- .orderList:last-child {
- border-right: none;
- }
- }
- .notification {
- background: #ffffff;
- margin-bottom: 100rpx;
- display: flex;
- flex-wrap: wrap;
- border-bottom: 1rpx solid #eeeeee;
- .notifiList {
- width: 375rpx;
- height: 172rpx;
- padding: 46rpx 30rpx 46rpx 30rpx;
- text-align: left;
- border-right: 1rpx solid #eeeeee;
- border-bottom: 1rpx solid #eeeeee;
- box-sizing: border-box;
- display: flex;
- image {
- width: 48rpx;
- height: 48rpx;
- box-sizing: border-box;
- border-radius: 24rpx;
- padding: 10rpx;
- margin: 19rpx;
- }
- text {
- font-size: 24rpx;
- line-height: 30rpx;
- }
- }
- .notifiList:nth-child(2n + 2) {
- border-right: none;
- }
- }
- }
- </style>
|