Sfoglia il codice sorgente

Merge branch 'master' of http://git.zthymaoyi.com/gongdecai/wangluohuoyun-huozhuapp

gjy 2 anni fa
parent
commit
1fa9ee2537
1 ha cambiato i file con 148 aggiunte e 112 eliminazioni
  1. 148 112
      pages/mine/cargoowner/editEnerprise.vue

+ 148 - 112
pages/mine/cargoowner/editEnerprise.vue

@@ -4,15 +4,20 @@
 			<view style='border-bottom:1px solid #eee;padding:10px 0 10px;' class="flex flex-space-between row">
 			<view style='border-bottom:1px solid #eee;padding:10px 0 10px;' class="flex flex-space-between row">
 				<view class="left-text">企业</view>
 				<view class="left-text">企业</view>
 				<view style='font-size:16px;width:50%;' class='flex flex-space-between'>
 				<view style='font-size:16px;width:50%;' class='flex flex-space-between'>
-					<view :style="{'color':dataDetails.company ? '#000':'#C6CBD5'}">{{dataDetails.company?dataDetails.company:'选择所属企业'}}</view>
-					<view><u-icon name="arrow-right" color="#7E7E7E" size="10"></u-icon></view>
+					<view :style="{'color':dataDetails.company ? '#000':'#C6CBD5'}">
+						{{dataDetails.company?dataDetails.company:'选择所属企业'}}
+					</view>
+					<view>
+						<u-icon name="arrow-right" color="#7E7E7E" size="10"></u-icon>
+					</view>
 				</view>
 				</view>
-				
+
 			</view>
 			</view>
 			<view style='padding:10px 0 10px;' class="flex flex-space-between items-center width100">
 			<view style='padding:10px 0 10px;' class="flex flex-space-between items-center width100">
 				<view style='width:100px;font-size:14px;'>法定代表人姓名</view>
 				<view style='width:100px;font-size:14px;'>法定代表人姓名</view>
 				<view class="flex">
 				<view class="flex">
-					<u--input disabledColor='#fff' disabled placeholder="自动获取" inputAlign='left' border="none" v-model="dataDetails.legalPersonName1">
+					<u--input disabledColor='#fff' disabled placeholder="自动获取" inputAlign='left' border="none"
+						v-model="dataDetails.legalPersonName1">
 					</u--input>
 					</u--input>
 				</view>
 				</view>
 			</view>
 			</view>
@@ -20,7 +25,7 @@
 		<view class='content1'>
 		<view class='content1'>
 			<view class="title">上传企业授权书</view>
 			<view class="title">上传企业授权书</view>
 			<!-- {{show}} -->
 			<!-- {{show}} -->
-<!-- 			<button type="default" @click="()=>{show = true}" style="width: 80%;background-color: #007AFF;color: #fff;margin-top: 60rpx;">选择文件</button>
+			<!-- 			<button type="default" @click="()=>{show = true}" style="width: 80%;background-color: #007AFF;color: #fff;margin-top: 60rpx;">选择文件</button>
 				<view class="textStyle" v-for="(item,index) in pathArr" :key="index">
 				<view class="textStyle" v-for="(item,index) in pathArr" :key="index">
 					<view>
 					<view>
 						文件名:{{item.name}}
 						文件名:{{item.name}}
@@ -35,7 +40,7 @@
 				<nk-select-file v-model="show" @confirm="getPath"></nk-select-file> -->
 				<nk-select-file v-model="show" @confirm="getPath"></nk-select-file> -->
 			<u-upload class="uview-upload" :fileList="fileList1" @afterRead="afterRead($event)" @delete="deletePic"
 			<u-upload class="uview-upload" :fileList="fileList1" @afterRead="afterRead($event)" @delete="deletePic"
 				name="1" multiple :maxCount="9"></u-upload>
 				name="1" multiple :maxCount="9"></u-upload>
