linweizeng 3 лет назад
Родитель
Сommit
dd25b3beb3

+ 1 - 1
common/service/http.js

@@ -7,4 +7,4 @@ let apiHosp = 'http://120.78.154.31/'
 
 export default {
 	apiHosp
-}
+}

+ 13 - 7
common/util/meth.js

@@ -15,13 +15,19 @@ export default {
 	},
 	getShowToast(val1, val2) {
 		let title = '必填'
-		if (val2 == 1) {
-			title = '必选一项'
-		} else if (val2 == 2) {
-			title = '必添加'
-		} else if (val2 == 3) {
-			title = '大于1'
+		switch (val2) {
+			case 1:
+				title = '必选一项'
+				break
+			case 2:
+				title = '必添加'
+				break
+			case 3:
+				title = '大于1'
+				break
+			default:
+				title = '必填'
 		}
 		this.getPrompt(val1 + title)
 	}
-}
+}

+ 2 - 2
pages/home/home.vue

@@ -223,7 +223,7 @@
 					return
 				}
 				let sql =
-					`select count(id_) as count from t_lhwtsqb where wei_tuo_zhuang_ta = '待编制' or shi_fou_guo_shen_ = '已退回' and create_by_ = '${this.userid}'`
+					`select count(a.id_) as count from t_lhwtsqb a left join t_bjd d on a.he_tong_id_ = d.id_ where (a.wei_tuo_zhuang_ta = '待编制' or a.shi_fou_guo_shen_ = '已退回') and (a.create_by_ = '${this.userid}'or d.ke_hu_zhang_hao_ = '${this.userid}')`
 				let requestData = this.$sig(sql)
 				this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
 					if (res.data.state == 200) {
@@ -245,4 +245,4 @@
 		width: 60px;
 		height: 60px;
 	}
-</style>
+</style>

+ 1 - 3
pages/index/index.vue

@@ -24,8 +24,6 @@
 			}
 		},
 		onLoad: function() {
-
-			console.log("登录成功,进入首页")
 			this.PageCur = 'home'
 				++this.commponent1Key
 				++this.commponent2Key
@@ -41,4 +39,4 @@
 
 <style lang="scss">
 
-</style>
+</style>

+ 2 - 6
pages/jiance/jindu.vue

@@ -174,12 +174,8 @@
 					page = this.current * 10
 				}
 
-
-				// let sql =
-				// 	`{"sql":"select tb.*,td.he_tong_bian_hao_ as he_tong_ming_cheng_,ty.ke_hu_ming_cheng_ as ke_hu_dang_wei from t_mjwtsqb tb, t_bjd td,t_yxkh ty where tb.he_tong_bian_hao_ = td.id_ and td.ke_hu_ming_cheng_ = ty.id_ and tb.create_by_= '${useId}' and tb.wei_tuo_bian_hao_ like '%${keyworks}%' ORDER BY tb.id_ desc LIMIT ${page},10"}`
-
 				let sql =
-					`select tl.*,td.he_tong_bian_hao_ as he_tong_ming_cheng_ from t_lhwtsqb tl,t_bjd td where tl.he_tong_id_ = td.id_ and td.ke_hu_zhang_hao_ = '${useId}' and tl.wei_tuo_bian_hao_ like '%${keyworks}%' ORDER BY tl.create_time_ desc LIMIT ${page},10`
+					`select tl.*,td.he_tong_bian_hao_ as he_tong_ming_cheng_ from t_lhwtsqb tl left join t_bjd td on tl.he_tong_id_ = td.id_ where tl.create_by_ = '${useId}' or td.ke_hu_zhang_hao_ = '${useId}' and tl.wei_tuo_bian_hao_ like '%${keyworks}%' ORDER BY tl.create_time_ desc LIMIT ${page},10`
 				let requestData = this.$sig(sql)
 
 
@@ -310,4 +306,4 @@
 	}
 
 	/* ------------------------------------------------------------- */
-</style>
+</style>

+ 8 - 17
pages/jiance/list.vue

@@ -57,7 +57,7 @@
 					<view class="btnList">
 						<u-button class="u-m-r-15 btn-back-color" type="success" size="mini"
 							@click="goto(item.id_,item.wei_tuo_bian_hao_)"
