qzyReal před 3 roky
rodič
revize
a01c54c1d3

+ 3 - 0
app/apis/api.js

@@ -201,6 +201,9 @@ export default {
 	},
 	getItemTypeList(data){
 		return ajax.get('/TbItemType/getList',data)
+	},
+	getItemTypeEnum(){
+		return ajax.get('/TbItem/getItemType')
 	}
 	
 }

+ 2 - 2
app/pages/onely-disinfect/Index.vue

@@ -2,7 +2,7 @@
 	<view>
 		<view class="box">
 			<view class="top" style="margin-top: -1rpx;">
-				<text class="title">灵活业务</text>
+				<text class="title">其他业务</text>
 			</view>
 			<view class="add" @click="addFn">+添加</view>
 		</view>
@@ -50,7 +50,7 @@
 					</view>
 				</view>
 				<view class="b">
-					<view class="btn b3" v-if="customemrId=='1'&&businessItem.adminConfirmInput==0
+					<view class="btn b3" v-if="businessItem.adminConfirmInput==0
 								&&perList.indexOf('tb-flex-business-confirm')!=-1"
 								 @click="sureZdFn(businessItem)">
 						账单确认</view>

+ 39 - 10
app/pages/onely-disinfect/type-business-edit.vue

@@ -26,9 +26,9 @@
 			<view class="item">
 				<view class="l">车辆类型:</view>
 				<view class="r">
-					<picker class="p-picker" id="qy" @change="bindPickerChange($event)" :value="type.index"
-						:range="type.list" range-key="name">
-						<text class="p-text">{{type.list[type.index]}}</text>
+					<picker v-if="type.list.length>0" class="p-picker" id="qy" @change="bindPickerChange($event)"
+						:value="type.index" :range="type.list" range-key="name">
+						<text class="p-text">{{type.list[type.index].name}}</text>
 						<u-icon class="p-icon" name="arrow-down-fill" size="20"></u-icon>
 					</picker>
 				</view>
@@ -45,6 +45,20 @@
 					<u-input placeholder="请填写车辆载重" v-model="form.carWeight" />
 				</view>
 			</view>
+			<view class="item">
+				<view class="l">作业人员:</view>
+				<view class="r">
+					<u-input placeholder="作业人员" v-model="form.operator" />
+				</view>
+			</view>
+
+			<view class="item">
+				<view class="l">作业时间:</view>
+				<view class="r">
+					<uni-datetime-picker placeholder="请选择" :clear-icon="false" type="datetime"
+						v-model="form.operateTime" />
+				</view>
+			</view>
 			<view class="item-line">
 				收费明细<text style="color: red;">(总共{{totalPrice}}元)</text>
 			</view>
