Browse Source

首页统计+单量车和多辆车限制

qzyReal 2 years ago
parent
commit
2a0d534d5f

+ 3 - 2
app/pages/onely-disinfect/type-business-edit.vue

@@ -47,7 +47,7 @@
 					<u-col span=4>车辆</u-col>
 					<u-col span=8>
 						<u-button type="primary" text="添加" @click="addCar" icon="plus"
-							style="width: 60px;height: 26px;" />
+							style="width: 60px;height: 26px;"  v-if="goods.mulCar==1||car.list.length==0"/>
 					</u-col>
 				</u-row>
 			</view>
@@ -123,7 +123,8 @@
 				},
 				goods: {
 					id: '',
-					name: ''
+					name: '',
+					mulCar:0
 				},
 				typeList: [],
 				allTypeList: [],

+ 3 - 2
app/pages/onely-disinfect/type-business.vue

@@ -47,7 +47,7 @@
 					<u-col span=4>车辆</u-col>
 					<u-col span=8>
 						<u-button type="primary" text="添加" @click="addCar" icon="plus"
-							style="width: 60px;height: 26px;" />
+							style="width: 60px;height: 26px;"  v-if="goods.mulCar==1||car.list.length==0"/>
 					</u-col>
 				</u-row>
 			</view>
@@ -122,7 +122,8 @@
 				},
 				goods: {
 					id: '',
-					name: ''
+					name: '',
+					mulCar:0
 				},
 				typeList: [],
 				allTypeList: [],

+ 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 - 15
sp-admin/sa-frame/menu-list.js

@@ -1,18 +1,4 @@
-// 一个菜单可以包括的所有属性 
-// {
-// 	id: '12345',		// 菜单id, 必须唯一
-// 	name: '用户中心',		// 菜单名称, 同时也是tab选项卡上显示的名称
-// 	icon: 'el-icon-user',	// 菜单图标, 参考地址:  https://element.eleme.cn/#/zh-CN/component/icon
-//	info: '管理所有用户',	// 菜单介绍, 在菜单预览和分配权限时会有显示 
-// 	url: 'sa-html/user/user-list.html',	// 菜单指向地址
-// 	parentId: 1,			// 所属父菜单id, 如果指定了一个值, sa-admin在初始化时会将此菜单转移到指定菜单上 
-// 	isShow: true,			// 是否显示, 默认true
-// 	isBlank: false,		// 是否属于外部链接, 如果为true, 则点击菜单时从新窗口打开 
-// 	childList: [			// 指定这个菜单所有的子菜单, 子菜单可以继续指定子菜单, 至多支持三级菜单
-// 		// .... 
-// 	],
-//	click: function(){}		// 点击菜单执行一个函数 
-// }
+
 
 // 定义菜单列表 
 var menuList = [{

+ 19 - 10
sp-admin/sa-view-sp/console/com-sta-data.vue

@@ -5,8 +5,8 @@
 			<div class="sa-wnk">
 				<img src="../../static/icon/icon-total.png" >
 				<div class="sa-wnk-tv">
-					<p class="sa-wnk-title">车辆</p>
-					<p class="sa-wnk-value">{{car.totalCar}}</p>
+					<p class="sa-wnk-title">今日入场车辆</p>
+					<p class="sa-wnk-value">{{car.todayInCar}}</p>
 				</div>
 			</div>
 		</el-col>
@@ -14,7 +14,7 @@
 			<div class="sa-wnk">
 				<img src="../../static/icon/icon-car-leave.png" >
 				<div class="sa-wnk-tv">
-					<p class="sa-wnk-title">离场车辆</p>
+					<p class="sa-wnk-title">今日离场车辆</p>
 					<p class="sa-wnk-value">{{car.outCar}}</p>
 				</div>
 			</div>
@@ -23,7 +23,7 @@
 			<div class="sa-wnk">
 				<img src="../../static/icon/icon-car-in.png" >
 				<div class="sa-wnk-tv">
-					<p class="sa-wnk-title">在场车辆</p>
+					<p class="sa-wnk-title">当前未出车辆</p>
 					<p class="sa-wnk-value">{{car.inCar}}</p>
 				</div>
 			</div>
@@ -32,7 +32,7 @@
 			<div class="sa-wnk">
 				<img src="../../static/icon/icon-car-weight.png" >
 				<div class="sa-wnk-tv">
-					<p class="sa-wnk-title">重车</p>
+					<p class="sa-wnk-title">当前未出重车</p>
 					<p class="sa-wnk-value">{{car.weightCar}}</p>
 				</div>
 			</div>
@@ -41,7 +41,7 @@
 			<div class="sa-wnk">
 				<img src="../../static/icon/icon-car-empty.png" >
 				<div class="sa-wnk-tv">
-					<p class="sa-wnk-title">空车</p>
+					<p class="sa-wnk-title">当前未出空车</p>
 					<p class="sa-wnk-value">{{car.emptyCar}}</p>
 				</div>
 			</div>
@@ -56,25 +56,34 @@
 			return {
 				// 统计数据 
 				car:{
-					totalCar:0,
+					todayInCar:0,
 					inCar:0,
 					outCar:0,
 					weightCar:0,
 					emptyCar:0
-				}
+				},
+				timmer:null
 			}
 		},
 		methods: {
 			getCarStatics(){
-				sa.ajax('/TbBusinessCar/staticsCar',function(resp){
+				sa.ajaxNoLoading('/TbBusinessCar/staticsCar',function(resp){
 					this.car=resp.data;
 				}.bind(this))
 			},
 		
 		},
 		created() {
-			this.getCarStatics();
+			this.timmer = setInterval(() => {
+				this.getCarStatics();
+			}, 20000)
+		},
+		beforeDestroy() {
+			if (this.timmer != null) {
+				clearInterval(this.timmer);
+			}
 		}
+		
 	}
 </script>
 

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

@@ -124,7 +124,7 @@
 								<div slot="header" class="clearfix">
 									<span>车辆</span>
 									<el-button style="float: right;" icon="el-icon-plus" type="primary"
-										@click="showAddModal">添加
+										@click="showAddModal" v-if="goods.mulCar==1||car.list.length==0">添加
 									</el-button>
 								</div>
 								<el-table :data="car.list">
@@ -337,6 +337,7 @@
 						needOperateTime: 1,
 						chinaCarPay: 1,
 						vietnamCarPay: 1,
+						mulCar:0,
 					},
 					carTypeList: []
 				},

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