-							v-if="item.wei_tuo_zhuang_ta && (item.wei_tuo_zhuang_ta == '待审核' ||item.wei_tuo_zhuang_ta == '已编制' || item.wei_tuo_zhuang_ta == '待财务审核' || item.wei_tuo_zhuang_ta == '待签订' || item.wei_tuo_zhuang_ta == '待样品接收')">
+							v-if="item.wei_tuo_zhuang_ta && (item.wei_tuo_zhuang_ta == '待审核' ||item.wei_tuo_zhuang_ta == '已编制')">
 							样品修改</u-button>
 						<u-button type="success" size="mini" class="m-r-15" @click="getTag(item.id_)">样品标签</u-button>
 						<u-button type="success" size="mini" @click="goBaogao(item.yang_pin_bian_hao)">查看报告</u-button>
@@ -159,22 +159,13 @@
 					page = this.current * 10
 				}
 
-				//罗湖
-				// let sql =
-				// 	`select a.id_,a.bei_zhu_,a.create_time_,a.yang_pin_ming_che,a.yang_pin_bian_hao,b.shou_yang_ri_qi_,b.yan_shou_zhuang_t,c.wei_tuo_bian_hao_,c.fu_kuan_zhuang_ta,d.zhuang_tai_ ` +
-				// 	` from t_mjypb a ` +
-				// 	` inner join t_mjwtsqb c on a.wai_jian_ = c.id_ and a.create_by_= '${useId}' ` +
-				// 	` left join t_mjypdjb b on a.yang_pin_bian_hao = b.yang_pin_bian_hao ` +
-				// 	` left join t_mjjcbg d on a.yang_pin_bian_hao = d.yang_pin_bian_hao ORDER BY a.create_time_ desc limit ${page},10`
-
-				//select a.id_,a.create_time_,a.yang_pin_ming_che,a.yang_pin_bian_hao,c.fu_kuan_zhuang_ta,c.wei_tuo_bian_hao_,c.wei_tuo_zhuang_ta,b.fan_yang_ri_qi_,b.bei_zhu_ from t_lhypb a inner join t_lhwtsqb c on a.parent_id_ = c.id_ left join t_lhypdjb b on a.yang_pin_bian_hao = b.yang_ben_bian_hao
-				//明鉴
 				let sql =
-					`select a.id_,a.create_time_,a.yang_pin_ming_che,a.yang_pin_bian_hao,c.fu_kuan_zhuang_ta,c.wei_tuo_bian_hao_,c.wei_tuo_zhuang_ta,b.shou_yang_ri_qi_,b.bei_zhu_,b.yan_shou_jie_guo_` +
-					` from t_lhypb a` +
-					` inner join t_lhwtsqb c on a.parent_id_ = c.id_ and a.create_by_= '${useId}' ` +
-					` left join t_lhypdjb b on a.yang_pin_bian_hao = b.yang_ben_bian_hao where a.yang_pin_bian_hao like '%${keyworks}%' or a.wei_tuo_dan_hao_ like '%${keyworks}%' ORDER BY a.create_time_ desc limit ${page},10`
-
+					`select a.id_,a.create_time_,a.yang_pin_ming_che,a.yang_pin_bian_hao,c.fu_kuan_zhuang_ta,c.wei_tuo_bian_hao_,c.wei_tuo_zhuang_ta,b.shou_yang_ri_qi_,b.bei_zhu_,b.yan_shou_jie_guo_,d.ke_hu_zhang_hao_ ` +
+					`from t_lhypb a ` +
+					`left join t_lhwtsqb c on a.parent_id_ = c.id_ ` +
+					`left join t_bjd d on c.he_tong_id_ = d.id_ ` +
+					`left join t_lhypdjb b on a.yang_pin_bian_hao = b.yang_ben_bian_hao ` +
+					` where (a.create_by_= '${useId}' or d.ke_hu_zhang_hao_ = '${useId}') and (a.yang_pin_bian_hao like '%${keyworks}%' or a.wei_tuo_dan_hao_ like '%${keyworks}%') ORDER BY a.create_time_ desc limit ${page},10`
 				let requestData = this.$sig(sql)
 				this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
 					if (res.data.state == 200) {
@@ -258,4 +249,4 @@
 		padding-top: 15rpx;
 		padding-bottom: 0rpx;
 	}
-</style>
+</style>

+ 26 - 20
pages/jiance/order.vue

@@ -19,12 +19,12 @@
 					<u-form-item label="委托编号">
 						<u-input placeholder="请输入委托编号" v-model="form.weiTuoBianHao" disabled />
 					</u-form-item>
