Administrator 4 vuotta sitten
vanhempi
commit
53226bb767
1 muutettua tiedostoa jossa 212 lisäystä ja 33 poistoa
  1. 212 33
      supplier/pages/user/information.vue

+ 212 - 33
supplier/pages/user/information.vue

@@ -6,11 +6,11 @@
 			</view>
 			<view class="info-from">
 				<view class="label">公司名称</view>
-				<input class="row-input" type="text" placeholder="请与营业执照的注册名称保持一致" maxlength="6"/>
+				<input class="row-input" type="text"  v-model="params.name" placeholder="请与营业执照的注册名称保持一致" maxlength="30"/>
 			</view>
 			<view class="info-from">
 				<view class="label">公司简称</view>
-				<input class="row-input" type="text" placeholder="请输入公司简称" maxlength="6"/>
+				<input class="row-input" type="text" v-model="params.sname"placeholder="请输入公司简称" maxlength="10"/>
 			</view>
 			<view class="info-from">
 				<view class="label">公司地址</view>
@@ -21,39 +21,39 @@
 					 <text class="iconfont icon-xiayibu"></text>
 				</view> 
 			</view>
-			<textarea value="" placeholder="请填写详细地址,如街道/小区/门牌等" maxlength="50" class="address-details"/>
+			<textarea value="" v-model="addressData.addressDetail"  placeholder="请填写详细地址,如街道/小区/门牌等" maxlength="50" class="address-details"/>
 			<view class="info-from">
 				<view class="label">联系人</view>
-				<input class="row-input" type="text" placeholder="请输入联系人姓名" maxlength="6"/>
+				<input class="row-input"  v-model="params.linkMan" type="text" placeholder="请输入联系人姓名" maxlength="6"/>
 			</view>
 			<view class="info-from">
 				<view class="label">邮箱</view>
-				<input class="row-input" type="text" placeholder="请输入邮箱地址 " maxlength="6"/>
+				<input class="row-input" v-model="params.email" type="text" placeholder="请输入邮箱地址 " maxlength="6"/>
 			</view>
 			 <text class="info-email">邮箱可用作登录账号,请使用公司邮箱或法人邮箱</text>
 			<view class="info-from">
 				<view class="label">固定电话</view>
-				<input class="row-input" type="text" placeholder="请在号码前加区 " maxlength="6"/>
+				<input class="row-input" v-model="params.contractPhone" type="text" placeholder="请在号码前加区 " maxlength="11"/>
 			</view>
 			<view class="info-from">
 				<view class="label">传真</view>
-				<input class="row-input" type="text" placeholder="请输入公司传真号 " maxlength="6"/>
+				<input class="row-input" v-model="params.fax" type="text" placeholder="请输入公司传真号 " />
 			</view>
 			<view class="info-from">
 				<view class="label">法人代表</view>
-				<input class="row-input" type="text" placeholder="请输入公司法人代表姓名 " maxlength="6"/>
+				<input class="row-input" v-model="params.legalPerson" type="text" placeholder="请输入公司法人代表姓名 " maxlength="6"/>
 			</view>
 			<view class="info-from">
 				<view class="label">注册资本</view>
-				<input class="row-input" type="text" placeholder="请填写公司注册资本 " maxlength="6"/>
+				<input class="row-input"  v-model="params.registeredCapital" type="text" placeholder="请填写公司注册资本 " />
 			</view>
 			<view class="info-from">
 				<view class="label">公司性质</view>
-				<input class="row-input" type="text" placeholder="请填写公司性质 " maxlength="6"/>
+				<input class="row-input" v-model="params.nature" type="text" placeholder="请填写公司性质 " />
 			</view>
 			<view class="info-from">
 				<view class="label">年营业额</view>
-				<input class="row-input" type="text" placeholder="请输入公司年营业额  " maxlength="6"/>
+				<input class="row-input" v-model="params.turnover" type="text" placeholder="请输入公司年营业额  " />
 			</view>
 		</view>
 		
@@ -64,8 +64,8 @@
 			<view class="info-from" style="border: 0;">
 				<view class="label">公司类型</view>
 				<view class="row-input ShopTyperadio">
