heyang 1 年之前
父節點
當前提交
a898ac8abc

+ 11 - 1
pages/gasBottle/gasManage/gasManage.vue

@@ -36,7 +36,7 @@
 </template>
 
 <script>
-    import {useRecordList,airbottleStockFindByBeaconTag,airbottleUsageRecordList,warningNoticeLogGetDisposeCount} from '@/api/index.js'
+    import {useRecordList,airbottleStockFindByBeaconTag,airbottleUsageRecordList,warningNoticeLogGetDisposeCount,getDicts} from '@/api/index.js'
 	import { config } from '@/api/request/config.js'
     export default {
         data() {
@@ -68,6 +68,7 @@
 		mounted() {
 			this.warningNoticeLogGetDisposeCount()
 			this.getList();
+			this.bottleColourFun();
 		},
         methods: {
 			handleClick(doType) {
@@ -100,6 +101,15 @@
 
 
 			},
+			//气瓶颜色
+			async bottleColourFun(){
+				const {data} = await getDicts('bottle_db_colour');
+				if(data.code == 200){
+				  if(data.data[0]){
+					uni.setStorageSync('bottleColor', data.data)  
+				  }
+				}
+			},
 			
 			//使用记录跳转详情
 			goInfo(d){

+ 0 - 3
pages/gasBottle/stockList/seleteGas.vue

@@ -76,7 +76,6 @@ export default {
 	  },
 	  //点击选择实验室
 	  labSelete(item){
-	  	console.log(item)
 		 this.$set(this.form,'gasName',item.gasName);
 		 this.$set(this.form,'gasComposition',item.gasComposition);
 		 this.$set(this.form,'level',item.level);
@@ -125,8 +124,6 @@ export default {
 				  }
 				  
 			  }
-			  
-			  console.log(data.data.records)
 			  this.dataList=[...this.dataList,...data.data.records]
 			  _this.total=data.data.total;
 		  }

+ 81 - 32
pages/gasBottle/stockList/storageAdd.vue

@@ -14,6 +14,21 @@
 			</view>
 		</view>
 		<view class="register_li">
+			<view class="register_li_min" style="border:0;" v-if="isSelect">
+				<view></view>
+				<view>瓶身颜色:</view>
+				<picker @change="bottleColorChange"  :range="bottleColorArr">
+					<input class="picker-text" v-model="form.bottleColour" disabled type="text" placeholder-style="color:#999; text-align: right;font-size:24rpx;" placeholder="请选择瓶身颜色">
+				</picker>
+			</view>
+			<view class="register_li_min" style="border:0;" v-if="!isSelect">
+				<view></view>
+				<view>瓶身颜色:</view>
+				<input class="picker-text" v-model="form.bottleColour"  type="text" placeholder-style="color:#999; text-align: right;font-size:24rpx;" placeholder="请输入瓶身颜色">
+			</view>
+			<view class="custom_li_min" style="justify-content: flex-end;">
+				<view class="custom"  @click="selectFun">{{isSelect?'自定义输入':'选择颜色'}}</view>
+			</view>
 			<view class="register_li_min" v-for="(item,index) in list">
 				<view></view>
 				<view>{{item.name}}</view>
@@ -49,7 +64,6 @@
 				<picker @change="bindPickerChange" :value="laboratoryIndex" :range="laboratory">
 					<input class="picker-text" v-model="form.subjectName" disabled type="text" placeholder-style="color:#999; text-align: right;font-size:24rpx;" placeholder="请选择入库实验室">
 				</picker>
-				
 			</view>
 			<view class="register_li_min" style="border: none;">
 			    <view>*</view>
@@ -75,32 +89,12 @@
 				infoForm:{},
 				item:{},
 				id:{},
+				bottleColorArr:[],
+				bottleColorArrList:uni.getStorageSync('bottleColor'),
+				isSelect:true,
 				list:[
 					{
 						id:'0',
-						name:'瓶身颜色:',
-						lab:'color',
-						radioList:[
-							{
-								id:1,
-								name:'灰',
-								checked:true,
-							},
-							{
-								id:2,
-								name:'白',
-								checked:false,
-							},
-							{
-								id:3,
-								name:'蓝',
-								checked:false,
-							},
-						]
-
-					},
-					{
-						id:'0',
 						name:'有无手轮:',
 						lab:'isHandwheel',
 						radioList:[
@@ -171,19 +165,39 @@
 						]
 
 					}
-				]
-            }
+				],
+				
+            
+			}
         },
         onLoad(option) {
+			let self=this;
+			//获取气瓶颜色
+			if(this.bottleColorArrList){
+				let list = [];
+				for(let i=0;i<this.bottleColorArrList.length;i++){
+					list.push(this.bottleColorArrList[i].dictValue);
+				}
+				this.bottleColorArr = Array.from(new Set(list));
+			}
 			if(option.form){
-				this.form=JSON.parse(decodeURIComponent(option.form)); 
+				this.form=JSON.parse(decodeURIComponent(option.form));
+				if(this.form.gasName){
+					self.$set(self.form,'bottleColour','');
+					console.log(this.bottleColorArrList)
+					this.bottleColorArrList.forEach(function(item){
+						if(self.form.gasName==item.dictLabel){
+							self.$set(self.form,'bottleColour',item.dictValue);
+						}
+					})
+				}
 			}
         },
         onShow(){
-
         },
 		mounted(){
 			this.getSubjectDict();
+			
 		},
         methods: {
 			//限制只能输入数字
@@ -199,6 +213,15 @@
 					}
 				})
 			},
