(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-14a0b6a7"],{2543:function(e,t,a){"use strict";a.d(t,"q",(function(){return u})),a.d(t,"r",(function(){return s})),a.d(t,"u",(function(){return c})),a.d(t,"n",(function(){return d})),a.d(t,"o",(function(){return p})),a.d(t,"s",(function(){return b})),a.d(t,"p",(function(){return m})),a.d(t,"f",(function(){return g})),a.d(t,"g",(function(){return f})),a.d(t,"h",(function(){return v})),a.d(t,"m",(function(){return h})),a.d(t,"t",(function(){return S})),a.d(t,"k",(function(){return I})),a.d(t,"i",(function(){return y})),a.d(t,"j",(function(){return O})),a.d(t,"l",(function(){return w})),a.d(t,"d",(function(){return E})),a.d(t,"e",(function(){return T})),a.d(t,"c",(function(){return C})),a.d(t,"b",(function(){return _})),a.d(t,"a",(function(){return P}));var l=a("b775"),r=a("829b"),n=a("4328"),o=a.n(n),i="/api-web";function u(e){return Object(l["a"])({url:i+"/goods/queryPage",method:"get",params:e})}function s(e){return Object(l["a"])({url:i+"/goods/get/".concat(e),method:"get"})}function c(e){return Object(l["a"])({url:i+"/goods/updateGoodsStatus",method:"post",data:o.a.stringify(e)})}function d(e){return Object(l["a"])({url:i+"/goods/add",method:"post",data:e})}function p(e){return Object(l["a"])({url:i+"/goods/addBatch",method:"post",data:e})}function b(e){return Object(l["a"])({url:i+"/goods/update",method:"post",data:e})}function m(e){return Object(l["a"])({url:i+"/goods/del/".concat(e),method:"post"})}function g(e){return Object(l["a"])({url:i+"/category/queryPage",method:"get",params:e})}function f(e){return Object(l["a"])({url:i+"/category/upset",method:"post",data:e})}function v(e){return Object(l["a"])({url:i+"/category/del",method:"post",data:o.a.stringify(e)})}function h(e){return Object(l["a"])({url:i+"/subjectChange/queryPage",method:"get",params:e})}function S(e){return Object(l["a"])({url:i+"/subjectChange/updateCostMargin",method:"post",data:o.a.stringify(e)})}function I(e){return Object(l["a"])({url:i+"/goodsProcurement/queryGoodsProcurements",method:"get",params:e})}function y(e){return Object(l["a"])({url:i+"/goods/addGoodsProcurement",method:"post",params:e})}function O(e){return Object(l["a"])({url:i+"/swTempJc/queryPageForCourseSchedule",method:"get",params:e})}function w(e){return Object(l["a"])({url:i+"/swTempJc/queryPageForExtensionOrder",method:"get",params:e})}function E(e){return Object(r["a"])({url:i+"/goods/queryGoodsSubByPage",method:"GET",params:e,data:{}})}function T(e){return Object(r["a"])({url:i+"/goods/queryGoodsTypeList",method:"GET",params:e,data:{}})}function C(e){return Object(r["a"])({url:i+"/goods/queryGoodsCategoryList",method:"GET",params:e,data:{}})}function _(e){return Object(r["a"])({url:i+"/goods/queryGoodsBrandList",method:"GET",params:e,data:{}})}function P(e){return Object(r["a"])({url:i+"/goods/get/"+e.id,method:"GET",data:{}})}},"8dd6":function(e,t,a){"use strict";a("c02e")},"92e3":function(e,t,a){"use strict";a.d(t,"v",(function(){return u})),a.d(t,"I",(function(){return s})),a.d(t,"t",(function(){return c})),a.d(t,"c",(function(){return d})),a.d(t,"E",(function(){return p})),a.d(t,"bb",(function(){return b})),a.d(t,"Z",(function(){return m})),a.d(t,"d",(function(){return g})),a.d(t,"M",(function(){return f})),a.d(t,"x",(function(){return v})),a.d(t,"db",(function(){return h})),a.d(t,"u",(function(){return S})),a.d(t,"o",(function(){return I})),a.d(t,"cb",(function(){return y})),a.d(t,"Q",(function(){return O})),a.d(t,"fb",(function(){return w})),a.d(t,"gb",(function(){return E})),a.d(t,"P",(function(){return T})),a.d(t,"U",(function(){return C})),a.d(t,"C",(function(){return _})),a.d(t,"l",(function(){return P})),a.d(t,"Y",(function(){return k})),a.d(t,"eb",(function(){return N})),a.d(t,"J",(function(){return A})),a.d(t,"m",(function(){return L})),a.d(t,"w",(function(){return R})),a.d(t,"N",(function(){return x})),a.d(t,"f",(function(){return G})),a.d(t,"e",(function(){return F})),a.d(t,"L",(function(){return M})),a.d(t,"K",(function(){return D})),a.d(t,"T",(function(){return j})),a.d(t,"H",(function(){return q})),a.d(t,"a",(function(){return U})),a.d(t,"y",(function(){return $})),a.d(t,"p",(function(){return V})),a.d(t,"n",(function(){return H})),a.d(t,"q",(function(){return B})),a.d(t,"g",(function(){return W})),a.d(t,"G",(function(){return Y})),a.d(t,"r",(function(){return J})),a.d(t,"D",(function(){return X})),a.d(t,"B",(function(){return z})),a.d(t,"A",(function(){return K})),a.d(t,"h",(function(){return Q})),a.d(t,"k",(function(){return Z})),a.d(t,"i",(function(){return ee})),a.d(t,"j",(function(){return te})),a.d(t,"S",(function(){return ae})),a.d(t,"O",(function(){return le})),a.d(t,"F",(function(){return re})),a.d(t,"z",(function(){return ne})),a.d(t,"R",(function(){return oe})),a.d(t,"V",(function(){return ie})),a.d(t,"X",(function(){return ue})),a.d(t,"s",(function(){return se})),a.d(t,"ab",(function(){return ce})),a.d(t,"W",(function(){return de})),a.d(t,"b",(function(){return be}));var l=a("b85c"),r=a("3835"),n=a("267e"),o=sessionStorage.getItem("tenantConfig");o=o?JSON.parse(o):{};var i=o.tenantId,u=null,s=null;1==i?(s=[{label:"声部课",value:"SINGLE"},{label:"合奏课",value:"MIX"},{label:"基础技能课",value:"HIGH"},{label:"线上基础技能课",value:"HIGH_ONLINE"},{label:"乐团网管课",value:"MUSIC_NETWORK"},{label:"集训声部课",value:"TRAINING_SINGLE"},{label:"集训合奏课",value:"TRAINING_MIX"},{label:"课堂课",value:"CLASSROOM"},{label:"综合课",value:"COMPREHENSIVE"}],u=[{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"},{label:"直播课",value:"LIVE"}]):(s=[{label:"声部课",value:"SINGLE"},{label:"合奏课",value:"MIX"},{label:"基础技能课",value:"HIGH"},{label:"集训声部课",value:"TRAINING_SINGLE"},{label:"集训合奏课",value:"TRAINING_MIX"},{label:"课堂课",value:"CLASSROOM"},{label:"综合课",value:"COMPREHENSIVE"}],u=[{label:"声部课",value:"SINGLE"},{label:"合奏课",value:"MIX"},{label:"vip课",value:"VIP"},{label:"试听课",value:"DEMO"},{label:"综合课",value:"COMPREHENSIVE"},{label:"网管课",value:"PRACTICE"},{label:"启蒙课",value:"ENLIGHTENMENT"},{label:"集训声部课",value:"TRAINING_SINGLE"},{label:"集训合奏课",value:"TRAINING_MIX"},{label:"课堂课",value:"CLASSROOM"},{label:"对外课",value:"COMM"},{label:"直播课",value:"LIVE"}]);var c=[{label:"乐团课",value:"MUSIC"},{label:"VIP课",value:"VIP"},{label:"网管课",value:"PRACTICE"},{label:"直播课",value:"LIVE"}],d=[{label:"正常签到",value:1},{label:"异常签到",value:0}],p=[{label:"兼职",value:"PART_TIME"},{label:"全职",value:"FULL_TIME"},{label:"劳务",value:"LABOUR"}],b=[{label:"正常",value:"0"},{label:"冻结",value:"1"},{label:"锁定",value:"9"}],m=[{value:"NORMAL",label:"正常"},{value:"TRUANT",label:"旷课"},{value:"LEAVE",label:"请假"}],g=[].concat(m,[{value:"QUIT_SCHOOL",label:"休学"},{value:"DROP_OUT",label:"退学"},{value:"LATE",label:"迟到"}]),f=[{value:"APPLY",label:"报名"},{value:"RENEW",label:"续费"},{value:"MEMBER",label:"学练宝购买"},{value:"SMALL_CLASS_TO_BUY",label:"VIP购买"},{value:"SPORADIC",label:"零星收费"},{value:"LUCK",label:"福袋活动"},{value:"DEGREE_REGISTRATION",label:"考级报名"},{value:"DOUBLE_ELEVEN2020",label:"2020双十一活动"},{value:"DOUBLE_ELEVEN2021",label:"2021双十一活动"},{value:"DEGREE",label:"儿童节活动"},{value:"PRACTICE_GROUP_BUY",label:"网管课"},{value:"PRACTICE_GROUP_RENEW",label:"网管课续费"},{value:"REPAIR",label:"乐器维修"},{value:"OUTORDER",label:"外部收入"},{value:"GOODS_SELL",label:"商品销售"},{value:"MALL_BUY",label:"商城销售"},{value:"SUBJECT_CHANGE",label:"声部更换"},{value:"MAINTENANCE",label:"乐器保养"},{value:"ADD_STUDENT",label:"乐团报名"},{value:"REPLACEMENT",label:"乐器置换"},{value:"SCHOOL",label:"学校订单"},{value:"PERSONAL",label:"个人订单"},{value:"OTHER",label:"其他"},{value:"ACTIVITY",label:"活动购买"},{value:"LIVE_BUY",label:"直播购物"},{value:"LIVE_GROUP_BUY",label:"直播课购买"},{value:"SCHOOL_GOODS_PURCHASE",label:"商品采购"},{value:"DIRECTOR_TRAINING_CAMP",label:"乐队指导培训"}],v=[{value:"ING",label:"交易中"},{value:"SUCCESS",label:"成功交易"},{value:"FAILED",label:"交易失败"},{value:"CLOSE",label:"交易关闭"}],h=[{value:"0",text:"未开始"},{value:"1",text:"报名中"},{value:"2",text:"进行中"},{value:"4",text:"已结束"},{value:"3",text:"取消"}],S=[{value:"NOT_START",label:"未开始"},{value:"UNDERWAY",label:"进行中"},{value:"OVER",label:"已结束"}],I=[{value:"NORMAL",label:"进行中"},{value:"FINISH",label:"结束"},{value:"CANCEL",label:"关闭"},{value:"LOCK",label:"锁定"}],y=[{value:"RECHARGE",label:"充值"},{value:"CONSUME",label:"建课"},{value:"RETURN",label:"退课"},{value:"MANUAL_ADD",label:"系统充值"},{value:"MANUAL_SUB",label:"系统扣除"}],O=[{value:"FREE",label:"免费"},{value:"CHARGE",label:"收费"},{value:"TRIAL",label:"试听课"},{value:"CARE_PACKAGE",label:"关心包"},{value:"COME_ON_PACKAGE",label:"加油包"}],w=[{value:"课程推荐",label:"课程推荐",children:[{value:"新课推荐",label:"新课推荐"},{value:"续费提醒",label:"续费提醒"}]},{value:"常规回访",label:"常规回访",children:[{value:"课后及练习回访",label:"课后及练习回访"},{value:"练习及乐团表现",label:"练习及乐团表现"}]},{value:"其它",label:"其它",children:[{value:"其它",label:"其它"}]}],E=[{value:"课程推荐",label:"课程推荐",children:[{value:"新课推荐",label:"新课推荐"},{value:"续费提醒",label:"续费提醒"}]},{value:"常规回访",label:"常规回访",children:[{value:"课后及练习回访",label:"课后及练习回访"},{value:"练习及乐团表现",label:"练习及乐团表现"},{label:"考勤申诉",value:"考勤申诉"},{value:"异常请假回访",label:"异常请假回访"}]},{value:"小课回访",label:"小课回访",children:[{value:"续费类回访",label:"续费类回访"},{value:"服务回访",label:"服务回访"},{value:"其他",label:"其他"}]},{value:"学练宝",label:"学练宝",children:[{value:"体验回访",label:"体验回访"}]},{value:"其它",label:"其它",children:[{value:"其它",label:"其它"},{value:"会员续费",label:"会员续费"}]}],T=[{value:"YQPAY",label:"双乾"},{value:"BALANCE",label:"余额"},{value:"ADAPAY",label:"汇付"},{value:"YEEPAY",label:"易宝"}],C=[{value:"INSTRUMENT",label:"乐器销售"},{value:"ACCESSORIES",label:"配件销售"},{value:"SCHOOL_BUY",label:"学校采购"},{value:"OTHER",label:"其它"}],_=[{value:"INSTRUMENT",label:"乐器"},{value:"ACCESSORIES",label:"辅件"},{value:"TEACHING",label:"教材"},{value:"STAFF",label:"教谱"},{value:"OTHER",label:"其它"}],P=[{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:"高三"}],k=[{value:"INTERNAL",label:"内部"},{value:"EXTERNAL",label:"外部"},{value:"ALL",label:"全部"}],N=[{label:"不限制",value:"1"},{label:"线上不可调为线下",value:"0"},{label:"线下不可调为线上",value:"2"},{label:"线上线下不可互调",value:"3"}],A=pe(n["musicGroupType"]),L=pe(n["classTime"]),R=[{label:"课程收费",value:0},{label:"会员收费",value:2},{label:"免费",value:3}],x=pe(n["payOrderType"]),G=pe(n["auditType"]),F=pe(n["auditPaymentType"]),M=pe(n["orderServerType"]),D=pe(n["orderAuditType"]),j=pe(n["rewardModeType"]),q=pe(n["musicClassType"]),U=pe(n["ProbationPeriodStatus"]),$=pe(n["downListType"]),V=pe(n["conclusion"]),H=pe(n["clientType"]),B=pe(n["couponType"]),W=pe(n["backType"]),Y=pe(n["memberEnum"]),J=pe(n["coupontypeDetail"]),X=pe(n["issue"]),z=pe(n["feedbackType"]),K=pe(n["feedbackTypeDesc"]),Q=pe(n["campState"]),Z=pe(n["catgGoupType"]),ee=pe(n["catRole"]),te=pe(n["catType"]),ae=pe(n["quiteReason"]),le=pe(n["payUserType"]),re=pe(n["levelStatus"]),ne=pe(n["evaluateStatus"]),oe=pe(n["problemType"]),ie=pe(n["schoolUserType"]),ue=pe(n["shareLiveType"]),se=pe(n["courseEmnu"]),ce=pe(n["suggestionType"]),de=pe(n["scoreType"]);function pe(e){var t=[];for(var a in e)t.push({label:e[a],value:a});return t}var be=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["value","label"],a=Object(r["a"])(t,2),n=a[0],o=a[1],i={};if(e&&e.length){var u,s=Object(l["a"])(e);try{for(s.s();!(u=s.n()).done;){var c=u.value;i[c[n]]=c[o]}}catch(d){s.e(d)}finally{s.f()}}return i}},c02e:function(e,t,a){},fd78:function(e,t,a){"use strict";a.r(t);var l=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"m-container"},[a("h2",[a("el-page-header",{attrs:{content:e.pageTitle[e.pageType]+"商品"},on:{back:e.onCancel}})],1),e._v(" "),a("div",{staticClass:"m-core"},[a("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"160px",inline:!0}},[a("el-alert",{staticClass:"alert",attrs:{title:"基础信息",closable:!1,type:"info"}}),e._v(" "),a("el-form-item",{attrs:{label:"货号",prop:"sn"}},[a("el-input",{staticStyle:{width:"220px !important"},attrs:{disabled:e.pageDisabled,placeholder:"请输入货号"},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"}},[a("el-input",{staticStyle:{width:"220px !important"},attrs:{disabled:e.pageDisabled,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:"name"}},[a("el-input",{staticStyle:{width:"220px !important"},attrs:{placeholder:"请输入商品名称",disabled:e.pageDisabled},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:"type"}},[a("el-select",{staticStyle:{width:"220px !important"},attrs:{placeholder:"请选择商品类型",disabled:e.pageDisabled},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"}},[a("el-select",{staticStyle:{width:"220px !important"},attrs:{placeholder:"请选择商品分类",disabled:e.pageDisabled,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"}},[a("el-input",{staticStyle:{width:"220px"},attrs:{placeholder:"请输入商品型号",disabled:e.pageDisabled},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(" "),1==e.tenantId?a("el-form-item",{attrs:{label:"库存类型",prop:"stockType"}},[a("el-select",{staticStyle:{width:"220px !important"},attrs:{placeholder:"请选择库存类型",disabled:e.pageDisabled},model:{value:e.form.stockType,callback:function(t){e.$set(e.form,"stockType",t)},expression:"form.stockType"}},e._l(e.stockType,(function(e,t){return a("el-option",{key:t,attrs:{label:e.label,value:e.value}})})),1)],1):e._e(),e._v(" "),1==e.tenantId?a("el-form-item",{attrs:{label:"是否库存预警",prop:"stockWarning"}},[a("el-select",{staticStyle:{width:"220px !important"},attrs:{placeholder:"请选择库存预警",disabled:e.pageDisabled},model:{value:e.form.stockWarning,callback:function(t){e.$set(e.form,"stockWarning",t)},expression:"form.stockWarning"}},[a("el-option",{attrs:{label:"是",value:1}}),e._v(" "),a("el-option",{attrs:{label:"否",value:0}})],1)],1):e._e(),e._v(" "),a("el-alert",{staticClass:"alert",attrs:{title:"价格信息",closable:!1,type:"info"}}),e._v(" "),a("el-form-item",{staticClass:"hiddenStart",attrs:{label:"市场价",prop:"marketPrice"}},[a("template",{slot:"label"},[a("p",{staticStyle:{position:"relative"}},[a("span",{staticStyle:{color:"#f56c6c","margin-right":"4px"}},[e._v("*")]),e._v("\n 市场价\n "),a("el-tooltip",{attrs:{placement:"top","popper-class":"mTooltip"}},[a("div",{attrs:{slot:"content"},slot:"content"},[e._v("\n 商品标价,仅在商品购买时做展示,不以该价格向学员销售商品\n ")]),e._v(" "),a("i",{staticClass:"el-icon-question",staticStyle:{"font-size":"18px",color:"#f56c6c",position:"relative",top:"2px"}})])],1)]),e._v(" "),a("el-input",{staticStyle:{width:"220px"},attrs:{type:"number",placeholder:"请输入市场价",disabled:e.pageDisabled},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"}})],2),e._v(" "),a("el-form-item",{staticClass:"hiddenStart",attrs:{label:"零售价",prop:"discountPrice"}},[a("template",{slot:"label"},[a("p",{staticStyle:{position:"relative"}},[a("span",{staticStyle:{color:"#f56c6c","margin-right":"4px"}},[e._v("*")]),e._v("\n 零售价\n "),a("el-tooltip",{attrs:{placement:"top","popper-class":"mTooltip"}},[a("div",{attrs:{slot:"content"},slot:"content"},[e._v("\n 管理端APP、乐器维修时学员购买该商品的价格\n ")]),e._v(" "),a("i",{staticClass:"el-icon-question",staticStyle:{"font-size":"18px",color:"#f56c6c",position:"relative",top:"2px"}})])],1)]),e._v(" "),a("el-input",{staticStyle:{width:"220px"},attrs:{type:"number",placeholder:"请输入零售价",disabled:e.pageDisabled},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"}})],2),e._v(" "),a("el-form-item",{staticClass:"hiddenStart",attrs:{label:"商品团购价",prop:"groupPurchasePrice"}},[a("template",{slot:"label"},[a("p",{staticStyle:{position:"relative"}},[a("span",{staticStyle:{color:"#f56c6c","margin-right":"4px"}},[e._v("*")]),e._v("\n 团购价\n "),a("el-tooltip",{attrs:{placement:"top","popper-class":"mTooltip"}},[a("div",{attrs:{slot:"content"},slot:"content"},[e._v("乐团报名缴费时学员购买该商品的价格")]),e._v(" "),a("i",{staticClass:"el-icon-question",staticStyle:{"font-size":"18px",color:"#f56c6c",position:"relative",top:"2px"}})])],1)]),e._v(" "),a("el-input",{staticStyle:{width:"220px"},attrs:{type:"number",placeholder:"请输入商品团购价",disabled:e.pageDisabled},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"}})],2),e._v(" "),a("el-form-item",{attrs:{label:"分部成本",prop:"organCostPrice"}},[a("el-input",{staticStyle:{width:"220px"},attrs:{type:"number",placeholder:"请输入分部成本",disabled:e.pageDisabled},nativeOn:{mousewheel:function(e){e.preventDefault()}},model:{value:e.form.organCostPrice,callback:function(t){e.$set(e.form,"organCostPrice","string"===typeof t?t.trim():t)},expression:"form.organCostPrice"}})],1),e._v(" "),a("el-alert",{staticClass:"alert",attrs:{title:"销售渠道",closable:!1,type:"info"}}),e._v(" "),a("el-form-item",{attrs:{label:"移动端可售分部",prop:"educationShowOrganId"}},[a("select-all",{staticStyle:{width:"400px !important"},attrs:{filterable:"",placeholder:"请选择分部",multiple:"",disabled:e.pageDisabled,clearable:""},model:{value:e.form.educationShowOrganId,callback:function(t){e.$set(e.form,"educationShowOrganId","string"===typeof t?t.trim():t)},expression:"form.educationShowOrganId"}},e._l(e.selects.branchs,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id.toString()}})})),1)],1),e._v(" "),a("el-form-item",{attrs:{label:"课程收费乐团可售分部",prop:"courseFeeShowOrganId"}},[a("select-all",{staticStyle:{width:"400px !important"},attrs:{filterable:"",placeholder:"请选择分部",multiple:"",disabled:e.pageDisabled,clearable:""},model:{value:e.form.courseFeeShowOrganId,callback:function(t){e.$set(e.form,"courseFeeShowOrganId","string"===typeof t?t.trim():t)},expression:"form.courseFeeShowOrganId"}},e._l(e.selects.branchs,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id.toString()}})})),1)],1),e._v(" "),a("el-form-item",{attrs:{label:"会员收费乐团可售分部",prop:"memberFeeShowOrganId"}},[a("select-all",{staticStyle:{width:"400px !important"},attrs:{filterable:"",placeholder:"请选择分部",multiple:"",disabled:e.pageDisabled,clearable:""},model:{value:e.form.memberFeeShowOrganId,callback:function(t){e.$set(e.form,"memberFeeShowOrganId","string"===typeof t?t.trim():t)},expression:"form.memberFeeShowOrganId"}},e._l(e.selects.branchs,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id.toString()}})})),1)],1),e._v(" "),a("el-form-item",{attrs:{label:"免费乐团可售分部",prop:"freeFeeShowOrganId"}},[a("select-all",{staticStyle:{width:"400px !important"},attrs:{filterable:"",placeholder:"请选择分部",multiple:"",disabled:e.pageDisabled,clearable:""},model:{value:e.form.freeFeeShowOrganId,callback:function(t){e.$set(e.form,"freeFeeShowOrganId","string"===typeof t?t.trim():t)},expression:"form.freeFeeShowOrganId"}},e._l(e.selects.branchs,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id.toString()}})})),1)],1),e._v(" "),1==e.tenantId?a("el-form-item",{attrs:{label:"乐器置换可售分部",prop:"replacementShowOrganId"}},[a("select-all",{staticStyle:{width:"400px !important"},attrs:{filterable:"",placeholder:"请选择所属分部",multiple:"",disabled:e.pageDisabled,clearable:""},model:{value:e.form.replacementShowOrganId,callback:function(t){e.$set(e.form,"replacementShowOrganId","string"===typeof t?t.trim():t)},expression:"form.replacementShowOrganId"}},e._l(e.selects.branchs,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id.toString()}})})),1)],1):e._e(),e._v(" "),a("el-alert",{staticClass:"alert",attrs:{title:"商品信息",closable:!1,type:"info"}}),e._v(" "),a("el-form-item",{attrs:{label:"商品图片",prop:"image"}},[a("image-cropper",{attrs:{options:e.cropperOptions,disabled:e.pageDisabled,imgSize:2,imageUrl:e.form.image,bucket_name:"mall"},on:{"crop-upload-success":e.cropSuccess}}),e._v(" "),a("p",{staticClass:"imageSize"},[e._v("\n 请上传大小2M以内,格式为jpg、png、gif图片\n ")])],1),e._v(" "),a("br"),e._v(" "),a("el-form-item",{attrs:{label:"商品描述",prop:"brief"}},[a("el-input",{staticStyle:{width:"400px"},attrs:{type:"textarea",disabled:e.pageDisabled},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("br"),e._v(" "),a("el-form-item",{attrs:{label:"商品详情",prop:"desc"}},[a("el-input",{staticStyle:{width:"400px"},attrs:{type:"textarea",disabled:e.pageDisabled},model:{value:e.form.desc,callback:function(t){e.$set(e.form,"desc","string"===typeof t?t.trim():t)},expression:"form.desc"}})],1),e._v(" "),a("br"),e._v(" "),e.pageDisabled?e._e():a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.onSubmit("form")}}},[e._v("保存")]),e._v(" "),a("el-button",{on:{click:function(t){return e.onReSet("form")}}},[e._v("重置")])],1)],1)],1)])},r=[],n=(a("ac6a"),a("7f7f"),a("28a5"),a("2543")),o=a("5f87"),i=a("92e3"),u=a("896b"),s=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()},c=function(e,t,a){""==t&&"string"==typeof t||null==t?a(new Error("请输入库存")):t<0?a(new Error("库存数量必须大于或等于0")):a()},d={name:"shopOperation",components:{ImageCropper:u["a"]},data:function(){return{goodsType:i["C"],stockType:i["Y"],categoryList:[],pageType:null,pageTitle:{create:"添加",update:"修改",look:"查看",copy:"复制"},pageDisabled:!1,headers:{Authorization:Object(o["b"])()},form:{sn:null,brand:null,supplyChannel:null,name:null,type:null,goodsCategoryId:null,specification:null,stockCount:null,taxStockCount:null,stockType:null,marketPrice:null,discountPrice:null,groupPurchasePrice:null,organCostPrice:null,clientShow:null,educationalShow:null,musicGroupShow:null,courseViewType:[],stockWarning:null,image:null,brief:null,desc:null,replacementShow:null,studentShowOrganId:null,educationShowOrganId:null,courseFeeShowOrganId:null,memberFeeShowOrganId:null,freeFeeShowOrganId:null,replacementShowOrganId:null},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"}],organIdList:[{required:!0,message:"请选择所属分部",trigger:"change"}],specification:[{required:!0,message:"请输入商品型号",trigger:"blur"},{min:2,max:30,message:"长度在 2 到 30 个字符",trigger:"blur"}],stockCount:[{required:!0,validator:c,trigger:"blur"}],taxStockCount:[{required:!0,validator:c,trigger:"blur"}],stockType:[{required:!0,message:"请选择库存类型",trigger:"change"}],marketPrice:[{required:!0,validator:s,trigger:"blur"}],discountPrice:[{required:!0,validator:s,trigger:"blur"}],groupPurchasePrice:[{required:!0,validator:s,trigger:"blur"}],organCostPrice:[{required:!0,validator:s,trigger:"blur"}],clientShow:[{required:!0,message:"请选择学员是否展示",trigger:"change"}],replacementShow:[{required:!0,message:"是否参与乐器置换",trigger:"change"}],educationalShow:[{required:!0,message:"请选择教务端是否展示",trigger:"change"}],musicGroupShow:[{required:!0,message:"请选择乐团是否展示",trigger:"change"}],courseViewType:[{required:!0,message:"请选乐团收费模式",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"}]},Fsearch:null,Frules:null,imageWidthM:400,imageHeightM:400,tenantId:"",cropperOptions:{autoCrop:!0,autoCropWidth:300,autoCropHeight:300,fixedBox:!0,previewsCircle:!1,title:"商品图片"}}},mounted:function(){this.tenantId=this.$helpers.tenantId,this.$store.dispatch("setBranchs"),this.init()},methods:{init:function(){var e=this.$route.query;if(e.paramInfo){var t=JSON.parse(e.paramInfo);this.pageType=t.type,this.id=t.id}this.pageDisabled="look"==this.pageType,this.getList(),this.getCatagory()},cropSuccess:function(e){this.form.image=e.data.url},onSubmit:function(e){var t=this;this.$refs[e].validate((function(e){if(!e)return t.$nextTick((function(){var e=document.getElementsByClassName("is-error");e[0].scrollIntoView({block:"center",behavior:"smooth"})})),!1;var a=JSON.parse(JSON.stringify(t.form));a.courseViewType&&(a.courseViewType=a.courseViewType.join(",")),a.studentShowOrganId&&(a.studentShowOrganId=a.studentShowOrganId.join(",")),a.educationShowOrganId&&(a.educationShowOrganId=a.educationShowOrganId.join(",")),a.courseFeeShowOrganId&&(a.courseFeeShowOrganId=a.courseFeeShowOrganId.join(",")),a.memberFeeShowOrganId&&(a.memberFeeShowOrganId=a.memberFeeShowOrganId.join(",")),a.freeFeeShowOrganId&&(a.freeFeeShowOrganId=a.freeFeeShowOrganId.join(",")),a.replacementShowOrganId&&(a.replacementShowOrganId=a.replacementShowOrganId.join(",")),a.studentShowOrganId||a.educationShowOrganId||a.courseFeeShowOrganId||a.memberFeeShowOrganId||a.freeFeeShowOrganId||a.replacementShowOrganId?"create"==t.pageType||"copy"==t.pageType?(a.id&&delete a.id,a.sellCount=0,a.stockCount=0,a.taxStockCount=0,a.status="NO",Object(n["n"])(a).then((function(e){t.messageTips("保存",e)}))):"update"==t.pageType&&Object(n["s"])(a).then((function(e){t.messageTips("保存",e)})):t.$message.error("请至少选择一个可见分部")}))},messageTips:function(e,t){200==t.code?(this.$message.success(e+"成功"),this.$store.dispatch("delVisitedViews",this.$route),this.$router.push({path:"/shopList",query:{pageInfo:this.Frules,searchForm:this.Fsearch}})):this.$message.error(t.msg)},onCancel:function(){this.$store.dispatch("delVisitedViews",this.$route),this.$router.push({path:"/shopList"})},onReSet:function(e){this.$refs[e].resetFields()},getList:function(){var e=this;"create"==this.pageType?(this.form={sn:null,brand:null,supplyChannel:null,name:null,type:null,goodsCategoryId:null,organIdList:[],specification:null,stockCount:null,taxStockCount:null,stockType:null,marketPrice:null,discountPrice:null,groupPurchasePrice:null,organCostPrice:null,clientShow:null,educationalShow:null,musicGroupShow:null,courseViewType:[],stockWarning:null,image:null,brief:null,desc:null},this.$refs["form"]&&this.$refs["form"].resetFields()):Object(n["r"])(this.id).then((function(t){if(200==t.code){var a=t.data,l=null;a.courseViewType&&(l=a.courseViewType.split(","));var r=[];a.studentShowOrganId&&(r=a.studentShowOrganId.split(","));var n=[];a.educationShowOrganId&&(n=a.educationShowOrganId.split(","));var o=[];a.courseFeeShowOrganId&&(o=a.courseFeeShowOrganId.split(","));var i=[];a.memberFeeShowOrganId&&(i=a.memberFeeShowOrganId.split(","));var u=[];a.freeFeeShowOrganId&&(u=a.freeFeeShowOrganId.split(","));var s=[];a.replacementShowOrganId&&(s=a.replacementShowOrganId.split(",")),e.form={id:a.id,sn:a.sn,brand:a.brand,supplyChannel:a.supplyChannel,name:a.name,type:a.type,goodsCategoryId:a.goodsCategoryId,studentShowOrganId:r,educationShowOrganId:n,courseFeeShowOrganId:o,memberFeeShowOrganId:i,freeFeeShowOrganId:u,replacementShowOrganId:s,specification:a.specification,stockCount:a.stockCount,taxStockCount:a.taxStockCount,stockType:a.stockType,marketPrice:a.marketPrice,discountPrice:a.discountPrice,groupPurchasePrice:a.groupPurchasePrice,organCostPrice:a.organCostPrice,clientShow:a.clientShow,educationalShow:a.educationalShow,musicGroupShow:a.musicGroupShow,courseViewType:l,stockWarning:a.stockWarning,image:a.image,brief:a.brief,desc:a.desc,replacementShow:a.replacementShow}}}))},getCatagory:function(){var e=this;Object(n["f"])({delFlag:0,rows:9999}).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}}))},handleAvatarSuccess:function(e,t){this.form.image=e.data.url},beforeAvatarUpload:function(e){var t=this,a={"image/png":!0,"image/jpeg":!0},l=a[e.type],r=e.size/1024/1024<2,n=this.imageWidthM,o=this.imageHeightM,i=window.URL||window.webkitURL,u=new Promise((function(t,a){var l=new Image;l.onload=function(){n&&o?this.width===n&&this.height===o?t():a("请上传".concat(n,"x").concat(o,"尺寸图片")):n&&!o?this.width===n?t():a("请上传宽为".concat(n,"的图片")):!n&&o?this.height===o?t():a("请上传高为".concat(o,"的图片")):t()},l.src=i.createObjectURL(e)})).then((function(){return e}),(function(e){return t.$message.error(e),t.uploadImgLoading=!1,Promise.reject()}));return l||this.$message.error("只能上传图片格式!"),r||this.$message.error("上传头像图片大小不能超过 2MB!"),l&&r&&u}}},p=d,b=(a("8dd6"),a("2877")),m=Object(b["a"])(p,l,r,!1,null,"4a0c9e60",null);t["default"]=m.exports}}]);