西海岸:我的申请,增加设备申请

This commit is contained in:
guoyue 2022-09-22 19:07:54 +08:00
parent 10fdc587a2
commit 4a28789464
4 changed files with 379 additions and 236 deletions

View File

@ -284,3 +284,20 @@ export function endProcess(params) {
params,
})
}
// 西--
export function deviceApplylist(params) {
return request({
url: '/deviceApply/page',
method: 'get',
params,
})
}
// 西----
export function getDeviceDetail(deviceId) {
return request({
url: `/device/${deviceId}`,
method: 'get',
})
}

View File

@ -1,24 +1,12 @@
<template>
<div class="form-container">
<AbilityApplication
:refObj="refObj"
v-if="showType === '能力申请'"
></AbilityApplication>
<PutOnTheShelf
:refObj="refObj"
v-else-if="showType === '能力上架'"
></PutOnTheShelf>
<OffTheShelf
:refObj="refObj"
v-else-if="showType === '能力下架'"
></OffTheShelf>
<DeviceApplyDetail v-if="showType === '设备申请'" :refObj="refObj"></DeviceApplyDetail>
<div class="form-container" v-else>
<AbilityApplication :refObj="refObj" v-if="showType === '能力申请'"></AbilityApplication>
<PutOnTheShelf :refObj="refObj" v-else-if="showType === '能力上架'"></PutOnTheShelf>
<OffTheShelf :refObj="refObj" v-else-if="showType === '能力下架'"></OffTheShelf>
<Demand :refObj="refObj" v-else-if="showType === '能力需求'"></Demand>
<Comment :refObj="refObj" v-else-if="showType === '需求评论'"></Comment>
<OtherApplications :refObj="refObj" v-else></OtherApplications>
<!-- <div class="title">流程图</div>
<div>
<img :src="getResourceURL()" alt="" />
</div> -->
<div>
<div class="title">审批详情</div>
<template v-for="item in dataSource.data" :key="item">
@ -40,6 +28,7 @@
import OffTheShelf from './OffTheShelf.vue'
import Demand from './Demand.vue'
import Comment from './Comment.vue'
import DeviceApplyDetail from './DeviceApplyDetail.vue'
import OtherApplications from '@/views/personalCenter/components/OtherApplications '
import { onMounted, reactive, defineProps, ref } from 'vue'
import Cookies from 'js-cookie'
@ -69,6 +58,8 @@
showType.value = props.showType
//
const dataSource = reactive({ data: [] })
console.log('refObj------------>', refObj);
// console.log(props.refObj, '---------------------------------------')
const downloadFile = (path, name) => {
@ -255,6 +246,7 @@
height: 6rem;
overflow-y: scroll;
padding: 20px 20px 30px 20px;
.title {
font-size: 18px;
color: #000;
@ -265,6 +257,7 @@
border-left: 6px #0058e1 solid;
}
}
:deep(.ant-table-thead)>tr>.ant-table-cell {
background: #0087ff;
color: #fff;
@ -272,6 +265,7 @@
text-align: center;
font-size: 16px;
}
:deep(.ant-table-tbody)>tr>.ant-table-cell:nth-child(5) {
// width: 110px;
// display: inline-block;
@ -279,6 +273,7 @@
// overflow: hidden;
// text-overflow: ellipsis;
}
.oddNumbers {
margin-bottom: 0.05rem;
}

View File

@ -0,0 +1,43 @@
<!--
* @Description: 我的申请 设备申请 查看详情
-->
<template>
<div class="device-detail-box">
<div v-for="(db, key) in wrjData" :key="key">
<template v-if="typeof db == 'object'">
<div style="
font-size: 20px;
font-weight: 600;
margin: 10px 0;
text-align: center;
">
{{ db.attrType || '--' }}
</div>
<template v-if="db.attrValue">
<div style="padding: 0 30px" v-for="(value, key2) in JSON.parse(db.attrValue)" :key="value">
{{ key2 + '' + value }}
</div>
</template>
</template>
</div>
</div>
</template>
<script setup>
import { ref, defineProps, watch } from 'vue'
const props = defineProps({
refObj: { type: Object, default: null },
})
const wrjData = ref([])
wrjData.value = props.refObj.deviceAttrDTOList || []
watch(() => props.refObj, (val) => {
wrjData.value = val.deviceAttrDTOList || []
}, { immediate: true, deep: true })
</script>
<style lang="less" scoped>
.device-detail-box {
height: 6rem;
overflow-y: auto;
}
</style>

View File

