import{_ as e}from"./uni-search-bar.48a9b35c.js";import{s as a,M as t,c as s,r as o,D as l,I as r,d as u,e as n,f as i,a as d,g as c,u as p,m,b as f,p as y}from"./index-45b322f7.js";import{_ as g}from"./su-sticky.dcc8e273.js";import{_ as v}from"./uni-load-more.575c3b96.js";import{_ as I}from"./s-layout.940eafb4.js";import{i as b}from"./itemList.bfc32ea9.js";import{_}from"./_plugin-vue_export-helper.1b428a4d.js";import"./uni-icons.c22fa7d9.js";import"./index.f474d5f6.js";const h=_({__name:"biztypeSelect",setup(_){const h=a.$store("order"),x=t({supplierId:"",goodsId:"",currentPageNo:1,pageSize:20,isLastPage:!1,loadStatus:""}),z=s((()=>h.reqInfo.businessTypeId)),P=o([]),j=o(""),k=s((()=>""==j.value?"*":j.value));function S(){L(),T()}function C(){j.value="",L(),T()}function w(e){if(e!=z.value){let a=P.value.find((a=>a.id==e));h.modifyBiztype(a)}a.$router.back()}function T(){return e=this,t=null,s=function*(){x.loadStatus="loading";const e=yield a.$api.baseData.getBiztypeList({number:k.value,name:k.value,billtype_id:BigInt(0x1248350d9d80c800),route:"bd_biztype",pageSize:x.pageSize,pageNo:x.currentPageNo});0==e.errorCode&&(e.data.rows.forEach((e=>e.type="subLevelType")),P.value.push(...e.data.rows),x.isLastPage=e.data.lastPage,e.data.lastPage?x.loadStatus="noMore":x.loadStatus="more")},new Promise(((a,o)=>{var l=e=>{try{u(s.next(e))}catch(a){o(a)}},r=e=>{try{u(s.throw(e))}catch(a){o(a)}},u=e=>e.done?a(e.value):Promise.resolve(e.value).then(l,r);u((s=s.apply(e,t)).next())}));var e,t,s}function L(){x.currentPageNo=1,P.value=[]}return l((e=>{L(),x.materialId=e.materialId,x.bizTypeId=e.bizTypeId,x.supplierId=e.supplierId,x.goodsId=e.goodsId,T()})),r((()=>{x.currentPageNo+=1,T()})),(a,t)=>{const s=d(f("uni-search-bar"),e),o=y,l=d(f("su-sticky"),g),r=d(f("uni-load-more"),v),_=d(f("s-layout"),I);return u(),n(_,null,{default:i((()=>[c(l,{bgColor:"#fff",stickyToTop:!1},{default:i((()=>[c(o,{class:"search-block ss-flex ss-row-center"},{default:i((()=>[c(s,{class:"search-bar",placeholder:"请搜索业务类型编号/名称",onConfirm:S,onCancel:C,modelValue:j.value,"onUpdate:modelValue":t[0]||(t[0]=e=>j.value=e)},null,8,["modelValue"])])),_:1})])),_:1}),c(o,null,{default:i((()=>[c(b,{listData:P.value,selectedItemId:p(z),onClickEntry:w},null,8,["listData","selectedItemId"])])),_:1}),P.value.length>0?(u(),n(r,{key:0,status:x.loadStatus,"content-text":{contentdown:"上拉加载更多"},onClick:a.loadmore},null,8,["status","onClick"])):m("",!0)])),_:1})}}},[["__scopeId","data-v-2adc1540"]]);export{h as default};
