TmallWeb-dist/js/channel-taobao-shop-list.A-SNkXis.js
2025-08-12 13:15:23 +08:00

2 lines
14 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{b1 as e,aU as a,ag as t,D as l,r as o,b6 as r,bX as n,be as s,bV as d,c as p,e as i,N as u,bB as c,w as m,l as _,O as h,E as b,m as g,al as y,an as v,bd as w,t as f,n as F,g as k,R as x,bY as q,bZ as D,b0 as C,bu as T}from"./index.6CBafaUJ.js";import{_ as j}from"./index.DoJehMc1.js";import{j as V,k as A,l as I,m as U,n as L,p as E,q as R}from"./service.CFh9MDTf.js";import{m as S,n as z,o as B,j as N}from"./commonOptions.DBWK2JrU.js";import"./el-col.D6-mP02b.js";import"./deposit.Bs9ENqdA.js";import"./merchant.Ctv4LQAR.js";import"./account.DYFHT1i6.js";const O={style:{color:"red"}},G={class:"operate"},K={__name:"channel-taobao-shop-list",props:{channel_id:{type:[Number,String],default:""}},setup(K){const M=e(),P=a(),W=K;let X=[];const Y=[{label:"禁用",value:0},{label:"正常",value:1}];let Z=[],H=[];const J=t({columns:[],tableData:[],searchFields:[{label:"ID",prop:"id",type:"input",value:""},{label:"店铺唯一标识",prop:"shop_unique_code",type:"input",value:""},{label:"接单状态",type:"select",prop:"order_status",value:"",options:Y},{label:"有效状态",type:"select",prop:"status",value:"",options:Y},{prop:"created_at",label:"创建时间",type:"date",dateType:"datetimerange",value:[]},{prop:"updated_at",label:"更新时间",type:"date",dateType:"datetimerange",value:[]}],total:0,page:1,per_page:10,loading:!1,addForm:{title:"新增",fields:[{label:"淘宝登录账户",prop:"name",type:"input",value:""},{label:"店铺唯一标识",prop:"shop_unique_code",type:"input",value:""},{label:"店铺类型",prop:"shop_type",type:"select",options:H},{label:"页面",prop:"page",type:"select",options:Z},{label:"接单金额",prop:"take_order_type",type:"select",options:X,placeholder:"请选择接单金额"},{label:"最小金额",prop:"balance_min",type:"number",placeholder:"请输入最小金额",unshow:!0},{label:"最大金额",prop:"balance_max",type:"number",placeholder:"请输入最大金额",unshow:!0},{label:"固定金额",prop:"amount",type:"input",placeholder:"请输入固定金额,多个以英文逗号隔开",unshow:!0},{label:"备注",prop:"shop_remark",type:"input",value:""},{label:"token",prop:"token",type:"input",value:""},{label:"CK",prop:"cookie",type:"input",value:""},{label:"app链接",prop:"link",type:"password",value:"",htmlTxt:'<div style="color: #e6a23c;">跳转店铺首页这里要写</div><div style="color: #e6a23c;">格式:taobao://店铺特有地址,自己去淘宝看.tmall.com</div>'},{label:"每日收款笔数上限",prop:"daily_limit_count",type:"number",value:"",htmlTxt:'<span style="color: #e6a23c;">每日收款笔数上限0不限)</span>'},{label:"每日收款金额上限",prop:"daily_limit_amount",type:"number",value:"",htmlTxt:'<span style="color: #e6a23c;">每日每日收款金额上限0不限)</span>'}],rules:{shop_unique_code:[{required:!0,message:"请输入店铺唯一标识",trigger:"blur"}],page:[{required:!0,message:"请选择页面",trigger:"blur"}],shop_type:[{required:!0,message:"请选择店铺类型",trigger:"blur"}],take_order_type:[{required:!0,message:"请选择入金规则",trigger:"change"}],balance_min:[{required:!1,message:"请输入最小金额",trigger:"blur"}],balance_max:[{required:!1,message:"请输入最大金额",trigger:"blur"}],amount:[{required:!1,message:"请输入固定金额,多个以英文逗号隔开",trigger:"blur"}]},values:{shop_unique_code:"",link:"",shop_remark:"",token:"",cookie:"",page:0,shop_type:0,daily_limit_count:0,daily_limit_amount:0,channel_id:W.channel_id,amount:"",balance_min:"",balance_max:"",take_order_type:0}},btnLoading:!1,showAddDialog:!1});l(()=>J.addForm.values.take_order_type,e=>{0==e?(J.addForm.fields.forEach(e=>{"balance_min"===e.prop&&(e.unshow=!0),"balance_max"===e.prop&&(e.unshow=!0),"amount"===e.prop&&(e.unshow=!0)}),J.addForm.rules.balance_min[0].required=!1,J.addForm.rules.balance_max[0].required=!1,J.addForm.rules.amount[0].required=!1,J.addForm.values.balance_min="",J.addForm.values.balance_max="",J.addForm.values.amount=""):1==e?(J.addForm.fields.forEach(e=>{"balance_min"===e.prop&&(e.unshow=!1),"balance_max"===e.prop&&(e.unshow=!1),"amount"===e.prop&&(e.unshow=!0)}),J.addForm.rules.balance_min[0].required=!0,J.addForm.rules.balance_max[0].required=!0,J.addForm.rules.amount[0].required=!1,J.addForm.values.amount=""):2==e&&(J.addForm.fields.forEach(e=>{"balance_min"===e.prop&&(e.unshow=!0),"balance_max"===e.prop&&(e.unshow=!0),"amount"===e.prop&&(e.unshow=!1)}),J.addForm.rules.balance_min[0].required=!1,J.addForm.rules.balance_max[0].required=!1,J.addForm.rules.amount[0].required=!0,J.addForm.values.balance_min="",J.addForm.values.balance_max="")},{immediate:!0}),l(()=>W.channel_id,e=>{J.columns=[{prop:"id",label:"ID",width:60,align:"center"},{prop:"service",label:"服务商名称",width:120,align:"center",slot:"service_name_slot"},{prop:"shop_type",label:"店铺类型",width:100,align:"center",slot:"shop_type_slot"},{prop:"shop_remark",label:"店铺备注",width:100,align:"center"},{prop:"name",label:"淘宝登录账户",width:120,align:"center"},{prop:"shop_unique_code",label:"店铺唯一标识",width:120,align:"center"},{prop:"total_count",label:"今日总笔数",width:100,align:"center"},{prop:"success_count",label:"今日成功笔数",width:110,align:"center"},{prop:"total_amount",label:"今日总跑量",width:100,align:"center"},{prop:"total_profit",label:"今日总收益",width:100,align:"center"},{prop:"total_revenue",label:"总收益",width:80,align:"center"},{prop:"success_rate",label:"今日成功率",width:90,align:"center"},{prop:"total_success_rate",label:"成功率",width:80,slot:"success_rate_slot"},{label:"总跑量",prop:"success_volume",align:"center",width:100},{prop:"order_status",label:"接单状态",width:130,align:"center",slot:"order_status_slot"},{prop:"status",label:"有效状态",width:130,align:"center",slot:"status_slot"},{prop:"take_order_type",label:"接单金额",width:120,slot:"take_order_type_slot"},{prop:"balance_min",label:"最小金额",width:120},{prop:"balance_max",label:"最大金额",width:120},{prop:"amount",label:"固定金额",width:120,slot:"amountSolt"},{prop:"created_at",label:"创建时间",width:160,align:"center"},{prop:"updated_at",label:"更新时间",width:160,align:"center"}],e&&J.columns.push({prop:"operate",label:"操作",width:430,align:"center",slot:"operate",fixed:"right"})},{deep:!0,immediate:!0});const Q=(e,a)=>{let t="",l=null;switch(a){case 0:l=H;break;case 1:l=X}return l.some(a=>{if(a.value==e)return t=a.label,!0}),t},$=()=>{J.searchFields.forEach(e=>{"datetimerange"==e.dateType?e.value=[]:e.value=""}),re()},ee=o(null),ae=q(async()=>{ee.value&&ee.value.hasValid&&ee.value.hasValid().validate(e=>{var a;if(e){J.btnLoading=!0,J.addForm.values.channel_id=W.channel_id;let e=(null==(a=J.addForm.values.amount)?void 0:a.length)?[...new Set(J.addForm.values.amount.split(",").map(e=>Number(e)))]:[];J.addForm.values.channel_id=W.channel_id;let t={...J.addForm.values,amount:e};"新增"==J.addForm.title?E(t).then(e=>{re(),J.showAddDialog=!1,J.btnLoading=!1}).catch(()=>{J.btnLoading=!1}):R(t,J.addForm.values.id).then(e=>{J.showAddDialog=!1,J.btnLoading=!1,re()}).catch(()=>{J.btnLoading=!1})}})},300),te=(e,a)=>{let t="status"===a?U:L;J.loading=!0;const l={channel_id:W.channel_id};l[a]=e[a],t(e.id,l).then(e=>{J.loading=!1}).catch(()=>{const t=J.tableData.findIndex(a=>a.id==e.id);-1!==t&&(J.tableData[t][a]=1==e[a]?0:1),J.loading=!1})},le=(e,a)=>{if(1===a)J.addForm={title:"新增",fields:[{label:"淘宝登录账户",prop:"name",type:"input",value:""},{label:"店铺唯一标识",prop:"shop_unique_code",type:"input",value:""},{label:"店铺类型",prop:"shop_type",type:"select",options:H},{label:"页面",prop:"page",type:"select",options:Z},{label:"接单金额",prop:"take_order_type",type:"select",options:X,placeholder:"请选择接单金额"},{label:"最小金额",prop:"balance_min",type:"number",placeholder:"请输入最小金额",unshow:!0},{label:"最大金额",prop:"balance_max",type:"number",placeholder:"请输入最大金额",unshow:!0},{label:"固定金额",prop:"amount",type:"input",placeholder:"请输入固定金额,多个以英文逗号隔开",unshow:!0},{label:"备注",prop:"shop_remark",type:"input",value:""},{label:"token",prop:"token",type:"input",value:""},{label:"CK",prop:"cookie",type:"input",value:""},{label:"app链接",prop:"link",type:"password",value:"",htmlTxt:'<div style="color: #e6a23c;">跳转店铺首页这里要写</div><div style="color: #e6a23c;">格式:taobao://店铺特有地址,自己去淘宝看.tmall.com</div>'},{label:"每日收款笔数上限",prop:"daily_limit_count",type:"number",value:"",htmlTxt:'<span style="color: #e6a23c;">每日收款笔数上限0不限)</span>'},{label:"每日收款金额上限",prop:"daily_limit_amount",type:"number",value:"",htmlTxt:'<span style="color: #e6a23c;">每日每日收款金额上限0不限)</span>'}],rules:{shop_unique_code:[{required:!0,message:"请输入店铺唯一标识",trigger:"blur"}],page:[{required:!0,message:"请选择页面",trigger:"blur"}],shop_type:[{required:!0,message:"请选择店铺类型",trigger:"blur"}],take_order_type:[{required:!0,message:"请选择入金规则",trigger:"change"}],balance_min:[{required:!1,message:"请输入最小金额",trigger:"blur"}],balance_max:[{required:!1,message:"请输入最大金额",trigger:"blur"}],amount:[{required:!1,message:"请输入固定金额,多个以英文逗号隔开",trigger:"blur"}]},values:{shop_unique_code:"",link:"",shop_remark:"",token:"",cookie:"",page:0,shop_type:0,daily_limit_count:0,daily_limit_amount:0,channel_id:W.channel_id,amount:"",balance_min:"",balance_max:"",take_order_type:0}};else{J.addForm.title="修改";const a=J.addForm.fields.findIndex(e=>"shop_unique_code"===e.prop);-1!==a&&(J.addForm.fields[a].disabled=!0),J.addForm.values={...e},J.addForm.values.amount=Array.isArray(null==e?void 0:e.amount)?null==e?void 0:e.amount.join(","):[]}J.showAddDialog=!0};r(()=>{oe(),re()});const oe=()=>{const e=J.addForm.fields.findIndex(e=>"page"===e.prop);-1!==e&&(J.addForm.fields[e].options=Z=S());const a=J.addForm.fields.findIndex(e=>"shop_type"===e.prop);-1!==a&&(J.addForm.fields[a].options=H=z());const t=J.addForm.fields.findIndex(e=>"protocol_type"===e.prop);-1!==t&&(J.addForm.fields[t].options=B());const l=J.addForm.fields.findIndex(e=>"take_order_type"===e.prop);-1!==l&&(J.addForm.fields[l].options=X=N())},re=()=>{var e,a;J.loading=!0;let t={per_page:J.per_page,page:J.page,channel_id:W.channel_id},l=function(e){const a={};return e.forEach(e=>{e.prop&&void 0!==e.value&&(a[e.prop]=e.value)}),a}(J.searchFields);(null==(e=l.created_at)?void 0:e.length)>0&&(l.created_at_start=l.created_at[0]?n(l.created_at[0]):"",l.created_at_end=l.created_at[1]?n(l.created_at[1]):""),(null==(a=l.updated_at)?void 0:a.length)>0&&(l.updated_at_start=l.updated_at[0]?n(l.updated_at[0]):"",l.updated_at_end=l.updated_at[1]?n(l.updated_at[1]):""),delete l.created_at,delete l.updated_at,V(Object.assign(t,l)).then(e=>{J.tableData=e.data,J.total=e.total,J.loading=!1}).catch(()=>{J.loading=!1})};return(e,a)=>{const t=s("Plus"),l=b,o=w,r=v,n=j,q=D,V=d("click-debounce");return i(),p("div",null,[u(n,{type:"export",columns:k(J).columns,searchFields:k(J).searchFields,"onUpdate:searchFields":a[1]||(a[1]=e=>k(J).searchFields=e),data:k(J).tableData,per_page:k(J).per_page,"onUpdate:per_page":a[2]||(a[2]=e=>k(J).per_page=e),page:k(J).page,"onUpdate:page":a[3]||(a[3]=e=>k(J).page=e),total:k(J).total,onGetTableData:re,onResetForm:$,loading:k(J).loading,showSelection:!1,showRightRefreshSlot:!1},c({success_rate_slot:m(({row:e})=>[_("div",O,f(e.total_success_rate),1)]),service_name_slot:m(({row:e})=>{var a;return[_("div",null,f(null==(a=null==e?void 0:e.service)?void 0:a.service_name),1)]}),shop_type_slot:m(({row:e})=>[_("div",null,f(Q(e.shop_type,0)),1)]),take_order_type_slot:m(({row:e})=>[_("span",{class:F(["table-status-color-"+e.take_order_type])},f(Q(e.take_order_type,1)),3)]),amountSolt:m(({row:e})=>[_("div",null,f(Array.isArray(null==e?void 0:e.amount)?null==e?void 0:e.amount.join(","):""),1)]),status_slot:m(({row:e})=>[u(o,{modelValue:e.status,"onUpdate:modelValue":a=>e.status=a,style:{"--el-switch-on-color":"#337ecc"},"active-value":1,"inactive-value":0,"active-text":"正常","inactive-text":"禁用",onChange:a=>te(e,"status")},null,8,["modelValue","onUpdate:modelValue","onChange"])]),order_status_slot:m(({row:e})=>[u(o,{modelValue:e.order_status,"onUpdate:modelValue":a=>e.order_status=a,style:{"--el-switch-on-color":"#337ecc"},"active-value":1,"inactive-value":0,"active-text":"正常","inactive-text":"禁用",onChange:a=>te(e,"order_status")},null,8,["modelValue","onUpdate:modelValue","onChange"])]),_:2},[1==K.channel_id||2==K.channel_id?{name:"btns",fn:m(()=>[_("div",{class:"blue",onClick:a[0]||(a[0]=a=>le(e.row,1))},[u(l,null,{default:m(()=>[u(t)]),_:1}),a[6]||(a[6]=h(" 新增 "))])]),key:"0"}:void 0,1==K.channel_id||2==K.channel_id?{name:"operate",fn:m(({row:e})=>[_("div",G,[u(r,{size:"small",type:"primary",onClick:a=>le(e,2)},{default:m(()=>a[7]||(a[7]=[h(" 编辑 ")])),_:2,__:[7]},1032,["onClick"]),u(r,{size:"small",onClick:a=>(e=>{M.push({name:"payee-channel-management-taobao-recharge",params:e}),P.setpageRechargeInfo(e)})(e)},{default:m(()=>a[8]||(a[8]=[h(" 充值账号 ")])),_:2,__:[8]},1032,["onClick"]),u(r,{type:"warning",size:"small",onClick:a=>(e=>{M.push({name:"payee-channel-management-taobao-goods-list",params:e}),P.setpageGoodsManagementInfo(e)})(e)},{default:m(()=>a[9]||(a[9]=[h(" 商品管理 ")])),_:2,__:[9]},1032,["onClick"]),e.token?(i(),g(r,{key:0,size:"small",type:"success",onClick:a=>(e=>{C.confirm("确认要同步商品吗","系统提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(()=>{A({shop_id:e.id}).then(e=>{T.success("同步商品成功"),re()})})})(e)},{default:m(()=>a[10]||(a[10]=[h(" 同步商品 ")])),_:2,__:[10]},1032,["onClick"])):y("",!0),u(r,{size:"small",type:"danger",onClick:a=>(async e=>{C.confirm("确认要删除吗","系统提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(()=>{I(e.id).then(e=>{T.success("操作成功"),re()})})})(e)},{default:m(()=>a[11]||(a[11]=[h(" 删除 ")])),_:2,__:[11]},1032,["onClick"])])]),key:"1"}:void 0]),1032,["columns","searchFields","data","per_page","page","total","loading"]),u(q,{showDialog:k(J).showAddDialog,"onUpdate:showDialog":a[4]||(a[4]=e=>k(J).showAddDialog=e),formData:k(J).addForm,"onUpdate:formData":a[5]||(a[5]=e=>k(J).addForm=e),ref_key:"addFormRef",ref:ee,labelWidth:"130px"},{submit:m(()=>[x((i(),g(r,{type:"primary",loading:k(J).btnLoading},{default:m(()=>a[12]||(a[12]=[h("确定")])),_:1,__:[12]},8,["loading"])),[[V,k(ae)]])]),_:1},8,["showDialog","formData"])])}}};export{K as default};