@ -39,15 +39,20 @@
</div>
</a-tooltip>
<div class="content-body-content">
<p class="content-body-content-son">
<p class="content-body-content-son" v-if="typeName !=='设备申请'">
审核结果{{ item.ended ? '审核完成' : '审核中' }}
</p>
<p class="content-body-content-son" v-else>
审核结果{{ item.state === 0 ? '审核中' : '审核完成' }}
</p>
</div>
<div class="content-body-bottom">
<div>申请日期{{ item.createDate || item.startTime }}</div>
<div></div>
</div>
<div class="button-box">
<div class="button" v-if="typeName =='设备申请' && phoneSate.includes(item.state)"
@click="showPhoneModal(item)">联系方式</div>
<div class="button" @click="showDetail(item)">查看详情</div>
<div class="button" @click="showAdd(item)" v-if="item.backToFirst">
修改
@ -98,10 +103,16 @@
</a-table>
</a-modal>
</div>
<!-- 联系方式弹框 -->
<a-modal v-model:visible="phoneVisible" title="提示" @ok="phoneVisible = false">
<!-- 工业信息化局那个号电话配这个号199 6399 0996 -->
<p>请联系工业信息化局电话199 6399 0996</p>
</a-modal>
</template>
<script setup>
import { onMounted, reactive, ref, onBeforeUnmount } from 'vue'
import { onMounted, reactive, ref, onBeforeUnmount, h } from 'vue'
import {
getMyProcessInstancePage,
getTabilityapplication,
@ -109,6 +120,8 @@ import {
nengliziyuanshangjiaapply,
getDemandForm,
demandComment,
deviceApplylist,
getDeviceDetail,
} from '@/api/personalCenter'
import {
updateRes,
@ -132,6 +145,7 @@ let typeList = ref([
])
// 西-
let isXiHaiAn = whoShow.itShowXiHaiAn;
const phoneSate = ref([2, 3])
if (isXiHaiAn) {
typeList.value.push('设备申请')
}
@ -146,7 +160,6 @@ const contentList = reactive({ data: [] })
let tabIndex = ref(0)
let typeIndex = ref(0)
let typeName = ref(typeList.value[0])
console.log('typeName------------>', typeName);
const videoVisible = ref(false)
const numFlag = ref(true)
@ -206,9 +219,8 @@ const taskId = ref('')
const backUrl = ref(window.SITE_CONFIG.apiURL + '/')
const refObj = ref({})
const showDetail = (item) => {
console.log('showDetail', item)
// getProcDefBizRoute(item.processDefinitionId)
if (typeIndex.value == 0 && item.applyFlag) {
if (typeName.value == '能力申请' && item.applyFlag) {
getByApplyFlag(item.applyFlag).then((res) => {
if (res.data.code == 0) {
refObj.value = res.data.data
@ -221,7 +233,19 @@ const showDetail = (item) => {
message.error('数据请求失败!')
}
})
} else if (typeIndex.value !== 1) {
} else if (typeName.value == '设备申请') {
getDeviceDetailInfo(item.deviceId).then(res => {
if (res.data.code == 0) {
refObj.value = res.data.data
detailsVisible.value = true
processDefinitionName.value = item.processDefinitionName
// businessKey.value = item.businessKey
// processInstanceId.value = item.processInstanceId
// resourceId.value = item.resourceId
}
}).catch(err => {
})
} else if (Object.keys(typeStrObj).includes(typeName.value) || typeName.value == '能力评价') {
refObj.value = item
detailsVisible.value = true
processDefinitionName.value = item.processDefinitionName
@ -401,9 +425,18 @@ const getApplyList = () => {
num.value = []
showType.value = ''
} else if (typeName.value == '设备申请') {
let _state = ended.value === '' ? '全部' : ended.value === true ? '审核完成' : '审核中';
getDeviceApply(_state).then(res => {
if (res.data.code == 0) {
contentList.data = []
num.value = []
showType.value = ''
contentList.data = res.data.data.list || []
total.value = res.data.data.total
showType.value = '设备申请';
//
getDeviceNum()
}
}).catch(err => {
})
} else if (Object.keys(typeStrObj).includes(typeName.value)) {
processDefinitionKey.value = typeStrObj[typeName.value]
params.processDefinitionKey = processDefinitionKey.value;
@ -528,6 +561,61 @@ const del = () => {
}
})
}
// 西 todo
const getDeviceApply = (state) => {
return new Promise((resolve, reject) => {
let _data = {
page: page.value,
limit: 4,
state
}
deviceApplylist(_data).then(res => {
resolve(res)
console.log('res----设备申请-------->', res);
}).catch(err => {
reject(err)
console.log('err------------>', err);
})
})
}
// 西--
const getDeviceDetailInfo = (deviceId) => {
return new Promise((resolve, reject) => {
getDeviceDetail(deviceId).then(res => {
resolve(res)
console.log('res----查询详情-------->', res);
}).catch(err => {
reject(err)
console.log('err------------>', err);
})
})
}
// 西-,
const getDeviceNum = () => {
if (!numFlag.value) {
return;
}
num.value = []
Promise.all([getDeviceApply('审核中'), getDeviceApply('审核完成')]).then(res => {
console.log('res-----数量------->', res);
let unfinished = res[0] && res[0].data && res[0].data.data;
let finished = res[1] && res[1].data && res[1].data.data;
num.value.unfinished = unfinished.total || '';
num.value.finished = finished.total || '';
numFlag.value = false
}).catch(err => {
console.log('err------------>', err);
})
}
const phoneVisible = ref(false)
const showPhoneModal = () => {
phoneVisible.value = true
}
mybus.on('closeModal', (obj) => {
detailsVisible.value = false
changeType(obj.type, obj.index)