2024-09-05 09:27:56 +08:00

1 line
132 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["f"],{"03be":function(e,t,a){"use strict";a.r(t);a("b0c0");var s=function(){var e=this,t=e._self._c;return t("div",{staticClass:"serial area"},[t("div",{staticClass:"layout"},[t("el-popover",{ref:"searchPopover",attrs:{"popper-class":"searchPopover",placement:"bottom-start"}},[t("el-form",{ref:"searchFrom",staticClass:"searchFrom",attrs:{inline:""}},[t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入商品名称",clearable:""},model:{value:e.searchFrom.name,callback:function(t){e.$set(e.searchFrom,"name",t)},expression:"searchFrom.name"}})],1),t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入商品编号",clearable:""},model:{value:e.searchFrom.number,callback:function(t){e.$set(e.searchFrom,"number",t)},expression:"searchFrom.number"}})],1),t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入序列号码",clearable:""},model:{value:e.searchFrom.serial,callback:function(t){e.$set(e.searchFrom,"serial",t)},expression:"searchFrom.serial"}})],1),t("el-form-item",[t("el-select",{attrs:{placeholder:"序列状态",clearable:""},model:{value:e.searchFrom.state,callback:function(t){e.$set(e.searchFrom,"state",t)},expression:"searchFrom.state"}},[t("el-option",{attrs:{label:"未销售",value:1}}),t("el-option",{attrs:{label:"已销售",value:2}}),t("el-option",{attrs:{label:"已调拨",value:3}}),t("el-option",{attrs:{label:"已退货",value:4}})],1)],1),t("el-form-item",[t("el-select",{attrs:{placeholder:"请选择仓库信息",multiple:"","collapse-tags":""},model:{value:e.searchFrom.warehouse,callback:function(t){e.$set(e.searchFrom,"warehouse",t)},expression:"searchFrom.warehouse"}},[e._l(e.store.warehouse,(function(e){return[t("el-option",{attrs:{label:e.name,value:e.id}})]}))],2)],1),t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入批次号码",clearable:""},model:{value:e.searchFrom.batch,callback:function(t){e.$set(e.searchFrom,"batch",t)},expression:"searchFrom.batch"}})],1),t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入商品型号",clearable:""},model:{value:e.searchFrom.spec,callback:function(t){e.$set(e.searchFrom,"spec",t)},expression:"searchFrom.spec"}})],1),t("el-form-item",[t("nodTree",{attrs:{treeData:e.store.category,placeholder:"请选择商品类别"},model:{value:e.searchFrom.category,callback:function(t){e.$set(e.searchFrom,"category",t)},expression:"searchFrom.category"}})],1),t("el-form-item",[t("el-select",{attrs:{placeholder:"请选择商品品牌",clearable:""},model:{value:e.searchFrom.brand,callback:function(t){e.$set(e.searchFrom,"brand",t)},expression:"searchFrom.brand"}},[e._l(e.store.sys.brand,(function(e){return[t("el-option",{attrs:{label:e,value:e}})]}))],2)],1),t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入商品条码",clearable:""},model:{value:e.searchFrom.code,callback:function(t){e.$set(e.searchFrom,"code",t)},expression:"searchFrom.code"}})],1),t("el-divider"),t("el-button",{staticClass:"searchBtn",attrs:{icon:"el-icon-search"},on:{click:function(t){return e.record(1)}}})],1),t("el-button",{attrs:{slot:"reference",icon:"el-icon-more"},slot:"reference"})],1),t("el-button-group",[t("el-button",{on:{click:e.exports}},[e._v("导出")]),t("el-button",{on:{click:e.reload}},[e._v("刷新")])],1)],1),t("el-divider"),t("el-table",{directives:[{name:"madeTable",rawName:"v-madeTable"}],attrs:{data:e.tableData,"tree-props":{children:"attr"},"row-key":"key",height:"calc(100% - 90px)",border:""}},[t("el-table-column",{attrs:{prop:"name",label:"商品名称",align:"left",width:"220px",fixed:"left"}}),t("el-table-column",{attrs:{prop:"summary",label:"序列数量",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"state",label:"序列状态",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"warehouse",label:"所属仓库",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"batch",label:"所属批次",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"number",label:"商品编号",align:"center",width:"160px"}}),t("el-table-column",{attrs:{prop:"spec",label:"规格型号",align:"center",width:"160px"}}),t("el-table-column",{attrs:{prop:"categoryData.name",label:"商品分类",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"brand",label:"商品品牌",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"extension.unit",label:"商品单位",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"code",label:"商品条码",align:"center",width:"160px"}}),t("el-table-column",{attrs:{prop:"data",label:"商品备注",align:"center",width:"160px"}}),t("el-table-column",{attrs:{prop:"set",label:"相关操作",align:"center","min-width":"120px",fixed:"right"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("el-button",{attrs:{size:"mini"},on:{click:function(t){return e.showSerialDetail(a.row)}}},[e._v("详情")])]}}])})],1),t("el-pagination",{staticClass:"tablePagination",attrs:{"current-page":e.page.current,total:e.page.total,"page-size":e.page.size,"page-sizes":e.page.sizes,"pager-count":e.page.count,layout:"prev,pager,next,jumper,sizes,total"},on:{"update:currentPage":function(t){return e.$set(e.page,"current",t)},"update:current-page":function(t){return e.$set(e.page,"current",t)},"update:pageSize":function(t){return e.$set(e.page,"size",t)},"update:page-size":function(t){return e.$set(e.page,"size",t)},"size-change":function(t){return e.record(1)},"current-change":function(t){return e.record(0)}}}),e.serialDetailDialog.show?t("SerialDetail",{attrs:{condition:e.serialDetailDialog.condition},on:{destroy:function(t){e.serialDetailDialog.show=!1}}}):e._e()],1)},r=[],o=a("b85c"),i=(a("14d9"),a("23f7")),l=function(){var e=this,t=e._self._c;return t("div",{staticClass:"serialDetail"},[t("el-dialog",{directives:[{name:"madeDialog",rawName:"v-madeDialog"}],attrs:{visible:e.dialog,title:"序列详情",width:"600px","append-to-body":!0},on:{"update:visible":function(t){e.dialog=t},closed:e.close}},[t("el-table",{directives:[{name:"madeTable",rawName:"v-madeTable"}],attrs:{data:e.tableData,height:"320px",border:""}},[t("el-table-column",{attrs:{prop:"sourceData.frameData.name",label:"所属组织",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"sourceData.time",label:"操作时间",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"extension.type",label:"单据类型",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"sourceData.number",label:"单据编号",align:"center",width:"200px"}})],1),t("el-pagination",{staticClass:"tablePagination",attrs:{"current-page":e.page.current,total:e.page.total,"page-size":e.page.size,"page-sizes":e.page.sizes,"pager-count":e.page.count,layout:"prev,pager,next,jumper,sizes,total"},on:{"update:currentPage":function(t){return e.$set(e.page,"current",t)},"update:current-page":function(t){return e.$set(e.page,"current",t)},"update:pageSize":function(t){return e.$set(e.page,"size",t)},"update:page-size":function(t){return e.$set(e.page,"size",t)},"size-change":function(t){return e.record(1)},"current-change":function(t){return e.record(0)}}}),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-popover",{ref:"searchPopover",attrs:{"popper-class":"searchPopover",placement:"top-start"}},[t("el-form",{ref:"searchFrom",staticClass:"searchFrom",attrs:{inline:""}},[t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入单据编号",clearable:""},model:{value:e.searchFrom.number,callback:function(t){e.$set(e.searchFrom,"number",t)},expression:"searchFrom.number"}})],1),t("el-form-item",[t("el-select",{attrs:{placeholder:"请选择单据类型",multiple:"","collapse-tags":""},model:{value:e.searchFrom.type,callback:function(t){e.$set(e.searchFrom,"type",t)},expression:"searchFrom.type"}},[t("el-option",{attrs:{label:"采购单",value:"buy"}}),t("el-option",{attrs:{label:"采购退货单",value:"bre"}}),t("el-option",{attrs:{label:"销售单",value:"sell"}}),t("el-option",{attrs:{label:"销售退货单",value:"sre"}}),t("el-option",{attrs:{label:"调拨单-出",value:"swapOut"}}),t("el-option",{attrs:{label:"调拨单-入",value:"swapEnter"}}),t("el-option",{attrs:{label:"其它入库单",value:"entry"}}),t("el-option",{attrs:{label:"其它出库单",value:"extry"}})],1)],1),t("el-form-item",[t("el-date-picker",{attrs:{placeholder:"请输入开始日期","value-format":"yyyy-MM-dd",type:"date"},model:{value:e.searchFrom.startTime,callback:function(t){e.$set(e.searchFrom,"startTime",t)},expression:"searchFrom.startTime"}})],1),t("el-form-item",[t("el-date-picker",{attrs:{placeholder:"请输入结束日期","value-format":"yyyy-MM-dd",type:"date"},model:{value:e.searchFrom.endTime,callback:function(t){e.$set(e.searchFrom,"endTime",t)},expression:"searchFrom.endTime"}})],1),t("el-divider"),t("el-button",{staticClass:"searchBtn",attrs:{icon:"el-icon-search"},on:{click:function(t){return e.record(1)}}})],1),t("el-button",{attrs:{slot:"reference",icon:"el-icon-more"},slot:"reference"})],1),t("el-button",{on:{click:e.exports}},[e._v("导出")])],1)],1)],1)},n=[],c={name:"SerialDetail",props:{condition:{required:!0,type:Object}},data:function(){return{dialog:!0,searchFrom:{number:"",type:[],startTime:"",endTime:""},tableData:[],page:{current:1,total:0,size:10,sizes:[10,20,50,100,200],count:5}}},created:function(){this.record()},computed:{store:function(){return this.$store.state}},methods:{record:function(){var e=this,t=Object.assign({page:this.page.current,limit:this.page.size},this.searchFrom,this.condition);this.$axios.post("serial/detailRecord",t).then((function(t){"success"==t.state?(e.tableData=t.info,e.page.total=t.count,e.$refs["searchPopover"].showPopper=!1):"error"==t.state?e.$message({type:"warning",message:t.info}):e.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))},exports:function(){var e=this;this.$message({type:"success",message:"[ 导出数据 ] 请求中..."});var t=this.$lib.objToParm(Object.assign({},this.searchFrom,this.condition),!0);setTimeout((function(){window.open(e.$base.web+"serial/detailExports?"+t)}),1e3)},close:function(){this.$emit("destroy",!0)}}},u=c,m=(a("5950"),a("2877")),p=Object(m["a"])(u,l,n,!1,null,"6fea422c",null),d=p.exports,h={name:"Serial",components:{NodTree:i["a"],SerialDetail:d},data:function(){return{searchFrom:{name:"",number:"",serial:"",state:"",warehouse:[],batch:"",spec:"",category:null,brand:"",code:""},tableData:[],tableColumn:[],page:{current:1,total:0,size:30,sizes:[30,60,90,150,300],count:5},serialDetailDialog:{show:!1,condition:{}}}},created:function(){this.record(1)},computed:{store:function(){return this.$store.state}},methods:{record:function(e){var t=this;0==e||(this.page.current=e);var a=Object.assign({page:this.page.current,limit:this.page.size},this.searchFrom);this.$axios.post("serial/record",a).then((function(e){"success"==e.state?(t.tableData=e.info,t.tableColumn=e.column,t.page.total=e.count,t.$refs["searchPopover"].showPopper=!1):"error"==e.state?t.$message({type:"warning",message:e.info}):t.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))},exports:function(){var e=this;this.$message({type:"success",message:"[ 导出数据 ] 请求中..."});var t=this.$lib.objToParm(this.searchFrom,!0);setTimeout((function(){window.open(e.$base.web+"serial/exports?"+t)}),1e3)},showSerialDetail:function(e){var t={serial:[]},a=function e(a){if(a.hasOwnProperty("attr")){var s,r=Object(o["a"])(a.attr);try{for(r.s();!(s=r.n()).done;){var i=s.value;e(i)}}catch(l){r.e(l)}finally{r.f()}}else t.serial.push(a.serial)};a(e),this.serialDetailDialog.condition=t,this.serialDetailDialog.show=!0},reload:function(){this.$bus.emit("homeReload",this.$options.name),this.$message({type:"success",message:"页面刷新成功!"})}}},f=h,b=(a("3332"),Object(m["a"])(f,s,r,!1,null,"77fbbd65",null));t["default"]=b.exports},"0a7c":function(e,t,a){"use strict";a.r(t);var s=function(){var e=this,t=e._self._c;return t("div",{staticClass:"swap bill"},[t("el-form",{ref:"form",staticStyle:{height:"100%"},attrs:{model:e.form,rules:e.rules,inline:!0,"hide-required-asterisk":!0}},[t("el-form-item",{attrs:{label:"单据日期",prop:"time"}},[t("el-date-picker",{attrs:{"value-format":"yyyy-MM-dd",type:"date",placeholder:"请选择单据日期"},model:{value:e.form.time,callback:function(t){e.$set(e.form,"time",t)},expression:"form.time"}})],1),t("el-form-item",{attrs:{label:"单据编号",prop:"number"}},[t("el-input",{attrs:{placeholder:"请输入单据编号",clearable:""},model:{value:e.form.number,callback:function(t){e.$set(e.form,"number",t)},expression:"form.number"}})],1),t("el-divider",{staticClass:"fistDivider"}),t("ag-grid-vue",{directives:[{name:"madeAgGrid",rawName:"v-madeAgGrid"}],staticClass:"ag-theme-balham",staticStyle:{height:"calc(100% - 256px)"},attrs:{context:e.grid.context,defaultColDef:e.grid.coldef,gridOptions:e.grid.options,columnDefs:e.grid.column,getRowNodeId:e.grid.getRowNodeId,frameworkComponents:e.grid.components,tabToNextCell:e.$grid.gridTabToNextCell},on:{setter:function(t){e.goods.dialog=!0},schemeChange:e.schemeChange,quickEnter:e.quickEnter}}),t("Status",{attrs:{config:e.grid.status,source:e.info}},[1==e.form.examine?t("img",{staticClass:"billExamine",attrs:{src:"/static/images/lib/examine.png"}}):e._e()]),t("el-divider"),t("LineFeed",{attrs:{tag:".el-form-item",rule:3}},[t("el-form-item",{attrs:{label:"单据成本"}},[t("el-input",{attrs:{placeholder:"请输入单据成本",disabled:!0},model:{value:e.form.total,callback:function(t){e.$set(e.form,"total",t)},expression:"form.total"}})],1),t("el-form-item",{attrs:{label:"单据费用"}},[t("NodIet",{attrs:{type:"out"},on:{change:e.costChange},model:{value:e.cost,callback:function(t){e.cost=t},expression:"cost"}})],1),t("el-form-item",{attrs:{label:"关联人员"}},[t("nodList",{attrs:{placeholder:"请选择关联人员",action:"service/peopleRecord",scene:"people"},model:{value:e.form.people,callback:function(t){e.$set(e.form,"people",t)},expression:"form.people"}})],1),t("el-form-item",{attrs:{label:"物流信息"}},[t("Logistics",{model:{value:e.form.logistics,callback:function(t){e.$set(e.form,"logistics",t)},expression:"form.logistics"}})],1),t("el-form-item",{attrs:{label:"单据附件"}},[t("NodUpload",{attrs:{action:e.$base.web+"swap/upload"},model:{value:e.form.file,callback:function(t){e.$set(e.form,"file",t)},expression:"form.file"}})],1),t("FieldForm",{staticStyle:{display:"initial"},attrs:{rule:"swap",prefix:"more."},model:{value:e.form.more,callback:function(t){e.$set(e.form,"more",t)},expression:"form.more"}}),t("el-form-item",{attrs:{label:"备注信息"}},[t("el-input",{attrs:{placeholder:"请输入备注信息",clearable:""},model:{value:e.form.data,callback:function(t){e.$set(e.form,"data",t)},expression:"form.data"}})],1)],1)],1),t("div",{staticClass:"layerBtn"},[t("el-button-group",[0==e.form.id||0==e.form.examine&&e.$lib.getUserRoot(e.store.root,"swap","edit")?[t("el-button",{attrs:{type:"info"},on:{click:e.save}},[e._v("保存")])]:e._e(),0!=e.form.id?[e.$lib.getUserRoot(e.store.root,"swap","examine")?[t("el-button",{attrs:{type:"info"},on:{click:e.examine}},[e._v(e._s(0==e.form.examine?"审核":"反审核"))])]:e._e()]:e._e(),null==e.source?[t("el-button",{attrs:{type:"info"},on:{click:e.reload}},[e._v("刷新")])]:e._e()],2)],1),e.goods.dialog?t("GoodsList",{attrs:{parm:e.goods.parm},on:{destroy:e.goodsDestroy,choice:e.pushGrid}}):e._e()],1)},r=[],o=a("b85c"),i=(a("99af"),a("7db0"),a("d81d"),a("14d9"),a("a434"),a("b0c0"),a("d3b7"),a("159b"),a("401b")),l=a("a389"),n=a("60f6"),c=a("fc0a"),u=a("56d9"),m=a("2ff6"),p=a("aac3"),d=a("b232"),h=a("5a8a"),f=a("09a0"),b=a("6b69"),g=a("94ab"),y=a("b786"),v=a("c3e3"),x=a("a447"),w=a("ddf5"),$=a("5549"),k=a("b8a6"),F=a("5fb4"),D=a("1d84"),_={name:"Swap",components:{AgGridVue:i["AgGridVue"],Status:y["a"],LineFeed:v["a"],NodList:x["a"],NodIet:w["a"],NodUpload:$["a"],Logistics:k["a"],FieldForm:F["a"],GoodsList:D["a"]},props:{source:{default:null}},data:function(){var e=this;return{form:{id:0,time:"",number:"",total:0,cost:0,people:null,logistics:{key:"auto",name:"自动识别",number:""},file:[],data:"",examine:0,more:{}},rules:{time:{required:!0,message:"请选择单据日期",trigger:"change"},number:{required:!0,message:"请输入单据编号",trigger:"blur"}},info:[],cost:[],grid:{options:{onGridReady:function(){e.$grid.addGridRow(e.grid.options)},onCellEditingStopped:function(e){e.context.runHandleGrid()}},context:{row:{uniqid:this.$lib.getUniqid(),key:null},runHandleGrid:function(){if(null==e.grid.options.api)return!1;e.handleGrid()}},coldef:{suppressMenu:!1,resizable:!0,singleClickEdit:!0,suppressMovable:!0},components:{dispose:l["a"],scheme:n["a"],storeroom:c["a"],setter:u["a"],quickInput:m["a"],company:p["a"],depot:d["a"],storehouse:h["a"],batch:f["a"],validity:b["a"],serial:g["a"]},getRowNodeId:function(e){return e.uniqid},column:[{headerName:"序号",width:50,field:"sequence",headerComponent:"dispose",headerComponentParams:{dispose:{key:"swap"}},valueGetter:function(e){return e.node.rowIndex+1},hide:!1,dispose:!1},{headerName:"操作",width:50,field:"setter",cellRenderer:"setter",hide:!1,dispose:!1},{headerName:"商品名称",width:150,field:"name",headerComponent:"scheme",headerComponentParams:{dispose:{title:"商品名称"}},editable:!0,cellEditor:"quickInput",hide:!1,dispose:!0},{headerName:"商品编号",width:120,field:"number",hide:!1,dispose:!0},{headerName:"规格型号",width:120,field:"spec",hide:!1,dispose:!0},{headerName:"辅助属性",width:120,field:"attr",hide:!1,dispose:!0},{headerName:"单位",width:120,field:"unit",editable:!0,cellEditor:"company",hide:!1,dispose:!0},{headerName:"调出仓库",width:120,field:"warehouse",headerComponent:"storeroom",headerComponentParams:{dispose:{title:"调出仓库",key:"warehouseId",text:"warehouse"}},cellRenderer:"depot",cellRendererParams:{dispose:{key:"warehouseId",text:"warehouse"}},editable:!0,cellEditor:"storehouse",cellEditorParams:{dispose:{key:"warehouseId",text:"warehouse"}},hide:!1,dispose:!0},{headerName:"调入仓库",width:120,field:"storehouse",headerComponent:"storeroom",headerComponentParams:{dispose:{title:"调入仓库",key:"storehouseId",text:"storehouse"}},cellRenderer:"depot",cellRendererParams:{dispose:{key:"storehouseId",text:"storehouse"}},editable:!0,cellEditor:"storehouse",cellEditorParams:{dispose:{key:"storehouseId",text:"storehouse"}},hide:!1,dispose:!0},{headerName:"批次号",width:120,field:"batch",editable:!0,cellEditor:"batch",hide:!0,dispose:!1},{headerName:"生产日期",width:120,field:"mfd",editable:!0,cellEditor:"validity",hide:!0,dispose:!1},{headerName:"成本",width:90,field:"price",editable:!0,hide:!1,dispose:!0},{headerName:"数量",width:90,field:"nums",editable:!0,cellEditor:"serial",cellEditorParams:{dispose:{record:{show:!0,parm:{state:0}}}},hide:!1,dispose:!0},{headerName:"总成本",width:120,field:"total",hide:!1,dispose:!0},{headerName:"备注信息",width:120,field:"data",editable:!0,hide:!1,dispose:!0}],status:[{text:"总条数",type:"count"},{text:"总合计",type:"sum",key:"total"}]},scan:!1,goods:{dialog:!1,parm:{}}}},computed:{store:function(){return this.$store.state}},created:function(){this.init()},methods:{init:function(){var e=this;null==this.source?(this.form.time=this.$moment().format("YYYY-MM-DD"),this.form.number="DBD"+this.$moment().format("YYMMDDHHmmssS")):this.$axios.post("swap/get",{parm:this.source}).then((function(t){"success"==t.state?(e.form=t.info.class,e.pushGrid(t.info.info,!1),e.cost=t.info.cost):"error"==t.state?e.$message({type:"warning",message:t.info}):e.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))},save:function(){var e=this,t=this.$refs["form"];this.$lib.aloneValidate(t,["time","number"]).then((function(){var t=e.handleGrid();if(1==t)if(0==e.info.length)e.$message({type:"warning",message:"商品信息不可为空!"});else{e.handleCost();e.$axios.post("swap/save",{class:e.form,info:e.info,cost:e.cost}).then((function(t){"success"==t.state?e.store.sys.fun.examine&&0==e.form.id?(e.form.id=t.info,e.$message({type:"success",message:"审核单据中..."}),setTimeout((function(){e.examine()}),996)):(e.form.id=t.info,e.$message({type:"success",message:"单据保存成功!"})):"error"==t.state?e.$message({type:"warning",message:t.info}):e.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))}else e.$message({type:"warning",message:t})})).catch((function(t){e.$message({type:"warning",message:t})}))},examine:function(){var e=this;this.$axios.post("swap/examine",{parm:[this.form.id]}).then((function(t){"success"==t.state?(e.form.examine=0==e.form.examine?1:0,e.$message({type:"success",message:(0==e.form.examine?"反审核":"审核")+"单据成功!"})):"error"==t.state?e.$message({type:"warning",message:t.info}):e.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))},schemeChange:function(e){this.scan=e,this.$grid.startEditingLastCell(this.grid.options,"name")},quickEnter:function(e,t){var a=this,s=this.grid.options.api;if(!this.$lib.validate("empty",e)){var r=this.scan?{code:e}:{mate:e},o=Object.assign({page:1,limit:1},r);this.$axios.post("service/goodsRecord",o).then((function(e){if("success"==e.state)if(0==e.count)s.startEditingCell({rowIndex:t,colKey:"name"}),a.$message({type:"warning",message:"未匹配到商品数据!"});else if(1==e.count){var o=e.info[0];if(o.attr.length>1)a.goods.parm=r,a.goods.dialog=!0;else{if(0==o.attr.length)o.attr="",o.nums=1;else{var i=o.attr[0];o=Object.assign({},o,{attr:i.name,buy:i.buy,sell:i.sell,retail:i.retail,code:i.code,nums:1})}a.pushGrid([o]),a.scan&&s.startEditingCell({rowIndex:t+1,colKey:"name"})}}else a.goods.parm=r,a.goods.dialog=!0;else"error"==e.state?a.$message({type:"warning",message:e.info}):a.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))}},pushGrid:function(e){var t,a=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],s=[],r="buy",i=Object(o["a"])(e);try{for(i.s();!(t=i.n()).done;){var l=t.value,n=a?l:l.goodsData,c={uniqid:this.$lib.getUniqid(),key:n.id,goodsType:n.type,unitData:n.units,unitRelation:{valence:n[r],multiple:a?1:null},warehouseId:a?null:l.warehouse,storehouseId:a?null:l.storehouse,batchType:n.batch,validityType:n.validity,serialType:n.serial,name:n.name,number:n.number,spec:n.spec,attr:l.attr,unit:a?"-1"==n.unit?"点击选择":n.unit:l.unit,warehouse:a?0==n.type?"点击选择":"":this.$lib.objectSeek(l,"warehouseData|name"),storehouse:a?0==n.type?"点击选择":"":this.$lib.objectSeek(l,"storehouseData|name"),batch:a?"":l.batch,mfd:a?"":l.mfd,price:a?n[r]:l.price,nums:l.nums,serial:a?[]:l.serial,total:a?null:l.total,data:a?"":l.data};if(a)c.total=this.$calc.chain(c.price).multiply(c.nums).round(this.store.sys.fun.digit.money).done();else if(c.unitData.length>0){var u=this.$lib.unitRelation(c.unit,c.unitData,this);c.unitRelation.multiple=u.multiple}s.push(c)}}catch(m){i.e(m)}finally{i.f()}this.$grid.pushGridData(this.grid.options,s),this.handleGrid()},handleGrid:function(){var e=!0,t=this.$grid.getGridData(this.grid.options);this.grid.options.columnApi.setColumnsVisible(["batch","mfd"],!1),void 0==t.find((function(e){return e.key&&e.batchType}))||this.grid.options.columnApi.setColumnVisible("batch",!0),void 0==t.find((function(e){return e.key&&e.validityType}))||this.grid.options.columnApi.setColumnVisible("mfd",!0);for(var a=[],s=0;s<t.length;s++)if(null==t[s].key)t.splice(s,1);else{if(t[s].unitData.length>0&&"点击选择"==t[s].unit){1==e&&(e="商品信息第"+(s+1)+"行单位不可为空!");continue}if(0==t[s].goodsType&&null==t[s].warehouseId){1==e&&(e="商品信息第"+(s+1)+"行调出仓库不可为空!");continue}if(0==t[s].goodsType&&null==t[s].storehouseId){1==e&&(e="商品信息第"+(s+1)+"行调入仓库不可为空!");continue}if(0==t[s].goodsType&&t[s].warehouseId==t[s].storehouseId){1==e&&(e="商品信息第"+(s+1)+"行调出调入仓库不可相等!");continue}if(t[s].batchType&&this.$lib.validate("empty",t[s].batch)){1==e&&(e="商品信息第"+(s+1)+"行批次号不可为空!");continue}if(t[s].validityType&&this.$lib.validate("empty",t[s].mfd)){1==e&&(e="商品信息第"+(s+1)+"行生产日期不可为空!");continue}if(!this.$lib.synValidate("money",t[s].price)){1==e&&(e="商品信息第"+(s+1)+"行成本不正确!");continue}if(!this.$lib.synValidate("nums",t[s].nums)){1==e&&(e="商品信息第"+(s+1)+"行数量不正确!");continue}if(t[s].serialType&&0==t[s].serial.length){1==e&&(e="商品信息第"+(s+1)+"行序列号不可为空!");continue}t[s].total=this.$calc.chain(t[s].price).multiply(t[s].nums).round(this.store.sys.fun.digit.money).done(),this.grid.options.api.applyTransaction({update:[t[s]]}),a=a.concat(t[s].serial)}return 1==e&&(a.length!=this.$lib.distinct(a).length&&1==e&&(e="商品信息中存在重复序列号!"),this.$set(this,"info",t.map((function(e){return{goods:e.key,attr:e.attr,unit:e.unit,warehouse:e.warehouseId,storehouse:e.storehouseId,batch:e.batch,mfd:e.mfd,price:e.price,nums:e.nums,serial:e.serial,total:e.total,data:e.data}}))),this.summary()),e},handleCost:function(){for(var e=!0,t=this.cost,a=0;a<t.length;a++)if(!this.$lib.synValidate("numerical",t[a].money)){e="单据费用第"+(a+1)+"行金额不正确!";break}return e},costChange:function(e){this.form.cost=e},summary:function(){var e=this.$calc.chain(0);this.info.forEach((function(t){e.add(t.total)})),this.form.total=e.done()},goodsDestroy:function(){this.goods.dialog=!1,this.goods.parm={},this.$grid.startEditingLastCell(this.grid.options,"name")},reload:function(){this.$bus.emit("homeReload",this.$options.name),this.$message({type:"success",message:"页面刷新成功!"})}}},C=_,R=a("2877"),T=Object(R["a"])(C,s,r,!1,null,null,null);t["default"]=T.exports},"13ed":function(e,t,a){"use strict";a("cce7")},"16c0":function(e,t,a){"use strict";a.r(t);a("b0c0");var s=function(){var e=this,t=e._self._c;return t("div",{staticClass:"swapForm area"},[t("div",{staticClass:"layout"},[t("el-popover",{ref:"searchPopover",attrs:{"popper-class":"searchPopover",placement:"bottom-start"}},[t("el-form",{ref:"searchFrom",staticClass:"searchFrom",attrs:{inline:""}},[t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入商品名称",clearable:""},model:{value:e.searchFrom.goods,callback:function(t){e.$set(e.searchFrom,"goods",t)},expression:"searchFrom.goods"}})],1),t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入单据编号",clearable:""},model:{value:e.searchFrom.number,callback:function(t){e.$set(e.searchFrom,"number",t)},expression:"searchFrom.number"}})],1),t("el-form-item",[t("el-date-picker",{attrs:{placeholder:"请输入开始日期","value-format":"yyyy-MM-dd",type:"date"},model:{value:e.searchFrom.startTime,callback:function(t){e.$set(e.searchFrom,"startTime",t)},expression:"searchFrom.startTime"}})],1),t("el-form-item",[t("el-date-picker",{attrs:{placeholder:"请输入结束日期","value-format":"yyyy-MM-dd",type:"date"},model:{value:e.searchFrom.endTime,callback:function(t){e.$set(e.searchFrom,"endTime",t)},expression:"searchFrom.endTime"}})],1),t("el-form-item",[t("nodList",{attrs:{placeholder:"请选择关联人员",action:"service/peopleRecord",scene:"people"},model:{value:e.searchFrom.people,callback:function(t){e.$set(e.searchFrom,"people",t)},expression:"searchFrom.people"}})],1),t("el-form-item",[t("el-select",{attrs:{placeholder:"请选择审核状态",clearable:""},model:{value:e.searchFrom.examine,callback:function(t){e.$set(e.searchFrom,"examine",t)},expression:"searchFrom.examine"}},[t("el-option",{attrs:{label:"未审核",value:1}}),t("el-option",{attrs:{label:"已审核",value:2}})],1)],1),t("el-form-item",[t("el-select",{attrs:{placeholder:"请选择费用状态",clearable:""},model:{value:e.searchFrom.cse,callback:function(t){e.$set(e.searchFrom,"cse",t)},expression:"searchFrom.cse"}},[t("el-option",{attrs:{label:"未结算",value:1}}),t("el-option",{attrs:{label:"部分结算",value:2}}),t("el-option",{attrs:{label:"已结算",value:3}}),t("el-option",{attrs:{label:"无需结算",value:4}})],1)],1),t("el-form-item",[t("nodList",{attrs:{placeholder:"请选择制单人",action:"service/userRecord",scene:"user"},model:{value:e.searchFrom.user,callback:function(t){e.$set(e.searchFrom,"user",t)},expression:"searchFrom.user"}})],1),t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入备注信息",clearable:""},model:{value:e.searchFrom.data,callback:function(t){e.$set(e.searchFrom,"data",t)},expression:"searchFrom.data"}})],1),t("el-divider"),t("el-button",{staticClass:"searchBtn",attrs:{icon:"el-icon-search"},on:{click:function(t){return e.record(1)}}})],1),t("el-button",{attrs:{slot:"reference",icon:"el-icon-more"},slot:"reference"})],1),t("el-button-group",[0!=e.tableSelection.length?[e.$lib.getUserRoot(e.store.root,"swap","examine")?[t("el-popover",{staticClass:"btnGroupPopover",attrs:{type:"center","popper-class":"blockPopover",trigger:"click"}},[t("el-button",{attrs:{slot:"reference",type:"info"},slot:"reference"},[e._v("操作")]),t("ul",[t("li",{on:{click:function(t){return e.examine(0)}}},[e._v("审核")]),t("li",{on:{click:function(t){return e.examine(1)}}},[e._v("反审核")])])],1)]:e._e(),e.$lib.getUserRoot(e.store.root,"swap","del")?[t("el-button",{attrs:{type:"info"},on:{click:function(t){return e.del(e.tableSelection)}}},[e._v("删除")])]:e._e()]:e._e(),e.$lib.getUserRoot(e.store.root,"swap","batch")?[t("el-button",{on:{click:function(t){e.batch.dialog=!0}}},[e._v("批量")])]:e._e(),t("el-button",{on:{click:e.reload}},[e._v("刷新")])],2)],1),t("el-divider"),t("el-table",{directives:[{name:"madeTable",rawName:"v-madeTable"}],attrs:{data:e.tableData,height:"calc(100% - 90px)",border:""},on:{"selection-change":e.selectionChange}},[t("el-table-column",{attrs:{type:"selection",align:"center",width:"39px",fixed:"left"}}),t("el-table-column",{attrs:{prop:"frameData.name",label:"所属组织",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"time",label:"单据时间",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"number",label:"单据编号",align:"center",width:"200px"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("span",{on:{click:function(t){return e.billShow(a.row.id)}}},[e._v(e._s(a.row.number))])]}}])}),t("el-table-column",{attrs:{prop:"total",label:"单据成本",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"cost",label:"单据费用",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"peopleData.name",label:"关联人员",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"extension.examine",label:"审核状态",align:"center",width:"100px"}}),t("el-table-column",{attrs:{prop:"cse",label:"费用状态",align:"center",width:"100px"},scopedSlots:e._u([{key:"default",fn:function(a){return[0==a.row.costData.length?[t("span",[e._v(e._s(a.row.extension.cse))])]:[t("el-popover",{attrs:{"popper-class":"tablePopover",trigger:"click"}},[t("div",{attrs:{slot:"reference"},slot:"reference"},[t("span",[e._v(e._s(a.row.extension.cse))]),t("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),t("el-table",{attrs:{data:a.row.costData,height:"120px",size:"mini",border:""}},[t("el-table-column",{attrs:{prop:"ietData.name",label:"支出类别",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"money",label:"金额",align:"center",width:"90px"}}),t("el-table-column",{attrs:{prop:"settle",label:"结算金额",align:"center",width:"90px"}}),t("el-table-column",{attrs:{prop:"extension.state",label:"结算状态",align:"center",width:"90px"}})],1)],1)]]}}])}),t("el-table-column",{attrs:{prop:"userData.name",label:"制单人",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"data",label:"备注信息",align:"center",width:"200px"}}),t("el-table-column",{attrs:{prop:"set",label:"相关操作",align:"center",width:"180px",fixed:"right"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("el-button-group",[t("el-button",{attrs:{size:"mini"},on:{click:function(t){return e.billShow(a.row.id)}}},[e._v("详情")]),e.$lib.getUserRoot(e.store.root,"swap","del")?[t("el-button",{attrs:{size:"mini"},on:{click:function(t){return e.del([a.row.id])}}},[e._v("删除")])]:e._e(),t("el-popover",{staticClass:"btnGroupPopover",attrs:{type:"right","popper-class":"listPopover",trigger:"click",placement:"bottom-end"}},[t("el-button",{staticStyle:{padding:"7px"},attrs:{slot:"reference",icon:"el-icon-arrow-down",size:"mini"},slot:"reference"}),t("ul",[e._l(a.row.recordData,(function(a){return[t("li",[e._v(" "+e._s(a.extension.time)+" - "+e._s(a.userData.name)+" - "+e._s(a.info)+" ")])]}))],2)],1)],2)]}}])})],1),t("el-pagination",{staticClass:"tablePagination",attrs:{"current-page":e.page.current,total:e.page.total,"page-size":e.page.size,"page-sizes":e.page.sizes,"pager-count":e.page.count,layout:"prev,pager,next,jumper,sizes,total,slot"},on:{"update:currentPage":function(t){return e.$set(e.page,"current",t)},"update:current-page":function(t){return e.$set(e.page,"current",t)},"update:pageSize":function(t){return e.$set(e.page,"size",t)},"update:page-size":function(t){return e.$set(e.page,"size",t)},"size-change":function(t){return e.record(1)},"current-change":function(t){return e.record(0)}}},[t("PageStatus",{attrs:{config:e.page.status,model:e.tableData}})],1),t("el-dialog",{staticClass:"billDialog",attrs:{visible:e.bill.dialog,title:"单据详情",fullscreen:!0},on:{"update:visible":function(t){return e.$set(e.bill,"dialog",t)},close:e.billDestroy}},[t("transition",{attrs:{name:"el-fade-in"}},[e.bill.dialog?[t("Swap",{attrs:{source:e.bill.source},on:{destroy:function(t){e.bill.dialog=!1}}})]:e._e()],2)],1),t("el-dialog",{directives:[{name:"madeDialog",rawName:"v-madeDialog"}],staticClass:"tabsDialog",attrs:{visible:e.batch.dialog,title:"批量",width:"420px"},on:{"update:visible":function(t){return e.$set(e.batch,"dialog",t)}}},[t("transition",{attrs:{name:"el-fade-in"}},[e.batch.dialog?[t("el-tabs",{model:{value:e.batch.active,callback:function(t){e.$set(e.batch,"active",t)},expression:"batch.active"}},[t("el-tab-pane",{attrs:{label:"导入数据",name:"import"}},[t("ul",{staticClass:"importTip"},[t("li",[e._v("1.该功能适用于Excel导入单据数据。")]),t("li",[e._v("2.录入数据时,请勿修改首行数据标题以及排序。")]),t("li",[e._v("3.字段之间存在关联关系时,将自动进行关联运算。")]),t("li",[e._v("4.请查阅使用文档获取字段格式内容以及相关导入须知。")]),t("li",[e._v("5.点击下方上传模板,选择您编辑好的模板文件即可。")])]),t("el-divider"),t("el-row",{staticStyle:{"text-align":"center"}},[t("el-col",{attrs:{span:12}},[t("el-button",{attrs:{type:"info"},on:{click:e.downTemplate}},[e._v("下载模板")])],1),t("el-col",{attrs:{span:12}},[t("el-upload",{attrs:{action:e.$base.web+"swap/import",headers:{Token:e.$store.state.token},"show-file-list":!1,"on-success":e.importCall}},[t("el-button",{attrs:{type:"primary"}},[e._v("上传模板")])],1)],1)],1)],1),t("el-tab-pane",{staticClass:"exportGroup",attrs:{label:"导出数据",name:"export"}},[t("div",{staticClass:"item",on:{click:function(t){return e.exports("simple")}}},[t("i",{staticClass:"el-icon-download"}),t("p",[e._v("简易报表")])]),t("div",{staticClass:"item",on:{click:function(t){return e.exports("detailed")}}},[t("i",{staticClass:"el-icon-download"}),t("p",[e._v("详细报表")])])])],1)]:e._e()],2)],1)],1)},r=[],o=a("b85c"),i=(a("14d9"),a("d3b7"),a("159b"),a("0a7c")),l=a("a447"),n=a("947e"),c={name:"SwapForm",components:{Swap:i["default"],NodList:l["a"],PageStatus:n["a"]},data:function(){return{searchFrom:{goods:"",number:"",people:null,startTime:"",endTime:"",examine:"",cse:"",user:null,data:""},tableData:[],tableSelection:[],page:{current:1,total:0,size:30,sizes:[30,60,90,150,300],count:5,status:[{text:"总单据成本",type:"sum",key:"total"},{text:"总单据费用",type:"sum",key:"cost"}]},bill:{dialog:!1,source:null},batch:{dialog:!1,active:"import"}}},created:function(){this.init(),this.record(1)},computed:{store:function(){return this.$store.state}},methods:{init:function(){this.searchFrom.startTime=this.$moment().subtract(this.store.sys.fun.days,"days").format("YYYY-MM-DD"),this.searchFrom.endTime=this.$moment().format("YYYY-MM-DD")},record:function(e){var t=this;0==e||(this.page.current=e);var a=Object.assign({page:this.page.current,limit:this.page.size},this.searchFrom);this.$axios.post("swap/record",a).then((function(e){"success"==e.state?(t.tableData=e.info,t.page.total=e.count,t.$refs["searchPopover"].showPopper=!1):"error"==e.state?t.$message({type:"warning",message:e.info}):t.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))},billShow:function(e){this.bill.source=e,this.bill.dialog=!0},billDestroy:function(){this.record(0)},examine:function(e){var t=this,a=[];this.tableData.forEach((function(s){-1!=t.tableSelection.indexOf(s.id)&&(0==s.examine?0==e&&a.push(s.id):1==e&&a.push(s.id))})),0==a.length?this.$message({type:"warning",message:"无可操作单据!"}):this.$axios.post("swap/examine",{parm:a}).then((function(e){"success"==e.state?(t.record(0),t.$message({type:"success",message:"操作单据成功!"})):"error"==e.state?(t.record(0),t.$message({type:"warning",message:e.info})):t.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))},del:function(e){var t=this;this.$confirm("您确定要删除选中数据吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){t.$axios.post("swap/del",{parm:e}).then((function(e){"success"==e.state?(t.record(0),t.$message({type:"success",message:"删除成功!"})):"error"==e.state?t.$message({type:"warning",message:e.info}):t.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})})).catch((function(){}))}))},downTemplate:function(){var e=this;this.$message({type:"success",message:"[ 数据模板 ] 下载请求中..."}),setTimeout((function(){window.open(e.store.base.cdnSite+"/erp/batch/调拨单导入模板.xlsx")}),1e3)},importCall:function(e,t,a){"success"==e.state?(this.$bus.emit("homeReload",this.$options.name),this.$message({type:"success",message:"导入单据成功!"})):"error"==e.state?this.$message({type:"warning",message:"[ "+t.name+" ]"+e.info}):this.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})},exports:function(e){var t=this;if(0==this.tableSelection.length)this.$message({type:"warning",message:"未选择导出数据内容!"});else{this.$message({type:"success",message:"[ 导出数据 ] 请求中..."});var a=this.$lib.objToParm({scene:e,parm:this.tableSelection},!0);setTimeout((function(){window.open(t.$base.web+"swap/exports?"+a)}),1e3)}},selectionChange:function(e){var t,a=[],s=Object(o["a"])(e);try{for(s.s();!(t=s.n()).done;){var r=t.value;a.push(r.id)}}catch(i){s.e(i)}finally{s.f()}this.tableSelection=a},reload:function(){this.$bus.emit("homeReload",this.$options.name),this.$message({type:"success",message:"页面刷新成功!"})}}},u=c,m=(a("d3c6"),a("2877")),p=Object(m["a"])(u,s,r,!1,null,null,null);t["default"]=p.exports},"1e43":function(e,t,a){"use strict";a.r(t);a("b0c0");var s=function(){var e=this,t=e._self._c;return t("div",{staticClass:"stock area"},[t("div",{staticClass:"layout"},[t("el-popover",{ref:"searchPopover",attrs:{"popper-class":"searchPopover",placement:"bottom-start"}},[t("el-form",{ref:"searchFrom",staticClass:"searchFrom",attrs:{inline:""}},[t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入商品名称",clearable:""},model:{value:e.searchFrom.name,callback:function(t){e.$set(e.searchFrom,"name",t)},expression:"searchFrom.name"}})],1),t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入商品编号",clearable:""},model:{value:e.searchFrom.number,callback:function(t){e.$set(e.searchFrom,"number",t)},expression:"searchFrom.number"}})],1),t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入商品型号",clearable:""},model:{value:e.searchFrom.spec,callback:function(t){e.$set(e.searchFrom,"spec",t)},expression:"searchFrom.spec"}})],1),t("el-form-item",[t("nodTree",{attrs:{treeData:e.store.category,placeholder:"请选择商品类别"},model:{value:e.searchFrom.category,callback:function(t){e.$set(e.searchFrom,"category",t)},expression:"searchFrom.category"}})],1),t("el-form-item",[t("el-select",{attrs:{placeholder:"请选择商品品牌",clearable:""},model:{value:e.searchFrom.brand,callback:function(t){e.$set(e.searchFrom,"brand",t)},expression:"searchFrom.brand"}},[e._l(e.store.sys.brand,(function(e){return[t("el-option",{attrs:{label:e,value:e}})]}))],2)],1),t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入商品条码",clearable:""},model:{value:e.searchFrom.code,callback:function(t){e.$set(e.searchFrom,"code",t)},expression:"searchFrom.code"}})],1),t("el-form-item",[t("el-select",{attrs:{placeholder:"请选择仓库信息",multiple:"","collapse-tags":""},model:{value:e.searchFrom.warehouse,callback:function(t){e.$set(e.searchFrom,"warehouse",t)},expression:"searchFrom.warehouse"}},[e._l(e.store.warehouse,(function(e){return[t("el-option",{attrs:{label:e.name,value:e.id}})]}))],2)],1),t("el-form-item",[t("el-select",{attrs:{placeholder:"查询类型"},model:{value:e.searchFrom.state,callback:function(t){e.$set(e.searchFrom,"state",t)},expression:"searchFrom.state"}},[t("el-option",{attrs:{label:"常规库存",value:0}}),t("el-option",{attrs:{label:"非零库存",value:1}}),t("el-option",{attrs:{label:"预警库存",value:2}})],1)],1),t("el-divider"),t("el-button",{staticClass:"searchBtn",attrs:{icon:"el-icon-search"},on:{click:function(t){return e.record(1)}}})],1),t("el-button",{attrs:{slot:"reference",icon:"el-icon-more"},slot:"reference"})],1),t("el-button-group",[t("el-button",{on:{click:e.exports}},[e._v("导出")]),t("el-button",{on:{click:e.reload}},[e._v("刷新")])],1)],1),t("el-divider"),t("el-table",{directives:[{name:"madeTable",rawName:"v-madeTable"}],attrs:{data:e.tableData,"tree-props":{children:"attr"},"row-key":"key",height:"calc(100% - 90px)",border:""}},[t("el-table-column",{attrs:{prop:"name",label:"商品名称",align:"left",width:"160px",fixed:"left"}}),t("el-table-column",{attrs:{prop:"summary",label:"库存数量",align:"center",width:"120px"}}),t("el-table-column",{attrs:{label:"仓库",align:"center"}},e._l(e.tableColumn,(function(e){return t("div",{key:e.key},[t("el-table-column",{attrs:{prop:e.key,label:e.name,align:"center",width:"90px"}})],1)})),0),t("el-table-column",{attrs:{prop:"stock",label:"预警阈值",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"number",label:"商品编号",align:"center",width:"160px"}}),t("el-table-column",{attrs:{prop:"spec",label:"规格型号",align:"center",width:"160px"}}),t("el-table-column",{attrs:{prop:"categoryData.name",label:"商品分类",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"brand",label:"商品品牌",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"extension.unit",label:"商品单位",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"code",label:"商品条码",align:"center",width:"160px"}}),t("el-table-column",{attrs:{prop:"data",label:"商品备注",align:"center",width:"160px"}}),t("el-table-column",{attrs:{prop:"set",label:"相关操作",align:"center","min-width":"100px",fixed:"right"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("el-button",{attrs:{size:"mini"},on:{click:function(t){return e.showStockDetail(a.row)}}},[e._v("详情")])]}}])})],1),t("el-pagination",{staticClass:"tablePagination",attrs:{"current-page":e.page.current,total:e.page.total,"page-size":e.page.size,"page-sizes":e.page.sizes,"pager-count":e.page.count,layout:"prev,pager,next,jumper,sizes,total"},on:{"update:currentPage":function(t){return e.$set(e.page,"current",t)},"update:current-page":function(t){return e.$set(e.page,"current",t)},"update:pageSize":function(t){return e.$set(e.page,"size",t)},"update:page-size":function(t){return e.$set(e.page,"size",t)},"size-change":function(t){return e.record(1)},"current-change":function(t){return e.record(0)}}}),e.stockDetailDialog.show?t("StockDetail",{attrs:{condition:e.stockDetailDialog.condition},on:{destroy:function(t){e.stockDetailDialog.show=!1}}}):e._e()],1)},r=[],o=(a("7db0"),a("d81d"),a("d3b7"),a("23f7")),i=function(){var e=this,t=e._self._c;return t("div",{staticClass:"stockDetail"},[t("el-dialog",{directives:[{name:"madeDialog",rawName:"v-madeDialog"}],attrs:{visible:e.dialog,title:"库存详情",width:"800px","append-to-body":!0},on:{"update:visible":function(t){e.dialog=t},closed:e.close}},[t("el-table",{directives:[{name:"madeTable",rawName:"v-madeTable"}],attrs:{data:e.tableData,height:"320px",border:""}},[t("el-table-column",{attrs:{prop:"sourceData.frameData.name",label:"所属组织",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"sourceData.time",label:"操作时间",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"extension.type",label:"单据类型",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"sourceData.number",label:"单据编号",align:"center","min-width":"200px"}}),t("el-table-column",{attrs:{prop:"extension.direction",label:"操作类型",align:"center",width:"100px"}}),t("el-table-column",{attrs:{prop:"nums",label:"操作数量",align:"center",width:"100px"}})],1),t("el-pagination",{staticClass:"tablePagination",attrs:{"current-page":e.page.current,total:e.page.total,"page-size":e.page.size,"page-sizes":e.page.sizes,"pager-count":e.page.count,layout:"prev,pager,next,jumper,sizes,total"},on:{"update:currentPage":function(t){return e.$set(e.page,"current",t)},"update:current-page":function(t){return e.$set(e.page,"current",t)},"update:pageSize":function(t){return e.$set(e.page,"size",t)},"update:page-size":function(t){return e.$set(e.page,"size",t)},"size-change":function(t){return e.record(1)},"current-change":function(t){return e.record(0)}}}),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-popover",{ref:"searchPopover",attrs:{"popper-class":"searchPopover",placement:"top-start"}},[t("el-form",{ref:"searchFrom",staticClass:"searchFrom",attrs:{inline:""}},[t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入单据编号",clearable:""},model:{value:e.searchFrom.number,callback:function(t){e.$set(e.searchFrom,"number",t)},expression:"searchFrom.number"}})],1),t("el-form-item",[t("el-select",{attrs:{placeholder:"请选择单据类型",multiple:"","collapse-tags":""},model:{value:e.searchFrom.type,callback:function(t){e.$set(e.searchFrom,"type",t)},expression:"searchFrom.type"}},[t("el-option",{attrs:{label:"采购单",value:"buy"}}),t("el-option",{attrs:{label:"采购退货单",value:"bre"}}),t("el-option",{attrs:{label:"销售单",value:"sell"}}),t("el-option",{attrs:{label:"销售退货单",value:"sre"}}),t("el-option",{attrs:{label:"调拨单-出",value:"swapOut"}}),t("el-option",{attrs:{label:"调拨单-入",value:"swapEnter"}}),t("el-option",{attrs:{label:"其它入库单",value:"entry"}}),t("el-option",{attrs:{label:"其它出库单",value:"extry"}})],1)],1),t("el-form-item",[t("el-date-picker",{attrs:{placeholder:"请输入开始日期","value-format":"yyyy-MM-dd",type:"date"},model:{value:e.searchFrom.startTime,callback:function(t){e.$set(e.searchFrom,"startTime",t)},expression:"searchFrom.startTime"}})],1),t("el-form-item",[t("el-date-picker",{attrs:{placeholder:"请输入结束日期","value-format":"yyyy-MM-dd",type:"date"},model:{value:e.searchFrom.endTime,callback:function(t){e.$set(e.searchFrom,"endTime",t)},expression:"searchFrom.endTime"}})],1),t("el-divider"),t("el-button",{staticClass:"searchBtn",attrs:{icon:"el-icon-search"},on:{click:function(t){return e.record(1)}}})],1),t("el-button",{attrs:{slot:"reference",icon:"el-icon-more"},slot:"reference"})],1),t("el-button",{on:{click:e.exports}},[e._v("导出")])],1)],1)],1)},l=[],n={name:"StockDetail",props:{condition:{required:!0,type:Object}},data:function(){return{dialog:!0,searchFrom:{number:"",type:[],startTime:"",endTime:""},tableData:[],page:{current:1,total:0,size:10,sizes:[10,20,50,100,200],count:5}}},created:function(){this.record()},computed:{store:function(){return this.$store.state}},methods:{record:function(){var e=this,t=Object.assign({page:this.page.current,limit:this.page.size},this.searchFrom,this.condition);this.$axios.post("stock/detailRecord",t).then((function(t){"success"==t.state?(e.tableData=t.info,e.page.total=t.count,e.$refs["searchPopover"].showPopper=!1):"error"==t.state?e.$message({type:"warning",message:t.info}):e.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))},exports:function(){var e=this;this.$message({type:"success",message:"[ 导出数据 ] 请求中..."});var t=this.$lib.objToParm(Object.assign({},this.searchFrom,this.condition),!0);setTimeout((function(){window.open(e.$base.web+"stock/detailExports?"+t)}),1e3)},close:function(){this.$emit("destroy",!0)}}},c=n,u=(a("e260a"),a("2877")),m=Object(u["a"])(c,i,l,!1,null,"987cf4f4",null),p=m.exports,d={name:"Stock",components:{NodTree:o["a"],StockDetail:p},data:function(){return{searchFrom:{name:"",number:"",spec:"",category:null,brand:"",code:"",warehouse:[],state:0},tableData:[],tableColumn:[],page:{current:1,total:0,size:30,sizes:[30,60,90,150,300],count:5},stockDetailDialog:{show:!1,condition:{}}}},created:function(){this.record(1)},computed:{store:function(){return this.$store.state}},methods:{record:function(e){var t=this;0==e||(this.page.current=e);var a=Object.assign({page:this.page.current,limit:this.page.size},this.searchFrom);this.$axios.post("stock/record",a).then((function(e){"success"==e.state?(t.tableData=e.info,t.tableColumn=e.column,t.page.total=e.count,t.$refs["searchPopover"].showPopper=!1):"error"==e.state?t.$message({type:"warning",message:e.info}):t.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))},exports:function(){var e=this;this.$message({type:"success",message:"[ 导出数据 ] 请求中..."});var t=this.$lib.objToParm(this.searchFrom,!0);setTimeout((function(){window.open(e.$base.web+"stock/exports?"+t)}),1e3)},showStockDetail:function(e){e.hasOwnProperty("pid")&&this.tableData.find((function(t){return t.id==e.pid}));var t=e.hasOwnProperty("pid")?{goods:e.pid,attr:e.name}:e.attr.length>0?{goods:e.id}:{goods:e.id,attr:""};t.warehouse=this.tableColumn.map((function(e){return e.id})),this.stockDetailDialog.condition=t,this.stockDetailDialog.show=!0},reload:function(){this.$bus.emit("homeReload",this.$options.name),this.$message({type:"success",message:"页面刷新成功!"})}}},h=d,f=(a("df19"),Object(u["a"])(h,s,r,!1,null,"0b4b246d",null));t["default"]=f.exports},2449:function(e,t,a){"use strict";a("cc09")},"26e5":function(e,t,a){},"2f18":function(e,t,a){"use strict";a.r(t);a("b0c0");var s=function(){var e=this,t=e._self._c;return t("div",{staticClass:"extryForm area"},[t("div",{staticClass:"layout"},[t("el-popover",{ref:"searchPopover",attrs:{"popper-class":"searchPopover",placement:"bottom-start"}},[t("el-form",{ref:"searchFrom",staticClass:"searchFrom",attrs:{inline:""}},[t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入商品名称",clearable:""},model:{value:e.searchFrom.goods,callback:function(t){e.$set(e.searchFrom,"goods",t)},expression:"searchFrom.goods"}})],1),t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入单据编号",clearable:""},model:{value:e.searchFrom.number,callback:function(t){e.$set(e.searchFrom,"number",t)},expression:"searchFrom.number"}})],1),t("el-form-item",[t("el-date-picker",{attrs:{placeholder:"请输入开始日期","value-format":"yyyy-MM-dd",type:"date"},model:{value:e.searchFrom.startTime,callback:function(t){e.$set(e.searchFrom,"startTime",t)},expression:"searchFrom.startTime"}})],1),t("el-form-item",[t("el-date-picker",{attrs:{placeholder:"请输入结束日期","value-format":"yyyy-MM-dd",type:"date"},model:{value:e.searchFrom.endTime,callback:function(t){e.$set(e.searchFrom,"endTime",t)},expression:"searchFrom.endTime"}})],1),t("el-form-item",[t("nodList",{attrs:{placeholder:"请选择客户",action:"service/customerRecord",scene:"customer"},model:{value:e.searchFrom.customer,callback:function(t){e.$set(e.searchFrom,"customer",t)},expression:"searchFrom.customer"}})],1),t("el-form-item",[t("nodList",{attrs:{placeholder:"请选择关联人员",action:"service/peopleRecord",scene:"people"},model:{value:e.searchFrom.people,callback:function(t){e.$set(e.searchFrom,"people",t)},expression:"searchFrom.people"}})],1),t("el-form-item",[t("el-select",{attrs:{placeholder:"请选择单据类型",clearable:""},model:{value:e.searchFrom.type,callback:function(t){e.$set(e.searchFrom,"type",t)},expression:"searchFrom.type"}},[t("el-option",{attrs:{label:"其它出库单",value:1}}),t("el-option",{attrs:{label:"盘亏单",value:2}})],1)],1),t("el-form-item",[t("el-select",{attrs:{placeholder:"请选择审核状态",clearable:""},model:{value:e.searchFrom.examine,callback:function(t){e.$set(e.searchFrom,"examine",t)},expression:"searchFrom.examine"}},[t("el-option",{attrs:{label:"未审核",value:1}}),t("el-option",{attrs:{label:"已审核",value:2}})],1)],1),t("el-form-item",[t("el-select",{attrs:{placeholder:"请选择费用状态",clearable:""},model:{value:e.searchFrom.cse,callback:function(t){e.$set(e.searchFrom,"cse",t)},expression:"searchFrom.cse"}},[t("el-option",{attrs:{label:"未结算",value:1}}),t("el-option",{attrs:{label:"部分结算",value:2}}),t("el-option",{attrs:{label:"已结算",value:3}}),t("el-option",{attrs:{label:"无需结算",value:4}})],1)],1),t("el-form-item",[t("el-select",{attrs:{placeholder:"请选择核对状态",clearable:""},model:{value:e.searchFrom.check,callback:function(t){e.$set(e.searchFrom,"check",t)},expression:"searchFrom.check"}},[t("el-option",{attrs:{label:"未核对",value:1}}),t("el-option",{attrs:{label:"已核对",value:2}})],1)],1),t("el-form-item",[t("nodList",{attrs:{placeholder:"请选择制单人",action:"service/userRecord",scene:"user"},model:{value:e.searchFrom.user,callback:function(t){e.$set(e.searchFrom,"user",t)},expression:"searchFrom.user"}})],1),t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入备注信息",clearable:""},model:{value:e.searchFrom.data,callback:function(t){e.$set(e.searchFrom,"data",t)},expression:"searchFrom.data"}})],1),t("el-divider"),t("el-button",{staticClass:"searchBtn",attrs:{icon:"el-icon-search"},on:{click:function(t){return e.record(1)}}})],1),t("el-button",{attrs:{slot:"reference",icon:"el-icon-more"},slot:"reference"})],1),t("el-button-group",[0!=e.tableSelection.length?[e.$lib.getUserRoot(e.store.root,"extry","examine")?[t("el-popover",{staticClass:"btnGroupPopover",attrs:{type:"center","popper-class":"blockPopover",trigger:"click"}},[t("el-button",{attrs:{slot:"reference",type:"info"},slot:"reference"},[e._v("操作")]),t("ul",[e.$lib.getUserRoot(e.store.root,"extry","examine")?[t("li",{on:{click:function(t){return e.examine(0)}}},[e._v("审核")]),t("li",{on:{click:function(t){return e.examine(1)}}},[e._v("反审核")])]:e._e(),t("li",{on:{click:function(t){return e.check(0)}}},[e._v("核对")]),t("li",{on:{click:function(t){return e.check(1)}}},[e._v("反核对")])],2)],1)]:e._e(),e.$lib.getUserRoot(e.store.root,"extry","del")?[t("el-button",{attrs:{type:"info"},on:{click:function(t){return e.del(e.tableSelection)}}},[e._v("删除")])]:e._e()]:e._e(),e.$lib.getUserRoot(e.store.root,"extry","batch")?[t("el-button",{on:{click:function(t){e.batch.dialog=!0}}},[e._v("批量")])]:e._e(),t("el-button",{on:{click:e.reload}},[e._v("刷新")])],2)],1),t("el-divider"),t("el-table",{directives:[{name:"madeTable",rawName:"v-madeTable"}],attrs:{data:e.tableData,height:"calc(100% - 90px)",border:""},on:{"selection-change":e.selectionChange}},[t("el-table-column",{attrs:{type:"selection",align:"center",width:"39px",fixed:"left"}}),t("el-table-column",{attrs:{prop:"frameData.name",label:"所属组织",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"customerData.name",label:"客户",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"extension.type",label:"单据类型",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"time",label:"单据时间",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"number",label:"单据编号",align:"center",width:"200px"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("span",{on:{click:function(t){return e.billShow(a.row.id)}}},[e._v(e._s(a.row.number))])]}}])}),t("el-table-column",{attrs:{prop:"total",label:"单据成本",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"cost",label:"单据费用",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"peopleData.name",label:"关联人员",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"extension.examine",label:"审核状态",align:"center",width:"100px"}}),t("el-table-column",{attrs:{prop:"cse",label:"费用状态",align:"center",width:"100px"},scopedSlots:e._u([{key:"default",fn:function(a){return[0==a.row.costData.length?[t("span",[e._v(e._s(a.row.extension.cse))])]:[t("el-popover",{attrs:{"popper-class":"tablePopover",trigger:"click"}},[t("div",{attrs:{slot:"reference"},slot:"reference"},[t("span",[e._v(e._s(a.row.extension.cse))]),t("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),t("el-table",{attrs:{data:a.row.costData,height:"120px",size:"mini",border:""}},[t("el-table-column",{attrs:{prop:"ietData.name",label:"支出类别",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"money",label:"金额",align:"center",width:"90px"}}),t("el-table-column",{attrs:{prop:"settle",label:"结算金额",align:"center",width:"90px"}}),t("el-table-column",{attrs:{prop:"extension.state",label:"结算状态",align:"center",width:"90px"}})],1)],1)]]}}])}),t("el-table-column",{attrs:{prop:"extension.check",label:"核对状态",align:"center",width:"100px"}}),t("el-table-column",{attrs:{prop:"userData.name",label:"制单人",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"data",label:"备注信息",align:"center",width:"200px"}}),t("el-table-column",{attrs:{prop:"set",label:"相关操作",align:"center",width:"180px",fixed:"right"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("el-button-group",[t("el-button",{attrs:{size:"mini"},on:{click:function(t){return e.billShow(a.row.id)}}},[e._v("详情")]),e.$lib.getUserRoot(e.store.root,"extry","del")?[t("el-button",{attrs:{size:"mini"},on:{click:function(t){return e.del([a.row.id])}}},[e._v("删除")])]:e._e(),t("el-popover",{staticClass:"btnGroupPopover",attrs:{type:"right","popper-class":"listPopover",trigger:"click",placement:"bottom-end"}},[t("el-button",{staticStyle:{padding:"7px"},attrs:{slot:"reference",icon:"el-icon-arrow-down",size:"mini"},slot:"reference"}),t("ul",[e._l(a.row.recordData,(function(a){return[t("li",[e._v(" "+e._s(a.extension.time)+" - "+e._s(a.userData.name)+" - "+e._s(a.info)+" ")])]}))],2)],1)],2)]}}])})],1),t("el-pagination",{staticClass:"tablePagination",attrs:{"current-page":e.page.current,total:e.page.total,"page-size":e.page.size,"page-sizes":e.page.sizes,"pager-count":e.page.count,layout:"prev,pager,next,jumper,sizes,total,slot"},on:{"update:currentPage":function(t){return e.$set(e.page,"current",t)},"update:current-page":function(t){return e.$set(e.page,"current",t)},"update:pageSize":function(t){return e.$set(e.page,"size",t)},"update:page-size":function(t){return e.$set(e.page,"size",t)},"size-change":function(t){return e.record(1)},"current-change":function(t){return e.record(0)}}},[t("PageStatus",{attrs:{config:e.page.status,model:e.tableData}})],1),t("el-dialog",{staticClass:"billDialog",attrs:{visible:e.bill.dialog,title:"单据详情",fullscreen:!0},on:{"update:visible":function(t){return e.$set(e.bill,"dialog",t)},close:e.billDestroy}},[t("transition",{attrs:{name:"el-fade-in"}},[e.bill.dialog?[t("Extry",{attrs:{source:e.bill.source},on:{destroy:function(t){e.bill.dialog=!1}}})]:e._e()],2)],1),t("el-dialog",{directives:[{name:"madeDialog",rawName:"v-madeDialog"}],staticClass:"tabsDialog",attrs:{visible:e.batch.dialog,title:"批量",width:"420px"},on:{"update:visible":function(t){return e.$set(e.batch,"dialog",t)}}},[t("transition",{attrs:{name:"el-fade-in"}},[e.batch.dialog?[t("el-tabs",{model:{value:e.batch.active,callback:function(t){e.$set(e.batch,"active",t)},expression:"batch.active"}},[t("el-tab-pane",{attrs:{label:"导入数据",name:"import"}},[t("ul",{staticClass:"importTip"},[t("li",[e._v("1.该功能适用于Excel导入单据数据。")]),t("li",[e._v("2.录入数据时,请勿修改首行数据标题以及排序。")]),t("li",[e._v("3.字段之间存在关联关系时,将自动进行关联运算。")]),t("li",[e._v("4.请查阅使用文档获取字段格式内容以及相关导入须知。")]),t("li",[e._v("5.点击下方上传模板,选择您编辑好的模板文件即可。")])]),t("el-divider"),t("el-row",{staticStyle:{"text-align":"center"}},[t("el-col",{attrs:{span:12}},[t("el-button",{attrs:{type:"info"},on:{click:e.downTemplate}},[e._v("下载模板")])],1),t("el-col",{attrs:{span:12}},[t("el-upload",{attrs:{action:e.$base.web+"extry/import",headers:{Token:e.$store.state.token},"show-file-list":!1,"on-success":e.importCall}},[t("el-button",{attrs:{type:"primary"}},[e._v("上传模板")])],1)],1)],1)],1),t("el-tab-pane",{staticClass:"exportGroup",attrs:{label:"导出数据",name:"export"}},[t("div",{staticClass:"item",on:{click:function(t){return e.exports("simple")}}},[t("i",{staticClass:"el-icon-download"}),t("p",[e._v("简易报表")])]),t("div",{staticClass:"item",on:{click:function(t){return e.exports("detailed")}}},[t("i",{staticClass:"el-icon-download"}),t("p",[e._v("详细报表")])])])],1)]:e._e()],2)],1)],1)},r=[],o=a("b85c"),i=(a("14d9"),a("d3b7"),a("159b"),a("a90b")),l=a("a447"),n=a("947e"),c={name:"ExtryForm",components:{Extry:i["default"],NodList:l["a"],PageStatus:n["a"]},data:function(){return{searchFrom:{goods:"",number:"",people:null,customer:null,startTime:"",endTime:"",type:"",examine:"",cse:"",check:"",user:null,data:""},tableData:[],tableSelection:[],page:{current:1,total:0,size:30,sizes:[30,60,90,150,300],count:5,status:[{text:"总单据成本",type:"sum",key:"total"},{text:"总单据费用",type:"sum",key:"cost"}]},bill:{dialog:!1,source:null},batch:{dialog:!1,active:"import"}}},created:function(){this.init(),this.record(1)},computed:{store:function(){return this.$store.state}},methods:{init:function(){this.searchFrom.startTime=this.$moment().subtract(this.store.sys.fun.days,"days").format("YYYY-MM-DD"),this.searchFrom.endTime=this.$moment().format("YYYY-MM-DD")},record:function(e){var t=this;0==e||(this.page.current=e);var a=Object.assign({page:this.page.current,limit:this.page.size},this.searchFrom);this.$axios.post("extry/record",a).then((function(e){"success"==e.state?(t.tableData=e.info,t.page.total=e.count,t.$refs["searchPopover"].showPopper=!1):"error"==e.state?t.$message({type:"warning",message:e.info}):t.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))},billShow:function(e){this.bill.source=e,this.bill.dialog=!0},billDestroy:function(){this.record(0)},examine:function(e){var t=this,a=[];this.tableData.forEach((function(s){-1!=t.tableSelection.indexOf(s.id)&&(0==s.examine?0==e&&a.push(s.id):1==e&&a.push(s.id))})),0==a.length?this.$message({type:"warning",message:"无可操作单据!"}):this.$axios.post("extry/examine",{parm:a}).then((function(e){"success"==e.state?(t.record(0),t.$message({type:"success",message:"操作单据成功!"})):"error"==e.state?(t.record(0),t.$message({type:"warning",message:e.info})):t.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))},check:function(e){var t=this,a=[];this.tableData.forEach((function(s){-1!=t.tableSelection.indexOf(s.id)&&(0==s.check?0==e&&a.push(s.id):1==e&&a.push(s.id))})),0==a.length?this.$message({type:"warning",message:"无可操作单据!"}):this.$axios.post("extry/check",{parm:a}).then((function(e){"success"==e.state?(t.record(0),t.$message({type:"success",message:"操作单据成功!"})):"error"==e.state?(t.record(0),t.$message({type:"warning",message:e.info})):t.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))},del:function(e){var t=this;this.$confirm("您确定要删除选中数据吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){t.$axios.post("extry/del",{parm:e}).then((function(e){"success"==e.state?(t.record(0),t.$message({type:"success",message:"删除成功!"})):"error"==e.state?t.$message({type:"warning",message:e.info}):t.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})})).catch((function(){}))}))},downTemplate:function(){var e=this;this.$message({type:"success",message:"[ 数据模板 ] 下载请求中..."}),setTimeout((function(){window.open(e.store.base.cdnSite+"/erp/batch/其它出库单导入模板.xlsx")}),1e3)},importCall:function(e,t,a){"success"==e.state?(this.$bus.emit("homeReload",this.$options.name),this.$message({type:"success",message:"导入单据成功!"})):"error"==e.state?this.$message({type:"warning",message:"[ "+t.name+" ]"+e.info}):this.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})},exports:function(e){var t=this;if(0==this.tableSelection.length)this.$message({type:"warning",message:"未选择导出数据内容!"});else{this.$message({type:"success",message:"[ 导出数据 ] 请求中..."});var a=this.$lib.objToParm({scene:e,parm:this.tableSelection},!0);setTimeout((function(){window.open(t.$base.web+"extry/exports?"+a)}),1e3)}},selectionChange:function(e){var t,a=[],s=Object(o["a"])(e);try{for(s.s();!(t=s.n()).done;){var r=t.value;a.push(r.id)}}catch(i){s.e(i)}finally{s.f()}this.tableSelection=a},reload:function(){this.$bus.emit("homeReload",this.$options.name),this.$message({type:"success",message:"页面刷新成功!"})}}},u=c,m=(a("cdfb"),a("2877")),p=Object(m["a"])(u,s,r,!1,null,null,null);t["default"]=p.exports},3332:function(e,t,a){"use strict";a("b48d")},"365e":function(e,t,a){},3688:function(e,t,a){},5950:function(e,t,a){"use strict";a("26e5")},"64ca":function(e,t,a){"use strict";a.r(t);a("b0c0");var s=function(){var e=this,t=e._self._c;return t("div",{staticClass:"inventory area"},[t("div",{staticClass:"layout"},[t("el-popover",{ref:"searchPopover",attrs:{"popper-class":"searchPopover",placement:"bottom-start"}},[t("el-form",{ref:"searchFrom",staticClass:"searchFrom",attrs:{inline:""}},[t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入商品名称",clearable:""},model:{value:e.searchFrom.name,callback:function(t){e.$set(e.searchFrom,"name",t)},expression:"searchFrom.name"}})],1),t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入商品编号",clearable:""},model:{value:e.searchFrom.number,callback:function(t){e.$set(e.searchFrom,"number",t)},expression:"searchFrom.number"}})],1),t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入商品型号",clearable:""},model:{value:e.searchFrom.spec,callback:function(t){e.$set(e.searchFrom,"spec",t)},expression:"searchFrom.spec"}})],1),t("el-form-item",[t("nodTree",{attrs:{treeData:e.store.category,placeholder:"请选择商品类别"},model:{value:e.searchFrom.category,callback:function(t){e.$set(e.searchFrom,"category",t)},expression:"searchFrom.category"}})],1),t("el-form-item",[t("el-select",{attrs:{placeholder:"请选择商品品牌",clearable:""},model:{value:e.searchFrom.brand,callback:function(t){e.$set(e.searchFrom,"brand",t)},expression:"searchFrom.brand"}},[e._l(e.store.sys.brand,(function(e){return[t("el-option",{attrs:{label:e,value:e}})]}))],2)],1),t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入商品条码",clearable:""},model:{value:e.searchFrom.code,callback:function(t){e.$set(e.searchFrom,"code",t)},expression:"searchFrom.code"}})],1),t("el-form-item",[t("el-select",{attrs:{placeholder:"请选择仓库信息",multiple:"","collapse-tags":""},model:{value:e.searchFrom.warehouse,callback:function(t){e.$set(e.searchFrom,"warehouse",t)},expression:"searchFrom.warehouse"}},[e._l(e.store.warehouse,(function(e){return[t("el-option",{attrs:{label:e.name,value:e.id}})]}))],2)],1),t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入商品备注",clearable:""},model:{value:e.searchFrom.data,callback:function(t){e.$set(e.searchFrom,"data",t)},expression:"searchFrom.data"}})],1),t("el-divider"),t("el-button",{staticClass:"searchBtn",attrs:{icon:"el-icon-search"},on:{click:function(t){return e.record(1)}}})],1),t("el-button",{attrs:{slot:"reference",icon:"el-icon-more"},slot:"reference"})],1),t("el-button-group",[t("el-button",{on:{click:e.build}},[e._v("生成盘点单")]),t("el-button",{on:{click:e.exports}},[e._v("导出")]),t("el-button",{on:{click:e.reload}},[e._v("刷新")])],1)],1),t("el-divider"),t("el-table",{directives:[{name:"madeTable",rawName:"v-madeTable"}],staticClass:"gridTable",attrs:{data:e.tableData,"tree-props":{children:"attr"},"row-key":"key",height:"calc(100% - 90px)",border:""}},[t("el-table-column",{attrs:{prop:"name",label:"商品名称",align:"left",width:"220px",fixed:"left"}}),t("el-table-column",{attrs:{prop:"summary",label:"库存数量",align:"center",width:"120px"}}),t("el-table-column",{attrs:{label:"仓库",align:"center"}},[e._l(e.tableColumn,(function(a){return[t("el-table-column",{key:a.key,attrs:{label:a.name,align:"center"}},[t("el-table-column",{attrs:{prop:"record."+a.key+".basisAlias",label:"库存数",align:"center",width:"90px"}}),t("el-table-column",{attrs:{label:"盘点数",align:"center",width:e.columnWidth},scopedSlots:e._u([{key:"default",fn:function(s){return[s.row.hasOwnProperty("attr")&&s.row.attr.length>0?[t("span",[e._v("-")])]:[Array.isArray(s.row.record[a.key].enter)?[t("div",{staticClass:"unitGroup"},[e._l(s.row.record[a.key].enter,(function(a){return[t("div",{staticClass:"unitItem"},[t("input",{directives:[{name:"model",rawName:"v-model",value:a.nums,expression:"item.nums"}],attrs:{type:"text"},domProps:{value:a.nums},on:{input:[function(t){t.target.composing||e.$set(a,"nums",t.target.value)},function(t){return e.unitHandle(!1)}]}}),t("span",{on:{click:e.unitNameClick}},[e._v(e._s(a.name))])])]}))],2)]:[t("input",{directives:[{name:"model",rawName:"v-model",value:s.row.record[a.key].enter,expression:"scope.row.record[column.key].enter"}],attrs:{type:"text"},domProps:{value:s.row.record[a.key].enter},on:{input:[function(t){t.target.composing||e.$set(s.row.record[a.key],"enter",t.target.value)},function(t){return e.unitHandle(!1)}]}})]]]}}],null,!0)}),t("el-table-column",{attrs:{label:"盘盈盘亏",align:"center",width:e.columnWidth},scopedSlots:e._u([{key:"default",fn:function(s){return[s.row.hasOwnProperty("attr")&&s.row.attr.length>0?[t("span",[e._v("-")])]:[e._v(" "+e._s(s.row.record[a.key].diffAlias)+" ")]]}}],null,!0)})],1)]}))],2),t("el-table-column",{attrs:{prop:"number",label:"商品编号",align:"center",width:"160px"}}),t("el-table-column",{attrs:{prop:"spec",label:"规格型号",align:"center",width:"160px"}}),t("el-table-column",{attrs:{prop:"categoryData.name",label:"商品分类",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"brand",label:"商品品牌",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"extension.unit",label:"商品单位",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"code",label:"商品条码",align:"center",width:"160px"}}),t("el-table-column",{attrs:{prop:"data",label:"商品备注",align:"center","min-width":"160px"}})],1),t("el-pagination",{staticClass:"tablePagination",attrs:{"current-page":e.page.current,total:e.page.total,"page-size":e.page.size,"page-sizes":e.page.sizes,"pager-count":e.page.count,layout:"prev,pager,next,jumper,sizes,total"},on:{"update:currentPage":function(t){return e.$set(e.page,"current",t)},"update:current-page":function(t){return e.$set(e.page,"current",t)},"update:pageSize":function(t){return e.$set(e.page,"size",t)},"update:page-size":function(t){return e.$set(e.page,"size",t)},"size-change":function(t){return e.record(1)},"current-change":function(t){return e.record(0)}}}),t("el-dialog",{directives:[{name:"madeDialog",rawName:"v-madeDialog"}],attrs:{visible:e.dialog,title:"盘点库存",width:"420px"},on:{"update:visible":function(t){e.dialog=t}}},[t("transition",{attrs:{name:"el-fade-in"}},[e.dialog?[t("div",{staticClass:"exportGroup"},[t("div",{staticClass:"item",on:{click:e.buildEntry}},[t("i",{staticClass:"el-icon-document"}),t("p",[e._v("盘盈单")])]),t("div",{staticClass:"item",on:{click:e.buildExtry}},[t("i",{staticClass:"el-icon-document"}),t("p",[e._v("盘亏单")])])])]:e._e()],2)],1)],1)},r=[],o=a("b85c"),i=(a("7db0"),a("14d9"),a("d3b7"),a("23f7")),l={name:"Inventory",components:{NodTree:i["a"]},data:function(){return{searchFrom:{name:"",number:"",spec:"",category:null,brand:"",code:"",warehouse:[],data:""},tableData:[],tableColumn:[],page:{current:1,total:0,size:30,sizes:[30,60,90,150,300],count:5},dialog:!1,unitLength:0,summary:[]}},created:function(){this.record(1)},computed:{store:function(){return this.$store.state},columnWidth:function(){var e=0==this.unitLength?90:50*this.unitLength;return e+"px"}},methods:{record:function(e){var t=this;0==e||(this.page.current=e);var a=Object.assign({page:this.page.current,limit:this.page.size},this.searchFrom);this.$axios.post("inventory/record",a).then((function(e){if("success"==e.state){t.unitLength=0;var a,s=Object(o["a"])(e.info);try{for(s.s();!(a=s.n()).done;){var r=a.value;"-1"==r.unit&&r.units.length+1>t.unitLength&&(t.unitLength=r.units.length+1)}}catch(i){s.e(i)}finally{s.f()}t.tableData=e.info,t.tableColumn=e.column,t.page.total=e.count,t.$refs["searchPopover"].showPopper=!1}else"error"==e.state?t.$message({type:"warning",message:e.info}):t.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))},exports:function(){var e=this;this.$message({type:"success",message:"[ 导出数据 ] 请求中..."});var t=this.$lib.objToParm(this.searchFrom,!0);setTimeout((function(){window.open(e.$base.web+"inventory/exports?"+t)}),1e3)},unitHandle:function(){var e,t=this,a=!0,s=[],r=Object(o["a"])(this.tableData);try{for(r.s();!(e=r.n()).done;){var i=e.value;if(i.hasOwnProperty("attr")&&i.attr.length>0){var l,n=Object(o["a"])(i.attr);try{for(n.s();!(l=n.n()).done;){var c=l.value;s.push(c)}}catch(d){n.e(d)}finally{n.f()}}else s.push(i)}}catch(d){r.e(d)}finally{r.f()}this.summary=[];for(var u=function(){var e=p[m],s=e.hasOwnProperty("pid")?t.tableData.find((function(t){return t.id==e.pid})):e;e:for(var r in e.record){var i=e.record[r];if(Array.isArray(i.enter)){var l,n=0,c=Object(o["a"])(i.enter);try{for(c.s();!(l=c.n()).done;){var u=l.value;if(!t.$lib.validate("empty",u.nums)){if(!t.$lib.validate("plus",u.nums)){i.diff=0,i.diffAlias="",1==a&&(a=s.name+"盘点数不正确!");continue e}if(0!=u.nums){var h=t.$lib.unitRelation(u.name,s.units,t),f=t.$calc.chain(u.nums).multiply(h.multiple).done();n=t.$calc.chain(n).add(f).done()}}}}catch(d){c.e(d)}finally{c.f()}if(0==n)i.diff=0,i.diffAlias="";else{var b=t.$calc.chain(n).subtract(i.basis).done(),g=t.$calc.chain(b).abs().done(),y=t.$lib.unitSwitch(g,s.units,t);i.diff=b,i.diffAlias=b>0?y:"-"+y,t.summary.push({goods:s.id,attr:e.hasOwnProperty("pid")?e.name:"",warehouse:i.warehouse,unit:s.units[0].source,nums:b})}}else if(t.$lib.validate("empty",i.enter))i.diff=0,i.diffAlias="";else{if(!t.$lib.validate("plus",i.enter)){i.diff=0,i.diffAlias="",1==a&&(a=s.name+"盘点数不正确!");continue}var v=t.$calc.chain(i.enter).subtract(i.basis).done();i.diff=v,i.diffAlias=v,t.summary.push({goods:s.id,attr:e.hasOwnProperty("pid")?e.name:"",warehouse:i.warehouse,unit:"",nums:v})}}},m=0,p=s;m<p.length;m++)u();return a},build:function(){var e=this.unitHandle();1==e?this.dialog=!0:this.$message({type:"warning",message:e})},buildEntry:function(){var e,t=this,a=[],s=Object(o["a"])(this.summary);try{for(s.s();!(e=s.n()).done;){var r=e.value;r.nums>0&&a.push(r)}}catch(i){s.e(i)}finally{s.f()}0==a.length?this.$message({type:"warning",message:"未匹配到盘盈单数据"}):this.$axios.post("inventory/buildEntry",{info:a}).then((function(e){"success"==e.state?(t.dialog=!1,t.$bus.emit("switchPage","entry",!0),setTimeout((function(){t.$bus.emit("buildEntry",e.info)}),600)):"warning"==e.state||"error"==e.state?t.$message({type:"warning",message:e.info}):t.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))},buildExtry:function(){var e,t=this,a=[],s=Object(o["a"])(this.summary);try{for(s.s();!(e=s.n()).done;){var r=e.value;r.nums<0&&a.push(r)}}catch(i){s.e(i)}finally{s.f()}0==a.length?this.$message({type:"warning",message:"未匹配到盘亏单数据"}):this.$axios.post("inventory/buildExtry",{info:a}).then((function(e){"success"==e.state?(t.dialog=!1,t.$bus.emit("switchPage","extry",!0),setTimeout((function(){t.$bus.emit("buildExtry",e.info)}),600)):"warning"==e.state||"error"==e.state?t.$message({type:"warning",message:e.info}):t.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))},unitNameClick:function(e){e.target.previousSibling.focus()},reload:function(){this.$bus.emit("homeReload",this.$options.name),this.$message({type:"success",message:"页面刷新成功!"})}}},n=l,c=(a("6dbb"),a("2877")),u=Object(c["a"])(n,s,r,!1,null,"3517b58c",null);t["default"]=u.exports},"6dbb":function(e,t,a){"use strict";a("365e")},"7e22":function(e,t,a){},9299:function(e,t,a){"use strict";a("ada7")},a90b:function(e,t,a){"use strict";a.r(t);var s=function(){var e=this,t=e._self._c;return t("div",{staticClass:"extry bill"},[t("el-form",{ref:"form",staticStyle:{height:"100%"},attrs:{model:e.form,rules:e.rules,inline:!0,"hide-required-asterisk":!0}},[t("el-form-item",{attrs:{label:"客户"}},[t("template",{slot:"label"},[t("span",{on:{click:function(t){return e.switchPage("customer")}}},[e._v("客户")])]),t("nodList",{attrs:{placeholder:"请选择客户",action:"service/customerRecord",scene:"customer"},model:{value:e.form.customer,callback:function(t){e.$set(e.form,"customer",t)},expression:"form.customer"}})],2),t("el-form-item",{attrs:{label:"单据日期",prop:"time"}},[t("el-date-picker",{attrs:{"value-format":"yyyy-MM-dd",type:"date",placeholder:"请选择单据日期"},model:{value:e.form.time,callback:function(t){e.$set(e.form,"time",t)},expression:"form.time"}})],1),t("el-form-item",{attrs:{label:"单据编号",prop:"number"}},[t("el-input",{attrs:{placeholder:"请输入单据编号",clearable:""},model:{value:e.form.number,callback:function(t){e.$set(e.form,"number",t)},expression:"form.number"}})],1),t("el-divider",{staticClass:"fistDivider"}),t("ag-grid-vue",{directives:[{name:"madeAgGrid",rawName:"v-madeAgGrid"}],staticClass:"ag-theme-balham",staticStyle:{height:"calc(100% - 256px)"},attrs:{context:e.grid.context,defaultColDef:e.grid.coldef,gridOptions:e.grid.options,columnDefs:e.grid.column,getRowNodeId:e.grid.getRowNodeId,frameworkComponents:e.grid.components,tabToNextCell:e.$grid.gridTabToNextCell},on:{setter:function(t){e.goods.dialog=!0},schemeChange:e.schemeChange,quickEnter:e.quickEnter}}),t("Status",{attrs:{config:e.grid.status,source:e.info}},[1==e.form.examine?t("img",{staticClass:"billExamine",attrs:{src:"/static/images/lib/examine.png"}}):e._e()]),t("el-divider"),t("LineFeed",{attrs:{tag:".el-form-item",rule:3}},[t("el-form-item",{attrs:{label:"单据类型"}},[t("el-select",{attrs:{placeholder:"请选择单据类型"},on:{change:e.typeChange},model:{value:e.form.type,callback:function(t){e.$set(e.form,"type",t)},expression:"form.type"}},[t("el-option",{attrs:{label:"其它出库单",value:0}}),t("el-option",{attrs:{label:"盘亏单",value:1}})],1)],1),t("el-form-item",{attrs:{label:"单据成本"}},[t("el-input",{attrs:{placeholder:"请输入单据成本",disabled:!0},model:{value:e.form.total,callback:function(t){e.$set(e.form,"total",t)},expression:"form.total"}})],1),t("el-form-item",{attrs:{label:"单据费用"}},[t("NodIet",{attrs:{type:"out"},on:{change:e.costChange},model:{value:e.cost,callback:function(t){e.cost=t},expression:"cost"}})],1),t("el-form-item",{attrs:{label:"关联人员"}},[t("nodList",{attrs:{placeholder:"请选择关联人员",action:"service/peopleRecord",scene:"people"},model:{value:e.form.people,callback:function(t){e.$set(e.form,"people",t)},expression:"form.people"}})],1),t("el-form-item",{attrs:{label:"物流信息"}},[t("Logistics",{model:{value:e.form.logistics,callback:function(t){e.$set(e.form,"logistics",t)},expression:"form.logistics"}})],1),t("el-form-item",{attrs:{label:"单据附件"}},[t("NodUpload",{attrs:{action:e.$base.web+"extry/upload"},model:{value:e.form.file,callback:function(t){e.$set(e.form,"file",t)},expression:"form.file"}})],1),t("FieldForm",{staticStyle:{display:"initial"},attrs:{rule:"extry",prefix:"more."},model:{value:e.form.more,callback:function(t){e.$set(e.form,"more",t)},expression:"form.more"}}),t("el-form-item",{attrs:{label:"备注信息"}},[t("el-input",{attrs:{placeholder:"请输入备注信息",clearable:""},model:{value:e.form.data,callback:function(t){e.$set(e.form,"data",t)},expression:"form.data"}})],1)],1)],1),t("div",{staticClass:"layerBtn"},[t("el-button-group",[0==e.form.id||0==e.form.examine&&e.$lib.getUserRoot(e.store.root,"extry","edit")?[t("el-button",{attrs:{type:"info"},on:{click:e.save}},[e._v("保存")])]:e._e(),0!=e.form.id?[e.$lib.getUserRoot(e.store.root,"extry","examine")?[t("el-button",{attrs:{type:"info"},on:{click:e.examine}},[e._v(e._s(0==e.form.examine?"审核":"反审核"))])]:e._e(),t("el-button",{attrs:{type:"info"},on:{click:e.check}},[e._v(e._s(0==e.form.check?"核对":"反核对"))])]:e._e(),null==e.source?[t("el-button",{attrs:{type:"info"},on:{click:e.reload}},[e._v("刷新")])]:e._e()],2)],1),e.goods.dialog?t("GoodsList",{attrs:{parm:e.goods.parm},on:{destroy:e.goodsDestroy,choice:e.pushGrid}}):e._e()],1)},r=[],o=a("b85c"),i=(a("99af"),a("7db0"),a("d81d"),a("14d9"),a("a434"),a("b0c0"),a("d3b7"),a("159b"),a("401b")),l=a("a389"),n=a("60f6"),c=a("fc0a"),u=a("56d9"),m=a("2ff6"),p=a("aac3"),d=a("b232"),h=a("5a8a"),f=a("09a0"),b=a("6b69"),g=a("94ab"),y=a("b786"),v=a("c3e3"),x=a("a447"),w=a("ddf5"),$=a("5549"),k=a("b8a6"),F=a("5fb4"),D=a("1d84"),_={name:"Extry",components:{AgGridVue:i["AgGridVue"],Status:y["a"],LineFeed:v["a"],NodList:x["a"],NodIet:w["a"],NodUpload:$["a"],Logistics:k["a"],FieldForm:F["a"],GoodsList:D["a"]},props:{source:{default:null}},data:function(){var e=this;return{form:{id:0,customer:null,time:"",number:"",total:0,cost:0,type:0,people:null,logistics:{key:"auto",name:"自动识别",number:""},file:[],data:"",examine:0,check:0,more:{}},rules:{time:{required:!0,message:"请选择单据日期",trigger:"change"},number:{required:!0,message:"请输入单据编号",trigger:"blur"}},info:[],cost:[],grid:{options:{onGridReady:function(){e.$grid.addGridRow(e.grid.options)},onCellEditingStopped:function(e){e.context.runHandleGrid()}},context:{row:{uniqid:this.$lib.getUniqid(),key:null},runHandleGrid:function(){if(null==e.grid.options.api)return!1;e.handleGrid()}},coldef:{suppressMenu:!1,resizable:!0,singleClickEdit:!0,suppressMovable:!0},components:{dispose:l["a"],scheme:n["a"],storeroom:c["a"],setter:u["a"],quickInput:m["a"],company:p["a"],depot:d["a"],storehouse:h["a"],batch:f["a"],validity:b["a"],serial:g["a"]},getRowNodeId:function(e){return e.uniqid},column:[{headerName:"序号",width:50,field:"sequence",headerComponent:"dispose",headerComponentParams:{dispose:{key:"extry"}},valueGetter:function(e){return e.node.rowIndex+1},hide:!1,dispose:!1},{headerName:"操作",width:50,field:"setter",cellRenderer:"setter",hide:!1,dispose:!1},{headerName:"商品名称",width:150,field:"name",headerComponent:"scheme",headerComponentParams:{dispose:{title:"商品名称"}},editable:!0,cellEditor:"quickInput",hide:!1,dispose:!0},{headerName:"商品编号",width:120,field:"number",hide:!1,dispose:!0},{headerName:"规格型号",width:120,field:"spec",hide:!1,dispose:!0},{headerName:"辅助属性",width:120,field:"attr",hide:!1,dispose:!0},{headerName:"单位",width:120,field:"unit",editable:!0,cellEditor:"company",hide:!1,dispose:!0},{headerName:"仓库",width:120,field:"warehouse",headerComponent:"storeroom",headerComponentParams:{dispose:{title:"仓库",key:"warehouseId",text:"warehouse"}},cellRenderer:"depot",cellRendererParams:{dispose:{key:"warehouseId",text:"warehouse"}},editable:!0,cellEditor:"storehouse",cellEditorParams:{dispose:{key:"warehouseId",text:"warehouse"}},hide:!1,dispose:!0},{headerName:"批次号",width:120,field:"batch",editable:!0,cellEditor:"batch",hide:!0,dispose:!1},{headerName:"生产日期",width:120,field:"mfd",editable:!0,cellEditor:"validity",hide:!0,dispose:!1},{headerName:"成本",width:90,field:"price",editable:!0,hide:!1,dispose:!0},{headerName:"数量",width:90,field:"nums",editable:!0,cellEditor:"serial",cellEditorParams:{dispose:{record:{show:!1}}},hide:!1,dispose:!0},{headerName:"总成本",width:120,field:"total",hide:!1,dispose:!0},{headerName:"备注信息",width:120,field:"data",editable:!0,hide:!1,dispose:!0}],status:[{text:"总条数",type:"count"},{text:"总合计",type:"sum",key:"total"}]},scan:!1,goods:{dialog:!1,parm:{}}}},computed:{store:function(){return this.$store.state}},created:function(){this.init(),this.$bus.on("buildExtry",this.buildExtry)},methods:{init:function(){var e=this;null==this.source?(this.form.time=this.$moment().format("YYYY-MM-DD"),this.form.number="QTCKD"+this.$moment().format("YYMMDDHHmmssS")):this.$axios.post("extry/get",{parm:this.source}).then((function(t){"success"==t.state?(e.form=t.info.class,e.pushGrid(t.info.info,!1),e.cost=t.info.cost):"error"==t.state?e.$message({type:"warning",message:t.info}):e.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))},save:function(){var e=this,t=this.$refs["form"];this.$lib.aloneValidate(t,["time","number"]).then((function(){var a=e.handleGrid();if(1==a)if(0==e.info.length)e.$message({type:"warning",message:"商品信息不可为空!"});else{var s=e.handleCost();1==s?t.validate((function(t){t?e.$axios.post("extry/save",{class:e.form,info:e.info,cost:e.cost}).then((function(t){"success"==t.state?e.store.sys.fun.examine&&0==e.form.id?(e.form.id=t.info,e.$message({type:"success",message:"审核单据中..."}),setTimeout((function(){e.examine()}),996)):(e.form.id=t.info,e.$message({type:"success",message:"单据保存成功!"})):"error"==t.state?e.$message({type:"warning",message:t.info}):e.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})})):e.$message({type:"warning",message:"表单验证错误,请检查并修正!"})})):e.$message({type:"warning",message:s})}else e.$message({type:"warning",message:a})})).catch((function(t){e.$message({type:"warning",message:t})}))},examine:function(){var e=this;this.$axios.post("extry/examine",{parm:[this.form.id]}).then((function(t){"success"==t.state?(e.form.examine=0==e.form.examine?1:0,e.$message({type:"success",message:(0==e.form.examine?"反审核":"审核")+"单据成功!"})):"error"==t.state?e.$message({type:"warning",message:t.info}):e.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))},check:function(){var e=this;this.$axios.post("extry/check",{parm:[this.form.id]}).then((function(t){"success"==t.state?(e.form.check=0==e.form.check?1:0,e.$message({type:"success",message:(0==e.form.check?"反核对":"核对")+"单据成功!"})):"error"==t.state?e.$message({type:"warning",message:t.info}):e.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))},schemeChange:function(e){this.scan=e,this.$grid.startEditingLastCell(this.grid.options,"name")},typeChange:function(e){var t=0==e?"QTCKD":"PKD";this.form.number=t+this.$moment().format("YYMMDDHHmmssS")},quickEnter:function(e,t){var a=this,s=this.grid.options.api;if(!this.$lib.validate("empty",e)){var r=this.scan?{code:e}:{mate:e},o=Object.assign({page:1,limit:1},r);this.$axios.post("service/goodsRecord",o).then((function(e){if("success"==e.state)if(0==e.count)s.startEditingCell({rowIndex:t,colKey:"name"}),a.$message({type:"warning",message:"未匹配到商品数据!"});else if(1==e.count){var o=e.info[0];if(o.attr.length>1)a.goods.parm=r,a.goods.dialog=!0;else{if(0==o.attr.length)o.attr="",o.nums=1;else{var i=o.attr[0];o=Object.assign({},o,{attr:i.name,buy:i.buy,sell:i.sell,retail:i.retail,code:i.code,nums:1})}a.pushGrid([o]),a.scan&&s.startEditingCell({rowIndex:t+1,colKey:"name"})}}else a.goods.parm=r,a.goods.dialog=!0;else"error"==e.state?a.$message({type:"warning",message:e.info}):a.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))}},pushGrid:function(e){var t,a=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],s=[],r="buy",i=Object(o["a"])(e);try{for(i.s();!(t=i.n()).done;){var l=t.value,n=a?l:l.goodsData,c={uniqid:this.$lib.getUniqid(),key:n.id,goodsType:n.type,unitData:n.units,unitRelation:{valence:n[r],multiple:a?1:null},warehouseId:a?null:l.warehouse,batchType:n.batch,validityType:n.validity,serialType:n.serial,number:n.number,name:n.name,spec:n.spec,attr:l.attr,unit:a?"-1"==n.unit?"点击选择":n.unit:l.unit,warehouse:a?0==n.type?"点击选择":"":this.$lib.objectSeek(l,"warehouseData|name"),batch:a?"":l.batch,mfd:a?"":l.mfd,price:a?n[r]:l.price,nums:l.nums,serial:a?[]:l.serial,total:a?null:l.total,data:a?"":l.data};if(a)c.total=this.$calc.chain(c.price).multiply(c.nums).round(this.store.sys.fun.digit.money).done();else if(c.unitData.length>0){var u=this.$lib.unitRelation(c.unit,c.unitData,this);c.unitRelation.multiple=u.multiple}s.push(c)}}catch(m){i.e(m)}finally{i.f()}this.$grid.pushGridData(this.grid.options,s),this.handleGrid()},handleGrid:function(){var e=!0,t=this.$grid.getGridData(this.grid.options);this.grid.options.columnApi.setColumnsVisible(["batch","mfd"],!1),void 0==t.find((function(e){return e.key&&e.batchType}))||this.grid.options.columnApi.setColumnVisible("batch",!0),void 0==t.find((function(e){return e.key&&e.validityType}))||this.grid.options.columnApi.setColumnVisible("mfd",!0);for(var a=[],s=0;s<t.length;s++)if(null==t[s].key)t.splice(s,1);else{if(t[s].unitData.length>0&&"点击选择"==t[s].unit){1==e&&(e="商品信息第"+(s+1)+"行单位不可为空!");continue}if(0==t[s].goodsType&&null==t[s].warehouseId){1==e&&(e="商品信息第"+(s+1)+"行仓库不可为空!");continue}if(t[s].batchType&&this.$lib.validate("empty",t[s].batch)){1==e&&(e="商品信息第"+(s+1)+"行批次号不可为空!");continue}if(t[s].validityType&&this.$lib.validate("empty",t[s].mfd)){1==e&&(e="商品信息第"+(s+1)+"行生产日期不可为空!");continue}if(!this.$lib.synValidate("money",t[s].price)){1==e&&(e="商品信息第"+(s+1)+"行成本不正确!");continue}if(!this.$lib.synValidate("nums",t[s].nums)){1==e&&(e="商品信息第"+(s+1)+"行数量不正确!");continue}if(t[s].serialType&&0==t[s].serial.length){1==e&&(e="商品信息第"+(s+1)+"行序列号不可为空!");continue}t[s].total=this.$calc.chain(t[s].price).multiply(t[s].nums).round(this.store.sys.fun.digit.money).done(),this.grid.options.api.applyTransaction({update:[t[s]]}),a=a.concat(t[s].serial)}if(1==e){if(a.length!=this.$lib.distinct(a).length)return message&&this.$message({type:"warning",message:"商品信息中存在重复序列号!"}),!1;this.$set(this,"info",t.map((function(e){return{goods:e.key,attr:e.attr,unit:e.unit,warehouse:e.warehouseId,batch:e.batch,mfd:e.mfd,price:e.price,nums:e.nums,serial:e.serial,total:e.total,data:e.data}}))),this.summary()}return e},handleCost:function(){for(var e=!0,t=this.cost,a=0;a<t.length;a++)if(!this.$lib.synValidate("numerical",t[a].money)){e="单据费用第"+(a+1)+"行金额不正确!";break}return e},costChange:function(e){this.form.cost=e},summary:function(){var e=this.$calc.chain(0);this.info.forEach((function(t){e.add(t.total)})),this.form.total=e.done()},buildExtry:function(e){this.form.total=e.class.total,this.form.type=e.class.type,this.typeChange(e.class.type),this.pushGrid(e.info,!1)},goodsDestroy:function(){this.goods.dialog=!1,this.goods.parm={},this.$grid.startEditingLastCell(this.grid.options,"name")},switchPage:function(e){this.$bus.emit("switchPage",e,!0)},reload:function(){this.$bus.emit("homeReload",this.$options.name),this.$message({type:"success",message:"页面刷新成功!"})}},beforeDestroy:function(){this.$bus.off("buildExtry",this.buildExtry)}},C=_,R=a("2877"),T=Object(R["a"])(C,s,r,!1,null,null,null);t["default"]=T.exports},a976:function(e,t,a){"use strict";a.r(t);var s=function(){var e=this,t=e._self._c;return t("div",{staticClass:"entry bill"},[t("el-form",{ref:"form",staticStyle:{height:"100%"},attrs:{model:e.form,rules:e.rules,inline:!0,"hide-required-asterisk":!0}},[t("el-form-item",{attrs:{label:"供应商"}},[t("template",{slot:"label"},[t("span",{on:{click:function(t){return e.switchPage("supplier")}}},[e._v("供应商")])]),t("nodList",{attrs:{placeholder:"请选择供应商",action:"service/supplierRecord",scene:"supplier"},model:{value:e.form.supplier,callback:function(t){e.$set(e.form,"supplier",t)},expression:"form.supplier"}})],2),t("el-form-item",{attrs:{label:"单据日期",prop:"time"}},[t("el-date-picker",{attrs:{"value-format":"yyyy-MM-dd",type:"date",placeholder:"请选择单据日期"},model:{value:e.form.time,callback:function(t){e.$set(e.form,"time",t)},expression:"form.time"}})],1),t("el-form-item",{attrs:{label:"单据编号",prop:"number"}},[t("el-input",{attrs:{placeholder:"请输入单据编号",clearable:""},model:{value:e.form.number,callback:function(t){e.$set(e.form,"number",t)},expression:"form.number"}})],1),t("el-divider",{staticClass:"fistDivider"}),t("ag-grid-vue",{directives:[{name:"madeAgGrid",rawName:"v-madeAgGrid"}],staticClass:"ag-theme-balham",staticStyle:{height:"calc(100% - 256px)"},attrs:{context:e.grid.context,defaultColDef:e.grid.coldef,gridOptions:e.grid.options,columnDefs:e.grid.column,getRowNodeId:e.grid.getRowNodeId,frameworkComponents:e.grid.components,tabToNextCell:e.$grid.gridTabToNextCell},on:{setter:function(t){e.goods.dialog=!0},schemeChange:e.schemeChange,quickEnter:e.quickEnter}}),t("Status",{attrs:{config:e.grid.status,source:e.info}},[1==e.form.examine?t("img",{staticClass:"billExamine",attrs:{src:"/static/images/lib/examine.png"}}):e._e()]),t("el-divider"),t("LineFeed",{attrs:{tag:".el-form-item",rule:3}},[t("el-form-item",{attrs:{label:"单据类型"}},[t("el-select",{attrs:{placeholder:"请选择单据类型"},on:{change:e.typeChange},model:{value:e.form.type,callback:function(t){e.$set(e.form,"type",t)},expression:"form.type"}},[t("el-option",{attrs:{label:"其它入库单",value:0}}),t("el-option",{attrs:{label:"盘盈单",value:1}})],1)],1),t("el-form-item",{attrs:{label:"单据成本"}},[t("el-input",{attrs:{placeholder:"请输入单据成本",disabled:!0},model:{value:e.form.total,callback:function(t){e.$set(e.form,"total",t)},expression:"form.total"}})],1),t("el-form-item",{attrs:{label:"单据费用"}},[t("NodIet",{attrs:{type:"out"},on:{change:e.costChange},model:{value:e.cost,callback:function(t){e.cost=t},expression:"cost"}})],1),t("el-form-item",{attrs:{label:"关联人员"}},[t("nodList",{attrs:{placeholder:"请选择关联人员",action:"service/peopleRecord",scene:"people"},model:{value:e.form.people,callback:function(t){e.$set(e.form,"people",t)},expression:"form.people"}})],1),t("el-form-item",{attrs:{label:"物流信息"}},[t("Logistics",{model:{value:e.form.logistics,callback:function(t){e.$set(e.form,"logistics",t)},expression:"form.logistics"}})],1),t("el-form-item",{attrs:{label:"单据附件"}},[t("NodUpload",{attrs:{action:e.$base.web+"entry/upload"},model:{value:e.form.file,callback:function(t){e.$set(e.form,"file",t)},expression:"form.file"}})],1),t("FieldForm",{staticStyle:{display:"initial"},attrs:{rule:"entry",prefix:"more."},model:{value:e.form.more,callback:function(t){e.$set(e.form,"more",t)},expression:"form.more"}}),t("el-form-item",{attrs:{label:"备注信息"}},[t("el-input",{attrs:{placeholder:"请输入备注信息",clearable:""},model:{value:e.form.data,callback:function(t){e.$set(e.form,"data",t)},expression:"form.data"}})],1)],1)],1),t("div",{staticClass:"layerBtn"},[t("el-button-group",[0==e.form.id||0==e.form.examine&&e.$lib.getUserRoot(e.store.root,"entry","edit")?[t("el-button",{attrs:{type:"info"},on:{click:e.save}},[e._v("保存")])]:e._e(),0!=e.form.id?[e.$lib.getUserRoot(e.store.root,"entry","examine")?[t("el-button",{attrs:{type:"info"},on:{click:e.examine}},[e._v(e._s(0==e.form.examine?"审核":"反审核"))])]:e._e(),t("el-button",{attrs:{type:"info"},on:{click:e.check}},[e._v(e._s(0==e.form.check?"核对":"反核对"))])]:e._e(),null==e.source?[t("el-button",{attrs:{type:"info"},on:{click:e.reload}},[e._v("刷新")])]:e._e()],2)],1),e.goods.dialog?t("GoodsList",{attrs:{parm:e.goods.parm},on:{destroy:e.goodsDestroy,choice:e.pushGrid}}):e._e()],1)},r=[],o=a("b85c"),i=(a("99af"),a("7db0"),a("d81d"),a("14d9"),a("a434"),a("b0c0"),a("d3b7"),a("159b"),a("401b")),l=a("a389"),n=a("60f6"),c=a("fc0a"),u=a("56d9"),m=a("2ff6"),p=a("aac3"),d=a("b232"),h=a("5a8a"),f=a("09a0"),b=a("6b69"),g=a("94ab"),y=a("b786"),v=a("c3e3"),x=a("a447"),w=a("ddf5"),$=a("5549"),k=a("b8a6"),F=a("5fb4"),D=a("1d84"),_={name:"Entry",components:{AgGridVue:i["AgGridVue"],Status:y["a"],LineFeed:v["a"],NodList:x["a"],NodIet:w["a"],NodUpload:$["a"],Logistics:k["a"],FieldForm:F["a"],GoodsList:D["a"]},props:{source:{default:null}},data:function(){var e=this;return{form:{id:0,supplier:null,time:"",number:"",total:0,cost:0,type:0,people:null,logistics:{key:"auto",name:"自动识别",number:""},file:[],data:"",examine:0,check:0,more:{}},rules:{time:{required:!0,message:"请选择单据日期",trigger:"change"},number:{required:!0,message:"请输入单据编号",trigger:"blur"}},info:[],cost:[],grid:{options:{onGridReady:function(){e.$grid.addGridRow(e.grid.options)},onCellEditingStopped:function(e){e.context.runHandleGrid()}},context:{row:{uniqid:this.$lib.getUniqid(),key:null},runHandleGrid:function(){if(null==e.grid.options.api)return!1;e.handleGrid()}},coldef:{suppressMenu:!1,resizable:!0,singleClickEdit:!0,suppressMovable:!0},components:{dispose:l["a"],scheme:n["a"],storeroom:c["a"],setter:u["a"],quickInput:m["a"],company:p["a"],depot:d["a"],storehouse:h["a"],batch:f["a"],validity:b["a"],serial:g["a"]},getRowNodeId:function(e){return e.uniqid},column:[{headerName:"序号",width:50,field:"sequence",headerComponent:"dispose",headerComponentParams:{dispose:{key:"entry"}},valueGetter:function(e){return e.node.rowIndex+1},hide:!1,dispose:!1},{headerName:"操作",width:50,field:"setter",cellRenderer:"setter",hide:!1,dispose:!1},{headerName:"商品名称",width:150,field:"name",headerComponent:"scheme",headerComponentParams:{dispose:{title:"商品名称"}},editable:!0,cellEditor:"quickInput",hide:!1,dispose:!0},{headerName:"商品编号",width:120,field:"number",hide:!1,dispose:!0},{headerName:"规格型号",width:120,field:"spec",hide:!1,dispose:!0},{headerName:"辅助属性",width:120,field:"attr",hide:!1,dispose:!0},{headerName:"单位",width:120,field:"unit",editable:!0,cellEditor:"company",hide:!1,dispose:!0},{headerName:"仓库",width:120,field:"warehouse",headerComponent:"storeroom",headerComponentParams:{dispose:{title:"仓库",key:"warehouseId",text:"warehouse"}},cellRenderer:"depot",cellRendererParams:{dispose:{key:"warehouseId",text:"warehouse"}},editable:!0,cellEditor:"storehouse",cellEditorParams:{dispose:{key:"warehouseId",text:"warehouse"}},hide:!1,dispose:!0},{headerName:"批次号",width:120,field:"batch",editable:!0,cellEditor:"batch",hide:!0,dispose:!1},{headerName:"生产日期",width:120,field:"mfd",editable:!0,cellEditor:"validity",hide:!0,dispose:!1},{headerName:"成本",width:90,field:"price",editable:!0,hide:!1,dispose:!0},{headerName:"数量",width:90,field:"nums",editable:!0,cellEditor:"serial",cellEditorParams:{dispose:{record:{show:!1}}},hide:!1,dispose:!0},{headerName:"总成本",width:120,field:"total",hide:!1,dispose:!0},{headerName:"备注信息",width:120,field:"data",editable:!0,hide:!1,dispose:!0}],status:[{text:"总条数",type:"count"},{text:"总合计",type:"sum",key:"total"}]},scan:!1,goods:{dialog:!1,parm:{}}}},computed:{store:function(){return this.$store.state}},created:function(){this.init(),this.$bus.on("buildEntry",this.buildEntry)},methods:{init:function(){var e=this;null==this.source?(this.form.time=this.$moment().format("YYYY-MM-DD"),this.form.number="QTRKD"+this.$moment().format("YYMMDDHHmmssS")):this.$axios.post("entry/get",{parm:this.source}).then((function(t){"success"==t.state?(e.form=t.info.class,e.pushGrid(t.info.info,!1),e.cost=t.info.cost):"error"==t.state?e.$message({type:"warning",message:t.info}):e.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))},save:function(){var e=this,t=this.$refs["form"];this.$lib.aloneValidate(t,["time","number"]).then((function(){var a=e.handleGrid();if(1==a)if(0==e.info.length)e.$message({type:"warning",message:"商品信息不可为空!"});else{var s=e.handleCost();1==s?t.validate((function(t){t?e.$axios.post("entry/save",{class:e.form,info:e.info,cost:e.cost}).then((function(t){"success"==t.state?e.store.sys.fun.examine&&0==e.form.id?(e.form.id=t.info,e.$message({type:"success",message:"审核单据中..."}),setTimeout((function(){e.examine()}),996)):(e.form.id=t.info,e.$message({type:"success",message:"单据保存成功!"})):"error"==t.state?e.$message({type:"warning",message:t.info}):e.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})})):e.$message({type:"warning",message:"表单验证错误,请检查并修正!"})})):e.$message({type:"warning",message:s})}else e.$message({type:"warning",message:a})})).catch((function(t){e.$message({type:"warning",message:t})}))},examine:function(){var e=this;this.$axios.post("entry/examine",{parm:[this.form.id]}).then((function(t){"success"==t.state?(e.form.examine=0==e.form.examine?1:0,e.$message({type:"success",message:(0==e.form.examine?"反审核":"审核")+"单据成功!"})):"error"==t.state?e.$message({type:"warning",message:t.info}):e.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))},check:function(){var e=this;this.$axios.post("entry/check",{parm:[this.form.id]}).then((function(t){"success"==t.state?(e.form.check=0==e.form.check?1:0,e.$message({type:"success",message:(0==e.form.check?"反核对":"核对")+"单据成功!"})):"error"==t.state?e.$message({type:"warning",message:t.info}):e.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))},schemeChange:function(e){this.scan=e,this.$grid.startEditingLastCell(this.grid.options,"name")},typeChange:function(e){var t=0==e?"QTRKD":"PYD";this.form.number=t+this.$moment().format("YYMMDDHHmmssS")},quickEnter:function(e,t){var a=this,s=this.grid.options.api;if(!this.$lib.validate("empty",e)){var r=this.scan?{code:e}:{mate:e},o=Object.assign({page:1,limit:1},r);this.$axios.post("service/goodsRecord",o).then((function(e){if("success"==e.state)if(0==e.count)s.startEditingCell({rowIndex:t,colKey:"name"}),a.$message({type:"warning",message:"未匹配到商品数据!"});else if(1==e.count){var o=e.info[0];if(o.attr.length>1)a.goods.parm=r,a.goods.dialog=!0;else{if(0==o.attr.length)o.attr="",o.nums=1;else{var i=o.attr[0];o=Object.assign({},o,{attr:i.name,buy:i.buy,sell:i.sell,retail:i.retail,code:i.code,nums:1})}a.pushGrid([o]),a.scan&&s.startEditingCell({rowIndex:t+1,colKey:"name"})}}else a.goods.parm=r,a.goods.dialog=!0;else"error"==e.state?a.$message({type:"warning",message:e.info}):a.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))}},pushGrid:function(e){var t,a=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],s=[],r="buy",i=Object(o["a"])(e);try{for(i.s();!(t=i.n()).done;){var l=t.value,n=a?l:l.goodsData,c={uniqid:this.$lib.getUniqid(),key:n.id,goodsType:n.type,unitData:n.units,unitRelation:{valence:n[r],multiple:a?1:null},warehouseId:a?null:l.warehouse,batchType:n.batch,validityType:n.validity,serialType:n.serial,name:n.name,number:n.number,spec:n.spec,attr:l.attr,unit:a?"-1"==n.unit?"点击选择":n.unit:l.unit,warehouse:a?0==n.type?"点击选择":"":this.$lib.objectSeek(l,"warehouseData|name"),batch:a?"":l.batch,mfd:a?"":l.mfd,price:a?n[r]:l.price,nums:l.nums,serial:a?[]:l.serial,total:a?null:l.total,data:a?"":l.data};if(a)c.total=this.$calc.chain(c.price).multiply(c.nums).round(this.store.sys.fun.digit.money).done();else if(c.unitData.length>0){var u=this.$lib.unitRelation(c.unit,c.unitData,this);c.unitRelation.multiple=u.multiple}s.push(c)}}catch(m){i.e(m)}finally{i.f()}this.$grid.pushGridData(this.grid.options,s),this.handleGrid()},handleGrid:function(){var e=!0,t=this.$grid.getGridData(this.grid.options);this.grid.options.columnApi.setColumnsVisible(["batch","mfd"],!1),void 0==t.find((function(e){return e.key&&e.batchType}))||this.grid.options.columnApi.setColumnVisible("batch",!0),void 0==t.find((function(e){return e.key&&e.validityType}))||this.grid.options.columnApi.setColumnVisible("mfd",!0);for(var a=[],s=0;s<t.length;s++)if(null==t[s].key)t.splice(s,1);else{if(t[s].unitData.length>0&&"点击选择"==t[s].unit){1==e&&(e="商品信息第"+(s+1)+"行单位不可为空!");continue}if(0==t[s].goodsType&&null==t[s].warehouseId){1==e&&(e="商品信息第"+(s+1)+"行仓库不可为空!");continue}if(t[s].batchType&&this.$lib.validate("empty",t[s].batch)){1==e&&(e="商品信息第"+(s+1)+"行批次号不可为空!");continue}if(t[s].validityType&&this.$lib.validate("empty",t[s].mfd)){1==e&&(e="商品信息第"+(s+1)+"行生产日期不可为空!");continue}if(!this.$lib.synValidate("money",t[s].price)){1==e&&(e="商品信息第"+(s+1)+"行成本不正确!");continue}if(!this.$lib.synValidate("nums",t[s].nums)){1==e&&(e="商品信息第"+(s+1)+"行数量不正确!");continue}if(t[s].serialType&&0==t[s].serial.length){1==e&&(e="商品信息第"+(s+1)+"行序列号不可为空!");continue}t[s].total=this.$calc.chain(t[s].price).multiply(t[s].nums).round(this.store.sys.fun.digit.money).done(),this.grid.options.api.applyTransaction({update:[t[s]]}),a=a.concat(t[s].serial)}return 1==e&&(a.length!=this.$lib.distinct(a).length&&1==e&&(e="商品信息中存在重复序列号!"),this.$set(this,"info",t.map((function(e){return{goods:e.key,attr:e.attr,unit:e.unit,warehouse:e.warehouseId,batch:e.batch,mfd:e.mfd,price:e.price,nums:e.nums,serial:e.serial,total:e.total,data:e.data}}))),this.summary()),e},handleCost:function(){for(var e=!0,t=this.cost,a=0;a<t.length;a++)if(!this.$lib.synValidate("numerical",t[a].money)){e="单据费用第"+(a+1)+"行金额不正确!";break}return e},costChange:function(e){this.form.cost=e},summary:function(){var e=this.$calc.chain(0);this.info.forEach((function(t){e.add(t.total)})),this.form.total=e.done()},buildEntry:function(e){this.form.total=e.class.total,this.form.type=e.class.type,this.typeChange(e.class.type),this.pushGrid(e.info,!1)},goodsDestroy:function(){this.goods.dialog=!1,this.goods.parm={},this.$grid.startEditingLastCell(this.grid.options,"name")},switchPage:function(e){this.$bus.emit("switchPage",e,!0)},reload:function(){this.$bus.emit("homeReload",this.$options.name),this.$message({type:"success",message:"页面刷新成功!"})}},beforeDestroy:function(){this.$bus.off("buildEntry",this.buildEntry)}},C=_,R=a("2877"),T=Object(R["a"])(C,s,r,!1,null,null,null);t["default"]=T.exports},a9f3:function(e,t,a){"use strict";a.r(t);a("b0c0");var s=function(){var e=this,t=e._self._c;return t("div",{staticClass:"batch area"},[t("div",{staticClass:"layout"},[t("el-popover",{ref:"searchPopover",attrs:{"popper-class":"searchPopover",placement:"bottom-start"}},[t("el-form",{ref:"searchFrom",staticClass:"searchFrom",attrs:{inline:""}},[t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入商品名称",clearable:""},model:{value:e.searchFrom.name,callback:function(t){e.$set(e.searchFrom,"name",t)},expression:"searchFrom.name"}})],1),t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入商品编号",clearable:""},model:{value:e.searchFrom.number,callback:function(t){e.$set(e.searchFrom,"number",t)},expression:"searchFrom.number"}})],1),t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入批次号码",clearable:""},model:{value:e.searchFrom.batch,callback:function(t){e.$set(e.searchFrom,"batch",t)},expression:"searchFrom.batch"}})],1),t("el-form-item",[t("el-date-picker",{attrs:{placeholder:"请选择生产日期","value-format":"yyyy-MM-dd",type:"date"},model:{value:e.searchFrom.time,callback:function(t){e.$set(e.searchFrom,"time",t)},expression:"searchFrom.time"}})],1),t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入商品型号",clearable:""},model:{value:e.searchFrom.spec,callback:function(t){e.$set(e.searchFrom,"spec",t)},expression:"searchFrom.spec"}})],1),t("el-form-item",[t("nodTree",{attrs:{treeData:e.store.category,placeholder:"请选择商品类别"},model:{value:e.searchFrom.category,callback:function(t){e.$set(e.searchFrom,"category",t)},expression:"searchFrom.category"}})],1),t("el-form-item",[t("el-select",{attrs:{placeholder:"请选择商品品牌",clearable:""},model:{value:e.searchFrom.brand,callback:function(t){e.$set(e.searchFrom,"brand",t)},expression:"searchFrom.brand"}},[e._l(e.store.sys.brand,(function(e){return[t("el-option",{attrs:{label:e,value:e}})]}))],2)],1),t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入商品条码",clearable:""},model:{value:e.searchFrom.code,callback:function(t){e.$set(e.searchFrom,"code",t)},expression:"searchFrom.code"}})],1),t("el-form-item",[t("el-select",{attrs:{placeholder:"请选择仓库信息",multiple:"","collapse-tags":""},model:{value:e.searchFrom.warehouse,callback:function(t){e.$set(e.searchFrom,"warehouse",t)},expression:"searchFrom.warehouse"}},[e._l(e.store.warehouse,(function(e){return[t("el-option",{attrs:{label:e.name,value:e.id}})]}))],2)],1),t("el-form-item",[t("el-select",{attrs:{placeholder:"查询类型"},model:{value:e.searchFrom.state,callback:function(t){e.$set(e.searchFrom,"state",t)},expression:"searchFrom.state"}},[t("el-option",{attrs:{label:"常规批次",value:0}}),t("el-option",{attrs:{label:"预警批次",value:1}})],1)],1),t("el-divider"),t("el-button",{staticClass:"searchBtn",attrs:{icon:"el-icon-search"},on:{click:function(t){return e.record(1)}}})],1),t("el-button",{attrs:{slot:"reference",icon:"el-icon-more"},slot:"reference"})],1),t("el-button-group",[t("el-button",{on:{click:e.exports}},[e._v("导出")]),t("el-button",{on:{click:e.reload}},[e._v("刷新")])],1)],1),t("el-divider"),t("el-table",{directives:[{name:"madeTable",rawName:"v-madeTable"}],attrs:{data:e.tableData,"tree-props":{children:"attr"},"row-key":"key",height:"calc(100% - 90px)",border:""}},[t("el-table-column",{attrs:{prop:"name",label:"商品名称",align:"left",width:"220px",fixed:"left"}}),t("el-table-column",{attrs:{prop:"summary",label:"库存数量",align:"center",width:"120px"}}),t("el-table-column",{attrs:{label:"仓库",align:"center"}},[e._l(e.tableColumn,(function(e){return[t("el-table-column",{attrs:{prop:e.key,label:e.name,align:"center",width:"90px"}})]}))],2),t("el-table-column",{attrs:{prop:"protect",label:"保质期(天)",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"startTime",label:"生产日期",align:"center",width:"160px"}}),t("el-table-column",{attrs:{prop:"endTime",label:"过期日期",align:"center",width:"160px"}}),t("el-table-column",{attrs:{prop:"number",label:"商品编号",align:"center",width:"160px"}}),t("el-table-column",{attrs:{prop:"spec",label:"规格型号",align:"center",width:"160px"}}),t("el-table-column",{attrs:{prop:"categoryData.name",label:"商品分类",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"brand",label:"商品品牌",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"extension.unit",label:"商品单位",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"code",label:"商品条码",align:"center",width:"160px"}}),t("el-table-column",{attrs:{prop:"data",label:"商品备注",align:"center",width:"160px"}}),t("el-table-column",{attrs:{prop:"set",label:"相关操作",align:"center","min-width":"120px",fixed:"right"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("el-button",{attrs:{size:"mini"},on:{click:function(t){return e.showBatchDetail(a.row)}}},[e._v("详情")])]}}])})],1),t("el-pagination",{staticClass:"tablePagination",attrs:{"current-page":e.page.current,total:e.page.total,"page-size":e.page.size,"page-sizes":e.page.sizes,"pager-count":e.page.count,layout:"prev,pager,next,jumper,sizes,total"},on:{"update:currentPage":function(t){return e.$set(e.page,"current",t)},"update:current-page":function(t){return e.$set(e.page,"current",t)},"update:pageSize":function(t){return e.$set(e.page,"size",t)},"update:page-size":function(t){return e.$set(e.page,"size",t)},"size-change":function(t){return e.record(1)},"current-change":function(t){return e.record(0)}}}),e.batchDetailDialog.show?t("BatchDetail",{attrs:{condition:e.batchDetailDialog.condition},on:{destroy:function(t){e.batchDetailDialog.show=!1}}}):e._e()],1)},r=[],o=a("b85c"),i=(a("d81d"),a("14d9"),a("23f7")),l=function(){var e=this,t=e._self._c;return t("div",{staticClass:"batchDetail"},[t("el-dialog",{directives:[{name:"madeDialog",rawName:"v-madeDialog"}],attrs:{visible:e.dialog,title:"批次详情",width:"800px","append-to-body":!0},on:{"update:visible":function(t){e.dialog=t},closed:e.close}},[t("el-table",{directives:[{name:"madeTable",rawName:"v-madeTable"}],attrs:{data:e.tableData,height:"320px",border:""}},[t("el-table-column",{attrs:{prop:"sourceData.frameData.name",label:"所属组织",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"sourceData.time",label:"操作时间",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"extension.type",label:"单据类型",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"sourceData.number",label:"单据编号",align:"center","min-width":"200px"}}),t("el-table-column",{attrs:{prop:"extension.direction",label:"操作类型",align:"center",width:"100px"}}),t("el-table-column",{attrs:{prop:"nums",label:"操作数量",align:"center",width:"100px"}})],1),t("el-pagination",{staticClass:"tablePagination",attrs:{"current-page":e.page.current,total:e.page.total,"page-size":e.page.size,"page-sizes":e.page.sizes,"pager-count":e.page.count,layout:"prev,pager,next,jumper,sizes,total"},on:{"update:currentPage":function(t){return e.$set(e.page,"current",t)},"update:current-page":function(t){return e.$set(e.page,"current",t)},"update:pageSize":function(t){return e.$set(e.page,"size",t)},"update:page-size":function(t){return e.$set(e.page,"size",t)},"size-change":function(t){return e.record(1)},"current-change":function(t){return e.record(0)}}}),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-popover",{ref:"searchPopover",attrs:{"popper-class":"searchPopover",placement:"top-start"}},[t("el-form",{ref:"searchFrom",staticClass:"searchFrom",attrs:{inline:""}},[t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入单据编号",clearable:""},model:{value:e.searchFrom.number,callback:function(t){e.$set(e.searchFrom,"number",t)},expression:"searchFrom.number"}})],1),t("el-form-item",[t("el-select",{attrs:{placeholder:"请选择单据类型",multiple:"","collapse-tags":""},model:{value:e.searchFrom.type,callback:function(t){e.$set(e.searchFrom,"type",t)},expression:"searchFrom.type"}},[t("el-option",{attrs:{label:"采购单",value:"buy"}}),t("el-option",{attrs:{label:"采购退货单",value:"bre"}}),t("el-option",{attrs:{label:"销售单",value:"sell"}}),t("el-option",{attrs:{label:"销售退货单",value:"sre"}}),t("el-option",{attrs:{label:"调拨单-出",value:"swapOut"}}),t("el-option",{attrs:{label:"调拨单-入",value:"swapEnter"}}),t("el-option",{attrs:{label:"其它入库单",value:"entry"}}),t("el-option",{attrs:{label:"其它出库单",value:"extry"}})],1)],1),t("el-form-item",[t("el-date-picker",{attrs:{placeholder:"请输入开始日期","value-format":"yyyy-MM-dd",type:"date"},model:{value:e.searchFrom.startTime,callback:function(t){e.$set(e.searchFrom,"startTime",t)},expression:"searchFrom.startTime"}})],1),t("el-form-item",[t("el-date-picker",{attrs:{placeholder:"请输入结束日期","value-format":"yyyy-MM-dd",type:"date"},model:{value:e.searchFrom.endTime,callback:function(t){e.$set(e.searchFrom,"endTime",t)},expression:"searchFrom.endTime"}})],1),t("el-divider"),t("el-button",{staticClass:"searchBtn",attrs:{icon:"el-icon-search"},on:{click:function(t){return e.record(1)}}})],1),t("el-button",{attrs:{slot:"reference",icon:"el-icon-more"},slot:"reference"})],1),t("el-button",{on:{click:e.exports}},[e._v("导出")])],1)],1)],1)},n=[],c={name:"BatchDetail",props:{condition:{required:!0,type:Object}},data:function(){return{dialog:!0,searchFrom:{number:"",type:[],startTime:"",endTime:""},tableData:[],page:{current:1,total:0,size:10,sizes:[10,20,50,100,200],count:5}}},created:function(){this.record()},computed:{store:function(){return this.$store.state}},methods:{record:function(){var e=this,t=Object.assign({page:this.page.current,limit:this.page.size},this.searchFrom,this.condition);this.$axios.post("batch/detailRecord",t).then((function(t){"success"==t.state?(e.tableData=t.info,e.page.total=t.count,e.$refs["searchPopover"].showPopper=!1):"error"==t.state?e.$message({type:"warning",message:t.info}):e.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))},exports:function(){var e=this;this.$message({type:"success",message:"[ 导出数据 ] 请求中..."});var t=this.$lib.objToParm(Object.assign({},this.searchFrom,this.condition),!0);setTimeout((function(){window.open(e.$base.web+"batch/detailExports?"+t)}),1e3)},close:function(){this.$emit("destroy",!0)}}},u=c,m=(a("9299"),a("2877")),p=Object(m["a"])(u,l,n,!1,null,"0608db42",null),d=p.exports,h={name:"Batch",components:{NodTree:i["a"],BatchDetail:d},data:function(){return{searchFrom:{name:"",number:"",batch:"",time:"",spec:"",category:null,brand:"",code:"",warehouse:[],state:0},tableData:[],tableColumn:[],page:{current:1,total:0,size:30,sizes:[30,60,90,150,300],count:5},batchDetailDialog:{show:!1,condition:{}}}},created:function(){this.record(1)},computed:{store:function(){return this.$store.state}},methods:{record:function(e){var t=this;0==e||(this.page.current=e);var a=Object.assign({page:this.page.current,limit:this.page.size},this.searchFrom);this.$axios.post("batch/record",a).then((function(e){"success"==e.state?(t.tableData=e.info,t.tableColumn=e.column,t.page.total=e.count,t.$refs["searchPopover"].showPopper=!1):"error"==e.state?t.$message({type:"warning",message:e.info}):t.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))},exports:function(){var e=this;this.$message({type:"success",message:"[ 导出数据 ] 请求中..."});var t=this.$lib.objToParm(this.searchFrom,!0);setTimeout((function(){window.open(e.$base.web+"batch/exports?"+t)}),1e3)},showBatchDetail:function(e){var t={batch:[],warehouse:this.tableColumn.map((function(e){return e.id}))},a=function e(a){if(a.hasOwnProperty("attr")){var s,r=Object(o["a"])(a.attr);try{for(r.s();!(s=r.n()).done;){var i=s.value;e(i)}}catch(l){r.e(l)}finally{r.f()}}else t.batch.push(a.batch)};a(e),this.batchDetailDialog.condition=t,this.batchDetailDialog.show=!0},reload:function(){this.$bus.emit("homeReload",this.$options.name),this.$message({type:"success",message:"页面刷新成功!"})}}},f=h,b=(a("2449"),Object(m["a"])(f,s,r,!1,null,"d6b65258",null));t["default"]=b.exports},ada7:function(e,t,a){},b48d:function(e,t,a){},cc09:function(e,t,a){},cce7:function(e,t,a){},cdfb:function(e,t,a){"use strict";a("d117")},d05f:function(e,t,a){},d117:function(e,t,a){},d3c6:function(e,t,a){"use strict";a("7e22")},df19:function(e,t,a){"use strict";a("3688")},e260a:function(e,t,a){"use strict";a("d05f")},fd2d:function(e,t,a){"use strict";a.r(t);a("b0c0");var s=function(){var e=this,t=e._self._c;return t("div",{staticClass:"entryForm area"},[t("div",{staticClass:"layout"},[t("el-popover",{ref:"searchPopover",attrs:{"popper-class":"searchPopover",placement:"bottom-start"}},[t("el-form",{ref:"searchFrom",staticClass:"searchFrom",attrs:{inline:""}},[t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入商品名称",clearable:""},model:{value:e.searchFrom.goods,callback:function(t){e.$set(e.searchFrom,"goods",t)},expression:"searchFrom.goods"}})],1),t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入单据编号",clearable:""},model:{value:e.searchFrom.number,callback:function(t){e.$set(e.searchFrom,"number",t)},expression:"searchFrom.number"}})],1),t("el-form-item",[t("nodList",{attrs:{placeholder:"请选择供应商",action:"service/supplierRecord",scene:"supplier"},model:{value:e.searchFrom.supplier,callback:function(t){e.$set(e.searchFrom,"supplier",t)},expression:"searchFrom.supplier"}})],1),t("el-form-item",[t("nodList",{attrs:{placeholder:"请选择制单人",action:"service/userRecord",scene:"user"},model:{value:e.searchFrom.user,callback:function(t){e.$set(e.searchFrom,"user",t)},expression:"searchFrom.user"}})],1),t("el-form-item",[t("el-date-picker",{attrs:{placeholder:"请输入开始日期","value-format":"yyyy-MM-dd",type:"date"},model:{value:e.searchFrom.startTime,callback:function(t){e.$set(e.searchFrom,"startTime",t)},expression:"searchFrom.startTime"}})],1),t("el-form-item",[t("el-date-picker",{attrs:{placeholder:"请输入结束日期","value-format":"yyyy-MM-dd",type:"date"},model:{value:e.searchFrom.endTime,callback:function(t){e.$set(e.searchFrom,"endTime",t)},expression:"searchFrom.endTime"}})],1),t("el-form-item",[t("nodList",{attrs:{placeholder:"请选择关联人员",action:"service/peopleRecord",scene:"people"},model:{value:e.searchFrom.people,callback:function(t){e.$set(e.searchFrom,"people",t)},expression:"searchFrom.people"}})],1),t("el-form-item",[t("el-select",{attrs:{placeholder:"请选择审核状态",clearable:""},model:{value:e.searchFrom.examine,callback:function(t){e.$set(e.searchFrom,"examine",t)},expression:"searchFrom.examine"}},[t("el-option",{attrs:{label:"未审核",value:1}}),t("el-option",{attrs:{label:"已审核",value:2}})],1)],1),t("el-form-item",[t("el-select",{attrs:{placeholder:"请选择费用状态",clearable:""},model:{value:e.searchFrom.cse,callback:function(t){e.$set(e.searchFrom,"cse",t)},expression:"searchFrom.cse"}},[t("el-option",{attrs:{label:"未结算",value:1}}),t("el-option",{attrs:{label:"部分结算",value:2}}),t("el-option",{attrs:{label:"已结算",value:3}}),t("el-option",{attrs:{label:"无需结算",value:4}})],1)],1),t("el-form-item",[t("el-select",{attrs:{placeholder:"请选择核对状态",clearable:""},model:{value:e.searchFrom.check,callback:function(t){e.$set(e.searchFrom,"check",t)},expression:"searchFrom.check"}},[t("el-option",{attrs:{label:"未核对",value:1}}),t("el-option",{attrs:{label:"已核对",value:2}})],1)],1),t("el-form-item",[t("el-select",{attrs:{placeholder:"请选择单据类型",clearable:""},model:{value:e.searchFrom.type,callback:function(t){e.$set(e.searchFrom,"type",t)},expression:"searchFrom.type"}},[t("el-option",{attrs:{label:"其它入库单",value:1}}),t("el-option",{attrs:{label:"盘盈单",value:2}})],1)],1),t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入备注信息",clearable:""},model:{value:e.searchFrom.data,callback:function(t){e.$set(e.searchFrom,"data",t)},expression:"searchFrom.data"}})],1),t("el-divider"),t("el-button",{staticClass:"searchBtn",attrs:{icon:"el-icon-search"},on:{click:function(t){return e.record(1)}}})],1),t("el-button",{attrs:{slot:"reference",icon:"el-icon-more"},slot:"reference"})],1),t("el-button-group",[0!=e.tableSelection.length?[e.$lib.getUserRoot(e.store.root,"entry","examine")?[t("el-popover",{staticClass:"btnGroupPopover",attrs:{type:"center","popper-class":"blockPopover",trigger:"click"}},[t("el-button",{attrs:{slot:"reference",type:"info"},slot:"reference"},[e._v("操作")]),t("ul",[e.$lib.getUserRoot(e.store.root,"entry","examine")?[t("li",{on:{click:function(t){return e.examine(0)}}},[e._v("审核")]),t("li",{on:{click:function(t){return e.examine(1)}}},[e._v("反审核")])]:e._e(),t("li",{on:{click:function(t){return e.check(0)}}},[e._v("核对")]),t("li",{on:{click:function(t){return e.check(1)}}},[e._v("反核对")])],2)],1)]:e._e(),e.$lib.getUserRoot(e.store.root,"entry","del")?[t("el-button",{attrs:{type:"info"},on:{click:function(t){return e.del(e.tableSelection)}}},[e._v("删除")])]:e._e()]:e._e(),e.$lib.getUserRoot(e.store.root,"entry","batch")?[t("el-button",{on:{click:function(t){e.batch.dialog=!0}}},[e._v("批量")])]:e._e(),t("el-button",{on:{click:e.reload}},[e._v("刷新")])],2)],1),t("el-divider"),t("el-table",{directives:[{name:"madeTable",rawName:"v-madeTable"}],attrs:{data:e.tableData,height:"calc(100% - 90px)",border:""},on:{"selection-change":e.selectionChange}},[t("el-table-column",{attrs:{type:"selection",align:"center",width:"39px",fixed:"left"}}),t("el-table-column",{attrs:{prop:"frameData.name",label:"所属组织",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"supplierData.name",label:"供应商",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"extension.type",label:"单据类型",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"time",label:"单据时间",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"number",label:"单据编号",align:"center",width:"200px"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("span",{on:{click:function(t){return e.billShow(a.row.id)}}},[e._v(e._s(a.row.number))])]}}])}),t("el-table-column",{attrs:{prop:"total",label:"单据成本",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"cost",label:"单据费用",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"peopleData.name",label:"关联人员",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"extension.examine",label:"审核状态",align:"center",width:"100px"}}),t("el-table-column",{attrs:{prop:"cse",label:"费用状态",align:"center",width:"100px"},scopedSlots:e._u([{key:"default",fn:function(a){return[0==a.row.costData.length?[t("span",[e._v(e._s(a.row.extension.cse))])]:[t("el-popover",{attrs:{"popper-class":"tablePopover",trigger:"click"}},[t("div",{attrs:{slot:"reference"},slot:"reference"},[t("span",[e._v(e._s(a.row.extension.cse))]),t("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),t("el-table",{attrs:{data:a.row.costData,height:"120px",size:"mini",border:""}},[t("el-table-column",{attrs:{prop:"ietData.name",label:"支出类别",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"money",label:"金额",align:"center",width:"90px"}}),t("el-table-column",{attrs:{prop:"settle",label:"结算金额",align:"center",width:"90px"}}),t("el-table-column",{attrs:{prop:"extension.state",label:"结算状态",align:"center",width:"90px"}})],1)],1)]]}}])}),t("el-table-column",{attrs:{prop:"extension.check",label:"核对状态",align:"center",width:"100px"}}),t("el-table-column",{attrs:{prop:"userData.name",label:"制单人",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"data",label:"备注信息",align:"center",width:"200px"}}),t("el-table-column",{attrs:{prop:"set",label:"相关操作",align:"center",width:"180px",fixed:"right"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("el-button-group",[t("el-button",{attrs:{size:"mini"},on:{click:function(t){return e.billShow(a.row.id)}}},[e._v("详情")]),e.$lib.getUserRoot(e.store.root,"entry","del")?[t("el-button",{attrs:{size:"mini"},on:{click:function(t){return e.del([a.row.id])}}},[e._v("删除")])]:e._e(),t("el-popover",{staticClass:"btnGroupPopover",attrs:{type:"right","popper-class":"listPopover",trigger:"click",placement:"bottom-end"}},[t("el-button",{staticStyle:{padding:"7px"},attrs:{slot:"reference",icon:"el-icon-arrow-down",size:"mini"},slot:"reference"}),t("ul",[e._l(a.row.recordData,(function(a){return[t("li",[e._v(" "+e._s(a.extension.time)+" - "+e._s(a.userData.name)+" - "+e._s(a.info)+" ")])]}))],2)],1)],2)]}}])})],1),t("el-pagination",{staticClass:"tablePagination",attrs:{"current-page":e.page.current,total:e.page.total,"page-size":e.page.size,"page-sizes":e.page.sizes,"pager-count":e.page.count,layout:"prev,pager,next,jumper,sizes,total,slot"},on:{"update:currentPage":function(t){return e.$set(e.page,"current",t)},"update:current-page":function(t){return e.$set(e.page,"current",t)},"update:pageSize":function(t){return e.$set(e.page,"size",t)},"update:page-size":function(t){return e.$set(e.page,"size",t)},"size-change":function(t){return e.record(1)},"current-change":function(t){return e.record(0)}}},[t("PageStatus",{attrs:{config:e.page.status,model:e.tableData}})],1),t("el-dialog",{staticClass:"billDialog",attrs:{visible:e.bill.dialog,title:"单据详情",fullscreen:!0},on:{"update:visible":function(t){return e.$set(e.bill,"dialog",t)},close:e.billDestroy}},[t("transition",{attrs:{name:"el-fade-in"}},[e.bill.dialog?[t("Entry",{attrs:{source:e.bill.source},on:{destroy:function(t){e.bill.dialog=!1}}})]:e._e()],2)],1),t("el-dialog",{directives:[{name:"madeDialog",rawName:"v-madeDialog"}],staticClass:"tabsDialog",attrs:{visible:e.batch.dialog,title:"批量",width:"420px"},on:{"update:visible":function(t){return e.$set(e.batch,"dialog",t)}}},[t("transition",{attrs:{name:"el-fade-in"}},[e.batch.dialog?[t("el-tabs",{model:{value:e.batch.active,callback:function(t){e.$set(e.batch,"active",t)},expression:"batch.active"}},[t("el-tab-pane",{attrs:{label:"导入数据",name:"import"}},[t("ul",{staticClass:"importTip"},[t("li",[e._v("1.该功能适用于Excel导入单据数据。")]),t("li",[e._v("2.录入数据时,请勿修改首行数据标题以及排序。")]),t("li",[e._v("3.字段之间存在关联关系时,将自动进行关联运算。")]),t("li",[e._v("4.请查阅使用文档获取字段格式内容以及相关导入须知。")]),t("li",[e._v("5.点击下方上传模板,选择您编辑好的模板文件即可。")])]),t("el-divider"),t("el-row",{staticStyle:{"text-align":"center"}},[t("el-col",{attrs:{span:12}},[t("el-button",{attrs:{type:"info"},on:{click:e.downTemplate}},[e._v("下载模板")])],1),t("el-col",{attrs:{span:12}},[t("el-upload",{attrs:{action:e.$base.web+"entry/import",headers:{Token:e.$store.state.token},"show-file-list":!1,"on-success":e.importCall}},[t("el-button",{attrs:{type:"primary"}},[e._v("上传模板")])],1)],1)],1)],1),t("el-tab-pane",{staticClass:"exportGroup",attrs:{label:"导出数据",name:"export"}},[t("div",{staticClass:"item",on:{click:function(t){return e.exports("simple")}}},[t("i",{staticClass:"el-icon-download"}),t("p",[e._v("简易报表")])]),t("div",{staticClass:"item",on:{click:function(t){return e.exports("detailed")}}},[t("i",{staticClass:"el-icon-download"}),t("p",[e._v("详细报表")])])])],1)]:e._e()],2)],1)],1)},r=[],o=a("b85c"),i=(a("14d9"),a("d3b7"),a("159b"),a("a976")),l=a("a447"),n=a("947e"),c={name:"EntryForm",components:{Entry:i["default"],NodList:l["a"],PageStatus:n["a"]},data:function(){return{searchFrom:{goods:"",number:"",supplier:null,people:null,startTime:"",endTime:"",type:"",examine:"",cse:"",check:"",user:null,data:""},tableData:[],tableSelection:[],page:{current:1,total:0,size:30,sizes:[30,60,90,150,300],count:5,status:[{text:"总单据成本",type:"sum",key:"total"},{text:"总单据费用",type:"sum",key:"cost"}]},bill:{dialog:!1,source:null},batch:{dialog:!1,active:"import"}}},created:function(){this.init(),this.record(1)},computed:{store:function(){return this.$store.state}},methods:{init:function(){this.searchFrom.startTime=this.$moment().subtract(this.store.sys.fun.days,"days").format("YYYY-MM-DD"),this.searchFrom.endTime=this.$moment().format("YYYY-MM-DD")},record:function(e){var t=this;0==e||(this.page.current=e);var a=Object.assign({page:this.page.current,limit:this.page.size},this.searchFrom);this.$axios.post("entry/record",a).then((function(e){"success"==e.state?(t.tableData=e.info,t.page.total=e.count,t.$refs["searchPopover"].showPopper=!1):"error"==e.state?t.$message({type:"warning",message:e.info}):t.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))},billShow:function(e){this.bill.source=e,this.bill.dialog=!0},billDestroy:function(){this.record(0)},examine:function(e){var t=this,a=[];this.tableData.forEach((function(s){-1!=t.tableSelection.indexOf(s.id)&&(0==s.examine?0==e&&a.push(s.id):1==e&&a.push(s.id))})),0==a.length?this.$message({type:"warning",message:"无可操作单据!"}):this.$axios.post("entry/examine",{parm:a}).then((function(e){"success"==e.state?(t.record(0),t.$message({type:"success",message:"操作单据成功!"})):"error"==e.state?(t.record(0),t.$message({type:"warning",message:e.info})):t.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))},check:function(e){var t=this,a=[];this.tableData.forEach((function(s){-1!=t.tableSelection.indexOf(s.id)&&(0==s.check?0==e&&a.push(s.id):1==e&&a.push(s.id))})),0==a.length?this.$message({type:"warning",message:"无可操作单据!"}):this.$axios.post("entry/check",{parm:a}).then((function(e){"success"==e.state?(t.record(0),t.$message({type:"success",message:"操作单据成功!"})):"error"==e.state?(t.record(0),t.$message({type:"warning",message:e.info})):t.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))},del:function(e){var t=this;this.$confirm("您确定要删除选中数据吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){t.$axios.post("entry/del",{parm:e}).then((function(e){"success"==e.state?(t.record(0),t.$message({type:"success",message:"删除成功!"})):"error"==e.state?t.$message({type:"warning",message:e.info}):t.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})})).catch((function(){}))}))},downTemplate:function(){var e=this;this.$message({type:"success",message:"[ 数据模板 ] 下载请求中..."}),setTimeout((function(){window.open(e.store.base.cdnSite+"/erp/batch/其它入库单导入模板.xlsx")}),1e3)},importCall:function(e,t,a){"success"==e.state?(this.$bus.emit("homeReload",this.$options.name),this.$message({type:"success",message:"导入单据成功!"})):"error"==e.state?this.$message({type:"warning",message:"[ "+t.name+" ]"+e.info}):this.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})},exports:function(e){var t=this;if(0==this.tableSelection.length)this.$message({type:"warning",message:"未选择导出数据内容!"});else{this.$message({type:"success",message:"[ 导出数据 ] 请求中..."});var a=this.$lib.objToParm({scene:e,parm:this.tableSelection},!0);setTimeout((function(){window.open(t.$base.web+"entry/exports?"+a)}),1e3)}},selectionChange:function(e){var t,a=[],s=Object(o["a"])(e);try{for(s.s();!(t=s.n()).done;){var r=t.value;a.push(r.id)}}catch(i){s.e(i)}finally{s.f()}this.tableSelection=a},reload:function(){this.$bus.emit("homeReload",this.$options.name),this.$message({type:"success",message:"页面刷新成功!"})}}},u=c,m=(a("13ed"),a("2877")),p=Object(m["a"])(u,s,r,!1,null,null,null);t["default"]=p.exports}}]);