chunk-780c3120.ba701e97.js 18 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-780c3120"],{"206d":function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAAmCAYAAACoPemuAAAAAXNSR0IArs4c6QAAAJ5JREFUWAnt2DEKwDAMA8Ck9Cl9e/Ko9i8uXrUIBQ8eVMhgUEW4Zggdo+jZe7+5iurGXVUUEU9VV/ZclWWVXd6Yqmkxi6kCat5nzGKqgJr3GbOYKqDm256xmbfO6kueqoP5OefXVgw3ezyvtSLXcQG82FbMG4MvRUeLUSIIWAxA6GgxSgQBiwEIHS1GiSBgMQChY1uxsn+weR2mDELgB3FmFp5YffVrAAAAAElFTkSuQmCC"},4091:function(t,e,o){},"5cc6":function(t,e,o){var a=o("74e8");a("Uint8",(function(t){return function(e,o,a){return t(this,e,o,a)}}))},"5d59":function(t,e,o){"use strict";o("a574")},a574:function(t,e,o){},c19f:function(t,e,o){"use strict";var a=o("23e7"),s=o("da84"),l=o("621a"),r=o("2626"),n="ArrayBuffer",i=l[n],c=s[n];a({global:!0,forced:c!==i},{ArrayBuffer:i}),r(n)},cbc3:function(t,e,o){"use strict";var a=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"finish_room"},[o("div",{staticClass:"finish_room2"},[o("div",{staticClass:"img-list"},t._l(t.photo,(function(e,a){return o("div",{key:a,staticClass:"room_img"},[o("img",{directives:[{name:"lazy",rawName:"v-lazy",value:e.url,expression:"item.url"}]}),o("div",{staticClass:"im-button",attrs:{disabled:!t.disabled},on:{click:function(e){return t.deleteImg(a)}}},[o("div",{staticClass:"im-close"}),o("div",{staticClass:"im-close1"})])])})),0),t.photo.length<t.limit?o("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"room_add_img"},[t._m(0),o("input",{attrs:{disabled:t.disabled,type:"file"},on:{change:t.add_img}})]):t._e()])])},s=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("span",{staticStyle:{"margin-top":"35px"}},[a("img",{attrs:{src:o("206d")}})])}],l=(o("a434"),o("c19f"),o("a9e3"),o("d3b7"),o("ac1f"),o("1276"),o("5cc6"),o("9a8c"),o("a975"),o("735e"),o("c1ac"),o("d139"),o("3a7b"),o("d5d6"),o("82f8"),o("e91f"),o("60bd"),o("5f96"),o("3280"),o("3fcc"),o("ca91"),o("25a1"),o("cd26"),o("3c5d"),o("2954"),o("649e"),o("219c"),o("170b"),o("b39a"),o("72f7"),o("bc3a")),r=o.n(l),n={name:"uploadImage",props:{limit:{type:Number,default:function(){return 1}},disabled:{type:Boolean,default:function(){return!1}},isCompress:{type:Boolean,default:function(){return!1}},value:{}},data:function(){return{photo:[],deleteStatus:!1,loading:!1}},watch:{photo:function(){1==this.limit?this.$emit("input",this.photo.length>0?this.photo[0].url:""):this.$emit("input",this.photo)},value:function(){1==this.limit?this.value instanceof Array?this.photo=[]:this.photo=this.value?[{url:this.value}]:[]:this.photo=this.value}},mounted:function(){1==this.limit?this.value instanceof Array?this.photo=[]:this.photo=this.value?[{url:this.value}]:[]:this.value instanceof Array?this.photo=this.value:this.photo=[]},methods:{deleteImg:function(t){this.photo&&this.photo instanceof Array&&this.photo.splice(t,1)},compress:function(t){var e=null,o=document.createElement("canvas"),a=t.height/t.width;o.width=720,o.height=720*a;var s=o.getContext("2d");return s.clearRect(0,0,o.width,o.height),s.drawImage(t,0,0,o.width,o.height),e=o.toDataURL("image/jpeg"),e},dataURItoBlob:function(t){for(var e=window.atob(t.split(",")[1]),o=t.split(",")[0].split(":")[1].split(";")[0],a=new ArrayBuffer(e.length),s=new Uint8Array(a),l=0;l<e.length;l++)s[l]=e.charCodeAt(l);return new window.Blob([a],{type:o})},add_img:function(t){var e=t.target.files[0];if(/\.(gif|jpg|jpeg|png|GIF|JPG|PNG)$/.test(t.target.value)){var o=10485760,a=e.size;if(a>o)return t.target.value="",void this.$notify.error({title:"上传图片错误",message:"上传图片不能超过10M"});this.loading=!0;var s=new FileReader,l=this;s.readAsDataURL(e);var n=new Image;s.onload=function(o){n.src=this.result,n.onload=function(){var a=o.target.result,s=e;l.isCompress&&(a=l.compress(n),s=l.dataURItoBlob(a));var i=new window.FormData;i.append("file",s),r()({method:"POST",url:"/upload/uploadImage",data:i,timeout:1e6,headers:{"Content-Type":"multipart/form-data"}}).then((function(o){console.log(o.data),t.target.value="","undefined"!=typeof l.photo&&""!=l.photo||(l.photo=[]),console.log(l.photo),l.photo.push({fileName:e.fileName,url:o.data.data}),l.loading=!1})).catch((function(e){t.target.value="",l.loading=!1,console.log(e)}))}}}else t.target.value="",this.$notify.error({title:"上传图片错误",message:"请上传gif|jpg|jpeg|png|GIF|JPG|PNG格式图片"})}}},i=n,c=(o("e5ee"),o("2877")),d=Object(c["a"])(i,a,s,!1,null,"2ed5cae0",null);e["a"]=d.exports},e5ee:function(t,e,o){"use strict";o("4091")},f4d7:function(t,e,o){"use strict";o.r(e);var a=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"ele-body"},[o("el-card",{attrs:{shadow:"never"}},[o("el-form",{staticClass:"ele-form-search",attrs:{model:t.table.where,"label-width":"77px"},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.$refs.table.reload()},submit:function(t){t.preventDefault()}}},[o("el-row",{attrs:{gutter:15}},[o("el-col",{attrs:{md:6,sm:12}},[o("el-form-item",{attrs:{label:"关键词:"}},[o("el-input",{attrs:{placeholder:"请输入订单号/用户昵称",clearable:""},model:{value:t.table.where.keyword,callback:function(e){t.$set(t.table.where,"keyword",e)},expression:"table.where.keyword"}})],1)],1),o("el-col",{attrs:{md:6,sm:12}},[o("el-form-item",{attrs:{label:"状态:"}},[o("el-select",{staticClass:"ele-fluid",attrs:{placeholder:"请选择状态",clearable:""},model:{value:t.table.where.status,callback:function(e){t.$set(t.table.where,"status",e)},expression:"table.where.status"}},[o("el-option",{attrs:{label:"全部",value:"0"}}),o("el-option",{attrs:{label:"待支付",value:"1"}}),o("el-option",{attrs:{label:"已支付",value:"2"}})],1)],1)],1),o("el-col",{attrs:{md:6,sm:12}},[o("div",{staticClass:"ele-form-actions"},[o("el-button",{staticClass:"ele-btn-icon",attrs:{type:"primary",icon:"el-icon-search"},on:{click:function(e){return t.$refs.table.reload()}}},[t._v("查询 ")]),o("el-button",{on:{click:function(e){(t.table.where={})&&t.$refs.table.reload()}}},[t._v("重置")])],1)])],1)],1),o("div",{staticClass:"ele-table-tool ele-table-tool-default"},[t.permission.includes("sys:orders:add")?o("el-button",{staticClass:"ele-btn-icon",attrs:{type:"primary",icon:"el-icon-plus",size:"small"},on:{click:function(e){t.showEdit=!0}}},[t._v("添加 ")]):t._e(),t.permission.includes("sys:orders:dall")?o("el-button",{staticClass:"ele-btn-icon",attrs:{type:"danger",icon:"el-icon-delete",size:"small"},on:{click:function(e){return t.remove()}}},[t._v("批量删除 ")]):t._e(),t.permission.includes("sys:orders:export")?o("el-button",{staticClass:"ele-btn-icon",attrs:{icon:"el-icon-download",type:"success"},on:{click:t.exportData}},[t._v("导出")]):t._e()],1),o("ele-data-table",{ref:"table",attrs:{config:t.table,choose:t.choose,height:"calc(100vh - 315px)","highlight-current-row":""},on:{"update:choose":function(e){t.choose=e}},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.index;return[o("el-table-column",{attrs:{type:"selection",width:"45",align:"center",fixed:"left"}}),o("el-table-column",{attrs:{type:"index",index:a,label:"编号",width:"60",align:"center",fixed:"left","show-overflow-tooltip":""}}),o("el-table-column",{attrs:{label:"商品","min-width":"150"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row;return[o("el-avatar",{attrs:{shape:"square",size:35,src:a.fx_thumb}}),o("span",{staticClass:"row_text",domProps:{textContent:t._s(a.fx_name)}})]}}],null,!0)}),o("el-table-column",{attrs:{prop:"nickname",label:"用户","show-overflow-tooltip":"",align:"center","min-width":"100"}}),o("el-table-column",{attrs:{prop:"order_sn",label:"订单编号","show-overflow-tooltip":"",align:"center","min-width":"200"}}),o("el-table-column",{attrs:{prop:"device_num",label:"灯号","show-overflow-tooltip":"",align:"center","min-width":"100"}}),o("el-table-column",{attrs:{prop:"buy_type",label:"购买类型","show-overflow-tooltip":"",align:"center","min-width":"100"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row;return[1==a.buy_type?o("span",[t._v("购买")]):t._e(),2==a.buy_type?o("span",[t._v("续费")]):t._e()]}}],null,!0)}),o("el-table-column",{attrs:{prop:"num",label:"数量/天","show-overflow-tooltip":"",align:"center","min-width":"80"},scopedSlots:t._u([{key:"default",fn:function(e){var o=e.row;return[t._v(" "+t._s(o.num)+"天 ")]}}],null,!0)}),o("el-table-column",{attrs:{prop:"total",label:"总价","show-overflow-tooltip":"",align:"center","min-width":"100"}}),o("el-table-column",{attrs:{prop:"pay_money",label:"实付金额","show-overflow-tooltip":"",align:"center","min-width":"100"}}),o("el-table-column",{attrs:{prop:"lamp_status",label:"灯状态",resizable:!1,align:"center","min-width":"100"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row;return[1==a.lamp_status?o("span",[t._v("未开启")]):t._e(),2==a.lamp_status?o("span",[t._v("已开启")]):t._e()]}}],null,!0)}),o("el-table-column",{attrs:{prop:"status",label:"状态",resizable:!1,align:"center","min-width":"100"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row;return[1==a.status?o("span",[t._v("待支付")]):t._e(),2==a.status?o("span",[t._v("已支付")]):t._e(),3==a.status?o("span",[t._v("已取消")]):t._e()]}}],null,!0)}),o("el-table-column",{attrs:{prop:"sf_name",label:"收福人","show-overflow-tooltip":"",align:"center","min-width":"120"}}),o("el-table-column",{attrs:{label:"创建时间",sortable:"custom","show-overflow-tooltip":"",align:"center","min-width":"160"},scopedSlots:t._u([{key:"default",fn:function(e){var o=e.row;return[t._v(t._s(t._f("toDateString")(o.create_time)))]}}],null,!0)}),o("el-table-column",{attrs:{label:"支付时间",sortable:"custom","show-overflow-tooltip":"",align:"center","min-width":"160"},scopedSlots:t._u([{key:"default",fn:function(e){var o=e.row;return[t._v(t._s(o.pay_at))]}}],null,!0)}),o("el-table-column",{attrs:{label:"到期时间",sortable:"custom","show-overflow-tooltip":"",align:"center","min-width":"160"},scopedSlots:t._u([{key:"default",fn:function(e){var o=e.row;return[t._v(t._s(o.expire_at))]}}],null,!0)}),o("el-table-column",{attrs:{prop:"trade_no",label:"交易单号","show-overflow-tooltip":"",align:"center","min-width":"180"}}),o("el-table-column",{attrs:{prop:"remark",label:"备注","show-overflow-tooltip":"",align:"center","min-width":"200"}}),o("el-table-column",{attrs:{label:"操作",width:"130px",align:"center",resizable:!1,fixed:"right"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row;return[t.permission.includes("sys:orders:edit")?o("el-link",{attrs:{icon:"el-icon-edit",type:"primary",underline:!1},on:{click:function(e){return t.edit(a)}}},[t._v("详情")]):t._e(),o("el-popconfirm",{staticClass:"ele-action",attrs:{title:"确定要删除此订单信息吗?"},on:{confirm:function(e){return t.remove(a)}}},[t.permission.includes("sys:orders:delete")?o("el-link",{attrs:{slot:"reference",icon:"el-icon-delete",type:"danger",underline:!1},slot:"reference"},[t._v("删除")]):t._e()],1)]}}],null,!0)})]}}])})],1),o("el-dialog",{attrs:{title:(t.editForm.id,"修改订单信息"),visible:t.showEdit,width:"600px","destroy-on-close":!0,"custom-class":"ele-dialog-form","lock-scroll":!1},on:{"update:visible":function(e){t.showEdit=e},closed:function(e){t.editForm={}}}},[o("el-form",{ref:"editForm",attrs:{model:t.editForm,rules:t.editRules,"label-width":"110px"}},[o("el-form-item",{attrs:{label:"佛像图片:",visible:t.showEdit},on:{"update:visible":function(e){t.showEdit=e}}},[o("uploadImage",{attrs:{limit:1,disabled:!0},model:{value:t.editForm.fx_thumb,callback:function(e){t.$set(t.editForm,"fx_thumb",e)},expression:"editForm.fx_thumb"}})],1),o("el-row",{attrs:{gutter:15}},[o("el-col",{attrs:{sm:24}},[o("el-col",{attrs:{sm:24}},[o("el-form-item",{attrs:{label:"购买用户:",prop:"nickname"}},[o("span",{domProps:{textContent:t._s(t.editForm.nickname)}})]),o("el-form-item",{attrs:{label:"佛像名称:",prop:"fx_name"}},[o("span",{domProps:{textContent:t._s(t.editForm.fx_name)}})]),o("el-form-item",{attrs:{label:"订单编号:",prop:"order_sn"}},[o("span",{domProps:{textContent:t._s(t.editForm.order_sn)}})]),o("el-form-item",{attrs:{label:"交易单号:",prop:"trade_no"}},[o("span",{domProps:{textContent:t._s(t.editForm.trade_no)}})]),o("el-form-item",{attrs:{label:"灯号:",prop:"device_num"}},[o("span",{domProps:{textContent:t._s(t.editForm.device_num)}}),t._v("号 ")]),o("el-form-item",{attrs:{label:"购买数量:",prop:"num"}},[o("span",{domProps:{textContent:t._s(t.editForm.num)}}),t._v("天 ")]),o("el-form-item",{attrs:{label:"购买总价:",prop:"total"}},[o("span",{domProps:{textContent:t._s(t.editForm.total)}})]),o("el-form-item",{attrs:{label:"实付金额:",prop:"pay_money"}},[o("span",{domProps:{textContent:t._s(t.editForm.pay_money)}})]),o("el-form-item",{attrs:{label:"下单时间:",prop:"create_time"}},[o("span",{domProps:{textContent:t._s(t.editForm.create_time)}})]),o("el-form-item",{attrs:{label:"支付时间:",prop:"pay_at"}},[o("span",{domProps:{textContent:t._s(t.editForm.pay_at)}})]),o("el-form-item",{attrs:{label:"到期时间:",prop:"pay_at"}},[o("span",{domProps:{textContent:t._s(t.editForm.expire_at)}})]),o("el-form-item",{attrs:{label:"收福人:",prop:"sf_name"}},[o("span",{domProps:{textContent:t._s(t.editForm.sf_name)}})]),o("el-form-item",{attrs:{label:"祈福内容:",prop:"qf_content"}},[o("span",{domProps:{textContent:t._s(t.editForm.qf_content)}})]),o("el-form-item",{attrs:{label:"订单备注:",prop:"remark"}},[o("span",{domProps:{textContent:t._s(t.editForm.remark)}})]),o("el-form-item",{attrs:{label:"灯状态:",prop:"lamp_status"}},[1==t.editForm.lamp_status?o("span",[t._v("未开启")]):t._e(),2==t.editForm.lamp_status?o("span",[t._v("已开启")]):t._e()]),o("el-form-item",{attrs:{label:"订单状态:",prop:"status"}},[1==t.editForm.status?o("span",[t._v("待支付")]):t._e(),2==t.editForm.status?o("span",[t._v("已支付")]):t._e(),3==t.editForm.status?o("span",[t._v("已取消")]):t._e()])],1)],1)],1)],1),o("div",{attrs:{slot:"footer"},slot:"footer"},[o("el-button",{on:{click:function(e){t.showEdit=!1}}},[t._v("取消")]),o("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.send()}}},[t._v("发货")])],1)],1)],1)},s=[],l=(o("4160"),o("d81d"),o("159b"),o("5530")),r=o("1146"),n=o.n(r),i=o("2f62"),c=o("cbc3"),d={name:"SysOrdersOnline",components:{uploadImage:c["a"]},data:function(){return{table:{url:"/gdorders/index",where:{status:"0"},page:{page:1,limit:30}},choose:[],showEdit:!1,editForm:{id:0,status:1,form:1,thumb:{},albums:[],title:""},express:[],editRules:{status:[{required:!0,message:"请选择发布状态",trigger:"blur"}]}}},computed:Object(l["a"])(Object(l["a"])({},Object(i["b"])(["permission"])),{},{editContent:function(){return{menubar:!1,file_picker_callback:this.file_picker_callback,skin_url:"dark"===this.$store.state.theme.theme?"/tinymce/skins/ui/oxide-dark":"/tinymce/skins/ui/oxide",content_css:"dark"===this.$store.state.theme.theme?"/tinymce/skins/content/dark/content.css":"/tinymce/skins/content/default/content.css"}}}),mounted:function(){},methods:{edit:function(t){this.editForm=Object.assign({},t),this.editForm.albums||(this.editForm.albums=[]),this.showEdit=!0},save:function(){var t=this;this.$refs["editForm"].validate((function(e){if(!e)return!1;var o=t.$loading({lock:!0});t.$http.post("/gdorders/edit",t.editForm).then((function(e){o.close(),0===e.data.code?(t.showEdit=!1,t.$message({type:"success",message:e.data.msg}),t.$refs.table.reload()):t.$message.error(e.data.msg)})).catch((function(e){o.close(),t.$message.error(e.message)}))}))},remove:function(t){var e=this;if(t){var o=this.$loading({lock:!0});this.$http.post("/gdorders/delete",{id:t.id}).then((function(t){o.close(),0===t.data.code?(e.$message({type:"success",message:t.data.msg}),e.$refs.table.reload()):e.$message.error(t.data.msg)})).catch((function(t){o.close(),e.$message.error(t.message)}))}else{if(0===this.choose.length)return this.$message.error("请至少选择一条数据");var a=this.choose.map((function(t){return t.id}));this.$confirm("确定要删除选中的信息吗?","提示",{type:"warning"}).then((function(){var t=e.$loading({lock:!0});e.$http.post("/gdorders/delete",{id:a}).then((function(o){t.close(),0===o.data.code?(e.$message({type:"success",message:o.data.msg}),e.$refs.table.reload()):e.$message.error(o.data.msg)})).catch((function(o){t.close(),e.$message.error(o.message)}))})).catch((function(){return 0}))}},exportData:function(){var t=this,e=[["商品","订单号","交易单号","灯号","购买类型","收福人","祈福内容","数量","订单金额","实付金额","支付时间","到期时间","灯状态","状态"]],o=this.$loading({lock:!0});this.table.where.page=this.table.where.page?this.table.where.page:1,this.table.where.limit=this.table.where.limit?this.table.where.limit:50,this.$http.get("/gdorders/index?page="+this.table.where.page+"&limit="+this.table.where.limit+"&status="+this.table.where.status).then((function(a){if(o.close(),0===a.data.code){a.data.data.forEach((function(t){e.push([t.fx_name,t.order_sn,t.trade_no,t.device_num?t.device_num+"号":"",["","购买","续费"][t.buy_type],t.sf_name,t.qf_content,t.num,t.total,t.pay_money,t.pay_at,t.expire_at,["","未开启","已开启"][t.lamp_status],["","待支付","已支付","已取消"][t.status]])}));var s=n.a.utils.aoa_to_sheet(e);t.$util.exportSheet(n.a,s,"线上供灯订单")}else t.$message.error(a.data.msg)})).catch((function(e){o.close(),t.$message.error(e.message)}))},editStatus:function(t){var e=this,o=this.$loading({lock:!0}),a=Object.assign({},t);this.$http.post("/gdorders/status",a).then((function(a){o.close(),0===a.data.code?e.$message({type:"success",message:a.data.msg}):(t.status=t.status?1:2,e.$message.error(a.data.msg))})).catch((function(t){o.close(),e.$message.error(t.message)}))}}},u=d,m=(o("5d59"),o("2877")),p=Object(m["a"])(u,a,s,!1,null,"c09ff05e",null);e["default"]=p.exports}}]);