chunk-41c6edd5.228b3bda.js 5.6 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-41c6edd5"],{"0daa":function(e,t,a){},"859c":function(e,t,a){"use strict";a.r(t);a("14d9");var s=function(){var e=this,t=e._self._c;return t("div",{staticClass:"body"},[t("div",{staticClass:"table-page-search-box"},[t("a-form",{attrs:{layout:"inline"}},[t("a-row",{attrs:{gutter:24}},[t("a-col",{attrs:{md:24,sm:24}},[t("a-form-item",{attrs:{label:"仓库名称"}},[t("a-input",{attrs:{"allow-clear":"",placeholder:"请输入仓库名称"},model:{value:e.queryParam.name,callback:function(t){e.$set(e.queryParam,"name",t)},expression:"queryParam.name"}})],1),t("a-form-item",{staticStyle:{"margin-left":"16px"},attrs:{label:""}},[t("a-button",{attrs:{type:"primary"},on:{click:function(t){return e.getList()}}},[e._v("搜索仓库")])],1)],1)],1)],1)],1),t("div",{staticClass:"table-operator",staticStyle:{display:"flex","justify-content":"space-between",margin:"20px 0px"}},[t("div",{staticStyle:{display:"flex"}},[t("a-button",{staticStyle:{"margin-right":"10px"},attrs:{type:"primary"},on:{click:function(t){return e.handle("edit",0)}}},[e._v("+ 添加仓库")])],1),t("div")]),t("a-table",{staticStyle:{width:"100%","overflow-x":"auto"},attrs:{size:"default",columns:e.columns,"data-source":e.list,"row-key":e=>e.id,scroll:{x:1500,y:550},pagination:{current:e.pageNo,total:e.total,pageSize:e.pageSize,onChange:e.tablePageChange,onShowSizeChange:e.onShowSizeChange,showSizeChanger:!1}},scopedSlots:e._u([{key:"warehouseZoneNum",fn:function(a,s){return t("span",{},[t("a",{attrs:{href:"#"},on:{click:function(t){return e.$router.push({path:"/zone?id="+s.id})}}},[e._v(e._s(a.warehouseZoneNum))])])}},{key:"goods_num",fn:function(a,s){return t("span",{},[t("a",{attrs:{href:"#"},on:{click:function(t){return e.$router.push({path:"/home?id="+s.id})}}},[e._v(e._s(a.goods_num))])])}},{key:"action",fn:function(a,s){return t("span",{},[t("a-button",{attrs:{type:"link",size:"small"},on:{click:function(t){return e.handle("edit",s)}}},[e._v("编辑")]),t("a-divider",{attrs:{type:"vertical"}}),t("a-popconfirm",{attrs:{title:"是否删除?","ok-text":"确定"},on:{confirm:function(t){return e.handle("remove",s)}}},[t("a-button",{attrs:{type:"link",size:"small"}},[e._v("删除")])],1)],1)}}])}),t("pagePopForm",{ref:"pop",on:{callback:function(t){return e.getList()}}})],1)},o=[],i=a("0fc4"),r=function(){var e=this,t=e._self._c;return t("a-modal",{attrs:{title:(e.form.id?"编辑":"添加")+"仓库",width:"700px",afterClose:e.closeModal,destroyOnClose:!0,confirmLoading:e.btnLoading,okText:"确定",cancelText:"取消"},on:{ok:e.submit},model:{value:e.visible,callback:function(t){e.visible=t},expression:"visible"}},[t("a-form-model",{ref:"ruleForm",attrs:{model:e.form,rules:e.rules,"label-col":{span:4},"wrapper-col":{span:18}}},[t("a-form-model-item",{attrs:{label:"仓库名称",prop:"name"}},[t("a-input",{attrs:{"allow-clear":"",placeholder:"请输入仓库名称"},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1),t("a-form-model-item",{attrs:{label:"仓库排序",prop:"sort"}},[t("a-input",{attrs:{"allow-clear":"",placeholder:"请输入仓库排序"},model:{value:e.form.sort,callback:function(t){e.$set(e.form,"sort",t)},expression:"form.sort"}})],1)],1)],1)},n=[],l={components:{},props:{params:{type:Object,default(){return{}}}},data(){return{visible:!1,btnLoading:!1,form:{name:"",sort:""},rules:{name:[{required:!0,message:"请填写仓库名称",trigger:"blur"}],sort:[{required:!0,message:"请填写仓库排序",trigger:"blur"}]}}},watch:{visible(e){e||this.closeModal()}},methods:{submit(){this.$refs["ruleForm"].validate(async e=>{if(!e)return!1;try{const e=JSON.parse(JSON.stringify(this.form));delete e.value,this.btnLoading=!0;const t=await Object(i["L"])({...e});this.btnLoading=!1,0==t.code&&(this.$message.success("操作成功"),this.visible=!1,this.$emit("callback"),this.form={name:"",sort:""})}catch(t){this.btnLoading=!1}})},closeModal(){this.$refs["ruleForm"].resetFields()}},created(){}},c=l,u=a("2877"),m=Object(u["a"])(c,r,n,!1,null,null,null),d=m.exports;const p=[{title:"仓库ID",dataIndex:"id",width:80},{title:"仓库名称",dataIndex:"name"},{title:"仓库分区数量",scopedSlots:{customRender:"warehouseZoneNum"}},{title:"商品数量",scopedSlots:{customRender:"goods_num"}},{title:"排序",dataIndex:"sort"},{title:"操作",scopedSlots:{customRender:"action"},width:180,fixed:"right"}];var h={components:{pagePopForm:d},data(){return{total:0,pageNo:1,pageSize:10,columns:p,queryParam:{name:""},list:[],selectedRowKeys:[],supplierList:[]}},mounted(){this.getList()},methods:{onChange(e,t){this.queryParam.begin_time=t[0],this.queryParam.end_time=t[1]},onSelectChange(e){this.selectedRowKeys=e},handleAll(e){const{selectedRowKeys:t}=this;if(t.length)switch(e){case"remove":this.remove(t.join(","));break}else this.$message.error("请至少选择一条数据~")},async getList(e=1){const{queryParam:t,pageSize:a}=this,s=await Object(i["K"])({...t,pageSize:a,pageNo:e});if(0==s.code){this.pageNo=e,this.selectedRowKeys=[];const{totalCount:t,list:a}=s.data;this.total=t,this.list=a}},tablePageChange(e){this.getList(e)},onShowSizeChange(e,t){this.pageSize=t,this.getList(e)},handle(e,t){switch(e){case"remove":this.remove(t.id);break;case"edit":const e=this.$refs.pop;if(e.visible=!0,t){const{id:a,name:s,sort:o}=t;e.form={id:a,name:s,sort:o}}else e.form={name:"",sort:""};break}},async remove(e){const t=this.$message.loading("请稍等..."),a=await Object(i["J"])({id:e});t(),a.code||(this.$message.success(a.msg),this.getList())}}},f=h,g=(a("f4e8"),Object(u["a"])(f,s,o,!1,null,"55718d4a",null));t["default"]=g.exports},f4e8:function(e,t,a){"use strict";a("0daa")}}]);