-				 <radio-group>
-					 <label class="radio" v-for="(item, index) in typename" :key="item.value" @click="firstShopTypeRidio(item)">
+				 <radio-group @change="radioChange">
+					 <label class="radio" v-for="(item, index) in typename" :key="item.value">
 						 <radio :value="item.value" color='#E15616'/>{{item.name}}
 					 </label>
 				 </radio-group>
@@ -102,8 +102,8 @@
 								</label>
 					 </checkbox-group>
 					 <view class="addbusiness">
-					 	<input class="row-input other" type="text" placeholder="请输入自定义项目"  @blur="onBlurInput" maxlength="5"/>
-					 	<button type="default" class="button" @click.stop="addCustomItem">确认添加</button>
+					 	<input class="row-input other" type="text" placeholder="请输入自定义项目"  v-model="mainProEdit"  maxlength="5"/>
+					 	<button type="default" class="button" @click.stop="mainProAdd">确认添加</button>
 					 </view>
 				</view>
 			</view>
@@ -117,18 +117,18 @@
 							</label>
 					   </checkbox-group>
 					 <view class="addbusiness">
-					 	<input class="row-input other" type="text" placeholder="请输入自定义经营范围"  @blur="onBlurInput" maxlength="5"/>
+					 	<input class="row-input other" type="text" placeholder="请输入自定义经营范围" v-model="shopScopeEdit" maxlength="5"/>
 					 	<button type="default" class="button" @click.stop="shopScopeAdd">确认添加</button>
 					 </view>
 				</view>
 			</view>
 			<view class="info">
 				<view class="info2-title">公司介绍</view>
-				 <textarea placeholder="公司简介会在公司介绍页面展示,有助于机构更好的了解您, 建议从个人规模、代理产品、机构服务、荣誉资质这4方面进行介绍" name="textarea"/>
+				 <textarea  v-model="params.info"  maxlength="2000" placeholder="公司简介会在公司介绍页面展示,有助于机构更好的了解您, 建议从个人规模、代理产品、机构服务、荣誉资质这4方面进行介绍" name="textarea"/>
 			</view>
 			<view class="info">
 				<view class="info2-title">主打系列商品说明</view>
-				 <textarea placeholder="请输入主打系列商品说明" name="textarea"/>
+				 <textarea placeholder="请输入主打系列商品说明" v-model="params.productDesc" maxlength="500" name="textarea"/>
 			</view>
 		</view>
 		
@@ -208,7 +208,7 @@
 					 </view>
 					 <view class="form-upload-image" v-for="(item, index) in HonorImagesList" :key="index">
 						   <image class="upload-img" :src="item" alt="" @click="showViewerImageFn5()"></image>
-						   <view class="iconfont icon-shanchu1" @click="removeGoodsImagesFn(index)"></view>
+						   <view class="iconfont icon-shanchu1" @click="removeGoodsImagesFn(HonorImagesList)"></view>
 					 </view>
 				</view>
 			</view>
@@ -290,9 +290,30 @@
 					{value:'12',name:'健康养生'},
 					{value:'13',name:'纤体减肥'}
 				],
-				shopMainPros:[],
-				shopScope:[],
 				params:{
+					userID:'',
+					shopID:'',
+					townID:'',
+					provinceID: '',//省id
+					cityID: '',
+					address:'',
+					name:'',//公司名称
+					sname:'',//公司简称
+					linkMan:'',//联系人
+					email:'',//
+					contractPhone:'',//固定电话
+					fax:'',//传真
+					legalPerson:'',//法人代表
+					registeredCapital:'',//注册资本
+					nature:'',//公司性质
+					turnover:'',//年营业额
+					firstShopType:'',//公司类型 1医疗  2非医疗
+					secondShopType:'',//医疗下的二级分类
+					medicalPracticeLicenseImg1:'',//资质
+					mainpro:'',//主营产品
+					businessScope:'',//经营内容
+					info:'',//公司介绍
+					productDesc:'',//主打说明
 					medicalPracticeLicenseImg1:'',//三级器械/医疗执照
 					socialCreditCode:'',//营业执照编号
 					businessLicenseImage:'',//营业执照
@@ -303,11 +324,170 @@
 					certificateHonor:'',//荣誉
 					productCertification:'',//产品
 				},