-	<!-- 		<view style='position:relative;'>
+			<!-- 		<view style='position:relative;'>
 				<view v-if='!dataDetails.certificateAddressUrl' @click="uploadImg(1)" class="picture picture7">
 				<view v-if='!dataDetails.certificateAddressUrl' @click="uploadImg(1)" class="picture picture7">
 					<image class="xj-image" src="@/static/mine/ic_shanchuan@2x.png"></image>
 					<image class="xj-image" src="@/static/mine/ic_shanchuan@2x.png"></image>
 					<view class="text">上传企业授权书</view>
 					<view class="text">上传企业授权书</view>
@@ -51,28 +56,36 @@
 			</view> -->
 			</view> -->
 			<view class="flex row noborder">
 			<view class="flex row noborder">
 				<view stlye='width:100px;' class="left-text">授权截止日期</view>
 				<view stlye='width:100px;' class="left-text">授权截止日期</view>
-				<view style='font-size:16px;width:50%;' class='flex flex-space-between'  @click="selectdate">
-					<view style='padding-left:20px;' :style="{'color':dataDetails.authorizationDeadline ? '#000':'#C6CBD5'}">{{dataDetails.authorizationDeadline?dataDetails.authorizationDeadline:'选择期限截止日期'}}</view>
-					<view><u-icon name="arrow-right" color="#7E7E7E" size="10"></u-icon></view>
+				<view style='font-size:16px;width:50%;' class='flex flex-space-between' @click="selectdate">
+					<view style='padding-left:20px;'
+						:style="{'color':dataDetails.authorizationDeadline ? '#000':'#C6CBD5'}">
+						{{dataDetails.authorizationDeadline?dataDetails.authorizationDeadline:'选择期限截止日期'}}
+					</view>
+					<view>
+						<u-icon name="arrow-right" color="#7E7E7E" size="10"></u-icon>
+					</view>
 				</view>
 				</view>
 			</view>
 			</view>
-			<u-picker :show="isdate" ref="uPicker" :columns="validityPeriod"
-				@confirm="confirmValidityPeriod" @change="changeHandler"  @cancel="isdate=false">
+			<u-picker :show="isdate" ref="uPicker" :columns="validityPeriod" @confirm="confirmValidityPeriod"
+				@change="changeHandler" @cancel="isdate=false">
 			</u-picker>
 			</u-picker>
-			
+
 		</view>
 		</view>
 		<u-action-sheet :actions="$helper.imgTypeList" :title="$helper.imgType" :show="isShowimgType"
 		<u-action-sheet :actions="$helper.imgTypeList" :title="$helper.imgType" :show="isShowimgType"
-			@select="imgTypeSelect" @cancel='isShowimgType=false' :closeOnClickOverlay="true" :closeOnClickAction="true" @close="isShowimgType=false">
+			@select="imgTypeSelect" @cancel='isShowimgType=false' :closeOnClickOverlay="true" :closeOnClickAction="true"
+			@close="isShowimgType=false">
 		</u-action-sheet>
 		</u-action-sheet>
 		<view class="content4">
 		<view class="content4">
-			<view style='margin:0 0 18px;font-size:12px;color:#999;' class='flex items-center'>
-				<u--image style='margin-right:5px;margin-top: 6rpx;' @click='consent'
-					:src="checked?'../../../static/mine/duihao@2x.png':'../../../static/mine/wxz.png'"
-					width="12px" height="12px"></u--image>
-					我已阅读并同意全部细则
+			<view style='margin:0 0 18px;font-size:12px;color:#999;align-items:center' class='flex'>
+				<u--image style='margin-right:5px;' @click='consent'
+					:src="checked?'../../../static/mine/duihao@2x.png':'../../../static/mine/wxz.png'" width="12px"
+					height="12px"></u--image>
+				我已阅读并同意全部细则
 			</view>
 			</view>
 			<view class='line'></view>
 			<view class='line'></view>
-			<view :class="{'active':dataDetails.certificateAddressUrl&&dataDetails.company&&dataDetails.legalPersonName&&dataDetails.authorizationDeadline}" class="next-btn" @click="submit()">
+			<view
+				:class="{'active':dataDetails.certificateAddressUrl&&dataDetails.company&&dataDetails.legalPersonName&&dataDetails.authorizationDeadline}"
+				class="next-btn" @click="submit()">
 				提交
 				提交
 			</view>
 			</view>
 		</view>
 		</view>
