| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954 |
- <!--
- * @Title:
- * @Description: 首页
- * @Author: swp
- * @Date: 2022-08-24 10:49:21
- * @LastEditors:
- * @LastEditTime: 2022-08-24 10:49:21
- -->
- <template>
- <view class="container">
- <!-- 导航栏 #3F9EFF-->
- <uni-nav-bar :fixed="true" backgroundColor="#3F9EFF" statusBar="false" height="75px">
- <block slot="left">
- <view class="view-flex-block-center">
- <image src="/static/images/logo_start.png" class="logo" mode="widthFix"></image>
- </view>
- </block>
- <view class="view-flex-block-center" style="width: 100%;">
- <view class="view-flex-inline-center">
- <text style="color: #ffffff; font-size: 1.2rem;font-family: Microsoft YaHei;">{{title}}</text>
- </view>
- </view>
- <block slot="right">
- <view style="margin-right:20rpx" @click="onNoticeMoreClick">
- <uni-badge class="uni-badge-left-margin" absolute="rightTop" :is-dot="noticeDot" :text="noticeValue"
- size="small">
- <uni-icons class="input-uni-icon" type="notification" size="24" color="#FFFFFF" />
- </uni-badge>
- </view>
- </block>
- </uni-nav-bar>
- <!-- 头部按钮 -->
- <view class="nav">
- <u-grid :col="4" :border="false">
- <u-grid-item v-if="navButtonIndex[index]" bg-color="transparent" v-for="(item, index) in navButton"
- :key="index">
- <navigator v-if="item.badge" :url="item.url" hover-class="none" class="nav-item"
- open-type="navigate">
- <uni-badge class="uni-badge-left-margin" absolute="rightTop" :text="item.value" size="small">
- <image :src="item.img" mode="widthFix" class="nav-item-img"></image>
- </uni-badge>
- <view style="font-size: 0.9rem;font-weight: bold;">{{ item.name }}</view>
- </navigator>
- <navigator v-else :url="item.url" hover-class="none" class="nav-item" open-type="navigate">
- <image :src="item.img" mode="widthFix" class="nav-item-img"></image>
- <view style="font-size: 0.9rem;font-weight: bold;">{{ item.name }}</view>
- </navigator>
- </u-grid-item>
- </u-grid>
- </view>
- <uni-card v-if="permission.orgAdmin || (permission.companyServciePerson && postName=='servicePerson')"
- title="快捷操作">
- <view class="view-flex-inline">
- <uni-icons class="input-uni-icon" type="phone" size="18" color="coral" />
- <text class="text-under-line" style="color: coral;font-size: 1rem;"
- @click="toShortcutCreateOrder">发起工单</text>
- </view>
- </uni-card>
- <!-- <uni-card v-if="permission.companyServciePerson && postName=='engineer'" title="新的工单">
- <view v-if="todoOrderCount>0">
- <uni-list>
- <uni-list-item v-for="item in todoOrderList" :key="item.id">
- <template v-slot:body>
- <view class="list-item-block">
- <view class="line">
- <uni-icons type="gear" size="18" color="lightblue" />
- <view v-if="item.orderType==1" class="text" style="width: 90%;color: gray;">
- 工单类型: <span style="margin-left: 5px;color: cornflowerblue;">维修工单</span>
- </view>
- <view v-else class="text" style="width: 90%;color: gray;">
- 工单类型: <span style="margin-left: 5px;color: cornflowerblue;">服务工单</span>
- </view>
- </view>
- <view class="line">
- <uni-icons type="personadd" size="18" color="lightblue" />
- <view class="text" style="width: 90%;color: gray;">
- 工单发起人: <span
- style="margin-left: 5px;color: cornflowerblue;">{{item.createOrderPersonName}}</span>
- </view>
- </view>
- <view class="line">
- <uni-icons type="calendar" size="18" color="lightblue" />
- <view class="text" style="width: 90%;color: gray;">
- 发起时间: <span
- style="margin-left: 5px;color: cornflowerblue;">{{item.createTime}}</span>
- </view>
- </view>
- <view class="line">
- <uni-icons type="help" size="18" color="lightblue" />
- <view class="text text-ellipsis" style="width: 90%;color: gray;">
- 问题描述: <span
- style="margin-left: 5px;color: cornflowerblue;">{{item.orderDesc}}</span>
- </view>
- </view>
- <view class="line">
- <view class="block">
- <uni-icons type="arrow-right" size="20" color="coral" />
- </view>
- <view class="text text-underline"
- style="color: coral;margin-left: 2px;font-size: 1rem;" @click="toDo(item)">
- 去处理
- </view>
- </view>
- </view>
- </template>
- </uni-list-item>
- </uni-list>
- </view>
- <view v-else class="view-flex-inline">
- <image src="/static/images/todo/todo.png" style="width: 40px;margin-left: 10px;" mode="widthFix">
- </image>
- <view class="view-flex-block-center" style="margin-left: 10px;align-items: flex-start;">
- <text>暂无待处理工单</text>
- </view>
- </view>
- </uni-card>
- <uni-card v-if="permission.orgAdmin" title="待审批费用申请" >
- <view v-if="costsApproveOrderCount>0">
- <uni-list>
- <uni-list-item v-for="item in costsApproveOrderList" :key="item.id">
- <template v-slot:body>
- <view class="list-item-block">
- <view class="line">
- <uni-icons type="auth" size="18" color="lightblue" />
- <view class="text" style="width: 90%;color: gray;">
- 费用审批申请人:<span
- style="margin-left: 5px;color: cornflowerblue;">{{item.processorName}}</span>
- </view>
- </view>
- <view class="line">
- <uni-icons type="calendar" size="18" color="lightblue" />
- <view class="text" style="width: 90%;color: gray;">
- 申请时间:<span
- style="margin-left: 5px;color: cornflowerblue;">{{item.orderProcessTime}}</span>
- </view>
- </view>
- <view class="line">
- <uni-icons type="info" size="18" color="lightblue" />
- <view class="text text-ellipsis" style="width: 90%;color: gray;">
- 费用说明:<span
- style="margin-left: 5px;color: cornflowerblue;">{{item.costsReportDesc}}</span>
- </view>
- </view>
- <view class="line">
- <view class="block">
- <uni-icons type="arrow-right" size="20" color="coral" />
- </view>
- <view class="text text-ellipsis text-underline"
- style="width: 90%;color: coral;font-size: 1rem;"
- @click="toOrderCostsApprove(item)">
- 去审批
- </view>
- </view>
- </view>
- </template>
- </uni-list-item>
- </uni-list>
- </view>
- <view v-else class="view-flex-inline">
- <image src="/static/images/todo/todo.png" style="width: 40px;margin-left: 10px;" mode="widthFix">
- </image>
- <view class="view-flex-block-center" style="margin-left: 10px;align-items: flex-start;">
- <text>暂无待费用审批工单</text>
- </view>
- </view>
- </uni-card>
- <uni-card v-if="permission.companyServciePerson && postName=='engineer'" title="费用已审批工单">
- <view v-if="costsApproveOrderCount>0">
- <uni-list>
- <uni-list-item v-for="item in costsApproveOrderList" :key="item.id">
- <template v-slot:body>
- <view class="list-item-block">
- <view class="line">
- <uni-icons type="auth" size="18" color="lightblue" />
- <view class="text" style="width: 90%;color: gray;">
- 费用审批人:<span
- style="margin-left: 5px;color: cornflowerblue;">{{item.processorName}}</span>
- </view>
- </view>
- <view class="line">
- <uni-icons type="calendar" size="18" color="lightblue" />
- <view class="text" style="width: 90%;color: gray;">
- 审批时间:<span
- style="margin-left: 5px;color: cornflowerblue;">{{item.orderProcessTime}}</span>
- </view>
- </view>
- <view class="line">
- <uni-icons type="info" size="18" color="lightblue" />
- <view class="text text-ellipsis" style="width: 90%;color: gray;">
- 审批意见:<span
- style="margin-left: 5px;color: cornflowerblue;">{{item.processDesc}}</span>
- </view>
- </view>
- <view class="line">
- <view class="block">
- <uni-icons type="arrow-right" size="20" color="coral" />
- </view>
- <view class="text text-ellipsis text-underline"
- style="width: 90%;color: coral;font-size: 1rem;"
- @click="toOrderProcess(item)">
- 去处理
- </view>
- </view>
- </view>
- </template>
- </uni-list-item>
- </uni-list>
- </view>
- <view v-else class="view-flex-inline">
- <image src="/static/images/todo/todo.png" style="width: 40px;margin-left: 10px;" mode="widthFix">
- </image>
- <view class="view-flex-block-center" style="margin-left: 10px;align-items: flex-start;">
- <text>暂无费用已审批工单</text>
- </view>
- </view>
- </uni-card>
- <uni-card v-if="permission.orgAdmin" title="待完结审批工单">
- <view v-if="closeApproveOrderCount>0">
- <uni-list>
- <uni-list-item v-for="item in closeApproveOrderList" :key="item.id">
- <template v-slot:body>
- <view class="list-item-block">
- <view class="line">
- <uni-icons type="auth" size="18" color="lightblue" />
- <view class="text" style="width: 90%;color: gray;">
- 工单处理人:<span
- style="margin-left: 5px;color: cornflowerblue;">{{item.processorName}}</span>
- </view>
- </view>
- <view class="line">
- <uni-icons type="calendar" size="18" color="lightblue" />
- <view class="text" style="width: 90%;color: gray;">
- 处理时间:<span
- style="margin-left: 5px;color: cornflowerblue;">{{item.orderProcessTime}}</span>
- </view>
- </view>
- <view class="line">
- <uni-icons type="info" size="18" color="lightblue" />
- <view class="text text-ellipsis" style="width: 90%;color: gray;">
- 解决措施说明:<span
- style="margin-left: 5px;color: cornflowerblue;">{{item.processDesc}}</span>
- </view>
- </view>
- <view class="line">
- <view class="block">
- <uni-icons type="arrow-right" size="20" color="coral" />
- </view>
- <view class="text text-ellipsis text-underline"
- style="width: 90%;color: coral;font-size: 1rem;"
- @click="toOrderCloseApprove(item)">
- 去审批
- </view>
- </view>
- </view>
- </template>
- </uni-list-item>
- </uni-list>
- </view>
- <view v-else class="view-flex-inline">
- <image src="/static/images/todo/todo.png" style="width: 40px;margin-left: 10px;" mode="widthFix">
- </image>
- <view class="view-flex-block-center" style="margin-left: 10px;align-items: flex-start;">
- <text>暂无待完结审批工单</text>
- </view>
- </view>
- </uni-card> -->
- <uni-card title="待处理事件">
- <uni-section v-if="permission.companyServciePerson && postName=='engineer'" title="新的工单"
- ftitleFontSize="0.8rem" type="circle">
- <!-- <template v-slot:decoration>
- <view class="decoration"></view>
- </template> -->
- <view v-if="todoOrderCount>0">
- <uni-list>
- <uni-list-item v-for="item in todoOrderList" :key="item.id">
- <template v-slot:body>
- <view class="list-item-block">
- <view class="line">
- <uni-icons type="gear" size="18" color="lightblue" />
- <view v-if="item.orderType==1" class="text" style="width: 90%;color: gray;">
- 工单类型: <span style="margin-left: 5px;color: cornflowerblue;">维修工单</span>
- </view>
- <view v-else class="text" style="width: 90%;color: gray;">
- 工单类型: <span style="margin-left: 5px;color: cornflowerblue;">服务工单</span>
- </view>
- </view>
- <view class="line">
- <uni-icons type="personadd" size="18" color="lightblue" />
- <view class="text" style="width: 90%;color: gray;">
- 工单发起人: <span
- style="margin-left: 5px;color: cornflowerblue;">{{item.createOrderPersonName}}</span>
- </view>
- </view>
- <view class="line">
- <uni-icons type="calendar" size="18" color="lightblue" />
- <view class="text" style="width: 90%;color: gray;">
- 发起时间: <span
- style="margin-left: 5px;color: cornflowerblue;">{{item.createTime}}</span>
- </view>
- </view>
- <view class="line">
- <uni-icons type="help" size="18" color="lightblue" />
- <view class="text text-ellipsis" style="width: 90%;color: gray;">
- 问题描述: <span
- style="margin-left: 5px;color: cornflowerblue;">{{item.orderDesc}}</span>
- </view>
- </view>
- <view class="line">
- <view class="block">
- <uni-icons type="arrow-right" size="20" color="coral" />
- </view>
- <view class="text text-underline"
- style="color: coral;margin-left: 2px;font-size: 1rem;" @click="toDo(item)">
- 去处理
- </view>
- </view>
- </view>
- </template>
- </uni-list-item>
- </uni-list>
- </view>
- <view v-else class="view-flex-inline">
- <image src="/static/images/todo/todo.png" style="width: 40px;margin-left: 10px;" mode="widthFix">
- </image>
- <view class="view-flex-block-center" style="margin-left: 10px;align-items: flex-start;">
- <text>暂无待处理工单</text>
- </view>
- </view>
- </uni-section>
- <uni-section v-if="permission.orgAdmin" title="待审批费用申请" ftitleFontSize="0.8rem" type="circle">
- <!-- <template v-slot:decoration>
- <view class="decoration"></view>
- </template> -->
- <view v-if="costsApproveOrderCount>0">
- <uni-list>
- <uni-list-item v-for="item in costsApproveOrderList" :key="item.id">
- <template v-slot:body>
- <view class="list-item-block">
- <view class="line">
- <uni-icons type="auth" size="18" color="lightblue" />
- <view class="text" style="width: 90%;color: gray;">
- 费用申请人:<span
- style="margin-left: 5px;color: cornflowerblue;">{{item.processorName}}</span>
- </view>
- </view>
- <view class="line">
- <uni-icons type="calendar" size="18" color="lightblue" />
- <view class="text" style="width: 90%;color: gray;">
- 申请时间:<span
- style="margin-left: 5px;color: cornflowerblue;">{{item.orderProcessTime}}</span>
- </view>
- </view>
- <view class="line">
- <uni-icons type="info" size="18" color="lightblue" />
- <view class="text text-ellipsis" style="width: 90%;color: gray;">
- 费用说明:<span
- style="margin-left: 5px;color: cornflowerblue;">{{item.costsReportDesc}}</span>
- </view>
- </view>
- <view class="line">
- <view class="block">
- <uni-icons type="arrow-right" size="20" color="coral" />
- </view>
- <view class="text text-ellipsis text-underline"
- style="width: 90%;color: coral;font-size: 1rem;"
- @click="toOrderCostsApprove(item)">
- 去审批
- </view>
- </view>
- </view>
- </template>
- </uni-list-item>
- </uni-list>
- </view>
- <view v-else class="view-flex-inline">
- <image src="/static/images/todo/todo.png" style="width: 40px;margin-left: 10px;" mode="widthFix">
- </image>
- <view class="view-flex-block-center" style="margin-left: 10px;align-items: flex-start;">
- <text>暂无待审批费用申请工单</text>
- </view>
- </view>
- </uni-section>
- <uni-section v-if="permission.companyServciePerson && postName=='engineer'" title="费用已审批工单"
- ftitleFontSize="0.8rem" type="circle">
- <!-- <template v-slot:decoration>
- <view class="decoration"></view>
- </template> -->
- <view v-if="costsApproveOrderCount>0">
- <uni-list>
- <uni-list-item v-for="item in costsApproveOrderList" :key="item.id">
- <template v-slot:body>
- <view class="list-item-block">
- <view class="line">
- <uni-icons type="auth" size="18" color="lightblue" />
- <view class="text" style="width: 90%;color: gray;">
- 费用审批人:<span
- style="margin-left: 5px;color: cornflowerblue;">{{item.processorName}}</span>
- </view>
- </view>
- <view class="line">
- <uni-icons type="calendar" size="18" color="lightblue" />
- <view class="text" style="width: 90%;color: gray;">
- 审批时间:<span
- style="margin-left: 5px;color: cornflowerblue;">{{item.orderProcessTime}}</span>
- </view>
- </view>
- <view class="line">
- <uni-icons type="info" size="18" color="lightblue" />
- <view class="text text-ellipsis" style="width: 90%;color: gray;">
- 审批意见:<span
- style="margin-left: 5px;color: cornflowerblue;">{{item.processDesc}}</span>
- </view>
- </view>
- <view class="line">
- <view class="block">
- <uni-icons type="arrow-right" size="20" color="coral" />
- </view>
- <view class="text text-ellipsis text-underline"
- style="width: 90%;color: coral;font-size: 1rem;"
- @click="toOrderProcess(item)">
- 去处理
- </view>
- </view>
- </view>
- </template>
- </uni-list-item>
- </uni-list>
- </view>
- <view v-else class="view-flex-inline">
- <image src="/static/images/todo/todo.png" style="width: 40px;margin-left: 10px;" mode="widthFix">
- </image>
- <view class="view-flex-block-center" style="margin-left: 10px;align-items: flex-start;">
- <text>暂无费用已审批工单</text>
- </view>
- </view>
- </uni-section>
- <uni-section v-if="permission.orgAdmin" title="待完结审批工单" ftitleFontSize="0.8rem" type="circle">
- <view v-if="closeApproveOrderCount>0">
- <uni-list>
- <uni-list-item v-for="item in closeApproveOrderList" :key="item.id">
- <template v-slot:body>
- <view class="list-item-block">
- <view class="line">
- <uni-icons type="auth" size="18" color="lightblue" />
- <view class="text" style="width: 90%;color: gray;">
- 工单处理人:<span
- style="margin-left: 5px;color: cornflowerblue;">{{item.processorName}}</span>
- </view>
- </view>
- <view class="line">
- <uni-icons type="calendar" size="18" color="lightblue" />
- <view class="text" style="width: 90%;color: gray;">
- 处理时间:<span
- style="margin-left: 5px;color: cornflowerblue;">{{item.orderProcessTime}}</span>
- </view>
- </view>
- <view class="line">
- <uni-icons type="info" size="18" color="lightblue" />
- <view class="text text-ellipsis" style="width: 90%;color: gray;">
- 解决措施说明:<span
- style="margin-left: 5px;color: cornflowerblue;">{{item.processDesc}}</span>
- </view>
- </view>
- <view class="line">
- <view class="block">
- <uni-icons type="arrow-right" size="20" color="coral" />
- </view>
- <view class="text text-ellipsis text-underline"
- style="width: 90%;color: coral;font-size: 1rem;"
- @click="toOrderCloseApprove(item)">
- 去审批
- </view>
- </view>
- </view>
- </template>
- </uni-list-item>
- </uni-list>
- </view>
- <view v-else class="view-flex-inline">
- <image src="/static/images/todo/todo.png" style="width: 40px;margin-left: 10px;" mode="widthFix">
- </image>
- <view class="view-flex-block-center" style="margin-left: 10px;align-items: flex-start;">
- <text>暂无待完结审批工单</text>
- </view>
- </view>
- </uni-section>
- </uni-card>
- <!-- <uni-card title="云监控">
- <uni-row>
- <uni-col :span="12">
- <view class="view-flex-inline">
- <uni-icons class="input-uni-icon" type="calendar" size="18" color="orangered" />
- <text>未关闭工单 {{realData.orderCount}}</text>
- </view>
- <view class="view-flex-inline">
- <uni-icons class="input-uni-icon" type="calendar" size="18" color="orangered" />
- <text>工单处理超时 {{realData.delayComfireOrders}}</text>
- </view>
- </uni-col>
- <uni-col :span="12">
- <view class="view-flex-inline">
- <uni-icons class="input-uni-icon" type="notification" size="18" color="orangered" />
- <text>设备异常 {{realData.warningRtus}}</text>
- </view>
- </uni-col>
- </uni-row>
- </uni-card> -->
- <!--
- <uni-card title="我的资源">
- <uni-row>
- <uni-col :span="12">
- <view class="view-flex-inline">
- <uni-icons class="input-uni-icon" type="home" size="18" color="orangered" />
- <text>运维机构数量</text>
- </view>
- </uni-col>
- <uni-col :span="12">
- <view class="view-flex-inline">
- <uni-icons class="input-uni-icon" type="folder-add" size="18" color="orangered" />
- <text>项目数量</text>
- </view>
- </uni-col>
- </uni-row>
- <uni-row>
- <uni-col :span="12">
- <view class="view-flex-inline">
- <uni-icons class="input-uni-icon" type="staff" size="18" color="orangered" />
- <text>运维人员数量</text>
- </view>
- </uni-col>
- <uni-col :span="12">
- <view class="view-flex-inline">
- <uni-icons class="input-uni-icon" type="videocam" size="18" color="orangered" />
- <text>设备数量 {{realData.rtus}}</text>
- </view>
- </uni-col>
- </uni-row>
- </uni-card> -->
- </view>
- </template>
- <script>
- import
- navBtns
- from "@/api/home.js";
- import {
- role
- } from "@/api/role.js";
- import {
- oss
- } from '@/common/setting';
- import http from '@/http/api.js';
- export default {
- components: {},
- data() {
- return {
- title: '泰山电教维护服务',
- permission: {
- 'admin': false,
- 'orgAdmin': false,
- 'companyAdmin': false,
- 'companyServciePerson': false,
- 'yjServicePerson': false,
- },
- postName: '',
- currentRole: '',
- current: 0,
- navButton: [],
- navButtonIndex: [],
- //more/loading/noMore
- loadMoreStatus: "noMore",
- timer: false,
- pageSize: 10,
- pageCurrent: 1,
- total: 0,
- noticeDot: false,
- noticeValue: 0,
- todoOrderCount: 0,
- todoOrderList: [],
- costsApproveOrderCount: 0,
- costsApproveOrderList: [],
- closeApproveOrderCount: 0,
- closeApproveOrderList: [],
- };
- },
- computed: {},
- onLoad() {
- //console.log(JSON.stringify(this.userInfo))
- this.permission.admin = false;
- this.permission.orgAdmin = false;
- this.permission.companyAdmin = false;
- this.permission.companyServciePerson = false;
- this.permission.yjServicePerson = false;
- this.navButton = navBtns.navButtons;
- if (this.userInfo.role_name === role.admin) {
- this.permission.admin = true;
- this.navButtonIndex = navBtns.sysAdminNavButton;
- this.currentRole = role.admin;
- } else if (this.userInfo.role_name === role.orgAdmin) {
- this.permission.orgAdmin = true;
- this.currentRole = role.orgAdmin;
- this.navButtonIndex = navBtns.orgAdminNavButton;
- } else if (this.userInfo.role_name === role.companyAdmin) {
- this.permission.companyAdmin = true;
- this.currentRole = role.companyAdmin;
- this.navButtonIndex = navBtns.companyAdminNavButton;
- } else if (this.userInfo.role_name === role.companyServciePerson) {
- this.permission.companyServciePerson = true;
- this.currentRole = role.companyServciePerson;
- this.navButtonIndex = navBtns.companyServicePersonNavButton;
- if (this.userInfo.post_id == '1706859505948098562') {
- this.postName = "engineer";
- } else if (this.userInfo.post_id == '1730535542909140993') {
- this.postName = "servicePerson";
- }
- }
- if (this.$u.func.checkLogin()) {
- console.log("timer start +++++++ ")
- this.timer = true;
- setTimeout(this.timeCall, 10);
- }
- },
- onUnload() {
- this.timer = false;
- },
- onReady() {
- if (this.$u.func.checkLogin()) {} else {
- this.$u.func.logout();
- }
- },
- onShow() {
- if (this.$u.func.checkLogin()) {
- if (this.userInfo.role_name !== this.currentRole) {
- this.permission.admin = false;
- this.permission.orgAdmin = false;
- this.permission.companyAdmin = false;
- this.permission.companyServciePerson = false;
- this.permission.yjServicePerson = false;
- this.navButton = navBtns.navButtons;
- if (this.userInfo.role_name === role.admin) {
- this.permission.admin = true;
- this.navButtonIndex = navBtns.sysAdminNavButton;
- this.currentRole = role.admin;
- } else if (this.userInfo.role_name === role.orgAdmin) {
- this.permission.orgAdmin = true;
- this.currentRole = role.orgAdmin;
- this.navButtonIndex = navBtns.orgAdminNavButton;
- } else if (this.userInfo.role_name === role.companyAdmin) {
- this.permission.companyAdmin = true;
- this.currentRole = role.companyAdmin;
- this.navButtonIndex = navBtns.companyAdminNavButton;
- } else if (this.userInfo.role_name === role.companyServciePerson) {
- this.permission.companyServciePerson = true;
- this.currentRole = role.companyServciePerson;
- this.navButtonIndex = navBtns.companyServicePersonNavButton;
- if (this.userInfo.post_id == '1706859505948098562') {
- this.postName = "engineer";
- } else if (this.userInfo.post_id == '1730535542909140993') {
- this.postName = "servicePerson";
- }
- }
- }
- if (this.timer == false) {
- this.timer = true;
- setTimeout(this.timeCall, 10);
- }
- } else {
- this.$u.func.logout();
- }
- },
- onHide() {
- this.timer = false;
- },
- methods: {
- toOss(path) {
- return oss + path;
- },
- timeCall() {
- if (this.timer == true) {
- this.getHomeInfo();
- setTimeout(this.timeCall, 10000);
- }
- },
- toDo(item) {
- var url = '/pages/check-order/orderconfirm?orderType=' + item.orderType + '&orderId=' + item.id;
- uni.navigateTo({
- url: url
- })
- },
- toOrderProcess(item) {
- var url = '/pages/check-order/orderprocessreport?skipPage=1&costsApprove=2&orderType=' + item.orderType +
- '&orderProcessId=' + item
- .orderProcessId + '&orderId=' + item.id;
- uni.navigateTo({
- url: url
- })
- },
- toOrderCostsApprove(item) {
- var url = '/pages/check-order/ordercostsapprove?orderType=' + item.orderType + '&orderId=' + item.id;
- uni.navigateTo({
- url: url
- })
- },
- toOrderCloseApprove(item) {
- console.log("toOrderCloseApprove")
- var url = '/pages/check-order/ordercloseapprove?orderType=' + item.orderType + '&orderId=' + item.id;
- uni.navigateTo({
- url: url
- })
- },
- toShortcutCreateOrder() {
- let url = '/pages/check-order/orderadd';
- uni.navigateTo({
- url: url
- })
- },
- onNoticeMoreClick() {
- uni.navigateTo({
- url: '/pages/news/noticelist'
- })
- },
- getHomeInfo() {
- this.getTodoOrderList();
- this.getTodoCostsApproveOrderList();
- this.getTodoCloseOrderList();
- },
- getTodoOrderList() {
- let that = this;
- let postData = {};
- http.request({
- url: '/galaxy-business/order/todo/list',
- method: 'GET',
- data: postData,
- }).then(res => {
- that.todoOrderCount = 0;
- if (res.data != null) {
- that.todoOrderCount = res.data.length;
- that.todoOrderList = res.data;
- }
- }).catch(err => {
- console.log(JOSN.stringify(err))
- })
- },
- getTodoCostsApproveOrderList() {
- let that = this;
- let postData = {};
- http.request({
- url: '/galaxy-business/order/todo/costsapprove/list',
- method: 'GET',
- data: postData,
- }).then(res => {
- that.costsApproveOrderCount = 0;
- if (res.data != null) {
- that.costsApproveOrderCount = res.data.length;
- that.costsApproveOrderList = res.data;
- }
- }).catch(err => {
- console.log(JOSN.stringify(err))
- })
- },
- getTodoCloseOrderList() {
- let that = this;
- let postData = {};
- http.request({
- url: '/galaxy-business/order/todo/closeapprove/list',
- method: 'GET',
- data: postData,
- }).then(res => {
- that.closeApproveOrderCount = 0;
- if (res.data != null) {
- that.closeApproveOrderCount = res.data.length;
- that.closeApproveOrderList = res.data;
- }
- }).catch(err => {
- console.log(JOSN.stringify(err))
- })
- },
- }
- };
- </script>
- <style lang="scss" scoped>
- $nav-height: 75px;
- .decoration {
- width: 6px;
- height: 6px;
- margin-right: 4px;
- border-radius: 50%;
- background-color: cadetblue;
- }
- .input-uni-icon {
- line-height: $nav-height;
- }
- .item-block {
- display: flex;
- flex-direction: column;
- justify-content: flex-start;
- width: 100%;
- }
- .line {
- display: flex;
- flex-direction: row;
- justify-content: flex-start;
- width: 100%;
- }
- .line .block {
- display: flex;
- flex-direction: column;
- justify-content: center;
- }
- .line-end {
- display: flex;
- flex-direction: row;
- justify-content: flex-end;
- width: 100%;
- }
- .line-end .block {
- display: flex;
- flex-direction: column;
- justify-content: center;
- }
- .line-center {
- display: flex;
- flex-direction: row;
- justify-content: center;
- width: 100%;
- height: 100%;
- }
- .line-center .block {
- display: flex;
- flex-direction: column;
- justify-content: center;
- }
- .rtu-name {
- margin-left: 5rpx;
- font-size: 0.7rem;
- font-weight: bold;
- }
- .rtu-code {
- margin-left: 5rpx;
- font-size: 0.6rem;
- color: gray;
- }
- .item-text-line {
- width: 100%;
- display: flex;
- flex-direction: row;
- align-items: flex-start;
- padding-left: 0px;
- padding-right: 0px;
- .block {
- height: 100%;
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- }
- .item-title {
- font-size: 0.7rem;
- }
- .item-text {
- padding-left: 2px;
- padding-right: 5px;
- font-size: 0.7rem;
- }
- .item-text-ell {
- width: 100%;
- overflow: hidden;
- font-size: 0.7rem;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
- .item-number {
- font-size: 0.7rem;
- margin-left: 2px;
- margin-right: 5px;
- }
- }
- .item-title-image {
- /* #ifndef APP-NVUE */
- display: block;
- /* #endif */
- margin-right: 5px;
- width: 20px;
- height: 20px;
- border-radius: 50%;
- }
- .uni-badge-left-margin {
- margin-left: 0px;
- }
- .logo {
- flex-shrink: 0;
- width: 80rpx;
- height: auto;
- }
- .container {
- background-color: #f7f7f7;
- min-height: 100vh;
- overflow: hidden;
- }
- .nav {
- margin: 0rpx 0;
- box-sizing: border-box;
- padding: 0 10rpx;
- &-item {
- width: 100%;
- box-sizing: border-box;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: space-between;
- height: 130rpx;
- &-img {
- width: 80rpx;
- height: 80rpx;
- }
- &-name {
- font-size: 0.7rem;
- font-family: PingFang SC;
- font-weight: 500;
- color: #585b61;
- }
- }
- }
- </style>
|