|
|
@@ -0,0 +1,125 @@
|
|
|
+@extends('layouts.app')
|
|
|
+@section('title')手持入库-收货@endsection
|
|
|
+
|
|
|
+@section('content')
|
|
|
+ <div class="container-fluid d-none" id="container">
|
|
|
+ <div class="card offset-md-3 col-md-6 col-sm-12">
|
|
|
+ <div class="card-header text-center mt-2 bg-transparent" id="header_title">
|
|
|
+ <span class="font-weight-bold h4">收货</span>
|
|
|
+ </div>
|
|
|
+ <div class="card-body">
|
|
|
+ <div class="offset-2">
|
|
|
+ <span class="font-weight-bold">ASN号:</span>
|
|
|
+ <div class="form-group row mt-2">
|
|
|
+ <label for="asn"></label>
|
|
|
+ <input type="text" class="form-control col-8" id="asn"
|
|
|
+ @change="downSign()" :class="errors.asn ? 'is-invalid' : ''" @keydown.enter="enterVal($event)" v-model="info.asn" @blur="checkAsn()">
|
|
|
+ <span class="invalid-feedback offset-3" role="alert" v-if="errors.asn">
|
|
|
+ <strong>@{{ errors.asn[0] }}</strong>
|
|
|
+ </span>
|
|
|
+ <span class="ml-2">
|
|
|
+ <button type="button" id="select" class="btn btn-info" @click="selectAsn()">搜索</button>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="card-footer bg-transparent">
|
|
|
+ <button type="button" id="confirm" class="btn btn-sm btn-outline-success float-right" @click="">确定</button>
|
|
|
+ <button type="button" id="cancel" class="btn btn-sm btn-outline-info float-left" @click="">取消</button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+@stop
|
|
|
+
|
|
|
+@section('lastScript')
|
|
|
+ <script type="text/javascript">
|
|
|
+ new Vue({
|
|
|
+ el:"#container",
|
|
|
+ data:{
|
|
|
+ permissionList:[ //允许聚焦许可列表
|
|
|
+ "asn","station","amount","location","ov_amount"
|
|
|
+ ],
|
|
|
+ info:{},
|
|
|
+ mount:false,
|
|
|
+ before:{
|
|
|
+ asn:"",
|
|
|
+ },
|
|
|
+ focus:"",
|
|
|
+ errors:{},
|
|
|
+ ov:{},//溢出减量数值
|
|
|
+ checkSign:false,
|
|
|
+ element:[
|
|
|
+ "asn","station","barCode","amount","submit"
|
|
|
+ ],
|
|
|
+ isAndroid:false,
|
|
|
+ },
|
|
|
+ mounted(){
|
|
|
+ if (navigator.userAgent.indexOf("Android")!==-1)this.isAndroid = true;
|
|
|
+ this.createBefore();
|
|
|
+ this.pageInit();
|
|
|
+ $("#container").removeClass("d-none");
|
|
|
+ },
|
|
|
+ methods:{
|
|
|
+ //页面初始化
|
|
|
+ pageInit(){
|
|
|
+ if (!this.isAndroid)return;
|
|
|
+ let element = document.getElementById("navbarSupportedContent").parentElement;
|
|
|
+ element.className = "row";
|
|
|
+ element.children[0].className += " col-5";
|
|
|
+ element.innerHTML = element.children[0].outerHTML;
|
|
|
+ let e1 = document.getElementById("menu");
|
|
|
+ let e2 = document.getElementById("demand-div");
|
|
|
+ if (e1)e1.remove();
|
|
|
+ if (e2)e2.remove();
|
|
|
+ },
|
|
|
+ // checkInfo(){
|
|
|
+ // let error = {};
|
|
|
+ // if (!this.info.asn)error.asn = ["ASN号必填"];
|
|
|
+ // if (this.info.asn && this.info.asn.length!==13)error.asn = ["非法ASN号"];
|
|
|
+ // if (!this.info.barCode)error.barCode = ["商品条码必填"];
|
|
|
+ // if (!this.info.station)error.station = ["库位必填"];
|
|
|
+ // if (!this.info.amount && !this.info.maximum)error.amount = ["数量必填"];
|
|
|
+ // if (JSON.stringify(error)!=='{}'){this.errors = error;return;}
|
|
|
+ // if (!this.info.amount && this.info.maximum)this.info.amount = this.info.maximum;
|
|
|
+ // },
|
|
|
+ createBefore(){
|
|
|
+ let now = new Date();
|
|
|
+ let yy = now.getFullYear().toString().substr(2, 2);
|
|
|
+ let mm = now.getMonth() + 1;
|
|
|
+ mm = mm <10 ? '0'+mm : mm.toString();
|
|
|
+ let dd = now.getDate();
|
|
|
+ dd = dd <10 ? '0'+dd : dd.toString();
|
|
|
+ this.before.asn = 'ASN'+yy+mm+dd+'000';
|
|
|
+ },
|
|
|
+ checkAsn(){
|
|
|
+ if(!this.info.asn)return;
|
|
|
+ let len = this.info.asn.length;
|
|
|
+ if (len<13)this.info.asn = this.before.asn.substr(0,13-len)+this.info.asn;
|
|
|
+ if (!this.checkSign)this.checkMaximum(e,'');
|
|
|
+ },
|
|
|
+ downSign(){
|
|
|
+ this.checkSign = false;
|
|
|
+ },
|
|
|
+ checkMaximum(){
|
|
|
+ if (!this.info.asn || !this.info.barCode || this.checkSign)return;
|
|
|
+ window.tempTip.postBasicRequest("{{url('store/inStorage/checkMaximum')}}",this.info,res=>{
|
|
|
+ this.info.maximum = res.maximum;
|
|
|
+ this.info.material_box_id = res.material_box_id;
|
|
|
+ this.info.material_box_model_id = res.material_box_model_id;
|
|
|
+ this.info.commodity_id = res.commodity_id;
|
|
|
+ if(!this.info.amount)this.info.amount = res.maximum;
|
|
|
+ return "该库位最大可上数为"+res.maximum;
|
|
|
+ });
|
|
|
+ this.checkSign = true;
|
|
|
+ },
|
|
|
+ enterVal(e){
|
|
|
+ let index = this.element.indexOf(e.target.id)+1;
|
|
|
+ let element = document.getElementById(this.element[index]);
|
|
|
+ if (element)element.focus();
|
|
|
+ e.preventDefault();
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ });
|
|
|
+ </script>
|
|
|
+@stop
|