You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

1 lines
7.5 KiB

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-392882cd"],{"5e35":function(t,e,r){"use strict";r.d(e,"c",(function(){return n})),r.d(e,"a",(function(){return a})),r.d(e,"b",(function(){return o})),r.d(e,"e",(function(){return i})),r.d(e,"d",(function(){return s}));var u=r("b775");function n(t){return Object(u["a"])({url:"/mall/pms/PmsProductAttributeCategory/list",method:"get",params:t})}function a(t){return Object(u["a"])({url:"/mall/pms/PmsProductAttributeCategory/create",method:"post",data:t})}function o(t){return Object(u["a"])({url:"/mall/pms/PmsProductAttributeCategory/delete/"+t,method:"get"})}function i(t,e){return Object(u["a"])({url:"/mall/pms/PmsProductAttributeCategory/update/"+t,method:"post",data:e})}function s(){return Object(u["a"])({url:"/mall/pms/PmsProductAttributeCategory/list/withAttr",method:"get"})}},"6e0d":function(t,e,r){"use strict";r.d(e,"a",(function(){return n}));var u=r("b775");function n(){return Object(u["a"])({url:"/aliyun/oss/policy",method:"get"})}},8085:function(t,e,r){"use strict";r.r(e);var u=function(){var t=this,e=t._self._c;return e("product-cate-detail",{attrs:{"is-edit":!0}})},n=[],a=r("c0fd"),o={name:"updateProductCate",components:{ProductCateDetail:a["a"]}},i=o,s=r("2877"),c=Object(s["a"])(i,u,n,!1,null,null,null);e["default"]=c.exports},c0fd:function(t,e,r){"use strict";var u=function(){var t=this,e=t._self._c;return e("div",{staticClass:"main-content"},[e("el-card",{staticClass:"form-container",attrs:{shadow:"never"}},[e("el-form",{ref:"productCateFrom",attrs:{model:t.productCate,rules:t.rules,"label-width":"150px"}},[e("el-form-item",{attrs:{label:"分类名称:",prop:"name"}},[e("el-input",{model:{value:t.productCate.name,callback:function(e){t.$set(t.productCate,"name",e)},expression:"productCate.name"}})],1),e("el-form-item",{attrs:{label:"是否显示:"}},[e("el-radio-group",{model:{value:t.productCate.showStatus,callback:function(e){t.$set(t.productCate,"showStatus",e)},expression:"productCate.showStatus"}},[e("el-radio",{attrs:{label:"1"}},[t._v("是")]),e("el-radio",{attrs:{label:"0"}},[t._v("否")])],1)],1),e("el-form-item",{attrs:{label:"分类描述:"}},[e("el-input",{attrs:{type:"textarea",autosize:!0},model:{value:t.productCate.description,callback:function(e){t.$set(t.productCate,"description",e)},expression:"productCate.description"}})],1),e("el-form-item",[e("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.onSubmit("productCateFrom")}}},[t._v("提交")]),t.isEdit?t._e():e("el-button",{on:{click:function(e){return t.resetForm("productCateFrom")}}},[t._v("重置")])],1)],1)],1)],1)},n=[],a=r("d1f3"),o=r("5e35"),i=(r("c8aa"),r("0f39")),s={description:"",icon:"",keywords:"",name:"",navStatus:1,parentId:0,productUnit:"",showStatus:0,indexStatus:1,sort:0,productAttributeIdList:[],sid:"",orgPath:window.sessionStorage.getItem("orgSidPath"),useOrgSid:window.sessionStorage.getItem("defaultDeptSid"),userSid:window.sessionStorage.getItem("userSid"),createOrgSid:window.sessionStorage.getItem("orgSid")},c={name:"ProductCateDetail",components:{SingleUpload:i["a"]},filters:{filterLabelFilter:function(t){return 0===t?"筛选属性:":""}},props:{isEdit:{type:Boolean,default:!1}},data:function(){return{productCate:Object.assign({},s),selectProductCateList:[],rules:{name:[{required:!0,message:"请输入品牌名称",trigger:"blur"},{min:2,max:140,message:"长度在 2 到 140 个字符",trigger:"blur"}]},filterAttrs:[],filterProductAttrList:[{value:[]}]}},created:function(){},activated:function(){var t=this;Object(a["f"])(this.$route.query.sid).then((function(e){t.productCate=e.data}))},methods:{getSelectProductCateList:function(){var t=this;Object(a["c"])(0,{pageSize:100,pageNum:1}).then((function(e){t.selectProductCateList=e.data.records,t.selectProductCateList.unshift({id:0,name:"无上级分类"})}))},getProductAttrCateList:function(){var t=this;Object(o["d"])().then((function(e){for(var r=e.data,u=0;u<r.length;u++){var n=r[u],a=[];if(null!=n.productAttributeList&&n.productAttributeList.length>0)for(var o=0;o<n.productAttributeList.length;o++)a.push({label:n.productAttributeList[o].name,value:n.productAttributeList[o].id});t.filterAttrs.push({label:n.name,value:n.id,children:a})}}))},getProductAttributeIdList:function(){for(var t=[],e=0;e<this.filterProductAttrList.length;e++){var r=this.filterProductAttrList[e];null!==r.value&&2===r.value.length&&t.push(r.value[1])}return t},onSubmit:function(t){var e=this;this.$refs[t].validate((function(r){if(!r)return e.$message({message:"验证失败",type:"error",duration:1e3}),!1;e.$confirm("是否提交数据","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){e.isEdit?(e.productCate.productAttributeIdList=e.getProductAttributeIdList(),Object(a["i"])(e.$route.query.sid,e.productCate).then((function(r){r.success&&(e.$refs[t].resetFields(),e.$message({message:"修改成功",type:"success",duration:1e3}),e.$store.dispatch("tagsView/delView",e.$route),e.$router.go(-1))}))):(e.productCate.productAttributeIdList=e.getProductAttributeIdList(),Object(a["a"])(e.productCate).then((function(t){t.success&&(e.$message({message:"提交成功",type:"success",duration:1e3}),e.$store.dispatch("tagsView/delView",e.$route),e.$router.go(-1))})))}))}))},resetForm:function(t){this.$refs[t].resetFields(),this.productCate=Object.assign({},s),this.filterProductAttrList=[{value:[]}]},removeFilterAttr:function(t){if(1!==this.filterProductAttrList.length){var e=this.filterProductAttrList.indexOf(t);-1!==e&&this.filterProductAttrList.splice(e,1)}else this.$message({message:"至少要留一个",type:"warning",duration:1e3})},handleAddFilterAttr:function(){3!==this.filterProductAttrList.length?this.filterProductAttrList.push({value:null,key:Date.now()}):this.$message({message:"最多添加三个",type:"warning",duration:1e3})}}},d=c,l=r("2877"),m=Object(l["a"])(d,u,n,!1,null,"6003fbb8",null);e["a"]=m.exports},c8aa:function(t,e,r){"use strict";r.d(e,"a",(function(){return n}));var u=r("b775");function n(t,e){return Object(u["a"])({url:"/pms/PmsProductAttribute/list/"+t,method:"get",params:e})}},d1f3:function(t,e,r){"use strict";r.d(e,"d",(function(){return n})),r.d(e,"c",(function(){return a})),r.d(e,"b",(function(){return o})),r.d(e,"a",(function(){return i})),r.d(e,"i",(function(){return s})),r.d(e,"f",(function(){return c})),r.d(e,"j",(function(){return d})),r.d(e,"g",(function(){return l})),r.d(e,"h",(function(){return m})),r.d(e,"e",(function(){return p}));var u=r("b775");function n(t){return Object(u["a"])({url:"/mall/pms/PmsProductCategory/list",method:"post",data:t})}function a(t,e){return Object(u["a"])({url:"/mall/pms/PmsProductCategory/list/"+t,method:"get",params:e})}function o(t){return Object(u["a"])({url:"/mall/pms/PmsProductCategory/delete",method:"DELETE",data:t,headers:{"Content-Type":"application/json"}})}function i(t){return Object(u["a"])({url:"/mall/pms/PmsProductCategory/create",method:"post",data:t})}function s(t,e){return Object(u["a"])({url:"/mall/pms/PmsProductCategory/update/"+t,method:"post",data:e})}function c(t){return Object(u["a"])({url:"/mall/pms/PmsProductCategory/"+t,method:"get"})}function d(t){return Object(u["a"])({url:"/mall/pms/PmsProductCategory/update/showStatus",method:"post",data:t})}function l(t){return Object(u["a"])({url:"/mall/pms/PmsProductCategory/update/indexStatus",method:"post",data:t})}function m(t){return Object(u["a"])({url:"/mall/pms/PmsProductCategory/update/navStatus",method:"post",data:t})}function p(){return Object(u["a"])({url:"/mall/pms/PmsProductCategory/list/withChildren",method:"get"})}}}]);