lyn7568 6 anni fa
parent
commit
a1ee8b9ef6

+ 4 - 1
src/App.vue

6
6
7
<script>
7
<script>
8
export default {
8
export default {
9
  name: 'App'
9
  name: 'App',
10
  created() {
11
    this.$store.dispatch('getCityData')
12
  }
10
}
13
}
11
</script>
14
</script>

+ 56 - 42
src/components/CityPicker/index.vue

7
          @change="choseProvince"
7
          @change="choseProvince"
8
          placeholder="省/直辖市">
8
          placeholder="省/直辖市">
9
          <el-option
9
          <el-option
10
            v-for="item in provinceArr"
10
            v-for="item in citydata"
11
            :key="item.id"
11
            :key="item.id"
12
            :label="item.value"
12
            :label="item.value"
13
            :value="item.id">
13
            :value="item.id">
31
  </div>
31
  </div>
32
</template>
32
</template>
33
<script>
33
<script>
34
import queryDict from '@/utils/queryDict'
34
import { mapGetters } from 'vuex'
35
export default {
35
export default {
36
  props: ['addrCode'],
36
  props: ['addrCode'],
37
  data() {
37
  data() {
38
    return {
38
    return {
39
      provinceArr: [],
39
      // provinceArr: [],
40
      cityArr: [],
40
      cityArr: [],
41
      sheng: '',
41
      sheng: '',
42
      shi: ''
42
      shi: ''
43
    }
43
    }
44
  },
44
  },
45
  computed: {
46
    ...mapGetters([
47
      'citydata'
48
    ])
49
  },
45
  watch: {
50
  watch: {
46
    addrCode: function() {
51
    citydata(val) {
52
      this.citydata = val
53
    },
54
    addrCode(val) {
47
      var that = this
55
      var that = this
48
      setTimeout(function() {
56
      setTimeout(() => {
49
        that.initpsq()
57
        that.initpsq()
50
      }, 100)
58
      }, 100)
51
    }
59
    }
52
  },
60
  },
53
  created() {
61
  created() {
54
    this.getCityData()
62
    // var that = this
63
    // setTimeout(() => {
64
    //   that.initpsq()
65
    // }, 100)
55
  },
66
  },
56
  methods: {
67
  methods: {
57
    getCityData: function() {
58
      var that = this
59
      queryDict.applyDict('XZQH', function(dictData) {
60
        if (dictData && dictData.length > 0) {
61
          var data = dictData.sort((obj1, obj2) => {
62
            return obj1.code - obj2.code
63
          })
64
          that.provinceArr = {}
65
          data.map(item => {
66
            if (item.code.match(/0000$/)) {
67
              that.provinceArr[item.code] = { id: item.code, value: item.caption, children: {}}
68
            } else if (item.code.match(/00$/)) {
69
              var p = that.provinceArr[item.code.slice(0, 2) + '0000']
70
              p.children[item.code] = { id: item.code, value: item.caption, children: {}}
71
              if (!p.defaultChild) {
72
                p.defaultChild = p.children[item.code]
73
              }
74
            }
75
            //  else {
76
            //   var pp = that.provinceArr[item.code.slice(0, 2) + '0000'].children[item.code.slice(0, 4) + '00']
77
            //   pp.children[item.code] = { id: item.code, value: item.caption }
78
            //   if (!pp.defaultChild) {
79
            //     pp.defaultChild = pp.children[item.code]
80
            //   }
81
            // }
82
          / })
83
        } else {
84
          console.log(dictData.status)
85
        }
86
      })
87
    },
68
    // getCityData: function() {
69
    //   var that = this
70
    //   queryDict.applyDict('XZQH', function(dictData) {
71
    //     if (dictData && dictData.length > 0) {
72
    //       var data = dictData.sort((obj1, obj2) => {
73
    //         return obj1.code - obj2.code
74
    //       })
75
    //       console.log(dictData)
76
    //       that.provinceArr = {}
77
    //       data.map(item => {
78
    //         if (item.code.match(/0000$/)) {
79
    //           that.provinceArr[item.code] = { id: item.code, value: item.caption, children: {}}
80
    //         } else if (item.code.match(/00$/)) {
81
    //           var p = that.provinceArr[item.code.slice(0, 2) + '0000']
82
    //           p.children[item.code] = { id: item.code, value: item.caption, children: {}}
83
    //           if (!p.defaultChild) {
84
    //             p.defaultChild = p.children[item.code]
85
    //           }
86
    //         }
87
    //         //  else {
88
    //         //   var pp = that.provinceArr[item.code.slice(0, 2) + '0000'].children[item.code.slice(0, 4) + '00']
89
    //         //   pp.children[item.code] = { id: item.code, value: item.caption }
90
    //         //   if (!pp.defaultChild) {
91
    //         //     pp.defaultChild = pp.children[item.code]
92
    //         //   }
93
    //         // / }
94
    //       })
95
    //     } else {
96
    //       console.log(dictData.status)
97
    //     }
98
    //   })
99
    // },
88
    choseProvince: function(e) {
100
    choseProvince: function(e) {
89
      var p = this.provinceArr[e]
101
      var p = this.citydata[e]
90
      this.cityArr = p.children
102
      this.cityArr = p.children
91
      this.sheng = p.value
103
      this.sheng = p.value
92
      this.shi = p.defaultChild.value
104
      this.shi = p.defaultChild.value
95
      this.$emit('parenStr', this.shi)
107
      this.$emit('parenStr', this.shi)
96
    },
108
    },
97
    choseCity: function(e) {
109
    choseCity: function(e) {
98
      var p = this.provinceArr[e.slice(0, 2) + '0000'].children[e]
110
      var p = this.citydata[e.slice(0, 2) + '0000'].children[e]
99
      this.E = p.id
111
      this.E = p.id
100
      this.shi = p.value
112
      this.shi = p.value
101
      this.$emit('paren', this.E)
113
      this.$emit('paren', this.E)
109
      }
121
      }
110
      const s = this.addrCode.substring(0, 2) + '0000'
122
      const s = this.addrCode.substring(0, 2) + '0000'
111
      const si = this.addrCode.substring(0, 4) + '00'
123
      const si = this.addrCode.substring(0, 4) + '00'
112
      var p = this.provinceArr[s]
113
      this.sheng = p.value
114
      this.shi = p.children[si].value
124
      if (this.citydata) {
125
        var p = this.citydata[s]
126
        this.sheng = p.value
127
        this.shi = p.children[si].value
128
      }
115
    }
129
    }
116
  }
130
  }
