1 line
14 KiB
JavaScript
1 line
14 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-c55f6b90"],{"09f4":function(e,t,a){"use strict";a.d(t,"a",(function(){return o})),Math.easeInOutQuad=function(e,t,a,i){return e/=i/2,e<1?a/2*e*e+t:(e--,-a/2*(e*(e-2)-1)+t)};var i=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}}();function n(e){document.documentElement.scrollTop=e,document.body.parentNode.scrollTop=e,document.body.scrollTop=e}function r(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function o(e,t,a){var o=r(),l=e-o,s=20,c=0;t="undefined"===typeof t?500:t;var u=function e(){c+=s;var r=Math.easeInOutQuad(c,o,l,t);n(r),c<t?i(e):a&&"function"===typeof a&&a()};u()}},"2cbf":function(e,t,a){"use strict";a("73e0")},"333d":function(e,t,a){"use strict";var i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"pagination-container",class:{hidden:e.hidden}},[a("el-pagination",e._b({attrs:{background:e.background,"current-page":e.currentPage,"page-size":e.pageSize,layout:e.layout,"page-sizes":e.pageSizes,total:e.total},on:{"update:currentPage":function(t){e.currentPage=t},"update:current-page":function(t){e.currentPage=t},"update:pageSize":function(t){e.pageSize=t},"update:page-size":function(t){e.pageSize=t},"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}},"el-pagination",e.$attrs,!1))],1)},n=[],r=(a("a9e3"),a("09f4")),o={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(e){this.$emit("update:page",e)}},pageSize:{get:function(){return this.limit},set:function(e){this.$emit("update:limit",e)}}},methods:{handleSizeChange:function(e){this.$emit("pagination",{page:this.currentPage,limit:e}),this.autoScroll&&Object(r["a"])(0,800)},handleCurrentChange:function(e){this.$emit("pagination",{page:e,limit:this.pageSize}),this.autoScroll&&Object(r["a"])(0,800)}}},l=o,s=(a("2cbf"),a("2877")),c=Object(s["a"])(l,i,n,!1,null,"6af373ef",null);t["a"]=c.exports},"50fc":function(e,t,a){"use strict";a.d(t,"e",(function(){return n})),a.d(t,"b",(function(){return r})),a.d(t,"f",(function(){return o})),a.d(t,"g",(function(){return l})),a.d(t,"d",(function(){return s})),a.d(t,"a",(function(){return c})),a.d(t,"c",(function(){return u})),a.d(t,"i",(function(){return d})),a.d(t,"h",(function(){return p}));a("99af");var i=a("b775");function n(){return Object(i["a"])({url:"admin/products/list",method:"get"})}function r(e){return Object(i["a"])({url:"/admin/products/add",method:"post",data:e})}function o(e){var t,a;return Object(i["a"])({url:"/admin/products/list?page=".concat(e.page,"&limit=").concat(e.limit,"&product_name=").concat(null!==(t=e.product_name)&&void 0!==t?t:"","&third_product_id=").concat(null!==(a=e.third_product_id)&&void 0!==a?a:""),method:"get"})}function l(e){return Object(i["a"])({url:"/admin/products/add",method:"post",data:e})}function s(e){return Object(i["a"])({url:"/admin/products/productschedules?id=".concat(e.id,"&date=").concat(e.date),method:"get"})}function c(e){return Object(i["a"])({url:"/admin/products/addproductschedules",method:"post",data:e})}function u(){return Object(i["a"])({url:"/admin/setting/getContractSetting",method:"get"})}function d(e){return Object(i["a"])({url:"/admin/setting/savecontractsetting",method:"post",data:e})}function p(){return Object(i["a"])({url:"/admin/setting/getContractSetting",method:"get"})}},"73e0":function(e,t,a){},ab98:function(e,t,a){},bf50:function(e,t,a){"use strict";a.r(t);var i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"app-container"},[a("div",{staticClass:"filter-container"},[a("el-input",{staticClass:"filter-item",staticStyle:{width:"200px","margin-right":"10px"},attrs:{placeholder:"商品名称"},model:{value:e.listQuery.product_name,callback:function(t){e.$set(e.listQuery,"product_name",t)},expression:"listQuery.product_name"}}),a("el-input",{staticClass:"filter-item",staticStyle:{width:"200px","margin-right":"10px"},attrs:{placeholder:"平台商品ID"},model:{value:e.listQuery.third_product_id,callback:function(t){e.$set(e.listQuery,"third_product_id",t)},expression:"listQuery.third_product_id"}}),a("el-button",{staticClass:"filter-item",attrs:{type:"primary",icon:"el-icon-search"},on:{click:e.getList}},[e._v(" 搜索 ")]),a("el-button",{staticClass:"filter-item",staticStyle:{"margin-left":"10px"},attrs:{type:"primary",icon:"el-icon-circle-plus"},on:{click:function(t){return e.handleCreate("add",[])}}},[e._v(" 新增商品 ")])],1),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],staticStyle:{width:"100%"},attrs:{data:e.list,border:"",fit:"","highlight-current-row":""}},[a("el-table-column",{attrs:{align:"center",label:"操作",width:"200"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{attrs:{type:"primary",size:"small",icon:"el-icon-edit"},on:{click:function(a){return e.handleCreate("edit",t.row)}}},[e._v(" 修改 ")]),t.row.status?a("el-button",{attrs:{type:"primary",size:"small",icon:"el-icon-date"},on:{click:function(a){return e.onWork(t.row.id)}}},[e._v(" 班期 ")]):e._e()]}}])}),a("el-table-column",{attrs:{align:"center",label:"商品名称",prop:"product_name"}}),a("el-table-column",{attrs:{align:"center",label:"所属平台",width:"160",prop:"os_name"}}),a("el-table-column",{attrs:{align:"center",label:"平台商品ID",width:"200",prop:"third_product_id"}}),a("el-table-column",{attrs:{align:"type",label:"境内/境外",width:"100",prop:"type"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",[e._v(e._s(1===t.row.type?"境内":"境外"))])]}}])}),a("el-table-column",{attrs:{align:"type",label:"天数",width:"120",prop:"day"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",[e._v(e._s(t.row.day)+"天"+e._s(t.row.night)+"晚")])]}}])}),a("el-table-column",{attrs:{width:"180px",align:"center",label:"创建时间"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",[e._v(e._s(e._f("parseTime")(t.row.created_at,"{y}-{m}-{d} {h}:{i}")))])]}}])}),a("el-table-column",{attrs:{width:"180px",align:"center",label:"修改时间"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",[e._v(e._s(e._f("parseTime")(t.row.updated_at,"{y}-{m}-{d} {h}:{i}")))])]}}])})],1),a("pagination",{directives:[{name:"show",rawName:"v-show",value:e.total>0,expression:"total > 0"}],attrs:{total:e.total,page:e.listQuery.page,limit:e.listQuery.limit},on:{"update:page":function(t){return e.$set(e.listQuery,"page",t)},"update:limit":function(t){return e.$set(e.listQuery,"limit",t)},pagination:e.getList}}),a("el-dialog",{attrs:{visible:e.dialogVisible,title:e.dialogTitle},on:{"update:visible":function(t){e.dialogVisible=t},open:e.onOpen,close:e.onClose}},[a("el-form",{ref:"elForm",attrs:{model:e.formData,rules:e.rules,size:"medium","label-width":"120px"}},[a("el-form-item",{attrs:{label:"请选择平台",prop:"os"}},[a("el-select",{attrs:{placeholder:"请选择平台",clearable:""},model:{value:e.formData.os,callback:function(t){e.$set(e.formData,"os",t)},expression:"formData.os"}},e._l(e.ossArr,(function(e,t){return a("el-option",{key:e.id,attrs:{label:e.os,value:e.id}})})),1)],1),a("el-form-item",{attrs:{label:"产品名称",prop:"product_name"}},[a("el-input",{attrs:{placeholder:"请输入产品名称",clearable:""},model:{value:e.formData.product_name,callback:function(t){e.$set(e.formData,"product_name",t)},expression:"formData.product_name"}})],1),a("el-form-item",{attrs:{label:"第三方产品编号",prop:"third_product_id"}},[a("el-input",{attrs:{placeholder:"请输入第三方产品编号",clearable:""},model:{value:e.formData.third_product_id,callback:function(t){e.$set(e.formData,"third_product_id",t)},expression:"formData.third_product_id"}})],1),a("el-form-item",{attrs:{label:"天数",prop:"day"}},[a("el-input",{attrs:{placeholder:"请输入天数",clearable:""},model:{value:e.formData.day,callback:function(t){e.$set(e.formData,"day",t)},expression:"formData.day"}})],1),a("el-form-item",{attrs:{label:"晚数",prop:"night"}},[a("el-input",{attrs:{placeholder:"请输入晚数",clearable:""},model:{value:e.formData.night,callback:function(t){e.$set(e.formData,"night",t)},expression:"formData.night"}})],1),a("el-form-item",{attrs:{label:"出游类型",prop:"type"}},[a("el-radio-group",{attrs:{size:"medium"},model:{value:e.formData.type,callback:function(t){e.$set(e.formData,"type",t)},expression:"formData.type"}},e._l(e.fieldTypeOptions,(function(t,i){return a("el-radio",{key:t.value,attrs:{label:t.value}},[e._v(e._s(t.label))])})),1)],1),a("el-form-item",{attrs:{label:"详细行程",prop:"trip_info",required:""}},[a("el-upload",{ref:"field105",attrs:{action:"","before-upload":e.wordBeforeUpload,"http-request":e.handlesAvatarSuccess,"on-success":e.handleWordSuccess,"on-error":e.handleUploadError,"on-remove":e.handleRemove,"on-change":e.handleChange,"before-remove":e.beforeRemove,limit:1,"file-list":e.fieldFileList,accept:".pdf,.docx,.xlsx"}},[a("el-button",{attrs:{size:"small",type:"primary",icon:"el-icon-upload"}},[e._v("点击上传")])],1)],1)],1),a("div",{attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:e.close}},[e._v("取消")]),a("el-button",{attrs:{type:"primary"},on:{click:e.handelConfirm}},[e._v("确定")])],1)],1)],1)},n=[],r=a("c7eb"),o=a("1da1"),l=a("5530"),s=(a("99af"),a("c740"),a("caad"),a("d81d"),a("fb6a"),a("a434"),a("b0c0"),a("333d")),c=a("50fc"),u=a("5f87"),d={name:"ProManagement",components:{Pagination:s["a"]},data:function(){return{listQuery:{page:1,limit:10},total:0,listLoading:!0,list:[],ossArr:[],dialogVisible:!1,dialogTitle:"新增商品",fieldFileList:[],formData:{os:"",product_name:"",type:"",day:"",night:"",third_product_id:"",trip_info:""},fieldAction:"//admin/upload/index",fieldTypeOptions:[{label:"境内",value:1},{label:"境外",value:2}],rules:{os:[{required:!0,message:"请选择平台",trigger:"change"}],product_name:[{required:!0,message:"请输入线路名称",trigger:"blur"}],day:[{required:!0,message:"请输入天数",trigger:"blur"}],night:[{required:!0,message:"请输入晚数",trigger:"blur"}],third_product_id:[{required:!0,message:"请输入第三方产品编号",trigger:"blur"}],type:[{required:!0,message:"请选择出游类型",trigger:"change"}]},editType:""}},created:function(){this.getList()},methods:{handleCreate:function(e,t){this.editType=e,"add"===e?this.AddProduct():this.editProduct(t)},AddProduct:function(){this.dialogTitle="新增商品",this.dialogVisible=!0},editProduct:function(e){console.log(e,"row"),this.formData=Object(l["a"])({},e),this.dialogTitle="编辑商品",this.dialogVisible=!0},getList:function(){var e=this;return Object(o["a"])(Object(r["a"])().mark((function t(){var a;return Object(r["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return console.log("this.listQuery",e.listQuery),t.next=3,Object(c["f"])(e.listQuery);case 3:a=t.sent,0===a.error&&(e.listLoading=!1,e.total=a.data.total,e.list=a.data.data,e.ossArr=a.ext.oss);case 5:case"end":return t.stop()}}),t)})))()},onWork:function(e){this.$router.push("/system/proScheduling?id=".concat(e))},handleChange:function(e,t){this.fileList=t.slice(-1)},handlesAvatarSuccess:function(e){var t=this;return Object(o["a"])(Object(r["a"])().mark((function a(){var i,n,o,l;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",e.file),a.next=5,t.$axios.post("/admin/upload/index",i,{headers:{"Content-type":"multipart/form-data","X-Token":Object(u["a"])()}});case 5:n=a.sent,console.log(n,"收拾收拾"),0===n.error&&e.onSuccess(n),a.next=17;break;case 10:a.prev=10,a.t0=a["catch"](0),console.log(e,"error--handlesAvatarSuccess"),o=e.file.uid,l=t.$refs.field105.uploadFiles.findIndex((function(e){return e.uid===o})),t.$refs.field105.uploadFiles.splice(l,1),t.$message.error("上传失败");case 17:case"end":return a.stop()}}),a,null,[[0,10]])})))()},handleWordSuccess:function(e,t,a,i){console.log(e,t,a,"成功了"),e&&(this.formData.trip_info="".concat(window.location.protocol,"//").concat(window.location.host).concat(e.data),this.fieldFileList=[{name:t.name,uid:t.uid,url:this.formData.trip_info}],this.$message.success("上传成功"))},beforeRemove:function(e,t){return this.$confirm("确定移除 ".concat(e.name,"?"))},handleRemove:function(e,t){var a=this;console.log(e,t,"handleRemove"),this.formData.trip_info="",this.fieldFileList.map((function(t,i){t.uid===e.uid&&a.fieldFileList.splice(i,1)}))},handleUploadError:function(e,t){var a=this;this.$message.error("上传失败: ".concat(t.name)),console.log(this.fieldFileList,"失败了"),this.fieldFileList.map((function(e,i){e.uid===t.uid&&a.fieldFileList.splice(i,1)}))},wordBeforeUpload:function(e){var t=["application/pdf","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"].includes(e.type);return t||this.$message.error("只允许上传 PDF、DOCX、XLSX 格式的文件"),t},openLink:function(e){window.open(e)},onOpen:function(){},onClose:function(){this.$refs["elForm"].resetFields(),this.$refs.field105.uploadFiles=[]},close:function(){console.log("1111",this.$refs.field105.uploadFiles),this.dialogVisible=!1,this.$refs.field105.uploadFiles=[]},handelConfirm:function(){var e=this;this.$refs["elForm"].validate(function(){var t=Object(o["a"])(Object(r["a"])().mark((function t(a){var i;return Object(r["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(a){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,Object(c["g"])(e.formData);case 4:i=t.sent,0===i.error&&(e.getList(),e.$message({message:"add"===e.editType?"商品添加成功":"商品编辑成功",type:"success"})),e.close();case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}}},p=d,f=(a("d24d"),a("2877")),m=Object(f["a"])(p,i,n,!1,null,"26d883ac",null);t["default"]=m.exports},d24d:function(e,t,a){"use strict";a("ab98")}}]); |