123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480 |
- <!-- 新增入库 -->
- <template>
- <view id="register">
- <view class="register_li">
- <view class="register_li_min" @click="seleteGasFun()">
- <view>*</view>
- <view style="color: #999999;">气瓶:</view>
- <input v-model="form.gasName" disabled placeholder="请选择气瓶" placeholder-style="color:#333;" type="text" >
- </view>
- <view class="register_li_min" style="border-bottom:0;">
- <view></view>
- <view style="color: #999999;">气体规格:</view>
- <input v-model="form.levelSizeName" disabled type="text" >
- </view>
- </view>
- <view class="register_li">
- <view class="register_li_min" v-for="(item,index) in list">
- <view></view>
- <view>{{item.name}}</view>
- <view class="radio_group">
- <view class="radio" v-for="(item2,index2) in item.radioList" @click="radioClick(item,item2)">
- <img v-if="!item2.checked" src="@/pages_manage/images/icon_5.png">
- <img v-if="item2.checked" src="@/pages_manage/images/icon_6.png">
- <text>{{item2.name}}</text>
- </view>
- </view>
- </view>
- <view class="register_li_min">
- <view>*</view>
- <view>气表压力:</view>
- <input v-model="form.gasPressure" maxlength="4" type="text" placeholder-style="color:#999;" placeholder="请输入气表压力">
- </view>
- <!-- 检验有效期 -->
- <view class="register_li_min2">
- <view><text style="color: #f00;margin-right: 10rpx;">*</text>检验有效期:</view>
- <picker mode="date" @change="startChange($event)">
- <input class="picker-text" v-model="form.validPeriod" disabled type="text" placeholder-style="color:#999;" placeholder="时间">
- </picker>
- </view>
- <view class="register_li_min" >
- <view>*</view>
- <view>信标标签:</view>
- <input v-model="form.beaconTag" type="text" placeholder-style="color:#999;" placeholder="请输入信标标签ID">
- <img @click.stop="saoCode" class="code_img" src="@/pages_manage/images/Version2.2/icon_aqjc_sm.png">
- </view>
- <view class="register_li_min">
- <view>*</view>
- <view>实验室:</view>
- <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>
- <view>备注:</view>
- <input v-model="form.remark" type="text" placeholder-style="color:#999;" placeholder="请输入验收备注">
- </view>
- </view>
- <view class="sub_btn" @click="submitForm()">确认信息并入库</view>
- </view>
- </template>
- <script>
- import {gasApplyDetailDrkDetail,gasApplyStorageAdd,getSubjectDict,airbottleStockEnter} from '@/api/index.js'
- import { config } from '@/api/request/config.js'
- export default {
- data() {
- return {
- form:{
- },
- laboratory:['请选择实验室'],
- laboratoryList:[],
- laboratoryIndex:0,
- infoForm:{},
- item:{},
- id:{},
- 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:[
- {
- id:1,
- name:'有',
- checked:true,
- },
- {
- id:0,
- name:'无',
- checked:false,
- },
- ]
- },
- {
- id:'0',
- name:'是否固定:',
- lab:'isFixed',
- radioList:[
- {
- id:1,
- name:'是',
- checked:true,
- },
- {
- id:0,
- name:'否',
- checked:false,
- },
- ]
- },
- {
- id:'0',
- name:'电子标签:',
- lab:'isElectronicTag',
- radioList:[
- {
- id:1,
- name:'有',
- checked:true,
- },
- {
- id:0,
- name:'无',
- checked:false,
- },
- ]
- },
- {
- id:'0',
- name:'气瓶状态标牌:',
- lab:'isStatusSign',
- radioList:[
- {
- id:1,
- name:'有',
- checked:true,
- },
- {
- id:0,
- name:'无',
- checked:false,
- },
- ]
- }
- ]
- }
- },
- onLoad(option) {
- if(option.form){
- this.form=JSON.parse(decodeURIComponent(option.form));
- }
- },
- onShow(){
- },
- mounted(){
- this.getSubjectDict();
- },
- methods: {
- //开始时间选中事件
- startChange(e){
- this.$set(this.form,'validPeriod',e.target.value);
- },
- //实验室选择器
- bindPickerChange(e){
- let self=this;
- let subjectName = self.laboratory[self.laboratoryIndex];
- self.$set(self.form,'subjectName',subjectName);
- self.laboratoryList.forEach(function(item){
- if(item.name==subjectName){
- self.$set(self.form,'subjectId',item.id);
- }
- })
- },
- //单选按钮
- radioClick(p,d){
- d.checked=!d.checked
- if(d.checked){
- //如果有选中的,循环把其他选中的取消
- p.radioList.forEach(function(item){
- if(item.id==d.id){
- }else{
- item.checked=false;
- }
- })
- }else{
- }
- },
- //调用摄像头
- saoCode(){
- let _this = this;
- uni.scanCode({
- onlyFromCamera: true,
- success: function (res) {
- console.log(res.result)
- _this.$set(_this.form,'beaconTag',res.result);
- }
- });
- },
- //实验室列表
- async getSubjectDict(){
- let self = this;
- let {data} = await getSubjectDict()
- if(data.code == 200){
- if(data.data[0]){
- let list = [];
- for(let i=0;i<data.data.length;i++){
- list.push(data.data[i].name);
- }
- this.laboratory = list;
- this.laboratoryList = data.data;
- }
- }
- },
- //选择气瓶
- seleteGasFun(){
- uni.redirectTo({
- url:'/pages/gasBottle/stockList/seleteGas?form='+encodeURIComponent(JSON.stringify(this.form))
- });
- },
- //提交
- async submitForm(){
- let _this = this;
- if(!this.form.gasName){
- uni.showToast({
- title: '请选择气体名称',
- icon:"none",
- mask:true,
- duration: 2000
- });
- return
- }
- if(!this.form.gasPressure){
- uni.showToast({
- title: '请输入气表压力',
- icon:"none",
- mask:true,
- duration: 2000
- });
- return
- }
- if(!this.form.validPeriod){
- uni.showToast({
- title: '请选择检验有效期',
- icon:"none",
- mask:true,
- duration: 2000
- });
- return
- }
- if(!this.form.beaconTag){
- uni.showToast({
- title: '请输入信标标签',
- icon:"none",
- mask:true,
- duration: 2000
- });
- return
- }
- if(!this.form.subjectId){
- uni.showToast({
- title: '请选择实验室',
- icon:"none",
- mask:true,
- duration: 2000
- });
- return
- }
- _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){
- _this.form.handwheel=item2.id;
- }else if(item.lab=='isFixed' && item2.checked){
- _this.form.fixed=item2.id;
- }else if(item.lab=='isElectronicTag' && item2.checked){
- _this.form.electronicTag=item2.id;
- }else if(item.lab=='isStatusSign' && item2.checked){
- _this.form.statusLabel=item2.id;
- }
- })
- })
- const {data} = await airbottleStockEnter(_this.form);
- if(data.code == 200){
- uni.showToast({
- title: '提交成功',
- icon:"none",
- mask:true,
- duration: 2000
- });
- setTimeout(function(){
- uni.redirectTo({
- url: '/pages/gasBottle/stockList/stockList'
- });
- },2000);
- }
- },
- }
- }
- </script>
- <style lang="stylus" scoped>
- #register{
- height:auto;
- width:100%;
- display flex
- flex-direction column;
- padding-bottom: 220rpx;
- .register_li{
- background #fff;
- border-radius:20rpx;
- margin:20rpx 20rpx 0;
- padding:20rpx 0;
- box-sizing: border-box;
- .register_li_min{
- margin:0 26rpx;
- display flex;
- align-items center;
- border-bottom: 1px solid #F5F5F5;
- view{
- line-height:100rpx;
- font-size:28rpx;
- }
- view:nth-child(1){
- color:red;
- line-height:28rpx;
- margin-right: 12rpx;
- }
- view:nth-child(2){
- //width:140rpx;
- flex: 1;
- font-size: 28rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #333333;
- }
- .picker-text{
- text-align: right;
- font-size: 28rpx;
- }
- >input{
- width 400rpx;
- text-align: right;
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #333333;
- }
- .code_img{
- width: 30rpx;
- height: 28rpx;
- margin-left: 26rpx;
- }
- /* 单选按钮 */
- .radio_group{
- display: flex;
- .radio{
- display: flex;
- margin-left: 74rpx;
- margin-right: 0;
- >img{
- width: 30rpx;
- height: 30rpx;
- }
- >text{
- margin-left: 34rpx;
- font-size: 28rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #333333;
- line-height: 28rpx;
- }
- }
- }
- }
- /* 时间 */
- .register_li_min2{
- margin:0 26rpx;
- border-bottom: 1px solid #f5f5f5;
- height: 100rpx;
- display: flex;
- justify-content: flex-start;
- align-items: center;
- >view:nth-child(1){
- font-size: 28rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #333333;
- line-height: 100rpx;
- margin-right: 96rpx;
- }
- .picker-text{
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #999999;
- line-height: 100rpx;
- width: 390rpx;
- text-align: right;
- }
- >view:nth-child(2){
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #999999;
- line-height: 100rpx;
- }
- .picker-text2{
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #999999;
- line-height: 100rpx;
- width: 188rpx;
- text-align: right;
- }
- }
- }
- /* 按钮 */
- /* 按钮 */
- .sub_btn{
- width: 650rpx;
- height: 100rpx;
- background: #0183FA;
- border-radius: 50rpx;
- font-size: 28rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #FFFFFF;
- line-height: 100rpx;
- text-align: center;
- margin-left: 50rpx;
- position: fixed;
- bottom:30rpx;
- z-index: 1000;
- }
- }
- /deep/.input-value-border{
- display :none !important;
- }
- </style>
|