西海岸:基础设施-申请增加过期时间

This commit is contained in:
guoyue 2022-09-27 11:53:10 +08:00
parent f071abfcf7
commit cf7d85060c
1 changed files with 44 additions and 8 deletions

View File

@ -10,10 +10,17 @@
<div v-if="applySuccess"> <div v-if="applySuccess">
<a-form ref="formRef" :model="formName" name="basic" :label-col="{ style: { width: '106px' } }" <a-form ref="formRef" :model="formName" name="basic" :label-col="{ style: { width: '106px' } }"
:wrapper-col="{ style: { width: '230px' } }" labelAlign="left" autocomplete="off"> :wrapper-col="{ style: { width: '230px' } }" labelAlign="left" autocomplete="off">
<div class="base-info"> <div class="base-info flex-row-start">
<a-form-item label="申请标题" name="title" :rules="[{ required: true, message: '请输入申请标题' }]"> <a-form-item label="申请标题" name="title" :rules="[{ required: true, message: '请输入申请标题' }]">
<a-input placeholder="请输入能力申请标题" v-model:value="formName.title" /> <a-input placeholder="请输入能力申请标题" v-model:value="formName.title" />
</a-form-item> </a-form-item>
<!-- 西海岸-摄像头-增加过期时间 -->
<a-form-item v-if="isCamera && isXiHaiAn" label="过期时间" name="expireDate"
:rules="[{ required: true, message: '请选择过期时间' }]" style="margin-left: 22px">
<a-select v-model:value="formName.expireDate" placeholder="请选择过期时间" style="width: 200px;"
:options="expireDateOptions">
</a-select>
</a-form-item>
</div> </div>
<div class="base-info"> <div class="base-info">
<a-form-item label="申请人信息" name="user" :rules="[{ required: true, message: '请输入申请人' }]"> <a-form-item label="申请人信息" name="user" :rules="[{ required: true, message: '请输入申请人' }]">
@ -127,6 +134,7 @@ import { sgcDel, getApplyForm } from '@/api/personalCenter'
import { pageWithAttrs, updateIntegrationServices } from '@/api/home' import { pageWithAttrs, updateIntegrationServices } from '@/api/home'
import { DETAIL_PAGE_CONTENT_DEFAULT_TAB } from '@/global/GlobalConfig.js' import { DETAIL_PAGE_CONTENT_DEFAULT_TAB } from '@/global/GlobalConfig.js'
import { getIntegrationDetail, soldierApply } from '@/api/home' import { getIntegrationDetail, soldierApply } from '@/api/home'
import * as moment from 'moment'
export default { export default {
name: '', name: '',
@ -148,6 +156,21 @@ export default {
// //
const integrationServicesItemInfo = ref(null) const integrationServicesItemInfo = ref(null)
const num = ref(0) const num = ref(0)
//
const expireDateOptions = [
{
value: moment().add(30, 'days').format('YYYY-MM-DD HH:mm:ss'),
label: '30天',
},
{
value: moment().add(60, 'days').format('YYYY-MM-DD HH:mm:ss'),
label: '60天',
},
{
value: moment().add(90, 'days').format('YYYY-MM-DD HH:mm:ss'),
label: '90天',
},
]
if (!applyAll) { if (!applyAll) {
list.value.map((item) => { list.value.map((item) => {
@ -171,8 +194,14 @@ export default {
const baseURL = window.SITE_CONFIG.apiURL const baseURL = window.SITE_CONFIG.apiURL
let record = ref('1') let record = ref('1')
const text = ref('') const text = ref('')
// 西- todo // 西-
let wrjAndDbText = ['单兵设备', '无人机'] let wrjAndDbText = ['单兵设备', '无人机']
const isXiHaiAn = ref(whoShow.itShowXiHaiAn)
// 西--
const isCamera = ref(false);
if (list.value[0] && list.value[0].arr && list.value[0].arr[0] && list.value[0].arr[0].type == '基础设施') {
isCamera.value = true
}
const formName = reactive({ const formName = reactive({
title: applyAll title: applyAll
? '全部应用资源申请' ? '全部应用资源申请'
@ -331,8 +360,8 @@ export default {
} }
} else { } else {
let obj = {} let obj = {}
Object.assign(obj, formName) // todo
console.log('摄像头===============>', obj, item) console.log('formName---摄像头--------->', formName);
obj.system = [] obj.system = []
item.note1 = JSON.parse(item.note1) item.note1 = JSON.parse(item.note1)
item.note1.map((sxt) => { item.note1.map((sxt) => {
@ -352,6 +381,8 @@ export default {
status: sxt.status + '', status: sxt.status + '',
}) })
}) })
console.log('obj----摄像头申请-------->', obj);
return;
submitApply(obj).then((res) => { submitApply(obj).then((res) => {
// applySuccess.value = false // applySuccess.value = false
console.log('摄像头申请================>', res) console.log('摄像头申请================>', res)
@ -734,7 +765,7 @@ export default {
}) })
} }
// 西 todo // 西
const handleWrjApply = (formName) => { const handleWrjApply = (formName) => {
let _data = { let _data = {
deviceId: formName.system && formName.system[0] && formName.system[0].resourceId, deviceId: formName.system && formName.system[0] && formName.system[0].resourceId,
@ -746,11 +777,8 @@ export default {
applicationSystem: formName.applicationSystem, // applicationSystem: formName.applicationSystem, //
applicationArea: JSON.stringify(formName.applicationScene), // applicationArea: JSON.stringify(formName.applicationScene), //
demand: formName.applicationBackground, // demand: formName.applicationBackground, //
// applyUserId: formName.userId // id
} }
console.log('_data-----提交申请------->', _data);
soldierApply(_data).then(res => { soldierApply(_data).then(res => {
console.log('res----提交申请-------->', res);
if (res.data.code == 0) { if (res.data.code == 0) {
message.success(res.data.msg) message.success(res.data.msg)
jumpToDetailsPageconetent() jumpToDetailsPageconetent()
@ -794,6 +822,9 @@ export default {
flag, flag,
applyAll, applyAll,
getIntegrationServicesDeatil, getIntegrationServicesDeatil,
isCamera,
isXiHaiAn,
expireDateOptions,
} }
}, },
} }
@ -839,6 +870,11 @@ export default {
justify-content: space-between; justify-content: space-between;
} }
.flex-row-start {
justify-content: flex-start;
align-items: center;
}
:deep(.ant-form-item-label) { :deep(.ant-form-item-label) {
label { label {
color: #666; color: #666;