@@ -119,8 +119,9 @@
                     <el-card class="box-card">
                         <div slot="header" class="clearfix">
                             <span>车辆</span>
-                            <el-button style="float: right;" icon="el-icon-plus" type="primary"
-                                       @click="showAddModal">添加
+                            <el-button style="float: right;" 
+							icon="el-icon-plus" type="primary"
+                                       @click="showAddModal" v-if="goods.mulCar==1||car.list.length==0">添加
                             </el-button>
                         </div>
                         <el-table :data="car.list">
@@ -331,6 +332,7 @@
                 needCarSize: 1,
                 needDeclare: 1,
                 needOperateTime: 1,
+				mulCar:0
             },
             carTypeList: [],
             intiItems: []

+ 37 - 26
sp-admin/sa-view/tb-goods/tb-goods-list.html

@@ -38,12 +38,14 @@
 						@change="s => updateNeedWeight(s.row)" width="90"></sa-td>
 					<sa-td name="规格" prop="needCarSize" type="switch" :jv="{0: '选填[#005500]', 1: '必填[#ff0000]'}"
 						@change="s => updateNeedCarSize(s.row)" width="90"></sa-td>
+					<sa-td name="车辆" prop="mulCar" type="switch" :jv="{0: '单辆[#005500]', 1: '多辆[#ff0000]'}"
+						@change="s => updateMulCar(s.row)" width="90"></sa-td>
 					<sa-td name="申报单" prop="needDeclare" type="switch" :jv="{0: '选填[#005500]', 1: '必填[#ff0000]'}"
 						@change="s => updateNeedDeclare(s.row)" width="90"></sa-td>
-						<sa-td name="客户" prop="needCustomer" type="switch" :jv="{0: '选填[#005500]', 1: '必填[#ff0000]'}"
-							@change="s => updateNeedCustomer(s.row)" width="90"></sa-td>
-						<sa-td name="货主" prop="needOwner" type="switch" :jv="{0: '选填[#005500]', 1: '必填[#ff0000]'}"
-							@change="s => updateNeedOwner(s.row)" width="90"></sa-td>
+					<sa-td name="客户" prop="needCustomer" type="switch" :jv="{0: '选填[#005500]', 1: '必填[#ff0000]'}"
+						@change="s => updateNeedCustomer(s.row)" width="90"></sa-td>
+					<sa-td name="货主" prop="needOwner" type="switch" :jv="{0: '选填[#005500]', 1: '必填[#ff0000]'}"
+						@change="s => updateNeedOwner(s.row)" width="90"></sa-td>
 					<sa-td name="作业时间" prop="needOperateTime" type="switch" :jv="{0: '选填[#005500]', 1: '必填[#ff0000]'}"
 						@change="s => updateNeedOperateTime(s.row)" width="90"></sa-td>
 					<sa-td name="空车" prop="chinaCarPay" type="switch" :jv="{0: '免停车费[#005500]', 1: '收停车费[#ff0000]'}"
