1 |
- webpackJsonp([58],{J4iN:function(e,t,n){(e.exports=n("FZ+f")(!1)).push([e.i,"\n.print[data-v-1dc87e20] {\n margin-left: 790px;\n}\n.tips-t[data-v-1dc87e20] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n padding: 10px 0;\n}\n.tips-t div[data-v-1dc87e20] {\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-1dc87e20] {\n padding: 20px 0;\n}\n.face-image[data-v-1dc87e20] {\n display: block;\n width: 50px;\n height: 50px;\n margin: 0 auto;\n}\n[data-v-1dc87e20] .el-dialog__body {\n padding: 10px 20px;\n}\n",""])},Kf1E:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n("fZjL"),i=n.n(a),o=n("Dd8w"),s=n.n(o),d=n("G+dR"),r=n("38N9"),l=n.n(r),c=n("hky6"),u=n("jQQ7"),m=n("MJLE"),h=n.n(m),p={name:"goodsLend",data:function(){return{deptList:[],loading:!1,params:{page_no:1,page_size:10},advancedForm:{},tableData:"",dialogVisible:!1,multipleSelection:[],goodsLendForm:{},codeList:[],title:"",dialogVisibleForm:!1,addLendForm:{},rules:{name:[{required:!0,message:"请输入渠道名称",trigger:"blur"}],intro:[{required:!0,message:"请输入渠道说明",trigger:"blur"}],main_user:[{required:!0,message:"请输入渠道负责人",trigger:"blur"}],bonus:[{required:!0,message:"请输入渠道佣金比例",trigger:"blur"},{pattern:/^(([1-9]?\d{0,1}(\.\d{1,2})?)|100|100\.(0){1,2})$/,message:"请输入0-100内的数字(最多2位小数)"}]},editId:""}},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:{lendCommit:function(){var e=this;this.$refs.addLendForm.validate(function(t){if(!t)return e.$message.error("提交失败"),!1;"新增"===e.title?d.a(e.addLendForm).then(function(t){e.$message.success("添加成功!"),e.dialogVisibleForm=!1,e.addLendForm={},e.GET_GoodsLendList()}):"编辑"===e.title&&d.i(e.editId,e.addLendForm).then(function(t){e.$message.success("修改成功!"),e.dialogVisibleForm=!1,e.addLendForm={},e.editId="",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 h.a(e.$refs.codeItem[n],{text:t,width:100,height:100,render:"table",colorDark:"#333333",colorLight:"#ffffff",correctLevel:h.a.CorrectLevel.H})})},500)},handleEditGoodsLend:function(e){this.title="编辑",this.addLendForm=e,this.editId=e.id,this.dialogVisibleForm=!0},handleReturnGoodsLend:function(e){var t=this;this.$confirm("确定要删除吗?","提示",{type:"warning"}).then(function(){d.f(e.id).then(function(){t.$message.success("删除成功!"),t.GET_GoodsLendList()})}).catch(function(){})},statusFilter:function(e){switch(e){case"NEW":return"新创建";case"CONFIRMED":return"已确认";case"RETURNED":return"已归还";default:return""}},handleConfirmGoodsLend:function(){if(!this.multipleSelection||!this.multipleSelection.length)return this.$message.error("请先选择!");var e=this.multipleSelection.map(function(e){return e.id});this.codeList=e,this.dialogVisible=!0,this.creatQrCode()},GET_DeptList:function(){var e=this;c.o().then(function(t){e.deptList=u.Foundation.buildTree(t,"0")})},handlePrintGoodsLend:function(){l()({printable:"deliverySheet",type:"html",targetStyles:["*"],ignoreElements:["no-logs","goods-image","no-btn"]})},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});d.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.id),this.creatQrCode()},GET_GoodsLendDetail:function(e){var t=this;d.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}),i()(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,d.d(this.params).then(function(t){e.loading=!1,e.tableData=t}).catch(function(){e.loading=!1})}}},g=n("XyMi");var f=function(e){n("qO0P")},b=Object(g.a)(p,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:del"])?n("el-button",{attrs:{size:"mini",type:"danger",disabled:0===e.multipleSelection.length},on:{click:function(t){return e.handleDeleteGoodsLend()}}},[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}})],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:"name",label:"渠道名称"}}),e._v(" "),n("el-table-column",{attrs:{prop:"intro",label:"渠道说明"}}),e._v(" "),n("el-table-column",{attrs:{prop:"main_user",label:"渠道负责人"}}),e._v(" "),n("el-table-column",{attrs:{prop:"bonus",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.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()]}}])})],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:e.title,visible:e.dialogVisibleForm,width:"30%",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":"120px"}},[n("el-form-item",{attrs:{label:"渠道名称:",prop:"name"}},[n("el-input",{staticStyle:{width:"200px"},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:"渠道说明:",prop:"intro"}},[n("el-input",{staticStyle:{width:"200px"},attrs:{placeholder:"请输入渠道说明"},model:{value:e.addLendForm.intro,callback:function(t){e.$set(e.addLendForm,"intro",t)},expression:"addLendForm.intro"}})],1),e._v(" "),n("el-form-item",{attrs:{label:"渠道负责人:",prop:"main_user"}},[n("el-input",{staticStyle:{width:"200px"},attrs:{placeholder:"请输入渠道负责人"},model:{value:e.addLendForm.main_user,callback:function(t){e.$set(e.addLendForm,"main_user",t)},expression:"addLendForm.main_user"}})],1),e._v(" "),n("el-form-item",{attrs:{label:"渠道佣金比例:",prop:"bonus"}},[n("el-input",{staticStyle:{width:"200px"},attrs:{placeholder:"请输入佣金比例"},model:{value:e.addLendForm.bonus,callback:function(t){e.$set(e.addLendForm,"bonus",t)},expression:"addLendForm.bonus"}},[n("template",{slot:"append"},[e._v("%")])],2)],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-1dc87e20",null);t.default=b.exports},qO0P:function(e,t,n){var a=n("J4iN");"string"==typeof a&&(a=[[e.i,a,""]]),a.locals&&(e.exports=a.locals);n("rjj0")("3ea521c6",a,!0)}});
|