33.a5adf2b647d47ffad1cf.js 8.8 KB

1
  1. webpackJsonp([33],{"+QJP":function(e,t,n){var i=n("sMHr");"string"==typeof i&&(i=[[e.i,i,""]]),i.locals&&(e.exports=i.locals);n("rjj0")("b4984502",i,!0)},rHuC:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n("fZjL"),o=n.n(i),a=n("Dd8w"),s=n.n(a),r=n("G+dR"),d=n("38N9"),l=n.n(d),c=n("hky6"),m=(n("jQQ7"),n("MJLE")),u=n.n(m),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:{name:"",remark:""},rules:{name:[{required:!0,message:"请选择输入名称",trigger:"blur"}],code:[{required:!0,message:"请选择输入编号",trigger:"blur"}]},typeList:[],id:""}},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:{ceshi:function(){this.$router.push({name:"demo"})},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.b(e.addLendForm).then(function(t){e.$message.success("添加成功!"),e.dialogVisibleForm=!1,e.warehouseSn="",e.addLendForm={},e.GET_GoodsLendList()})):"编辑"===e.title&&r.j(e.id,e.addLendForm).then(function(t){e.$message.success("修改成功!"),e.dialogVisibleForm=!1,e.id="",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 u.a(e.$refs.codeItem[n],{text:t,width:600,height:660,render:"table",colorDark:"#333333",colorLight:"#ffffff",correctLevel:u.a.CorrectLevel.H})})},500)},handleEditGoodsLend:function(e){this.id=e.id,this.title="编辑",this.addLendForm=e,this.dialogVisibleForm=!0},handleReturnGoodsLend:function(e){var t=this;this.$confirm("确定要删除吗?","提示",{type:"warning"}).then(function(){r.q(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(){l()({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.m().then(function(t){e.loading=!1,e.tableData=t}).catch(function(){e.loading=!1})}}},p=n("XyMi");var f=function(e){n("+QJP")},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,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(["createAreaType:add"])?n("el-button",{attrs:{size:"mini",type:"primary"},on:{click:e.handleAddGoodsLend}},[e._v("新增")]):e._e()],1),e._v(" "),n("div",{staticClass:"toolbar-search"})]),e._v(" "),n("template",{slot:"table-columns"},[n("el-table-column",{attrs:{type:"selection",width:"55"}}),e._v(" "),n("el-table-column",{attrs:{prop:"code",label:"区域编号"}}),e._v(" "),n("el-table-column",{attrs:{prop:"name",label:"名称"}}),e._v(" "),n("el-table-column",{attrs:{prop:"remark",label:"备注"}}),e._v(" "),n("el-table-column",{attrs:{label:"操作",width:"250"},scopedSlots:e._u([{key:"default",fn:function(t){return[e.checkPermission(["updateAreaType:update"])?n("el-button",{attrs:{size:"mini"},on:{click:function(n){return e.handleEditGoodsLend(t.row)}}},[e._v("编辑")]):e._e(),e._v(" "),e.checkPermission(["removeAreaType:delete"])?n("el-button",{attrs:{type:"success",size:"mini"},on:{click:function(n){return e.handleReturnGoodsLend(t.row)}}},[e._v("删除")]):e._e()]}}])})],1)],2),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:"code"}},[n("el-input",{attrs:{placeholder:"请输入编号"},model:{value:e.addLendForm.code,callback:function(t){e.$set(e.addLendForm,"code",t)},expression:"addLendForm.code"}})],1),e._v(" "),n("el-form-item",{attrs:{label:"名称",prop:"name"}},[n("el-input",{attrs:{placeholder:"请输入名称"},model:{value:e.addLendForm.name,callback:function(t){e.$set(e.addLendForm,"name",t)},expression:"addLendForm.name"}})],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.remark,callback:function(t){e.$set(e.addLendForm,"remark",t)},expression:"addLendForm.remark"}})],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-b7ec4f04",null);t.default=g.exports},sMHr:function(e,t,n){(e.exports=n("FZ+f")(!1)).push([e.i,"\n.print[data-v-b7ec4f04] {\n margin-left: 790px;\n}\n.tips-t[data-v-b7ec4f04] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n padding: 10px 0;\n}\n.tips-t div[data-v-b7ec4f04] {\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-b7ec4f04] {\n padding: 20px 0;\n}\n.face-image[data-v-b7ec4f04] {\n display: block;\n width: 50px;\n height: 50px;\n margin: 0 auto;\n}\n\n/* /deep/ .el-dialog__body {\n padding: 10px 20px;\n}\n/deep/.el-form{\n .el-form-item__content{\n display: flex;\n }\n} */\n\n/* @media print {\n html, body {\n font-size: 60pt !important;\n color: red;\n }\n} */\n",""])}});