|  | @@ -14,26 +14,28 @@
 | 
											
												
													
														|  |        <el-form-item label="供应商资质">
 |  |        <el-form-item label="供应商资质">
 | 
											
												
													
														|  |          <el-input v-model="company.compQual"></el-input>
 |  |          <el-input v-model="company.compQual"></el-input>
 | 
											
												
													
														|  |        </el-form-item>
 |  |        </el-form-item>
 | 
											
												
													
														|  | 
 |  | +      <!-- <el-form-item label="企业logo图片">
 | 
											
												
													
														|  | 
 |  | +         <single-upload v-model="company.compLogo"></single-upload>
 | 
											
												
													
														|  | 
 |  | +      </el-form-item> -->
 | 
											
												
													
														|  |        <el-form-item label="供应商图片">
 |  |        <el-form-item label="供应商图片">
 | 
											
												
													
														|  | -        <single-upload v-model="company.compImgs"></single-upload>
 |  | 
 | 
											
												
													
														|  | -      </el-form-item>
 |  | 
 | 
											
												
													
														|  | -      <el-form-item label="供应商资质图片">
 |  | 
 | 
											
												
													
														|  | -        <single-upload v-model="company.compQual"></single-upload>
 |  | 
 | 
											
												
													
														|  | -      </el-form-item>
 |  | 
 | 
											
												
													
														|  | -      <el-form-item label="企业logo图片">
 |  | 
 | 
											
												
													
														|  | -         <single-upload v-model="company.compQual"></single-upload>
 |  | 
 | 
											
												
													
														|  | -      </el-form-item>
 |  | 
 | 
											
												
													
														|  | -      <el-form-item label="公众号二维码图片">
 |  | 
 | 
											
												
													
														|  | -        <single-upload v-model="company.compQual"></single-upload>
 |  | 
 | 
											
												
													
														|  | 
 |  | +        <div>请按企业logo,供应商图片,供应商资质图片,公众号二维码图片顺序上传</div>
 | 
											
												
													
														|  | 
 |  | +        <multi-upload v-model="thecompImgs"></multi-upload>
 | 
											
												
													
														|  |        </el-form-item>
 |  |        </el-form-item>
 | 
											
												
													
														|  | 
 |  | +      <!-- <el-form-item label="供应商资质图片">
 | 
											
												
													
														|  | 
 |  | +        <single-upload v-model="company.compQualImgs"></single-upload>
 | 
											
												
													
														|  | 
 |  | +      </el-form-item> -->
 | 
											
												
													
														|  | 
 |  | +      
 | 
											
												
													
														|  | 
 |  | +      <!-- <el-form-item label="公众号二维码图片">
 | 
											
												
													
														|  | 
 |  | +        <single-upload v-model="company.compQr"></single-upload>
 | 
											
												
													
														|  | 
 |  | +      </el-form-item> -->
 | 
											
												
													
														|  |        <el-form-item label="淘宝店地址">
 |  |        <el-form-item label="淘宝店地址">
 | 
											
												
													
														|  | -        <el-input v-model="company.compLevel"></el-input>
 |  | 
 | 
											
												
													
														|  | 
 |  | +        <el-input v-model="taobaourl"></el-input>
 | 
											
												
													
														|  |        </el-form-item>
 |  |        </el-form-item>
 | 
											
												
													
														|  |        <el-form-item label="京东店地址">
 |  |        <el-form-item label="京东店地址">
 | 
											
												
													
														|  | -        <el-input v-model="company.compLevel"></el-input>
 |  | 
 | 
											
												
													
														|  | 
 |  | +        <el-input v-model="jdurl"></el-input>
 | 
											
												
													
														|  |        </el-form-item>
 |  |        </el-form-item>
 | 
											
												
													
														|  |        <el-form-item label="自主商城地址">
 |  |        <el-form-item label="自主商城地址">
 | 
											
												
													
														|  | -        <el-input v-model="company.compLevel"></el-input>
 |  | 
 | 
											
												
													
														|  | 
 |  | +        <el-input v-model="selfurl"></el-input>
 | 
											
												
													
														|  |        </el-form-item>
 |  |        </el-form-item>
 | 
											
												
													
														|  |        <el-form-item label="是否认证">
 |  |        <el-form-item label="是否认证">
 | 
											
												
													
														|  |          <el-switch          
 |  |          <el-switch          
 | 
											
										
											
												
													
														|  | @@ -103,12 +105,12 @@
 | 
											
												
													
														|  |                <bm-view :style="{width:'100%',height: '500px'}"></bm-view>
 |  |                <bm-view :style="{width:'100%',height: '500px'}"></bm-view>
 | 
											
												
													
														|  |            </baidu-map>
 |  |            </baidu-map>
 | 
											
												
													
														|  |        </el-form-item>
 |  |        </el-form-item>
 | 
											
												
													
														|  | -      <el-form-item label="带动农户人数">
 |  | 
 | 
											
												
													
														|  | -        <!-- <el-input v-model="company.countyId"></el-input> -->
 |  | 
 | 
											
												
													
														|  | 
 |  | +      <!-- <el-form-item label="带动农户人数">
 | 
											
												
													
														|  | 
 |  | +        <el-input v-model="company.countyId"></el-input>
 | 
											
												
													
														|  |        </el-form-item>
 |  |        </el-form-item>
 | 
											
												
													
														|  |        <el-form-item label="其中建档立卡人数">
 |  |        <el-form-item label="其中建档立卡人数">
 | 
											
												
													
														|  | -        <!-- <el-input v-model="company.countyId"></el-input> -->
 |  | 
 | 
											
												
													
														|  | -      </el-form-item>
 |  | 
 | 
											
												
													
														|  | 
 |  | +        <el-input v-model="company.countyId"></el-input>
 | 
											
												
													
														|  | 
 |  | +      </el-form-item> -->
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |        <el-form-item>
 |  |        <el-form-item>
 | 
											
												
													
														|  |          <el-button type="primary" @click="onSubmit('companyFrom')">提交</el-button>
 |  |          <el-button type="primary" @click="onSubmit('companyFrom')">提交</el-button>
 | 
											
										
											
												
													
														|  | @@ -120,6 +122,7 @@
 | 
											
												
													
														|  |  <script>
 |  |  <script>
 | 
											
												
													
														|  |    import {createCompany, getCompany, updateCompany} from '@/api/company'
 |  |    import {createCompany, getCompany, updateCompany} from '@/api/company'
 | 
											
												
													
														|  |    import SingleUpload from '@/components/Upload/singleUpload'
 |  |    import SingleUpload from '@/components/Upload/singleUpload'
 | 
											
												
													
														|  | 
 |  | +  import MultiUpload from '@/components/Upload/multiUpload'
 | 
											
												
													
														|  |    import {BaiduMap,BmNavigation,BmView,BmGeolocation,BmCityList} from 'vue-baidu-map'
 |  |    import {BaiduMap,BmNavigation,BmView,BmGeolocation,BmCityList} from 'vue-baidu-map'
 | 
											
												
													
														|  |    const defaultCompany={
 |  |    const defaultCompany={
 | 
											
												
													
														|  |      cityId: "",
 |  |      cityId: "",
 | 
											
										
											
												
													
														|  | @@ -160,6 +163,7 @@
 | 
											
												
													
														|  |      name: 'companyDetail',
 |  |      name: 'companyDetail',
 | 
											
												
													
														|  |      components:{
 |  |      components:{
 | 
											
												
													
														|  |        SingleUpload,
 |  |        SingleUpload,
 | 
											
												
													
														|  | 
 |  | +      MultiUpload,
 | 
											
												
													
														|  |        BaiduMap,
 |  |        BaiduMap,
 | 
											
												
													
														|  |        BmNavigation,
 |  |        BmNavigation,
 | 
											
												
													
														|  |        BmView,
 |  |        BmView,
 | 
											
										
											
												
													
														|  | @@ -176,6 +180,9 @@
 | 
											
												
													
														|  |      data() {
 |  |      data() {
 | 
											
												
													
														|  |        return {
 |  |        return {
 | 
											
												
													
														|  |          company:Object.assign({}, defaultCompany),
 |  |          company:Object.assign({}, defaultCompany),
 | 
											
												
													
														|  | 
 |  | +        jdurl:'',
 | 
											
												
													
														|  | 
 |  | +        taobaourl:'',
 | 
											
												
													
														|  | 
 |  | +        selfurl:'',
 | 
											
												
													
														|  |          rules: {
 |  |          rules: {
 | 
											
												
													
														|  |            compName: [
 |  |            compName: [
 | 
											
												
													
														|  |              {required: true, message: '请输入品牌名称', trigger: 'blur'},
 |  |              {required: true, message: '请输入品牌名称', trigger: 'blur'},
 | 
											
										
											
												
													
														|  | @@ -198,13 +205,70 @@
 | 
											
												
													
														|  |        if (this.isEdit) {
 |  |        if (this.isEdit) {
 | 
											
												
													
														|  |          getCompany(this.$route.query.id).then(response => {
 |  |          getCompany(this.$route.query.id).then(response => {
 | 
											
												
													
														|  |            this.company = response.data;
 |  |            this.company = response.data;
 | 
											
												
													
														|  | 
 |  | +          // 商城地址
 | 
											
												
													
														|  | 
 |  | +          let jdshop =  this.company.shops.filter( (item) => {
 | 
											
												
													
														|  | 
 |  | +            return item.shopType == "jd"
 | 
											
												
													
														|  | 
 |  | +          });
 | 
											
												
													
														|  | 
 |  | +          if(jdshop.length>0){this.jdurl = jdshop[0].shopUrl;}   
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +          let taobaoshop =  this.company.shops.filter( (item) => {
 | 
											
												
													
														|  | 
 |  | +            return item.shopType == "taobao"
 | 
											
												
													
														|  | 
 |  | +          });
 | 
											
												
													
														|  | 
 |  | +          if(taobaoshop.length>0){this.taobaourl = taobaoshop[0].shopUrl;}
 | 
											
												
													
														|  | 
 |  | +          // 商城地址
 | 
											
												
													
														|  | 
 |  | +          console.log('this.company',JSON.parse(JSON.stringify(this.company)));
 | 
											
												
													
														|  |          });
 |  |          });
 | 
											
												
													
														|  |        }else{
 |  |        }else{
 | 
											
												
													
														|  |          this.company = Object.assign({},defaultCompany);
 |  |          this.company = Object.assign({},defaultCompany);
 | 
											
												
													
														|  |        }
 |  |        }
 | 
											
												
													
														|  |      },
 |  |      },
 | 
											
												
													
														|  | 
 |  | +    computed: {
 | 
											
												
													
														|  | 
 |  | +      //供应商图片
 | 
											
												
													
														|  | 
 |  | +      thecompImgs:{
 | 
											
												
													
														|  | 
 |  | +        get:function () {
 | 
											
												
													
														|  | 
 |  | +          let pics=[];
 | 
											
												
													
														|  | 
 |  | +          if(this.company.files===undefined||this.company.files==null||this.company.files===''){
 | 
											
												
													
														|  | 
 |  | +            return pics;
 | 
											
												
													
														|  | 
 |  | +          }
 | 
											
												
													
														|  | 
 |  | +          let compImgs = this.company.files;
 | 
											
												
													
														|  | 
 |  | +          for(let i=0;i<compImgs.length;i++){
 | 
											
												
													
														|  | 
 |  | +            pics.push(compImgs[i].fileUrl);
 | 
											
												
													
														|  | 
 |  | +          }
 | 
											
												
													
														|  | 
 |  | +          return pics;
 | 
											
												
													
														|  | 
 |  | +        },
 | 
											
												
													
														|  | 
 |  | +        set:function (newValue) {     
 | 
											
												
													
														|  | 
 |  | +          // console.log('newValue',newValue);
 | 
											
												
													
														|  | 
 |  | +          if (newValue == null || newValue.length === 0) {
 | 
											
												
													
														|  | 
 |  | +            this.company.files = null;
 | 
											
												
													
														|  | 
 |  | +          } else {
 | 
											
												
													
														|  | 
 |  | +            this.company.files = [];
 | 
											
												
													
														|  | 
 |  | +            if (newValue.length >= 1) {              
 | 
											
												
													
														|  | 
 |  | +              for (let i = 0; i < newValue.length; i++) {
 | 
											
												
													
														|  | 
 |  | +                 this.company.files.push({fileUrl:newValue[i],fileType:"company"});
 | 
											
												
													
														|  | 
 |  | +                // this.company.files += newValue[i];
 | 
											
												
													
														|  | 
 |  | +                // if (i !== newValue.length - 1) {
 | 
											
												
													
														|  | 
 |  | +                //   this.company.files += ',';
 | 
											
												
													
														|  | 
 |  | +                // }
 | 
											
												
													
														|  | 
 |  | +              }
 | 
											
												
													
														|  | 
 |  | +            }
 | 
											
												
													
														|  | 
 |  | +          }
 | 
											
												
													
														|  | 
 |  | +        }
 | 
											
												
													
														|  | 
 |  | +      }
 | 
											
												
													
														|  | 
 |  | +    },
 | 
											
												
													
														|  |      methods: {
 |  |      methods: {
 | 
											
												
													
														|  |        onSubmit(formName) {
 |  |        onSubmit(formName) {
 | 
											
												
													
														|  | 
 |  | +        console.log('this.taobaourl',this.taobaourl);
 | 
											
												
													
														|  | 
 |  | +        // 商城地址
 | 
											
												
													
														|  | 
 |  | +        this.company.shops=[];
 | 
											
												
													
														|  | 
 |  | +        if(this.taobaourl.length>0){
 | 
											
												
													
														|  | 
 |  | +          this.company.shops.push({shopType:'taobao',shopUrl:this.taobaourl});
 | 
											
												
													
														|  | 
 |  | +        }
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +        if(this.jdurl.length>0){
 | 
											
												
													
														|  | 
 |  | +          this.company.shops.push({shopType:'jd',shopUrl:this.jdurl});
 | 
											
												
													
														|  | 
 |  | +        }
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +        // 商城地址
 | 
											
												
													
														|  |          console.log('this.company',JSON.parse(JSON.stringify(this.company)))
 |  |          console.log('this.company',JSON.parse(JSON.stringify(this.company)))
 | 
											
												
													
														|  |          // return false;
 |  |          // return false;
 | 
											
												
													
														|  |          this.$refs[formName].validate((valid) => {
 |  |          this.$refs[formName].validate((valid) => {
 | 
											
										
											
												
													
														|  | @@ -260,7 +324,7 @@
 | 
											
												
													
														|  |            let _this = this;	// 设置一个临时变量指向vue实例;
 |  |            let _this = this;	// 设置一个临时变量指向vue实例;
 | 
											
												
													
														|  |            var geolocation = new BMap.Geolocation();
 |  |            var geolocation = new BMap.Geolocation();
 | 
											
												
													
														|  |            geolocation.getCurrentPosition(function(r){
 |  |            geolocation.getCurrentPosition(function(r){
 | 
											
												
													
														|  | -            console.log(r);
 |  | 
 | 
											
												
													
														|  | 
 |  | +            // console.log(r);
 | 
											
												
													
														|  |              _this.center = {lng: r.longitude, lat: r.latitude};		// 设置center属性值
 |  |              _this.center = {lng: r.longitude, lat: r.latitude};		// 设置center属性值
 | 
											
												
													
														|  |              _this.autoLocationPoint = {lng: r.longitude, lat: r.latitude};		// 自定义覆盖物
 |  |              _this.autoLocationPoint = {lng: r.longitude, lat: r.latitude};		// 自定义覆盖物
 | 
											
												
													
														|  |              _this.initLocation = true;
 |  |              _this.initLocation = true;
 |