<template>
|
<el-dialog
|
:visible.sync="dialogVisible"
|
:close-on-click-modal="false"
|
width="70%"
|
>
|
<el-tabs type="border-card" class="active" v-model="activeName">
|
<el-tab-pane label="企业基本信息" name="enterpriseBasicInformation">
|
<enterpriseBasicInformation ref="enterpriseBasicInformation" @getinfo="submitEnterprise" @cancel="dialogVisible = false" :title="title" :passForm="dataFormPass"></enterpriseBasicInformation>
|
</el-tab-pane>
|
<el-tab-pane label="许可证件信息" name="permitInformation" v-if="ifShowOther">
|
<permitInformation ref="permitInformation" :enterpriseId="enterpriseId"></permitInformation>
|
</el-tab-pane>
|
<el-tab-pane label="存储库房" name="storeHouse" v-if="ifShowOther">
|
<storeHouse ref="storeHouse" :enterpriseId="enterpriseId"></storeHouse>
|
</el-tab-pane>
|
<el-tab-pane label="安全生产标准化" name="safetyProductionStandard" v-if="ifShowOther">
|
<safetyProductionStandard ref="safetyProductionStandard" @getinfo="refreshData" :enterpriseId="enterpriseId"></safetyProductionStandard>
|
</el-tab-pane>
|
<el-tab-pane label="安全人员资格" name="safetyPersonQualification" v-if="ifShowOther">
|
<safetyPersonQualification ref="safetyPersonQualification" :enterpriseId="enterpriseId"></safetyPersonQualification>
|
</el-tab-pane>
|
<el-tab-pane label="特种人员资格" name="specialPersonQualification" v-if="ifShowOther">
|
<specialPersonQualification ref="specialPersonQualification" :enterpriseId="enterpriseId"></specialPersonQualification>
|
</el-tab-pane>
|
<el-tab-pane label="应急救援预案" name="emergencyResponsePlan" v-if="ifShowOther">
|
<emergencyResponsePlan ref="emergencyResponsePlan" :enterpriseId="enterpriseId"></emergencyResponsePlan>
|
</el-tab-pane>
|
<el-tab-pane label="流向信息管理承诺书" name="flowInformationCommitment" v-if="ifShowOther">
|
<flowInformationCommitment ref="flowInformationCommitment" :enterpriseId="enterpriseId"></flowInformationCommitment>
|
</el-tab-pane>
|
<el-tab-pane label="年度库存" name="annualInventory" v-if="ifShowOther">
|
<annualInventory ref="annualInventory" :enterpriseId="enterpriseId"></annualInventory>
|
</el-tab-pane>
|
<el-tab-pane label="信息反馈" name="feed" v-if="ifShowOther">
|
<feed ref="feed" :enterpriseId="enterpriseId"></feed>
|
</el-tab-pane>
|
</el-tabs>
|
</el-dialog>
|
</template>
|
|
<script>
|
import enterpriseBasicInformation from "./components/enterpriseBasicInformation";
|
import permitInformation from "./components/permitInformation";
|
import storeHouse from "./components/storeHouse";
|
import safetyPersonQualification from "./components/safetyPersonQualification";
|
import safetyProductionStandard from "./components/safetyProductionStandard";
|
import specialPersonQualification from "./components/specialPersonQualification";
|
import emergencyResponsePlan from "./components/emergencyResponsePlan";
|
import flowInformationCommitment from "./components/flowInformationCommitment";
|
import annualInventory from "./components/annualInventory";
|
import feed from "./components/feed";
|
import { addNewEnterprise , updateNewEnterprise } from "../../api/enterprise";
|
import {parseError} from "../../utils/messageDialog";
|
|
export default {
|
name: "detailForm",
|
data(){
|
return{
|
title:'',
|
dataFormPass:{},
|
ifShowOther:'',
|
enterpriseId:'',
|
activeName:'enterpriseBasicInformation',
|
dialogVisible:false,
|
}
|
},
|
components:{
|
enterpriseBasicInformation,
|
permitInformation,
|
storeHouse,
|
safetyProductionStandard,
|
safetyPersonQualification,
|
specialPersonQualification,
|
emergencyResponsePlan,
|
flowInformationCommitment,
|
annualInventory,
|
feed
|
},
|
methods:{
|
openEnterpriseDetailForm(operateName,value,economicTypeList,jobList,safetySuperVisionList,economicIndustryList){
|
this.enterpriseId = value.id
|
this.activeName = 'enterpriseBasicInformation'
|
this.title = operateName
|
this.dialogVisible = true
|
if(operateName === '新增'){
|
this.ifShowOther = false
|
setTimeout(() =>{
|
this.$refs.enterpriseBasicInformation.dataForm = {
|
safetysupervision: '',
|
economicindustry: '',
|
enterprisenumber: '',
|
enterprisename: '',
|
enterpriseemail: '',
|
enterprisesize: '',
|
enterprisestatus: '',
|
department: '',
|
devicenumber: '',
|
officeaddress: '',
|
province: '',
|
city: '',
|
district: '',
|
street: '',
|
committee: '',
|
securitysupervisory: '',
|
officephone: '',
|
faxphone: '',
|
registeraddress: '',
|
registertype: '',
|
establishtime: '',
|
qqnumber: '',
|
postcode: '',
|
roomnumber: '',
|
economictype: '',
|
productioncontent: '',
|
businessregisternumber: '',
|
organizationstructurecode: '',
|
validstarttime: '',
|
validendtime: '',
|
employeenumber: '',
|
ispaysafetyinsurance: '',
|
insurancecontractnumber: '',
|
insureamount: '',
|
insurestarttime: '',
|
insureendtime: '',
|
ismajorhazard: '',
|
isspecialequipment: '',
|
isoccupationalhealthinfo: '',
|
isspecialpersonnel: '',
|
selfrecordingcycle: '',
|
isparententerprise: '',
|
parententerprisename: '',
|
latitude:'',
|
longitude:'',
|
legalrepresentative:{
|
belongid: 1,
|
belongname: "",
|
id: null,
|
name: "",
|
number: "",
|
identify:"",
|
officephone: "",
|
phone: "",
|
post: "",
|
type: "",
|
validendtime:"",
|
validstarttime:"",
|
},
|
informationofficer:{
|
belongid: 1,
|
belongname: "",
|
id: null,
|
name: "",
|
number: "",
|
officephone: "",
|
phone: "",
|
post: "",
|
type: "",
|
validendtime:"",
|
validstarttime:"",
|
},
|
mainprincipal:{
|
belongid: 1,
|
belongname: "",
|
id: null,
|
name: "",
|
number: "",
|
officephone: "",
|
phone: "",
|
post: "",
|
type: "",
|
validendtime:"",
|
validstarttime:"",
|
},
|
securityofficer:{
|
belongid: 1,
|
belongname: "",
|
id: null,
|
name: "",
|
number: "",
|
officephone: "",
|
phone: "",
|
post: "",
|
type: "",
|
validendtime:"",
|
validstarttime:"",
|
},
|
},
|
this.$refs.enterpriseBasicInformation.isEdit = false
|
this.$refs.enterpriseBasicInformation.jobList = jobList
|
this.$refs.enterpriseBasicInformation.economicTypeList = economicTypeList
|
this.$refs.enterpriseBasicInformation.safetySuperVisionList = safetySuperVisionList
|
this.$refs.enterpriseBasicInformation.economicIndustryList = economicIndustryList
|
this.$refs.enterpriseBasicInformation.resetFormRules()
|
})
|
}else{
|
this.dataFormPass = value
|
this.ifShowOther = true
|
setTimeout(() =>{
|
this.$refs.enterpriseBasicInformation.legalRepresentativeTime = [value.legalrepresentative.validstarttime,value.legalrepresentative.validendtime]
|
this.$refs.enterpriseBasicInformation.informationofficerTime = [value.informationofficer.validstarttime,value.informationofficer.validendtime]
|
this.$refs.enterpriseBasicInformation.mainprincipalTime = [value.mainprincipal.validstarttime,value.mainprincipal.validendtime]
|
this.$refs.enterpriseBasicInformation.securityOfficerTime = [value.securityofficer.validstarttime,value.securityofficer.validendtime]
|
if(this.$refs.enterpriseBasicInformation.legalRepresentativeTime[0] === null){
|
this.$refs.enterpriseBasicInformation.legalRepresentativeTime[0] = ""
|
}
|
if(this.$refs.enterpriseBasicInformation.legalRepresentativeTime[1] === null){
|
this.$refs.enterpriseBasicInformation.legalRepresentativeTime[1] = ""
|
}
|
if(this.$refs.enterpriseBasicInformation.informationofficerTime[0] === null){
|
this.$refs.enterpriseBasicInformation.informationofficerTime[0] = ""
|
}
|
if(this.$refs.enterpriseBasicInformation.informationofficerTime[1] === null){
|
this.$refs.enterpriseBasicInformation.informationofficerTime[1] = ""
|
}
|
if(this.$refs.enterpriseBasicInformation.mainprincipalTime[0] === null){
|
this.$refs.enterpriseBasicInformation.mainprincipalTime[0] = ""
|
}
|
if(this.$refs.enterpriseBasicInformation.mainprincipalTime[1] === null){
|
this.$refs.enterpriseBasicInformation.mainprincipalTime[1] = ""
|
}
|
if(this.$refs.enterpriseBasicInformation.securityOfficerTime[0] === null){
|
this.$refs.enterpriseBasicInformation.securityOfficerTime[0] = ""
|
}
|
if(this.$refs.enterpriseBasicInformation.securityOfficerTime[1] === null){
|
this.$refs.enterpriseBasicInformation.securityOfficerTime[1] = ""
|
}
|
this.$refs.enterpriseBasicInformation.dataForm = JSON.parse(JSON.stringify(value))
|
if(JSON.parse(JSON.stringify(value)).validendtime === null || JSON.parse(JSON.stringify(value)).validstarttime === null){
|
this.$refs.enterpriseBasicInformation.validTime = ['','']
|
}else{
|
this.$refs.enterpriseBasicInformation.validTime = [JSON.parse(JSON.stringify(value)).validstarttime,JSON.parse(JSON.stringify(value)).validendtime]
|
}
|
this.$refs.enterpriseBasicInformation.isEdit = true
|
this.$refs.enterpriseBasicInformation.jobList = jobList
|
this.$refs.enterpriseBasicInformation.economicTypeList = economicTypeList
|
this.$refs.enterpriseBasicInformation.safetySuperVisionList = safetySuperVisionList
|
this.$refs.enterpriseBasicInformation.economicIndustryList = economicIndustryList
|
this.$refs.permitInformation.getPermitInformationListData()
|
this.$refs.storeHouse.getEnterpriseWarehouseListData()
|
this.$refs.safetyPersonQualification.getSafetyPersonQualificationListData()
|
this.$refs.specialPersonQualification.getSpecialPersonQualificationListData()
|
this.$refs.emergencyResponsePlan.getEmergencyData()
|
this.$refs.flowInformationCommitment.getFlowInformationData()
|
this.$refs.annualInventory.getAnnualInventoryDataListData()
|
this.$refs.enterpriseBasicInformation.resetFormRules()
|
this.$refs.enterpriseBasicInformation.qrcode()
|
this.$refs.safetyProductionStandard.getSafetyProductionStandard()
|
this.$refs.feed.getFeedBackListData()
|
})
|
}
|
},
|
async submitEnterprise(){
|
this.$refs.enterpriseBasicInformation.justifyRules()
|
if(this.$refs.enterpriseBasicInformation.correct === false){
|
this.$notify({
|
title:'警告',
|
message:'请完善基本信息',
|
type:'warning'
|
})
|
}else{
|
if(this.title === '新增'){
|
let addForm = this.$refs.enterpriseBasicInformation.dataForm
|
if(addForm.validstarttime == null){
|
this.$notify({
|
title:'警告',
|
message:'请填写许可证期限',
|
type:'warning'
|
})
|
}else {
|
let res = await addNewEnterprise(addForm)
|
if(res.data.code === "200"){
|
this.$emit('getinfo')
|
this.dialogVisible = false
|
this.$notify({
|
type:'success',
|
duration:2000,
|
message:'成功',
|
title:'成功',
|
})
|
}else {
|
this.$message({
|
type:'warning',
|
message:res.data.message
|
})
|
}
|
}
|
|
} else{
|
let updateForm = this.$refs.enterpriseBasicInformation.dataForm
|
let res = await updateNewEnterprise(updateForm)
|
if(res.data.code === "200"){
|
this.$emit('getinfo')
|
this.dialogVisible = false
|
this.$notify({
|
type:'success',
|
duration:2000,
|
message:'成功',
|
title:'成功',
|
})
|
}else {
|
this.$message({
|
type:'warning',
|
message:res.data.message
|
})
|
}
|
}
|
}
|
},
|
refreshData(){
|
this.$refs.safetyProductionStandard.getSafetyProductionStandard()
|
}
|
}
|
}
|
</script>
|
|
<style scoped>
|
.enterpriseBasicInformation_footer{
|
padding-top:10px;
|
text-align: right;
|
}
|
</style>
|