徐总多门店
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
6.1 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-6ce18431"],{"633d":function(t,e,r){"use strict";r("d4a4")},"775b":function(t,e,r){"use strict";r.r(e);var a=r("2f62"),o=r("c4c8"),n=r("d708");function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,a)}return r}function l(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?s(Object(r),!0).forEach((function(e){u(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function u(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=i(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var a=r.call(t,e||"default");if("object"!=i(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==i(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var c={name:"specsAdd",data:function(){var t=this;return{roterPre:n.a.roterPre,grid:{xl:7,lg:7,md:12,sm:24,xs:24},formValidate:{id:0,name:"",sort:0,specs:[]},ruleValidate:{name:[{required:!0,message:"请输入参数模板名称",trigger:"blur"}]},columns:[{title:"参数名称",key:"name",width:150,render:function(e,r){return e("div",[e("Input",{props:{value:r.row.name,placeholder:"请输入参数名称"},on:{"on-change":function(e){r.row.name=e.target.value,t.data[r.index].name=e.target.value}}})])}},{title:"参数值",key:"value",width:300,render:function(e,r){return e("div",[e("Input",{props:{value:r.row.value,placeholder:"请输入参数值"},on:{"on-change":function(e){r.row.value=e.target.value,t.data[r.index].value=e.target.value}}})])}},{title:"排序",key:"sort",width:100,render:function(e,r){return e("div",[e("InputNumber",{props:{value:parseInt(r.row.sort)||0,placeholder:"排序",precision:0},on:{"on-change":function(e){r.row.sort=e,t.data[r.index].sort=e}}})])}},{title:"操作",slot:"action",minWidth:120}],data:[]}},computed:l(l({},Object(a.e)("admin/layout",["isMobile","menuCollapse"])),{},{labelWidth:function(){return this.isMobile?void 0:120},labelPosition:function(){return this.isMobile?"top":"right"}}),created:function(){this.add(),this.getInfo()},mounted:function(){this.setCopyrightShow({value:!1})},destroyed:function(){this.setCopyrightShow({value:!0})},methods:l(l({},Object(a.d)("admin/layout",["setCopyrightShow"])),{},{getInfo:function(){var t=this;Object(o.hb)(this.$route.params.id).then((function(e){t.formValidate=e.data,t.data=e.data.specs}))},del:function(t){this.data.splice(t,1)},add:function(){this.data.push({name:"",value:"",sort:0})},handleSubmit:function(t){var e=this;this.$refs[t].validate((function(t){if(t){e.formValidate.id=e.$route.params.id,e.formValidate.specs=e.data;for(var r=0;r<e.formValidate.specs.length;r++){var a=e.formValidate.specs[r];if(!a.name.trim())return e.$Message.error("请输入参数名称");if(!a.value.trim())return e.$Message.error("请输入参数值")}Object(o.gb)(e.formValidate).then((function(t){e.$Message.success(t.msg),e.$router.push({path:e.roterPre+"/product/specs"})})).catch((function(t){e.$Message.error(t.msg)}))}else e.$Message.error("请输入参数模板名称")}))}})},d=(r("633d"),r("2877")),m=Object(d.a)(c,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"form-submit"},[e("div",{staticClass:"i-layout-page-header"},[e("PageHeader",{staticClass:"product_tabs",attrs:{"hidden-breadcrumb":""}},[e("div",{attrs:{slot:"title"},slot:"title"},[e("router-link",{attrs:{to:{path:"".concat(t.roterPre,"/product/specs")}}},[e("div",{staticClass:"font-sm after-line"},[e("span",{staticClass:"iconfont iconfanhui"}),e("span",{staticClass:"pl10"},[t._v("返回")])])]),e("span",{staticClass:"mr20 ml16",domProps:{textContent:t._s("0"!==t.$route.params.id?"编辑商品参数模板":"添加商品参数模板")}})],1)])],1),e("Card",{staticClass:"ivu-mt",attrs:{bordered:!1,"dis-hover":""}},[e("Form",{ref:"formValidate",staticClass:"formValidate mt20",attrs:{rules:t.ruleValidate,model:t.formValidate,"label-width":t.labelWidth,"label-position":t.labelPosition},nativeOn:{submit:function(t){t.preventDefault()}}},[e("Row",{attrs:{gutter:24,type:"flex"}},[e("Col",{attrs:{span:"24"}},[e("FormItem",{attrs:{label:"参数模板名称:",prop:"name"}},[e("Input",{directives:[{name:"width",rawName:"v-width",value:"400",expression:"'400'"}],attrs:{placeholder:"请输入参数模板名称"},model:{value:t.formValidate.name,callback:function(e){t.$set(t.formValidate,"name",e)},expression:"formValidate.name"}})],1)],1),e("Col",{attrs:{span:"24"}},[e("FormItem",{attrs:{label:"排序:",props:""}},[e("InputNumber",{directives:[{name:"width",rawName:"v-width",value:"200",expression:"'200'"}],attrs:{placeholder:"排序","element-id":"sort",min:1,precision:0},model:{value:t.formValidate.sort,callback:function(e){t.$set(t.formValidate,"sort",e)},expression:"formValidate.sort"}})],1)],1),e("Col",{attrs:{span:"24"}},[e("FormItem",{attrs:{label:"",props:""}},[e("Table",{ref:"table",staticClass:"table",attrs:{border:"",columns:t.columns,data:t.data,width:"700"},scopedSlots:t._u([{key:"action",fn:function(r){r.row;var a=r.index;return[a>0?e("a",{on:{click:function(e){return t.del(a)}}},[t._v("删除")]):t._e()]}}])}),e("Button",{staticClass:"mt20",on:{click:t.add}},[t._v("添加参数")])],1)],1)],1)],1)],1),e("Card",{staticClass:"fixed-card",style:{left:"".concat(t.menuCollapse?t.isMobile?"0":"80px":"200px")},attrs:{bordered:!1,"dis-hover":""}},[e("Form",[e("FormItem",[e("Button",{staticClass:"submission",attrs:{type:"primary"},on:{click:function(e){return t.handleSubmit("formValidate")}}},[t._v("保存")])],1)],1)],1)],1)}),[],!1,null,"5de05d92",null);e.default=m.exports},d4a4:function(t,e,r){}}]);