@@ -94,7 +108,7 @@
 				showRemark: false,
 				type: {
 					index: 1,
-					list: ['空车', '载货']
+					list: []
 				},
 				customerId: '1',
 				customer: {
@@ -104,7 +118,10 @@
 				form: {
 					carNo: '',
 					carSize: '',
-					carWeight: ''
+					carWeight: '',
+					operator: '',
+					operateTime: ''
+
 				},
 				list: [],
 				checkList: [],
@@ -146,6 +163,12 @@
 			return true;
 		},
 		methods: {
+			getItemTypeEnum() {
+				this.$api.getItemTypeEnum().then(resp => {
+					this.type.list = resp.data;
+					this.type.index = this.type.list.map(obj => obj.name).indexOf(this.form.carType)
+				})
+			},
 			getCustomerList() {
 				let p = {
 					judgeStatus: 2,
@@ -156,7 +179,6 @@
 				this.$api.getCustomerList(p).then(resp => {
 					let list = resp.data;
 					this.customer.list = list;
-					console.log(list)
 					this.customer.index = list.map(obj => obj.id).indexOf(this.form.customerId);
 				})
 			},
@@ -172,9 +194,14 @@
 					id: this.itemType.id
 				}).then(resp => {
 					let data = resp.data;
+					let items = data.items
+						.filter(obj => obj.itemType && obj.itemType.indexOf(this.type.list[this.type.index]
+							.name) !== -1);
+					data.items = items;
 					this.itemType = data;
-					let items = data.items;
 					let businessItems = this.businessItems;
+					console.log(this.form.items)
+					this.checkList = this.form.items.map(obj => obj.itemId);
 					items.forEach(obj => {
 						businessItems.forEach(item => {
 							if (obj.id == item.itemId) {
@@ -186,8 +213,10 @@
 				})
 			},
 			bindPickerChange(e) {
+				this.checkList=[];
 				let index = e.detail.value;
 				this.type.index = index //当前picker选中的值
+				this.getItemType();
 			},
 			customerChange(e) {
 				let index = e.detail.value;
@@ -211,7 +240,7 @@
 				let list = itemList.filter(obj => checkList.indexOf(obj.id) !== -1);
 				this.form.itemTypeId = this.itemType.id;
 				this.form.items = list;
-				this.form.carType = this.type.list[this.type.index]
+				this.form.carType = this.type.list[this.type.index].name
 				if (this.customerId == '1') {
 					this.form.customerId = this.customer.list[this.customer.index].id;
 				} else {
@@ -236,11 +265,11 @@
 					let data = resp.data;
 					this.form = data;
 					this.businessItems = data.items;
-					this.checkList = data.items.map(obj => obj.itemId);
 					this.itemType.id = data.itemTypeId;
-					this.type.index = this.type.list.indexOf(data.carType)
 					this.getItemType();
 					this.getCustomerList();
+					this.getItemTypeEnum();
+
 				})
 			},
 			editFn() {

+ 12 - 0
app/pages/onely-disinfect/type-business-info.vue

@@ -47,6 +47,18 @@
 						{{item.realOutTime}} (米)
 					</view>
 				</view>
+				<view class="item" v-if="item.operator">
+					<view class="l" >作业人员:</view>
+					<view class="r">
+						{{item.operator}}
+					</view>
+				</view>
+				<view class="item" v-if="item.operateTime">
+					<view class="l" >作业时间:</view>
+					<view class="r">
+						{{item.operateTime}}
+					</view>
+				</view>
 			</view>
 			
 			<view class="item-line">

+ 52 - 20
app/pages/onely-disinfect/type-business.vue

@@ -4,7 +4,7 @@
 			<view class="top">
 				<text class="title">{{itemType.name}}</text>
 			</view>
-			
+
 			<view class="item-line">
 				基本信息
 			</view>
@@ -27,9 +27,9 @@
 			<view class="item">
 				<view class="l">车辆类型:</view>
 				<view class="r">
-					<picker class="p-picker" id="qy" @change="bindPickerChange($event)" :value="type.index"
+					<picker v-if="type.list.length>0" class="p-picker" id="qy" @change="bindPickerChange($event)" :value="type.index"
 						:range="type.list" range-key="name">
-						<text class="p-text">{{type.list[type.index]}}</text>
+						<text class="p-text">{{type.list[type.index].name}}</text>
 						<u-icon class="p-icon" name="arrow-down-fill" size="20"></u-icon>
 					</picker>
 				</view>
@@ -40,12 +40,26 @@
 					<u-input placeholder="请填写车辆规格" v-model="form.carSize" />
 				</view>
 			</view>
-			<view class="item" v-if="type.index==1">
+			<view class="item" v-if="type.index==0">
 				<view class="l">载重(kg):</view>
 				<view class="r">
 					<u-input placeholder="请填写车辆载重" v-model="form.carWeight" />
 				</view>
 			</view>
+			<view class="item">
+				<view class="l">作业人员:</view>
+				<view class="r">
+					<u-input placeholder="请填写作业人员" v-model="form.operator" />
+				</view>
+			</view>
+
+			<view class="item">
+				<view class="l">作业时间:</view>
+				<view class="r">
+					<uni-datetime-picker placeholder="请选择" :clear-icon="false" type="datetime"
+						v-model="form.operateTime" />
+				</view>
+			</view>
 			<view class="item-line">
 				收费明细<text style="color: red;">(总共{{totalPrice}}元)</text>
 			</view>
@@ -63,10 +77,11 @@
 									<view slot="minus" class="minus">
 										<u-icon name="minus" size="12"></u-icon>
 									</view>
-									<text v-if="item.inc==0" slot="input" style="width: 50px;text-align: center;color: #E5E5E5;"
+									<text v-if="item.inc==0" slot="input"
+										style="width: 50px;text-align: center;color: #E5E5E5;"
+										class="input">{{item.num}}</text>
+									<text v-else slot="input" style="width: 50px;text-align: center;"
 										class="input">{{item.num}}</text>
-										<text v-else slot="input" style="width: 50px;text-align: center;"
-											class="input">{{item.num}}</text>
 									<view slot="plus" class="plus">
 										<u-icon name="plus" size="12"></u-icon>
 									</view>
@@ -93,8 +108,8 @@
 			return {
 				showRemark: false,
 				type: {
-					index: 1,
-					list: ['空车', '载货']
+					index: 0,
+					list: []
 				},
 				customer: {
 					index: 0,
@@ -105,7 +120,8 @@
 					customerId: '',
 					carNo: '',
 					carSize: '',
-					carWeight: ''
+					carWeight: '',
+					operator: ''
 				},
 				list: [],
 				checkList: [],
@@ -131,12 +147,12 @@
 		},
 		onLoad(options) {
 			let customerId = uni.getStorageSync('customerId');
-			console.log(customerId)
 			this.customerId = customerId;
 			let typeId = options.typeId;
 			this.itemType.id = typeId;
-			this.getItemType();
-			if (!customerId||customerId == '1') {
+
+			this.getItemTypeEnum();
+			if (!customerId || customerId == '1') {
 				this.getCustomerList();
 			}
 			let that = this;
@@ -149,8 +165,19 @@
 		},
 
 		methods: {
+			getItemTypeEnum() {
+				this.$api.getItemTypeEnum().then(resp => {
+					this.type.list = resp.data;
+					this.getItemType();
+				})
+			},
 			getCustomerList() {
-				let p={judgeStatus: 2,pageNo:1,pageSize:30,	type: 0}
+				let p = {
+					judgeStatus: 2,
+					pageNo: 1,
+					pageSize: 30,
+					sortType: 20
+				}
 				this.$api.getCustomerList(p).then(resp => {
 					this.customer.list = resp.data;
 				})
@@ -167,8 +194,10 @@
 					id: this.itemType.id
 				}).then(resp => {
 					let data = resp.data;
+					let items = data.items
+					.filter(obj => obj.itemType && obj.itemType.indexOf(this.type.list[this.type.index].name) !== -1);
+					data.items=items;
 					this.itemType = data;
-					let items = data.items;
 					this.checkList = items.filter(obj => obj.need == 1).map(obj => obj.id)
 
 				})
@@ -176,8 +205,9 @@
 			bindPickerChange(e) {
 				let index = e.detail.value;
 				this.type.index = index //当前picker选中的值
+				this.getItemType();
 			},
-			customerChange(e){
+			customerChange(e) {
 				let index = e.detail.value;
 				this.customer.index = index //当前picker选中的值
 			},
@@ -189,14 +219,14 @@
 				let itemList = this.itemType.items;
 				let checkList = this.checkList;
 				let list = itemList.filter(obj => checkList.indexOf(obj.id) !== -1);
-				if(this.customerId=='1'||!this.customerId){
+				if (this.customerId == '1' || !this.customerId) {
 					this.form.customerId = this.customer.list[this.customer.index].id;
-				}else{
-					this.form.customerId=this.customerId
+				} else {
+					this.form.customerId = this.customerId
 				}
 				this.form.itemTypeId = this.itemType.id;
 				this.form.items = list;
-				this.form.carType = this.type.list[this.type.index]
+				this.form.carType = this.type.list[this.type.index].name
 				let that = this;
 				let content = '确认录入该车辆的业务?'
 				uni.showModal({
@@ -213,6 +243,8 @@
 				this.$api.addCarDisinfect(this.$common.removeNull(this.form)).then(resp => {
 					if (resp.code == 200) {
 						this.$common.to('/pages/onely-disinfect/addSuccess?typeId=' + this.itemType.id)
+					} else {
+						this.$common.toast(resp.msg);
 					}
 				})
 			},

+ 3 - 1
app/pages/wx/pay.vue

@@ -152,7 +152,9 @@
 						let data = resp.data;
 						if (data.cars && data.cars.length > 0) {
 							this.cars = data.cars;
-							this.carsSelect = [data.cars[0].id];
+							let carId=[data.cars[0].id];
+							this.carsSelect = carId;
+							this.groupChange(carId)
 						}
 					})
 				}

+ 2 - 2
app/utils/request.js

@@ -1,6 +1,6 @@
-// const server = 'http://127.0.0.1:8099/pro';
+const server = 'http://127.0.0.1:8099/pro';
 // const server = 'https://pco.aseanbusiness.cn/pro';
-const server = 'https://dxkaa1.bgigc.com/pro';
+// const server = 'https://dxkaa1.bgigc.com/pro';
 
 import common from '../common/js/common.js';
 

+ 1 - 1
sp-admin/sa-view/tb-business/tb-car-disincle-edit.html

@@ -185,7 +185,7 @@
 						sa.ajax('/TbCostomer/getList', {
 							pageNo: 1,
 							pageSize: 30,
-							sortType:20
+							sortType:20,
 							judgeStatus: 2
 						}, function(res) {
 							this.customerList = res.data; // 数据

+ 1 - 1
sp-server/app.pid

@@ -1 +1 @@
-24088
+14660

+ 1 - 1
sp-server/src/main/java/com/pj/api/jh/service/JhService.java

@@ -152,12 +152,12 @@ public class JhService {
     public void notifyResult(JhNotifyBO bo) {
         String orderStatus = bo.getTradeStatus();
         if (!"SUCCESS".equals(orderStatus) && !"FINISH".equals(orderStatus)) {
+            log.error("支付订单回调失败:{}",JSONUtil.toJsonStr(bo));
             return;
         }
         NotifyBO notifyBO = new NotifyBO();
         String outTradeNo = bo.getOutTradeNo();
         notifyBO.setOutTradeNo(bo.getOutTradeNo())
-                .setAttach(bo.getAttach())
                 .setTransactionId(bo.getBankTrxNo())
                 .setTotalFee(NumberUtil.mul(bo.getOrderPrice(), 100 + "").toString());
         wxService.WxNotify(notifyBO);

+ 5 - 2
sp-server/src/main/java/com/pj/api/wx/service/WxService.java

@@ -197,7 +197,6 @@ public class WxService {
     }
 
 
-    @Async
     public void WxNotify(NotifyBO notifyBO) {
         String outTradeNo = notifyBO.getOutTradeNo();
         TbOrder tbOrder = tbOrderService.findByOutTradeNo(outTradeNo);
@@ -205,6 +204,10 @@ public class WxService {
             log.error("========订单不存在==========:{}", outTradeNo);
             return;
         }
+        if (StrUtil.equals("SUCCESS",tbOrder.getOrderStatus())) {
+            log.error("========订单已支付==========:{}", outTradeNo);
+            return;
+        }
         String total_fee = notifyBO.getTotalFee();
         BigDecimal money = new BigDecimal(total_fee).divide(new BigDecimal(100), 2, BigDecimal.ROUND_UP);
         String attachStr = tbOrder.getAttach();
@@ -236,7 +239,7 @@ public class WxService {
                 List<TbBusinessItem> items;
                 List<TbBusiness> businessList = new ArrayList<>();
                 if (TbBusiness.BusinessType.CAR_DISINCLE.getCode().equals(tbOrder.getBusinessType())) {
-                    List<String> businessIds = StrUtil.splitTrim(",", businessId);
+                    List<String> businessIds = StrUtil.splitTrim(businessId,",");
                     items = tbBusinessItemService.findByBusinessIdList(businessIds);
                     businessList = tbBusinessService.listByIds(businessIds);
                 } else {

+ 3 - 0
sp-server/src/main/java/com/pj/project/tb_business/TbBusinessService.java

@@ -220,6 +220,9 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
             tbBusinessCar.setIsLock(0);
             String carNo = tbBusinessCar.getCarNo().toUpperCase();
             TbBusinessCar db = tbBusinessCarService.findByBusinessIdAndCarNo(t.getId(), carNo);
+            if (db!=null&&TbBusiness.BusinessType.CAR_DISINCLE.getCode().equals(db.getBusinessType())){
+                throw new BusinessException("该车存在其他业务");
+            }
             if (db != null) {
                 tbBusinessCar.setId(db.getId()).setIsLock(db.getIsLock());
             }

+ 6 - 2
sp-server/src/main/java/com/pj/project/tb_fee_statistics/TbFeeStatisticsService.java

@@ -250,11 +250,15 @@ public class TbFeeStatisticsService extends ServiceImpl<TbFeeStatisticsMapper, T
             if(StrUtil.isEmpty(business.getCardNo())){
                 carNo = business.getChinaCarNo();
             }
-            TbBusinessCar businessCar = tbBusinessCarService.findByBusinessIdAndCarNo(item.getBusinessId(), carNo);
+            TbBusinessCar businessCar;
+            if (TbBusiness.BusinessType.CAR_DISINCLE.getCode().equals(business.getBusinessType())) {
+                businessCar=tbBusinessCarService.getById(business.getBusinessCarId());
+            }else {
+                businessCar  = tbBusinessCarService.findByBusinessIdAndCarNo(item.getBusinessId(), carNo);
+            }
             businessFeeDetail.setBusinessId(item.getBusinessId()).setBusinessNo(business.getNo())
                     .setBusinessItemNo(item.getNo()).setBusinessCarId(businessCar.getId()).setBusinessCarNo(businessCar.getNo())
                     .setCarNo(carNo)
-
                     .setItemPrice(item.getTotal()).setUnitPrice(item.getItemPrice()).setNoTaxPrice(noTaxPrice).setTaxPrice(taxPrice)
                     .setFeeType(feeType)
                     .setItemTypeId(item.getItemTypeId()).setItemTypeName(item.getItemTypeName())