+				shopMainPros:[],
+				shopScope:[],
+				mainProEdit: '',
+				shopScopeEdit:'',
 				HonorImagesList:[],
 				productImagesList:[],
+				isPreviewImage:false,   	//预览图片开关
 			}
 		},
+		onLoad(option) {
+			this.shopInfo();
+		},
 		methods:{
+		  shopInfo(){
+			  this.$api.getStorage().then((resolve) =>{
+				  this.params.userID = resolve.userID;
+				  this.SupplierApi.shopInfo({userID:this.params.userID}).then(response =>{
+					if(res.code==0){
+						console.log(response)
+						let shop = response.data.shop;
+						let user = response.data.user;
+						_this.params.name = shop.name;
+						_this.params.sname = shop.sname;
+						_this.params.linkMan = shop.linkMan;
+						_this.params.email = user.email;
+						_this.params.address = shop.provincialAddress;
+						_this.params.provinceID = shop.provinceID;
+						_this.params.cityID = shop.cityID;
+						_this.params.townID = shop.townID;
+						_this.params.contractPhone = shop.contractPhone;
+						_this.params.fax = shop.fax;
+						_this.params.legalPerson = shop.legalPerson;
+						_this.params.registeredCapital = shop.registeredCapital;
+						_this.params.nature = shop.nature;
+						_this.params.turnover = shop.turnover;
+						_this.shopMainPros = _this.setNewMainpro(shop.mainpro);
+						_this.shopScope = _this.setNewScope(shop.businessScope);
+						_this.params.firstShopType = shop.firstShopType;
+						_this.params.secondShopType = shop.secondShopType;
+						_this.params.medicalPracticeLicenseImg1 = shop.medicalPracticeLicenseImg1;
+						_this.params.info = shop.info;
+						_this.params.productDesc = shop.productDesc;
+						_this.params.socialCreditCode = shop.socialCreditCode;
+						_this.params.businessLicenseImage = shop.businessLicenseImage;
+						_this.params.logo = shop.logo;
+						_this.params.productionLicence = shop.productionLicence;
+						_this.params.hygienicLicense = shop.hygienicLicense;
+						_this.params.taxLicense = shop.taxLicense;
+						_this.params.certificateHonor = shop.hygienicLicense;
+						_this.HonorImagesList = res.data.certificateHonor;
+						_this.productImagesList = res.data.productCertification;
+					}
+				 })
+				 })
+			 },
+			shopSubmit(){//提交修改
+				console.log(this.params);
+				 this.ShopService.modifiedData(params).then(res=>{
+						 console.log(res)
+						  if(res.code === 0){
+							  this.$util.msg('修改成功',2000,true,'success')
+							  setTimeout(()=>{
+							  	uni.navigateBack();
+							  },2000)
+						} else {
+							this.$util.msg(res.msg,2000);
+							this.loginLoading = false;
+						}
+					})
+			},
+			 mainProAdd(){//添加主营内容
+					if (this.mainProEdit.length>0) {
+						var obj = {name:this.mainProEdit};
+						if(this.checkedArray(this.mainProEdit,this.mentuzCampNullList)){
+							this.$util.msg('主营内容已存在!',2000)
+						}else {
+							this.mentuzCampNullList.push(obj);
+						}
+					}
+				},
+			shopScopeAdd(){ //经营内容
+				if (this.shopScopeEdit.length>0) {
+					var obj = {name:this.shopScopeEdit};
+					if(this.checkedArray(this.shopScopeEdit,this.Scopelist)){
+						this.$util.msg('主营内容已存在!',2000)
+					}else {
+						this.Scopelist.push(obj);
+					}
+				}
+			},
+			 checkedArray(content,arr){//判断主营内容是否已存在
+			            for(var i in arr){
+			                if(arr[i].name == content){
+			                    return true;
+			                }
+			            }
+			            return false;
+			        },
+				setNewMainpro(arr){//回显处理主营内容
+							var newArr = [];
+							console.log(arr)
+							arr.split('/').forEach(function(item){
+								newArr.push(item);
+							});
+							return newArr
+						},
+				setNewScope(arr) {//回显处理主营内容
+					  var newArr = [];
+					  console.log(arr)
+					  if(arr!=null){
+						 arr.split('/').forEach(function(item){
+							newArr.push(item);
+						});
+						 return newArr
+					  }else {
+						return newArr
+					  }
+				},
+			radioChange(e){
+				this.params.firstShopType = e.target.value;
+				if (e.target.value==1){
+					this.isfirstShow = true;
+				}else {
+					this.isfirstShow = false;
+				}
+				console.log(e.target.value)
+			},
+			showViewerImageFn6(e) {//预览产品
+				this.myPreviewImageFnlist(this.productImagesList)
+			},
+			showViewerImageFn5(e) {//预览荣誉
+				this.myPreviewImageFnlist(this.HonorImagesList)
+			},
+			showViewerImageFn4(e) {//预览税务
+				this.myPreviewImageFn(this.params.taxLicense)
+			},
+			showViewerImageFn3(e) {//预览卫生
+				this.myPreviewImageFn(this.params.hygienicLicense)
+			},
+			showViewerImageFn2(e) {//预览生产
+				this.myPreviewImageFn(this.params.productionLicence)
+			},
+			showViewerImageFn1(e) {//预览logo
+				this.myPreviewImageFn(this.params.logo)
+			},
+			showViewerImageFn(e) {//预览营业执照
+				this.myPreviewImageFn(this.params.businessLicenseImage)
+			},
+			myPreviewImageFnlist(arr){//多张预览
+				this.isPreviewImage = true;
+				uni.previewImage({
+					urls: arr,
+					current: 0
+				})
+				},
+			myPreviewImageFn(url){//单张预览
+				this.isPreviewImage = true
+				let mentuzArray = []
+				mentuzArray.push(url)
+				uni.previewImage({
+					urls: mentuzArray,
+					current: 0
+				});
+			},
 			uploadproductImageFn(event){//产品证书
 					 uploadFileImage().then(res =>{
 						 this.productImagesList.push(JSON.parse(res.data).data);
@@ -377,21 +557,14 @@
 			   this.medicalPracticeLicenseImg1 = '';
 			 },
 			secondypeRidio(item){
-				this.secontype = item.value;
+				this.params.secondShopType = item.value;
 				if (item.value==3){
 				this.issecondshow = true;
 				}else {
 				 this.issecondshow = false;
 				}
 			},
-			firstShopTypeRidio(item){
-				this.firsttype = item.value;
-				if (item.value==1){
-				this.isfirstShow = true;
-				}else {
-				 this.isfirstShow = false;
-				}
-			},
+			
 			showMulLinkageThreePicker() {//三级地址联动
 				this.isShowInput = true
 				this.$refs.mpvueCityPicker.show()
@@ -402,7 +575,9 @@
 				this.addressData.townID = e.townCode;
 				this.addressData.cityID = e.cityCode;
 				this.addressData.provinceID = e.provinceCode;
-				this.secondParams.townId = this.addressData.townID;
+				this.params.townID = this.addressData.townID;
+				this.params.provinceID = this.addressData.provinceID;
+				this.params.cityID = this.addressData.cityID;
 				this.secondParams.address = this.addressData.address;
 			},
 			onConfirmbrand(e){
@@ -483,7 +658,7 @@
 		 border: 0;
 		 .radio{
 			 float: left;
-			 margin-right: 60rpx;
+			 margin-right: 77rpx;
 			 .iconfont{
 				 margin-right: 10rpx;
 				 font-size: $font-size-36;
@@ -675,6 +850,8 @@
 	 .row-group{
 		 .row-text{
 		 	display: inline-block;
+			font-size: 28rpx;
+			color: #333333;
 		 }
 		 .row-input{
 			width: 50%;
@@ -682,7 +859,9 @@
 			margin-bottom: 10rpx;
 		 }
 		 .diyBox{
-			margin-right: 60rpx;
+			margin-bottom: 5px;
+			width: 33%;
+			display: inline-block;
 		 }
 		 
 	 }