chunk-78f757c3.9cc3fd06.js 35 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-78f757c3"],{"09f4":function(e,t,a){"use strict";a.d(t,"a",function(){return n}),Math.easeInOutQuad=function(e,t,a,l){return e/=l/2,e<1?a/2*e*e+t:(e--,-a/2*(e*(e-2)-1)+t)};var l=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}}();function o(e){document.documentElement.scrollTop=e,document.body.parentNode.scrollTop=e,document.body.scrollTop=e}function r(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function n(e,t,a){var n=r(),i=e-n,s=20,u=0;t="undefined"===typeof t?500:t;var c=function e(){u+=s;var r=Math.easeInOutQuad(u,n,i,t);o(r),u<t?l(e):a&&"function"===typeof a&&a()};c()}},2543:function(e,t,a){"use strict";a.d(t,"i",function(){return i}),a.d(t,"j",function(){return s}),a.d(t,"m",function(){return u}),a.d(t,"g",function(){return c}),a.d(t,"k",function(){return d}),a.d(t,"h",function(){return p}),a.d(t,"a",function(){return m}),a.d(t,"b",function(){return f}),a.d(t,"c",function(){return b}),a.d(t,"f",function(){return g}),a.d(t,"l",function(){return h}),a.d(t,"e",function(){return v}),a.d(t,"d",function(){return y});var l=a("b775"),o=a("4328"),r=a.n(o),n="/api-web";function i(e){return Object(l["a"])({url:n+"/goods/queryPage",method:"get",params:e})}function s(e){return Object(l["a"])({url:n+"/goods/get/".concat(e),method:"get"})}function u(e){return Object(l["a"])({url:n+"/goods/updateGoodsStatus",method:"post",data:r.a.stringify(e)})}function c(e){return Object(l["a"])({url:n+"/goods/add",method:"post",data:r.a.stringify(e)})}function d(e){return Object(l["a"])({url:n+"/goods/update",method:"post",data:r.a.stringify(e)})}function p(e){return Object(l["a"])({url:n+"/goods/del/".concat(e),method:"post"})}function m(e){return Object(l["a"])({url:n+"/category/queryPage",method:"get",params:e})}function f(e){return Object(l["a"])({url:n+"/category/upset",method:"post",data:e})}function b(e){return Object(l["a"])({url:n+"/category/del",method:"post",data:r.a.stringify(e)})}function g(e){return Object(l["a"])({url:n+"/subjectChange/queryPage",method:"get",params:e})}function h(e){return Object(l["a"])({url:n+"/subjectChange/updateCostMargin",method:"post",data:r.a.stringify(e)})}function v(e){return Object(l["a"])({url:n+"/goodsProcurement/queryGoodsProcurements",method:"get",params:e})}function y(e){return Object(l["a"])({url:n+"/goods/addGoodsProcurement",method:"post",params:e})}},3516:function(e,t,a){"use strict";var l=a("4500"),o=a.n(l);o.a},4500:function(e,t,a){},5046:function(e,t,a){},"54b3":function(e,t,a){"use strict";a.r(t);var l,o=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"m-container"},[e._m(0),e._v(" "),a("div",{staticClass:"m-core"},[a("el-button",{directives:[{name:"permission",rawName:"v-permission",value:"/shopOperation",expression:"'/shopOperation'"}],staticClass:"btn-primary",on:{click:function(t){return e.onShopOperation("create")}}},[e._v("添加")]),e._v(" "),a("el-upload",{directives:[{name:"permission",rawName:"v-permission",value:"import/goods",expression:"'import/goods'"}],staticStyle:{display:"inline-block",margin:"0 10px"},attrs:{action:"/api-web/import/goods","show-file-list":!1,"before-upload":e.beforeUpload,accept:".xlsx,.xls",headers:e.headers,"on-error":e.handleError,"on-success":e.handleSuccess}},[a("el-button",{staticClass:"btn-primary"},[e._v("商品导入")])],1),e._v(" "),a("el-button",{directives:[{name:"permission",rawName:"v-permission",value:"import/downloadTemplate",expression:"'import/downloadTemplate'"}],staticClass:"btn-primary",on:{click:e.onDownload}},[e._v("下载模板")]),e._v(" "),a("el-button",{staticClass:"btn-primary",attrs:{permission:"'goods/update'"},on:{click:e.onShopComAdd}},[e._v("添加组合商品")]),e._v(" "),a("el-form",{staticClass:"searchForm",attrs:{inline:!0},model:{value:e.searchForm,callback:function(t){e.searchForm="string"===typeof t?t.trim():t},expression:"searchForm"}},[a("el-form-item",[a("el-input",{attrs:{placeholder:"商品编号/货号/商品名称"},model:{value:e.searchForm.search,callback:function(t){e.$set(e.searchForm,"search","string"===typeof t?t.trim():t)},expression:"searchForm.search"}})],1),e._v(" "),a("el-form-item",[a("el-select",{attrs:{clearable:"",placeholder:"商品类型"},model:{value:e.searchForm.type,callback:function(t){e.$set(e.searchForm,"type","string"===typeof t?t.trim():t)},expression:"searchForm.type"}},e._l(e.goodsType,function(e,t){return a("el-option",{key:t,attrs:{label:e.label,value:e.value}})}),1)],1),e._v(" "),a("el-form-item",[a("el-select",{attrs:{clearable:"",placeholder:"商品分类"},model:{value:e.searchForm.goodsCategoryId,callback:function(t){e.$set(e.searchForm,"goodsCategoryId","string"===typeof t?t.trim():t)},expression:"searchForm.goodsCategoryId"}},e._l(e.categoryList,function(e,t){return a("el-option",{key:t,attrs:{label:e.label,value:e.value}})}),1)],1),e._v(" "),a("el-form-item",[a("el-select",{attrs:{clearable:"",placeholder:"是否是上架"},model:{value:e.searchForm.status,callback:function(t){e.$set(e.searchForm,"status","string"===typeof t?t.trim():t)},expression:"searchForm.status"}},[a("el-option",{attrs:{label:"是",value:"1"}}),e._v(" "),a("el-option",{attrs:{label:"否",value:"0"}})],1)],1),e._v(" "),a("el-form-item",[a("el-select",{attrs:{clearable:"",placeholder:"是否是组合商品"},model:{value:e.searchForm.groupGoods,callback:function(t){e.$set(e.searchForm,"groupGoods","string"===typeof t?t.trim():t)},expression:"searchForm.groupGoods"}},[a("el-option",{attrs:{label:"是",value:"1"}}),e._v(" "),a("el-option",{attrs:{label:"否",value:"0"}})],1)],1),e._v(" "),a("el-form-item",[a("el-button",{attrs:{type:"danger"},on:{click:e.onSearch}},[e._v("搜索")]),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:e.onReset}},[e._v("重置")])],1)],1),e._v(" "),a("div",{staticClass:"tableWrap"},[a("el-table",{attrs:{data:e.tableList,"header-cell-style":{background:"#EDEEF0",color:"#444"}}},[a("el-table-column",{attrs:{align:"center",prop:"id",label:"商品编号"}}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"sn",label:"货号"}}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"brand",label:"品牌"}}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"name",label:"商品名称"}}),e._v(" "),a("el-table-column",{attrs:{align:"center",label:"是否组合商品"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.complementGoodsIdList?"是":"否")+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center",label:"是否APP展示"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.clientShow?"是":"否")+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center",label:"是否库存预警"},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.complementGoodsIdList?e._e():a("span",[e._v("\n "+e._s(t.row.stockWarning?"是":"否")+"\n ")])]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center",label:"商品类型"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(e._f("shopType")(t.row.type))+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"goodsCategoryName",label:"商品分类"}}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"specification",label:"具体型号"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",{staticStyle:{"max-height":"64px",display:"block"}},[e._v(e._s(t.row.specification))])]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"stockCount",label:"内部库存"},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.complementGoodsIdList?a("span",[e._v("\n "+e._s(t.row.stockCount?t.row.stockCount:"")+"\n ")]):a("span",[e._v(e._s(t.row.stockCount))])]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"taxStockCount",label:"税务库存"},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.complementGoodsIdList?a("span",[e._v("\n "+e._s(t.row.taxStockCount?t.row.taxStockCount:"")+"\n ")]):a("span",[e._v(e._s(t.row.taxStockCount))])]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"stockType",label:"库存类型"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(e._f("stockTypeStatus")(t.row.stockType))+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"marketPrice",label:"市场价(元)"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(e._f("moneyFormat")(t.row.marketPrice))+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"marketPrice",label:"零售价(元)"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(e._f("moneyFormat")(t.row.discountPrice))+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"groupPurchasePrice",label:"商品团购价(元)"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(e._f("moneyFormat")(t.row.groupPurchasePrice))+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center","cell-style":"padding: 0",label:"商品缩略图"},scopedSlots:e._u([{key:"default",fn:function(e){return[a("img",{staticClass:"shopImage",attrs:{src:e.row.image,alt:"",srcset:""}})]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center",label:"商品描述"},scopedSlots:e._u([{key:"default",fn:function(e){return[a("Tooltip",{attrs:{content:e.row.brief}})]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center",label:"商品详情"},scopedSlots:e._u([{key:"default",fn:function(e){return[a("Tooltip",{attrs:{content:e.row.desc}})]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center",width:"180px",label:"操作",fixed:"right"},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.complementGoodsIdList?e._e():a("el-button",{directives:[{name:"permission",rawName:"v-permission",value:"/purchaseLlist",expression:"'/purchaseLlist'"}],attrs:{type:"text"},on:{click:function(a){return e.onPurchaseList(t.row)}}},[e._v("进货清单")]),e._v(" "),0==t.row.status?a("el-popconfirm",{directives:[{name:"permission",rawName:"v-permission",value:"goods/updateGoodsStatus",expression:"'goods/updateGoodsStatus'"}],attrs:{title:"你是否上架该商品?"},on:{confirm:function(a){return e.onUpdate(t.row)}}},[a("el-button",{attrs:{slot:"reference",type:"text"},slot:"reference"},[e._v("上架")])],1):e._e(),e._v(" "),0==t.row.status?a("el-button",{directives:[{name:"permission",rawName:"v-permission",value:t.row.complementGoodsIdList?"goods/update":"/shopOperation",expression:"scope.row.complementGoodsIdList ? 'goods/update' : '/shopOperation'"}],attrs:{type:"text"},on:{click:function(a){return e.onShopOperation("update",t.row)}}},[e._v("修改")]):e._e(),e._v(" "),1==t.row.status?a("el-popconfirm",{directives:[{name:"permission",rawName:"v-permission",value:"goods/updateGoodsStatus",expression:"'goods/updateGoodsStatus'"}],attrs:{title:"你是否下架该商品?"},on:{confirm:function(a){return e.onUpdate(t.row)}}},[a("el-button",{attrs:{slot:"reference",type:"text"},slot:"reference"},[e._v("下架")])],1):e._e(),e._v(" "),1==t.row.status?a("el-button",{directives:[{name:"permission",rawName:"v-permission",value:t.row.complementGoodsIdList?"goods/update":"/shopOperation",expression:"scope.row.complementGoodsIdList ? 'goods/update' : '/shopOperation'"}],attrs:{type:"text"},on:{click:function(a){return e.onShopOperation("look",t.row)}}},[e._v("查看")]):e._e()]}}])})],1),e._v(" "),a("pagination",{attrs:{total:e.pageInfo.total,page:e.pageInfo.page,limit:e.pageInfo.limit,"page-sizes":e.pageInfo.page_size},on:{"update:page":function(t){return e.$set(e.pageInfo,"page",t)},"update:limit":function(t){return e.$set(e.pageInfo,"limit",t)},pagination:e.getList}})],1)],1),e._v(" "),a("el-dialog",{attrs:{title:e.addString[e.addType]+"组合商品","destroy-on-close":"",visible:e.routeShopStatus,width:"600px"},on:{"update:visible":function(t){e.routeShopStatus=t},close:function(t){return e.onFormClose("ruleForm")}}},[a("el-form",{ref:"ruleForm",attrs:{model:e.form,rules:e.rules}},[a("el-form-item",{attrs:{label:"商品名称",prop:"name","label-width":e.formLabelWidth}},[a("el-input",{attrs:{placeholder:"请输入商品名称",type:"text",disabled:e.addDisabled},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name","string"===typeof t?t.trim():t)},expression:"form.name"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"货号",prop:"sn","label-width":e.formLabelWidth}},[a("el-input",{attrs:{placeholder:"请输入货号",type:"text",disabled:e.addDisabled},model:{value:e.form.sn,callback:function(t){e.$set(e.form,"sn","string"===typeof t?t.trim():t)},expression:"form.sn"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"品牌",prop:"brand","label-width":e.formLabelWidth}},[a("el-input",{attrs:{disabled:e.addDisabled,placeholder:"请输入品牌"},model:{value:e.form.brand,callback:function(t){e.$set(e.form,"brand","string"===typeof t?t.trim():t)},expression:"form.brand"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"商品类型",prop:"type","label-width":e.formLabelWidth}},[a("el-select",{attrs:{disabled:e.addDisabled,placeholder:"请选择商品类型"},model:{value:e.form.type,callback:function(t){e.$set(e.form,"type","string"===typeof t?t.trim():t)},expression:"form.type"}},e._l(e.goodsType,function(e,t){return a("el-option",{key:t,attrs:{label:e.label,value:e.value}})}),1)],1),e._v(" "),a("el-form-item",{attrs:{label:"商品分类",prop:"goodsCategoryId","label-width":e.formLabelWidth}},[a("el-select",{attrs:{placeholder:"请选择商品分类",disabled:e.addDisabled,filterable:""},model:{value:e.form.goodsCategoryId,callback:function(t){e.$set(e.form,"goodsCategoryId","string"===typeof t?t.trim():t)},expression:"form.goodsCategoryId"}},e._l(e.categoryList,function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})}),1)],1),e._v(" "),a("el-form-item",{attrs:{label:"商品型号",prop:"specification","label-width":e.formLabelWidth}},[a("el-input",{attrs:{disabled:e.addDisabled,placeholder:"请输入商品型号"},model:{value:e.form.specification,callback:function(t){e.$set(e.form,"specification","string"===typeof t?t.trim():t)},expression:"form.specification"}})],1),e._v(" "),e._l(e.form.goodsList,function(t,l){return a("div",{key:l},[a("el-form-item",{staticStyle:{display:"inline-block"},attrs:{label:"商品"+(l+1),"label-width":e.formLabelWidth,prop:"goodsList."+l+".id",rules:[{required:!0,message:"请选择商品",trigger:"change"}]}},[a("el-select",{attrs:{filterable:"",disabled:e.addDisabled,placeholder:"请选择商品"},on:{change:e.onGoodsChange},model:{value:t.id,callback:function(a){e.$set(t,"id","string"===typeof a?a.trim():a)},expression:"goodsList.id"}},e._l(e.selectGoodsList,function(e,t){return a("el-option",{key:t,attrs:{disabled:e.disabled,label:e.name,value:e.id}})}),1)],1),e._v(" "),e.addDisabled?e._e():a("div",{staticStyle:{display:"inline-block"}},[e.form.goodsList.length>1?a("el-button",{attrs:{icon:"el-icon-minus",circle:""},on:{click:function(a){return a.preventDefault(),e.removeGoodsList(t)}}}):e._e(),e._v(" "),a("el-button",{staticStyle:{"margin-left":"5px"},attrs:{icon:"el-icon-plus",circle:""},on:{click:function(t){return t.preventDefault(),e.addGoodsList(t)}}})],1)],1)}),e._v(" "),a("el-form-item",{attrs:{label:"市场价",prop:"marketPrice","label-width":e.formLabelWidth}},[a("el-input",{attrs:{type:"number",placeholder:"请输入市场价",disabled:e.addDisabled},nativeOn:{mousewheel:function(e){e.preventDefault()}},model:{value:e.form.marketPrice,callback:function(t){e.$set(e.form,"marketPrice","string"===typeof t?t.trim():t)},expression:"form.marketPrice"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"零售价",prop:"discountPrice","label-width":e.formLabelWidth}},[a("el-input",{attrs:{type:"number",placeholder:"请输入零售价",disabled:e.addDisabled},nativeOn:{mousewheel:function(e){e.preventDefault()}},model:{value:e.form.discountPrice,callback:function(t){e.$set(e.form,"discountPrice","string"===typeof t?t.trim():t)},expression:"form.discountPrice"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"商品团购价",prop:"groupPurchasePrice","label-width":e.formLabelWidth}},[a("el-input",{attrs:{type:"number",placeholder:"请输入商品团购价",disabled:e.addDisabled},nativeOn:{mousewheel:function(e){e.preventDefault()}},model:{value:e.form.groupPurchasePrice,callback:function(t){e.$set(e.form,"groupPurchasePrice","string"===typeof t?t.trim():t)},expression:"form.groupPurchasePrice"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"是否APP展示",prop:"clientShow","label-width":e.formLabelWidth}},[a("el-select",{attrs:{disabled:e.addDisabled,placeholder:"请选择是否APP展示"},model:{value:e.form.clientShow,callback:function(t){e.$set(e.form,"clientShow",t)},expression:"form.clientShow"}},[a("el-option",{attrs:{label:"是",value:1}}),e._v(" "),a("el-option",{attrs:{label:"否",value:0}})],1)],1),e._v(" "),a("el-form-item",{attrs:{label:"商品图片",prop:"image","label-width":e.formLabelWidth}},[a("upload",{attrs:{imageWidthM:400,disabled:e.addDisabled,imageHeightM:400},model:{value:e.form.image,callback:function(t){e.$set(e.form,"image",t)},expression:"form.image"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"商品描述",prop:"brief","label-width":e.formLabelWidth}},[a("el-input",{attrs:{type:"textarea",disabled:e.addDisabled},model:{value:e.form.brief,callback:function(t){e.$set(e.form,"brief","string"===typeof t?t.trim():t)},expression:"form.brief"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"商品详情",prop:"desc","label-width":e.formLabelWidth}},[a("el-input",{attrs:{type:"textarea",disabled:e.addDisabled},model:{value:e.form.desc,callback:function(t){e.$set(e.form,"desc","string"===typeof t?t.trim():t)},expression:"form.desc"}})],1)],2),e._v(" "),e.addDisabled?e._e():a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){e.routeShopStatus=!1}}},[e._v("取 消")]),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.onShopSubmit("ruleForm")}}},[e._v("确 定")])],1)],1)],1)},r=[function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("h2",[a("div",{staticClass:"squrt"}),e._v("商品列表\n ")])}],n=a("bd86"),i=(a("c5f6"),a("28a5"),a("6762"),a("96cf"),a("3b8d")),s=(a("7f7f"),a("ac6a"),a("333d")),u=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"upload"},[a("el-upload",{directives:[{name:"loading",rawName:"v-loading",value:e.uploadImgLoading,expression:"uploadImgLoading"}],staticClass:"avatar-uploader",staticStyle:{"line-height":"0",display:"inline-block"},attrs:{action:"/api-web/uploadFile",headers:e.headers,"show-file-list":!1,accept:e.accept,"on-success":e.handleImgSuccess,"on-error":e.handleUploadImgError,"before-upload":e.beforeImgUpload}},[e.imgUrl?a("img",{staticClass:"avatar",attrs:{src:e.imgUrl}}):a("i",{staticClass:"el-icon-plus avatar-uploader-icon"})])],1)},c=[],d=a("3908"),p=a("5f87"),m={data:function(){return{headers:{Authorization:Object(p["a"])()},uploadImgLoading:!1,imgUrl:null}},props:{value:{type:String},accept:{type:String,default:function(){return".jpg, .jpeg, .png, .gif"}},imageSizeM:{type:Number,default:function(){return 2}},imageWidthM:{type:Number,default:function(){return null}},imageHeightM:{type:Number,default:function(){return null}},imageType:{type:Object,default:function(){return{"image/png":!0,"image/jpeg":!0,"image/jpg":!0,"image/gif":!0}}}},mounted:function(){this.imgUrl=this.value},methods:{beforeImgUpload:function(e){var t=this,a=this.imageType[e.type],l=e.size/1024/1024<this.imageSizeM,o=this.imageWidthM,r=this.imageHeightM,n=window.URL||window.webkitURL,i=new Promise(function(t,a){var l=new Image;l.onload=function(){o&&r?this.width===o&&this.height===r?t():a("请上传".concat(o,"x").concat(r,"尺寸图片")):o&&!r?this.width===o?t():a("请上传宽为".concat(o,"的图片")):!o&&r?this.height===r?t():a("请上传高为".concat(r,"的图片")):t()},l.src=n.createObjectURL(e)}).then(function(){return e},function(e){return t.$message.error(e),t.uploadImgLoading=!1,Promise.reject()});return a||this.$message.error("只能上传图片格式!"),l||this.$message.error("上传图片大小不能超过 ".concat(l,"MB!")),a&&l&&i&&(this.uploadImgLoading=!0),a&&l&&i},handleUploadImgError:function(e){this.uploadImgLoading=!1,this.$message.error("上传失败")},handleImgSuccess:function(e,t){this.uploadImgLoading=!1,this.imgUrl=e.data.url,this.$emit("input",e.data.url)}},watch:{value:function(e){this.imgUrl=e}},beforeDestroy:function(){}},f=m,b=(a("3516"),a("2877")),g=Object(b["a"])(f,u,c,!1,null,null,null),h=g.exports,v=a("2543"),y=a("e3eb"),_=a.n(y),L=(a("4360"),a("a5b0")),I=a("adb2"),S=a("92e3"),w=function(e,t,a){""==t&&"string"==typeof t||null==t?a(new Error("请输入金额")):t<0?a(new Error("输入金额必须大于或等于0")):t>=1e5?a(new Error("输入金额必须小于100000")):a()},E={components:{pagination:s["a"],Tooltip:L["a"],Upload:h},name:"shopList",data:function(){return{goodsType:S["l"],categoryList:[],goodsLoading:!1,organId:null,orderDate:null,searchForm:{search:null,groupGoods:null,type:null,status:null,goodsCategoryId:null,startTime:null,endTime:null},headers:{Authorization:Object(p["a"])()},searchLsit:[],tableList:[],pageInfo:{limit:10,page:1,total:0,page_size:[10,20,40,50]},formLabelWidth:"120px",routeShopStatus:!1,addType:"create",addString:{create:"添加",update:"修改",look:"查看"},addDisabled:!1,form:{sn:null,brand:null,supplyChannel:null,name:null,type:null,goodsCategoryId:null,specification:null,marketPrice:null,discountPrice:null,groupPurchasePrice:null,clientShow:null,stockWarning:null,image:null,complementGoodsIdList:null,goodsList:[{id:null}],brief:null,desc:null},goodsTree:[],rules:{sn:[{required:!0,message:"请输入商品货号",trigger:"blur"}],brand:[{required:!0,message:"请输入品牌",trigger:"blur"},{min:2,max:30,message:"长度在 2 到 30 个字符",trigger:"blur"}],supplyChannel:[{required:!0,message:"请输入备查货号",trigger:"blur"}],name:[{required:!0,message:"请输入商品名称",trigger:"blur"},{min:2,max:30,message:"长度在 2 到 30 个字符",trigger:"blur"}],type:[{required:!0,message:"请选择商品分类",trigger:"change"}],goodsCategoryId:[{required:!0,message:"请选择商品类型",trigger:"change"}],specification:[{required:!0,message:"请输入商品型号",trigger:"blur"},{min:2,max:30,message:"长度在 2 到 30 个字符",trigger:"blur"}],marketPrice:[{required:!0,validator:w,trigger:"blur"}],discountPrice:[{required:!0,validator:w,trigger:"blur"}],groupPurchasePrice:[{required:!0,validator:w,trigger:"blur"}],clientShow:[{required:!0,message:"请选择是否APP展示",trigger:"change"}],stockWarning:[{required:!0,message:"请选择是否库存预警",trigger:"change"}],image:[{required:!0,message:"请选择图片",trigger:"blur"}],brief:[{required:!0,message:"请输入商品描述",trigger:"blur"}],desc:[{required:!0,message:"请输入商品详情",trigger:"blur"}]},selectGoodsList:[]}},created:function(){this.init()},activated:function(){this.init()},mounted:function(){},methods:(l={init:function(){this.$route.query.searchForm&&(this.$route.query.searchForm instanceof Object?this.searchForm=this.$route.query.searchForm:this.searchForm=JSON.parse(this.$route.query.searchForm)),this.$route.query.pageInfo&&(this.$route.query.pageInfo instanceof Object?this.pageInfo=this.$route.query.pageInfo:this.pageInfo=JSON.parse(this.$route.query.pageInfo)),this.getList(),this.getCategory()},getCategory:function(){var e=this,t={delFlag:0,rows:9999};Object(v["a"])(t).then(function(t){var a=t.data;if(200==t.code){var l=[];a.rows.forEach(function(e){l.push({label:e.name,value:e.id})}),e.categoryList=l}})},onUpdate:function(){var e=Object(i["a"])(regeneratorRuntime.mark(function e(t){var a=this;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(v["m"])({goodsId:t.id,status:t.status?0:1}).then(function(e){a.messageTips(t.status?"下架":"上架",e)});case 2:case"end":return e.stop()}},e)}));function t(t){return e.apply(this,arguments)}return t}(),onPurchaseList:function(e){var t=JSON.stringify(this.pageInfo),a=JSON.stringify(this.searchForm);this.$router.push({path:"/shopManager/purchaseLlist",query:{name:e.name,goodsId:e.id,pageInfo:t,search:a}})},onDelete:function(e){var t=this;this.$confirm("您确定删除该商品吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){Object(v["h"])(e.id).then(function(e){t.messageTips("删除",e)})}).catch(function(){})},searchOrderDate:function(e){e?(this.searchForm.startTime=e[0],this.searchForm.endTime=e[1]):(this.searchForm.startTime=null,this.searchForm.endTime=null)},messageTips:function(e,t){200==t.code?(this.$message.success(e+"成功"),this.typeStatus=!1,this.getList()):this.$message.error(t.msg)},getList:function(){var e=this,t=Object.assign({},this.searchForm);t.organId=this.organId,t.rows=this.pageInfo.limit,t.page=this.pageInfo.page,Object(v["i"])(t).then(function(t){200==t.code&&t.data&&(e.tableList=t.data.rows,e.pageInfo.total=t.data.total)})},getAllGoodsList:function(){var e=this;Object(v["i"])({rows:9999,page:1,groupGoods:0,status:1}).then(function(t){200==t.code&&t.data&&(e.selectGoodsList=t.data.rows)})},onSearch:function(){this.pageInfo.page=1,this.getList()},onReset:function(){this.searchForm={search:null,groupGoods:null,type:null,status:null,goodsCategoryId:null,startTime:null,endTime:null},this.getList()},onShopComAdd:function(){this.form={sn:null,brand:null,supplyChannel:null,name:null,type:null,goodsCategoryId:null,specification:null,marketPrice:null,discountPrice:null,groupPurchasePrice:null,clientShow:null,stockWarning:null,image:null,complementGoodsIdList:null,goodsList:[{id:null}],brief:null,desc:null},this.onValidGoodsStatus(),this.routeShopStatus=!0,this.addType="create",this.addDisabled=!1,this.$refs["ruleForm"]&&this.$refs["ruleForm"].resetFields(),this.getAllGoodsList()},onValidGoodsStatus:function(){var e=this.form.goodsList,t=[];e.forEach(function(e){t.push(e.id)}),this.selectGoodsList.forEach(function(e){e.disabled=!1,t.includes(e.id)&&(e.disabled=!0)})},onShopOperation:function(e,t){var a={type:e};t&&(a.id=t.id);var l=JSON.stringify(this.pageInfo),o=JSON.stringify(this.searchForm),r=JSON.stringify(a);if(this.addType=e,this.addDisabled="look"==e,"update"!=e&&"look"!=e||!t.complementGoodsIdList)this.$router.push({path:"/shopManager/shopOperation",query:{searchForm:o,paramInfo:r,pageInfo:l}});else{this.routeShopStatus=!0;var n=this.form;for(var i in n)n[i]=t[i];var s=t.complementGoodsIdList.split(","),u=[];s.forEach(function(e){u.push({id:Number(e)})}),n.goodsList=u,n.id=t.id,this.onValidGoodsStatus(),this.getAllGoodsList()}},beforeUpload:function(e){d["a"].startLoading()},handleSuccess:function(e,t,a){d["a"].endLoading(),200==e.code?(this.$message.success("导入成功"),this.getList()):this.$message.error(e.msg)},handleError:function(e,t,a){d["a"].endLoading(),console.log(e,t,a)},onDownload:function(){Object(I["a"])(this,{url:"/api-web/import/downloadTemplate",params:{templateType:"GOODS"},fileName:"商品导入模板.xlsx"})},onFormClose:function(e){this.$refs[e].resetFields()},onGoodsChange:function(){var e=this.selectGoodsList,t=this.form.goodsList,a=[];t.forEach(function(e){e.id&&a.push(e.id)}),e.forEach(function(e){a.includes(e.id)?e.disabled=!0:e.disabled=!1}),this.calcPrice()},removeGoodsList:function(e){var t=e.id,a=this.selectGoodsList;a.forEach(function(e){e.id==t&&(e.disabled=!1)});var l=this.form.goodsList.indexOf(e);-1!==l&&this.form.goodsList.splice(l,1),this.calcPrice()},addGoodsList:function(){this.form.goodsList.push({id:null})},onShopSubmit:function(e){var t=this;this.$refs[e].validate(function(e){if(!e)return!1;var a=Object.assign({},t.form),l=[];a.goodsList.forEach(function(e){e.id&&l.push(e.id)}),a.complementGoodsIdList=l.join(","),a.goodsList=null,"create"==t.addType?(t.form.id&&delete t.form.id,a.status="NO",Object(v["g"])(_()(a)).then(function(e){t.messageTips("添加",e)})):"update"==t.addType&&Object(v["k"])(_()(a)).then(function(e){t.messageTips("修改",e)})})}},Object(n["a"])(l,"messageTips",function(e,t){200==t.code?(this.$message.success(e+"成功"),this.getList(),this.routeShopStatus=!1):this.$message.error(t.msg)}),Object(n["a"])(l,"calcPrice",function(){var e=this.selectGoodsList,t=this.form,a=t.goodsList,l=[];a.forEach(function(e){e.id&&l.push(e.id)});var o=0,r=0,n=0;e.forEach(function(e){l.includes(e.id)&&(o+=e.groupPurchasePrice,r+=e.marketPrice,n+=e.discountPrice)}),t.groupPurchasePrice=Number(o.toFixed(2)),t.discountPrice=Number(n.toFixed(2)),t.marketPrice=Number(r.toFixed(2))}),l)},O=E,k=(a("f195"),Object(b["a"])(O,o,r,!1,null,null,null));t["default"]=k.exports},"92e3":function(e,t,a){"use strict";a.d(t,"j",function(){return o}),a.d(t,"n",function(){return r}),a.d(t,"h",function(){return n}),a.d(t,"a",function(){return i}),a.d(t,"m",function(){return s}),a.d(t,"v",function(){return u}),a.d(t,"b",function(){return c}),a.d(t,"p",function(){return d}),a.d(t,"k",function(){return p}),a.d(t,"o",function(){return m}),a.d(t,"x",function(){return f}),a.d(t,"i",function(){return b}),a.d(t,"g",function(){return g}),a.d(t,"w",function(){return h}),a.d(t,"s",function(){return v}),a.d(t,"y",function(){return y}),a.d(t,"r",function(){return _}),a.d(t,"t",function(){return L}),a.d(t,"l",function(){return I}),a.d(t,"e",function(){return S}),a.d(t,"u",function(){return w}),a.d(t,"f",function(){return E}),a.d(t,"q",function(){return O}),a.d(t,"d",function(){return k}),a.d(t,"c",function(){return C});var l=a("267e"),o=[{label:"单技课",value:"SINGLE"},{label:"合奏课",value:"MIX"},{label:"基础技能课",value:"HIGH"},{label:"线上基础技能课",value:"HIGH_ONLINE"},{label:"vip课",value:"VIP"},{label:"试听课",value:"DEMO"},{label:"综合课",value:"COMPREHENSIVE"},{label:"网管课",value:"PRACTICE"},{label:"乐团网管课",value:"MUSIC_NETWORK"},{label:"启蒙课",value:"ENLIGHTENMENT"},{label:"集训单技课",value:"TRAINING_SINGLE"},{label:"集训合奏课",value:"TRAINING_MIX"},{label:"课堂课",value:"CLASSROOM"},{label:"对外课",value:"COMM"}],r=[{label:"单技课",value:"SINGLE"},{label:"合奏课",value:"MIX"},{label:"基础技能课",value:"HIGH"},{label:"线上基础技能课",value:"HIGH_ONLINE"},{label:"网管课",value:"PRACTICE"},{label:"乐团网管课",value:"MUSIC_NETWORK"},{label:"启蒙课",value:"ENLIGHTENMENT"},{label:"集训单技课",value:"TRAINING_SINGLE"},{label:"集训合奏课",value:"TRAINING_MIX"},{label:"课堂课",value:"CLASSROOM"}],n=[{label:"乐团课",value:"MUSIC"},{label:"VIP课",value:"VIP"},{label:"网管课",value:"PRACTICE"},{label:"综合课",value:"COMPREHENSIVE"}],i=[{label:"正常签到",value:1},{label:"异常签到",value:0}],s=[{label:"兼职",value:"PART_TIME"},{label:"全职",value:"FULL_TIME"},{label:"临时工",value:"TEMPORARY"}],u=[{label:"正常",value:"0"},{label:"冻结",value:"1"},{label:"锁定",value:"9"}],c=[{value:"NORMAL",label:"正常"},{value:"TRUANT",label:"旷课"},{value:"LEAVE",label:"请假"},{value:"QUIT_SCHOOL",label:"退学"}],d=[{value:"APPLY",label:"报名"},{value:"RENEW",label:"续费"},{value:"OTHER",label:"其他"},{value:"SMALL_CLASS_TO_BUY",label:"VIP购买"},{value:"SPORADIC",label:"零星收费"},{value:"LUCK",label:"福袋活动"},{value:"DOUBLE_ELEVEN2020",label:"双十一活动"},{value:"PRACTICE_GROUP_BUY",label:"网管课"},{value:"PRACTICE_GROUP_RENEW",label:"网管课续费"},{value:"REPAIR",label:"乐器维修"},{value:"OUTORDER",label:"外部收入"},{value:"GOODS_SELL",label:"商品销售"},{value:"SUBJECT_CHANGE",label:"声部更换"}],p=[{value:"ING",label:"交易中"},{value:"SUCCESS",label:"成功交易"},{value:"FAILED",label:"交易失败"},{value:"CLOSE",label:"交易关闭"}],m=[{value:"APPLY",text:"报名中"},{value:"PAY",text:"缴费中"},{value:"PREPARE",text:"筹备中"},{value:"PROGRESS",text:"进行中"},{value:"PAUSE",text:"暂停"},{value:"DRAFT",text:"编辑中"},{value:"AUDIT",text:"审核中"},{value:"AUDIT_FAILED",text:"审核失败"},{value:"CANCELED",text:"取消"},{value:"FEE_AUDIT",text:"费用审核中"}],f=[{value:"0",text:"未开始"},{value:"1",text:"报名中"},{value:"5",text:"报名结束"},{value:"2",text:"进行中"},{value:"4",text:"已结束"},{value:"3",text:"取消"},{value:"6",text:"暂停"}],b=[{value:"NOT_START",label:"未开始"},{value:"UNDERWAY",label:"进行中"},{value:"OVER",label:"已结束"}],g=[{value:"NORMAL",label:"进行中"},{value:"FINISH",label:"结束"},{value:"CANCEL",label:"关闭"},{value:"LOCK",label:"锁定"}],h=[{value:"RECHARGE",label:"充值"},{value:"CONSUME",label:"建课"},{value:"RETURN",label:"退课"},{value:"MANUAL_ADD",label:"系统充值"},{value:"MANUAL_SUB",label:"系统扣除"}],v=[{value:"FREE",label:"免费"},{value:"CHARGE",label:"收费"},{value:"TRIAL",label:"试听课"}],y=[{value:"课程推荐",label:"课程推荐",children:[{value:"新课推荐",label:"新课推荐"},{value:"续费提醒",label:"续费提醒"}]},{value:"常规回访",label:"常规回访",children:[{value:"课后及作业回访",label:"课后及作业回访"},{value:"练习及乐团表现",label:"练习及乐团表现"}]},{value:"其它",label:"其它",children:[{value:"其它",label:"其它"}]}],_=[{value:"YQPAY",label:"双乾"},{value:"BALANCE",label:"余额"},{value:"ADAPAY",label:"汇付"}],L=[{value:"INSTRUMENT",label:"乐器销售"},{value:"ACCESSORIES",label:"配件销售"},{value:"SCHOOL_BUY",label:"学校采购"},{value:"OTHER",label:"其它"}],I=[{value:"INSTRUMENT",label:"乐器"},{value:"ACCESSORIES",label:"辅件"},{value:"TEACHING",label:"教材"},{value:"STAFF",label:"教谱"}],S=[{value:"1",label:"一年级"},{value:"2",label:"二年级"},{value:"3",label:"三年级"},{value:"4",label:"四年级"},{value:"5",label:"五年级"},{value:"6",label:"六年级"},{value:"7",label:"初一"},{value:"8",label:"初二"},{value:"9",label:"初三"},{value:"10",label:"高一"},{value:"11",label:"高二"},{value:"12",label:"高三"}],w=[{value:"INTERNAL",label:"内部"},{value:"EXTERNAL",label:"外部"},{value:"ALL",label:"全部"}],E=[{label:"90",value:"SINGLE"},{label:"90",value:"MIX"},{label:"45",value:"HIGH"},{label:"45",value:"HIGH_ONLINE"},{label:"90",value:"COMPREHENSIVE"},{label:"25",value:"PRACTICE"},{label:"25",value:"MUSIC_NETWORK"},{label:"180",value:"TRAINING_SINGLE"},{label:"180",value:"TRAINING_MIX"},{label:"40",value:"CLASSROOM"}],O=T(l["h"]),k=T(l["b"]),C=T(l["a"]);function T(e){var t=[];for(var a in e)t.push({label:e[a],value:a});return t}},adb2:function(e,t,a){"use strict";a.d(t,"a",function(){return i});var l=a("bc3a"),o=a.n(l),r=(a("4328"),a("5f87")),n=a("3908"),i=function(e,t,a){var l=t.url,i={method:t.method?t.method:"get",headers:{Authorization:Object(r["a"])()},url:l,responseType:"blob"};"post"==i.method?i.data=t.params:i.params=t.params,e.$confirm(a||"您确定下载模板","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){n["a"].startLoading(),o()(i).then(function(a){var l=new Blob([a.data],{type:"application/vnd.ms-excel;charset=utf-8"}),o=new Response(l).text();o.then(function(a){if(-1!=a.indexOf("code")){var o=JSON.parse(a);e.$message.error(o.msg)}else{var r=URL.createObjectURL(l),n=document.createElement("a"),i=t.fileName||"导出文件.xlsx";n.href=r,n.setAttribute("download",i),document.body.appendChild(n),n.click()}}),n["a"].endLoading()}).catch(function(t){e.$message.error("下载失败,请联系管理员"),n["a"].endLoading()})}).catch(function(){})}},f195:function(e,t,a){"use strict";var l=a("5046"),o=a.n(l);o.a}}]);