@@ -87,82 +100,86 @@
 	import permision from "@/js_sdk/wa-permission/permission.js"
 	import permision from "@/js_sdk/wa-permission/permission.js"
 	import uploadImage from '@/components/ossutil/uploadFile.js';
 	import uploadImage from '@/components/ossutil/uploadFile.js';
 	export default {
 	export default {
-		components: {
-		},
+		components: {},
 		data() {
 		data() {
 			return {
 			return {
-				show:false,
+				show: false,
 				pathArr: [],
 				pathArr: [],
-				dataDetails:{},
-				companuList:[],
-				isshow:false,
-				isdate:false,
-				checked:false,
-				validityPeriod:[],
-				isShowimgType:false,
-				uploadType:'',
-				index:0,
+				dataDetails: {},
+				companuList: [],
+				isshow: false,
+				isdate: false,
+				checked: false,
+				validityPeriod: [],
+				isShowimgType: false,
+				uploadType: '',
+				index: 0,
 				fileList1: [],
 				fileList1: [],
-				urlList:[]
+				urlList: []
 			}
 			}
 		},
 		},
 		computed: {
 		computed: {
 			...mapState(['hasLogin', 'userInfo']),
 			...mapState(['hasLogin', 'userInfo']),
 		},
 		},
-		onLoad(options){
+		onLoad(options) {
 			this.get_camera_permission()
 			this.get_camera_permission()
-			if(uni.getStorageSync('cargoOwnerId')){
-				this.dataDetails.cargoOwnerId=uni.getStorageSync('cargoOwnerId')
+			if (uni.getStorageSync('cargoOwnerId')) {
+				this.dataDetails.cargoOwnerId = uni.getStorageSync('cargoOwnerId')
 			}
 			}
-			this.validityPeriod = this.$helper.makeValidityPeriod(0,'长期')
+			this.validityPeriod = this.$helper.makeValidityPeriod(0, '长期')
 			// this.getList()
 			// this.getList()
-			
+
 			this.dataDetails = options
 			this.dataDetails = options
-			if(this.dataDetails.legalPersonName.length==2){
-				this.dataDetails.legalPersonName1=this.dataDetails.legalPersonName.toString().replace(/^([^\x00-\xff])([^\x00-\xff]{0,})([^\x00-\xff])/g , '$1*')
-			}else if(this.dataDetails.legalPersonName.length==3){
-				this.dataDetails.legalPersonName1=this.dataDetails.legalPersonName.toString().replace(/^([^\x00-\xff])([^\x00-\xff]{0,})([^\x00-\xff])/g , '$1*$3')
-			}else if(this.dataDetails.legalPersonName.length==4){
-				this.dataDetails.legalPersonName1=this.dataDetails.legalPersonName.toString().replace(/^([^\x00-\xff])([^\x00-\xff]{0,2})([^\x00-\xff])/g , '$1**$3')
+			if (this.dataDetails.legalPersonName.length == 2) {
+				this.dataDetails.legalPersonName1 = this.dataDetails.legalPersonName.toString().replace(
+					/^([^\x00-\xff])([^\x00-\xff]{0,})([^\x00-\xff])/g, '$1*')
+			} else if (this.dataDetails.legalPersonName.length == 3) {
+				this.dataDetails.legalPersonName1 = this.dataDetails.legalPersonName.toString().replace(
+					/^([^\x00-\xff])([^\x00-\xff]{0,})([^\x00-\xff])/g, '$1*$3')
+			} else if (this.dataDetails.legalPersonName.length == 4) {
+				this.dataDetails.legalPersonName1 = this.dataDetails.legalPersonName.toString().replace(
+					/^([^\x00-\xff])([^\x00-\xff]{0,2})([^\x00-\xff])/g, '$1**$3')
 			}
 			}
-			
+
 			console.log(this.dataDetails)
 			console.log(this.dataDetails)
-			if(options.certificateAddressUrl){
+			if (options.certificateAddressUrl) {
 				var arr = options.certificateAddressUrl.split(',')
 				var arr = options.certificateAddressUrl.split(',')
 				this.urlList = options.certificateAddressUrl.split(',')
 				this.urlList = options.certificateAddressUrl.split(',')
-				this.fileList1=[]
-				for(var i=0;i<arr.length;i++){
-					if(arr[i]!=''){
-						this.fileList1.push({url:arr[i]})
+				this.fileList1 = []
+				for (var i = 0; i < arr.length; i++) {
+					if (arr[i] != '') {
+						this.fileList1.push({
+							url: arr[i]
+						})
 					}
 					}
 				}
 				}
 			}
 			}
-			
-			
+
+
 		},
 		},
 		onShow() {
 		onShow() {
-		
+
 		},
 		},
 		methods: {
 		methods: {
 			async get_camera_permission() {
 			async get_camera_permission() {
-				var photol=await permision.requestAndroidPermission("android.permission.CAMERA")
-				if(photol == false){
+				var photol = await permision.requestAndroidPermission("android.permission.CAMERA")
+				if (photol == false) {
 					uni.showModal({
 					uni.showModal({
 						title: '提示',
 						title: '提示',
 						content: '您已经关闭相机权限,去设置',
 						content: '您已经关闭相机权限,去设置',
-						success: function (res) {
+						success: function(res) {
 							if (res.confirm) {
 							if (res.confirm) {
 								permision.gotoAppPermissionSetting()
 								permision.gotoAppPermissionSetting()
-									            // plus.runtime.openURL("app-settings:");
+								// plus.runtime.openURL("app-settings:");
 							} else if (res.cancel) {
 							} else if (res.cancel) {
 								console.log('用户点击取消');
 								console.log('用户点击取消');
 							}
 							}
 						}
 						}
-					});	
+					});
 				}
 				}
 			},
 			},
-			uploadFilePromise(file,url) {
-				uploadImage('image',url, 'appData/',
+			uploadFilePromise(file, url) {
+				uploadImage('image', url, 'appData/',
 					result => {
 					result => {
 						// 上传成功回调函数
 						// 上传成功回调函数
 						console.log('图片地址', result)
 						console.log('图片地址', result)
@@ -174,7 +191,7 @@
 			},
 			},
 			// 删除图片
 			// 删除图片
 			deletePic(event) {
 			deletePic(event) {
-				this.urlList=this.urlList.splice(event.index,1)
+				this.urlList = this.urlList.splice(event.index, 1)
 				this[`fileList${event.name}`].splice(event.index, 1)
 				this[`fileList${event.name}`].splice(event.index, 1)
 			},
 			},
 			// 新增图片
 			// 新增图片
@@ -191,7 +208,7 @@
 					})
 					})
 				})
 				})
 				for (let i = 0; i < lists.length; i++) {
 				for (let i = 0; i < lists.length; i++) {
-					const result = await this.uploadFilePromise(lists[i],lists[i].url)
+					const result = await this.uploadFilePromise(lists[i], lists[i].url)
 					// console.log(result)
 					// console.log(result)
 					let item = this[`fileList${event.name}`][fileListLen]
 					let item = this[`fileList${event.name}`][fileListLen]
 					this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
 					this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
@@ -202,13 +219,13 @@
 					fileListLen++
 					fileListLen++
 				}
 				}
 			},
 			},
