51.39ea6890e949823d05dc.js 14 KB

1
  1. webpackJsonp([51],{"6v9x":function(e,t,n){(e.exports=n("FZ+f")(!1)).push([e.i,"\n.print[data-v-188204f7] {\n margin-left: 790px;\n}\n.tips-t[data-v-188204f7] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n padding: 10px 0;\n}\n.tips-t div[data-v-188204f7] {\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n}\n.tips-f[data-v-188204f7] {\n padding: 20px 0;\n}\n.face-image[data-v-188204f7] {\n display: block;\n width: 50px;\n height: 50px;\n margin: 0 auto;\n}\n[data-v-188204f7] .el-dialog__body {\n padding: 10px 20px;\n}\n[data-v-188204f7].el-form .el-form-item__content {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n}\n\n/* @media print {\n html, body {\n font-size: 60pt !important;\n color: red;\n }\n} */\n",""])},CkOy:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n("fZjL"),o=n.n(a),i=n("Dd8w"),s=n.n(i),r=n("G+dR"),l=n("38N9"),d=n.n(l),c=n("hky6"),u=(n("jQQ7"),n("MJLE")),m=n.n(u),h={name:"goodsLend",data:function(){return{warehouseSn:"",warehouseList:[],loading:!1,params:{page_no:1,page_size:10},advancedForm:{},tableData:"",dialogVisible:!1,multipleSelection:[],goodsLendForm:{},codeList:[],title:"",dialogVisibleForm:!1,addLendForm:{},rules:{warehouse_id:[{required:!0,message:"请选择仓库",trigger:"change"}],name:[{required:!0,message:"请选择输入仓库名称",trigger:"blur"}],code:[{required:!0,message:"请选择输入库位号",trigger:"blur"}],type:[{required:!0,message:"请选择仓库类型",trigger:"change"}]},typeList:[]}},mounted:function(){this.GET_GoodsLendList(),this.GET_DeptList()},watch:{$route:{immediate:!0,handler:function(e){e.query.status&&(this.params.status=e.query.status,this.advancedForm.status=e.query.status),this.params.page_no=1,this.GET_GoodsLendList()}}},methods:{introGoodsLend:function(e){this.$router.push({name:"inventoryItem",params:{id:e.id,type:"check",code:e.code}})},AddGoodsLend:function(e){this.$router.push({name:"inventoryItem",params:{id:e.id,warehouse_id:e.warehouse_id,code:e.code}})},gowareHouse:function(){this.dialogVisibleForm=!1,this.$router.push({name:"warehouseList"})},selWarehouse:function(e){var t=this.warehouseList.filter(function(t){return t.id===e})[0];this.warehouseSn=t.sn},lendCommit:function(){var e=this;this.$refs.addLendForm.validate(function(t){if(!t)return e.$message.error("提交失败"),!1;"新增"===e.title?(e.addLendForm.code=e.warehouseSn+"-"+e.addLendForm.code,r.e(e.addLendForm).then(function(t){e.$message.success("添加成功!"),e.dialogVisibleForm=!1,e.warehouseSn="",e.addLendForm={},e.GET_GoodsLendList()})):"编辑"===e.title&&r.s(e.addLendForm).then(function(t){e.$message.success("修改成功!"),e.dialogVisibleForm=!1,e.addLendForm={},e.GET_GoodsLendList()})})},addHandleCancle:function(){this.dialogVisibleForm=!1,this.addLendForm={}},handleCancle:function(){this.dialogVisible=!1,this.codeList=[]},creatQrCode:function(){var e=this;this.$nextTick(function(){e.codeList.forEach(function(t,n){e.$refs.codeItem[n].innerHTML="";new m.a(e.$refs.codeItem[n],{text:t,width:600,height:660,render:"table",colorDark:"#333333",colorLight:"#ffffff",correctLevel:m.a.CorrectLevel.H})})},500)},handleEditGoodsLend:function(e){console.log(e),this.title="编辑",this.addLendForm=e,this.dialogVisibleForm=!0},handleReturnGoodsLend:function(e){var t=this;this.$confirm("确定要删除吗?","提示",{type:"warning"}).then(function(){r.h({id:e.id}).then(function(){t.$message.success("删除成功!"),t.GET_GoodsLendList()})}).catch(function(){})},statusFilter:function(e){var t=this.typeList.filter(function(t){return t.value===e});return 0!==t.length?t[0].label:""},handleConfirmGoodsLend:function(){if(!this.multipleSelection||!this.multipleSelection.length)return this.$message.error("请先选择!");var e=this.multipleSelection.map(function(e){return e.code});this.codeList=e,this.dialogVisible=!0,this.creatQrCode()},GET_DeptList:function(){var e=this;c.t().then(function(t){e.warehouseList=t,console.log(t)}),c.u({dictType:"Warehouse_location_type",page_no:1,page_size:50}).then(function(t){e.typeList=t.data})},handlePrintGoodsLend:function(){d()({printable:"deliverySheet",type:"html",targetStyles:["*"],ignoreElements:["no-logs","goods-image","no-btn","elementToIgnore"]})},handleDeleteGoodsLend:function(){var e=this;if(!this.multipleSelection||!this.multipleSelection.length)return this.$message.error("请先选择!");this.$confirm("确定要删除这些借出单吗?","提示",{type:"warning"}).then(function(){var t=e.multipleSelection.map(function(e){return e.id});r.g(t).then(function(){e.$message.success("删除成功!"),e.GET_GoodsLendList()})}).catch(function(){})},handleSelectionChange:function(e){this.multipleSelection=e},handlePageSizeChange:function(e){this.params.page_size=e,this.GET_GoodsLendList()},handlePageCurrentChange:function(e){this.params.page_no=e,this.GET_GoodsLendList()},handleAddGoodsLend:function(){this.title="新增",this.dialogVisibleForm=!0},handlePrintGoodsLendDialog:function(e){this.dialogVisible=!0,this.codeList.push(e.code),this.creatQrCode()},GET_GoodsLendDetail:function(e){var t=this;r.k(e).then(function(e){if(t.goodsLendForm=e,e.product_list&&e.product_list.length){var n="";e.product_list.forEach(function(e){n+=e.product_name+"、"})}t.goodsLendForm.illustrate=n})},searchEvent:function(e){var t=this;this.params=s()({},this.params,{sn:e}),o()(this.advancedForm).forEach(function(e){return delete t.params[e]}),this.params.page_no=1,this.GET_GoodsLendList()},advancedSearchEvent:function(){this.params=s()({},this.params,this.advancedForm),delete this.params.start_time,delete this.params.end_time,this.advancedForm.goodsLend_time_range&&(this.params.start_time=parseInt(Number(this.advancedForm.goodsLend_time_range[0])/1e3),this.params.end_time=parseInt(Number(this.advancedForm.goodsLend_time_range[1])/1e3)),delete this.params.goodsLend_time_range,this.params.page_no=1,this.GET_GoodsLendList()},GET_GoodsLendList:function(){var e=this;this.loading=!0,r.p(this.params).then(function(t){e.loading=!1,e.tableData=t}).catch(function(){e.loading=!1})}}},p=n("XyMi");var f=function(e){n("TOEI")},g=Object(p.a)(h,function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("en-table-layout",{attrs:{tableData:e.tableData.data,loading:e.loading},on:{"selection-change":e.handleSelectionChange}},[n("div",{staticClass:"inner-toolbar",attrs:{slot:"toolbar"},slot:"toolbar"},[n("div",{staticClass:"toolbar-btns"},[e.checkPermission(["goodsLend:add"])?n("el-button",{attrs:{size:"mini",type:"primary"},on:{click:e.handleAddGoodsLend}},[e._v("新增")]):e._e(),e._v(" "),e.checkPermission(["goodsLend:confirm"])?n("el-button",{attrs:{type:"success",size:"mini",disabled:0===e.multipleSelection.length},on:{click:e.handleConfirmGoodsLend}},[e._v("打印")]):e._e()],1),e._v(" "),n("div",{staticClass:"toolbar-search"},[n("en-table-search",{attrs:{placeholder:"请输入借出单编号",advanced:"",advancedWidth:"465"},on:{search:e.searchEvent,advancedSearch:e.advancedSearchEvent}},[n("template",{slot:"advanced-content"},[n("el-form",{ref:"advancedForm",attrs:{model:e.advancedForm,"label-width":"90px"}},[n("el-form-item",{attrs:{label:"仓库"}},[n("el-cascader",{attrs:{options:e.warehouseList,props:{label:"name",value:"id",emitPath:!1,checkStrictly:!0},clearable:""},model:{value:e.advancedForm.dept_id,callback:function(t){e.$set(e.advancedForm,"dept_id",t)},expression:"advancedForm.dept_id"}})],1),e._v(" "),n("el-form-item",{attrs:{label:"状态"}},[n("el-select",{model:{value:e.advancedForm.status,callback:function(t){e.$set(e.advancedForm,"status",t)},expression:"advancedForm.status"}},[n("el-option",{key:"NEW",attrs:{label:"新创建",value:"NEW"}}),e._v(" "),n("el-option",{key:"CONFIRMED",attrs:{label:"已确认",value:"CONFIRMED"}}),e._v(" "),n("el-option",{key:"RETURNED",attrs:{label:"已归还",value:"RETURNED"}})],1)],1),e._v(" "),n("el-form-item",{attrs:{label:"时间"}},[n("el-date-picker",{attrs:{type:"daterange",align:"center",editable:!1,"unlink-panels":"",clearable:!1,"default-time":["00:00:00","23:59:59"],"range-separator":"-","start-placeholder":"开始日期","end-placeholder":"结束日期","value-format":"timestamp","picker-options":{disabledDate:function(e){return e.getTime()-1>=new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()).getTime()+864e5-1},shortcuts:e.MixinPickerShortcuts}},model:{value:e.advancedForm.goodsLend_time_range,callback:function(t){e.$set(e.advancedForm,"goodsLend_time_range",t)},expression:"advancedForm.goodsLend_time_range"}})],1)],1)],1)],2)],1)]),e._v(" "),n("template",{slot:"table-columns"},[n("el-table-column",{attrs:{type:"selection",width:"55"}}),e._v(" "),n("el-table-column",{attrs:{prop:"warehouse.sn",label:"仓库编号"}}),e._v(" "),n("el-table-column",{attrs:{prop:"warehouse.name",label:"仓库名称"}}),e._v(" "),n("el-table-column",{attrs:{prop:"code",label:"库位号"}}),e._v(" "),n("el-table-column",{attrs:{prop:"type",label:"库位区域"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(e.statusFilter(t.row.type)))]}}])}),e._v(" "),n("el-table-column",{attrs:{prop:"intro",label:"库位说明"}}),e._v(" "),n("el-table-column",{attrs:{label:"操作",width:"250"},scopedSlots:e._u([{key:"default",fn:function(t){return[e.checkPermission(["goodsLend:edit"])?n("el-button",{attrs:{size:"mini"},on:{click:function(n){return e.introGoodsLend(t.row)}}},[e._v("查看")]):e._e(),e._v(" "),e.checkPermission(["goodsLend:edit"])?n("el-button",{attrs:{size:"mini"},on:{click:function(n){return e.AddGoodsLend(t.row)}}},[e._v("添加商品")]):e._e(),e._v(" "),e.checkPermission(["goodsLend:edit"])?n("el-button",{attrs:{size:"mini"},on:{click:function(n){return e.handleEditGoodsLend(t.row)}}},[e._v("编辑")]):e._e(),e._v(" "),e.checkPermission(["goodsLend:del"])?n("el-button",{attrs:{type:"success",size:"mini"},on:{click:function(n){return e.handleReturnGoodsLend(t.row)}}},[e._v("删除")]):e._e(),e._v(" "),e.checkPermission(["goodsLend:print"])?n("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(n){return e.handlePrintGoodsLendDialog(t.row)}}},[e._v("打印")]):e._e()]}}])})],1),e._v(" "),e.tableData?n("el-pagination",{attrs:{slot:"pagination","current-page":e.tableData.page_no,"page-sizes":[10,20,50,100],"page-size":e.tableData.page_size,layout:"total, sizes, prev, pager, next, jumper",total:e.tableData.data_total},on:{"size-change":e.handlePageSizeChange,"current-change":e.handlePageCurrentChange},slot:"pagination"}):e._e()],2),e._v(" "),n("el-dialog",{attrs:{title:"打印预览",visible:e.dialogVisible,width:"940px",center:""},on:{"update:visible":function(t){e.dialogVisible=t},close:e.handleCancle}},[n("el-button",{staticClass:"print",attrs:{size:"mini",type:"primary"},on:{click:e.handlePrintGoodsLend}},[e._v("打印")]),e._v(" "),n("div",{staticStyle:{width:"900px"},attrs:{id:"deliverySheet"}},e._l(e.codeList,function(t,a){return n("div",{key:a,staticClass:"tips-t"},[n("div",[n("h1",{staticClass:"qrcode-title",staticStyle:{"margin-top":"20px","font-family":"sans-serif",color:"black","font-weight":"600"}},[e._v("\n "+e._s(t)+"\n ")])])])}),0)],1),e._v(" "),n("el-dialog",{attrs:{title:e.title,visible:e.dialogVisibleForm,width:"940px",center:""},on:{"update:visible":function(t){e.dialogVisibleForm=t},close:e.addHandleCancle}},[n("el-form",{ref:"addLendForm",attrs:{model:e.addLendForm,rules:e.rules,"label-width":"90px"}},[n("el-form-item",{attrs:{label:"仓库",prop:"warehouse_id"}},[n("el-select",{attrs:{clearable:""},on:{change:e.selWarehouse},model:{value:e.addLendForm.warehouse_id,callback:function(t){e.$set(e.addLendForm,"warehouse_id",t)},expression:"addLendForm.warehouse_id"}},e._l(e.warehouseList,function(e){return n("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})}),1),e._v(" "),0==e.warehouseList.length?n("span",{staticStyle:{color:"red","margin-left":"20px",cursor:"pointer","text-decoration":"underline"},on:{click:e.gowareHouse}},[e._v("新增仓库")]):e._e()],1),e._v(" "),n("el-form-item",{attrs:{label:"库位号",prop:"code"}},[n("el-input",{staticStyle:{width:"270px"},attrs:{maxlength:"12",placeholder:"请输入库位号"},model:{value:e.addLendForm.code,callback:function(t){e.$set(e.addLendForm,"code",t)},expression:"addLendForm.code"}},[n("template",{slot:"prepend"},[e._v(e._s(e.warehouseSn)+"-")])],2)],1),e._v(" "),n("el-form-item",{attrs:{label:"库位区域",prop:"type"}},[n("el-select",{attrs:{clearable:""},model:{value:e.addLendForm.type,callback:function(t){e.$set(e.addLendForm,"type",t)},expression:"addLendForm.type"}},e._l(e.typeList,function(e){return n("el-option",{key:e.id,attrs:{label:e.label,value:e.value}})}),1)],1),e._v(" "),n("el-form-item",{attrs:{label:"库位说明"}},[n("el-input",{attrs:{type:"textarea",autosize:{minRows:2,maxRows:4},placeholder:"请输入内容"},model:{value:e.addLendForm.intro,callback:function(t){e.$set(e.addLendForm,"intro",t)},expression:"addLendForm.intro"}})],1)],1),e._v(" "),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{on:{click:e.addHandleCancle}},[e._v("取 消")]),e._v(" "),n("el-button",{attrs:{type:"primary"},on:{click:e.lendCommit}},[e._v("确 定")])],1)],1)],1)},[],!1,f,"data-v-188204f7",null);t.default=g.exports},TOEI:function(e,t,n){var a=n("6v9x");"string"==typeof a&&(a=[[e.i,a,""]]),a.locals&&(e.exports=a.locals);n("rjj0")("a9900936",a,!0)}});