Bladeren bron

bug修复

qzyReal 3 jaren geleden
bovenliggende
commit
ec3736d56d

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

@@ -106,5 +106,37 @@ export default {
 	isAuth(code) {
 		let list = uni.getStorageSync('perList');
 		return list.indexOf(code) !== -1;
+	},
+	// 将时间戳转化为指定时间
+	// way:方式(1=年月日,2=年月日时分秒)默认1,  也可以指定格式:yyyy-MM-dd HH:mm:ss  
+	forDate(inputTime, way) {
+		var date = new Date(inputTime);
+		var y = date.getFullYear();  
+		var m = date.getMonth() + 1;  
+		m = m < 10 ? ('0' + m) : m;  
+		var d = date.getDate();  
+		d = d < 10 ? ('0' + d) : d;  
+		var h = date.getHours();
+		h = h < 10 ? ('0' + h) : h;
+		var minute = date.getMinutes();
+		var second = date.getSeconds();
+		minute = minute < 10 ? ('0' + minute) : minute;  
+		second = second < 10 ? ('0' + second) : second; 
+		var ms = date.getMilliseconds();
+		
+		way = way || 1;
+		// way == 1  年月日
+		if(way === 1) {
+			return y + '-' + m + '-' + d;  
+		}
+		// way == 1  年月日时分秒 
+		if(way === 2){
+			return y + '-' + m + '-' + d + ' ' + h + ':' + minute + ':' + second;  
+		}
+		// way == 具体格式   标准格式: yyyy-MM-dd HH:mm:ss
+		if(typeof way == 'string') {
+			return way.replace("yyyy", y).replace("MM", m).replace("dd", d).replace("HH", h).replace("mm", minute).replace("ss", second).replace("ms", ms);
+		}
+		return y + '-' + m + '-' + d;  
 	}
 }

+ 37 - 40
app/pages/business-order/report.vue

@@ -56,9 +56,9 @@
 				},
 				imgList: [],
 				outReport: [],
-				checkReport:[],
-				disinfectReport:[],
-				nucleicReport:[],
+				checkReport: [],
+				disinfectReport: [],
+				nucleicReport: [],
 				imageStyles: {
 					width: 150,
 					height: 100,
@@ -74,11 +74,19 @@
 		},
 		onLoad(options) {
 			this.id = options.id;
-		},
-		onShow() {
 			this.getBusinessById();
 		},
+		
 		methods: {
+			toast() {
+				let obj = {
+					outReport: this.form.outReport,
+					checkReport: this.form.checkReport,
+					disinfectReport: this.form.disinfectReport,
+					nucleicReport: this.form.nucleicReport,
+				}
+				this.$common.toast(JSON.stringify(obj))
+			},
 			outSelect(e) {
 				let that = this;
 				uni.uploadFile({
@@ -86,7 +94,7 @@
 					filePath: e.tempFilePaths[0],
 					name: 'file',
 					success: (resp => {
-						that.form.outReport= JSON.parse(resp.data).data;
+						that.form.outReport = JSON.parse(resp.data).data;
 					})
 				})
 			},
@@ -97,7 +105,7 @@
 					filePath: e.tempFilePaths[0],
 					name: 'file',
 					success: (resp => {
-						that.form.checkReport= JSON.parse(resp.data).data;
+						that.form.checkReport = JSON.parse(resp.data).data;
 					})
 				})
 			},
@@ -108,7 +116,7 @@
 					filePath: e.tempFilePaths[0],
 					name: 'file',
 					success: (resp => {
-						that.form.disinfectReport= JSON.parse(resp.data).data;
+						that.form.disinfectReport = JSON.parse(resp.data).data;
 					})
 				})
 			},
@@ -119,18 +127,7 @@
 					filePath: e.tempFilePaths[0],
 					name: 'file',
 					success: (resp => {
-						that.form.nucleicReport= JSON.parse(resp.data).data;
-					})
-				})
-			},
-			handlerUpload(e, target) {
-				let that = this;
-				uni.uploadFile({
-					url: that.uploadImageUrl,
-					filePath: e.tempFilePaths[0],
-					name: 'file',
-					success: (resp => {
-						that.form[target] = JSON.parse(resp.data).data;
+						that.form.nucleicReport = JSON.parse(resp.data).data;
 					})
 				})
 			},