+			//颜色选择
+			selectFun(){
+				if(this.isSelect){
+					this.isSelect=false;
+				}else{
+					this.isSelect=true;
+				}
+				this.form.bottleColour='';
+			},
 			//开始时间选中事件
 			startChange(e){
 				this.$set(this.form,'validPeriod',e.target.value);
@@ -215,6 +238,13 @@
 					}
 				})
 			},
+			
+			//气瓶颜色选择
+			bottleColorChange(e){
+				let self=this;
+				let bottleColour = self.bottleColorArr[e.target.value];
+				self.$set(self.form,'bottleColour',bottleColour);
+			},
 			//单选按钮
 			radioClick(p,d){
 				d.checked=!d.checked
@@ -238,7 +268,6 @@
 			    uni.scanCode({
 			        onlyFromCamera: true,
 			        success: function (res) {
-						console.log(res.result)
 						_this.$set(_this.form,'beaconTag',res.result);
 			        }
 			    });
@@ -314,9 +343,7 @@
 				}
 				_this.list.forEach(function(item){
 					item.radioList.forEach(function(item2){
-						if(item.lab=='color' && item2.checked){
-							_this.form.bottleColour=item2.id;
-						}else if(item.lab=='isHandwheel' && item2.checked){
+						if(item.lab=='isHandwheel' && item2.checked){
 							_this.form.handwheel=item2.id;
 						}else if(item.lab=='isFixed' && item2.checked){
 							_this.form.fixed=item2.id;
@@ -469,6 +496,28 @@
 
 		}
 		/* 按钮 */
+		.custom_li_min{
+			margin:0 26rpx;
+			display flex;
+			align-items center;
+			border-bottom: 1px solid #F5F5F5;
+			.custom{
+				width: 150rpx;
+				height: 60rpx;
+				border-radius: 10rpx 10rpx 10rpx 10rpx;
+				opacity: 1;
+				border: 1rpx solid #0183FA;
+				font-size: 26rpx;
+				font-family: PingFang SC-Medium, PingFang SC;
+				font-weight: 400;
+				color: #0183FA;
+				line-height: 60rpx;
+				text-align: center;
+				float: right;
+				margin-bottom: 12rpx;
+			}
+		}
+		
 		/* 按钮 */
 		.sub_btn{
 			width: 650rpx;