demandSubject

This commit is contained in:
gaoyuanwei 2022-07-05 13:51:21 +08:00
parent dc0a44dab7
commit 20b968beba
3 changed files with 497 additions and 555 deletions

View File

@ -84,7 +84,11 @@ export default {
methods: { methods: {
// //
resetDataList () { resetDataList () {
this.dataForm = this.noDataForm this.dataForm = {
orderId: '',
status: '',
userId: ''
},
this.page = 1 // this.page = 1 //
this.query() this.query()
}, },

View File

@ -2,10 +2,7 @@
<!-- 使用方式 --> <!-- 使用方式 -->
<div class="usage-mode" v-if="flag"> <div class="usage-mode" v-if="flag">
<div class="tltle"> <div class="tltle">
<DetalsTitle <DetalsTitle :title="dataFrom.title" :type="dataFrom.englishTitle"></DetalsTitle>
:title="dataFrom.title"
:type="dataFrom.englishTitle"
></DetalsTitle>
</div> </div>
<div class="content" v-for="item in dataFrom.content" :key="item.title"> <div class="content" v-for="item in dataFrom.content" :key="item.title">
<div class="content-left"> <div class="content-left">
@ -31,7 +28,7 @@
<div class="content-right-title">{{ item.contact }}</div> <div class="content-right-title">{{ item.contact }}</div>
<div class="content-right-content"> <div class="content-right-content">
<p> <p>
<span>{{ item.contact }}</span> <span>{{ item.facilitator.name }}</span>
<a-tooltip> <a-tooltip>
<template #title>{{ item.facilitator.value }}</template> <template #title>{{ item.facilitator.value }}</template>
<span>{{ item.facilitator.value }}</span> <span>{{ item.facilitator.value }}</span>
@ -57,7 +54,7 @@
<div class="content-right-title">{{ item.contact2 }}</div> <div class="content-right-title">{{ item.contact2 }}</div>
<div class="content-right-content"> <div class="content-right-content">
<p> <p>
<span>{{ item.contact2 }}</span> <span>{{ item.facilitator2.name }}</span>
<a-tooltip> <a-tooltip>
<template #title>{{ item.facilitator2.value }}</template> <template #title>{{ item.facilitator2.value }}</template>
<span>{{ item.facilitator2.value }}</span> <span>{{ item.facilitator2.value }}</span>
@ -85,275 +82,286 @@
</template> </template>
<script setup> <script setup>
import DetalsTitle from '@/views/detailsAll/components/DetalsTitle' import DetalsTitle from '@/views/detailsAll/components/DetalsTitle'
import { pinyin } from 'pinyin-pro' import { pinyin } from 'pinyin-pro'
import { ref, defineProps, watch } from 'vue' import { ref, defineProps, watch } from 'vue'
let dataFrom = ref({ let dataFrom = ref({
link: '', link: '',
title: '使用方式', title: '使用方式',
englishTitle: 'USAGE', englishTitle: 'USAGE',
content: [ content: [
{ {
title: '组件地址', title: '组件地址',
link: { link: {
name: '接口地址:', name: '接口地址:',
},
linkValue: '',
contact: '归属部门',
facilitator: { name: '归属部门:', value: '' },
people: { name: '部门联系人:', value: '' },
phone: {
name: '联系人电话:',
value: '',
},
contact2: '服务商',
facilitator2: { name: '服务商:', value: '' },
people2: { name: '服务商联系人:', value: '' },
phone2: {
name: '联系人电话:',
value: '',
},
}, },
], linkValue: '',
}) contact: '归属部门',
// facilitator: { name: '归属部门:', value: '' },
const props = defineProps({ people: { name: '部门联系人:', value: '' },
dataList: { type: Object, default: null }, phone: {
}) name: '联系人电话:',
const flag = ref(true) value: '',
if (props.dataList.infoList) { },
let obj = props.dataList.infoList.filter( contact2: '服务商',
(item) => facilitator2: { name: '服务商:', value: '' },
item.attrType === '技术文档' || people2: { name: '服务商联系人:', value: '' },
item.attrType === '服务商' || phone2: {
item.attrType === '服务商联系人' || name: '联系人电话:',
item.attrType === '使用手册' || value: '',
item.attrType === '服务地址' || },
item.attrType === '样式服务地址' || },
item.attrType === '服务商联系电话' ],
)[0] })
if (!obj) { //
flag.value = false const props = defineProps({
} else { dataList: { type: Object, default: null },
// eslint-disable-next-line vue/no-setup-props-destructure })
dataFrom.value.content[0].link.value = props.dataList.apiUrl const flag = ref(true)
dataFrom.value.content[0].facilitator.value = props.dataList.deptName if (props.dataList.infoList) {
dataFrom.value.content[0].people.value = props.dataList.deptContacts let obj = props.dataList.infoList.filter(
dataFrom.value.content[0].phone.value = props.dataList.deptPhone (item) =>
console.log('dataList', props.dataList) item.attrType === '技术文档' ||
props.dataList.infoList.map((item) => { item.attrType === '服务商' ||
if (item.attrType === '组件地址') { item.attrType === '服务商联系人' ||
dataFrom.value.content[0].linkValue = item.attrValue || '--' item.attrType === '使用手册' ||
} else if (item.attrType === '服务商') { item.attrType === '服务地址' ||
dataFrom.value.content[0].facilitator2.value = item.attrValue || '--' item.attrType === '样式服务地址' ||
} else if (item.attrType === '服务商联系人') { item.attrType === '服务商联系电话'
dataFrom.value.content[0].people2.value = item.attrValue || '--' )[0]
} else if (item.attrType === '服务商联系电话') { if (!obj) {
dataFrom.value.content[0].phone2.value = item.attrValue || '--' flag.value = false
} } else {
}) // eslint-disable-next-line vue/no-setup-props-destructure
} dataFrom.value.content[0].link.value = props.dataList.apiUrl
dataFrom.value.content[0].facilitator.value = props.dataList.deptName
dataFrom.value.content[0].people.value = props.dataList.deptContacts
dataFrom.value.content[0].phone.value = props.dataList.deptPhone
console.log('dataList', props.dataList)
props.dataList.infoList.map((item) => {
if (item.attrType === '组件地址') {
dataFrom.value.content[0].linkValue = item.attrValue || '--'
} else if (item.attrType === '服务商') {
dataFrom.value.content[0].facilitator2.value = item.attrValue || '--'
} else if (item.attrType === '服务商联系人') {
dataFrom.value.content[0].people2.value = item.attrValue || '--'
} else if (item.attrType === '服务商联系电话') {
dataFrom.value.content[0].phone2.value = item.attrValue || '--'
}
})
} }
watch( }
() => props.dataList, watch(
(val) => { () => props.dataList,
if (val) { (val) => {
let obj = val.infoList.filter( if (val) {
(item) => let obj = val.infoList.filter(
item.attrType === '技术文档' || (item) =>
item.attrType === '服务商' || item.attrType === '技术文档' ||
item.attrType === '服务商联系人' || item.attrType === '服务商' ||
item.attrType === '使用手册' || item.attrType === '服务商联系人' ||
item.attrType === '服务地址' || item.attrType === '使用手册' ||
item.attrType === '样式服务地址' || item.attrType === '服务地址' ||
item.attrType === '服务商联系电话' item.attrType === '样式服务地址' ||
)[0] item.attrType === '服务商联系电话'
if (!obj) { )[0]
flag.value = false if (!obj) {
} else { flag.value = false
dataFrom.value.content[0].link.value = val.apiUrl } else {
dataFrom.value.content[0].facilitator.value = val.deptName dataFrom.value.content[0].link.value = val.apiUrl
dataFrom.value.content[0].people.value = val.deptContacts dataFrom.value.content[0].facilitator.value = val.deptName
dataFrom.value.content[0].phone.value = val.deptPhone dataFrom.value.content[0].people.value = val.deptContacts
console.log('dataList', val) dataFrom.value.content[0].phone.value = val.deptPhone
val.infoList.map((item) => { console.log('dataList', val)
if (item.attrType === '组件地址') { val.infoList.map((item) => {
dataFrom.value.content[0].linkValue = item.attrValue || '--' if (item.attrType === '组件地址') {
} else if (item.attrType === '服务商') { dataFrom.value.content[0].linkValue = item.attrValue || '--'
dataFrom.value.content[0].facilitator2.value = } else if (item.attrType === '服务商') {
item.attrValue || '--' dataFrom.value.content[0].facilitator2.value =
} else if (item.attrType === '服务商联系人') { item.attrValue || '--'
dataFrom.value.content[0].people2.value = item.attrValue || '--' } else if (item.attrType === '服务商联系人') {
} else if (item.attrType === '服务商联系电话') { dataFrom.value.content[0].people2.value = item.attrValue || '--'
dataFrom.value.content[0].phone2.value = item.attrValue || '--' } else if (item.attrType === '服务商联系电话') {
} dataFrom.value.content[0].phone2.value = item.attrValue || '--'
}) }
} })
} }
} }
}
)
function technical() {
//
// const type = pinyin(props.dataList.type, {
// pattern: 'initial',
// }).replace(/\s*/g, '')
// //
// const id = props.dataList.id
// window.open(window.SITE_CONFIG.frontUrl + type + '/' + id + '.md', '_blank')
// console.log('dataFrom.value.link', dataFrom.value.link)
let obj = props.dataList.infoList.filter(
(item) => item.attrType === '技术文档'
)[0]
console.log('dataFrom.value.link', obj.attrValue)
window.open(
window.SITE_CONFIG.previewUrl +
'hisense_office/onlinePreview?url=' +
btoa(encodeURI(obj.attrValue))
) )
function technical() { }
// function technicalNew() {
// const type = pinyin(props.dataList.type, { //
// pattern: 'initial', // const type = pinyin(props.dataList.type, {
// }).replace(/\s*/g, '') // pattern: 'initial',
// // // }).replace(/\s*/g, '')
// const id = props.dataList.id // //
// window.open(window.SITE_CONFIG.frontUrl + type + '/' + id + '.md', '_blank') // const id = props.dataList.id
// console.log('dataFrom.value.link', dataFrom.value.link) // window.open(window.SITE_CONFIG.frontUrl + type + '/' + id + '.md', '_blank')
let obj = props.dataList.infoList.filter( let obj = props.dataList.infoList.filter(
(item) => item.attrType === '技术文档' (item) => item.attrType === '使用手册'
)[0] )[0]
console.log('dataFrom.value.link', obj.attrValue) console.log('dataFrom.value.link', obj.attrValue)
window.open( window.open(
window.SITE_CONFIG.previewUrl + window.SITE_CONFIG.previewUrl +
'hisense_office/onlinePreview?url=' + 'hisense_office/onlinePreview?url=' +
btoa(encodeURI(obj.attrValue)) btoa(encodeURI(obj.attrValue))
) )
} }
function technicalNew() {
//
// const type = pinyin(props.dataList.type, {
// pattern: 'initial',
// }).replace(/\s*/g, '')
// //
// const id = props.dataList.id
// window.open(window.SITE_CONFIG.frontUrl + type + '/' + id + '.md', '_blank')
let obj = props.dataList.infoList.filter(
(item) => item.attrType === '使用手册'
)[0]
console.log('dataFrom.value.link', obj.attrValue)
window.open(
window.SITE_CONFIG.previewUrl +
'hisense_office/onlinePreview?url=' +
btoa(encodeURI(obj.attrValue))
)
}
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.usage-mode { .usage-mode {
display: flex;
flex-direction: column;
align-items: center;
padding: 0.8rem 0;
.content {
margin-top: 0.3rem;
display: flex; display: flex;
flex-direction: column;
align-items: center; .content-left {
padding: 0.8rem 0; height: 1.8rem;
.content { width: 6.2rem;
margin-top: 0.3rem; background: linear-gradient(to right,
rgba(113, 132, 252, 0.4),
rgba(148, 163, 252, 0.4));
border-radius: 0.1rem;
margin-right: 0.6rem;
box-shadow: 0rem 0.05rem 0.15rem rgba(82, 106, 255, 0.4);
display: flex; display: flex;
.content-left { align-items: center;
height: 1.8rem; padding: 0 0.35rem;
width: 6.2rem;
background: linear-gradient( .left {
to right, .content-left-title {
rgba(113, 132, 252, 0.4),
rgba(148, 163, 252, 0.4)
);
border-radius: 0.1rem;
margin-right: 0.6rem;
box-shadow: 0rem 0.05rem 0.15rem rgba(82, 106, 255, 0.4);
display: flex;
align-items: center;
padding: 0 0.35rem;
.left {
.content-left-title {
font-size: 0.26rem;
line-height: 0.26rem;
color: #212956;
margin-bottom: 0.2rem;
span:first-child {
margin-right: 0.1rem;
}
}
.content-left-content {
width: 4.2rem;
font-size: 0.2rem;
color: rgba(33, 41, 86, 0.8);
line-height: 0.2rem;
p {
display: -webkit-box;
overflow: hidden;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
// margin-bottom: 0.1rem;
font-size: 20px;
color: #212956;
line-height: 26px;
}
p:last-of-type {
margin-top: 20px;
}
}
}
.right {
div {
height: 0.4rem;
width: 1.3rem;
background: #ffffff;
border-radius: 0.2rem;
color: #526aff;
font-size: 0.2rem;
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
}
div:first-child {
margin-bottom: 0.2rem;
}
}
}
.content-right {
height: 1.8rem;
width: 6.2rem;
background: linear-gradient(
to right,
rgba(113, 132, 252, 0.4),
rgba(148, 163, 252, 0.4)
);
border-radius: 0.1rem;
box-shadow: 0rem 0.05rem 0.15rem rgba(82, 106, 255, 0.4);
display: flex;
justify-content: space-around;
align-items: center;
padding: 0 0.3rem;
.content-right-left {
border-right: 0.01rem solid #b0b9f1;
padding-right: 0.1rem;
margin-right: 0.1rem;
}
.content-right-title {
font-size: 0.26rem; font-size: 0.26rem;
line-height: 0.26rem; line-height: 0.26rem;
color: #212956; color: #212956;
margin-bottom: 0.15rem; margin-bottom: 0.2rem;
span:first-child {
margin-right: 0.1rem;
}
} }
.content-right-content {
display: flex; .content-left-content {
font-size: 0.16rem; width: 4.2rem;
font-size: 0.2rem;
color: rgba(33, 41, 86, 0.8); color: rgba(33, 41, 86, 0.8);
line-height: 0.2rem; line-height: 0.2rem;
overflow: hidden;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
flex-direction: column;
p { p {
// width: 1.60rem;
height: 0.2rem;
display: -webkit-box; display: -webkit-box;
// overflow: hidden; overflow: hidden;
white-space: nowrap;
-webkit-line-clamp: 1; -webkit-line-clamp: 1;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
margin-right: 0.15rem; // margin-bottom: 0.1rem;
span { font-size: 20px;
cursor: pointer; color: #212956;
font-size: 20px; line-height: 26px;
color: #212956; }
opacity: 0.8;
} p:last-of-type {
margin-top: 20px;
}
}
}
.right {
div {
height: 0.4rem;
width: 1.3rem;
background: #ffffff;
border-radius: 0.2rem;
color: #526aff;
font-size: 0.2rem;
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
}
div:first-child {
margin-bottom: 0.2rem;
}
}
}
.content-right {
height: 1.8rem;
width: 6.2rem;
background: linear-gradient(to right,
rgba(113, 132, 252, 0.4),
rgba(148, 163, 252, 0.4));
border-radius: 0.1rem;
box-shadow: 0rem 0.05rem 0.15rem rgba(82, 106, 255, 0.4);
display: flex;
justify-content: space-around;
align-items: center;
padding: 0 0.3rem;
.content-right-left {
// border-right: 0.01rem solid #b0b9f1;
padding-right: 0.1rem;
margin-right: 0.1rem;
}
.content-right-title {
font-size: 0.26rem;
line-height: 0.26rem;
color: #212956;
margin-bottom: 0.15rem;
}
.content-right-content {
display: flex;
font-size: 0.16rem;
color: rgba(33, 41, 86, 0.8);
line-height: 0.2rem;
overflow: hidden;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
flex-direction: column;
p {
// width: 1.60rem;
height: 0.2rem;
display: -webkit-box;
// overflow: hidden;
white-space: nowrap;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
margin-right: 0.15rem;
span {
cursor: pointer;
font-size: 20px;
color: #212956;
opacity: 0.8;
} }
} }
} }
} }
} }
}
</style> </style>

View File

@ -9,83 +9,38 @@
<div class="form-container"> <div class="form-container">
<div v-if="applySuccess"> <div v-if="applySuccess">
<div class="title">申请人信息</div> <div class="title">申请人信息</div>
<a-form <a-form ref="formRef" :model="formName" name="basic" :label-col="{ style: { width: '106px' } }"
ref="formRef" :wrapper-col="{ style: { width: '230px' } }" labelAlign="left" autocomplete="off">
:model="formName"
name="basic"
:label-col="{ style: { width: '106px' } }"
:wrapper-col="{ style: { width: '230px' } }"
labelAlign="left"
autocomplete="off"
>
<div class="base-info"> <div class="base-info">
<a-form-item <a-form-item label="申请人" name="applyUserName" :rules="[{ required: true, message: '请输入申请人' }]">
label="申请人" <a-input placeholder="请输入申请人" v-model:value="formName.applyUserName" />
name="applyUserName"
:rules="[{ required: true, message: '请输入申请人' }]"
>
<a-input
placeholder="请输入申请人"
v-model:value="formName.applyUserName"
/>
</a-form-item> </a-form-item>
<a-form-item <a-form-item style="margin: 0 22px" label="申请人电话" name="applyUserPhone" :rules="[
style="margin: 0 22px" {
label="申请人电话" required: true,
name="applyUserPhone" pattern: /^1[3456789]\d{9}$/,
:rules="[ message: '请输入正确的电话号码',
{ },
required: true, ]">
pattern: /^1[3456789]\d{9}$/, <a-input placeholder="请输入申请人电话" v-model:value="formName.applyUserPhone" />
message: '请输入正确的电话号码',
},
]"
>
<a-input
placeholder="请输入申请人电话"
v-model:value="formName.applyUserPhone"
/>
</a-form-item> </a-form-item>
<a-form-item <a-form-item label="申请单位" name="applyUserDeptName" :rules="[{ required: true, message: '请输入申请单位' }]">
label="申请单位" <a-input placeholder="请输入申请单位" v-model:value="formName.applyUserDeptName" />
name="applyUserDeptName"
:rules="[{ required: true, message: '请输入申请单位' }]"
>
<a-input
placeholder="请输入申请单位"
v-model:value="formName.applyUserDeptName"
/>
</a-form-item> </a-form-item>
</div> </div>
<div class="title">需求信息</div> <div class="title">需求信息</div>
<a-form-item <a-form-item style="margin-bottom: 10px" label="需求标题" name="demandSubject"
style="margin-bottom: 10px" :rules="[{ required: true, message: '请输入需求标题' }]">
label="需求标题" <a-input style="width: 350px" v-model:value="formName.demandSubject" />
name="demandSubject"
:rules="[{ required: true, message: '请输入需求标题' }]"
>
<a-input
style="width: 350px"
v-model:value="formName.demandSubject"
/>
</a-form-item> </a-form-item>
<a-form-item <a-form-item style="margin-bottom: 10px" label="需求类型" name="detailsType"
style="margin-bottom: 10px" :rules="[{ required: true, message: '请选择需求类型' }]">
label="需求类型" <a-select ref="select" v-model:value="formName.detailsType" @focus="focus" style="width: 200px">
name="detailsType"
:rules="[{ required: true, message: '请选择需求类型' }]"
>
<a-select
ref="select"
v-model:value="formName.detailsType"
@focus="focus"
style="width: 200px"
>
<a-select-option value="基础设施">基础设施</a-select-option> <a-select-option value="基础设施">基础设施</a-select-option>
<a-select-option value="数据资源">数据资源</a-select-option> <a-select-option value="数据资源">数据资源</a-select-option>
<a-select-option value="组件服务">组件服务</a-select-option> <a-select-option value="组件服务">组件服务</a-select-option>
@ -94,26 +49,14 @@
</a-select> </a-select>
</a-form-item> </a-form-item>
<a-form-item <a-form-item label="应用领域" name="detailsField" style="width: 350px"
label="应用领域" :rules="[{ required: true, message: '请输入应用领域' }]">
name="detailsField" <a-input placeholder="请输入应用领域" v-model:value="formName.detailsField" />
style="width: 350px"
:rules="[{ required: true, message: '请输入应用领域' }]"
>
<a-input
placeholder="请输入应用领域"
v-model:value="formName.detailsField"
/>
</a-form-item> </a-form-item>
<a-form-item <a-form-item style="margin-bottom: 10px" label="需求描述" name="demandDetails"
style="margin-bottom: 10px" :rules="[{ required: true, message: '请输入需求描述' }]">
label="需求描述" <a-textarea style="
name="demandDetails"
:rules="[{ required: true, message: '请输入需求描述' }]"
>
<a-textarea
style="
width: 500px; width: 500px;
height: 150px; height: 150px;
font-size: 16px; font-size: 16px;
@ -123,24 +66,12 @@
border-radius: 6px; border-radius: 6px;
padding: 10px; padding: 10px;
resize: none; resize: none;
" " v-model:value="formName.demandDetails" />
v-model:value="formName.demandDetails"
/>
</a-form-item> </a-form-item>
<a-form-item <a-form-item style="color: #666; font-size: 16px" label="附件上传" name="applyDoc">
style="color: #666; font-size: 16px" <a-upload v-model:file-list="fileList" name="file" :action="upLoadUrl" :headers="headers"
label="附件上传" @change="handleChange">
name="applyDoc" <a-button style="
>
<a-upload
v-model:file-list="fileList"
name="file"
:action="upLoadUrl"
:headers="headers"
@change="handleChange"
>
<a-button
style="
width: 100px; width: 100px;
height: 30px; height: 30px;
margin-right: 10px; margin-right: 10px;
@ -151,8 +82,7 @@
border: 1px solid #bbd3ef; border: 1px solid #bbd3ef;
padding: 0; padding: 0;
text-align: center; text-align: center;
" ">
>
<upload-outlined></upload-outlined> <upload-outlined></upload-outlined>
文件上传 文件上传
</a-button> </a-button>
@ -163,8 +93,7 @@
</a-form-item> </a-form-item>
<a-form-item :wrapper-col="{ offset: 8, span: 16 }"> <a-form-item :wrapper-col="{ offset: 8, span: 16 }">
<a-button <a-button style="
style="
width: 80px; width: 80px;
height: 38px; height: 38px;
margin-right: 20px; margin-right: 20px;
@ -175,15 +104,10 @@
border: none; border: none;
padding: 0; padding: 0;
text-align: center; text-align: center;
" " type="primary" html-type="cancle" @click="signOut">
type="primary"
html-type="cancle"
@click="signOut"
>
退出申请 退出申请
</a-button> </a-button>
<a-button <a-button style="
style="
width: 80px; width: 80px;
height: 38px; height: 38px;
background: #0087ff; background: #0087ff;
@ -193,11 +117,7 @@
border: none; border: none;
padding: 0; padding: 0;
text-align: center; text-align: center;
" " type="primary" html-type="submit" @click="processStartHandle()">
type="primary"
html-type="submit"
@click="processStartHandle()"
>
提交申请 提交申请
</a-button> </a-button>
</a-form-item> </a-form-item>
@ -209,7 +129,7 @@
</div> </div>
<p> <p>
您已成功申请{{ 您已成功申请{{
formName.demandSubject || '' formName.demandSubject || ''
}},请耐心等待审批结果结果会第一时间通知您 }},请耐心等待审批结果结果会第一时间通知您
</p> </p>
</div> </div>
@ -220,209 +140,219 @@
</template> </template>
<script> <script>
import HomeHeader from '@/views/home/components/header' import HomeHeader from '@/views/home/components/header'
import { reactive, ref } from 'vue' import { reactive, ref } from 'vue'
import { message } from 'ant-design-vue' import { message } from 'ant-design-vue'
// import { UploadOutlined } from '@ant-design/icons-vue' // import { UploadOutlined } from '@ant-design/icons-vue'
import { getUser, getUserInfo, relaunch } from '@/api/home' import { getUser, getUserInfo, relaunch } from '@/api/home'
import { import {
demandApply, demandApply,
getDemandForm, getDemandForm,
updateDemandForm, updateDemandForm,
} from '@/api/personalCenter' } from '@/api/personalCenter'
// import { baseURL } from '@/config' // import { baseURL } from '@/config'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
export default { export default {
name: '', name: '',
props: {}, props: {},
components: { components: {
HomeHeader, HomeHeader,
// UploadOutlined, // UploadOutlined,
}, },
setup() { setup() {
const disabled = ref(false) const disabled = ref(false)
const upLoadUrl = ref(window.SITE_CONFIG.apiURL + '/upload') const upLoadUrl = ref(window.SITE_CONFIG.apiURL + '/upload')
const formName = reactive({ const formName = reactive({
applyUserDeptId: '', applyUserDeptId: '',
applyUserDeptName: '', applyUserDeptName: '',
applyUserId: '', applyUserId: '',
applyUserName: '', applyUserName: '',
applyUserPhone: '', applyUserPhone: '',
demandDetails: '', demandDetails: '',
demandSubject: '', demandSubject: '',
detailsField: '', detailsField: '',
detailsType: '', detailsType: '',
enclosure: '', enclosure: '',
})
// console.log(formName.demandSubject)
const router = useRouter()
const id = ref(router.currentRoute.value.query.id)
const taskId = ref(router.currentRoute.value.query.taskId)
if (id.value) {
getDemandForm(id.value).then((res) => {
console.log('回填数据===============>', res)
formName.applyUserPhone = res.data.data.applyUserPhone
formName.demandSubject = res.data.data.demandSubject
formName.detailsType = res.data.data.detailsType
formName.detailsField = res.data.data.detailsField
formName.demandDetails = res.data.data.demandDetails
formName.enclosure = res.data.data.enclosure
}) })
// console.log(formName.demandSubject) }
getUser().then((res) => {
formName.applyUserName = res.data.data.realName
formName.applyUserId = res.data.data.id
getUserInfo(formName.applyUserId).then((res) => {
if (res.data.data.mobile) {
formName.applyUserPhone = res.data.data.mobile
}
formName.applyUserDeptName = res.data.data.deptName
formName.applyUserDeptId = res.data.data.deptId
})
})
const router = useRouter() const formRef = ref()
const id = ref(router.currentRoute.value.query.id) const applySuccess = ref(true)
const taskId = ref(router.currentRoute.value.query.taskId)
// 退
const signOut = () => {
window.close()
}
const handleChange = (info) => {
if (info.file.status !== 'uploading') {
console.log(info.file, info.fileList)
}
if (info.file.status === 'done') {
message.success(`${info.file.name} 文件上传成功`)
formName.enclosure = info.file.response.data
} else if (info.file.status === 'error') {
message.error(`${info.file.name} 文件上传失败`)
}
}
const fileList = ref([])
const processStartHandle = () => {
if (id.value) { if (id.value) {
getDemandForm(id.value).then((res) => { updateDemandForm(formName).then((upres) => {
console.log('回填数据===============>', res) if (upres.data.code == 0) {
formName.applyUserPhone = res.data.data.applyUserPhone relaunch({ data: formName, taskId: taskId.value }).then((res) => {
formName.demandSubject = res.data.data.demandSubject console.log('驳回================>', res)
formName.detailsType = res.data.data.detailsType if (res.data.code == 0) {
formName.detailsField = res.data.data.detailsField message.success('重新发起流程成功!')
formName.demandDetails = res.data.data.demandDetails window.setTimeout(() => {
formName.enclosure = res.data.data.enclosure window.close()
}) }, 1000)
} } else {
getUser().then((res) => { message.error('重新发起流程失败!')
formName.applyUserName = res.data.data.realName }
formName.applyUserId = res.data.data.id
getUserInfo(formName.applyUserId).then((res) => {
if (res.data.data.mobile) {
formName.applyUserPhone = res.data.data.mobile
}
formName.applyUserDeptName = res.data.data.deptName
formName.applyUserDeptId = res.data.data.deptId
})
})
const formRef = ref()
const applySuccess = ref(true)
// 退
const signOut = () => {
window.close()
}
const handleChange = (info) => {
if (info.file.status !== 'uploading') {
console.log(info.file, info.fileList)
}
if (info.file.status === 'done') {
message.success(`${info.file.name} file uploaded successfully`)
formName.enclosure = info.file.response.data
} else if (info.file.status === 'error') {
message.error(`${info.file.name} file upload failed.`)
}
}
const fileList = ref([])
const processStartHandle = () => {
if (id.value) {
updateDemandForm(formName).then((upres) => {
if (upres.data.code == 0) {
relaunch({ data: formName, taskId: taskId.value }).then((res) => {
console.log('驳回================>', res)
if (res.data.code == 0) {
message.success('重新发起流程成功!')
window.setTimeout(() => {
window.close()
}, 1000)
} else {
message.error('重新发起流程失败!')
}
})
} else {
message.error('数据更新失败!')
}
})
} else {
formRef.value.validate().then(() => {
demandApply(formName).then((res) => {
applySuccess.value = false
message.success('操作成功!')
console.log('能力申请================>', res)
}) })
} else {
message.error('数据更新失败!')
}
})
} else {
formRef.value.validate().then(() => {
demandApply(formName).then((res) => {
applySuccess.value = false
message.success('操作成功!')
console.log('能力申请================>', res)
}) })
} })
} }
}
return { return {
formRef, formRef,
formName, formName,
fileList, fileList,
headers: { headers: {
authorization: 'authorization-text', authorization: 'authorization-text',
}, },
handleChange, handleChange,
applySuccess, applySuccess,
disabled, disabled,
signOut, signOut,
processStartHandle, processStartHandle,
upLoadUrl, upLoadUrl,
// baseURL, // baseURL,
} }
}, },
} }
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
#apply-container { #apply-container {
background-color: #f5f8fc; background-color: #f5f8fc;
height: 100%; height: 100%;
width: 100%; width: 100%;
margin: 90px auto 0; margin: 90px auto 0;
display: flex;
justify-content: space-between;
aside {
width: 282px;
height: 96%;
overflow-y: auto;
background-color: #fff;
margin: 1% 0 3%;
}
article {
width: 1090px;
height: 99%;
overflow-y: auto;
background-color: #fff;
margin: 5% auto;
}
.form-container {
padding: 20px 20px 30px 20px;
.title {
font-size: 20px;
color: #000;
font-weight: bold;
margin-bottom: 20px;
}
}
.base-info {
display: flex; display: flex;
justify-content: space-between; }
aside {
width: 282px; :deep(.ant-form-item-label) {
height: 96%; label {
overflow-y: auto; color: #666;
background-color: #fff; font-size: 16px;
margin: 1% 0 3%;
} &::after {
article { content: '';
width: 1090px;
height: 99%;
overflow-y: auto;
background-color: #fff;
margin: 5% auto;
}
.form-container {
padding: 20px 20px 30px 20px;
.title {
font-size: 20px;
color: #000;
font-weight: bold;
margin-bottom: 20px;
} }
} }
.base-info { }
display: flex;
:deep(.ant-form-item-required) {
&::before {
font-size: 8px;
margin-right: 10px;
} }
:deep(.ant-form-item-label) { }
label {
color: #666; :deep(.ant-input) {
font-size: 16px; border: 1px solid #e0e0e0;
&::after { border-radius: 6px;
content: ''; }
}
} .success {
} div {
:deep(.ant-form-item-required) { width: 100px;
&::before { margin: 80px auto 40px;
font-size: 8px;
margin-right: 10px;
}
} }
:deep(.ant-input) { text-align: center;
border: 1px solid #e0e0e0; font-size: 20px;
border-radius: 6px; font-weight: bold;
} color: #000;
.success {
div {
width: 100px;
margin: 80px auto 40px;
}
text-align: center;
font-size: 20px;
font-weight: bold;
color: #000;
}
} }
}
</style> </style>
<style> <style>
body, body,
html { html {
height: unset; height: unset;
} }
</style> </style>