zhaoxiaoqiang1
2026-01-04 f1d30d03186c79ca2cbcfe60d6d2ce7d73fba97b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<template>
<div>
  <el-dialog
    title="企业准入信息"
    :visible.sync="show"
    :close-on-click-modal="false"
    center
    width="850px">
    <el-form :model="form"  ref="form" v-if="show">
      <el-col :span="12">
        <el-form-item label="企业准入类型:" prop="enterpriseaccesstype" :rules="rules('企业准入类型')">
          <el-select v-model="form.enterpriseaccesstype" filterable clearable placeholder="请选择">
  <!--          <el-option label="普通企业" value="02"></el-option>-->
  <!--          <el-option label="核心企业" value="01"></el-option>-->
            <el-option
              v-for="(item, index) in options"
              :key="index"
              :label="item.valueDesc"
              :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
      </el-col>
      <!-- <el-col :span="12">
        <el-form-item label="公司类型:" prop="companytype" :rules="rules('公司类型')" v-if="companytypeShow">
          <el-select v-model="form.companytype" filterable clearable placeholder="请选择">
            <el-option label="总公司" value="01"></el-option>
            <el-option label="子公司" value="02"></el-option>
          </el-select>
        </el-form-item>
      </el-col> -->
      <el-col :span="12">
        <el-form-item label="企业工商登记名:" prop="enterprisename" :rules="rules('企业工商登记名')">
          <el-input v-model="form.enterprisename"></el-input>
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item label="统一社会信用码:" prop="reditcode" :rules="rules('统一社会信用码')">
          <el-input v-model="form.reditcode"></el-input>
        </el-form-item>
      </el-col>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button class="blueBtn" type="primary" size="mini" @click="handleSubmit">新增</el-button>
    </div>
  </el-dialog>
</div>
</template>
 
<script>
import { saveEnpAdmit, qryEnpDetailParams, enterpriseQryCondition } from '@/api/area/enterprise'
export default {
  props: ['showDialog'],
  data: function() {
    return {
      companytypeShow: false,
      form: {
        // companytype: '',
        enterpriseaccesstype: '',
        enterprisename: '',
        reditcode: '',
      },
      options: ''
    }
  },
  created() {
    this.initSelect()
  },
  computed: {
    show: {
      get() {
        return this.showDialog
      },
      set() {
        this.$refs['form'].resetFields()
        this.$emit('update:showDialog', false)
      }
    }
  },
  watch: {
    'form.enterpriseaccesstype': function (newVal) {
      // this.companytypeShow = Boolean(newVal === '01')
      // if (newVal === '02') {
      //   this.form.companytype = ''
      // }
    }
  },
  methods: {
    initSelect(value) {
      let params = { conditionName: 'EnpAccessType' }
      enterpriseQryCondition(params).then(res => {
        this.options = res.result
      })
    },
    async handleSubmit() {
    // *企业准入类型:01 核心企业 ,02 普通企业
    //   *公司类型:01 总公司, 02 子公司
      let submit = ''
      this.$refs['form'].validate((valid) => {
        if (valid) {
          submit = true
        } else {
          return false
        }
      })
      if (submit) {
        let addRes = await saveEnpAdmit(this.form)
        if (addRes.code === '00') {
          let params = {
            creditCode: addRes.result.creditCode,
            serialno: addRes.result.serialno,
            searchType: 1,
            clickType: 0 // 点击类型(详情传1 继续处理传0)
          }
          let res = await qryEnpDetailParams(params)
          let enterpriseParams = {
            clickType: 0,
            ...res.result
          }
          this.$store.commit('SET_enterpriseParams', enterpriseParams)
          this.$router.push({ path: '/area/enterprise/update/enterpriseBaseInfo' })
        }
      }
    },
    rules(rule) {
      return { required: true, message: '请输入' + rule, trigger: 'blur' }
    },
  }
}
</script>
 
<style lang="stylus" scoped>
>>> .el-dialog__header
  padding-top 40px
  .el-dialog__title
    font-size 18px
    // font-family PingFangSC-Medium,PingFangSC
    font-weight bold
    color #222222
    line-height 25px
>>> .el-dialog__body
  height 100px
>>> .el-dialog__footer
  padding-bottom 30px
  .dialog-footer
    .blueBtn
      background-color rgba(0,129,240,1)
      border-radius 4px
      color rgba(255,255,255,1)
      padding 0
      width 120px
      height 30px
      span
        font-size 14px    
        height 20px
        font-weight 400
        line-height 20px
</style>