-					<!-- <u-form-item label="用户选择" prop="userNameId" required v-if="administrator">
-						<uni-data-select placeholder="请选择合同选择" v-model="form.userNameId" :localdata="userList"
-							v-if="type != 'detail'">
+					<u-form-item label="用户选择" required v-if="administrator">
+						<uni-data-select placeholder="请选择合同选择" v-model="form.baoGaoBianZhiYuan" :localdata="userList"
+							@change="userListChange" v-if="type != 'detail'">
 						</uni-data-select>
-						<text v-else>{{getButtChange(form.heTongId,hetong)}}</text>
-					</u-form-item> -->
+						<text v-else>{{getButtChange(form.baoGaoBianZhiYuan,userList)}}</text>
+					</u-form-item>
 					<u-form-item label="合同选择" prop="heTongId" required>
 						<uni-data-select placeholder="请选择合同选择" v-model="form.heTongId" :localdata="hetong"
 							@change="hetongChange" v-if="type != 'detail'">
@@ -34,7 +34,7 @@
 					<u-form-item label="委托来源">
 						<u-input placeholder="请输入委托来源" v-model="form.weiTuoDanLaiYuan" disabled />
 					</u-form-item>
-					<u-form-item label="合同类型" prop="weiTuoHeTong" required>
+					<u-form-item label="合同类型" prop="weiTuoHeTong">
 						<u-input placeholder="请输入合同类型" v-model="form.weiTuoHeTong" disabled />
 					</u-form-item>
 					<u-form-item label="委托单位">