-			consent(){
-				this.checked=!this.checked
+			consent() {
+				this.checked = !this.checked
 			},
 			},
-			selectdate(){
-				this.isdate=true
+			selectdate() {
+				this.isdate = true
 			},
 			},
-			selectshow(){
+			selectshow() {
 				this.goDetailPage('/pages/mine/cargoowner/selectcompany')
 				this.goDetailPage('/pages/mine/cargoowner/selectcompany')
 			},
 			},
 			confirmValidityPeriod(e) {
 			confirmValidityPeriod(e) {
@@ -218,11 +235,14 @@
 				} else {
 				} else {
 					this.dataDetails.authorizationDeadline = e.value[0] + '-' + e.value[1] + '-' + e.value[2]
 					this.dataDetails.authorizationDeadline = e.value[0] + '-' + e.value[1] + '-' + e.value[2]
 				}
 				}
-			
+
 				this.isdate = false
 				this.isdate = false
 			},
 			},
 			goDetailPage(src) {
 			goDetailPage(src) {
-				uni.setStorage({key: 'companydata',data: JSON.stringify(this.dataDetails)});
+				uni.setStorage({
+					key: 'companydata',
+					data: JSON.stringify(this.dataDetails)
+				});
 				uni.$u.route(src);
 				uni.$u.route(src);
 			},
 			},
 			changeHandler(e) {
 			changeHandler(e) {
@@ -233,13 +253,13 @@
 					index,
 					index,
 					picker = this.$refs.uPicker
 					picker = this.$refs.uPicker
 				} = e
 				} = e