@@ -139,32 +136,32 @@
 					id: this.id
 				}).then(resp => {
 					this.form = resp.data;
-					if(this.form.nucleicReport){
-						this.nucleicReport=[{
-							'name':'payTicket.png',
-							'extname':'.png',
-							'url':this.form.nucleicReport
+					if (this.form.nucleicReport) {
+						this.nucleicReport = [{
+							'name': 'payTicket.png',
+							'extname': '.png',
+							'url': this.form.nucleicReport
 						}]
 					}
-					if(this.form.disinfectReport){
-						this.disinfectReport=[{
-							'name':'payTicket.png',
-							'extname':'.png',
-							'url':this.form.disinfectReport
+					if (this.form.disinfectReport) {
+						this.disinfectReport = [{
+							'name': 'payTicket.png',
+							'extname': '.png',
+							'url': this.form.disinfectReport
 						}]
 					}
-					if(this.form.checkReport){
-						this.checkReport=[{
-							'name':'payTicket.png',
-							'extname':'.png',
-							'url':this.form.checkReport
+					if (this.form.checkReport) {
+						this.checkReport = [{
+							'name': 'payTicket.png',
+							'extname': '.png',
+							'url': this.form.checkReport
 						}]
 					}
-					if(this.form.outReport){
-						this.outReport=[{
-							'name':'payTicket.png',
-							'extname':'.png',
-							'url':this.form.outReport
+					if (this.form.outReport) {
+						this.outReport = [{
+							'name': 'payTicket.png',
+							'extname': '.png',
+							'url': this.form.outReport
 						}]
 					}
 				})

+ 2 - 1
app/pages/customer-management/customer-info.vue

@@ -79,7 +79,7 @@
 			}
 		},
 		mounted() {
-			let id = uni.getStorageSync('info').customerId;
+			let id = uni.getStorageSync('userInfo').customerId;
 			this.customerId=id;
 			this.getCustomerById(id);
 		},
@@ -91,6 +91,7 @@
 					filePath: e.tempFilePaths[0],
 					name: 'file',
 					success: (resp => {
+						console.log(JSON.parse(resp.data).data)
 						that.form.businessLicence = JSON.parse(resp.data).data;
 					})
 				})

+ 14 - 10
app/pages/declare/add.vue

@@ -45,7 +45,7 @@
 				<view class="l"><text style="color: red;">*</text>生产日期:</view>
 				<view class="r">
 					<view class="r">
-						<uni-datetime-picker placeholder="请选择" @input="handler()" :clear-icon="false" type="date"
+						<uni-datetime-picker placeholder="请选择" :end="startDate" @input="handler()" :clear-icon="false" type="date"
 							v-model="form.productionDate" />
 					</view>
 				</view>
@@ -110,7 +110,7 @@
 			<view class="item">
 				<view class="l"><text style="color: red;">*</text>运输车辆(车尾牌):</view>
 				<view class="r">
-					<u--textarea @input="handler()" v-model="form.chinaCarNoSuff" placeholder="运输车车尾牌,多个请用逗号隔开">
+					<u--textarea @input="handler()" v-model="form.chinaCarSuff" placeholder="运输车车尾牌,多个请用逗号隔开">
 					</u--textarea>
 				</view>
 			</view>
@@ -185,6 +185,7 @@
 	export default {
 		data() {
 			return {
+				startDate:new Date().getTime()-24*60*60*1000,
 				form: {
 					declarePeople: '',
 					declarePhone: '',
@@ -204,7 +205,7 @@
 					driverPhone: '',
 					agent: '',
 					chinaCarNo: '',
-					chinaCarNoSuff: '',
+					chinaCarSuff: '',
 					carNo: '',
 					customProof: '',
 					quarantineProof: '',
@@ -234,7 +235,7 @@
 					goodsName: '',
 					grossWeight: '',
 					num: '',
-					productionDate: '',
+					productionDate: this.$common.forDate(new Date().getTime()-24*60*60*1000,1),
 					expirationDate: '',
 					productionMode: '',
 					origin: '',
@@ -247,7 +248,7 @@
 					driverPhone: '',
 					agent: '',
 					chinaCarNo: '',
-					chinaCarNoSuff: '',
+					chinaCarSuff: '',
 					carNo: '',
 					customProof: '',
 					quarantineProof: '',
@@ -299,6 +300,9 @@
 						success(resp) {
 							if (resp.confirm) {
 								that.form = cache
+								if(!that.form.productionDate){
+									that.form.productionDate=that.$common.forDate(new Date().getTime()-24*60*60*1000,1)
+								}
 							} else {
 								that.cleanFn();
 							}
@@ -395,14 +399,14 @@
 						return;
 					}
 				}
-				let chinaCarNoSuff = this.form.chinaCarNoSuff;
-				if (!chinaCarNoSuff) {
+				let chinaCarSuff = this.form.chinaCarSuff;
+				if (!chinaCarSuff) {
 					this.$common.toast('请填写运输车辆车尾牌');
 					return;
 				}
-				let suffArray = chinaCarNoSuff.replace(",", ",").split(",");
+				let suffArray = chinaCarSuff.replace(",", ",").split(",");
 				for (let i in suffArray) {
-					noArray[i]=noArray[i].toUpperCase();
+					suffArray[i]=suffArray[i].toUpperCase();
 					if (!this.$common.isCarNo(suffArray[i])) {
 						this.$common.toast('运输车尾牌不正确');
 						return;
@@ -455,8 +459,8 @@
 					return;
 				}
 				this.$api.addDeclare(this.$common.removeNull(this.form)).then(resp => {
-					this.addStoreCount();
 					if (resp.code == 200) {
+						this.addStoreCount();
 						this.$common.to('/pages/declare/addDeclareSuccess')
 					}
 				})

+ 4 - 2
app/pages/disinfect/addDisinfect.vue

@@ -286,8 +286,10 @@
 					return;
 				}
 				this.$api.addDisinfect(this.$common.removeNull(this.form)).then(resp => {
-					this.addStoreCount();
-					this.$common.to('/pages/disinfect/addDisinfectSuccess')
+					if(resp.code==200){
+						this.addStoreCount();
+						this.$common.to('/pages/disinfect/addDisinfectSuccess')
+					}
 				})
 			},
 			check(){

+ 0 - 1
app/pages/login/login.vue

@@ -68,7 +68,6 @@
 			},
 			verifyResult(res) {
 				this.sliderVerifyFLag = false;
-				
 				if (res) {  //校验通过
 					this.loginFn()
 				}else{

+ 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 = 'http://47.101.143.145/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-server/app.pid

@@ -1 +1 @@
-30980
+28988

+ 5 - 5
sp-server/src/main/java/com/pj/api/service/ApiService.java

@@ -144,8 +144,8 @@ public class ApiService {
     }
 
     public void addDeclare(TbDeclare tbDeclare) {
-        String currentCustomerId = StpUserUtil.getCustomerId();
-        if(!StrUtil.isEmpty(currentCustomerId)){
+        if (StpUserUtil.isLogin()) {
+            String currentCustomerId = StpUserUtil.getCustomerId();
             tbDeclare.setCustomerId(currentCustomerId);
         }
         String chinaCarNo = tbDeclare.getChinaCarNo();
@@ -165,8 +165,8 @@ public class ApiService {
     }
 
     public void addDisinfect(TbDisinfect tbDisinfect) {
-        String currentCustomerId = StpUserUtil.getCustomerId();
-        if(!StrUtil.isEmpty(currentCustomerId)){
+        if (StpUserUtil.isLogin()) {
+            String currentCustomerId = StpUserUtil.getCustomerId();
             tbDisinfect.setCustomerId(currentCustomerId);
         }
         String nowStr = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"));
@@ -214,7 +214,7 @@ public class ApiService {
         TbBusiness tbBusiness = tbBusinessService.getById(tbBusinessItem.getBusinessId());
         MsgDataBO msgDataBO = new MsgDataBO("订单号:" + tbBusinessItem.getNo(), tbCostomer.getName(), DateUtil.now(), tbBusiness.getGoodsName() + "(" + tbBusinessItem.getItemTypeName() + tbBusinessItem.getItemName() + ")");
         spAdminList.stream().filter(admin -> StrUtil.isNotEmpty(admin.getOpenid())).forEach(admin -> {
-            String detailUrl = myConfig.getWebDomain() + "/pages/business-order/business-item?id=" + tbBusiness.getId() +"&itemId="+tbBusinessItem.getId()+ "&openid=" + openid;
+            String detailUrl = myConfig.getWebDomain() + "/pages/business-order/business-item?id=" + tbBusiness.getId() + "&itemId=" + tbBusinessItem.getId() + "&openid=" + openid;
             log.info("admin confirm business:[{}]", detailUrl);
             wxService.sendTemplateMsg(wxConfig.getBusinessPickTemplate(), admin.getOpenid(), msgDataBO, detailUrl);
         });

+ 1 - 0
sp-server/src/main/java/com/pj/project/tb_business_item/PayTask.java

@@ -38,6 +38,7 @@ public class PayTask extends Task {
 
     @Override
     public void run() {
+        StaticLog.info("開始執行扣款任務:{},{}",customerId,businessId);
         TbAccountService tbAccountService = SpringUtil.getBean(TbAccountService.class);
         TbAccount tbAccount = tbAccountService.getByCustomerId(customerId);
         if (tbAccount == null) {

+ 2 - 1
sp-server/src/main/java/com/pj/project/tb_costomer/TbCostomerController.java

@@ -2,6 +2,7 @@ package com.pj.project.tb_costomer;
 
 import java.util.List;
 
+import cn.dev33.satoken.annotation.SaMode;
 import cn.hutool.core.util.StrUtil;
 import com.pj.constants.UserTypeEnum;
 import com.pj.utils.so.SoMap;
@@ -56,7 +57,7 @@ public class TbCostomerController {
 	
 	/** 改 */  
 	@RequestMapping("update")
-	@SaCheckPermission(TbCostomer.PERMISSION_CODE)
+	@SaCheckPermission(value = {TbCostomer.PERMISSION_CODE,TbCostomer.PERMISSION_INFO},mode = SaMode.OR)
 	public AjaxJson update(TbCostomer t){
 		int line = tbCostomerService.update(t);
 		return AjaxJson.getByLine(line);