117
}
131
}

+ 1 - 3
src/router/index.js

211
          path: 'noactive',
211
          path: 'noactive',
212
          component: () => import('@/views/companyCen/noactive/index'),
212
          component: () => import('@/views/companyCen/noactive/index'),
213
          name: 'noactive',
213
          name: 'noactive',
214
          parentPath: true,
215
          alwaysShow: true,
216
          redirect: { name: 'noactiveList' },
214
          redirect: { name: 'noactiveList' },
217
          meta: { title: '未激活企业' },
215
          meta: { title: '未激活企业' },
218
          children: [
216
          children: [
219
            {
217
            {
220
              path: 'noactiveList',
218
              path: 'noactiveList',
221
              name: 'noactiveList',
219
              name: 'noactiveList',
222
              hidden: true,
220
              meta: { title: '未激活企业列表' },
223
              component: () => import('@/views/companyCen/noactive/noactiveList')
221
              component: () => import('@/views/companyCen/noactive/noactiveList')
224
            },
222
            },
225
            {
223
            {

+ 2 - 1
src/store/getters.js

5
  account: state => state.user.account,
5
  account: state => state.user.account,
6
  name: state => state.user.name,
6
  name: state => state.user.name,
7
  permission_routers: state => state.permission.routers,
7
  permission_routers: state => state.permission.routers,
8
  addRouters: state => state.permission.addRouters
8
  addRouters: state => state.permission.addRouters,
9
  citydata: state => state.city.citydata
9
}
10
}
10
export default getters
11
export default getters

+ 3 - 1
src/store/index.js

3
import app from './modules/app'
3
import app from './modules/app'
4
import permission from './modules/permission'
4
import permission from './modules/permission'
5
import user from './modules/user'
5
import user from './modules/user'
6
import city from './modules/city'
6
import getters from './getters'
7
import getters from './getters'
7
8
8
Vue.use(Vuex)
9
Vue.use(Vuex)
11
  modules: {
12
  modules: {
12
    app,
13
    app,
13
    permission,
14
    permission,
14
    user
15
    user,
16
    city
15
  },
17
  },
16
  getters
18
  getters
17
})
19
})

