2 lines
5.2 KiB
JavaScript
2 lines
5.2 KiB
JavaScript
import{m as s,g as l}from"./inventory-move-DvQwAAFl.js";import{f as c}from"./storage-location-C3XO-c9o.js";import{n as u,q as i,b as n,h as a,g as d}from"./index-e_UnMlbA.js";import{i as p,a as m}from"./inputSelectDialogUtil-C-eceacX.js";import"./chunk-codemirror-6VmCJKz0.js";import"./chunk-vant-BYOVI82v.js";import"./chunk-xlsx-BIT_IiTZ.js";const f=window.Vuex.mapGetters,b={data(){return{lableWidth:{width:"150px"},site:d({name:"tenantId"}),formObj:{},initData:{qty:0},dialog:{storageLocationDialog:{id:"storageLocation",page:!0,tableColumn:[{prop:"storageLocation",label:"存储位置"},{prop:"description",label:"存储位置描述"},{prop:"storageLocationTypeDesc",label:"存储位置类型"},{prop:"erpStorageLocation",label:"ERP仓库"},{prop:"status",label:"是否启用"}],visible:!1,fetchFun:c,callBack:{target:null,keys:null}}},inventoryList:[]}},created(){this.doClear()},computed:{...f(["permissions"]),permissionList(){return{}}},methods:{doClear(){this.formObj=Object.assign({},this.initData),this.inventoryList=[]},scanCode(){let r=this,e=r.formObj.code;r.formObj.inventoryIdOrCarrier="",r.formObj.storageLocation="",r.formObj.erpStorageLocation="",i(e)?r.$message.error("不可扫描空条码"):r.inventoryList.findIndex(t=>t.inventoryIdOrCarrier===e)>=0?(r.formObj.code="",r.$message.error("条码已扫描")):(n(),l({inventoryIdOrCarrier:e,verifyDefaultStorageBin:!0}).then(t=>{a(),r.formObj.code="";let o=t.data.data;r.formObj.inventoryIdOrCarrier=o[0].inventoryIdOrCarrier,r.formObj.storageLocation=o[0].storageLocation,r.formObj.erpStorageLocation=o[0].erpStorageLocation,r.inventoryList=r.inventoryList.concat(o)}).catch(t=>a()))},doMove(){let r=this,e=r.formObj.targetWarehouse;i(e)?r.$message.error("请选择目的位置"):(n(),s(r.inventoryList.map(t=>({inventoryIdOrCarrier:t.inventoryIdOrCarrier,storageLocation:r.formObj.targetWarehouse}))).then(t=>{a(),r.doClear(),r.$message.success("库存移动成功")}).catch(t=>a()))},inputShowDialog(r,e,t){e=e||this,r.queryParam={erpStorageLocation:this.formObj.erpStorageLocation},m.call(this,r,e,t)},inputCallBack(r,e){p.call(this,r,e)}}};var g=function(){var e=this,t=e._self._c;return t("div",{staticClass:"execution"},[t("input-select-dialog",{attrs:{"modal-obj":e.dialog.storageLocationDialog,"modal-fetch-fun":e.dialog.storageLocationDialog.fetchFun,"modal-show":e.dialog.storageLocationDialog.visible},on:{"update:modalShow":function(o){return e.$set(e.dialog.storageLocationDialog,"visible",o)},"update:modal-show":function(o){return e.$set(e.dialog.storageLocationDialog,"visible",o)},inputDialogSelected:function(o){return e.inputCallBack(o,e.dialog.storageLocationDialog)}}}),t("basic-container",[t("el-form",{ref:"formObj",attrs:{model:e.formObj,"label-width":"auto"}},[t("el-row",[t("el-col",{attrs:{span:24}},[t("el-form-item",{attrs:{label:"站点:",prop:"site"}},[t("el-input",{attrs:{placeHolder:"站点",disabled:!0},model:{value:e.site,callback:function(o){e.site=o},expression:"site"}})],1)],1),t("el-col",{attrs:{span:24}},[t("el-form-item",{staticClass:"inputRequired",attrs:{label:"条码扫描:",prop:"code"}},[t("el-input",{attrs:{autofocus:""},nativeOn:{keyup:function(o){return!o.type.indexOf("key")&&e._k(o.keyCode,"enter",13,o.key,"Enter")?null:e.scanCode.apply(null,arguments)}},model:{value:e.formObj.code,callback:function(o){e.$set(e.formObj,"code",o)},expression:"formObj.code"}},[t("i",{staticClass:"el-input__icon el-icon-full-screen",attrs:{slot:"suffix"},slot:"suffix"})])],1)],1),t("el-col",{attrs:{span:24}},[t("el-form-item",{attrs:{label:"条码编号:",prop:"inventoryIdOrCarrier"}},[t("el-input",{attrs:{autofocus:"",disabled:!0},model:{value:e.formObj.inventoryIdOrCarrier,callback:function(o){e.$set(e.formObj,"inventoryIdOrCarrier",o)},expression:"formObj.inventoryIdOrCarrier"}})],1)],1),t("el-col",{attrs:{span:24}},[t("el-form-item",{attrs:{label:"来源位置:",prop:"storageLocation"}},[t("el-input",{attrs:{autofocus:"",disabled:!0},model:{value:e.formObj.storageLocation,callback:function(o){e.$set(e.formObj,"storageLocation",o)},expression:"formObj.storageLocation"}})],1)],1),t("el-col",{attrs:{span:24}},[t("el-form-item",{staticClass:"inputRequired",attrs:{label:"目的位置:",prop:"targetWarehouse"}},[t("el-input",{attrs:{placeholder:"请选择区域",disabled:!e.formObj.storageLocation},model:{value:e.formObj.targetWarehouse,callback:function(o){e.$set(e.formObj,"targetWarehouse",o)},expression:"formObj.targetWarehouse"}},[t("i",{staticClass:"el-input__icon el-icon-search",attrs:{slot:"suffix"},on:{click:function(o){return o.stopPropagation(),e.inputShowDialog(e.dialog.storageLocationDialog,e.formObj,{storageLocation:"targetWarehouse"})}},slot:"suffix"})])],1)],1)],1)],1),t("el-table",{attrs:{data:e.inventoryList,border:""}},[t("el-table-column",{attrs:{label:"序号",align:"center"},scopedSlots:e._u([{key:"default",fn:function(o){return[e._v(" "+e._s(o.$index+1)+" ")]}}])}),t("el-table-column",{attrs:{label:"条码",prop:"inventoryIdOrCarrier"}}),t("el-table-column",{attrs:{label:"数量",prop:"inventoryQty"}})],1),t("div",{staticStyle:{"margin-top":"10px"}},[t("el-button",{attrs:{type:"primary"},on:{click:e.doMove}},[e._v("移库执行")]),t("el-button",{attrs:{type:"warning"},on:{click:e.doClear}},[e._v("清除")])],1)],1)],1)},O=[],v=u(b,g,O,!1,null,"27734ca2");const x=v.exports;export{x as default};
|