소스 검색

部分bug修复

qzyReal 3 년 전
부모
커밋
2f5315cb42

+ 3 - 0
app/apis/api.js

@@ -78,4 +78,7 @@ export default {
 	editCustomer(data){
 		return ajax.postForm('/TbCostomer/update',data)
 	},
+	getUnitList(){
+		return ajax.get('/TbUnit/getList')
+	}
 }

+ 8 - 0
app/common/js/common.js

@@ -66,6 +66,14 @@ export default {
 		}
 		return reg.test(email)
 	},
+	// 正则验证是否为手机号
+	isPhone (str) {
+		str = str + '';
+		if((/^1[34578]\d{9}$/.test(str))){ 
+			return true; 
+		} 
+		return false;
+	},
 	removeNull(obj){
 		var newObj = {};
 		if(obj != undefined && obj != null) {

+ 50 - 75
app/pages/business-entering/business-entering.vue

@@ -46,31 +46,36 @@
 				</view>
 			</view>
 			<view class="item">
-				<view class="l">境外车牌:</view>
+				<view class="l">货物:</view>
 				<view class="r">
-					<u-input placeholder="输入车牌号" @input="carInputFn" v-model="form.cardNo" />
+					<picker v-if="goods.goodsList.length>0" class="p-picker" id="hw"
+						@change="whChange($event)" :value="goods.index" :range="goods.goodsList"
+						range-key="name">
+						<text class="p-text">{{goods.goodsList[goods.index].name}}</text>
+						<u-icon class="p-icon" name="arrow-down-fill" size="20"></u-icon>
+					</picker>
 				</view>
 			</view>
 			<view class="item">
-				<view class="l">规格(米):</view>
+				<view class="l">境外车牌:</view>
 				<view class="r">
-					<u-input type="number" placeholder="输入车辆规格" v-model="form.cardSize" />
+					<u-input placeholder="输入车牌号"  v-model="form.cardNo" />
 				</view>
 			</view>
 			<view class="item">
-				<view class="l">载重(吨):</view>
+				<view class="l">境外车规格:</view>
 				<view class="r">
-					<u-input type="number" placeholder="输入载重" v-model="form.netWeight" />
+					<u-input type="number" placeholder="输入车辆规格" @input="carSizeInput" v-model="form.cardSize" > 
+					<text slot="suffix">米</text>
+					</u-input>
 				</view>
 			</view>
 			<view class="item">
-				<view class="l">货物:</view>
+				<view class="l">载重:</view>
 				<view class="r">
-					<picker v-if="goods.goodsList.length>0" class="p-picker" id="hw" @change="bindPickerChange($event)"
-						:value="goods.index" :range="goods.goodsList" range-key="name">
-						<text class="p-text">{{goods.goodsList[goods.index].name}}</text>
-						<u-icon class="p-icon" name="arrow-down-fill" size="20"></u-icon>
-					</picker>
+					<u-input type="number" placeholder="输入载重" v-model="form.netWeight" >
+							<text slot="suffix">吨</text>
+					</u-input>
 				</view>
 			</view>
 			<view class="item">
@@ -103,8 +108,8 @@
 			<view class="item-line">
 				业务项
 			</view>
-			<view class="item" v-for="item in itemList" :key="item.id" v-if="item.items.length>0">
-				<view class="l">{{item.name}}:</view>
+			<view class="item" v-for="item in filterItemList" :key="item.id" v-if="item.items.length>0">
+				<view class="l"><text v-if="needTypeId.indexOf(item.id)!==-1" style="color: red;">*</text>{{item.name}}:</view>
 				<view class="r">
 					<view @click="selectItemFn(item)">
 						<u-input placeholder="请选择" v-model="item.itemName" readonly clearable style="width: 120px;">
@@ -132,7 +137,7 @@
 			<view style="padding: 40rpx;line-height: 60rpx;text-align: center;">
 				<view v-for="item in car.filterList" :id="item.id"
 					style="margin-bottom: 20rpx;border-bottom: 1rpx solid #E5E5E5;" @click="selectCarNo(item)">
-					{{item.cardNo}}({{item.cardSize}})
+					{{item.cardSize}}
 				</view>
 			</view>
 		</u-popup>
@@ -178,6 +183,8 @@
 				},
 				customerId: '1',
 				itemList: [],
+				filterItemList: [],
+				needTypeId:[],
 				form: {
 					customerId: '',
 					customerIndex: 0,
@@ -256,55 +263,34 @@
 			}
 		},
 		created() {
-			this.getItemList();
 			if (this.customerId == '1') {
 				this.getCustomerList();
 			}
-			this.getCarList();
-			this.getDriverList();
 			this.getGoodsList();
-			if (this.form.id) {
-				this.$common.showLoading('加载中...')
-				setTimeout(() => {
-					this.getBusinessById();
-				}, 800)
-			}
+			this.getUnit();
 		},
 		methods: {
-			closeFn(data) {
-				console.log(data);
+			whChange(event) {
+				let  index = event.detail.value; //当前picker选中的值
+				this.goods.index=index;
+				let goods=this.goods.goodsList[index];
+				let noNeedIds = goods.noNeedIds.split(',');
+				this.needTypeId=goods.needIds.split(',')
+				this.filterItemList = this.itemList.filter(obj => noNeedIds.indexOf(obj.id) == -1);
 			},
-			getBusinessById() {
-				this.$api.getBusinessById({
-					id: this.form.id
-				}).then(resp => {
-					let data = resp.data;
-					this.form = data;
-					this.customer.index = this.customer.customerList.map(obj => obj.name).indexOf(data
-						.customerName);
-					this.goods.index = this.goods.goodsList.map(o => o.name).indexOf(data.goodsName);
-					let items = data.items;
-					let names = items.map(obj => obj.itemTypeName);
-					let itemTypeList = this.itemList.filter(obj => names.indexOf(obj.name) !== -1);
-					for (let i in itemTypeList) {
-						let type = itemTypeList[i];
-						for (let j in items) {
-							let item = items[j];
-							if (item.itemTypeId == type.id) {
-								type.itemName = item.itemName;
-								type.num = item.num
-								break;
-							}
-						}
-					}
-					setTimeout(() => {
-						this.car.carInput = false;
-					}, 50)
+			carSizeInput(){
+				
+			},
+			getUnit(){
+				this.$api.getUnitList().then(resp=>{
+					
 				})
 			},
+			closeFn(data) {
+				console.log(data);
+			},
 			addHsFn() {
 				this.hs.visible = true;
-			
 			},
 			showHsModal() {
 				Object.assign(this.modal, {
@@ -353,12 +339,18 @@
 			getGoodsList() {
 				this.$api.getGoodsList().then(resp => {
 					this.goods.goodsList = resp.data;
+					let goods = resp.data[0];
+					let noNeedIds = goods.noNeedIds.split(',');
+					this.needTypeId=goods.needIds.split(',')
+					this.$api.getItemList().then(resp => {
+						let list = resp.data;
+						this.itemList = list;
+						this.filterItemList = list.filter(obj => noNeedIds.indexOf(obj.id) == -1);
+					})
 				})
 			},
-			getDriverList() {
-				this.$api.getDriverList().then(resp => {
-					this.driverList = resp.data;
-				})
+			handlerTypeItem(goods) {
+
 			},
 			idCardInput() {
 				let val = this.form.driverIdCard;
@@ -379,20 +371,7 @@
 					that.driver.show = false;
 				}, 150)
 			},
-			getCarList() {
-				this.$api.getCarList().then(resp => {
-					this.carList = resp.data;
-				})
-			},
 			carInputFn() {
-				let val = this.form.cardNo;
-				let list = this.carList.filter(obj => obj.cardNo.indexOf(val) !== -1);
-				if (list.length > 0 && val) {
-					this.car.carInput = true;
-					this.car.filterList = list;
-				} else {
-					this.car.carInput = false;
-				}
 				this.handler();
 			},
 			selectCarNo(item) {
@@ -415,11 +394,7 @@
 					this.customer.customerList = resp.data;
 				})
 			},
-			getItemList() {
-				this.$api.getItemList().then(resp => {
-					this.itemList = resp.data;
-				})
-			},
+
 			selectItemFn(item) {
 				this.item = item;
 				this.show = true;

+ 17 - 16
app/pages/enterprise-reg/enterprise-reg.vue

@@ -46,10 +46,9 @@
 				<view class="l">营业执照:</view>
 				<view class="r">
 					<view class="img">
-						<!-- <u-upload max-count="1" ref="license" :file-list="imgList" :action="uploadImageUrl" width="300" height="200"></u-upload> -->
 						<uni-file-picker v-model="imageValue" fileMediatype="image" mode="grid" limit="1"
 							@select="select" @progress="progress" @success="success" @fail="fail"
-							:image-styles="imageStyles" />
+							@delete="form.businessLicence=''" :image-styles="imageStyles" />
 					</view>
 				</view>
 			</view>
@@ -92,6 +91,16 @@
 			},
 			// 获取上传状态
 			select(e) {
+				let that = this;
+				uni.uploadFile({
+					url: that.uploadImageUrl,
+					filePath: e.tempFilePaths[0],
+					name: 'file',
+					success: (resp => {
+						console.log(JSON.parse(resp.data).data)
+						that.form.businessLicence = JSON.parse(resp.data).data;
+					})
+				})
 				console.log('选择文件:', e)
 			},
 			// 获取上传进度
@@ -117,24 +126,16 @@
 					return false;
 				}
 				if (!this.form.dutyPeople) {
-					this.$common.toast('请录入负责人');
+					this.$common.toast('请录入联系人');
 					return false;
 				}
-				if (!this.form.phone) {
-					this.$common.toast('请录入联系号码');
+				if (!this.$common.isPhone(this.form.phone)) {
+					this.$common.toast('联系号码不正确');
 					return false;
 				}
-				let licenseFiles = this.$refs.license.lists.filter(val => {
-					return val.progress == 100;
-				})
-				if (licenseFiles.length > 0) {
-					this.form.businessLicence = licenseFiles.map(obj => {
-						if (obj.response) {
-							return obj.response.data;
-						} else if (obj.url) {
-							return obj.url;
-						}
-					}).join(',');
+				if (!this.form.businessLicence) {
+					this.$common.toast('请上传营业执照');
+					return false;
 				}
 
 				return true;

+ 2 - 2
app/utils/request.js

@@ -1,5 +1,5 @@
-//const server = 'http://192.168.3.217:8099';
-const server = 'http://47.101.143.145/pro';
+const server = 'http://192.168.3.217:8099/pro';
+// const server = 'http://47.101.143.145/pro';
 import common from '../common/js/common.js';
 
 function get(url, data) {

+ 1 - 1
sp-admin/sa-view/tb-business/tb-business-info.html

@@ -57,7 +57,7 @@
 								<sa-info name="入场时间" br>{{m.chinaCarInTime}}</sa-info>
 								<sa-info name="出场时间" br>{{m.chinaCarOutTime}}</sa-info>
 								<!-- <sa-info name="停车时长" br>{{m.partTime}}(分)</sa-info> -->
-								<sa-info name="停车费用(元)" br>{{m.partMoney}}</sa-info>
+								<sa-info name="停车费用(元)" br>{{m.chinaPartMoney}}</sa-info>
 								<sa-info name="业务费用(元)" br>{{m.itemPrice}}</sa-info>
 								<sa-info name="合计费用(元)" br>{{m.totalMoney}}</sa-info>
 								<sa-info name="支付时间" br>{{m.payTime}}</sa-info>

+ 4 - 6
sp-admin/sa-view/tb-business/tb-business-list.html

@@ -54,7 +54,7 @@
 					<sa-td name="载重(吨)" prop="netWeight"></sa-td>
 					<!-- 	<sa-td name="司机名称" prop="driverName" ></sa-td>
 					<sa-td name="司机联系" width="120" prop="driverPhone" ></sa-td> -->
-					<sa-td name="总费用费(元)" prop="itemPrice"></sa-td>
+					<sa-td name="总用费(元)" prop="totalMoney"></sa-td>
 					<sa-td width="130" name="支付状态" prop="payStatus" type="enum"
 						:jv="{1: '未支付[#ff0000]', 2: '已支付(未确认)[#ffaa00]', 3: '已支付(已确认)[#005500]'}"></sa-td>
 						<sa-td width="160" name="支付时间" prop="payTime"></sa-td>
@@ -70,9 +70,9 @@
 						<template slot-scope="s">
 							<el-button class="c-btn" type="primary" v-if="s.row.realInTime!=null
 								&&s.row.complete==0&&currentCustomerId=='1'" @click="completeFn(s.row)">生成账单</el-button>
-							<el-button class="c-btn" type="primary" v-if="s.row.confirmInput==0
+							<el-button class="c-btn" type="primary" v-if="(s.row.confirmInput==0)
 								&&s.row.payStatus==1
-								&&s.row.outDayTime!=null
+								&&s.row.complete==1
 								&&perCode.indexOf('tb-business-confirm')!=-1
 								&&currentCustomerId!='1'" @click="confirmFn(s.row)">确认账单</el-button>
 							<el-button class="c-btn" type="success" v-if="perCode.indexOf('tb-business-pay')!=-1
@@ -91,9 +91,7 @@
 								@click="adminSurePayFn(s.row)">确认支付</el-button>
 							<el-button class="c-btn" type="success" @click="get(s.row)">查看</el-button>
 							<el-button class="c-btn" type="primary" v-if="currentCustomerId=='1'
-							&&s.row.confirmInput==0
-							&&s.row.realInTime==null
-							&&s.row.outDayTime==null" @click="update(s.row)">修改</el-button>
+							&&s.row.confirmInput==0" @click="update(s.row)">修改</el-button>
 							<el-button class="c-btn" type="danger" v-if="s.row.payStatus==1
 								&&s.row.confirmInput==0
 								&&s.row.realInTime==null

+ 2 - 2
sp-admin/static/sa.js

@@ -19,10 +19,10 @@ var sa = {
 	}
 	// 正式生产环境
 	var cfg_prod = {
-		api_url: 'http://www.baidu.com',
+		api_url: 'http://47.101.143.145/pro',
 		web_url: 'http://www.baidu.com'
 	}
-	sa.cfg = cfg_dev; // 最终环境 , 上线前请选择正确的环境 
+	sa.cfg = cfg_dev; // 最终环境 , 上线前请选择正确的环境
 })();