+ 52 - 0
src/store/modules/city.js

1
import queryDict from '@/utils/queryDict'
2
3
const city = {
4
  state: {
5
    citydata: {}
6
  },
7
  mutations: {
8
    citydata: (state, value) => {
9
      state.citydata = value
10
    }
11
  },
12
  actions: {
13
    getCityData({ commit, state }) {
14
      return new Promise((resolve, reject) => {
15
        queryDict.applyDict('XZQH', (dictData) => {
16
          if (dictData && dictData.length > 0) {
17
            var sortData = dictData.sort((obj1, obj2) => {
18
              return obj1.code - obj2.code
19
            })
20
            var arr = {}
21
            sortData.map(item => {
22
              if (item.code.match(/0000$/)) {
23
                arr[item.code] = { id: item.code, value: item.caption, children: {}}
24
              } else if (item.code.match(/00$/)) {
25
                var p = arr[item.code.slice(0, 2) + '0000']
26
                if (p) {
27
                  p.children[item.code] = { id: item.code, value: item.caption }
28
                  if (!p.defaultChild) {
29
                    p.defaultChild = p.children[item.code]
30
                  }
31
                } else {
32
                  arr[item.code.slice(0, 2) + '0000'] = { id: item.code.slice(0, 2) + '0000', value: item.caption, children: {}}
33
                  var pr = arr[item.code.slice(0, 2) + '0000']
34
                  pr.children[item.code] = { id: item.code, value: item.caption }
35
                  if (!pr.defaultChild) {
36
                    pr.defaultChild = pr.children[item.code]
37
                  }
38
                }
39
              }
40
            })
41
            commit('citydata', arr)
42
          }
43
          resolve(dictData)
44
        }, (error) => {
45
          reject(error)
46
        })
47
      })
48
    }
49
  }
50
}
51
52
export default city

+ 3 - 1
src/views/companyCen/noactive/compInfo.vue

61
                </el-col>
61
                </el-col>
62
                <el-col :span="12">
62
                <el-col :span="12">
63
                  <el-form-item label="所在城市" prop="addr">
63
                  <el-form-item label="所在城市" prop="addr">
64
                    <cityPicker @paren="toshow" :addrCode="formObj.addr"></cityPicker>
64
                    <cityPicker @paren="toshow" :addrCode="addrCur"></cityPicker>
65
                  </el-form-item>
65
                  </el-form-item>
66
                </el-col>
66
                </el-col>
67
                <el-col :span="12">
67
                <el-col :span="12">
181
        numRanger: [],
181
        numRanger: [],
182
        compType: [],
182
        compType: [],
183
        keywordObj: {},
183
        keywordObj: {},
184
        addrCur: '',
184
        formLoading: false,
185
        formLoading: false,
