TmallWeb-dist/js/channel-taobao-shop-list.CVyvWxrl.js
2025-07-23 17:43:16 +08:00

2 lines
10 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 p,bN as n,be as s,bW as i,c as d,e as r,N as c,bB as u,w as _,l as m,O as h,E as g,m as b,al as v,an as y,bd as f,t as w,g as k,R as F,bY as x,bZ as D,b0 as C,bu as q}from"./index.BG10Ectv.js";import{_ as T}from"./index.Dav7UILY.js";import{j,s as U,k as V,l as I,p as L}from"./service.DDCNBvvB.js";import{m as A,n as R,o as z}from"./commonOptions.CzpIGj8_.js";import"./el-col.DtmozZ-n.js";import"./deposit.DEOA2mQ7.js";import"./merchant.DpbzK-42.js";import"./account.DmuBvOWj.js";const B={class:"operate"},E={__name:"channel-taobao-shop-list",props:{channel_id:{type:[Number,String],default:""}},setup(E){const N=e(),O=a(),S=E,G=[{label:"禁用",value:0},{label:"正常",value:1}];let K=[],W=[],M=[];const P=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:G},{label:"有效状态",type:"select",prop:"status",value:"",options:G},{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:M},{label:"页面",prop:"page",type:"select",options:W},{label:"协议类型",prop:"protocol_type",type:"select",options:K,value:""},{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"}]},values:{shop_unique_code:"",link:"",shop_remark:"",token:"",cookie:"",page:0,shop_type:0,daily_limit_count:0,daily_limit_amount:0,channel_id:S.channel_id,protocol_type:3}},btnLoading:!1,showAddDialog:!1});l(()=>S.channel_id,e=>{P.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:"success_rate",label:"今日成功率",width:100,align:"center"},{prop:"order_status",label:"接单状态",width:130,align:"center",slot:"order_status_slot"},{prop:"status",label:"有效状态",width:130,align:"center",slot:"status_slot"},{prop:"created_at",label:"创建时间",width:160,align:"center"},{prop:"updated_at",label:"更新时间",width:160,align:"center"}],e&&P.columns.push({prop:"operate",label:"操作",width:430,align:"center",slot:"operate",fixed:"right"})},{deep:!0,immediate:!0});const Y=e=>{let a="";return M.some(t=>{if(t.value==e)return a=t.label,!0}),a},Z=()=>{P.searchFields.forEach(e=>{"datetimerange"==e.dateType?e.value=[]:e.value=""}),$()},H=o(null),J=x(async()=>{H.value&&H.value.hasValid&&H.value.hasValid().validate(e=>{if(e)if(P.btnLoading=!0,P.addForm.values.channel_id=S.channel_id,"新增"==P.addForm.title)I(P.addForm.values).then(e=>{$(),P.showAddDialog=!1,P.btnLoading=!1}).catch(()=>{P.btnLoading=!1});else{P.addForm.values.channel_id=S.channel_id;let e={...P.addForm.values};L(e,P.addForm.values.id).then(e=>{P.showAddDialog=!1,P.btnLoading=!1,$()}).catch(()=>{P.btnLoading=!1})}})},300),Q=(e,a)=>{if(1===a)P.addForm={title:"新增",fields:[{label:"淘宝登录账户",prop:"name",type:"input",value:""},{label:"店铺唯一标识",prop:"shop_unique_code",type:"input",value:""},{label:"店铺类型",prop:"shop_type",type:"select",options:M},{label:"页面",prop:"page",type:"select",options:W},{label:"协议类型",prop:"protocol_type",type:"select",options:K,value:""},{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"}]},values:{shop_unique_code:"",link:"",shop_remark:"",token:"",cookie:"",page:0,shop_type:0,daily_limit_count:0,daily_limit_amount:0,channel_id:S.channel_id,protocol_type:3}};else{P.addForm.title="修改";const a=P.addForm.fields.findIndex(e=>"shop_unique_code"===e.prop);-1!==a&&(P.addForm.fields[a].disabled=!0),P.addForm.values={...e}}P.showAddDialog=!0};p(()=>{X(),$()});const X=()=>{const e=P.addForm.fields.findIndex(e=>"page"===e.prop);-1!==e&&(P.addForm.fields[e].options=W=A());const a=P.addForm.fields.findIndex(e=>"shop_type"===e.prop);-1!==a&&(P.addForm.fields[a].options=M=R());const t=P.addForm.fields.findIndex(e=>"protocol_type"===e.prop);-1!==t&&(P.addForm.fields[t].options=K=z())},$=()=>{var e,a;P.loading=!0;let t={per_page:P.per_page,page:P.page,channel_id:S.channel_id},l=function(e){const a={};return e.forEach(e=>{e.prop&&void 0!==e.value&&(a[e.prop]=e.value)}),a}(P.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,j(Object.assign(t,l)).then(e=>{P.tableData=e.data,P.total=e.total,P.loading=!1}).catch(()=>{P.loading=!1})};return(e,a)=>{const t=s("Plus"),l=g,o=f,p=y,n=T,x=D,j=i("click-debounce");return r(),d("div",null,[c(n,{type:"export",columns:k(P).columns,searchFields:k(P).searchFields,"onUpdate:searchFields":a[1]||(a[1]=e=>k(P).searchFields=e),data:k(P).tableData,per_page:k(P).per_page,"onUpdate:per_page":a[2]||(a[2]=e=>k(P).per_page=e),page:k(P).page,"onUpdate:page":a[3]||(a[3]=e=>k(P).page=e),total:k(P).total,onGetTableData:$,onResetForm:Z,loading:k(P).loading,showSelection:!1,showRightRefreshSlot:!1},u({service_name_slot:_(({row:e})=>{var a;return[m("div",null,w(null==(a=null==e?void 0:e.service)?void 0:a.service_name),1)]}),shop_type_slot:_(({row:e})=>[m("div",null,w(Y(e.shop_type)),1)]),status_slot:_(({row:e})=>[c(o,{modelValue:e.status,"onUpdate:modelValue":a=>e.status=a,disabled:!0,style:{"--el-switch-on-color":"#337ecc"},"active-value":1,"inactive-value":0,"active-text":"正常","inactive-text":"禁用",onChange:e=>{}},null,8,["modelValue","onUpdate:modelValue","onChange"])]),order_status_slot:_(({row:e})=>[c(o,{modelValue:e.order_status,"onUpdate:modelValue":a=>e.order_status=a,disabled:!0,style:{"--el-switch-on-color":"#337ecc"},"active-value":1,"inactive-value":0,"active-text":"正常","inactive-text":"禁用",onChange:e=>{}},null,8,["modelValue","onUpdate:modelValue","onChange"])]),_:2},[1==E.channel_id||2==E.channel_id?{name:"btns",fn:_(()=>[m("div",{class:"blue",onClick:a[0]||(a[0]=a=>Q(e.row,1))},[c(l,null,{default:_(()=>[c(t)]),_:1}),a[6]||(a[6]=h(" 新增 "))])]),key:"0"}:void 0,1==E.channel_id||2==E.channel_id?{name:"operate",fn:_(({row:e})=>[m("div",B,[c(p,{size:"small",type:"primary",onClick:a=>Q(e,2)},{default:_(()=>a[7]||(a[7]=[h(" 编辑 ")])),_:2,__:[7]},1032,["onClick"]),c(p,{size:"small",onClick:a=>(e=>{N.push({name:"payee-channel-management-taobao-recharge",params:e}),O.setpageRechargeInfo(e)})(e)},{default:_(()=>a[8]||(a[8]=[h(" 充值账号 ")])),_:2,__:[8]},1032,["onClick"]),c(p,{type:"warning",size:"small",onClick:a=>(e=>{N.push({name:"payee-channel-management-taobao-goods-list",params:e}),O.setpageGoodsManagementInfo(e)})(e)},{default:_(()=>a[9]||(a[9]=[h(" 商品管理 ")])),_:2,__:[9]},1032,["onClick"]),e.token?(r(),b(p,{key:0,size:"small",type:"success",onClick:a=>(e=>{C.confirm("确认要同步商品吗","系统提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(()=>{U({shop_id:e.id}).then(e=>{q.success("同步商品成功"),$()})})})(e)},{default:_(()=>a[10]||(a[10]=[h(" 同步商品 ")])),_:2,__:[10]},1032,["onClick"])):v("",!0),c(p,{size:"small",type:"danger",onClick:a=>(async e=>{C.confirm("确认要删除吗","系统提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(()=>{V(e.id).then(e=>{q.success("操作成功"),$()})})})(e)},{default:_(()=>a[11]||(a[11]=[h(" 删除 ")])),_:2,__:[11]},1032,["onClick"])])]),key:"1"}:void 0]),1032,["columns","searchFields","data","per_page","page","total","loading"]),c(x,{showDialog:k(P).showAddDialog,"onUpdate:showDialog":a[4]||(a[4]=e=>k(P).showAddDialog=e),formData:k(P).addForm,"onUpdate:formData":a[5]||(a[5]=e=>k(P).addForm=e),ref_key:"addFormRef",ref:H,labelWidth:"130px"},{submit:_(()=>[F((r(),b(p,{type:"primary",loading:k(P).btnLoading},{default:_(()=>a[12]||(a[12]=[h("确定")])),_:1,__:[12]},8,["loading"])),[[j,k(J)]])]),_:1},8,["showDialog","formData"])])}}};export{E as default};