zx/public/mer/js/chunk-a97676f4.48f7d9a7.js

1 line
10 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-a97676f4"],{"32e2":function(t,e,a){"use strict";a.r(e);var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"divBox"},[a("el-card",[a("el-button",{staticClass:"mb20",attrs:{size:"small",type:"primary"},on:{click:t.add}},[t._v("添加关键字")]),t._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.listLoading,expression:"listLoading"}],attrs:{data:t.tableData.data,size:"small"}},[a("el-table-column",{attrs:{prop:"service_reply_id",label:"ID","min-width":"80"}}),t._v(" "),a("el-table-column",{attrs:{prop:"keyword",label:"关键字","min-width":"180"}}),t._v(" "),a("el-table-column",{attrs:{prop:"status",label:"回复类型","min-width":"120"},scopedSlots:t._u([{key:"default",fn:function(e){return["1"==e.row.type?a("span",[t._v("文字消息")]):t._e(),t._v(" "),"2"==e.row.type?a("span",[t._v("图片消息")]):t._e()]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"status",label:"是否显示","min-width":"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-switch",{attrs:{"active-value":1,"inactive-value":0,width:55,"active-text":"显示","inactive-text":"隐藏"},on:{change:function(a){return t.onchangeIsShow(e.row)}},model:{value:e.row.status,callback:function(a){t.$set(e.row,"status",a)},expression:"scope.row.status"}})]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"操作","min-width":"80",fixed:"right"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return t.edit(e.row)}}},[t._v("编辑")]),t._v(" "),a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return t.handleDelete(e.row.service_reply_id,e.$index)}}},[t._v("删除")])]}}])})],1),t._v(" "),a("div",{staticClass:"block"},[a("el-pagination",{attrs:{background:"","page-size":t.tableData.limit,"current-page":t.tableData.page,layout:"total, prev, pager, next, jumper",total:t.tableData.total},on:{"size-change":t.handleSizeChange,"current-change":t.pageChange}})],1)],1),t._v(" "),t.dialogVisible?a("el-dialog",{staticClass:"addDia",attrs:{visible:t.dialogVisible,title:t.message_id?"编辑":"添加",height:"30%",width:"540px"},on:{"update:visible":function(e){t.dialogVisible=e}}},[a("div",{staticClass:"box-card right"},[a("el-form",{ref:"formValidate",attrs:{model:t.formValidate,rules:t.ruleValidate,"label-width":"90px"},nativeOn:{submit:function(t){t.preventDefault()}}},[a("el-form-item",{attrs:{label:"关键字:",prop:"val"}},[a("div",{staticClass:"arrbox"},[t._l(t.labelarr,(function(e,i){return a("el-tag",{key:i,staticClass:"mr5",attrs:{type:"success",closable:"","disable-transitions":!1},on:{close:function(a){return t.handleClose(e)}}},[t._v(t._s(e))])})),t._v(" "),a("el-input",{staticClass:"width100",attrs:{placeholder:"输入后回车",size:"small"},on:{change:t.addlabel},model:{value:t.val,callback:function(e){t.val=e},expression:"val"}})],2)]),t._v(" "),a("el-form-item",{attrs:{label:"规则状态:"}},[a("el-radio-group",{model:{value:t.formValidate.status,callback:function(e){t.$set(t.formValidate,"status",e)},expression:"formValidate.status"}},[a("el-radio",{attrs:{label:1}},[t._v("启用")]),t._v(" "),a("el-radio",{attrs:{label:0}},[t._v("禁用")])],1)],1),t._v(" "),a("el-form-item",{attrs:{label:"消息类型:",prop:"type"}},[a("el-select",{staticClass:"width100",attrs:{placeholder:"请选择规则状态",size:"small"},model:{value:t.formValidate.type,callback:function(e){t.$set(t.formValidate,"type",e)},expression:"formValidate.type"}},t._l(t.typeList,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),t._v(" "),"1"==t.formValidate.type?a("el-form-item",{attrs:{label:"规则内容:",prop:"content"}},[a("el-input",{staticClass:"width100",attrs:{type:"textarea",placeholder:"请填写规则内容",size:"small"},model:{value:t.formValidate.content,callback:function(e){t.$set(t.formValidate,"content",e)},expression:"formValidate.content"}})],1):t._e(),t._v(" "),"2"==t.formValidate.type?a("el-form-item",{attrs:{label:"图片地址:",prop:"src"}},[a("div",{staticClass:"acea-row row-middle"},[a("div",{staticClass:"upLoadPicBox",attrs:{title:"750*750px"},on:{click:t.modalPicTap}},[t.formValidate.content?a("div",{staticClass:"pictrue"},[a("img",{attrs:{src:t.formValidate.content}})]):a("div",{staticClass:"upLoad"},[a("i",{staticClass:"el-icon-camera cameraIconfont"})])])])]):t._e()],1)],1),t._v(" "),a("div",[a("div",{staticStyle:{"text-align":"right"}},[a("el-button",{attrs:{size:"small"},on:{click:function(e){t.dialogVisible=!1}}},[t._v("取消")]),t._v(" "),a("el-button",{attrs:{type:"primary",size:"small",loading:t.loading},on:{click:function(e){return t.submenus("formValidate")}}},[t._v("保存并发布")])],1)])]):t._e()],1)},n=[],r=(a("28a5"),a("c80c")),s=(a("96cf"),a("3b8d")),l=(a("7f7f"),a("a7a4")),o=a("83d6"),c=a("5f87"),u={name:"CustomerKeyword",data:function(){var t=this,e=function(e,a,i){"1"==t.formValidate.type&&(""==t.formValidate.content?i(new Error("请填写规则内容")):i())},a=function(e,a,i){0==t.labelarr.length?i(new Error("请输入后回车")):i()};return{roterPre:o["roterPre"],tableData:{page:1,limit:20,data:[],total:0,indexNum:0},typeList:[{label:"文字消息",value:1},{label:"图片消息",value:2}],listLoading:!0,loading:!1,message_id:"",val:"",dialogVisible:!1,formValidate:{status:1,type:1,content:"",keyword:""},ruleValidate:{val:[{required:!0,validator:a,trigger:"blur"}],type:[{required:!0,message:"请选择消息类型",trigger:"change"}],content:[{required:!0,validator:e,trigger:"blur"}]},labelarr:[],myHeaders:{"X-Token":Object(c["a"])()}}},created:function(){this.getList()},methods:{onchangeIsShow:function(t){var e=this;Object(l["p"])(t.service_reply_id,t.status).then((function(t){var a=t.message;e.$message.success(a)})).catch((function(t){var a=t.message;e.$message.error(a)}))},getList:function(){var t=this;this.listLoading=!0,Object(l["o"])(this.tableData.page,this.tableData.limit).then((function(e){t.tableData.data=e.data.list,t.tableData.total=e.data.count,t.listLoading=!1})).catch((function(e){t.listLoading=!1,t.$message.error(e.message)}))},pageChange:function(t){this.tableData.page=t,this.getList()},handleSizeChange:function(t){this.tableData.limit=t,this.getList()},modalPicTap:function(){var t=this;this.$modalUpload((function(e){t.formValidate.content=e[0]}))},handleClose:function(t){var e=this.labelarr.indexOf(t);this.labelarr.splice(e,1)},addlabel:function(){var t=this.labelarr.indexOf(this.val);-1===t&&""!=this.val&&this.labelarr.push(this.val),this.val=""},submenus:function(t){var e=this;this.$refs[t].validate((function(t){t&&(e.loading=!0,e.formValidate.keyword=e.labelarr.join(","),e.message_id?Object(l["n"])(e.message_id,e.formValidate).then(function(){var t=Object(s["a"])(Object(r["a"])().mark((function t(a){return Object(r["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.loading=!1,e.dialogVisible=!1,e.$message.success(a.message),e.getList();case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){e.loading=!1,e.$message.error(t.message)})):Object(l["l"])(e.formValidate).then(function(){var t=Object(s["a"])(Object(r["a"])().mark((function t(a){return Object(r["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.loading=!1,e.dialogVisible=!1,e.getList();case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){e.loading=!1,e.$message.error(t.message)})))}))},operation:function(){var t=this;this.$confirm("继续添加吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){setTimeout((function(){t.$refs["formValidate"].resetFields()}),1e3)})).catch((function(){setTimeout((function(){t.$router.push({path:"".concat(o["roterPre"],"/systemForm/customer_keyword")})}),500)}))},add:function(){this.message_id="",this.dialogVisible=!0,this.formValidate={status:1,content:"",keyword:"",type:""},this.labelarr=[]},edit:function(t){this.message_id=t.service_reply_id,this.dialogVisible=!0;var e=t||null;this.formValidate={status:e.status,content:e.content,keyword:e.keyword,type:e.type},this.labelarr=e.keyword.split(",")||[]},handleDelete:function(t,e){var a=this;this.$modalSure("删除该关键字").then((function(){Object(l["m"])(t).then((function(t){var e=t.message;a.$message.success(e),a.getList()})).catch((function(t){var e=t.message;a.$message.error(e)}))}))}}},d=u,f=a("2877"),m=Object(f["a"])(d,i,n,!1,null,"b3ec68b8",null);e["default"]=m.exports},a7a4:function(t,e,a){"use strict";a.d(e,"a",(function(){return n})),a.d(e,"k",(function(){return r})),a.d(e,"b",(function(){return s})),a.d(e,"e",(function(){return l})),a.d(e,"d",(function(){return o})),a.d(e,"f",(function(){return c})),a.d(e,"g",(function(){return u})),a.d(e,"j",(function(){return d})),a.d(e,"h",(function(){return f})),a.d(e,"c",(function(){return m})),a.d(e,"i",(function(){return p})),a.d(e,"l",(function(){return v})),a.d(e,"o",(function(){return g})),a.d(e,"m",(function(){return h})),a.d(e,"n",(function(){return b})),a.d(e,"p",(function(){return y}));var i=a("0c6d");function n(t){return i["a"].get("config/".concat(t))}function r(){return i["a"].get("delivery/station/business")}function s(t){return i["a"].post("delivery/station/create",t)}function l(t){return i["a"].get("delivery/station/lst",t)}function o(t){return i["a"].get("delivery/station/detail/".concat(t))}function c(t){return i["a"].get("delivery/station/mark/".concat(t,"/form"))}function u(t,e){return i["a"].post("delivery/station/status/".concat(t),e)}function d(){return i["a"].get("config")}function f(t,e){return i["a"].post("delivery/station/update/".concat(t),e)}function m(t){return i["a"].delete("delivery/station/delete/".concat(t))}function p(){return i["a"].get("delivery/station/getCity")}function v(t){return i["a"].post("service/reply/create",t)}function g(t,e){return i["a"].get("service/reply/list",{page:t,limit:e})}function h(t){return i["a"].delete("service/reply/delete/".concat(t))}function b(t,e){return i["a"].post("service/reply/update/".concat(t),e)}function y(t,e){return i["a"].post("service/reply/status/".concat(t),{status:e})}}}]);