185
        rulesObj: {
186
        rulesObj: {
186
          name: [{ required: true, message: requiredTip('企业全部名称'), trigger: 'blur' }],
187
          name: [{ required: true, message: requiredTip('企业全部名称'), trigger: 'blur' }],
293
          if (res.success) {
294
          if (res.success) {
294
            const obj = res.data
295
            const obj = res.data
295
            that.formObj = obj
296
            that.formObj = obj
297
            that.addrCur = obj.addr
296
          }
298
          }
297
        })
299
        })
298
      },
300
      },

+ 4 - 6
src/views/companyCen/noactive/productInfo.vue

19
                    <el-input v-model="formObj.name" placeholder="请填写产品名称" maxlength="30"></el-input>
19
                    <el-input v-model="formObj.name" placeholder="请填写产品名称" maxlength="30"></el-input>
20
                  </el-form-item>
20
                  </el-form-item>
21
                </el-col>
21
                </el-col>
22
                <el-col :span="24" v-if="tagsShow">
22
                <el-col :span="24">
23
                  <el-form-item label="关键词">
23
                  <el-form-item label="关键词">
24
                    <dynamicTags :dyStr="formObj.keyword" :tagInfo="tagKeyword" @turnTags="turnKeywordTags"></dynamicTags>
24
                    <dynamicTags :dyStr="keywordObj" :tagInfo="tagKeyword" @turnTags="turnKeywordTags($event)"></dynamicTags>
25
                  </el-form-item>
25
                  </el-form-item>
26
                </el-col>
26
                </el-col>
27
                <el-col :span="24">
27
                <el-col :span="24">
89
      return {
89
      return {
90
        companyId: '',
90
        companyId: '',
91
        productId: '',
91
        productId: '',
92
        tagsShow: false,
93
        tagKeyword: {
92
        tagKeyword: {
94
          lableTit: '关键词',
93
          lableTit: '关键词',
95
          placeholder: '请填写相关的关键词,如:腐蚀防护、石墨烯、纳米材料',
94
          placeholder: '请填写相关的关键词,如:腐蚀防护、石墨烯、纳米材料',
96
          limitCount: 10,
95
          limitCount: 10,
97
          tagsNum: 5
96
          tagsNum: 5
98
        },
97
        },
98
        keywordObj: [],
99
        formLoading: true,
99
        formLoading: true,
100
        formObj: {
100
        formObj: {
101
          name: '',
101
          name: '',
173
                objKey.push(item.keyword)
173
                objKey.push(item.keyword)
174
              })
174
              })
175
            }
175
            }
176
            that.keywordObj = objKey
176
            that.formObj.keyword = objKey
177
            that.formObj.keyword = objKey
177
            setTimeout(function() {
178
              that.tagsShow = true
179
            }, 1)
180
          }
178
          }
181
        })
179
        })
182
      },
180
      },

+ 1 - 6
src/views/specialExperts/expertSort.vue

17
          {{form.orgName}}
17
          {{form.orgName}}
18
        </el-form-item>
18
        </el-form-item>
19
        <el-form-item :label-width="formLabelWidth" prop="level">
19
        <el-form-item :label-width="formLabelWidth" prop="level">
20
          <div class='labelBox'>专家平台序号</div></span>
20
          <div class='labelBox'>专家平台序号</div>
21
          <el-input type="number" v-model.number="form.level" placeholder="最多三位数字" class="conBox" min="0" max="999" ></el-input>
21
          <el-input type="number" v-model.number="form.level" placeholder="最多三位数字" class="conBox" min="0" max="999" ></el-input>
22
        </el-form-item>
22
        </el-form-item>
23
        <el-form-item class="modiaB">
23
        <el-form-item class="modiaB">
95
95
96
  .t-left {
96
  .t-left {
97
    float: left
97
    float: left
98
  }
99
100
  .headPhoto {
101
    
102
    
103
  }
98
  }
104
  .headPhoto img {
99
  .headPhoto img {
105
    width: 100px;
100
    width: 100px;