"use strict";(self["webpackChunkscui"]=self["webpackChunkscui"]||[]).push([[8250],{53381:function(e,t,s){s.r(t),s.d(t,{default:function(){return f}});var a=s(66252),l=s(3577);const o=e=>((0,a.dD)("data-v-5bb10ced"),e=e(),(0,a.Cn)(),e),i={class:"left-panel"},c={class:"right-panel-search"},u=(0,a.Uk)("保存配置"),n=o((()=>(0,a._)("div",{class:"right-panel"},null,-1))),r={key:0},d=["onClick"],m=(0,a.Uk)("删除配置");function p(e,t,s,o,p,h){const w=(0,a.up)("scSearch"),_=(0,a.up)("el-input"),f=(0,a.up)("el-button"),b=(0,a.up)("el-header"),g=(0,a.up)("sc-icon-edit"),v=(0,a.up)("el-icon"),y=(0,a.up)("el-table-column"),z=(0,a.up)("el-switch"),$=(0,a.up)("el-dropdown-item"),W=(0,a.up)("el-dropdown-menu"),k=(0,a.up)("el-dropdown"),C=(0,a.up)("scTable"),V=(0,a.up)("el-main"),D=(0,a.up)("el-container");return(0,a.wg)(),(0,a.j4)(D,{class:"mainBox"},{default:(0,a.w5)((()=>[(0,a.Wm)(b,null,{default:(0,a.w5)((()=>[(0,a._)("div",i,[(0,a.Wm)(w,{ref:"scSearch",searchList:p.searchList,onFetchSelectData:h.getSelectData},null,8,["searchList","onFetchSelectData"]),(0,a._)("div",c,[(0,a.Wm)(_,{size:p.size,modelValue:p.params.customer_name,"onUpdate:modelValue":t[0]||(t[0]=e=>p.params.customer_name=e),placeholder:"公司名称",clearable:""},null,8,["size","modelValue"]),(0,a.Wm)(f,{size:p.size,type:"primary",onClick:h.save},{default:(0,a.w5)((()=>[u])),_:1},8,["size","onClick"])])]),n])),_:1}),(0,a.Wm)(V,{class:"nopadding"},{default:(0,a.w5)((()=>[(0,a.Wm)(C,{ref:"table",apiObj:p.list.apiObj,column:p.list.column,params:p.tableParams,stripe:"",border:"",size:p.size,highlightCurrentRow:"",hideDo:""},{default:(0,a.w5)((()=>[(0,a.Wm)(y,{width:"380",label:"客户名称",prop:"customer_name"},{default:(0,a.w5)((e=>[e.row.$edit_show?((0,a.wg)(),(0,a.iD)("div",r,[(0,a.Wm)(_,{type:"text",size:p.size,modelValue:e.row.customer_name,"onUpdate:modelValue":t=>e.row.customer_name=t,onChange:t=>h.customerInput(e.row),onMouseout:t=>h.customerOut(e.row)},null,8,["size","modelValue","onUpdate:modelValue","onChange","onMouseout"])])):((0,a.wg)(),(0,a.iD)("span",{key:1,class:"customerView",onClick:t=>h.customerEdit(e.row)},[(0,a.Uk)((0,l.toDisplayString)(e.row.customer_name)+" ",1),(0,a.Wm)(v,{class:"iconBtn"},{default:(0,a.w5)((()=>[(0,a.Wm)(g)])),_:1})],8,d))])),_:1}),(0,a.Wm)(y,{width:"100",label:"状态",prop:"active_status"},{default:(0,a.w5)((e=>[(0,a.Wm)(z,{size:p.size,modelValue:e.row.active_status,"onUpdate:modelValue":t=>e.row.active_status=t,onChange:t=>h.changeSwitch(t,e.row),loading:e.row.$switch_status,"active-value":!0,"inactive-value":!1},null,8,["size","modelValue","onUpdate:modelValue","onChange","loading"])])),_:1}),(0,a.Wm)(y,{label:"操作",fixed:"right",align:"center",width:"160"},{default:(0,a.w5)((e=>[(0,a.Wm)(k,null,{dropdown:(0,a.w5)((()=>[(0,a.Wm)(W,null,{default:(0,a.w5)((()=>[(0,a.Wm)($,{onClick:t=>h.table_del(e.row,"delete"),icon:"sc-icon-Delete"},{default:(0,a.w5)((()=>[m])),_:2},1032,["onClick"])])),_:2},1024)])),default:(0,a.w5)((()=>[(0,a.Wm)(f,{class:"noBorderBtn",icon:"el-icon-more",size:p.size},null,8,["size"])])),_:2},1024)])),_:1})])),_:1},8,["apiObj","column","params","size"])])),_:1})])),_:1})}var h={name:"",data(){return{size:"small",list:{apiObj:this.$API.setup.customer.list,column:[]},params:{keyword:"",sys_type:1},tableParams:{sys_type:1},searchList:[{customer_name:"客户名称",type:"text",code:"customer_name",placeholder:"请输入客户名称",show:!0}]}},mounted(){},methods:{getSelectData(e){let{params:t}=e;this.params=t},changeSwitch(e,t){t.$switch_yx=!0,setTimeout((async()=>{let e={id:t.id,active_status:t.active_status};const s=await this.$API.setup.customer.status.post(e);200!=s.code&&(t.active_status=!t.active_status),delete t.$switch_status,delete t.$switch_yx}),500)},customerEdit(e){e.$edit_show=!e.$edit_show},customerOut(e){setTimeout((()=>{e.$edit_show=!1}),1e3)},async customerInput(e){let t={id:e.id,customer_name:e.customer_name};const s=await this.$API.setup.customer.add.post(t);200==s.code&&this.$refs.table.refresh()},async save(){const e=await this.$API.setup.customer.add.post(this.params);200==e.code&&this.$refs.table.refresh()},async table_del(e){this.$confirm(`确定删除 ${e.customer_name} 吗？`,"提示",{type:"warning"}).then((async()=>{const t={id:e.id},s=await this.$API.setup.customer.delete.post(t);200==s.code&&(this.$refs.table.refresh(),this.$message.success("删除成功"))})).catch((()=>{}))}}},w=s(83744);const _=(0,w.Z)(h,[["render",p],["__scopeId","data-v-5bb10ced"]]);var f=_}}]);