@@ -125,39 +127,48 @@
 						}.bind(this));
 					},
 					chinaLeaveChange(v) {
-						let obj={
-							id:v.id,
-							chinaCarLeave:v.chinaCarLeave
+						let obj = {
+							id: v.id,
+							chinaCarLeave: v.chinaCarLeave
 						}
-						sa.ajax('/TbGoods/chinaLeaveChange',obj,function(resp){
-							
+						sa.ajax('/TbGoods/chinaLeaveChange', obj, function(resp) {
+
 						}.bind(this))
 					},
 					vietnamLeaveChange(v) {
-						let obj={
-							id:v.id,
-							vietnamCarLeave:v.vietnamCarLeave
+						let obj = {
+							id: v.id,
+							vietnamCarLeave: v.vietnamCarLeave
+						}
+						sa.ajax('/TbGoods/vietnamLeaveChange', obj, function(resp) {
+
+						}.bind(this))
+					},
+					updateMulCar(data){
+						let obj = {
+							id: data.id,
+							mulCar: data.mulCar
 						}
-						sa.ajax('/TbGoods/vietnamLeaveChange',obj,function(resp){
-							
+						sa.ajax('/TbGoods/updateMulCar', obj, function(resp) {
+						
 						}.bind(this))
 					},
-					updateNeedOwner(v){
-						let obj={
-							id:v.id,
-							value:v.needOwner
+					updateNeedOwner(v) {
+						let obj = {
+							id: v.id,
+							value: v.needOwner
 						}
-						sa.ajax('/TbGoods/updateNeedOwner',obj,function(resp){
-							
+						sa.ajax('/TbGoods/updateNeedOwner', obj, function(resp) {
+
 						}.bind(this))
 					},
-					updateNeedCustomer(v){
-						let obj={
-							id:v.id,
-							value:v.needCustomer
+					updateNeedCustomer(v) {
+						let obj = {
+							id: v.id,
+							value: v.needCustomer
 						}
-						sa.ajax('/TbGoods/updateNeedCustomer',obj,function(resp){
-							
+						sa.ajax('/TbGoods/updateNeedCustomer', obj, function(resp) {
+
 						}.bind(this))
 					},
 					// 查看

+ 2 - 2
sp-server/src/main/java/com/pj/project/tb_business_car/TbBusinessCarMapper.xml

@@ -166,9 +166,9 @@
     </select>
     <select id="staticsCar" resultType="com.pj.project.tb_business_car.statics.CarStatics">
         SELECT
-            SUM(CASE  WHEN   real_in_time is not null THEN 1 ELSE 0 END ) as totalCar,
+            SUM(CASE  WHEN  DATE_FORMAT(real_in_time,'%Y-%m-%d')= DATE_FORMAT(NOW(),'%Y-%m-%d') THEN 1 ELSE 0 END ) as todayInCar,
 
-            SUM(CASE  WHEN   real_out_time is not null and real_in_time is not null THEN 1 ELSE 0 END ) as outCar,
+            SUM(CASE  WHEN   DATE_FORMAT(real_out_time,'%Y-%m-%d')= DATE_FORMAT(NOW(),'%Y-%m-%d') and real_in_time is not null THEN 1 ELSE 0 END ) as outCar,
 
             SUM(CASE  WHEN   real_out_time is null and real_in_time is not null THEN 1 ELSE 0 END ) as inCar,
 

+ 1 - 0
sp-server/src/main/java/com/pj/project/tb_business_car/statics/CarStatics.java

@@ -6,6 +6,7 @@ import java.io.Serializable;
 
 @Data
 public class CarStatics implements Serializable {
+    private Integer todayInCar;
     private Integer totalCar;
     private Integer inCar;
     private Integer outCar;

+ 1 - 0
sp-server/src/main/java/com/pj/project/tb_goods/TbGoods.java

@@ -95,6 +95,7 @@ public class TbGoods extends Model<TbGoods> implements Serializable {
 	private Integer vietnamCarLeave=1;
 	private Integer needOwner=1;
 	private Integer needCustomer=1;
+	private Integer mulCar=1;
 
 
 

+ 6 - 0
sp-server/src/main/java/com/pj/project/tb_goods/TbGoodsController.java

@@ -208,6 +208,12 @@ public class TbGoodsController {
         int line = SP.publicMapper.updateColumnById(TbGoods.TABLE_NAME, "vietnam_car_leave", vietnamCarLeave, id);
         return AjaxJson.getByLine(line);
     }
+    @RequestMapping("updateMulCar")
+    @SaCheckPermission(TbGoods.PERMISSION_CODE_EDIT)
+    public AjaxJson updateMulCar(Long id, String mulCar) {
+        int line = SP.publicMapper.updateColumnById(TbGoods.TABLE_NAME, "mul_car", mulCar, id);
+        return AjaxJson.getByLine(line);
+    }
 
 
     @RequestMapping("getPayStep")