lilei %!s(int64=4) %!d(string=hai) anos
pai
achega
8200320017
Modificáronse 1 ficheiros con 5 adicións e 10 borrados
  1. 5 10
      src/components/Select/index.js

+ 5 - 10
src/components/Select/index.js

@@ -30,18 +30,13 @@ export default {
   created () {
   created () {
     const _this = this
     const _this = this
     // console.log(_this.code, '_this.code')
     // console.log(_this.code, '_this.code')
-    Promise.all([listLookUp({ code: '' }), getLookUpData({
+    getLookUpData({
       pageNo: 1,
       pageNo: 1,
       pageSize: 1000,
       pageSize: 1000,
       lookupCode: _this.code
       lookupCode: _this.code
-    })]).then(results => {
-      const _all = results[0]
-      const _data = results[1]
-      if (_all.status + '' === '200' && _data.status + '' === '200') {
-        _this.dataList = _data.data.list
-        const a = _.find(_all.data, ['code', _this.code])
-        // console.log(a)
-        _this.placeholderText = '请选择' + (a != undefined ? a.name : '')
+    }).then(res => {
+      if (res.status == 200) {
+        _this.dataList = res.data.list
       }
       }
     })
     })
   },
   },
@@ -79,8 +74,8 @@ export default {
 
 
     const on = {
     const on = {
       change: obj => {
       change: obj => {
-        this.$emit('change', obj, _.find(this.dataList, ['code', obj]))
         this.$emit('input', obj)
         this.$emit('input', obj)
+        this.$emit('change', obj, _.find(this.dataList, ['code', obj]))
       }
       }
     }
     }
     if (this.showType === 'tabs') {
     if (this.showType === 'tabs') {