qzyReal 2 éve
szülő
commit
5e01a11d44

+ 1 - 1
app/manifest.json

@@ -85,7 +85,7 @@
     "vueVersion" : "2",
     "h5" : {
         "router" : {
-            "base" : "/test/",
+            "base" : "/h5/",
             "mode" : "history"
         },
         "devServer" : {

+ 18 - 9
app/pages/onely-disinfect/type-business-edit.vue

@@ -12,7 +12,7 @@
 					</u-input>
 				</view>
 			</view>
-			<view class="item">
+			<view class="item"  v-if="goods.needCustomer==1">
 				<view class="l">客户:</view>
 				<view class="r" style="flex: 12;">
 					<picker :disabled="goods.needDeclare==1" v-if="customer.customerList.length>0" class="p-picker"
@@ -57,7 +57,7 @@
 					<u-input placeholder="车辆" v-model="car.carNo" readonly>
 						<view slot="suffix" style="display: flex;">
 							<u-icon @click="editCar(car)" size="20" name="edit-pen-fill" color="blue"></u-icon>
-							<u-icon style="margin-left:15rpx;" size="20" @click="delCar(car)" name="close-circle-fill"
+							<u-icon style="margin-left:20rpx;" size="20" @click="delCar(car)" name="close-circle-fill"
 								color="red"></u-icon>
 						</view>
 					</u-input>
@@ -165,8 +165,7 @@
 			let id = options.id;
 			this.form.id = id;
 			this.customerId = uni.getStorageSync('customerId');
-			this.goods = JSON.parse(options.goodsJson);
-			
+			this.goods = JSON.parse(options.goodsJson);			
 			this.getOtherBusinessById();
 			let that = this;
 			uni.$on('getSelectDeclare', declare => {
@@ -192,6 +191,7 @@
 		},
 		methods: {
 			remarkFn(type){
+				console.log(type)
 				let remark=type.remark?type.remark:'';
 				this.$common.to('/pages/onely-disinfect/add-remark?needRemark='+type.needRemark+'&typeId='+type.id+'&remark='+remark)
 			},
@@ -299,11 +299,13 @@
 							if (type.id == item.itemTypeId) {
 								type.items.filter(obj => obj.id == item.itemId)
 									.forEach(obj => {
+										console.log(obj)
 										type.num = item.num;
 										type.price = item.itemPrice;
 										type.itemName = item.itemName;
 										type.itemId = item.itemId;
 										type.inc = obj.inc;
+										type.remark=item.remark;
 									})
 
 
@@ -415,6 +417,8 @@
 				let form = this.form;
 				let goods = this.goods;
 				let needDeclare = goods.needDeclare;
+				let needCustomer=goods.needCustomer;
+				let index = this.customer.index;
 				if (needDeclare == 1 && !form.declareNo) {
 					this.$common.toast('请选择申报单');
 					return false;
@@ -479,11 +483,16 @@
 				this.form.carJson = JSON.stringify(this.car.list);
 				this.form.items = null;
 				this.form.cars = null;
-				let customerList = this.customer.customerList;
-				let index = this.customer.index;
-				let customer = customerList[index];
-				this.form.customerId = customer.id;
-				this.form.customerName = customer.name;
+				if(needCustomer==1){
+					let customerList = this.customer.customerList;
+					let index = this.customer.index;
+					let customer = customerList[index];
+					this.form.customerId = customer.id;
+					this.form.customerName = customer.name;
+				}else{
+					this.form.customerId='';
+					this.form.customerName ='';
+				}
 				this.form.goodsId = this.goods.id;
 				this.form.goodsName = this.goods.name;
 				let chinaCarNo = carList

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

@@ -45,7 +45,7 @@
 				<view class="item" v-if="item.realOutTime">
 					<view class="l" >离场时间:</view>
 					<view class="r">
-						{{item.realOutTime}} (米)
+						{{item.realOutTime}}
 					</view>
 				</view>
 				<view class="item" v-if="item.operator">

+ 15 - 8
app/pages/onely-disinfect/type-business.vue

@@ -12,7 +12,7 @@
 					</u-input>
 				</view>
 			</view>
-			<view class="item">
+			<view class="item" v-if="goods.needCustomer==1">
 				<view class="l">客户:</view>
 				<view class="r" style="flex: 12;">
 					<picker :disabled="goods.needDeclare==1" v-if="customer.customerList.length>0" class="p-picker"
@@ -57,7 +57,7 @@
 					<u-input placeholder="车辆" v-model="car.carNo" readonly>
 						<view slot="suffix" style="display: flex;">
 							<u-icon @click="editCar(car)" size="20" name="edit-pen-fill" color="blue"></u-icon>
-							<u-icon style="margin-left:15rpx;" size="20" @click="delCar(car)" name="close-circle-fill"
+							<u-icon style="margin-left:20rpx;" size="20" @click="delCar(car)" name="close-circle-fill"
 								color="red"></u-icon>
 						</view>
 					</u-input>
@@ -118,7 +118,7 @@
 				columns: [],
 				customerId: '1',
 				customer: {
-					index: -1,
+					index: 0,
 					customerList: [],
 				},
 				goods: {
@@ -382,6 +382,8 @@
 				let form = this.form;
 				let goods = this.goods;
 				let needDeclare = goods.needDeclare;
+				let needCustomer=goods.needCustomer;
+				let index = this.customer.index;
 				if (needDeclare == 1 && !form.declareNo) {
 					this.$common.toast('请选择申报单');
 					return false;
@@ -445,11 +447,16 @@
 				this.form.itemJson = JSON.stringify(selectList);
 				this.form.carJson = JSON.stringify(this.car.list);
 				this.form.items = null;
-				let customerList = this.customer.customerList;
-				let index = this.customer.index;
-				let customer = customerList[index];
-				this.form.customerId = customer.id;
-				this.form.customerName = customer.name;
+				if(needCustomer==1){
+					let customerList = this.customer.customerList;
+					let index = this.customer.index;
+					let customer = customerList[index];
+					this.form.customerId = customer.id;
+					this.form.customerName = customer.name;
+				}else{
+					this.form.customerId='';
+					this.form.customerName ='';
+				}
 				this.form.goodsId = this.goods.id;
 				this.form.goodsName = this.goods.name;
 				let chinaCarNo = carList

+ 2 - 2
app/utils/request.js

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

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

@@ -84,7 +84,7 @@
 											</div>
 										</el-col>
 										<el-col span=8>
-											<div class="c-item">
+											<div class="c-item" v-if="goods.needCustomer">
 												<label class="c-label"><span style="color: red;">*</span>客户:</label>
 												<el-select
 													:disabled="goods.needDeclare||m.declareNo"
@@ -625,11 +625,16 @@
 					// 提交数据 
 					ok: function() {
 						let goods = this.goods;
+						let needCustomer=goods.needCustomer;
 						let m = this.m;
 						if (goods.needDeclare == 1 && !m.declareNo) {
 							sa.error('请选择申报单');
 							return false;
 						}
+						if (needCustomer == 1 && !m.customerId) {
+							sa.error('请选择客户');
+							return false;
+						}
 						if (goods.needOperateTime == 1 && !m.operateTime) {
 							sa.error('请选择作业时间');
 							return false;
@@ -676,6 +681,9 @@
 								selectList.push(obj);
 							}
 						}
+						if (needCustomer != 1) {
+							m.customerId='';
+						}
 						m.itemJson = JSON.stringify(selectList);
 						m.carJson = JSON.stringify(carList);
 						let chinaCarNo = carList

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

@@ -80,7 +80,7 @@
 											</div>
 										</el-col>
 										<el-col span=8>
-											<div class="c-item">
+											<div class="c-item" v-if="goods.needCustomer">
 												<label class="c-label"><span style="color: red;">*</span>客户:</label>
 												<el-select
 													:disabled="goods.needDeclare||m.declareNo||currentCustomerId!='1'"

+ 11 - 0
sp-admin/sa-view/tb-goods/tb-goods-list.html

@@ -40,6 +40,8 @@
 						@change="s => updateNeedCarSize(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="needOperateTime" type="switch" :jv="{0: '选填[#005500]', 1: '必填[#ff0000]'}"
@@ -149,6 +151,15 @@
 							
 						}.bind(this))
 					},
+					updateNeedCustomer(v){
+						let obj={
+							id:v.id,
+							value:v.needCustomer
+						}
+						sa.ajax('/TbGoods/updateNeedCustomer',obj,function(resp){
+							
+						}.bind(this))
+					},
 					// 查看
 					get: function(data) {
 						sa.showIframe('数据详情', 'tb-goods-info.html?id=' + data.id, '1050px', '90%');

+ 1 - 1
sp-server/src/main/java/com/pj/project/relation_goods_type/RelationGoodsTypeService.java

@@ -55,7 +55,7 @@ public class RelationGoodsTypeService extends ServiceImpl<RelationGoodsTypeMappe
 
     public List<RelationGoodsType> findByGoodsId(String goodsId) {
         QueryWrapper<RelationGoodsType> ew = new QueryWrapper<>();
-        ew.eq("goods_id", goodsId);
+        ew.eq("goods_id", goodsId).orderByDesc("need_select");
         return list(ew);
     }
 

+ 1 - 2
sp-server/src/main/java/com/pj/project/tb_business/TbBusinessService.java

@@ -898,8 +898,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
                 .setOperator(otherBusinessBO.getOperator()).setOperateTime(otherBusinessBO.getOperateTime())
                 .setNo(no).setGoodsId(otherBusinessBO.getGoodsId()).setOwner(otherBusinessBO.getOwner())
                 .setDeclareNo(declareNo).setCardNo(otherBusinessBO.getCardNo());
-        dbBusiness.setBusinessType(TbBusiness.BusinessType.CAR_DISINCLE.getCode())
-                .setItemPrice(price).setTotalMoney(price);
+        dbBusiness.setItemPrice(price).setTotalMoney(price);
         dbBusiness.setChinaCarNo(otherBusinessBO.getChinaCarNo());
         this.updateById(dbBusiness);
     }

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

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

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

@@ -184,6 +184,15 @@ public class TbGoodsController {
     /**
      * 改 - 申报时间是否必填(1=是,0=否)
      */
+    @RequestMapping("updateNeedCustomer")
+    @SaCheckPermission(TbGoods.PERMISSION_CODE_EDIT)
+    public AjaxJson updateNeedCustomer(Long id, String value) {
+        int line = SP.publicMapper.updateColumnById(TbGoods.TABLE_NAME, "need_customer", value, id);
+        return AjaxJson.getByLine(line);
+    }
+    /**
+     * 改 - 申报时间是否必填(1=是,0=否)
+     */
     @RequestMapping("chinaLeaveChange")
     @SaCheckPermission(TbGoods.PERMISSION_CODE_EDIT)
     public AjaxJson chinaLeaveChange(Long id, String chinaCarLeave) {