<template>
|
<div class="wrapbox">
|
<newApprovalView
|
ref="newProApprovalViewAllRef"
|
@setDraftDisable="handleSetDraftDisable"
|
@setSubmitDisable="handleSetSubmitDisable"
|
@returnCurrentApproStatus="getCurrentApproStatus"
|
></newApprovalView>
|
|
<div class="footerbtns">
|
<el-button
|
type="primary"
|
class="footerbtn"
|
size="large"
|
plain
|
@click="goBackList"
|
>返回</el-button
|
>
|
<el-button
|
type="primary"
|
class="footerbtn"
|
size="large"
|
v-if="state.routeData?.informationEditType != 'view'"
|
:disabled="state.draftDisabled"
|
plain
|
@click="saveBasicDraft"
|
>{{ isSaveName() }}</el-button
|
>
|
<el-button
|
v-if="isVisiteSubmit()"
|
type="primary"
|
@click="submitClick"
|
class="footerbtn"
|
:disabled="state.submitDisabled"
|
size="large"
|
>提交</el-button
|
>
|
</div>
|
</div>
|
</template>
|
|
<script lang="ts">
|
export default {
|
name: 'meritRatingNewDetail',
|
}
|
</script>
|
<script setup lang="ts">
|
import productService from '@/api/zhongjian/productApi' // 接口文件
|
import Base64 from '@/utils/base64'
|
import { useRoute } from 'vue-router'
|
import { useUserInfo } from '@/stores/modules/userInfo'
|
import newApprovalView from './components/newApprovalView.vue' //增删改查组件
|
const userStore = useUserInfo() // 用户相关的状态管理器
|
const route = useRoute()
|
const state = reactive<any>({
|
formData: {
|
businessProcessIdList: [],
|
businessProcessNameList: [],
|
businessTypeId: '',
|
businessTypeName: '',
|
constructionUnit: '',
|
contactJob: '',
|
contactNumber: '',
|
contactUnit: '',
|
contacts: '',
|
id: '',
|
importantAreaIdList: [],
|
importantAreaNameList: [],
|
industrialChainIdList: [],
|
industrialChainNameList: [],
|
name: '',
|
technologyTypeId: '',
|
technologyTypeName: '',
|
productDetailInfos: [],
|
ownershipId: '',
|
ownershipName: '',
|
},
|
productionTecknCategory: [], //产品技术类型
|
productTechnologyCategory: [],
|
productOwnershipOption: [],
|
productionBusinessCategory: [],
|
classifyInfoType: [], //行业领域
|
importantAreaType: [], //单位工程
|
importantAreaTypeywhj: [], //业务环节
|
dictObj: {
|
ProductDifficulty: [],
|
AwardGrade: [],
|
ResourceCategory: [],
|
},
|
currentRichData: '',
|
isSaveSubmit: false,
|
disabled: false,
|
draftDisabled: false,
|
srcData: '',
|
routeData: {
|
informationEditType: '',
|
id: '',
|
},
|
defaultCheckedAreaIds: [],
|
currentAproStatus: '',
|
})
|
const newProApprovalViewAllRef = ref()
|
const currentCreatUserId = ref()
|
const getCurrentApproStatus = (val: any) => {
|
state.currentAproStatus = val
|
currentCreatUserId.value = userStore.getUserId
|
}
|
const isVisiteSubmit = computed(() => {
|
return function () {
|
if (state.routeData?.informationEditType != 'view') {
|
if (
|
state.routeData?.informationEditType == 'add' ||
|
(state.routeData?.informationEditType == 'edit' &&
|
state.routeData?.createUserId == currentCreatUserId.value &&
|
(state.currentAproStatus == 3 || state.currentAproStatus == 4))
|
) {
|
return true
|
} else {
|
return false
|
}
|
} else {
|
return false
|
}
|
}
|
})
|
const isSaveName = computed(() => {
|
return function () {
|
if (
|
state.currentAproStatus == 3 ||
|
state.currentAproStatus == 4 ||
|
state.currentAproStatus == null ||
|
state.currentAproStatus == '' ||
|
state.currentAproStatus == undefined
|
) {
|
return '存草稿'
|
} else {
|
return '保存'
|
}
|
}
|
})
|
|
const handleSetSubmitDisable = (val: boolean) => {
|
state.submitDisabled = val
|
}
|
const handleSetDraftDisable = (val: boolean) => {
|
state.draftDisabled = val
|
}
|
const submitClick = () => {
|
state.submitDisabled = true
|
newProApprovalViewAllRef.value.submitClick(true)
|
}
|
const goBackList = () => {
|
newProApprovalViewAllRef.value.goBackList()
|
}
|
// 保存草稿
|
const saveBasicDraft = () => {
|
state.draftDisabled = true
|
newProApprovalViewAllRef.value.saveBasicDraft()
|
}
|
// dictObj当前的字典下拉数据源;id:是选择框选择的id
|
const returnContentName = (dictObj: any, selectId: any) => {
|
if (dictObj.id == selectId) {
|
return dictObj.name
|
}
|
if (dictObj.children && dictObj.children.length > 0) {
|
dictObj.children.forEach((sub: any) => {
|
returnContentName(sub, selectId)
|
})
|
}
|
}
|
const returnContentLabel = (dictObj: any, selectId: any) => {
|
if (dictObj.value == selectId) {
|
return dictObj.label
|
}
|
if (dictObj.children && dictObj.children.length > 0) {
|
for (let i = 0; i < dictObj.children.length; i++) {
|
let name: any = returnContentLabel(dictObj.children[i], selectId)
|
if (name) return name
|
}
|
}
|
}
|
onMounted(() => {
|
state.routeData = JSON.parse(Base64.decode(route.query.info))
|
newProApprovalViewAllRef.value.setData(state.routeData)
|
if (state.routeData.informationEditType == 'add') {
|
state.currentAproStatus = null
|
}
|
state.draftDisabled = false
|
state.submitDisabled = false
|
})
|
onActivated(() => {
|
state.routeData = JSON.parse(Base64.decode(route.query.info))
|
if (state.routeData.informationEditType == 'add') {
|
state.currentAproStatus = null
|
}
|
newProApprovalViewAllRef.value.setData(state.routeData)
|
state.submitDisabled = false
|
state.draftDisabled = false
|
})
|
</script>
|
<style scoped lang="scss">
|
.wrapbox {
|
border: 1px solid #dce6f4;
|
border-radius: 4px;
|
}
|
.viewbox-cont {
|
padding: 10px;
|
h2 {
|
padding: 6px 15px;
|
background-color: #dce6f4;
|
color: #5b6ad8;
|
font-size: 17px;
|
border: 1px solid #bbc6fc;
|
border-radius: 4px;
|
}
|
}
|
.formitem {
|
display: flex;
|
flex-direction: column;
|
width: 100%;
|
}
|
.item-desc {
|
display: flex;
|
margin-top: 12px;
|
font-weight: 600;
|
align-items: center;
|
position: relative;
|
height: 25px;
|
.xing {
|
font-size: 24px;
|
color: rgb(247, 23, 23);
|
padding-right: 5px;
|
padding-top: 9px;
|
display: flex;
|
}
|
.titletxt {
|
padding-bottom: 5px;
|
}
|
.xing-tb {
|
font-size: 24px;
|
color: rgb(247, 23, 23);
|
padding-right: 5px;
|
padding-top: 5px;
|
}
|
}
|
.borderbox {
|
border: 1px solid #dddddd;
|
padding: 0px 10px;
|
width: 100%;
|
border-radius: 4px;
|
.el-radio-group {
|
.el-radio--large {
|
}
|
}
|
}
|
.customTh {
|
display: flex;
|
justify-content: center;
|
align-items: center;
|
.xing-tb {
|
display: inline-block;
|
font-size: 24px;
|
color: rgb(247, 23, 23);
|
padding-right: 5px;
|
}
|
}
|
:deep(.el-tag.el-tag--info) {
|
border: 1px solid #e4e4e4;
|
border-radius: 3px;
|
background-color: #f8f8f8;
|
}
|
:deep(.el-form-item) {
|
margin-bottom: 0px;
|
}
|
.table {
|
width: 100%;
|
}
|
.btnicon {
|
cursor: pointer;
|
&:hover {
|
color: #5b6ad8;
|
}
|
}
|
.rowBtnDiv {
|
display: flex;
|
justify-content: center;
|
}
|
.addbtn {
|
margin-top: 10px;
|
}
|
.footerbtns {
|
display: flex;
|
justify-content: center;
|
}
|
.footerbtn {
|
margin: 10px 10px;
|
}
|
</style>
|