dedsudiyu 2 weeks ago
parent
commit
7fc4018dde

+ 48 - 0
pages_supplierCylinderManagement/api/index.js

@@ -37,6 +37,22 @@ export const airBottleNewQpDictList = (data) => {
 		data: data,
 	})
 };
+//扫码查询气瓶
+export const airBottleNewQpAppletBottleScan = (data) => {
+	return apiResquest({
+		url: '/airbottle-new/qp/applet/bottle/scan',
+		method: 'GET',
+		data: data,
+	})
+};
+//扫码查询实验室
+export const airBottleNewQpAppletBottleSubjectsInfo = (data) => {
+	return apiResquest({
+		url: '/airbottle-new/qp/applet/bottle/subjects/info',
+		method: 'GET',
+		data: data,
+	})
+};
 
 
 /*查询用户列表-下拉列表 - 无权限
@@ -65,4 +81,36 @@ export const systemBuildingGetTreeList = (data) => {
 		method: 'POST',
 		data: data,
 	})
+};
+//入库
+export const airBottleNewQpAppletBottleStorageIn = (data) => {
+	return apiResquest({
+		url: '/airbottle-new/qp/applet/bottle/storage/in',
+		method: 'POST',
+		data: data,
+	})
+};
+//出库
+export const airBottleNewQpAppletBottleStorageOut = (data) => {
+	return apiResquest({
+		url: '/airbottle-new/qp/applet/bottle/storage/out',
+		method: 'POST',
+		data: data,
+	})
+};
+//历史记录列表
+export const airBottleNewQpAppletBottleHistoryPage = (data) => {
+	return apiResquest({
+		url: '/airbottle-new/qp/applet/bottle/history/page',
+		method: 'POST',
+		data: data,
+	})
+};
+//撤回入库
+export const airBottleNewQpAppletBottleStorageWithdraw = (data) => {
+	return apiResquest({
+		url: '/airbottle-new/qp/applet/bottle/storage/withdraw',
+		method: 'POST',
+		data: data,
+	})
 };

+ 167 - 81
pages_supplierCylinderManagement/views/gasCylinderManagement/cylinderDetails.vue

@@ -4,118 +4,149 @@
 		<view class="text-max-big-box">
 			<view class="for-title-box">
 				<view>气瓶状态:</view>
-				<view :class="newData.data7==1?'colorA':'colorB'">{{newData.data7==1?'已入库':'已出库'}}</view>
+				<view :class="newData.state==1?'colorA':(newData.state==2?'colorB':'')">{{newData.state==0?'待入库':(newData.state==1?'已入库':'已出库')}}</view>
 			</view>
 		</view>
-		<view class="title-p" v-if="newData.data7 == 1">气瓶信息</view>
+		<view class="title-p" v-if="newData.state == 1">气瓶信息</view>
 		<view class="text-max-big-box">
-			<view class="for-text-box" v-if="newData.data6 == 1">
+			<view class="for-text-box" v-if="!newData.specialGases">
 				<view>气瓶编码:</view>
-				<view>{{newData.data1}}</view>
+				<view>{{newData.bottleCode}}</view>
 			</view>
 			<view class="for-text-box">
 				<view>气体:</view>
-				<view>{{newData.data2}}</view>
+				<view>{{newData.gasName}}</view>
 			</view>
 			<view class="for-text-box">
 				<view>气瓶规格:</view>
-				<view>{{newData.data3}}</view>
+				<view>{{newData.specification}}</view>
 			</view>
 			<view class="for-text-box">
 				<view>气体类别:</view>
-				<view>{{newData.data4}}</view>
+				<view>{{newData.gasCategory}}</view>
 			</view>
 			<view class="for-text-box">
 				<view>纯度:</view>
-				<view>{{newData.data5}}</view>
+				<view>{{newData.purity}}</view>
 			</view>
-			<view class="for-text-box" v-if="newData.data6 == 1">
+			<view class="for-text-box" v-if="!newData.specialGases">
 				<view>压力:</view>
-				<view>{{newData.data8}}</view>
+				<view>{{newData.pressure}}</view>
 			</view>
-			<view class="for-text-box" v-if="newData.data7 == 2">
+			<view class="for-text-box" v-if="newData.state == 2">
 				<view>实验室名称:</view>
-				<view>{{newData.data9}}</view>
+				<view>{{newData.subName}}</view>
 			</view>
-			<view class="for-text-box" v-if="newData.data7 == 2">
+			<view class="for-text-box" v-if="newData.state == 2">
 				<view>楼栋:</view>
-				<view>{{newData.data10}}</view>
+				<view>{{newData.buildName}}</view>
 			</view>
-			<view class="for-text-box" v-if="newData.data7 == 2">
+			<view class="for-text-box" v-if="newData.state == 2">
 				<view>楼层:</view>
-				<view>{{newData.data11}}</view>
+				<view>{{newData.floorName}}</view>
 			</view>
-			<view class="for-text-box" v-if="newData.data7 == 2">
+			<view class="for-text-box" v-if="newData.state == 2">
 				<view>房间:</view>
-				<view>{{newData.data12}}</view>
+				<view>{{newData.roomNum}}</view>
 			</view>
 		</view>
-		<view class="title-p" v-if="newData.data7 == 1">实验室信息</view>
-		<view class="text-max-big-box" v-if="newData.data7 == 1">
+		<view class="title-p" v-if="newData.state == 1">实验室信息</view>
+		<view class="text-max-big-box" v-if="newData.state == 1">
 			<view class="for-text-box">
 				<view>实验室名称:</view>
-				<view>{{newData.data9}}</view>
+				<view>{{newData.subName}}</view>
 			</view>
 			<view class="for-text-box">
 				<view>楼栋:</view>
-				<view>{{newData.data10}}</view>
+				<view>{{newData.buildName}}</view>
 			</view>
 			<view class="for-text-box">
 				<view>楼层:</view>
-				<view>{{newData.data11}}</view>
+				<view>{{newData.floorName}}</view>
 			</view>
 			<view class="for-text-box">
 				<view>房间:</view>
-				<view>{{newData.data12}}</view>
+				<view>{{newData.roomNum}}</view>
 			</view>
 		</view>
-		<view class="text-max-big-box" v-if="newData.data7 == 1">
+		<view class="text-max-big-box" v-if="newData.state == 1">
 			<view class="for-text-box">
 				<view>签收人:</view>
-				<view>{{newData.data13}}</view>
+				<view>{{newData.receiver}}</view>
 			</view>
 		</view>
-		<view class="text-max-big-box">
-			<view class="for-border-box" v-if="newData.data7 == 2">
+		<view class="text-max-big-box" v-if="newData.state == 1">
+			<view class="for-text-box">
+				<view>费用:</view>
+				<view>{{newData.latestStorageIn.cost}}</view>
+			</view>
+		</view>
+		<view class="text-max-big-box" v-if="newData.state == 2">
+			<view class="for-border-box" style="padding-bottom:20rpx;">
 				<view>出库类型:</view>
-				<view>{{newData.data14==1?'空瓶出库':'满瓶出库'}}</view>
+				<view>{{newData.latestStorageOut.outType==1?'空瓶出库':'满瓶出库'}}</view>
 			</view>
-			<view class="for-text-box">
+			<view class="for-text-box" style="padding-top:20rpx;">
 				<view>费用:</view>
-				<view>{{newData.data15}}</view>
+				<view>{{newData.latestStorageOut.outType==1?newData.latestStorageOut.cost:'0'}}</view>
 			</view>
 		</view>
-		<view class="text-max-big-box" v-if="newData.data7 == 2">
+		<view class="text-max-big-box" v-if="newData.state == 2">
 			<view class="for-text-box">
 				<view>签出人:</view>
-				<view>{{newData.data21}}</view>
+				<view>{{newData.signerOut}}</view>
 			</view>
 		</view>
-		<view class="text-max-big-box">
+		<view class="text-max-big-box" v-if="newData.state == 1">
 			<view class="for-img-box">
-				<view>{{newData.data7==1?'入库单':'出库单'}}:</view>
-				<img class="img-box" @click="previewSingleImage(baseUrl+item)" :src="baseUrl+newData.data16">
+				<view>入库单:</view>
+				<img class="img-box" 
+				v-for="(item,index) in newData.latestStorageIn.voucherUrl" :key="index"
+				@click="previewSingleImage(baseUrl+item)" 
+				:src="baseUrl+item">
 			</view>
 			<view class="for-text-box">
-				<view>{{newData.data7==1?'入库时间':'出库时间'}}:</view>
-				<view>{{newData.data17}}</view>
+				<view>入库时间:</view>
+				<view>{{newData.latestStorageIn.storageTime}}</view>
 			</view>
 			<view class="for-text-box">
-				<view>{{newData.data7==1?'入库人':'出库人'}}:</view>
-				<view>{{newData.data18}}</view>
+				<view>入库人:</view>
+				<view>{{newData.latestStorageIn.operator}}</view>
 			</view>
 			<view class="for-text-box">
 				<view>联系电话</view>
-				<view>{{newData.data19}}</view>
+				<view>{{newData.latestStorageIn.operatorPhone}}</view>
 			</view>
 		</view>
-		<view class="text-max-big-box">
+		<view class="text-max-big-box" v-if="newData.state == 2">
+			<view class="for-img-box">
+				<view>出库单:</view>
+				<img class="img-box" 
+				v-for="(item,index) in newData.latestStorageOut.voucherUrl" :key="index"
+				@click="previewSingleImage(baseUrl+item)" 
+				:src="baseUrl+item">
+			</view>
+			<view class="for-text-box">
+				<view>出库时间:</view>
+				<view>{{newData.latestStorageOut.storageTime}}</view>
+			</view>
+			<view class="for-text-box">
+				<view>出库人:</view>
+				<view>{{newData.latestStorageOut.operator}}</view>
+			</view>
+			<view class="for-text-box">
+				<view>联系电话</view>
+				<view>{{newData.latestStorageOut.operatorPhone}}</view>
+			</view>
+		</view>
+		<view class="text-max-big-box" :class="newData.state == 2?'margin-bottom-p':''">
 			<view class="for-text-one-box">
 				<view>备注:</view>
-				<view>{{newData.data20}}</view>
+				<view v-if="newData.state == 1">{{newData.latestStorageIn.remark}}</view>
+				<view v-if="newData.state == 2">{{newData.latestStorageOut.remark}}</view>
 			</view>
 		</view>
-		<view v-if="newData.data7 == 1" class="bottom-button-box">
+		<view v-if="newData.state == 1" class="bottom-button-box">
 			<view @click="submitButton()">撤回入库</view>
 			<view @click="goPage()">气瓶出库</view>
 		</view>
@@ -124,56 +155,103 @@
 
 <script>
 	import {
+		parseTime
+	} from '@/component/public.js'
+	import {
 		config
 	} from '@/api/request/config.js'
+	import {
+		airbottleNewQpAppletBottleDetail,airBottleNewQpAppletBottleStorageWithdraw
+	} from '@/pages_supplierCylinderManagement/api/index.js'
 	export default {
 		data() {
 			return {
 				baseUrl: config.base_url,
 				newData: {
-					data1: '1231315',
-					data2: '氢气',
-					data3: '8L',
-					data4: '易燃气体',
-					data5: '99%',
-					data6: '1',
-					data7: '1',
-					data8: '15Mpa',
-					data9: '实验室-11',
-					data10: '名义楼',
-					data11: '10层',
-					data12: '302',
-					data13: '张签收',
-					data14: '1',
-					data15: '5000',
-					data16: 'statics/2026/08/24/b8877900-a4b7-44c3-949c-3d652d54063f.jpg',
-					data17: '2022-0202 16:42',
-					data18: '张出库',
-					data19: '13333333333',
-					data20: '我是备注信息,我是备注信息,我是备注信息,我是备注信息,我是备注信息,我是备注信息',
-					data21: '张签出',
+					bottleCode: '',
+					gasName: '',
+					specification: '',
+					gasCategory: '',
+					purity: '',
+					specialGases: '',
+					state: '',
+					pressure: '',
+					subName: '',
+					buildName: '',
+					floorName: '',
+					roomNum: '',
+					receiver: '',
+					cost: '',
+					latestStorageIn:{
+						voucherUrl:[],
+						storageTime:'',
+						operator:'',
+						operatorPhone:'',
+					},
+					latestStorageOut:{
+						voucherUrl:[],
+						storageTime:'',
+						operator:'',
+						operatorPhone:'',
+					},
 				}
 			}
 		},
 		onLoad(options) {
-			console.log(options.id)
+			this.airbottleNewQpAppletBottleDetail(options.id);
 		},
 		onShow() {
 
 		},
 
 		methods: {
+			//气瓶详情
+			async airbottleNewQpAppletBottleDetail(id) {
+				const {
+					data
+				} = await airbottleNewQpAppletBottleDetail({
+					id: id
+				});
+				if (data.code == 200) {
+					if(data.data.latestStorageIn){
+						data.data.latestStorageIn.storageTime = parseTime(data.data.latestStorageIn.storageTime, "{y}-{m}-{d} {h}:{i}");
+						data.data.latestStorageIn.voucherUrl = data.data.latestStorageIn.voucherUrl.split(",");
+					}
+					if(data.data.latestStorageOut){
+						data.data.latestStorageOut.storageTime = parseTime(data.data.latestStorageOut.storageTime, "{y}-{m}-{d} {h}:{i}");
+						data.data.latestStorageOut.voucherUrl = data.data.latestStorageOut.voucherUrl.split(",");
+					}
+					this.$set(this,'newData', data.data);
+				}
+			},
+			//撤回入库
+			async airBottleNewQpAppletBottleStorageWithdraw() {
+				const {
+					data
+				} = await airBottleNewQpAppletBottleStorageWithdraw({
+					bottleId: this.newData.id
+				});
+				if (data.code == 200) {
+					uni.showToast({
+						title: '撤回成功',
+						icon: "success",
+						mask: true,
+						duration: 2000
+					});
+					setTimeout(function() {
+						uni.navigateBack({ delta: 1 });
+					}, 2000);
+				}
+			},
 			//气瓶出库
 			goPage(){
-				let obj = {
-					
-				}
 				uni.navigateTo({
-					url: '/pages_supplierCylinderManagement/views/gasCylinderManagement/outbound?form='+encodeURIComponent(JSON.stringify(obj))+'&pageType=3'
+					url: '/pages_supplierCylinderManagement/views/gasCylinderManagement/outbound?id='+this.newData.id,
 				});
 			},
 			//撤回入库
 			submitButton(){
+				let self = this;
 				uni.showModal({
 					title: '撤回入库',
 					content: '撤回后,该气体气瓶的当前状态将被强制回退至待入库。',
@@ -183,15 +261,7 @@
 					confirmColor:'#FF0000',
 					success: (res) => {
 						if (res.confirm) {
-							uni.showToast({
-								title:'入库完成',
-								icon:"success",
-								mask:true,
-								duration: 2000
-							});
-							setTimeout(function(){
-								uni.navigateBack();
-							},2000);
+							self.airBottleNewQpAppletBottleStorageWithdraw();
 						}
 					}
 				});
@@ -260,7 +330,18 @@
 				}
 			}
 			.for-border-box{
-				
+				display: flex;
+				border-bottom:1rpx solid #dedede;
+				view{
+					line-height: 60rpx
+					font-weight: 700;
+				}
+				view:nth-child(1){
+				}
+				view:nth-child(2){
+					flex:1;
+					text-align: right;
+				}
 			}
 			.for-img-box{
 				view{
@@ -268,10 +349,12 @@
 					font-weight: 700;
 				}
 				.img-box{
+					display: inline-block;
+					margin:15rpx 30rpx 30rpx 15rpx;
 					width:160rpx;
 					height:160rpx;
 					border-radius:12rpx;
-					margin:15rpx 0;
+					overflow: hidden;
 				}
 			}
 			.for-text-one-box{
@@ -288,6 +371,9 @@
 				}
 			}
 		}
+		.margin-bottom-p{
+			margin-bottom:60rpx;
+		}
 		.bottom-button-box{
 			display: flex;
 			margin:40rpx 30rpx 60rpx;

+ 124 - 64
pages_supplierCylinderManagement/views/gasCylinderManagement/historyRecord.vue

@@ -6,11 +6,12 @@
 				<uni-icons type="search" class="icon-box" color="#7C7C7C" size="25"></uni-icons>
 				<input class="uni-input input-min" confirm-type="search" @confirm="getList()"
 					v-model="inputData" maxlength="20" placeholder="搜索气瓶" />	
+				<view class="button-p" @click="resetButton()">重置</view>
 			</view>
 			<view class="picker-box">
 				<picker @change="bindPickerChangeA" :value="indexA" :range="arrayA">
 					<view class="picker-min-box">
-						<view>{{indexA==null?'已入库':arrayA[indexA]}}</view>
+						<view>{{indexA==null?'状态':arrayA[indexA]}}</view>
 						<uni-icons type="down" class="icon-box" size="15"></uni-icons>
 					</view>
 				</picker>
@@ -22,113 +23,162 @@
 				</picker>
 			</view>
 		</view>
-		<view class="content-box">
+		<scroll-view scroll-y @scrolltolower="scrollGet" class="content-box">
 			<view class="null-p" v-if="!dataList[0]">暂无数据</view>
 			<view class="for-max-big-box" @click="checkButton(item)"
 			v-for="(item,index) in dataList" :key="index">
-				<view class="for-title-box" v-if="item.data6 == 1">
-					<view>气瓶编码:{{item.data1}}</view>
-					<view :class="item.data7==1?'colorA':'colorB'">{{item.data7==1?'已入库':'已出库'}}</view>
+				<view class="for-title-box" v-if="!item.specialGases">
+					<view>气瓶编码:{{item.bottleCode}}</view>
+					<view :class="item.state==1?'colorA':(item.state==2?'colorB':'')">{{item.state==0?'待入库':(item.state==1?'已入库':'已出库')}}</view>
 				</view>
-				<view class="for-title-box" v-if="item.data6 == 2">
-					<view>气体:{{item.data2}}</view>
-					<view :class="item.data7==1?'colorA':'colorB'">{{item.data7==1?'已入库':'已出库'}}</view>
+				<view class="for-title-box" v-if="item.specialGases">
+					<view>气体:{{item.gasName}}</view>
+					<view :class="item.state==1?'colorA':(item.state==2?'colorB':'')">{{item.state==0?'待入库':(item.state==1?'已入库':'已出库')}}</view>
 				</view>
-				<view class="for-text-box" v-if="item.data6 == 1">
+				<view class="for-text-box" v-if="!item.specialGases">
 					<view>气体:</view>
-					<view>{{item.data2}}</view>
+					<view>{{item.gasName}}</view>
 				</view>
 				<view class="for-text-box">
 					<view>纯度:</view>
-					<view>{{item.data2}}</view>
+					<view>{{item.purity}}</view>
 				</view>
 				<view class="for-text-box">
 					<view>实验室名称:</view>
-					<view>{{item.data2}}</view>
+					<view>{{item.subName}}</view>
 				</view>
 				<view class="for-text-box">
-					<view>入库时间:</view>
-					<view>{{item.data3}}</view>
+					<view>{{item.recordType ==1 ?'入库时间':'出库时间'}}:</view>
+					<view>{{item.storageTime}}</view>
 				</view>
 				<view class="for-text-box">
-					<view>入库人:</view>
-					<view>{{item.data4}}</view>
+					<view>{{item.recordType ==1 ?'入库人':'出库人'}}:</view>
+					<view>{{item.operator}}</view>
 				</view>
 			</view>
-		</view>
+		</scroll-view>
 	</view>
 </template>
 
 <script>
+	import {
+		parseTime
+	} from '@/component/public.js'
+	import {
+		airBottleNewQpAppletBottleHistoryPage,airBottleNewQpDictList,
+	} from '@/pages_supplierCylinderManagement/api/index.js'
 	export default {
 		data() {
 			return {
 				inputData:'',
-				arrayA:[],
-				indexA:null,
+				arrayA:['已入库','已出库'],
+				indexA:0,
 				arrayB:[],
 				indexB:null,
-				dataList:[
-					{
-						data1:'1231315',
-						data2:'氢气',
-						data3:'实验室A03',
-						data4:'2026-06-06',
-						data5:'张老师',
-						data6:'1',
-						data7:'1',
-					},
-					{
-						data1:'1231315',
-						data2:'氢气',
-						data3:'实验室A03',
-						data4:'2026-06-06',
-						data5:'张老师',
-						data6:'1',
-						data7:'2',
-					},
-					{
-						data1:'1231315',
-						data2:'氢气',
-						data3:'实验室A03',
-						data4:'2026-06-06',
-						data5:'张老师',
-						data6:'2',
-						data7:'1',
-					},
-					{
-						data1:'1231315',
-						data2:'氢气',
-						data3:'实验室A03',
-						data4:'2026-06-06',
-						data5:'张老师',
-						data6:'2',
-						data7:'2',
-					},
-				],
+				dataList:[],
+				// 查询参数
+				getDataType: false,
+				queryParams: {
+					page: 1,
+					pageSize: 10,
+				},
+				total:0,
 			}
 		},
 		onLoad(option) {
 			
 		},
 		onShow() {
-
+			this.airBottleNewQpDictList1();
+			this.getList();
 		},
 
 		methods: {
 			bindPickerChangeA(e) {
 				this.indexA = e.detail.value
+				this.$set(this.queryParams,'page',1);
+				this.getList();
 			},
 			bindPickerChangeB(e) {
 				this.indexB = e.detail.value
+				this.$set(this.queryParams,'page',1);
+				this.getList();
+			},
+			//滚动加载事件
+			scrollGet() {
+				let self = this;
+				if (self.total / self.queryParams.pageSize <= self.queryParams.page) {
+					this.$set(this, 'getDataType', true);
+				} else {
+					this.queryParams.page += 1;
+					this.$nextTick(() => {
+						this.getList();
+					})
+				}
+			},
+			//搜索
+			async getList() {
+				let self = this;
+				let obj = {
+					page:this.queryParams.page,
+					pageSize:this.queryParams.pageSize,
+					searchValue:this.inputData,
+					state:this.indexA==null?'':(this.indexA==0?1:(this.indexA==1?2:0)),
+					gasName:this.indexB==null?'':this.arrayB[this.indexB],
+				};
+				const {
+					data
+				} = await airBottleNewQpAppletBottleHistoryPage(obj);
+				if (data.code == 200) {
+					
+					for(let i=0;i<data.data.records.length;i++){
+						data.data.records[i].storageTime = parseTime(data.data.records[i].storageTime, "{y}-{m}-{d} {h}:{i}");
+					}
+					if(self.queryParams.page == 1){
+						this.dataList = data.data.records;
+						this.total = data.data.total;
+						if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
+							this.$set(this, 'getDataType', true);
+						}
+					}else{
+						this.dataList = [...this.dataList, ...data.data.records]
+						this.total = data.data.total;
+						if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
+							this.$set(this, 'getDataType', true);
+						}
+					}
+				}
 			},
-			getList(){
-				
+			async airBottleNewQpDictList1() {
+				const {
+					data
+				} = await airBottleNewQpDictList({"typeCode":'gas'});
+				if (data.code == 200) {
+					let list = [];
+					for(let i=0;i<data.data.length;i++){
+						list.push(data.data[i].name);
+					}
+					this.$set(this,'arrayB',list);
+				}
+			},
+			//重置
+			resetButton(){
+				this.$set(this,'inputData','');
+				this.$set(this,'indexA',0);
+				this.$set(this,'indexB',null);
+				this.$set(this,'dataList',[]);
+				this.$set(this,'getDataType',false);
+				this.$set(this,'queryParams',{
+					page: 1,
+					pageSize: 10,
+				});
+				this.$set(this,'total',0);
+				this.getList();
 			},
 			//跳转详情
-			checkButton(){
+			checkButton(item){
 				uni.navigateTo({
-					url: "/pages_supplierCylinderManagement/views/gasCylinderManagement/cylinderDetails?id=1",
+					url: "/pages_supplierCylinderManagement/views/gasCylinderManagement/cylinderDetails?id="+item.id,
 				});
 			},
 		}
@@ -147,7 +197,7 @@
 			.input-box{
 				display: flex;
 				border-radius:40rpx;
-				background-color: #D4D4D4;
+				background-color: #eeeeee;
 				margin:20rpx 20rpx 0 20rpx;
 				color:#7C7C7C;
 				.icon-box{
@@ -158,6 +208,16 @@
 					line-height:80rpx;
 					flex:1;
 				}
+				.button-p{
+					line-height:80rpx;
+					width:120rpx;
+					text-align: center;
+					color:#333;
+					font-size:28rpx;
+					background-color: #D4D4D4;
+					border-top-right-radius:40rpx;
+					border-bottom-right-radius:40rpx;
+				}
 			}
 			.picker-box{
 					display: flex;
@@ -177,7 +237,7 @@
 			display flex ;
 			flex-direction column;
 			overflow: scroll;
-			padding-bottom:200rpx;
+			padding-bottom:40rpx;
 			.null-p{
 				text-align: center;
 				line-height:300rpx;

+ 146 - 43
pages_supplierCylinderManagement/views/gasCylinderManagement/inbound.vue

@@ -12,7 +12,7 @@
 							<uni-icons class="right-icon" type="right"></uni-icons>
 						</view>
 						<view class="content-bottom-text-box" v-if="newData.newData1">
-							<view class="content-text-box">
+							<view class="content-text-box" v-if="!newData.newData0">
 								<view>气瓶编码:</view>
 								<view>{{newData.newData2}}</view>
 							</view>
@@ -28,7 +28,7 @@
 								<view>气体类别:</view>
 								<view>{{newData.newData5}}</view>
 							</view>
-							<view class="content-text-box">
+							<view class="content-text-box" v-if="!newData.newData0">
 								<view>压力:</view>
 								<view>{{newData.newData6}}</view>
 							</view>
@@ -106,10 +106,11 @@
 					<view class="button-box" @click="searchButton()">搜索</view>
 				</view>
 				<view class="list-max-box">
-					<view @click="checkUserButton(item)"
+					<view class="for-p" @click="checkUserButton(item)"
 						v-for="(item,index) in userList" :key="index">
 					{{item.userName}}({{item.account}})
 					</view>
+					<view class="null-p" v-if="!userList[0]">搜索并查询签收人</view>
 				</view>
 			</view>
 		</view>
@@ -121,13 +122,14 @@
 		config
 	} from '@/api/request/config.js'
 	import {
-		systemUserSelectUser
+		systemUserSelectUser,airBottleNewQpAppletBottleStorageIn,
 	} from '@/pages_supplierCylinderManagement/api/index.js'
 	export default {
 		data() {
 			return {
 				baseUrl: config.base_url,
 				newData: {
+					newData0: '',
 					newData1: '',
 					newData2: '',
 					newData3: '',
@@ -137,7 +139,6 @@
 					newData7: '',
 					newData8: '',
 					newData9: '',
-					newData91: '',
 					newData92: '',
 					newData10: '',
 					newData11: '',
@@ -154,26 +155,53 @@
 			}
 		},
 		onLoad(options) {
-			if (options.pageType) {
-				let obj = JSON.parse(decodeURIComponent(options.form));
-				if (options.pageType == 1) {
-					this.$set(this.newData, 'newData1', obj.id);
-					this.$set(this.newData, 'newData2', obj.bottleCode);
-					this.$set(this.newData, 'newData3', obj.gasName);
-					this.$set(this.newData, 'newData4', obj.specification);
-					this.$set(this.newData, 'newData5', obj.gasCategory);
-					this.$set(this.newData, 'newData6', obj.pressure);
-					this.$set(this.newData, 'newData7', obj.purity);
-				} else if (options.pageType == 2) {
-					this.$set(this.newData, 'newData8', obj.subId);
-					this.$set(this.newData, 'newData9', obj.subName);
-					this.$set(this.newData, 'newData92', obj.deptId);
-					this.$set(this.newData, 'newData10', obj.buildName);
-					this.$set(this.newData, 'newData11', obj.floorName);
-					this.$set(this.newData, 'newData12', obj.roomNum);
+			uni.$on('refreshBPageData', (data) => {
+				if (data.pageType == 1) {
+					this.$set(this.newData, 'newData0', data.specialGases);
+					this.$set(this.newData, 'newData1', data.id);
+					this.$set(this.newData, 'newData2', data.bottleCode);
+					this.$set(this.newData, 'newData3', data.gasName);
+					this.$set(this.newData, 'newData4', data.specification);
+					this.$set(this.newData, 'newData5', data.gasCategory);
+					this.$set(this.newData, 'newData6', data.pressure);
+					this.$set(this.newData, 'newData7', data.purity);
+				} else if (data.pageType == 2) {
+					this.$set(this.newData, 'newData8', data.subId);
+					this.$set(this.newData, 'newData9', data.subName);
+					this.$set(this.newData, 'newData92', data.deptId);
+					this.$set(this.newData, 'newData10', data.buildName);
+					this.$set(this.newData, 'newData11', data.floorName);
+					this.$set(this.newData, 'newData12', data.roomNum);
 				}
-			}
+			});
+		},
+		onUnload() { 
+			uni.$off('refreshBPageData'); 
 		},
+		// onLoad(options) {
+		// 	if (options.pageType) {
+		// 		this.$set(this,'newData',JSON.parse(uni.getStorageSync('inboundData')));
+		// 		uni.removeStorageSync('inboundData')
+		// 		let obj = JSON.parse(decodeURIComponent(options.form));
+		// 		if (options.pageType == 1) {
+		// 			this.$set(this.newData, 'newData0', obj.specialGases);
+		// 			this.$set(this.newData, 'newData1', obj.id);
+		// 			this.$set(this.newData, 'newData2', obj.bottleCode);
+		// 			this.$set(this.newData, 'newData3', obj.gasName);
+		// 			this.$set(this.newData, 'newData4', obj.specification);
+		// 			this.$set(this.newData, 'newData5', obj.gasCategory);
+		// 			this.$set(this.newData, 'newData6', obj.pressure);
+		// 			this.$set(this.newData, 'newData7', obj.purity);
+		// 		} else if (options.pageType == 2) {
+		// 			this.$set(this.newData, 'newData8', obj.subId);
+		// 			this.$set(this.newData, 'newData9', obj.subName);
+		// 			this.$set(this.newData, 'newData92', obj.deptId);
+		// 			this.$set(this.newData, 'newData10', obj.buildName);
+		// 			this.$set(this.newData, 'newData11', obj.floorName);
+		// 			this.$set(this.newData, 'newData12', obj.roomNum);
+		// 		}
+		// 	}
+		// },
 		onShow() {
 
 		},
@@ -192,6 +220,48 @@
 			},
 			//提交方法
 			submitButton() {
+				let self = this;
+				if(!this.newData.newData1){
+					uni.showToast({
+						title: '请选择气瓶',
+						icon: "error",
+						mask: true,
+						duration: 2000
+					});
+					return
+				}else if(!this.newData.newData8){
+					uni.showToast({
+						title: '请选择实验室',
+						icon: "error",
+						mask: true,
+						duration: 2000
+					});
+					return
+				}else if(!this.newData.newData133){
+					uni.showToast({
+						title: '请选择签收人',
+						icon: "error",
+						mask: true,
+						duration: 2000
+					});
+					return
+				}else if(!this.newData.newData14){
+					uni.showToast({
+						title: '请输入金额',
+						icon: "error",
+						mask: true,
+						duration: 2000
+					});
+					return
+				}else if(!this.newData.newData15[0]){
+					uni.showToast({
+						title: '请上传入库单',
+						icon: "error",
+						mask: true,
+						duration: 2000
+					});
+					return
+				}
 				uni.showModal({
 					title: '确认入库',
 					content: '确认后,该气体气瓶的当前状态将变更为已入库。',
@@ -201,19 +271,43 @@
 					confirmColor: '#2684D8',
 					success: (res) => {
 						if (res.confirm) {
-							uni.showToast({
-								title: '入库完成',
-								icon: "success",
-								mask: true,
-								duration: 2000
-							});
-							setTimeout(function() {
-								uni.navigateBack();
-							}, 2000);
+							self.airBottleNewQpAppletBottleStorageIn();
 						}
 					}
 				});
 			},
+			//入库
+			async airBottleNewQpAppletBottleStorageIn() {
+				let obj = {
+					bottleId:this.newData.newData1,
+					deptId:this.newData.newData92,
+					subId:this.newData.newData8,
+					receiver:this.newData.newData13,
+					receiverId:this.newData.newData133,
+					cost:this.newData.newData14,
+					voucherUrl:this.newData.newData15+'',
+					remark:this.newData.newData16,
+					specialGases:this.newData.newData0,
+					source:'2',
+				};
+				const {
+					data
+				} = await airBottleNewQpAppletBottleStorageIn(obj);
+				if (data.code == 200) {
+					uni.showToast({
+						title: '入库完成',
+						icon: "success",
+						mask: true,
+						duration: 2000
+					});
+					setTimeout(function() {
+						uni.navigateBack({ delta: 1 });
+						// uni.redirectTo({
+						// 	url: '/pages_supplierCylinderManagement/views/gasCylinderManagement/index',
+						// });
+					}, 2000);
+				}
+			},
 			/******图片上传******/
 			selectImage() {
 				let self = this;
@@ -577,18 +671,27 @@
 					height:660rpx;
 					overflow-y: scroll;
 					border-top: 1rpx solid #dedede;
-					view:nth-child(1){
-						border:none;
+					
+					.for-p:nth-child(1) {
+						border: none;
+					}
+					
+					.for-p {
+						font-size: 28rpx;
+						padding: 20rpx 40rpx;
+						line-height: 60rpx;
+						border-top: 1rpx solid #dedede;
+						display:block;
+						overflow:hidden;
+						text-overflow:ellipsis;
+						white-space:nowrap;
 					}
-					view{
-						font-size:28rpx;
-						padding:20rpx 40rpx;
-						line-height:60rpx;
-						border-top:1rpx solid #dedede;
-						display block;
-						overflow hidden;
-						text-overflow ellipsis;
-						white-space nowrap;
+					
+					.null-p {
+						text-align: center;
+						font-size: 28rpx;
+						color: #999;
+						line-height: 300rpx;
 					}
 				}
 			}

+ 181 - 37
pages_supplierCylinderManagement/views/gasCylinderManagement/outbound.vue

@@ -11,8 +11,9 @@
 							<view>{{newData.newData1?'更改':'请选择'}}</view>
 							<uni-icons class="right-icon" type="right"></uni-icons>
 						</view>
-						<view class="content-bottom-text-box" v-if="newData.newData1">
-							<view class="content-text-box">
+						<view class="content-bottom-text-box" :class="!detailsType?'border-top-box':''"
+						 v-if="newData.newData1">
+							<view class="content-text-box" v-if="!newData.newData0">
 								<view>气瓶编码:</view>
 								<view>{{newData.newData2}}</view>
 							</view>
@@ -28,7 +29,7 @@
 								<view>气体类别:</view>
 								<view>{{newData.newData5}}</view>
 							</view>
-							<view class="content-text-box">
+							<view class="content-text-box" v-if="!newData.newData0">
 								<view>压力:</view>
 								<view>{{newData.newData6}}</view>
 							</view>
@@ -39,10 +40,10 @@
 						</view>
 					</view>
 				</view>
-				<view class="content-big-box">
+				<view class="content-big-box" v-if="newData.newData8">
 					<view class="content-title-p">实验室信息</view>
 					<view class="content-min-box">
-						<view class="content-bottom-text-box" v-if="newData.newData8">
+						<view class="content-bottom-text-box">
 							<view class="content-text-box">
 								<view>实验室名称:</view>
 								<view>{{newData.newData9}}</view>
@@ -73,16 +74,19 @@
 						</picker>
 						<view class="content-max-input-box" style="margin:0;">
 							<view class="name-box">费用</view>
-							<input class="uni-input input-box" v-if="newData.newData17 != 2" v-model="newData.newData14" type="number"
+							<view class="input-box" style="color:#808080;" @click='shadeButton(1)'>
+								{{newData.newData17 != 2?newData.newData14:'0'}}</view>
+							<!-- <input class="uni-input input-box" v-if="newData.newData17 != 2" v-model="newData.newData14" type="number"
 								maxlength="10" placeholder="请输入" />
-							<p class="input-box" v-if="newData.newData17 == 2">0</p>
+							<p class="input-box" v-if="newData.newData17 == 2">0</p> -->
 						</view>
 					</view>
 				</view>
 				<view class="content-max-input-box">
 					<view class="name-box">签出人</view>
 					<view class="input-box" style="color:#808080;" @click='shadeButton(1)'>
-						{{newData.newData13?newData.newData13:'请选择'}}</view>
+						{{newData.newData13?newData.newData13:'请选择'}}
+					</view>
 				</view>
 				<view class="content-max-up-box">
 					<view class="name-box">出库单</view>
@@ -114,9 +118,11 @@
 					<view class="button-box" @click="searchButton()">搜索</view>
 				</view>
 				<view class="list-max-box">
-					<view @click="checkUserButton(item)" v-for="(item,index) in userList" :key="index">
+					<view class="for-p" @click="checkUserButton(item)" 
+						v-for="(item,index) in userList" :key="index">
 						{{item.userName}}({{item.account}})
 					</view>
+					<view class="null-p" v-if="!userList[0]">搜索并查询签出人</view>
 				</view>
 			</view>
 		</view>
@@ -128,7 +134,9 @@
 		config
 	} from '@/api/request/config.js'
 	import {
-		systemUserSelectUser
+		systemUserSelectUser,
+		airbottleNewQpAppletBottleDetail,
+		airBottleNewQpAppletBottleStorageOut,
 	} from '@/pages_supplierCylinderManagement/api/index.js'
 	export default {
 		data() {
@@ -136,6 +144,7 @@
 				baseUrl: config.base_url,
 				detailsType: false,
 				newData: {
+					newData0: '',
 					newData1: '',
 					newData2: '',
 					newData3: '',
@@ -145,6 +154,7 @@
 					newData7: '',
 					newData8: '',
 					newData9: '',
+					newData92: '',
 					newData10: '',
 					newData11: '',
 					newData12: '',
@@ -157,22 +167,56 @@
 				},
 				array: ['空瓶出库', '满瓶出库'],
 				inputData: '',
-				userList:[],
-				shadeType:false,
+				userList: [],
+				shadeType: false,
 			}
 		},
 		onLoad(options) {
+			uni.$on('refreshBPageData', (data) => {
+				this.$set(this.newData, 'newData1', data.id);
+				this.airbottleNewQpAppletBottleDetail(data.id);
+			});
+			if (options.id) {
+				this.$set(this, 'detailsType', true);
+				this.$set(this.newData, 'newData1', options.id);
+				this.airbottleNewQpAppletBottleDetail(options.id);
+				// let obj = JSON.parse(decodeURIComponent(options.infoData));
+				// this.$set(this, 'detailsType', true);
+				// this.$set(this, 'newData', {
+				// 	newData0: obj.specialGases,
+				// 	newData1: obj.id,
+				// 	newData2: obj.bottleCode,
+				// 	newData3: obj.gasName,
+				// 	newData4: obj.specification,
+				// 	newData5: obj.gasCategory,
+				// 	newData6: obj.pressure,
+				// 	newData7: obj.purity,
+				// 	newData8: obj.subId,
+				// 	newData9: obj.subName,
+				// 	newData92: obj.deptId,
+				// 	newData10: obj.buildName,
+				// 	newData11: obj.floorName,
+				// 	newData12: obj.roomNum,
+				// 	newData13: '',
+				// 	newData133: '',
+				// 	newData14: obj.latestStorageIn.cost,
+				// 	newData15: [],
+				// 	newData16: '',
+				// 	newData17: '',
+				// });
+			}
+		},
+		onUnload() {
+			uni.$off('refreshBPageData');
+		},
+		/*
+		onLoad(options) {
 			if (options.pageType) {
 				let obj = JSON.parse(decodeURIComponent(options.form));
 				if (options.pageType == 1) {
 					//选择气瓶
 					this.$set(this.newData, 'newData1', obj.id);
-					this.$set(this.newData, 'newData2', obj.bottleCode);
-					this.$set(this.newData, 'newData3', obj.gasName);
-					this.$set(this.newData, 'newData4', obj.specification);
-					this.$set(this.newData, 'newData4', obj.gasCategory);
-					this.$set(this.newData, 'newData4', obj.pressure);
-					this.$set(this.newData, 'newData4', obj.purity);
+					this.airbottleNewQpAppletBottleDetail(obj.id);
 				} else if (options.pageType == 2) {
 					//选择实验室
 					this.$set(this.newData, 'newData5', obj.data5);
@@ -180,18 +224,44 @@
 					this.$set(this.newData, 'newData7', obj.data7);
 					this.$set(this.newData, 'newData8', obj.data8);
 				} else if (options.pageType == 3) {
-					//历史记录-气瓶出
-					this.$set(this, 'detailsType', true);
+					//历史记录-气瓶出
+					this.$set(this, 'detailsType', true);
 					this.$set(this.newData, 'newData1', "1");
 					this.$set(this.newData, 'newData8', "1");
 				}
 			}
 		},
+		*/
 		onShow() {
 
 		},
 
 		methods: {
+			//气瓶详情
+			async airbottleNewQpAppletBottleDetail(id) {
+				const {
+					data
+				} = await airbottleNewQpAppletBottleDetail({
+					id: id
+				});
+				if (data.code == 200) {
+					this.$set(this.newData, 'newData0', data.data.specialGases);
+					this.$set(this.newData, 'newData2', data.data.bottleCode);
+					this.$set(this.newData, 'newData3', data.data.gasName);
+					this.$set(this.newData, 'newData4', data.data.specification);
+					this.$set(this.newData, 'newData5', data.data.gasCategory);
+					this.$set(this.newData, 'newData6', data.data.pressure);
+					this.$set(this.newData, 'newData7', data.data.purity);
+					this.$set(this.newData, 'newData8', data.data.subId);
+					this.$set(this.newData, 'newData9', data.data.subName);
+					this.$set(this.newData, 'newData92', data.data.deptId);
+					this.$set(this.newData, 'newData10', data.data.buildName);
+					this.$set(this.newData, 'newData11', data.data.floorName);
+					this.$set(this.newData, 'newData12', data.data.roomNum);
+					this.$set(this.newData, 'newData14', data.data.cost);
+				}
+			},
+			//出库状态切换
 			bindPickerChange(e) {
 				if (e.detail.value == 0) {
 					this.$set(this.newData, 'newData17', 1)
@@ -212,6 +282,40 @@
 			},
 			//提交方法
 			submitButton() {
+				let self = this;
+				if (!this.newData.newData1) {
+					uni.showToast({
+						title: '请选择气瓶',
+						icon: "error",
+						mask: true,
+						duration: 2000
+					});
+					return
+				} else if (!this.newData.newData17) {
+					uni.showToast({
+						title: '请选择出库类型',
+						icon: "error",
+						mask: true,
+						duration: 2000
+					});
+					return
+				} else if (!this.newData.newData133) {
+					uni.showToast({
+						title: '请选择签出人',
+						icon: "error",
+						mask: true,
+						duration: 2000
+					});
+					return
+				} else if (!this.newData.newData15[0]) {
+					uni.showToast({
+						title: '请上传出库单',
+						icon: "error",
+						mask: true,
+						duration: 2000
+					});
+					return
+				}
 				uni.showModal({
 					title: '确认出库',
 					content: '确认后,该气体气瓶的当前状态将变更为已出库。',
@@ -221,19 +325,49 @@
 					confirmColor: '#2684D8',
 					success: (res) => {
 						if (res.confirm) {
-							uni.showToast({
-								title: '出库完成',
-								icon: "success",
-								mask: true,
-								duration: 2000
-							});
-							setTimeout(function() {
-								uni.navigateBack();
-							}, 2000);
+							self.airBottleNewQpAppletBottleStorageOut();
 						}
 					}
 				});
 			},
+			//出库
+			async airBottleNewQpAppletBottleStorageOut() {
+				let self = this;
+				let obj = {
+					bottleId: this.newData.newData1,
+					outType: this.newData.newData17,
+					signerOut: this.newData.newData13,
+					signerOutId: this.newData.newData133,
+					voucherUrl: this.newData.newData15 + '',
+					remark: this.newData.newData16,
+					source: '2',
+				};
+				const {
+					data
+				} = await airBottleNewQpAppletBottleStorageOut(obj);
+				if (data.code == 200) {
+					uni.showToast({
+						title: '出库完成',
+						icon: "success",
+						mask: true,
+						duration: 2000
+					});
+					setTimeout(function() {
+						uni.navigateBack({
+							delta: self.detailsType?2:1
+						});
+						// if(self.detailsType){
+						// 	uni.redirectTo({
+						// 		url: '/pages_supplierCylinderManagement/views/gasCylinderManagement/cylinderDetails',
+						// 	});
+						// }else{
+						// 	uni.redirectTo({
+						// 		url: '/pages_supplierCylinderManagement/views/gasCylinderManagement/index',
+						// 	});
+						// }
+					}, 2000);
+				}
+			},
 			/******图片上传******/
 			selectImage() {
 				let self = this;
@@ -384,10 +518,13 @@
 						background-color: #fff;
 						border-radius: 12rpx;
 
+						.border-top-box {
+							border-top: 1rpx solid #dedede;
+						}
+
 						.content-check-box {
 							display: flex;
 							padding: 40rpx 30rpx;
-							border-bottom: 1rpx solid #dedede;
 
 							view {
 								font-size: 30rpx;
@@ -598,19 +735,26 @@
 					overflow-y: scroll;
 					border-top: 1rpx solid #dedede;
 
-					view:nth-child(1) {
+					.for-p:nth-child(1) {
 						border: none;
 					}
 
-					view {
+					.for-p {
 						font-size: 28rpx;
 						padding: 20rpx 40rpx;
-						line-height:60rpx;
+						line-height: 60rpx;
 						border-top: 1rpx solid #dedede;
-						display block;
-						overflow hidden;
-						text-overflow ellipsis;
-						white-space nowrap;
+						display:block;
+						overflow:hidden;
+						text-overflow:ellipsis;
+						white-space:nowrap;
+					}
+
+					.null-p {
+						text-align: center;
+						font-size: 28rpx;
+						color: #999;
+						line-height: 300rpx;
 					}
 				}
 			}

+ 84 - 12
pages_supplierCylinderManagement/views/gasCylinderManagement/selectCylinder.vue

@@ -27,7 +27,7 @@
 			<view class="null-p" v-if="!dataList[0]">暂无数据</view>
 			<view class="for-max-big-box" @click="checkButton(item)"
 			v-for="(item,index) in dataList" :key="index">
-				<view class="for-title-box" v-if="item.specialGases == 0">
+				<view class="for-title-box" v-if="!item.specialGases">
 					<view>气瓶编码:</view>
 					<view>{{item.bottleCode}}</view>
 				</view>
@@ -43,7 +43,7 @@
 					<view>气体类别:</view>
 					<view>{{item.gasCategory}}</view>
 				</view>
-				<view class="for-text-box" v-if="item.specialGases == 0">
+				<view class="for-text-box" v-if="!item.specialGases">
 					<view>压力:</view>
 					<view>{{item.pressure}}</view>
 				</view>
@@ -53,12 +53,13 @@
 				</view>
 			</view>
 		</scroll-view>
-		<uni-icons class="sao-code-box" type="scan" color="#fff" size="25"></uni-icons>
+		<uni-icons class="sao-code-box" type="scan" color="#fff" size="25" @click="saoCode()"></uni-icons>
 	</view>
 </template>
 
 <script>
 	import {
+		airBottleNewQpAppletBottleScan,
 		airbottleNewQpAppletBottlePage,airBottleNewQpDictList,
 	} from '@/pages_supplierCylinderManagement/api/index.js'
 	export default {
@@ -111,7 +112,7 @@
 					})
 				}
 			},
-			//搜索用户
+			//搜索
 			async getList() {
 				let self = this;
 				let obj = {
@@ -121,6 +122,11 @@
 					gasName:this.indexA==null?'':this.arrayA[this.indexA],
 					gasCategory:this.indexB==null?'':this.arrayB[this.indexB],
 				};
+				if(this.fromPage == 1){
+					obj.state = 0;
+				}else{
+					obj.state = 1;
+				}
 				const {
 					data
 				} = await airbottleNewQpAppletBottlePage(obj);
@@ -180,6 +186,7 @@
 			},
 			checkButton(item){
 				let obj = {
+					pageType:1,
 					id:item.id,
 					bottleCode:item.bottleCode,
 					gasName:item.gasName,
@@ -187,15 +194,80 @@
 					gasCategory:item.gasCategory,
 					pressure:item.pressure,
 					purity:item.purity,
+					specialGases:item.specialGases,
 				}
-				if(this.fromPage == 1){
-					uni.redirectTo({
-						url: '/pages_supplierCylinderManagement/views/gasCylinderManagement/inbound?form='+encodeURIComponent(JSON.stringify(obj))+'&pageType=1'
-					});
-				}else if(this.fromPage == 2){
-					uni.redirectTo({
-						url: '/pages_supplierCylinderManagement/views/gasCylinderManagement/outbound?form='+encodeURIComponent(JSON.stringify(obj))+'&pageType=1'
-					});
+				uni.$emit('refreshBPageData', obj);
+				uni.navigateBack({ delta: 1 });
+			},
+			/* 扫一扫*/
+			saoCode() {
+				let self = this;
+				uni.scanCode({
+					onlyFromCamera: true,
+					success: function(res) {
+						if(res.result.indexOf('type') != -1){
+							let list = res.result.split("?")[1].split("&");
+							let codeData = {};
+							list.forEach((item) => {
+								codeData[item.split("=")[0]] = item.split("=")[1];
+							})
+							if (codeData.type == 'gasCylinder' && codeData.code) {
+								self.airBottleNewQpAppletBottleScan(codeData.code);
+							}else{
+								uni.showToast({
+									title: '请扫描正确的二维码',
+									icon: "error",
+									mask: true,
+									duration: 2000
+								});
+							}
+						}else{
+							uni.showToast({
+								title: '请扫描正确的二维码',
+								icon: "error",
+								mask: true,
+								duration: 2000
+							});
+						}
+					}
+				});
+			},
+			async airBottleNewQpAppletBottleScan(code) {
+				const {
+					data
+				} = await airBottleNewQpAppletBottleScan({code:code});
+				if (data.code == 200) {
+					if(this.fromPage == 1 && data.data.state != 0){
+						uni.showToast({
+							title: '非待入库状态,无法入库',
+							icon:"none",
+							mask:true,
+							duration: 3000
+						});
+						return
+					}
+					if(this.fromPage == 2 && data.data.state != 1){
+						uni.showToast({
+							title: '非使用中状态,无法出库',
+							icon:"none",
+							mask:true,
+							duration: 3000
+						});
+						return
+					}
+					let obj = {
+						pageType:1,
+						id:data.data.id,
+						bottleCode:data.data.bottleCode,
+						gasName:data.data.gasName,
+						specification:data.data.specification,
+						gasCategory:data.data.gasCategory,
+						pressure:data.data.pressure,
+						purity:data.data.purity,
+						specialGases:data.data.specialGases,
+					}
+					uni.$emit('refreshBPageData', obj);
+					uni.navigateBack({ delta: 1 });
 				}
 			},
 		}

+ 61 - 15
pages_supplierCylinderManagement/views/gasCylinderManagement/selectLab.vue

@@ -68,7 +68,7 @@
 				</view>
 			</view>
 		</scroll-view>
-		<uni-icons class="sao-code-box" type="scan" color="#fff" size="25"></uni-icons>
+		<uni-icons class="sao-code-box" type="scan" color="#fff" size="25" @click="saoCode()"></uni-icons>
 	</view>
 </template>
 
@@ -77,6 +77,7 @@
 		getDeptDropList,
 		systemBuildingGetTreeList,
 		airbottleNewQpAppletBottleSubjectsPage,
+		airBottleNewQpAppletBottleSubjectsInfo,
 	} from '@/pages_supplierCylinderManagement/api/index.js'
 	export default {
 		data() {
@@ -287,6 +288,7 @@
 			},
 			checkButton(item) {
 				let obj = {
+					pageType:2,
 					subId:item.subId,
 					deptId:item.deptId,
 					subName:item.subName,
@@ -294,16 +296,58 @@
 					floorName:item.floorName,
 					roomNum:item.roomNum,
 				}
-				if (this.fromPage == 1) {
-					uni.redirectTo({
-						url: '/pages_supplierCylinderManagement/views/gasCylinderManagement/inbound?form=' + encodeURIComponent(
-							JSON.stringify(obj)) + '&pageType=2'
-					});
-				} else if (this.fromPage == 2) {
-					uni.redirectTo({
-						url: '/pages_supplierCylinderManagement/views/gasCylinderManagement/outbound?form=' + encodeURIComponent(
-							JSON.stringify(obj)) + '&pageType=2'
-					});
+				uni.$emit('refreshBPageData', obj);
+				uni.navigateBack({ delta: 1 });
+			},
+			/* 扫一扫*/
+			saoCode() {
+				let self = this;
+				uni.scanCode({
+					onlyFromCamera: true,
+					success: function(res) {
+						if(res.result.indexOf('type') != -1){
+							let list = res.result.split("?")[1].split("&");
+							let codeData = {};
+							list.forEach((item) => {
+								codeData[item.split("=")[0]] = item.split("=")[1];
+							})
+							if (codeData.type == '5' && codeData.subId) {
+								self.airBottleNewQpAppletBottleSubjectsInfo(codeData.subId);
+							}else{
+								uni.showToast({
+									title: '请扫描正确的二维码',
+									icon: "error",
+									mask: true,
+									duration: 2000
+								});
+							}
+						}else{
+							uni.showToast({
+								title: '请扫描正确的二维码',
+								icon: "error",
+								mask: true,
+								duration: 2000
+							});
+						}
+					}
+				});
+			},
+			async airBottleNewQpAppletBottleSubjectsInfo(subId) {
+				const {
+					data
+				} = await airBottleNewQpAppletBottleSubjectsInfo({subId:subId});
+				if (data.code == 200) {
+					let obj = {
+						pageType:2,
+						subId:data.data.subId,
+						deptId:data.data.deptId,
+						subName:data.data.subName,
+						buildName:data.data.buildName,
+						floorName:data.data.floorName,
+						roomNum:data.data.roomNum,
+					}
+					uni.$emit('refreshBPageData', obj);
+					uni.navigateBack({ delta: 1 });
 				}
 			},
 		}
@@ -391,19 +435,21 @@
 					margin-bottom: 20rpx;
 
 					view {
-						padding-bottom: 20rpx;
-						line-height: 60rpx;
+						padding:15rpx 0 35rpx 0;
+						// padding-bottom: 20rpx;
+						line-height: 30rpx;
 						border-bottom: 1rpx solid #dedede;
 						font-weight: 700;
 					}
 
 					view:nth-child(1) {
+						min-width:200rpx;
 						color: #666666;
+						flex: 1;
 					}
 
 					view:nth-child(2) {
-						flex: 1;
-						text-align: right;
+						text-align: left;
 					}
 				}