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

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">
@ -35,43 +23,46 @@
</div>
</template>
<script setup>
import AbilityApplication from './AbilityApplication.vue'
import PutOnTheShelf from './PutOnTheShelf .vue'
import OffTheShelf from './OffTheShelf.vue'
import Demand from './Demand.vue'
import Comment from './Comment.vue'
import OtherApplications from '@/views/personalCenter/components/OtherApplications '
import { onMounted, reactive, defineProps, ref } from 'vue'
import Cookies from 'js-cookie'
// import { baseURL } from '@/config'
import qs from 'qs'
import {
import AbilityApplication from './AbilityApplication.vue'
import PutOnTheShelf from './PutOnTheShelf .vue'
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'
// import { baseURL } from '@/config'
import qs from 'qs'
import {
getApplyForm,
getTaskHandleDetailInfo,
getDemandForm,
nengliziyuanshangjiaapply,
getTaskVariables,
} from '@/api/personalCenter'
import { selectOneDel } from '@/api/home'
const props = defineProps({
} from '@/api/personalCenter'
import { selectOneDel } from '@/api/home'
const props = defineProps({
processDefinitionName: { type: String, default: null },
businessKey: { type: String, default: null },
processInstanceId: { type: String, default: null },
resourceId: { type: String, default: null },
refObj: { type: Object, default: null },
showType: { type: String, default: null },
})
const refObj = ref({})
const showType = ref('')
// eslint-disable-next-line vue/no-setup-props-destructure
refObj.value = props.refObj
// eslint-disable-next-line vue/no-setup-props-destructure
showType.value = props.showType
//
const dataSource = reactive({ data: [] })
// console.log(props.refObj, '---------------------------------------')
})
const refObj = ref({})
const showType = ref('')
// eslint-disable-next-line vue/no-setup-props-destructure
refObj.value = props.refObj
// eslint-disable-next-line vue/no-setup-props-destructure
showType.value = props.showType
//
const dataSource = reactive({ data: [] })
console.log('refObj------------>', refObj);
const downloadFile = (path, name) => {
// console.log(props.refObj, '---------------------------------------')
const downloadFile = (path, name) => {
const xhr = new XMLHttpRequest()
xhr.open('get', path)
xhr.responseType = 'blob'
@ -96,9 +87,9 @@
URL.revokeObjectURL(url)
}
}
}
//
const formName = reactive({
}
//
const formName = reactive({
user: '',
phone: '',
unit: '',
@ -107,12 +98,12 @@
scene: '',
basis: '',
id: '',
})
let shifoushizujian = ref('')
let nameNotShow = ref('')
let algorithmShow = ref('')
const dataForm = reactive({ data: {} })
const columns = [
})
let shifoushizujian = ref('')
let nameNotShow = ref('')
let algorithmShow = ref('')
const dataForm = reactive({ data: {} })
const columns = [
{
title: '任务名称',
dataIndex: 'activityName',
@ -143,8 +134,8 @@
dataIndex: 'durationInSeconds',
key: 'durationInSeconds',
},
]
const getInfo = () => {
]
const getInfo = () => {
console.log(props.processInstanceId, '============================')
if (props.processDefinitionName == '能力申请') {
// getTaskVariables({ taskId: props.processInstanceId }).then((res) => {
@ -208,9 +199,9 @@
dataForm.data = res.data.data
})
}
}
}
const getLiuZhuanInfo = () => {
const getLiuZhuanInfo = () => {
const params = qs.stringify({
processInstanceId: props.processInstanceId,
})
@ -221,9 +212,9 @@
})
dataSource.data.push([props.processInstanceId, arr])
})
}
}
onMounted(() => {
onMounted(() => {
// getInfo()
if (props.refObj.resourceApplication) {
dataSource.data = []
@ -237,9 +228,9 @@
} else {
getLiuZhuanInfo()
}
})
})
const getResourceURL = () => {
const getResourceURL = () => {
console.log('111111111111111111111111111111', Cookies.get('token'))
const params = qs.stringify({
token: Cookies.get('token'),
@ -247,7 +238,7 @@
processInstanceId: props.processInstanceId,
})
return `${window.SITE_CONFIG.apiURL}/act/his/getInstImage?${params}`
}
}
</script>
<style scoped lang="less">
@ -255,6 +246,7 @@
height: 6rem;
overflow-y: scroll;
padding: 20px 20px 30px 20px;
.title {
font-size: 18px;
color: #000;
@ -265,20 +257,23 @@
border-left: 6px #0058e1 solid;
}
}
:deep(.ant-table-thead) > tr > .ant-table-cell {
:deep(.ant-table-thead)>tr>.ant-table-cell {
background: #0087ff;
color: #fff;
border: none;
text-align: center;
font-size: 16px;
}
:deep(.ant-table-tbody) > tr > .ant-table-cell:nth-child(5) {
:deep(.ant-table-tbody)>tr>.ant-table-cell:nth-child(5) {
// width: 110px;
// display: inline-block;
// white-space: nowrap;
// 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)