能力申请驳回开发 视频调整成100个

This commit is contained in:
a0049873 2022-08-04 15:07:58 +08:00
parent 9f9edd23eb
commit 6d79448ebe
4 changed files with 254 additions and 61 deletions

View File

@ -2,7 +2,7 @@
* @Author: hisense.liangjunhua
* @Date: 2022-06-29 15:59:51
* @LastEditors: hisense.liangjunhua
* @LastEditTime: 2022-08-02 16:06:20
* @LastEditTime: 2022-08-04 14:34:45
* @Description: 告诉大家这是什么
-->
<!-- 流程业务表单 -->
@ -291,6 +291,7 @@ export default {
if (val.cameraList) {
flag = true
obj.describe += val.system
obj.describe += ''
} else {
this.$http.get('/resource/' + val.resourceId).then((res1) => {
// console.log(res1.data.data, '1111111111111111111111111111111111')

View File

@ -249,7 +249,7 @@
relaunch,
selectOne,
} from '@/api/home'
import { getCategoryTreePage } from '@/api/personalCenter'
import { getCategoryTreePage, endProcess } from '@/api/personalCenter'
import mybus from '@/myplugins/mybus'
import { sgcDel, getApplyForm } from '@/api/personalCenter'
import { pageWithAttrs } from '@/api/home'
@ -327,6 +327,30 @@
enclosureName: '', //
})
const dataList = ref([])
const id = router.currentRoute.value.query.id
const taskId = router.currentRoute.value.query.taskId
const businessKey = ref(router.currentRoute.value.query.id)
if (id) {
getApplyForm(id).then((res) => {
console.log('修改==============>', res.data.data)
// formName.id = res.data.data.id || ''
formName.applicationSystem = res.data.data.applicationSystem || ''
formName.applicationScene = res.data.data.applicationScene || []
formName.applicationBackground =
res.data.data.applicationBackground || ''
formName.effectWish = res.data.data.effectWish || ''
formName.phone = res.data.data.phone || ''
// formName.system = res.data.data.system || []
formName.enclosure = res.data.data.enclosure || ''
formName.enclosureName = res.data.data.enclosureName || ''
if (res.data.data.enclosure) {
fileList.value.push({
name: res.data.data.enclosureName,
url: res.data.data.enclosure,
})
}
})
}
getUser().then((res) => {
formName.user = res.data.data.realName
formName.userId = res.data.data.id
@ -338,18 +362,6 @@
})
})
// console.log('====================', list.value)
const businessKey = ref(router.currentRoute.value.query.id)
const taskId = ref(router.currentRoute.value.query.taskId)
if (businessKey.value) {
getApplyForm(businessKey.value).then((res) => {
formName.id = res.data.data.id
formName.phone = res.data.data.phone
formName.scene = res.data.data.scene
formName.basis = res.data.data.basis
formName.enclosure = res.data.data.enclosure
// console.log('================>', res, formName.phone)
})
}
const applicationSceneOpthion = ref([])
getCategoryTreePage({
page: 1,
@ -385,41 +397,146 @@
window.history.go(-1)
}
const processStartHandle = () => {
if (businessKey.value) {
const obj = ref({})
for (const key in formName) {
if (key !== 'formNameSystem') {
obj.value[key] = formName[key]
}
formRef.value.validate().then(() => {
if (!formUrl) {
return message.error('请设置保存表单的URL')
}
obj.value.system = formName.system[0].resourceName
tabilityapplication(obj.value).then((upres) => {
if (upres.data.code == 0) {
relaunch({ data: obj.value, taskId: taskId.value }).then(
(res) => {
// console.log('================>', res)
if (res.data.code == 0) {
message.success('重新发起流程成功!')
window.setTimeout(() => {
window.history.go(-1)
}, 1000)
} else {
message.error('重新发起流程失败!')
if (!formName) {
return message.error('请设置表单名称')
}
if (id) {
endProcess({ instanceId: taskId }).then((end) => {
if (end.data.code == 0) {
let ids = []
let falgNum = 0
let sxt = true
formName.system = []
console.log('list==================', list.value)
list.value.map((val) => {
val.arr.map((item) => {
if (item.type !== '基础设施') {
falgNum++
}
})
})
list.value.map((val) => {
val.arr.map((item) => {
if (item.type !== '基础设施') {
formName.system.push({
resourceId: item.resourceId,
resourceName: item.resourceName,
})
falgNum++
console.log(item.id)
if (item.id) {
ids.push(item.id)
}
} else {
let obj = {}
Object.assign(obj, formName)
console.log('摄像头===============>', obj, item)
obj.system = []
item.note1 = JSON.parse(item.note1)
item.note1.map((sxt) => {
obj.system.push({
resourceId: sxt.idtCameraChannel + '',
resourceName: sxt.channelName,
cameraId: sxt.channelId, //
channelCode: sxt.channelCode,
channelId: sxt.channelId,
channelName: sxt.channelName,
checkStatus: sxt.checkStatus + '',
gpsX: sxt.gpsX,
gpsY: sxt.gpsY,
idtCameraChannel: sxt.idtCameraChannel + '',
nodeName: sxt.nodeName,
parentId: sxt.parentId,
status: sxt.status + '',
})
})
submitApply(obj).then((res) => {
// applySuccess.value = false
console.log('摄像头申请================>', res)
if (item.id) {
sgcDel({ ids: [item.id] }).then((res1) => {
if (res1.data.msg === 'success') {
if (falgNum == 0 && sxt) {
message.success(
'申请提交成功,请到消息中心查看!'
)
sxt = false
}
mybus.emit('getSgcNum')
router.push({
path: '/DetailsPageconetent',
query: {
select: '组件服务',
},
})
}
})
} else {
if (
res.data.msg === 'success' &&
falgNum == 0 &&
sxt
) {
message.success('申请提交成功,请到消息中心查看!')
sxt = false
}
router.push({
path: '/DetailsPageconetent',
query: {
select: '组件服务',
},
})
}
})
}
})
})
console.log(
'提交数据==========================>',
formName,
ids
)
if (formName.system.length !== 0) {
if (formName.applicationSystem.length == 0) {
formName.applicationSystem = ''
}
submitApply(formName).then((res) => {
// applySuccess.value = false
message.success('申请提交成功,请到消息中心查看!')
console.log('能力申请================>', res)
if (res.data.code == 0) {
if (ids && ids.length > 0) {
sgcDel({ ids: ids }).then((res) => {
if (res.data.msg === 'success') {
mybus.emit('getSgcNum')
router.push({
path: '/DetailsPageconetent',
query: {
select: '组件服务',
},
})
}
})
} else {
router.push({
path: '/DetailsPageconetent',
query: {
select: '组件服务',
},
})
}
} else {
message.error('申请失败!')
}
})
}
)
} else {
message.error('数据更新失败!')
}
})
} else {
formRef.value.validate().then(() => {
if (!formUrl) {
return message.error('请设置保存表单的URL')
}
if (!formName) {
return message.error('请设置表单名称')
}
}
})
} else {
if (!applyAll) {
console.log(list.value[0].arr[0])
//
@ -576,8 +693,8 @@
}
})
}
})
}
}
})
}
//
const startProcess = (processDefinitionKey, businessKey, formData) => {
@ -841,4 +958,4 @@
justify-content: center;
// position: fixed;
}
</style>
</style>

View File

@ -264,9 +264,8 @@
const pagination = ref({
total: 0,
current: 1,
pageSize: 10, //10
pageSize: 300, //10
showSizeChanger: true,
pageSizeOptions: ['5', '10', '15', '20'], //
})
const mapSearchParam = ref({
//
@ -709,8 +708,8 @@
const onSelectChange = (record, selected, selectedRows, nativeEvent) => {
console.log('hahhahah', record, selected, selectedRows, nativeEvent)
if (selected) {
if (selectedRowKeys.value.length == 10) {
message.warning('最多只能添加10个摄像头')
if (selectedRowKeys.value.length == 300) {
message.warning('最多只能添加300个摄像头')
} else {
selectedList.value.push(record)
selectedRowKeys.value.push(record.channelCode || record.channelId)
@ -734,8 +733,8 @@
selectedList.value.push(val)
selectedRowKeys.value.push(val.channelCode || val.channelId)
})
if (selectedRowKeys.value.length > 10) {
message.warning('最多只能添加10个摄像头')
if (selectedRowKeys.value.length > 300) {
message.warning('最多只能添加300个摄像头')
changeRows.map((val) => {
selectedList.value = selectedList.value.filter(
(item) => item.idtCameraChannel !== val.idtCameraChannel

View File

@ -2,7 +2,7 @@
* @Author: hisense.liangjunhua
* @Date: 2022-07-12 09:42:44
* @LastEditors: hisense.liangjunhua
* @LastEditTime: 2022-08-02 16:34:42
* @LastEditTime: 2022-08-04 10:41:06
* @Description:我的申请 能力申请 查看详情
-->
<template>
@ -61,7 +61,11 @@
>
<div class="oddNumbers">子单号{{ item.instanceId }}</div>
<div style="display: flex; align-items: center">
<a-button type="primary" @click="modify(item.instanceId)">
<a-button
type="primary"
@click="modify(props.refObj.id, item)"
v-if="item.backToFirst"
>
修改
</a-button>
<a-popconfirm
@ -183,14 +187,24 @@
</div>
</template>
<script setup>
import { ref, defineProps } from 'vue'
import { ref, defineProps, reactive } from 'vue'
import mybus from '@/myplugins/mybus'
import { message } from 'ant-design-vue'
import { endProcess } from '@/api/personalCenter.js'
import { endProcess, getApplyForm } from '@/api/personalCenter.js'
import { useRouter } from 'vue-router'
const router = useRouter()
const backUrl = ref(window.SITE_CONFIG.apiURL + '/')
const props = defineProps({
refObj: { type: Object, default: null },
})
const dept = reactive({})
// eslint-disable-next-line no-undef
if (infrastructure) {
// eslint-disable-next-line no-undef
dept.deptId = infrastructure.deptId
// eslint-disable-next-line no-undef
dept.deptName = infrastructure.deptName
}
const showThis = () => {
window.open(
window.SITE_CONFIG.previewUrl +
@ -210,8 +224,69 @@
}
})
}
const modify = (instanceId) => {
console.log('修改==============>', instanceId)
const modify = (id, item) => {
getApplyForm(id).then((res) => {
console.log('修改==============>', res.data.data, item)
if (item.list.length > 0) {
let arr = []
item.list.map((val) => {
arr.push({
delFlag: val.delFlag,
description: val.description,
resourceId: val.id,
resourceName: val.name,
time: val.createDate,
type: val.type,
componentType:
(val.infoList.filter((val) => val.attrType == '组件类型')[0] &&
val.infoList.filter((val) => val.attrType == '组件类型')[0]
.attrValue) ||
'',
})
})
localStorage.setItem(
'applyList',
JSON.stringify([
{
arr: arr,
deptId: item.name,
deptName: item.name,
},
])
)
router.push({
path: '/apply',
query: {
id: id,
taskId: item.instanceId,
},
})
} else if (item.list2.length > 0) {
let arr = [
{
arr: [
{
description: '',
note1: JSON.stringify(item.list2),
resourceId: '1522550195055828996',
resourceName: '摄像头列表',
type: '基础设施',
},
],
deptId: dept.deptId,
deptName: dept.deptName,
},
]
localStorage.setItem('applyList', JSON.stringify(arr))
router.push({
path: '/apply',
query: {
id: id,
taskId: item.instanceId,
},
})
}
})
}
if (props.refObj.resourceApplication) {
showArr.value = []
@ -221,6 +296,7 @@
obj.name = key
props.refObj.resourceApplication[key].map((item) => {
obj.instanceId = item.instanceId
obj.backToFirst = item.backToFirst
obj.ended = item.ended
obj.approveStatus = item.approveStatus
if (item.resources.length > 0) {