chunk-d3f214ce.c068f7f6.js 5.5 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-d3f214ce"],{9809:function(e,t,a){"use strict";a.r(t);var s=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"divBox"},[a("el-card",{staticClass:"box-card"},[a("div",{attrs:{slot:"header"},slot:"header"},[a("div",{staticClass:"container"},[a("div",{staticClass:"demo-input-suffix acea-row"},[a("el-form",{ref:"formValidate",attrs:{"label-width":"120px",rules:e.ruleValidate,model:e.formValidate}},[a("el-form-item",{attrs:{label:"参数模板名称:",prop:"template_name"}},[a("el-input",{staticClass:"pageWidth",attrs:{maxlength:30,size:"small",placeholder:"请输入参数模板名称"},model:{value:e.formValidate.template_name,callback:function(t){e.$set(e.formValidate,"template_name",t)},expression:"formValidate.template_name"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"排序:"}},[a("el-input-number",{staticClass:"pageWidth",attrs:{min:0,size:"small",label:"排序","controls-position":"right"},model:{value:e.formValidate.sort,callback:function(t){e.$set(e.formValidate,"sort",t)},expression:"formValidate.sort"}})],1),e._v(" "),a("el-form-item",{attrs:{label:""}},[a("el-table",{attrs:{data:e.data,border:"",size:"small"}},[a("el-table-column",{attrs:{align:"center",prop:"name",label:"参数名称","min-width":"150"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-input",{staticClass:"priceBox",attrs:{size:"small",placeholder:"请输入参数名称"},model:{value:t.row.name,callback:function(a){e.$set(t.row,"name",a)},expression:"scope.row.name"}})]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center",label:"参数值","min-width":"300"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"arrbox"},[e._l(t.row.values,(function(s,r){return a("el-tag",{key:r,staticClass:"tags-item",attrs:{name:s,closable:!0,size:"small"},on:{close:function(a){return e.handleClose(t.$index,r)}}},[e._v("\n "+e._s(s.value)+"\n ")])})),e._v(" "),a("input",{directives:[{name:"model",rawName:"v-model",value:t.row.single,expression:"scope.row.single"}],staticClass:"arrbox_ip width100",attrs:{size:"small",placeholder:"请输入选项,回车确认",maxlength:15},domProps:{value:t.row.single},on:{blur:function(a){return e.addSpecList(t.row,t.$index)},keyup:function(a){return!a.type.indexOf("key")&&e._k(a.keyCode,"enter",13,a.key,"Enter")?null:e.addSpecList(t.row,t.$index)},input:function(a){a.target.composing||e.$set(t.row,"single",a.target.value)}}})],2)]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center",label:"排序","min-width":"200"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-input-number",{staticClass:"priceBox",attrs:{size:"small",min:0,"controls-position":"right"},model:{value:t.row.sort,callback:function(a){e.$set(t.row,"sort",a)},expression:"scope.row.sort"}})]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"操作","min-width":"100"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{staticClass:"submission",attrs:{type:"text",size:"small"},on:{click:function(a){return e.delSpecs(t.row,t.$index)}}},[e._v("删除")])]}}])})],1)],1),e._v(" "),a("el-form-item",[a("el-button",{attrs:{size:"small",type:"primary"},on:{click:e.onAdd}},[e._v("添加参数")])],1)],1)],1)])])]),e._v(" "),a("el-card",[a("el-form",{attrs:{"label-width":"120px"}},[a("el-form-item",[a("el-button",{attrs:{size:"small",type:"primary"},on:{click:function(t){return e.handleSubmit("formValidate")}}},[e._v("保存")])],1)],1)],1)],1)},r=[],l=(a("7f7f"),a("ac6a"),a("c4c8")),i=a("83d6"),n={name:"specsCreate",data:function(){return{listLoading:!0,ruleValidate:{template_name:[{required:!0,message:"请输入参数模板名称",trigger:"blur"}]},data:[],single:"",cateList:[],formValidate:{sort:0,delete_params:[]},ids:[]}},created:function(){this.onAdd(),this.$route.params.id&&this.getInfo()},mounted:function(){},methods:{onAdd:function(){var e={name:"",values:[],sort:0,parameter_id:0,single:""};this.data.push(e)},addSpecList:function(e,t){if(e.single){var a=this.data[t].values.indexOf(e);-1===a&&this.data[t].values.push({value:e.single}),e.single=""}},handleClose:function(e,t){this.data[e]["values"].splice(t,1)},onEdit:function(e){var t=this;this.$modalForm(levelUpdateApi(e)).then((function(){return t.getList("")}))},getInfo:function(){var e=this;Object(l["Gb"])(this.$route.params.id).then((function(t){e.formValidate=t.data,e.data=t.data.parameter}))},delSpecs:function(e,t){this.ids.push(e.parameter_id),this.formValidate.delete_params=this.ids,this.data.splice(t,1)},handleSubmit:function(e){var t=this;this.$refs[e].validate((function(e){if(e){t.formValidate.params=t.data;for(var a=0;a<t.formValidate.params.length;a++){var s=t.formValidate.params[a];if(!s.name.trim())return t.$message.error("请输入参数名称");if(!s.values.length)return t.$message.error("请输入参数值")}t.$route.params.id?Object(l["Tb"])(t.$route.params.id,t.formValidate).then((function(e){t.$message.success(e.message),t.$router.push({path:"".concat(i["roterPre"],"/product/specs")})})).catch((function(e){t.$message.error(e.message)})):Object(l["Eb"])(t.formValidate).then((function(e){t.$message.success(e.message),t.$router.push({path:"".concat(i["roterPre"],"/product/specs")})})).catch((function(e){t.$message.error(e.message)}))}else t.$message.error("请输入参数模板名称")}))}}},o=n,c=(a("e0fa"),a("2877")),d=Object(c["a"])(o,s,r,!1,null,"1af0fc66",null);t["default"]=d.exports},e0fa:function(e,t,a){"use strict";a("fdee")},fdee:function(e,t,a){}}]);