(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-6c8e5c64"],{"393d":function(t,e,a){"use strict";a("49f2")},"49f2":function(t,e,a){},"88a7a":function(t,e,a){"use strict";a.r(e);a("14d9");var s=function(){var t=this,e=t._self._c;return e("div",{staticClass:"body"},[e("div",{staticClass:"table-page-search-box"},[e("a-form",{attrs:{layout:"inline"}},[e("a-row",{attrs:{gutter:24}},[e("a-col",{attrs:{md:8,sm:24}},[e("a-form-item",{attrs:{label:"供货商"}},[e("a-select",{staticStyle:{width:"215px"},attrs:{showSearch:!0,"filter-option":t.filterOption,allowClear:"",placeholder:"请选择"},model:{value:t.queryParam.supplier_id,callback:function(e){t.$set(t.queryParam,"supplier_id",e)},expression:"queryParam.supplier_id"}},t._l(t.supplierList,(function(a){return e("a-select-option",{key:a.id,attrs:{value:a.id}},[t._v(t._s(a.name))])})),1)],1)],1),e("a-col",{attrs:{md:12,sm:24}},[e("a-form-item",{attrs:{label:"商品名称"}},[e("a-input",{attrs:{"allow-clear":"",placeholder:"请输入商品名称"},model:{value:t.queryParam.goods_name,callback:function(e){t.$set(t.queryParam,"goods_name",e)},expression:"queryParam.goods_name"}})],1),e("a-form-item",{staticStyle:{"margin-left":"20px"},attrs:{label:""}},[e("a-button",{attrs:{type:"primary"},on:{click:function(e){return t.getList()}}},[t._v("搜索采购")])],1)],1)],1)],1)],1),e("div",{staticClass:"table-operator",staticStyle:{display:"flex","justify-content":"space-between",margin:"20px 0px"}},[e("div",{staticStyle:{display:"flex"}},[e("a-button",{staticStyle:{"margin-right":"20px"},attrs:{type:"primary"},on:{click:function(e){return t.$router.push({path:"/stocksForewarnCreate"})}}},[t._v(" 生成采购单 ")]),e("a-dropdown",[e("a-menu",{attrs:{slot:"overlay"},slot:"overlay"},[e("a-menu-item",[e("a-popconfirm",{attrs:{title:"是否批量导出?","ok-text":"确定"},on:{confirm:function(e){return t.handleAll("export")}}},[t._v(" 批量导出 ")])],1)],1),e("a-button",[t._v(" 批量操作 ")])],1)],1)]),e("a-table",{staticStyle:{width:"100%","overflow-x":"auto"},attrs:{size:"default",columns:t.columns,"data-source":t.list,"row-key":t=>t.id,scroll:{x:1500,y:550},pagination:{current:t.pageNo,total:t.total,pageSize:t.pageSize,onShowSizeChange:t.onShowSizeChange,showSizeChanger:!1,onChange:t.tablePageChange},rowSelection:{selectedRowKeys:t.selectedRowKeys,onChange:t.onSelectChange}},scopedSlots:t._u([{key:"status",fn:function(a){return e("span",{},[e("a-badge",{attrs:{color:t.getStatus(a)[1],text:t.getStatus(a)[0]}})],1)}},{key:"action",fn:function(a,s){return e("span",{},[e("a-button",{attrs:{type:"link",size:"small"},on:{click:function(e){return t.handle("see",s)}}},[t._v("查看")]),e("a-divider",{attrs:{type:"vertical"}}),e("a-button",{attrs:{type:"link",size:"small"},on:{click:function(e){return t.handle("print",s)}}},[t._v("打印采购单")])],1)}}])}),e("ContentDetails",{ref:"pop",attrs:{title:"打印订单"},on:{cancel:function(e){t.item=null},ok:function(e){t.visible=!1}}},[t.item?e("div",{staticClass:"pop"},[e("div",{staticClass:"title"},[e("span",[t._v("采购单")]),e("a-button",{directives:[{name:"print",rawName:"v-print",value:"#print",expression:"'#print'"}],attrs:{type:"primary"},on:{click:t.setPrintStatus}},[t._v("打印")])],1),e("div",{attrs:{id:"print"}},[e("div",{staticClass:"des-item"},[e("strong",[t._v("采购单号:"+t._s(t.item.epo.order_no))])]),e("div",{staticClass:"des-item"},[e("span",[t._v("配送商家:"+t._s(t.item.store.name)+" ")]),e("span",[t._v("联系电话:"+t._s(t.item.store.contact_tel))])]),e("div",{staticClass:"des-item"},[t._v("商家地址:"+t._s(t.item.store.district+t.item.store.address))]),e("table",[e("tr",[e("th",[t._v("序号")]),e("th",[t._v("商品名称")]),e("th",[t._v("商品规格")]),e("th",[t._v("商品价格")]),e("th",[t._v("商品数量")])]),t._l(t.item.ep,(function(a,s){return e("tr",{key:s},[e("td",[t._v(t._s(s))]),e("td",[t._v(t._s(a.goods_name))]),e("td",[t._v(t._s(a.attr_names))]),e("td",[t._v(t._s(a.goods_price))]),e("td",[t._v(t._s(a.num))])])}))],2),e("div",{staticClass:"fd"},[e("div",{staticClass:"total"},[t._v("商品总价:¥"+t._s(t.item.totalPrice||"0.00"))]),e("div",{staticClass:"time"},[t._v(t._s(t.item.epo.created_at))])])])]):t._e()])],1)},i=[],n=a("0fc4");const o=[{title:"ID",dataIndex:"id",width:80},{title:"采购订单",dataIndex:"order_no"},{title:"供货商",dataIndex:"supplier_name"},{title:"商品数量",dataIndex:"num"},{title:"下单时间",dataIndex:"created_at"},{title:"状态",dataIndex:"status",scopedSlots:{customRender:"status"}},{title:"操作",scopedSlots:{customRender:"action"},width:180,fixed:"right"}];var r={components:{ContentDetails:()=>a.e("chunk-2d222176").then(a.bind(null,"ccaa"))},data(){return{total:0,pageNo:1,pageSize:10,columns:o,queryParam:{supplier_id:"",goods_name:"",status:"-1"},list:[],selectedRowKeys:[],categoryInfo:[],statusList:[{id:"-1",title:"全部"},{id:"1",title:"已打印"},{id:"0",title:"未打印"}],supplierList:[],item:null}},mounted(){this.getList(),Object(n["I"])().then(t=>{0==t.code&&(this.supplierList=t.data)})},computed:{getStatus(){return t=>{let e,a;switch(String(t)){case"0":e="未打印",a="rgba(0, 0, 0, 0.25)";break;case"1":e="已打印",a="#65C817";break}return[e,a]}}},methods:{filterOption(t,e){return e.componentOptions.children[0].text.toLowerCase().indexOf(t.toLowerCase())>=0},onSelectChange(t){this.selectedRowKeys=t},handleAll(t){const{selectedRowKeys:e}=this;if(e.length)switch(t){case"export":this.export(e.join(","));break}else this.$message.error("请至少选择一条数据~")},async getList(t=1){const{queryParam:e,pageSize:a}=this,s=await Object(n["v"])({...e,pageSize:a,pageNo:t});if(0==s.code){this.pageNo=t,this.selectedRowKeys=[];const{totalCount:e,list:a}=s.data;this.total=e,this.list=a}},tablePageChange(t){this.getList(t)},handle(t,e){switch(t){case"see":this.$router.push({path:"/purchasingItem?id="+e.id});break;case"print":this.purchaseInfo({id:e.id}),this.$refs.pop.visible=!0;break}},async purchaseInfo(t){const e=this.$message.loading("请稍等",0);try{const a=await Object(n["u"])(t);e(),a.code||(this.item=a.data)}catch(a){e()}},async export(t){try{await Object(n["f"])(t)}catch(e){hide()}},async setPrintStatus(){try{await Object(n["G"])({id:this.item.epo.id})}catch(t){}},onShowSizeChange(t,e){this.pageSize=e,this.getList(t)}}},l=r,c=(a("393d"),a("2877")),d=Object(c["a"])(l,s,i,!1,null,"56ecdb70",null);e["default"]=d.exports}}]);