-			
+
 				// if (columnIndex === 0) {
 				// if (columnIndex === 0) {
 				// 	
 				// 	
 				// 	if (e.index != 0) {
 				// 	if (e.index != 0) {
 				// 		picker.setColumnValues(1, this.validityPeriod[1].shift())
 				// 		picker.setColumnValues(1, this.validityPeriod[1].shift())
 				// 	}
 				// 	}
-			
+
 				// } else if (columnIndex === 1) {
 				// } else if (columnIndex === 1) {
 				// 	if (e.index != 0) {
 				// 	if (e.index != 0) {
 				// 		picker.setColumnValues(2, this.validityPeriod[2].shift())
 				// 		picker.setColumnValues(2, this.validityPeriod[2].shift())
@@ -265,7 +285,7 @@
 			// 		})
 			// 		})
 			// 	});
 			// 	});
 			// },
 			// },
-			submit(){
+			submit() {
 				if (!this.checked) {
 				if (!this.checked) {
 					uni.showToast({
 					uni.showToast({
 						title: '请勾选协议',
 						title: '请勾选协议',
@@ -276,10 +296,10 @@
 				}
 				}
 				uni.showLoading({
 				uni.showLoading({
 					title: '加载中',
 					title: '加载中',
-					mask:true
+					mask: true
 				})
 				})
-				var _this=this
-				this.dataDetails.commonId=this.userInfo.id
+				var _this = this
+				this.dataDetails.commonId = this.userInfo.id
 				this.dataDetails.certificateAddressUrl = this.urlList.toString()
 				this.dataDetails.certificateAddressUrl = this.urlList.toString()
 				this.$request.baseRequest('post', '/cargoOwnerCompInfo/api/editCargoOwnerComp', _this.dataDetails).then(res => {
 				this.$request.baseRequest('post', '/cargoOwnerCompInfo/api/editCargoOwnerComp', _this.dataDetails).then(res => {
 					uni.hideLoading()
 					uni.hideLoading()
@@ -304,26 +324,32 @@
 </script>
 </script>
 
 
 <style lang='scss' scoped>
 <style lang='scss' scoped>
-	page{
+	page {
 		background: #F5F6FA;
 		background: #F5F6FA;
-		
+
 	}
 	}
-	.content{
-		height:100vh;
+
+	.content {
+		height: 100vh;
 		/* background: white; */
 		/* background: white; */
 		/* padding:20rpx */
 		/* padding:20rpx */
 	}
 	}
-	.wrap{
+
+	.wrap {
 		margin: 20rpx;
 		margin: 20rpx;
 		padding: 20rpx;
 		padding: 20rpx;
 		border-radius: 20rpx;
 		border-radius: 20rpx;
 		background: white;
 		background: white;
 	}
 	}
+
 	.preview-card-img {
 	.preview-card-img {
-		/deep/uni-image>div, uni-image>img {
-		    transform: scale(1.5) rotate(-90deg);
+
+		/deep/uni-image>div,
+		uni-image>img {
+			transform: scale(1.5) rotate(-90deg);
 		}
 		}
 	}
 	}
+
 	.picture {
 	.picture {
 		margin-top: 20rpx;
 		margin-top: 20rpx;
 		background: #F5F6FA;
 		background: #F5F6FA;
@@ -336,27 +362,29 @@
 		align-items: center;
 		align-items: center;
 		color: #6A7282;
 		color: #6A7282;
 	}
 	}
+
 	.content1 {
 	.content1 {
-		background:#fff;
-		padding:40rpx 20rpx 20rpx;
-		margin:20rpx 0rpx 200rpx;
+		background: #fff;
+		padding: 40rpx 20rpx 20rpx;
+		margin: 20rpx 0rpx 200rpx;
 		border-radius: 10rpx;
 		border-radius: 10rpx;
+
 		.row {
 		.row {
 			border-bottom: 1px solid #EEEEEE;
 			border-bottom: 1px solid #EEEEEE;
 			padding-bottom: 28rpx;
 			padding-bottom: 28rpx;
 			margin-top: 26rpx;
 			margin-top: 26rpx;
-	
+
 		}
 		}
-	
+
 		.left-text {
 		.left-text {
 			// background: red;
 			// background: red;
 			width: 320rpx;
 			width: 320rpx;
 			color: #333333;
 			color: #333333;
 			display: flex;
 			display: flex;
 			align-items: center;
 			align-items: center;
-			font-size:14px;
+			font-size: 14px;
 		}
 		}
-	
+
 		.picture {
 		.picture {
 			position: relative;
 			position: relative;
 			width: 100%;
 			width: 100%;
@@ -365,58 +393,66 @@
 			justify-content: center;
 			justify-content: center;
 			flex-direction: column;
 			flex-direction: column;
 			align-items: center;
 			align-items: center;
-	
+
 			.text {
 			.text {
 				margin-top: 20rpx;
 				margin-top: 20rpx;
 			}
 			}
 		}
 		}
+
 		.picture7 {
 		.picture7 {
 			background: url(../../../static/mine/cy.png);
 			background: url(../../../static/mine/cy.png);
 			background-size: 100% 100%;
 			background-size: 100% 100%;
 		}
 		}
-	
-	
+
+
 		.xj-image {
 		.xj-image {
 			width: 100rpx;
 			width: 100rpx;
 			height: 100rpx;
 			height: 100rpx;
 		}
 		}
-	
+
 		.title {
 		.title {
 			color: #999999;
 			color: #999999;
 			margin: 20rpx 0;
 			margin: 20rpx 0;
 		}
 		}
 	}
 	}
-	.u-input{
-		font-size:16px;
+
+	.u-input {
+		font-size: 16px;
 	}
 	}
+
 	.content4 {
 	.content4 {
-		position:fixed;
-		bottom:0;
+		position: fixed;
+		bottom: 0;
 		background: white;
 		background: white;
-		width:100%;
-		text-align:center;
-		left:0;
-		box-sizing: border-box;;
-		padding:10px 15px;
-		.line{
-			position:absolute;
-			left:0;
-			margin-top:-9px;
-			border-top:1px solid #eee;
-			width:100%;
+		width: 100%;
+		text-align: center;
+		left: 0;
+		box-sizing: border-box;
+		;
+		padding: 10px 15px;
+
+		.line {
+			position: absolute;
+			left: 0;
+			margin-top: -9px;
+			border-top: 1px solid #eee;
+			width: 100%;
 		}
 		}
+
 		.next-btn {
 		.next-btn {
 			background: #F1F3F6;
 			background: #F1F3F6;
 			width: 85%;
 			width: 85%;
 			padding: 20rpx 20rpx;
 			padding: 20rpx 20rpx;
 			text-align: center;
 			text-align: center;
 			color: #C5CAD4;
 			color: #C5CAD4;
-			border-radius: 50rpx;margin:0 auto;
-			margin-top:10px;
+			border-radius: 50rpx;
+			margin: 0 auto;
+			margin-top: 10px;
 		}
 		}
-		.next-btn.active{
-			background:#2772FB;
-			color:#fff;
+
+		.next-btn.active {
+			background: #2772FB;
+			color: #fff;
 		}
 		}
 	}
 	}
 </style>
 </style>