1 line
17 KiB
JavaScript
1 line
17 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-1522d452"],{"09f4":function(t,e,a){"use strict";a.d(e,"a",(function(){return r})),Math.easeInOutQuad=function(t,e,a,i){return t/=i/2,t<1?a/2*t*t+e:(t--,-a/2*(t*(t-2)-1)+e)};var i=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)}}();function n(t){document.documentElement.scrollTop=t,document.body.parentNode.scrollTop=t,document.body.scrollTop=t}function o(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function r(t,e,a){var r=o(),s=t-r,l=20,c=0;e="undefined"===typeof e?500:e;var u=function t(){c+=l;var o=Math.easeInOutQuad(c,r,s,e);n(o),c<e?i(t):a&&"function"===typeof a&&a()};u()}},2953:function(t,e,a){"use strict";a.r(e);var i=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"app-container"},[i("div",{staticClass:"filter-container"},[i("el-input",{staticClass:"filter-item",staticStyle:{width:"200px","margin-right":"10px"},attrs:{placeholder:"用户名"},model:{value:t.listQuery.username,callback:function(e){t.$set(t.listQuery,"username",e)},expression:"listQuery.username"}}),i("el-button",{staticClass:"filter-item",attrs:{type:"primary",icon:"el-icon-search"},on:{click:t.getList}},[t._v(" 搜索 ")]),i("el-button",{staticClass:"filter-item",staticStyle:{"margin-left":"10px"},attrs:{type:"primary",icon:"el-icon-circle-plus"},on:{click:function(e){return t.handleCreate({routes:[]})}}},[t._v(" 添加 ")])],1),i("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.listLoading,expression:"listLoading"}],staticStyle:{width:"100%"},attrs:{data:t.list,border:"",fit:"","highlight-current-row":""}},[i("el-table-column",{attrs:{align:"center",label:"操作",width:"200"},scopedSlots:t._u([{key:"default",fn:function(e){return[i("el-button",{attrs:{type:"primary",size:"small",icon:"el-icon-edit"},on:{click:function(a){return t.handleCreate(e.row)}}},[t._v(" 修改 ")]),e.row.status?i("el-button",{attrs:{type:"primary",size:"small",icon:"el-icon-date"},on:{click:function(a){return t.onWork(e.row)}}},[t._v(" 排班 ")]):t._e()]}}])}),i("el-table-column",{attrs:{align:"center",label:"ID",width:"80",prop:"id"}}),i("el-table-column",{attrs:{align:"center",label:"用户名",width:"160",prop:"username"}}),i("el-table-column",{attrs:{align:"center",label:"姓名",width:"160",prop:"name"}}),i("el-table-column",{attrs:{align:"center",label:"手机",width:"160",prop:"mobile"}}),i("el-table-column",{attrs:{"class-name":"status-col",label:"状态",width:"180"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row;return[i("el-switch",{attrs:{"active-text":"启用","active-value":1,"inactive-value":0,"inactive-text":"禁用"},on:{change:function(e){return t.setStatus(a)}},model:{value:a.status,callback:function(e){t.$set(a,"status",e)},expression:"row.status"}})]}}])}),i("el-table-column",{attrs:{width:"180px",align:"center",label:"创建时间"},scopedSlots:t._u([{key:"default",fn:function(e){return[i("span",[t._v(t._s(t._f("parseTime")(e.row.create_time,"{y}-{m}-{d} {h}:{i}")))])]}}])}),i("el-table-column",{attrs:{width:"180px",align:"center",label:"修改时间"},scopedSlots:t._u([{key:"default",fn:function(e){return[i("span",[t._v(t._s(t._f("parseTime")(e.row.update_time,"{y}-{m}-{d} {h}:{i}")))])]}}])})],1),i("pagination",{directives:[{name:"show",rawName:"v-show",value:t.total>0,expression:"total > 0"}],attrs:{total:t.total,page:t.listQuery.page,limit:t.listQuery.limit},on:{"update:page":function(e){return t.$set(t.listQuery,"page",e)},"update:limit":function(e){return t.$set(t.listQuery,"limit",e)},pagination:t.getList}}),i("el-dialog",{attrs:{title:"修改管理员",visible:t.dialogVisible},on:{"update:visible":function(e){t.dialogVisible=e}}},[i("el-form",{attrs:{"label-width":"120px",model:t.item}},[i("el-form-item",{attrs:{label:"用户名"}},[i("el-input",{attrs:{name:"username",placeholder:"管理员的用户名"},model:{value:t.item.username,callback:function(e){t.$set(t.item,"username",e)},expression:"item.username"}})],1),i("el-form-item",{attrs:{label:"姓名"}},[i("el-input",{attrs:{name:"name",placeholder:"管理员的姓名"},model:{value:t.item.name,callback:function(e){t.$set(t.item,"name",e)},expression:"item.name"}})],1),i("el-form-item",{attrs:{label:"手机"}},[i("el-input",{attrs:{name:"name",placeholder:"发送短时的时候会用到这个手机"},model:{value:t.item.mobile,callback:function(e){t.$set(t.item,"mobile",e)},expression:"item.mobile"}})],1),i("el-form-item",{attrs:{label:"微信"}},[i("el-input",{attrs:{name:"wechat",placeholder:"微信号"},model:{value:t.item.wechat,callback:function(e){t.$set(t.item,"wechat",e)},expression:"item.wechat"}})],1),i("el-form-item",{attrs:{label:"微信图片"}},[i("el-upload",{attrs:{action:"","list-type":"picture-card","multiple:false":"","show-file-list":!1,"http-request":t.handlesAvatarSuccess,"on-success":function(e,a,i){return t.handleSuccess(e,a,i,1)}}},[t.item.wechat_pic?i("img",{staticStyle:{width:"120px",height:"120px","margin-top":"14px"},attrs:{src:t.item.wechat_pic}}):t._e(),t.item.wechat_pic?t._e():i("img",{staticStyle:{width:"120px",height:"120px","margin-top":"14px"},attrs:{src:a("a137")}})])],1),i("el-form-item",{attrs:{label:"密码"}},[i("el-input",{attrs:{type:"password",name:"password",placeholder:"管理员的新密码"},model:{value:t.item.password,callback:function(e){t.$set(t.item,"password",e)},expression:"item.password"}})],1),i("el-form-item",{attrs:{label:"是否分配"}},[i("el-switch",{attrs:{"active-text":"分配","active-value":1,"inactive-text":"不分配","inactive-value":0},model:{value:t.item.is_order,callback:function(e){t.$set(t.item,"is_order",e)},expression:"item.is_order"}})],1),i("el-form-item",{attrs:{label:"是否主播"}},[i("el-switch",{attrs:{"active-text":"主播","active-value":1,"inactive-text":"","inactive-value":0},model:{value:t.item.is_anchor,callback:function(e){t.$set(t.item,"is_anchor",e)},expression:"item.is_anchor"}})],1),i("el-form-item",{attrs:{label:"是否加盟商"}},[i("el-switch",{attrs:{"active-text":"加盟商","active-value":1,"inactive-text":"","inactive-value":0},model:{value:t.item.is_franchisee,callback:function(e){t.$set(t.item,"is_franchisee",e)},expression:"item.is_franchisee"}})],1),i("el-form-item",{attrs:{label:"抖音昵称"}},[i("el-input",{attrs:{name:"dy_nickname",placeholder:"抖音昵称"},model:{value:t.item.dy_nickname,callback:function(e){t.$set(t.item,"dy_nickname",e)},expression:"item.dy_nickname"}})],1),i("el-form-item",{attrs:{label:"线路"}},[i("el-select",{attrs:{filterable:"",multiple:"",placeholder:"请选择"},model:{value:t.item.product_ids,callback:function(e){t.$set(t.item,"product_ids",e)},expression:"item.product_ids"}},t._l(t.options,(function(t){return i("el-option",{key:t.id,attrs:{label:t.product_name,value:t.id}})})),1)],1)],1),i("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.onSave(t.item)}}},[t._v("保 存")])],1)],1),i("el-dialog",{attrs:{title:"添加排班",visible:t.dialogWork},on:{"update:visible":function(e){t.dialogWork=e}}},[i("el-form",{attrs:{"label-width":"120px",model:t.from}},[i("el-form-item",{attrs:{label:"上班日期"}},[i("el-date-picker",{staticStyle:{"margin-right":"10px"},attrs:{type:"dates",placeholder:"选择一个或多个日期"},model:{value:t.from.dates,callback:function(e){t.$set(t.from,"dates",e)},expression:"from.dates"}})],1),i("el-form-item",{attrs:{label:"上班时间段"}},[i("el-time-picker",{attrs:{"is-range":"","range-separator":"至","start-placeholder":"开始时间","end-placeholder":"结束时间",placeholder:"选择时间范围"},model:{value:t.from.time,callback:function(e){t.$set(t.from,"time",e)},expression:"from.time"}})],1),i("el-form-item",{attrs:{label:"渠道"}},[i("el-checkbox-group",{model:{value:t.from.oss,callback:function(e){t.$set(t.from,"oss",e)},expression:"from.oss"}},t._l(t.oss,(function(e,a,n){return i("el-checkbox",{key:n,attrs:{label:a}},[t._v(t._s(e))])})),1)],1)],1),i("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.onWork()}}},[t._v("保 存")])],1)],1),i("el-dialog",{attrs:{title:"添加线路",visible:t.isAddRouters,width:"30%"},on:{"update:visible":function(e){t.isAddRouters=e}}},[i("el-form",{ref:"AddRoutersForm",attrs:{rules:t.addRoutes,model:t.AddRoutersForm,"label-width":"80px"}},[i("el-form-item",{attrs:{label:"平台",prop:"os"}},[i("el-select",{attrs:{placeholder:"请选择平台"},model:{value:t.AddRoutersForm.os,callback:function(e){t.$set(t.AddRoutersForm,"os",e)},expression:"AddRoutersForm.os"}},t._l(t.platformList,(function(t){return i("el-option",{attrs:{label:t.os,value:t.id}})})),1)],1),i("el-form-item",{attrs:{label:"线路名称",prop:"product_name"}},[i("el-input",{attrs:{placeholder:"请输入线路名称"},model:{value:t.AddRoutersForm.product_name,callback:function(e){t.$set(t.AddRoutersForm,"product_name",e)},expression:"AddRoutersForm.product_name"}})],1),i("el-form-item",{attrs:{label:"线路id",prop:"third_product_id"}},[i("el-input",{attrs:{placeholder:"请输入线路id"},model:{value:t.AddRoutersForm.third_product_id,callback:function(e){t.$set(t.AddRoutersForm,"third_product_id",e)},expression:"AddRoutersForm.third_product_id"}})],1)],1),i("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{on:{click:function(e){t.isAddRouters=!1}}},[t._v("取 消")]),i("el-button",{attrs:{type:"primary"},on:{click:t.handleAddRouters}},[t._v("确 定")])],1)],1)],1)},n=[],o=a("5530"),r=a("c7eb"),s=a("1da1"),l=(a("99af"),a("a15b"),a("d81d"),a("a9e3"),a("d3b7"),a("8a79"),a("333d")),c=a("50fc"),u=a("5f87"),d={name:"Adminlist",components:{Pagination:l["a"]},data:function(){return{list:[],ids:"",oss:[],platformList:[],isAddRouters:!1,AddRoutersForm:{third_product_id:"",product_name:"",os:""},from:{oss:[]},total:0,listLoading:!0,listQuery:{page:1,limit:20},dialogVisible:!1,dialogWork:!1,item:{btn:[],product_ids:[]},route_type:"",options:[],addRoutes:{third_product_id:[{required:!0,message:"请输入线路id",trigger:"blur"}],os:[{required:!0,message:"请选择平台",trigger:"change"}],product_name:[{required:!0,message:"请输入线路名称",trigger:"blur"}]}}},created:function(){this.getList()},methods:{getList:function(){var t=this;this.$axios.get("/admin/admin/index",{params:this.listQuery}).then((function(e){t.list=e.data.data,t.total=e.data.total,t.oss=e.ext.oss,console.log(t.oss),t.listLoading=!1})).catch((function(t){}))},checkIfUrlContainsImage:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=[".jpg",".jpeg",".png",".gif",".bmp",".svg",".webp"];return e.some((function(e){return t.toLowerCase().endsWith(e)}))},handleAddRoutes:function(){this.isAddRouters=!0},handlesAvatarSuccess:function(t){var e=this;return Object(s["a"])(Object(r["a"])().mark((function a(){var i,n;return Object(r["a"])().wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.prev=0,i=new FormData,i.append("file",t.file),e.upLoading=!0,e,a.next=7,e.$axios.post("/admin/upload/index",i,{headers:{"Content-type":"multipart/form-data","X-Token":Object(u["a"])()}});case 7:n=a.sent,e.item.wechat_pic="".concat(window.location.protocol,"//").concat(window.location.host).concat(n.data),t.onSuccess(n),a.next=15;break;case 12:a.prev=12,a.t0=a["catch"](0),console.error("error:",a.t0);case 15:case"end":return a.stop()}}),a,null,[[0,12]])})))()},handleSuccess:function(t,e,a){console.log(t,e,a),t.data&&(this.item.wechat_pic="".concat(window.location.protocol,"//").concat(window.location.host).concat(t.data))},handleAddRouters:function(){var t=this;this.$refs["AddRoutersForm"].validate(function(){var e=Object(s["a"])(Object(r["a"])().mark((function e(a){var i,n;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!a){e.next=14;break}return e.next=3,Object(c["b"])(t.AddRoutersForm);case 3:if(i=e.sent,t.isAddRouters=!1,"ok"!=i.msg){e.next=12;break}return t.$message({message:"线路添加成功",type:"success"}),e.next=9,Object(c["e"])();case 9:n=e.sent,t.options=n.data.data,t.platformList=n.ext.oss;case 12:e.next=15;break;case 14:return e.abrupt("return",!1);case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())},setStatus:function(t){var e=this;console.log(t),this.$axios.post("/admin/admin/disabled",t).then((function(t){e.$notify({title:"成功",message:"修改成功",type:"success",duration:2e3})})).catch((function(t){e.$notify({title:"成功",message:"修改失败",type:"error",duration:2e3})}))},handleCreate:function(t){var e=this;return Object(s["a"])(Object(r["a"])().mark((function a(){var i;return Object(r["a"])().wrap((function(a){while(1)switch(a.prev=a.next){case 0:return e.dialogVisible=!0,a.next=3,Object(c["e"])();case 3:i=a.sent,e.options=i.data.data,e.platformList=i.ext.oss,e.item=Object(o["a"])({},t),e.item.product_ids=t.product_ids.split(",").map((function(t){return Number(t)}));case 8:case"end":return a.stop()}}),a)})))()},onSave:function(t){var e=this;this.$axios.post("/admin/admin/save",Object(o["a"])(Object(o["a"])({},t),{},{product_ids:t.product_ids.join()})).then((function(t){e.$message({message:"成功",type:"success"}),e.item={},e.dialogVisible=!1,e.getList()})).catch((function(t){}))},onWork:function(t){var e=this;if(t)return this.item=t,this.from={oss:[]},void(this.dialogWork=!0);this.from.admin_id=this.item.id,this.$axios.post("/admin/work/saves",this.from).then((function(t){e.item={},e.dialogWork=!1})).catch((function(t){}))},setTime:function(t){console.log(t)}}},m=d,p=(a("8de5"),a("2877")),f=Object(p["a"])(m,i,n,!1,null,"921c829c",null);e["default"]=f.exports},"2cbf":function(t,e,a){"use strict";a("73e0")},"333d":function(t,e,a){"use strict";var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"pagination-container",class:{hidden:t.hidden}},[a("el-pagination",t._b({attrs:{background:t.background,"current-page":t.currentPage,"page-size":t.pageSize,layout:t.layout,"page-sizes":t.pageSizes,total:t.total},on:{"update:currentPage":function(e){t.currentPage=e},"update:current-page":function(e){t.currentPage=e},"update:pageSize":function(e){t.pageSize=e},"update:page-size":function(e){t.pageSize=e},"size-change":t.handleSizeChange,"current-change":t.handleCurrentChange}},"el-pagination",t.$attrs,!1))],1)},n=[],o=(a("a9e3"),a("09f4")),r={name:"Pagination",props:{total:{required:!0,type:Number},page:{type:Number,default:1},limit:{type:Number,default:20},pageSizes:{type:Array,default:function(){return[10,20,30,50]}},layout:{type:String,default:"total, sizes, prev, pager, next, jumper"},background:{type:Boolean,default:!0},autoScroll:{type:Boolean,default:!0},hidden:{type:Boolean,default:!1}},computed:{currentPage:{get:function(){return this.page},set:function(t){this.$emit("update:page",t)}},pageSize:{get:function(){return this.limit},set:function(t){this.$emit("update:limit",t)}}},methods:{handleSizeChange:function(t){this.$emit("pagination",{page:this.currentPage,limit:t}),this.autoScroll&&Object(o["a"])(0,800)},handleCurrentChange:function(t){this.$emit("pagination",{page:t,limit:this.pageSize}),this.autoScroll&&Object(o["a"])(0,800)}}},s=r,l=(a("2cbf"),a("2877")),c=Object(l["a"])(s,i,n,!1,null,"6af373ef",null);e["a"]=c.exports},"50fc":function(t,e,a){"use strict";a.d(e,"e",(function(){return n})),a.d(e,"b",(function(){return o})),a.d(e,"f",(function(){return r})),a.d(e,"g",(function(){return s})),a.d(e,"d",(function(){return l})),a.d(e,"a",(function(){return c})),a.d(e,"c",(function(){return u})),a.d(e,"i",(function(){return d})),a.d(e,"h",(function(){return m}));a("99af");var i=a("b775");function n(){return Object(i["a"])({url:"admin/products/list",method:"get"})}function o(t){return Object(i["a"])({url:"/admin/products/add",method:"post",data:t})}function r(t){var e,a;return Object(i["a"])({url:"/admin/products/list?page=".concat(t.page,"&limit=").concat(t.limit,"&product_name=").concat(null!==(e=t.product_name)&&void 0!==e?e:"","&third_product_id=").concat(null!==(a=t.third_product_id)&&void 0!==a?a:""),method:"get"})}function s(t){return Object(i["a"])({url:"/admin/products/add",method:"post",data:t})}function l(t){return Object(i["a"])({url:"/admin/products/productschedules?id=".concat(t.id,"&date=").concat(t.date),method:"get"})}function c(t){return Object(i["a"])({url:"/admin/products/addproductschedules",method:"post",data:t})}function u(){return Object(i["a"])({url:"/admin/setting/getContractSetting",method:"get"})}function d(t){return Object(i["a"])({url:"/admin/setting/savecontractsetting",method:"post",data:t})}function m(){return Object(i["a"])({url:"/admin/setting/getContractSetting",method:"get"})}},"73e0":function(t,e,a){},"8a79":function(t,e,a){"use strict";var i=a("23e7"),n=a("06cf").f,o=a("50c4"),r=a("5a34"),s=a("1d80"),l=a("ab13"),c=a("c430"),u="".endsWith,d=Math.min,m=l("endsWith"),p=!c&&!m&&!!function(){var t=n(String.prototype,"endsWith");return t&&!t.writable}();i({target:"String",proto:!0,forced:!p&&!m},{endsWith:function(t){var e=String(s(this));r(t);var a=arguments.length>1?arguments[1]:void 0,i=o(e.length),n=void 0===a?i:d(o(a),i),l=String(t);return u?u.call(e,l,n):e.slice(n-l.length,n)===l}})},"8de5":function(t,e,a){"use strict";a("c2a3")},a137:function(t,e,a){t.exports=a.p+"static/img/wechat.5e3ebdac.png"},c2a3:function(t,e,a){}}]); |