123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619 |
- <template>
- <div class='appealBox'>
- <div class='top'>
- <Head :headText='headText'></Head>
- </div>
- <div class='bottom'>
- <div class='appealContainer'>
- <div class='appeal-left'>
- <div class='appeal-left-top'>
- <span class='appeal-left-top-span Micbold'>待审核</span>
- <el-select v-model='value' placeholder='请选择'>
- <el-option v-for='item in appealOptions' :key='item.value' :label='item.label' :value='item.value'></el-option>
- </el-select>
- </div>
- <div class='appeal-left-box'>
- <div v-if='auditArr.length==0' class='no-data'>
- <span>暂无待审核策略</span>
- </div>
- <div v-else v-for='(item1,index) in auditArr' :key='index'>
- <div v-if='item1.date'>
- <p class='date MicrYaHei' v-if='item1.date==today'>{{formatterStr(item1.date)+' 今天'}}</p>
- <p v-if='item1.date==yesterday' class='date MicrYaHei'>{{formatterStr(item1.date)+' 昨天'}}</p>
- <p class='date MicrYaHei' v-if='item1.date!=today&&item1.date!=yesterday'>
- {{formatterStr(item1.date)+' '}}
- <span v-if='formatter3(formatters(item1.date))==0'>星期日</span>
- <span v-if='formatter3(formatters(item1.date))==1'>星期一</span>
- <span v-if='formatter3(formatters(item1.date))==2'>星期二</span>
- <span v-if='formatter3(formatters(item1.date))==3'>星期三</span>
- <span v-if='formatter3(formatters(item1.date))==4'>星期四</span>
- <span v-if='formatter3(formatters(item1.date))==5'>星期五</span>
- <span v-if='formatter3(formatters(item1.date))==6'>星期六</span>
- </p>
- </div>
- <div
- class='appeal-left-div'
- v-for='(item,index) in item1.children'
- :key='index'
- @click='appealClick(item)'
- :class='{border: ids==item.id}'
- >
- <div class='time'>
- <span>{{item.pushTime?formatter(item.pushTime):'--'}} {{item.title||'--'}}</span>
- <span v-if='item.pics'>
- <img src='../../assets/tp.png' alt />
- <span>{{item.pics.length}}</span>
- </span>
- </div>
- <div class='content'>
- <span>申请人:{{'--'}}</span>
- <span>申请时间:{{item.updateTime?formatter1(item.updateTime):'--'}}</span>
- <span>申请原因:{{item.reasonType||'--'}}</span>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class='appeal-right'>
- <div class='title Micbold' v-if='Object.keys(auditObj).length>0'>未执行申诉单</div>
- <div class='detailContainer' v-if='Object.keys(auditObj).length>0'>
- <div class='nav MicrYaHei'>
- <span>项目名称:{{'--'}}</span>
- <span>申请人:{{auditObj.applyUser||'--'}}</span>
- <span>申请时间:{{auditObj.updateTime?formatter1(auditObj.updateTime):'--'}}</span>
- </div>
- <div class='cont1 MicrYaHei'>申诉未执行指令:{{auditObj.title||'--'}}</div>
- <div class='cont2'>
- <audit-table v-if='tableList.length>=0' :tableList='tableList'></audit-table>
- </div>
- <div class='cont3'>
- <span class='Micbold'>策略评价</span>
- <span class='MicrYaHei'>{{auditObj.judgement||'--'}}</span>
- </div>
- <div class='cont4'>
- <span class='Micbold'>申请原因</span>
- <span>
- <el-select size='mini' v-model='auditObj.reasonType' placeholder='请选择'>
- <el-option v-for='item in options' :key='item.value' :label='item.label' :value='item.value'></el-option>
- </el-select>
- </span>
- <span>
- <textarea class='text-color' placeholder='填写申请原因' v-model='auditObj.reason'></textarea>
- </span>
- </div>
- <div>
- <upload-img :souseArr='auditObj.pics || []'></upload-img>
- </div>
- </div>
- <div class='opinion' v-if='Object.keys(auditObj).length>0'>
- <span class='opinion-title Micbold'>审批意见</span>
- <div class='opinion-bottom MicrYaHei'>
- <input type='text' v-model='comment' :class='{isRed: isRed}' />
- <span @click='approvalOpinion(auditObj,"reject")'>不同意</span>
- <span @click='approvalOpinion(auditObj,"approve")'>同意</span>
- </div>
- </div>
- <div class='no-data' v-if='Object.keys(auditObj).length==0'>
- <img src='@/assets/noData.png' />
- <br />
- <div>暂无内容</div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script>
- import Head from '../main/index'
- import AuditTable from './auditTable'
- import uploadImg from '../../components/uploadImg'
- import { queryWorkflow, queryChillerExecuteInfo } from '@/api/appeal/appeal.js'
- import { updateWorkflow } from '@/api/audit/audit.js'
- import { querySimpleInfo } from '@/api/appeal/appeal.js'
- var moment = require('moment')
- import 'moment/locale/zh-cn'
- export default {
- data() {
- return {
- headText: '申诉审核',
- isactive: 0, //默认第一个
- appealOptions: [
- {
- value: '0',
- label: '按未执行策略的时间'
- }
- ],
- resonOptions: [
- {
- value: '1',
- label: '策略原因'
- }
- ],
- resonValue: '1',
- options: [
- {
- value: '0',
- label: '策略原因'
- },
- {
- value: '1',
- label: '设备原因'
- },
- {
- value: '2',
- label: '其他'
- }
- ],
- auditArr: [],
- auditObj: {},
- value: '0',
- comment: '',
- souseArr: [],
- tableList: [],
- isRed: false,
- auditArr1: [],
- yesterday: '',
- today: '',
- day: '',
- ids: ''
- }
- },
- components: {
- Head,
- AuditTable,
- uploadImg
- },
- mounted() {
- this.today = this.formatter2(moment(new Date()))
- this.yesterday = this.formatter2(moment(new Date()).add(-1, 'days'))
- this.day = this.formatter2(moment(new Date()).add(-3, 'days'))
- this.query()
- },
- methods: {
- check() {
- this.isRed = !this.comment
- return this.isRed
- },
- quertName(id) {
- querySimpleInfo(id, {}).then(res => {
- this.auditObj.applyUser = res.realname
- })
- },
- approvalOpinion(item, type) {
- let params = {
- postParams: {
- id: item.id,
- commit: type,
- comment: this.comment,
- roles: [1002],
- updateUser: item.updateUser
- }
- }
- if (this.check()) return
- updateWorkflow(params).then(res => {
- if (res.result == 'success') {
- this.$message.success('操作成功')
- this.comment = ''
- this.query()
- } else {
- this.$message.error('操作失败: ' + res.message)
- }
- })
- },
- formatterStr(str) {
- if (str) {
- return str.substring(0, 4) + '.' + str.substring(4, 6) + '.' + str.substring(6, 8)
- }
- },
- formatters(date) {
- return moment(date).valueOf()
- },
- formatter(date) {
- return moment.unix(date / 1000).format('YYYY.MM.DD HH:mm')
- },
- formatter1(date) {
- return moment.unix(date / 1000).format('YYYY.MM.DD')
- },
- formatter3(date) {
- return moment.unix(date / 1000).format('d')
- },
- formatter2(date) {
- return moment.unix(date / 1000).format('YYYYMMDD')
- },
- appealClick(item) {
- this.ids = item.id
- this.auditObj = item
- this.quertName(item.updateUser)
- let params = {
- postParams: {
- criteria: {
- id: item.commandId
- }
- }
- }
- queryChillerExecuteInfo(params).then(res => {
- this.tableList = []
- const list = res.data || [{}, {}, {}]
- if (list.length > 0) {
- let current = list[0].current
- current.title = '当前运行状态'
- this.tableList.push(current)
- list.forEach(item => {
- if (Object.keys(item.recommend).length > 0) {
- let obj = {
- title: '推送策略',
- id: item.recommend.id,
- date: item.recommend.date,
- time: item.recommend.time,
- projectId: item.recommend.projectId,
- chillerNumSetLOrg: item.recommend.chillerNumSetL,
- chillerNumSetSOrg: item.recommend.chillerNumSetS,
- chillWaterOutTempSetOrg: item.recommend.chillWaterOutTempSet,
- coolPumpNumSetLOrg: item.recommend.coolPumpNumSetL,
- coolPumpNumSetSOrg: item.recommend.coolPumpNumSetS,
- coolPumpFreqSetOrg: item.recommend.coolPumpFreqSet,
- chillPumpNumSetLOrg: item.recommend.chillPumpNumSetL,
- chillPumpNumSetSOrg: item.recommend.chillPumpNumSetS,
- chillPumpFreqSetOrg: item.recommend.chillPumpFreqSet,
- coolTowerNumSetLOrg: item.recommend.coolTowerNumSetL,
- coolTowerNumSetSOrg: item.recommend.coolTowerNumSetS,
- coolTowerFreqSetOrg: item.recommend.coolTowerFreqSet,
- plrAllOrg: item.recommend.plrAllOrg
- }
- this.tableList.push(obj)
- }
- })
- let real = list[0].real
- real.title = '执行策略'
- this.tableList.push(real)
- }
- // console.log(list)
- // this.tableList = Object.values(list[0]).map(i => i || {})
- // this.tableList[0].title = '当前运行状态'
- // this.tableList[1].title = '推送策略'
- // this.tableList[2].title = '执行策略'
- console.log(this.tableList)
- })
- },
- unique(array) {
- var res = []
- for (var i = 0, len = array.length; i < len; i++) {
- var current = array[i]
- if (res.indexOf(current) === -1) {
- res.push(current)
- }
- }
- return res
- },
- query() {
- let params = {
- postParams: {
- criteria: {
- projectId: this.$store.state.projectId,
- trackerId: 3,
- status: 302
- // createTime: {
- // $gte: this.day + '000000'
- // }
- },
- orders: [
- {
- column: 'createTime',
- asc: false
- }
- ],
- withColumns: ['customAttribute']
- }
- }
- queryWorkflow(params).then(res => {
- let arr = []
- this.auditArr = []
- this.auditArr1 = []
- this.auditArr1 = res.content ? res.content : []
- if (this.auditArr1.length > 0) {
- this.auditArr1.forEach(el => {
- arr.push(this.formatter2(el.createTime))
- })
- let arrNew = this.unique(arr)
- arrNew.forEach(item => {
- let obj1 = {
- date: item,
- children: []
- }
- this.auditArr.push(obj1)
- })
- this.auditArr.forEach(item => {
- this.auditArr1.forEach(item2 => {
- if (item.date == this.formatter2(item2.createTime)) {
- item.children.push(item2)
- }
- })
- })
- this.auditObj = this.auditArr[0].children[0]
- this.ids = this.auditArr[0].children[0].id
- this.quertName(this.auditObj.applyUser)
- this.appealClick(this.auditObj)
- } else {
- this.appealClick({})
- }
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .appealBox {
- height: 100%;
- display: flex;
- .top {
- height: 100px;
- }
- .bottom {
- flex: 1;
- .appealContainer {
- height: 100%;
- display: flex;
- background: rgba(247, 249, 250, 1);
- border-top: 1px solid #e4e5e7;
- margin-top: 5px;
- .appeal-left {
- height: 100%;
- display: flex;
- flex-direction: column;
- max-width: 460px;
- min-width: 350px;
- padding-left: 20px;
- .appeal-left-top {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 12px;
- padding-top: 112px;
- .appeal-left-top-span {
- height: 24px;
- font-size: 16px;
- color: rgba(31, 36, 41, 1);
- line-height: 21px;
- }
- }
- .appeal-left-box {
- flex: 1;
- overflow: auto;
- margin-bottom: 24px;
- .no-data {
- display: flex;
- justify-content: center;
- align-items: center;
- font-size: 14px;
- height: 100%;
- font-family: MicrosoftYaHei;
- color: rgba(100, 108, 115, 1);
- }
- .date {
- height: 18px;
- font-size: 12px;
- color: rgba(141, 147, 153, 1);
- line-height: 16px;
- text-align: center;
- }
- .appeal-left-div {
- margin-bottom: 8px;
- padding: 16px 20px;
- background: rgba(255, 255, 255, 1);
- border-radius: 4px;
- border: 1px solid rgba(228, 230, 231, 1);
- .time {
- display: flex;
- justify-content: space-between;
- margin-bottom: 12px;
- span:nth-of-type(1) {
- height: 24px;
- font-size: 16px;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: rgba(31, 36, 41, 1);
- line-height: 22px;
- }
- span:nth-of-type(2) {
- display: flex;
- align-items: center;
- height: 22px;
- font-size: 14px;
- font-family: ArialMT;
- color: rgba(31, 36, 41, 1);
- line-height: 16px;
- img {
- width: 16px;
- height: 16px;
- margin-right: 6px;
- }
- }
- }
- .content {
- span {
- display: block !important;
- height: 22px;
- width: 100%;
- font-size: 14px;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: rgba(100, 108, 115, 1);
- line-height: 20px;
- }
- span:nth-of-type(2) {
- margin: 4px 0;
- }
- }
- }
- .border {
- border: 1px solid rgba(0, 145, 255, 1);
- }
- }
- }
- .appeal-right {
- position: relative;
- flex: 1;
- margin-left: 28px;
- height: 100%;
- display: flex;
- flex-direction: column;
- background: #fff;
- .no-data {
- height: 100%;
- display: flex;
- justify-content: center;
- align-items: center;
- flex-direction: column;
- font-size: 14px;
- font-family: MicrosoftYaHei;
- color: rgba(100, 108, 115, 1);
- }
- .title {
- height: 32px;
- font-size: 24px;
- color: rgba(31, 36, 41, 1);
- line-height: 32px;
- padding-top: 148px;
- text-align: center;
- }
- .detailContainer {
- overflow: auto;
- // min-width: 762px;
- padding: 0 100px;
- padding-bottom: 24px;
- background: rgba(255, 255, 255, 1);
- margin-bottom: 100px;
- .nav {
- display: flex;
- justify-content: space-between;
- margin-top: 40px;
- margin-bottom: 12px;
- span {
- height: 22px;
- font-size: 14px;
- color: rgba(31, 36, 41, 1);
- line-height: 19px;
- }
- }
- .cont1 {
- height: 22px;
- font-size: 14px;
- color: rgba(31, 36, 41, 1);
- line-height: 19px;
- margin-bottom: 16px;
- }
- .cont2 {
- margin-bottom: 24px;
- }
- .cont3 {
- margin-bottom: 24px;
- span {
- display: block;
- }
- span:nth-of-type(1) {
- height: 24px;
- font-size: 16px;
- color: rgba(31, 36, 41, 1);
- line-height: 21px;
- margin-bottom: 8px;
- }
- span:nth-of-type(2) {
- height: 22px;
- font-size: 14px;
- color: rgba(100, 108, 115, 1);
- line-height: 19px;
- }
- }
- .cont4 {
- margin-bottom: 8px;
- span {
- display: block;
- }
- span:nth-of-type(1) {
- height: 24px;
- font-size: 16px;
- color: rgba(31, 36, 41, 1);
- line-height: 21px;
- }
- span:nth-of-type(2) {
- margin: 8px 0;
- }
- span:nth-of-type(3) {
- textarea {
- width: 762px;
- height: 64px;
- border-radius: 4px;
- border: 1px solid rgba(195, 199, 203, 1);
- // color: rgba(195, 199, 203, 1);
- }
- }
- textarea:focus {
- color: #000;
- }
- textarea {
- color: #c3c7cb;
- }
- .text-color::-webkit-input-placeholder {
- color: #c3c7cb;
- }
- }
- }
- .opinion {
- width: 100%;
- box-sizing: border-box;
- background: rgba(247, 249, 250, 1);
- box-shadow: 0px -1px 8px 0px rgba(0, 0, 0, 0.08);
- position: absolute;
- bottom: 0px;
- padding: 16px 32px;
- .opinion-title {
- height: 24px;
- font-size: 16px;
- color: rgba(31, 36, 41, 1);
- line-height: 21px;
- margin-bottom: 8px;
- display: block;
- }
- .opinion-bottom {
- display: flex;
- align-items: center;
- .isRed {
- border: 1px solid #f54e45;
- }
- input {
- flex: 1;
- height: 32px;
- background: rgba(255, 255, 255, 1);
- border-radius: 4px;
- border: 1px solid rgba(195, 199, 203, 1);
- margin-right: 32px;
- }
- span {
- display: inline-block;
- width: 80px;
- height: 32px;
- background: rgba(255, 255, 255, 1);
- border-radius: 4px;
- border: 1px solid rgba(195, 199, 203, 1);
- font-size: 14px;
- color: rgba(31, 35, 41, 1);
- line-height: 32px;
- text-align: center;
- cursor: pointer;
- }
- span:nth-of-type(1) {
- margin-right: 12px;
- }
- }
- }
- }
- }
- }
- }
- </style>
|