webpackJsonp([17],{"+6Bu":function(t,e,l){"use strict";e.__esModule=!0,e.default=function(t,e){var l={};for(var a in t)e.indexOf(a)>=0||Object.prototype.hasOwnProperty.call(t,a)&&(l[a]=t[a]);return l}},LZD3:function(t,e,l){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=l("Dd8w"),n=l.n(a),i=l("+6Bu"),o=l.n(i),r=l("woOf"),s=l.n(r),c=l("5LJj"),u=l("bOdI"),d=l.n(u),p=(l("pFYg"),l("oqQY")),f=l.n(p);var h=l("caBC"),m=l("UgCr"),S={keyword:null,pageNum:1,pageSize:5,id:null,selectProductSn:null,timer:null},g={name:"productList",data:function(){return{type:"create",dialogVisible:!1,editSkuInfo:{productId:null,productSkuId:null,selectProductSn:null,internalStock:null,taxStock:null,price:null},rules:{selectProductSn:[{required:!0,message:"请输入查备货号",trigger:"blur"}],internalStock:[{required:!0,message:"请输入内部库存",trigger:"blur"}],taxStock:[{required:!0,message:"请输入税务库存",trigger:"blur"}],price:[{required:!0,message:"请输入采购价",trigger:"blur"}],productSkuId:[{required:!0,message:"请选择Sku",trigger:"change, blur"}]},loading:!1,stockList:[],productId:null,listQuery:s()({},S),list:null,total:null,listLoading:!0,selectProductCateValue:null,multipleSelection:[],productCateOptions:[],brandOptions:[]}},created:function(){this.productId=this.$route.query.id,this.getList()},methods:{onchange:function(t){this.editSkuInfo.internalStock=t.replace(/[^\d]/g,"")},getList:function(){var t=this;this.listLoading=!0;var e=this.listQuery,l=e.timer,a=o()(e,["timer"]);Object(m.e)(n()({},a,{productId:this.productId},function(t){var e,l,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"YYYY-MM-DD";return t&&t.length?"YYYY-MM-DD"==n?(e={},d()(e,a[0]||"start",f()(t[0]).isValid()?f()(t[0]).format(n)+" 00:00:00":""),d()(e,a[1]||"end",f()(t[1]).isValid()?f()(t[1]).format(n)+" 23:59:59":""),e):(l={},d()(l,a[0]||"start",f()(t[0]).isValid()?f()(t[0]).format(n):""),d()(l,a[1]||"end",f()(t[1]).isValid()?f()(t[1]).format(n):""),l):{}}(l,["startTime","endTime"]))).then(function(e){t.listLoading=!1,t.list=e.data.list,t.total=e.data.total})},handleConfirm:function(t){var e=this;this.$refs[t].validate(function(t){if(!t)return console.log("error submit!!"),!1;var l=n()({},e.editSkuInfo,{productId:e.productId});e.loading=!0,"create"==e.type?Object(m.f)(l).then(function(t){e.$message({message:"create"==e.type?"添加成功":"修改成功",type:"success",duration:1e3}),e.dialogVisible=!1,e.handleClose(),e.getList()}).catch(function(){e.loading=!1}):Object(m.g)(l).then(function(t){e.$message({message:"create"==e.type?"添加成功":"修改成功",type:"success",duration:1e3}),e.dialogVisible=!1,e.handleClose(),e.getList()}).catch(function(){e.loading=!1})})},handleClose:function(){this.dialogVisible=!1,!this.dialogVisible&&this.$refs.productAttrCatForm&&this.$refs.productAttrCatForm.clearValidate()},handleSearchList:function(){this.listQuery.pageNum=1,this.getList()},onUpdate:function(t){var e=this;this.type="update",this.loading=!1,this.editSkuInfo={id:t.id,productId:t.productId,productSkuId:t.productSkuId,selectProductSn:t.selectProductSn,internalStock:t.internalStock,taxStock:t.taxStock,price:t.price},Object(h.a)(this.productId).then(function(t){try{var l=t.data||[];l.forEach(function(t){var e="";(t.spData?JSON.parse(t.spData):[{key:"默认"}]).forEach(function(t){e+=t.key+(t.value?":"+t.value:"")}),t.spText=e}),e.stockList=l,e.dialogVisible=!0}catch(t){console.log(t)}})},handleAddProduct:function(){var t=this;this.type="create",this.loading=!1,this.editSkuInfo={productId:null,productSkuId:null,selectProductSn:null,internalStock:null,taxStock:null,price:null},Object(h.a)(this.productId).then(function(e){try{var l=e.data||[];l.forEach(function(t){var e="";(t.spData?JSON.parse(t.spData):[{key:"默认"}]).forEach(function(t){e+=t.key+(t.value?":"+t.value:"")}),t.spText=e}),t.stockList=l,t.dialogVisible=!0}catch(t){console.log(t)}})},handleDownloadStock:function(){Object(c.a)(this,{url:"/api-mall-admin/export/pmsProductSkuStockRecord",fileName:"进货清单记录.xls",method:"post",params:n()({},this.listQuery,{productId:this.productId})},"您确定导出进货清单记录?")},handleSizeChange:function(t){this.listQuery.pageNum=1,this.listQuery.pageSize=t,this.getList()},handleCurrentChange:function(t){this.listQuery.pageNum=t,this.getList()},handleResetSearch:function(){this.selectProductCateValue=[],this.listQuery=s()({},S),this.handleSearchList()}}},k={render:function(){var t=this,e=t.$createElement,l=t._self._c||e;return l("div",{staticClass:"app-container"},[l("el-card",{staticClass:"filter-container",attrs:{shadow:"never"}},[l("div",[l("i",{staticClass:"el-icon-search"}),t._v(" "),l("span",[t._v("筛选搜索")]),t._v(" "),l("el-button",{staticStyle:{float:"right"},attrs:{type:"primary",size:"small"},on:{click:function(e){t.handleSearchList()}}},[t._v("\n 查询结果\n ")]),t._v(" "),l("el-button",{staticStyle:{float:"right","margin-right":"15px"},attrs:{size:"small"},on:{click:function(e){t.handleResetSearch()}}},[t._v("\n 重置\n ")])],1),t._v(" "),l("div",{staticStyle:{"margin-top":"15px"}},[l("el-form",{attrs:{inline:!0,model:t.listQuery,size:"small","label-width":"120px"}},[l("el-form-item",{attrs:{label:"批次号:"}},[l("el-input",{staticStyle:{width:"203px"},attrs:{placeholder:"请输入批次号"},model:{value:t.listQuery.id,callback:function(e){t.$set(t.listQuery,"id",e)},expression:"listQuery.id"}})],1),t._v(" "),l("el-form-item",{attrs:{label:"备查货号:"}},[l("el-input",{staticStyle:{width:"203px"},attrs:{placeholder:"请输入备查货号"},model:{value:t.listQuery.selectProductSn,callback:function(e){t.$set(t.listQuery,"selectProductSn",e)},expression:"listQuery.selectProductSn"}})],1),t._v(" "),l("el-form-item",{attrs:{label:"入库时间:"}},[l("el-date-picker",{attrs:{type:"daterange",align:"right","unlink-panels":"","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期",format:"yyyy-MM-dd","value-format":"yyyy-MM-dd",clearable:!1},model:{value:t.listQuery.timer,callback:function(e){t.$set(t.listQuery,"timer",e)},expression:"listQuery.timer"}})],1)],1)],1)]),t._v(" "),l("el-card",{staticClass:"operate-container",attrs:{shadow:"never"}},[l("i",{staticClass:"el-icon-tickets"}),t._v(" "),l("span",[t._v("数据列表")]),t._v(" "),l("div",{staticClass:"btn-add"},[l("el-button",{attrs:{size:"mini"},on:{click:function(e){t.handleAddProduct()}}},[t._v("\n 新增入库\n ")]),t._v(" "),l("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(e){t.handleDownloadStock()}}},[t._v("\n 导出记录\n ")])],1)]),t._v(" "),l("div",{staticClass:"table-container"},[l("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.listLoading,expression:"listLoading"}],ref:"productTable",staticStyle:{width:"100%"},attrs:{data:t.list,border:""}},[l("el-table-column",{attrs:{label:"批次号",width:"100",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(e.row.id))]}}])}),t._v(" "),l("el-table-column",{attrs:{label:"备查货号",width:"120",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(e.row.selectProductSn))]}}])}),t._v(" "),l("el-table-column",{attrs:{label:"序号",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[l("p",[t._v(t._s(e.row.productSkuId))])]}}])}),t._v(" "),l("el-table-column",{attrs:{label:"sku编号",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[l("p",[t._v(t._s(e.row.productSkuCode))])]}}])}),t._v(" "),l("el-table-column",{attrs:{label:"sku规格",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[l("p",[t._v(t._s(e.row.spData))])]}}])}),t._v(" "),l("el-table-column",{attrs:{label:"内部库存",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[l("p",[t._v(t._s(e.row.internalStock))])]}}])}),t._v(" "),l("el-table-column",{attrs:{label:"内部售出数量",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[l("p",[t._v(t._s(e.row.internalSaleStock))])]}}])}),t._v(" "),l("el-table-column",{attrs:{label:"税务库存",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[l("p",[t._v(t._s(e.row.taxStock))])]}}])}),t._v(" "),l("el-table-column",{attrs:{label:"税务售出库存",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[l("p",[t._v(t._s(e.row.taxSaleStock))])]}}])}),t._v(" "),l("el-table-column",{attrs:{label:"采购价",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[l("p",[t._v(t._s(e.row.price))])]}}])}),t._v(" "),l("el-table-column",{attrs:{label:"入库日期",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[l("p",[t._v(t._s(e.row.createTime))])]}}])}),t._v(" "),l("el-table-column",{attrs:{label:"操作",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[l("el-button",{attrs:{type:"text",disabled:0!=e.row.internalSaleStock||0!=e.row.taxSaleStock},on:{click:function(l){t.onUpdate(e.row)}}},[t._v("修改")])]}}])})],1)],1),t._v(" "),l("div",{staticClass:"pagination-container"},[l("el-pagination",{attrs:{background:"",layout:"total, sizes,prev, pager, next,jumper","page-size":t.listQuery.pageSize,"page-sizes":[5,10,15],"current-page":t.listQuery.pageNum,total:t.total},on:{"size-change":t.handleSizeChange,"current-change":t.handleCurrentChange,"update:currentPage":function(e){t.$set(t.listQuery,"pageNum",e)}}})],1),t._v(" "),l("el-dialog",{attrs:{title:"create"==t.type?"新增入库":"修改入库",visible:t.dialogVisible,width:"40%"},on:{"update:visible":function(e){t.dialogVisible=e}}},[l("el-form",{ref:"productAttrCatForm",attrs:{model:t.editSkuInfo,rules:t.rules,"label-width":"120px"}},[l("el-form-item",{attrs:{label:"查备货号",prop:"selectProductSn"}},[l("el-input",{attrs:{size:"small",placeholder:"请输入查备货号","auto-complete":"off"},model:{value:t.editSkuInfo.selectProductSn,callback:function(e){t.$set(t.editSkuInfo,"selectProductSn",e)},expression:"editSkuInfo.selectProductSn"}})],1),t._v(" "),l("el-form-item",{attrs:{label:"内部库存",prop:"internalStock"}},[l("el-input",{attrs:{size:"small",placeholder:"请输入内部库存","auto-complete":"off"},on:{input:function(e){t.onchange(e)}},model:{value:t.editSkuInfo.internalStock,callback:function(e){t.$set(t.editSkuInfo,"internalStock",e)},expression:"editSkuInfo.internalStock"}})],1),t._v(" "),l("el-form-item",{attrs:{label:"税务库存",prop:"taxStock"}},[l("el-input",{attrs:{size:"small",placeholder:"请输入税务库存","auto-complete":"off"},on:{input:function(e){t.editSkuInfo.taxStock=e.replace(/[^\d]/g,"")}},model:{value:t.editSkuInfo.taxStock,callback:function(e){t.$set(t.editSkuInfo,"taxStock",e)},expression:"editSkuInfo.taxStock"}})],1),t._v(" "),l("el-form-item",{attrs:{label:"采购价",prop:"price"}},[l("el-input",{attrs:{size:"small",placeholder:"请输入采购价","auto-complete":"off"},nativeOn:{keyup:function(e){t.keyupEvent(e)}},model:{value:t.editSkuInfo.price,callback:function(e){t.$set(t.editSkuInfo,"price",e)},expression:"editSkuInfo.price"}})],1),t._v(" "),l("el-form-item",{attrs:{label:"Sku",prop:"productSkuId"}},[l("el-select",{staticStyle:{width:"100%"},attrs:{size:"small",placeholder:"请选择Sku"},model:{value:t.editSkuInfo.productSkuId,callback:function(e){t.$set(t.editSkuInfo,"productSkuId",e)},expression:"editSkuInfo.productSkuId"}},t._l(t.stockList,function(t){return l("el-option",{key:t.id,attrs:{label:t.spText,value:t.id}})}))],1)],1),t._v(" "),l("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[l("el-button",{on:{click:t.handleClose}},[t._v("取 消")]),t._v(" "),l("el-button",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],attrs:{type:"primary",disabled:t.loading},on:{click:function(e){t.handleConfirm("productAttrCatForm")}}},[t._v("确 定")])],1)],1)],1)},staticRenderFns:[]};var v=l("VU/8")(g,k,!1,function(t){l("bqmw")},"data-v-22d120f3",null);e.default=v.exports},bqmw:function(t,e){},caBC:function(t,e,l){"use strict";e.a=function(t,e){return Object(a.a)({url:"/sku/"+t,method:"get",params:e})},e.b=function(t,e){return Object(a.a)({url:"/sku/update/"+t,method:"post",data:e})};var a=l("vLgD")}}); //# sourceMappingURL=17.e9e8af1100534438adc3.js.map