qzyReal 3 jaren geleden
bovenliggende
commit
6aecfcc7c8

+ 4 - 2
app/apis/api.js

@@ -5,7 +5,9 @@ export default {
 	doLogin(data) {
 		return ajax.postForm('/api/doLogin', data)
 	},
-
+	doLoginByOpenid(data) {
+		return ajax.postForm('/api/doLoginByOpenid', data)
+	},
 	register(data) {
 		return ajax.postForm('/api/register', data)
 	},
@@ -157,7 +159,7 @@ export default {
 	getPartnerBusinessItem(data) {
 		return ajax.get('/api/getPartnerBusinessItem', data)
 	},
-	checkUserType(){
+	checkUserType() {
 		return ajax.get('/api/checkUserType')
 	}
 }

+ 31 - 8
app/pages/business-order/business-item.vue

@@ -48,7 +48,7 @@
 					</view>
 				</view>
 				<view class="c" v-if="businessItem.pick==1">
-					<view class="item" >
+					<view class="item">
 						<text class="p1">确认状态:</text>
 						<text class="p2">
 							<text v-if="businessItem.confirm==1">已确认</text>
@@ -57,7 +57,7 @@
 					</view>
 				</view>
 				<view class="c" v-if="businessItem.confirm==1">
-					<view class="item" >
+					<view class="item">
 						<text class="p1">确认时间:</text>
 						<text class="p2">
 							<text>{{businessItem.confirmTime}}</text>
@@ -65,7 +65,7 @@
 					</view>
 				</view>
 				<view class="b" v-if="customerId!='1'&&businessItem.pick==1&&businessItem.confirm!=1">
-					<view class="btn b3"  @click="pickFn(businessItem.id)">
+					<view class="btn b3" @click="pickFn(businessItem.id)">
 						确认</view>
 				</view>
 			</view>
@@ -78,13 +78,16 @@
 	export default {
 		data() {
 			return {
-				customerId:'',
+				customerId: '',
+				openid: '',
 				form: {},
-				items:[],
+				items: [],
 			}
 		},
 		onLoad(options) {
 			this.form.id = options.id;
+			this.openid = options.openid;
+			this.checkLogin();
 		},
 		onShow() {
 			this.customerId = uni.getStorageSync('customerId')
@@ -95,12 +98,30 @@
 			return true;
 		},
 		methods: {
+			checkLogin() {
+				let token = uni.getStorageSync('token');
+				if (this.openid && !token) {
+					this.$api.doLoginByOpenid({
+						openid: this.openid
+					}).then(resp => {
+						let data = resp.data;
+						if (data.tokenInfo) {
+							uni.setStorageSync('token', data.tokenInfo.tokenValue);
+							uni.setStorageSync('customerId', data.admin.customerId)
+							uni.setStorageSync('info', data.admin)
+							uni.setStorageSync('perList', data.per_list)
+						} else {
+							this.$common.toast(resp.msg);
+						}
+					})
+				}
+			},
 			getBusinessById() {
 				this.$api.getBusinessById({
 					id: this.form.id
 				}).then(resp => {
-					let data=resp.data;
-					this.items = resp.data.items.filter(obj=>obj.businessType!==0);
+					let data = resp.data;
+					this.items = resp.data.items.filter(obj => obj.businessType !== 0);
 				})
 			},
 			pickFn(id) {
@@ -116,7 +137,9 @@
 				})
 			},
 			surePick(id) {
-				this.$api.confirmBusinessItem({id: id}).then(resp => {
+				this.$api.confirmBusinessItem({
+					id: id
+				}).then(resp => {
 					if (resp.code == 200) {
 						this.$common.toast('已确认');
 						this.getBusinessById();

+ 1 - 1
app/pages/business-order/business-order.vue

@@ -49,7 +49,7 @@
 					</view>
 				</view>
 				<view class="b">
-					<view class="btn b3" @click="businessFn(businessItem)">
+					<view class="btn b3" v-if="customemrId=='1'" @click="businessFn(businessItem)">
 						业务项</view>
 					<view class="btn b3" v-if="businessItem.payStatus==1
 								&&perList.indexOf('tb-business-confirm')!=-1

+ 2 - 2
sp-admin/sa-frame/menu-list.js

@@ -37,11 +37,11 @@ var menuList =	[
 	},
 	{
 		id: 'tb-business-item',
-		name: '业管理',
+		name: '业管理',
 		icon: 'el-icon-edit-outline',
 		info: '业务订单',
 		childList: [
-			{id: 'tb-business-item-list', name: '业订单', url: 'sa-view/tb-partner/tb-business-item-list.html'},
+			{id: 'tb-business-item-list', name: '业订单', url: 'sa-view/tb-partner/tb-business-item-list.html'},
 		]
 	},
 	{

+ 9 - 3
sp-admin/sa-view/tb-partner/tb-business-item-list.html

@@ -31,8 +31,11 @@
 				<!-- ------------- 数据列表 ------------- -->
 				<el-table class="data-table" ref="data-table" :data="dataList">
 					<sa-td name="单号" prop="no" width="160"></sa-td>
+					<sa-td name="货物" prop="goodsName"></sa-td>
+					<sa-td name="越南车" prop="cardNo"></sa-td>
+					<sa-td name="中国车" prop="chinaCarNo"></sa-td>
 					<sa-td name="作业公司" prop="pickCustomerName"></sa-td>
-						<sa-td name="项目" prop="itemName"></sa-td>
+					<sa-td name="项目" prop="itemName"></sa-td>
 					<sa-td name="类型" prop="itemTypeName"></sa-td>
 					<sa-td name="计费标准" prop="unit">
 						<template slot-scope="s">
@@ -46,7 +49,8 @@
 					<sa-td name="确认时间" prop="confirmTime" width="160"></sa-td>
 					<el-table-column label="操作" fixed="right" width="200px" v-if="currentCustomerId=='1'">
 						<template slot-scope="s">
-							<el-button v-if="s.row.pickTime&&!s.row.confirmTime" class="c-btn" type="success" icon="el-icon-edit" @click="confirmFn(s.row)">确认
+							<el-button v-if="s.row.pickTime&&!s.row.confirmTime" class="c-btn" type="success"
+								icon="el-icon-edit" @click="confirmFn(s.row)">确认
 							</el-button>
 						</template>
 					</el-table-column>
@@ -98,7 +102,9 @@
 						})
 					},
 					sureConfirm() {
-						sa.ajax('/TbBusinessItem/confirm',{id:this.confirm.form.id}, function(resp) {
+						sa.ajax('/TbBusinessItem/confirm', {
+							id: this.confirm.form.id
+						}, function(resp) {
 							this.confirm.visible = false;
 							this.f5();
 						}.bind(this));

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

@@ -22,7 +22,7 @@ var sa = {
 		api_url: 'https://dxkaa1.bgigc.com/pro',
 		web_url: 'http://www.baidu.com'
 	}
-	sa.cfg = cfg_prod; // 最终环境 , 上线前请选择正确的环境
+	sa.cfg = cfg_dev; // 最终环境 , 上线前请选择正确的环境
 })();
 
 

+ 1 - 1
sp-server/app.pid

@@ -1 +1 @@
-45144
+45152

+ 7 - 0
sp-server/src/main/java/com/pj/project/tb_business_item/TbBusinessItem.java

@@ -102,6 +102,13 @@ public class TbBusinessItem extends Model<TbBusinessItem> implements Serializabl
 	private String businessType;
 	private String no;
 
+	@TableField(exist = false)
+	private String goodsName;
+	@TableField(exist = false)
+	private String cardNo;
+	@TableField(exist = false)
+	private String chinaCarNo;
+
 
 
 

+ 27 - 28
sp-server/src/main/java/com/pj/project/tb_business_item/TbBusinessItemMapper.xml

@@ -43,44 +43,43 @@
 	
 	<!-- 公共查询sql片段 -->
 	<sql id="select_sql">
-		select *
-		from tb_business_item 
+		select a.*,b.goods_name,b.card_no,b.china_car_no
+		from tb_business_item a,tb_business b where a.business_id=b.id
 	</sql>
 	
 	<!-- 查 - 根据id -->
 	<select id="getById" resultMap="model">
-		<include refid="select_sql"></include>
+		select * from tb_busness
 		where id = #{id}
 	</select>
 	
 	<!-- 查集合 - 根据条件(参数为空时代表忽略指定条件) [G] -->
-	<select id="getList" resultMap="model">
-		<include refid="select_sql"></include>
-		<where>
-			<if test=' this.has("id") '> and id = #{id} </if>
-			<if test=' this.has("businessId") '> and business_id = #{businessId} </if>
-			<if test=' this.has("pickCustomerId") '> and pick_customer_id = #{pickCustomerId} </if>
-			<if test=' this.has("itemCode") '> and item_code = #{itemCode} </if>
-			<if test=' this.has("itemPrice") '> and item_price = #{itemPrice} </if>
-			<if test=' this.has("itemName") '> and item_name like concat('%',#{itemName},'%') </if>
-			<if test=' this.has("status") '> and status = #{status} </if>
-			<if test=' this.has("operateTime") '> and operate_time = #{operateTime} </if>
-			<if test=' this.has("operaror") '> and operaror = #{operaror} </if>
-			<if test=' this.has("typeFlag") '> and business_type !='0' </if>
-		</where>
+	<select id="getList" resultType="com.pj.project.tb_business_item.TbBusinessItem">
+		select a.*,b.goods_name,b.card_no,b.china_car_no
+		from tb_business_item a,tb_business b where a.business_id=b.id
+			<if test=' this.has("id") '> and a.id = #{id} </if>
+			<if test=' this.has("businessId") '> and a.business_id = #{businessId} </if>
+			<if test=' this.has("pickCustomerId") '> and a.pick_customer_id = #{pickCustomerId} </if>
+			<if test=' this.has("itemCode") '> and a.item_code = #{itemCode} </if>
+			<if test=' this.has("itemPrice") '> and a.item_price = #{itemPrice} </if>
+			<if test=' this.has("itemName") '> and a.item_name like concat('%',#{itemName},'%') </if>
+			<if test=' this.has("status") '> and a.status = #{status} </if>
+			<if test=' this.has("operateTime") '> and a.operate_time = #{operateTime} </if>
+			<if test=' this.has("operaror") '> and a.operaror = #{operaror} </if>
+			<if test=' this.has("typeFlag") '> and a.business_type !='0' </if>
 		order by
 		<choose>
-			<when test='sortType == 1'> id desc </when>
-			<when test='sortType == 2'> business_id desc </when>
-			<when test='sortType == 3'> item_code desc </when>
-			<when test='sortType == 4'> item_price desc </when>
-			<when test='sortType == 5'> item_name desc </when>
-			<when test='sortType == 6'> status desc </when>
-			<when test='sortType == 7'> operate_time desc </when>
-			<when test='sortType == 8'> operaror desc </when>
-			<when test='sortType == 9'> pick_time desc </when>
-			<when test='sortType == 10'> create_time desc </when>
-			<otherwise> id desc </otherwise>
+			<when test='sortType == 1'> a.id desc </when>
+			<when test='sortType == 2'> a.business_id desc </when>
+			<when test='sortType == 3'> a.item_code desc </when>
+			<when test='sortType == 4'> a.item_price desc </when>
+			<when test='sortType == 5'> a.item_name desc </when>
+			<when test='sortType == 6'> a.status desc </when>
+			<when test='sortType == 7'> a.operate_time desc </when>
+			<when test='sortType == 8'> a.operaror desc </when>
+			<when test='sortType == 9'> a.pick_time desc </when>
+			<when test='sortType == 10'> a.create_time desc </when>
+			<otherwise> a.id desc </otherwise>
 		</choose>
 	</select>