@@ -242,7 +242,7 @@
 			return {
 				activeNum: 1,
 				form: {
-					userNameId: '',
+					baoGaoBianZhiYuan: '',
 					weiTuoLeiXing: '',
 					weiTuoDanLaiYuan: '',
 					weiTuoBianHao: '',
@@ -388,9 +388,13 @@
 			this.administrator = administrator
 			this.getInit()
 
-			// if (administrator) {
-			// 	this.getAdministrator()
-			// }
+			if (administrator) {
+				this.getAdministrator()
+			}
+
+			if ((administrator && options.id) || !administrator) {
+				this.getDataHetong(options.id)
+			}
 
 			//一开始查合同  如果修改或者明细 传option.id
 			// if (options && options.type != 'detail') {
@@ -398,7 +402,7 @@
 			// } else {
 			// 	this.getLiuHenWeiTuoDan(options.id)
 			// }
-			this.getDataHetong(options.id)
+
 
 
 			if (options.saveId) { //是不是暂存信息
@@ -434,7 +438,7 @@
 			//超级用户 获取全部客户信息
 			getAdministrator() {
 				let sql =
-					`select * from ibps_party_employee where GROUP_ID_ = '1041786072788369408' and STATUS_ = 'actived'`
+					`select ID_,NAME_ from ibps_party_employee where GROUP_ID_ = '1041786072788369408' and STATUS_ = 'actived'`
 				let requestData = this.$sig(sql)
 				this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
 					if (res.data.state == 200) {
@@ -662,21 +666,22 @@
 				})
 			},
 			//获取合同  //weiTouId 委托id特殊 在委托详情和修改才出现
-			getDataHetong(weiTouId) {
+			getDataHetong(weiTouId = '', userId = '') {
 				let info = uni.getStorageSync(USER_INFO);
-				if (info == undefined) {
-					return;
+				if (!this.administrator) {
+					userId = info.user.id
 				}
 				// let sql =
 				// 	`select tb.*,ty.ke_hu_ming_cheng_ as ke_hu_dang_wei from t_bjd tb,t_yxkh ty where tb.ke_hu_ming_cheng_ = ty.id_  and tb.zhuang_tai_='生效中' and tb.shi_fou_guo_shen_ = '已完成'`
 
 				let sql =
-					`select tb.*,ty.ke_hu_ming_cheng_ as ke_hu_dang_wei from t_bjd tb,t_yxkh ty where tb.ke_hu_ming_cheng_ = ty.id_ and tb.ke_hu_zhang_hao_ ='${info.employee.id}' and tb.zhuang_tai_='生效中' and tb.shi_fou_guo_shen_ = '已完成'`
+					`select tb.*,ty.ke_hu_ming_cheng_ as ke_hu_dang_wei from t_bjd tb,t_yxkh ty where tb.ke_hu_ming_cheng_ = ty.id_ and tb.ke_hu_zhang_hao_ ='${userId}' and tb.zhuang_tai_='生效中' and tb.shi_fou_guo_shen_ = '已完成'`
 				let requestData = this.$sig(sql)
 				this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
 					if (res.data.state == 200) {
 						let result = res.data.variables.data
 						if (result.length > 0) {
+							this.heTongShow = false
 							this.hetongList = result
 							let list = []
 							result.forEach((item, index) => {
@@ -1155,8 +1160,6 @@
 					})
 				}
 
-
-
 				this.$refs.form.validate(valid => {
 					if (valid) {
 						if (valueType == 3) {
@@ -1391,7 +1394,7 @@
 						return data
 					}
 				}
-
+				return data
 			},
 			/**
 			 * 生成唯一id
@@ -1452,6 +1455,9 @@
 				}
 				this.$refs.top.activeNum = index
 				this.activeNum = index
+			},
+			userListChange(e) {
+				this.getDataHetong('', e)
 			}
 
 		}
@@ -1558,4 +1564,4 @@
 	/deep/ .uni-group__title-text {
 		color: #67c23a !important;
 	}
-</style>
+</style>

+ 6 - 1
pages/jiance/order/lhypbMessage.vue

@@ -43,6 +43,11 @@
 						@click="dateClick('inspect')" v-if="type != 'detail'">选择
 					</u-button>
 				</u-form-item>
+				<view class="qingshe">
+					<view class="qingTitle">
+						若需做培养基灵敏度检测请在此备注
+					</view>
+				</view>
 				<u-form-item label="备注">
 					<u-input placeholder="请输入备注" v-model="form.beiZhu1" :disabled="type == 'detail'?true :false" />
 				</u-form-item>
@@ -886,4 +891,4 @@
 	// 	overflow: hidden;
 	// 	text-overflow: ellipsis;
 	// }
-</style>
+</style>

+ 42 - 80
pages/jiance/order/meth.js

@@ -1,3 +1,4 @@
+import order from './test.json'
 export default {
 	//时间
 	time(index) {
@@ -15,12 +16,18 @@ export default {
 	},
 	getShowToast(val1, val2) {
 		let title = '必填'
-		if (val2 == 1) {
-			title = '必选一项'
-		} else if (val2 == 2) {
-			title = '必添加'
-		} else if (val2 == 3) {
-			title = '大于1'
+		switch (val2) {
+			case 1:
+				title = '必选一项'
+				break
+			case 2:
+				title = '必添加'
+				break
+			case 3:
+				title = '大于1'
+				break
+			default:
+				title = '必填'
 		}
 		this.getPrompt(val1 + title)
 	},
@@ -46,7 +53,8 @@ export default {
 			weiTuoRiQi: item.wei_tuo_ri_qi_,
 			weiTuoFangQueRen: item.wei_tuo_fang_que_,
 			zongJia: item.zong_jia_,
-			zhanShiBiaoId: item.zhan_shi_biao_id_
+			zhanShiBiaoId: item.zhan_shi_biao_id_,
+			baoGaoBianZhiYuan: item.bao_gao_bian_zhi_ || ''
 		}
 		return form
 	},
@@ -102,7 +110,6 @@ export default {
 				}
 			}
 
-
 			let obj = {
 				id: item.id_,
 				jianCeXiangMu: item.jian_ce_xiang_mu_,
@@ -296,79 +303,23 @@ export default {
 	},
 	//提交判断
 	getJudge(form) {
-		if (form.showBoolean1) {
-			if (form.yangPinLeiXing == '') {
-				this.getShowToast('样品信息的样品类型①')
-				return false
-			}
-			if (form.yangBenYunShuTiao == '') {
-				this.getShowToast('样品信息的运输条件①')
-				return false
-			}
-			if (form.yangPinGuiGe == '') {
-				this.getShowToast('样品信息的样品规格①')
-				return false
-			}
-			if (form.shuLiang == 0) {
-				this.getShowToast('样品信息的样品数量①', 3)
-				return false
-			}
+		if (!form.showBoolean1 && !form.showBoolean2 && !form.showBoolean3 && !form.showBoolean4) {
+			this.getPrompt('至少填写一组样品类型信息')
+			return false
 		}
-
-		if (form.showBoolean2) {
-			if (form.yangPinLeiXingEr == '') {
-				this.getShowToast('样品信息的样品类型②')
-				return false
-			}
-			if (form.yangPinYunShuTiao == '') {
-				this.getShowToast('样品信息的运输条件②')
-				return false
-			}
-			if (form.yangPinGuiGeEr == '') {
-				this.getShowToast('样品信息的样品规格②')
-				return false
-			}
-			if (form.shuLiangEr == 0) {
-				this.getShowToast('样品信息的样品数量②', 3)
-				return false
-			}
+		if (form.showBoolean1 && !this.getEstimate(order.showBooleanList1, form)) {
+			return false
+		}
+		if (form.showBoolean2 && !this.getEstimate(order.showBooleanList2, form)) {
+			return false
 		}
 
-		if (form.showBoolean3) {
-			if (form.yangPinLeiXingSan == '') {
-				this.getShowToast('样品信息的样品类型③')
-				return false
-			}
-			if (form.yangPinYunShuSan == '') {
-				this.getShowToast('样品信息的运输条件③')
-				return false
-			}
-			if (form.yangPinGuiGeSan == '') {
-				this.getShowToast('样品信息的样品规格③')
-				return false
-			}
-			if (form.shuLiangSan == 0) {
-				this.getShowToast('样品信息的样品数量③', 3)
-				return false
-			}
+		if (form.showBoolean3 && !this.getEstimate(order.showBooleanList3, form)) {
+			return false
 		}
-		if (form.showBoolean4) {
-			if (form.yangPinLeiXingSi == '') {
-				this.getShowToast('样品信息的样品类型④')
-				return false
-			}
-			if (form.yangPinYunShuSi == '') {
-				this.getShowToast('样品信息的运输条件④')
-				return false
-			}
-			if (form.yangPinGuiGeSi == '') {
-				this.getShowToast('样品信息的样品规格④')
-				return false
-			}
-			if (form.shuLiangSi == 0) {
-				this.getShowToast('样品信息的样品数量④', 3)
-				return false
-			}
+
+		if (form.showBoolean4 && !this.getEstimate(order.showBooleanList4, form)) {
+			return false
 		}
 
 		//判断是否有套餐,并且是否选择列套餐
@@ -391,12 +342,23 @@ export default {
 		}
 		return true
 	},
+	//数据判断是否必填
+	getEstimate(list, form) {
+		for (let item of list) {
+			if (item.type == 'number' && form[item.value] == 0) {
+				this.getShowToast(item.text, item.num)
+				return false
+			} else if (item.type == 'string' && form[item.value] == '') {
+				this.getShowToast(item.text, item.num)
+				return false
+			}
+		}
+		return true
+	},
 	//遍历list1 在 list的是否存在
 	getXiangMuList(list1, list2) {
-		console.log(list1)
 		for (let item of list1) {
 			let show = list2.findIndex(it => it.id_ == item)
-			console.log(show)
 			if (show < 0) {
 				return false
 			}
@@ -411,4 +373,4 @@ export default {
 			return ''
 		}
 	}
-}
+}

+ 85 - 1
pages/jiance/order/test.json

@@ -119,5 +119,89 @@
 		"value": "songJianShiJian",
 		"toast": "送检时间",
 		"num": 0
+	}],
+	"showBooleanList1": [{
+		"value": "yangPinLeiXing",
+		"text": "样品信息的样品类型①",
+		"num": 0,
+		"type": "string"
+	}, {
+		"value": "yangBenYunShuTiao",
+		"text": "样品信息的运输条件①",
+		"num": 0,
+		"type": "string"
+	}, {
+		"value": "yangPinGuiGe",
+		"text": "样品信息的样品规格①",
+		"num": 0,
+		"type": "string"
+	}, {
+		"value": "shuLiang",
+		"text": "样品信息的样品数量①",
+		"num": 3,
+		"type": "number"
+	}],
+	"showBooleanList2": [{
+		"value": "yangPinLeiXingEr",
+		"text": "样品信息的样品类型②",
+		"num": 0,
+		"type": "string"
+	}, {
+		"value": "yangPinYunShuTiao",
+		"text": "样品信息的运输条件②",
+		"num": 0,
+		"type": "string"
+	}, {
+		"value": "yangPinGuiGeEr",
+		"text": "样品信息的样品规格②",
+		"num": 0,
+		"type": "string"
+	}, {
+		"value": "shuLiangEr",
+		"text": "样品信息的样品数量②",
+		"num": 3,
+		"type": "number"
+	}],
+	"showBooleanList3": [{
+		"value": "yangPinLeiXingSan",
+		"text": "样品信息的样品类型③",
+		"num": 0,
+		"type": "string"
+	}, {
+		"value": "yangPinYunShuSan",
+		"text": "样品信息的运输条件③",
+		"num": 0,
+		"type": "string"
+	}, {
+		"value": "yangPinGuiGeSan",
+		"text": "样品信息的样品规格③",
+		"num": 0,
+		"type": "string"
+	}, {
+		"value": "shuLiangSan",
+		"text": "样品信息的样品数量③",
+		"num": 3,
+		"type": "number"
+	}],
+	"showBooleanList4": [{
+		"value": "yangPinLeiXingSi",
+		"text": "样品信息的样品类型④",
+		"num": 0,
+		"type": "string"
+	}, {
+		"value": "yangPinYunShuSi",
+		"text": "样品信息的运输条件④",
+		"num": 0,
+		"type": "string"
+	}, {
+		"value": "yangPinGuiGeSi",
+		"text": "样品信息的样品规格③",
+		"num": 0,
+		"type": "string"
+	}, {
+		"value": "shuLiangSi",
+		"text": "样品信息的样品数量④",
+		"num": 3,
+		"type": "number"
 	}]
-}
+}

+ 2 - 21
pages/login/login.vue

@@ -171,7 +171,7 @@
 		},
 		methods: {
 			...mapActions(["mLogin", "PhoneLogin", "mSign", "ThirdLogin"]),
-			onLogin: function() {
+			onLogin() {
 
 				if (!this.userName || this.userName.length == 0) {
 					this.$tip.toast('请填写用户名');
@@ -181,17 +181,6 @@
 					this.$tip.toast('请填写密码');
 					return;
 				}
-
-				if (this.userName == 'luohu') {
-					uni.setStorageSync('administrator', true)
-				} else {
-					let nameLength = this.userName.split("")
-					if (nameLength != 13 && this.userName.indexOf("LH") == -1) {
-						this.$tip.toast("该账户不是客户账号");
-						return
-					}
-					uni.setStorageSync('administrator', false)
-				}
 				let loginParams = {
 					username: this.userName,
 					password: this.password,
@@ -199,16 +188,13 @@
 					requestId: this.requestId
 				}
 				this.loading = true;
-
 				this.mLogin(loginParams).then((res) => {
 					this.loading = false;
 					if (res.data.state == 200) {
-
 						this.$tip.success('登录成功!', 'none')
 						this.$Router.replaceAll({
 							name: 'index'
 						})
-
 						//账号保存到缓存中
 						let userName = {
 							username: this.userName
@@ -220,13 +206,8 @@
 						} else {
 							this.$tip.alert(res.data.cause);
 						}
-
 					}
 				}).catch((err) => {
-					let msg = err.data.cause || "请求出现错误,请稍后再试"
-					this.loading = false;
-					this.$tip.alert(msg);
-				}).finally(() => {
 					this.loading = false;
 				})
 			},
@@ -446,4 +427,4 @@
 	/deep/ .u-btn--primary {
 		background-color: #3396d1;
 	}
-</style>
+</style>

+ 48 - 63
store/index.js

@@ -37,53 +37,32 @@ export default new Vuex.Store({
 		}
 	},
 	actions: {
-		/**
-		 * 
-		 const result = response.data.result
-		 const userInfo = result.userInfo
-		 uni.setStorageSync(ACCESS_TOKEN,result.token);
-		 uni.setStorageSync(USER_INFO,userInfo);
-		 commit('SET_TOKEN', result.token)
-		 commit('SET_NAME', { username: userInfo.username,realname: userInfo.realname})
-		 commit('SET_AVATAR', userInfo.avatar)
-		 resolve(response)	  
-		 */
-
-
 		// 登录
 		mLogin({
 			commit
 		}, userInfo) {
-
 			return new Promise((resolve, reject) => {
 				var username = userInfo.username;
 				api.login(userInfo).then(response => {
 					if (response.data.state == 200) {
 						const result = response.data
 						const userInfo = response.data.data
-
-						//	uni.setStorageSync(USER_INFO,userInfo);
-						console.log("userInfo", userInfo)
 						commit('SET_TOKEN', "")
 						commit('SET_AVATAR', null)
 						commit('SET_NAME', userInfo)
-
-						let params = {};
-						params.login_state = userInfo;
-						params.client_id = "ibps";
+						let params = {
+							login_state: userInfo,
+							client_id: 'ibps'
+						}
 						//授权第二步
 						api.authorize(params).then(response2 => {
-							//console.log(response2)
-							console.log(33)
 							if (response.data.state == 200) {
-								let auparams = {};
-								auparams.authorize_code = response2.data.data;
-								auparams.client_id = "ibps";
-								//写死的client_secret
-								auparams.client_secret =
-									"58b65297-3467-0859-8337-8cbaf81ef68a"
-
-								auparams.grant_type = "authorization_code"
+								let auparams = {
+									authorize_code: response2.data.data,
+									client_id: 'ibps',
+									client_secret: '58b65297-3467-0859-8337-8cbaf81ef68a',
+									grant_type: 'authorization_code'
+								}
 								//授权第三步
 								api.authentication(auparams).then(res => {
 									if (res.data.state == 200) {
@@ -95,32 +74,59 @@ export default new Vuex.Store({
 										//获取用户信息
 										api.context(username).then(res => {
 											if (res.data.state == 200) {
-
 												let info = res.data
-													.data;
+													.data
 												uni.setStorageSync(
-													USER_INFO, info);
-
+													USER_INFO, info
+												)
+												if (info.user.id ==
+													'1100364672239927296' ||
+													info.user.id ==
+													'1100468240921919488'
+												) {
+													uni.setStorageSync(
+														'administrator',
+														true)
+													resolve(res)
+													return
+												}
+												if (info.org.id !=
+													'1041786072788369408'
+												) {
+													uni.showToast({
+														title: '该账户不是客户账号',
+														icon: 'none',
+														duration: 2000
+													})
+													reject(res)
+													return
+												}
+												uni.setStorageSync(
+													'administrator',
+													false)
 												resolve(res)
 											} else {
-												resolve(res)
+												reject(res)
 											}
 										})
-										resolve(res)
 									} else {
-										resolve(res)
+										reject(res)
 									}
 								})
 							} else {
-								resolve(response2)
+								reject(response2)
 							}
 						})
 
 					} else {
-						resolve(response)
+						uni.showToast({
+							title: response.data.cause,
+							icon: 'none',
+							duration: 2000
+						})
+						reject(response)
 					}
 				}).catch(error => {
-					console.log("catch===>response")
 					reject(error)
 				})
 			})
@@ -147,7 +153,6 @@ export default new Vuex.Store({
 						params.client_id = "ibps";
 
 						api.authorize(params).then(response2 => {
-							//console.log(response2)
 							if (response.data.state == 200) {
 								let auparams = {};
 								auparams.authorize_code = response2.data.data;
@@ -175,14 +180,10 @@ export default new Vuex.Store({
 								resolve(response)
 							}
 						})
-
-
-
 					} else {
 						resolve(response)
 					}
 				}).catch(error => {
-					console.log("catch===>response", error)
 					reject(error)
 				})
 			})
@@ -194,17 +195,6 @@ export default new Vuex.Store({
 			return new Promise((resolve, reject) => {
 				api.phoneNoLogin(userInfo).then(response => {
 					if (response.data.state == 200) {
-
-						/*	const result = response.data.result
-            const userInfo = result.userInfo
-			uni.setStorageSync(ACCESS_TOKEN,result.token);
-			uni.setStorageSync(USER_INFO,userInfo);
-            commit('SET_TOKEN', result.token)
-            commit('SET_NAME', { username: userInfo.username,realname: userInfo.realname})
-            commit('SET_AVATAR', userInfo.avatar)
-            resolve(response)
-			*/
-
 						const result = response.data
 						const userInfo = response.data.data
 						uni.setStorageSync(ACCESS_TOKEN, "ashdgajd");
@@ -220,7 +210,6 @@ export default new Vuex.Store({
 
 
 						api.authorize(params).then(response2 => {
-							//console.log(response2)
 							if (response.data.state == 200) {
 								let auparams = {};
 								auparams.authorize_code = response2.data.data;
@@ -268,11 +257,7 @@ export default new Vuex.Store({
 				let logoutToken = state.token;
 				commit('SET_TOKEN', '')
 				uni.removeStorageSync(ACCESS_TOKEN)
-				console.log("退出")
 				api.logout(logoutToken).then(() => {
-
-
-
 					resolve()
 				}).catch(() => {
 					resolve()
@@ -306,4 +291,4 @@ export default new Vuex.Store({
 		},
 	},
 
-})
+})