| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590 |
- <template>
- <div class="app-container">
- <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
- <el-form-item label="公司名" prop="companyId">
- <el-select filterable v-model="companyIds" placeholder="请选择公司名" multiple @change="companyChange" clearable size="small">
- <el-option
- v-for="item in companys"
- :key="item.companyId"
- :label="item.companyName"
- :value="item.companyId"
- />
- </el-select>
- </el-form-item>
- <el-form-item v-if="deptOpen">
- <treeselect style="width: 220px" :clearable="false" v-model="queryParams.deptId" :options="deptOptions" clearable :show-count="true" placeholder="请选择归属部门" />
- </el-form-item>
- <el-form-item label="会员ID" prop="userId">
- <el-input
- v-model="queryParams.userId"
- placeholder="请输入会员ID"
- clearable
- size="small"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item label="店铺" prop="storeId">
- <el-select v-model="queryParams.storeId" placeholder="店铺" clearable size="small" filterable>
- <el-option
- v-for="dict in storeOPtions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="订单号" prop="orderCodes">
- <div class="tag-input-container">
- <!-- 标签显示区域 -->
- <div class="tags-wrapper" @click="focusInput">
- <!-- 已添加的订单号标签 -->
- <el-tag
- v-for="(code, index) in queryParams.orderCodes"
- :key="index"
- closable
- size="small"
- @close="removeOrderCode(index)"
- class="order-tag"
- :class="{ 'tag-error': false }"
- >
- {{ code }}
- </el-tag>
-
- <!-- 输入框 -->
- <el-input
- ref="tagInput"
- v-model="currentInput"
- v-show="inputVisible || queryParams.orderCodes.length === 0"
- :placeholder="queryParams.orderCodes.length === 0 ? '请输入订单号,按回车或逗号分隔' : '继续输入...'"
- size="small"
- class="tag-input"
- @keydown.native="handleKeyDown"
- @keyup.native="handleKeyUp"
- @blur="handleInputConfirm"
- @focus="inputVisible = true"
- clearable
- />
-
- <!-- 添加按钮(当没有输入时显示) -->
- <el-button
- v-if="!inputVisible && queryParams.orderCodes.length > 0"
- class="button-new-tag"
- size="small"
- @click="showInput"
- icon="el-icon-plus"
- type="text"
- >
- 添加订单号
- </el-button>
- </div>
-
- <!-- 输入提示 -->
- <div class="input-tips">
- <span class="tip-text">
- 支持:回车、逗号、空格分隔 |
- 已添加 {{ queryParams.orderCodes.length }} 个订单号
- <span v-if="maxOrderCodes > 0"> (最多{{ maxOrderCodes }}个)</span>
- </span>
- </div>
- </div>
- </el-form-item>
- <el-form-item label="快递单号" prop="deliverySn">
- <el-input
- v-model="queryParams.deliverySn"
- placeholder="请输入快递单号"
- clearable
- size="small"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item label="处方单号" prop="prescribeCode">
- <el-input
- v-model="queryParams.prescribeCode"
- placeholder="请输入处方单号"
- clearable
- size="small"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item label="支付方式" prop="payType">
- <el-select multiple v-model="payTypeArr" placeholder="请选择支付方式" clearable filterable size="small" >
- <el-option
- v-for="item in PayOptions"
- :key="'type'+item.dictValue"
- :label="item.dictLabel"
- :value="item.dictValue"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="员工姓名" prop="companyUserNickName">
- <el-input
- v-model="queryParams.companyUserNickName"
- placeholder="请输入员工姓名"
- clearable
- size="small"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item label="套餐名称" prop="packageName">
- <el-input
- v-model="queryParams.packageName"
- placeholder="请输套餐名称"
- clearable
- size="small"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item label="套餐别名" prop="packageSecondName">
- <el-input
- v-model="queryParams.packageSecondName"
- placeholder="请输套餐别名"
- clearable
- size="small"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item label="收货人" prop="userName">
- <el-input
- v-model="queryParams.userName"
- placeholder="请输入收货人"
- clearable
- size="small"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item label="电话" prop="userPhone">
- <el-input
- v-model="queryParams.userPhone"
- placeholder="请输入收货人电话"
- clearable
- size="small"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item label="加密号码" prop="userPhoneMk">
- <el-input
- v-model="queryParams.userPhoneMk"
- placeholder="请输入收货人电话"
- clearable
- size="small"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item label="医生姓名" prop="doctorName">
- <el-input
- v-model="queryParams.doctorName"
- placeholder="请输入医生姓名"
- clearable
- size="small"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item label="患者姓名" prop="patientName">
- <el-input
- v-model="queryParams.patientName"
- placeholder="请输入患者姓名"
- clearable
- size="small"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item label="物流状态" prop="deliveryStatus">
- <el-select v-model="queryParams.deliveryStatus" placeholder="请选择物流状态" clearable size="small" >
- <el-option
- v-for="item in deliveryStatusOptions"
- :key="item.dictValue"
- :label="item.dictLabel"
- :value="item.dictValue"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="结算状态" prop="deliveryPayStatus">
- <el-select style="width: 200px" v-model="queryParams.deliveryPayStatus" placeholder="请选择物流结算状态" clearable size="small" >
- <el-option
- v-for="item in deliveryPayStatusOptions"
- :key="item.dictValue"
- :label="item.dictLabel"
- :value="item.dictValue"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="订单类型" prop="orderType">
- <el-select filterable v-model="queryParams.orderType" placeholder="状态" clearable size="small">
- <el-option
- v-for="dict in orderTypeOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- />
- </el-select>
- </el-form-item>
-
- <el-form-item label="是否首次进线" prop="isFirst">
- <el-select filterable v-model="queryParams.isFirst" placeholder="状态" clearable size="small">
- <el-option
- v-for="dict in orOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="档期归属" prop="scheduleId" >
- <el-select multiple filterable style="width: 200px" v-model="scheduleIdArr" placeholder="请选择档期" clearable size="small" >
- <el-option
- v-for="item in scheduleOptions"
- :key="'scheduleId'+item.id"
- :label="item.name"
- :value="item.id"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="订单购买类型" prop="orderBuyType">
- <el-select multiple filterable style="width: 200px" v-model="buyTypeArr" placeholder="请选择购买类型" clearable size="small" >
- <el-option
- v-for="item in orderBuyTypeOptions"
- :key="'bugType'+item.dictValue"
- :label="item.dictLabel"
- :value="item.dictValue"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="渠道" prop="channel">
- <el-select multiple filterable style="width: 200px" v-model="channelArr" placeholder="请选择渠道" clearable size="small" >
- <el-option
- v-for="item in channelOptions"
- :key="'channel'+item.dictValue"
- :label="item.dictLabel"
- :value="item.dictValue"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="企微主体" prop="qwSubject">
- <el-select multiple filterable style="width: 200px" v-model="qwSubjectArr" placeholder="请选择企微主体" clearable size="small" >
- <el-option
- v-for="item in qwSubjectOptions"
- :key="'qwSubject'+item.dictValue"
- :label="item.dictLabel"
- :value="item.dictValue"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="推广佣金状态" prop="tuiMoneyStatus">
- <el-select filterable style="width: 200px" v-model="queryParams.tuiMoneyStatus" placeholder="请选择推广佣金状态" clearable size="small" >
- <el-option
- v-for="item in tuiOptions"
- :key="item.dictValue"
- :label="item.dictLabel"
- :value="item.dictValue"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="订单来源" prop="source">
- <el-select v-model="queryParams.source" placeholder="请选择是否支付" clearable size="small">
- <el-option
- v-for="dict in sourceOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="所属小程序" prop="coursePlaySourceConfigId">
- <el-select v-model="queryParams.coursePlaySourceConfigId" placeholder="请选择所属小程序" clearable size="small">
- <el-option
- v-for="dict in appMallOptions"
- :key="dict.id"
- :label="dict.name + '(' + dict.appid + ')'"
- :value="dict.id"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="下单时间" prop="createTime">
- <el-date-picker v-model="createTime" size="small" style="width: 220px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" @change="changeTime"></el-date-picker>
- </el-form-item>
- <el-form-item label="支付时间" prop="payTime">
- <el-date-picker v-model="payTime" size="small" style="width: 220px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" @change="changePayTime"></el-date-picker>
- </el-form-item>
- <el-form-item label="发货时间" prop="deliverySendTime">
- <el-date-picker v-model="deliverySendTime" size="small" style="width: 220px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" @change="changeTime"></el-date-picker>
- </el-form-item>
- <el-form-item label="回单时间" prop="deliveryImportTime">
- <el-date-picker v-model="deliveryImportTime" size="small" style="width: 220px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" @change="changeTime"></el-date-picker>
- </el-form-item>
- <el-form-item label="入账时间" prop="tuiMoneyTime">
- <el-date-picker v-model="tuiMoneyTime" size="small" style="width: 220px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" @change="changeTime"></el-date-picker>
- </el-form-item>
- <el-form-item label="ERP账户" prop="erpAccount" v-if="SFDFopen">
- <el-select v-model="queryParams.erpAccount" placeholder="ERP账户" clearable size="small">
- <el-option
- v-for="dict in erpAccountQueryList"
- :key="dict"
- :label="dict"
- :value="dict"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="ERP电话" prop="erpPhoneNumber" v-if="SFDFopen">
- <el-input
- v-model="queryParams.erpPhoneNumber"
- placeholder="ERP电话"
- clearable
- size="small"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item>
- <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
- </el-form-item>
- </el-form>
- <el-row :gutter="10" class="mb8">
- <el-col :span="1.5">
- <el-button
- type="warning"
- plain
- icon="el-icon-download"
- size="mini"
- :loading="exportLoading"
- @click="handleExport"
- v-hasPermi="['his:storeOrder:export']"
- >财务导出</el-button>
- </el-col>
- <el-col :span="1.5">
- <el-button
- type="warning"
- plain
- icon="el-icon-download"
- size="mini"
- :loading="exportLoading"
- @click="handleOrderExport"
- v-hasPermi="['store:storeOrder:export']"
- >导出订单</el-button>
- </el-col>
- <el-col :span="1.5">
- <el-button
- type="info"
- plain
- icon="el-icon-upload2"
- size="mini"
- @click="handleImport"
- v-hasPermi="['his:storeOrder:exportDeliver']"
- >导入发货</el-button>
- </el-col>
- <el-col :span="1.5">
- <el-button
- type="info"
- plain
- icon="el-icon-upload2"
- size="mini"
- @click="handleImportStatus"
- v-hasPermi="['his:storeOrder:editImport']"
- >导入订单状态</el-button>
- </el-col>
- <el-col :span="1.5">
- <el-button
- type="info"
- plain
- icon="el-icon-upload2"
- size="mini"
- @click="handleImportExpress"
- v-hasPermi="['store:storeOrder:importExpress']"
- >导入银行回单</el-button>
- </el-col>
- <el-col :span="1.5" v-if="SFDFopen && orderStatus == 6"> <!--待推送erp-->
- <el-tooltip content="默认erp推送手机号" placement="top">
- <el-button
- type="warning"
- plain
- icon="el-icon-phone"
- size="mini"
- @click="handleErpPhone"
- v-hasPermi="['store:storeOrder:erpphone']"
- >推送手机号码</el-button>
- </el-tooltip>
- </el-col>
- <el-col :span="1.5" v-if="SFDFopen && orderStatus == 6">
- <el-tooltip content="批量设置erp推送手机号" placement="top">
- <el-button
- type="warning"
- plain
- icon="el-icon-phone"
- size="mini"
-
- @click="setErpPhone"
- v-hasPermi="['his:storeOrder:createErpOrder']"
- >设置推送手机</el-button>
- </el-tooltip>
- </el-col>
- <el-col :span="1.5" v-if="SFDFopen && orderStatus == 6">
- <el-tooltip content="批量设置erp账户" placement="top">
- <el-button
- type="warning"
- plain
- icon="el-icon-s-cooperation"
- size="mini"
- @click="showErpAccountSetDialog"
- v-hasPermi="['his:storeOrder:createErpOrder']"
- >数据分捡</el-button>
- </el-tooltip>
- </el-col>
- <el-col :span="1.5" v-if="SFDFopen && orderStatus == 6">
- <el-tooltip content="批量推送erp" placement="top">
- <el-button
- type="warning"
- plain
- icon="el-icon-s-cooperation"
- size="mini"
- @click="showErpAccountDialog"
- v-hasPermi="['his:storeOrder:createErpOrder']"
- >创建erp</el-button>
- </el-tooltip>
- </el-col>
- <el-col :span="1.5">
- <el-button
- disabled
- plain
- type="primary"
- size="mini"
- >应付金额: {{ payPriceTotal}}</el-button>
- </el-col>
- <el-col :span="1.5">
- <el-button
- disabled
- plain
- type="primary"
- size="mini"
- >实付金额: {{payMoneyTotal}}</el-button>
- </el-col>
- <el-col :span="1.5">
- <el-button
- disabled
- plain
- type="primary"
- size="mini"
- >物流代收金额: {{payRemainTotal }}</el-button>
- </el-col>
- <el-col :span="1.5">
- <el-button
- disabled
- plain
- type="primary"
- size="mini"
- >订单量/金额: {{ total }}/{{payPriceTotal }}</el-button>
- </el-col>
- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
- </el-row>
- <el-tabs type="card" v-model="actName" @tab-click="handleClickX">
- <el-tab-pane label="全部订单" name="10"></el-tab-pane>
- <el-tab-pane v-for="(item,index) in orderOptions" :label="item.dictLabel" :name="item.dictValue"></el-tab-pane>
- </el-tabs>
- <el-table ref="orderTable" height="500" v-loading="loading" border :data="orderList" @selection-change="handleSelectionChange"
- @sort-change="handleSortChange" :default-sort="{prop: 'createTime', order: 'descending'}">
- <el-table-column type="selection" width="55" align="center" />
- <el-table-column label="ERP电话" align="center" prop="erpPhone" width="120px" v-if="SFDFopen && orderStatus!=null && orderStatus != 1"/>
- <el-table-column label="ERP账号" align="center" prop="erpAccount" width="120px" v-if="SFDFopen && orderStatus!=null && orderStatus != 1"/>
- <el-table-column label="处方单编号" align="center" prop="prescribeCode" width="180px"/>
- <el-table-column label="药品订单号" align="center" prop="orderCode" width="180px"/>
- <el-table-column label="所属公司" align="center" prop="companyName" />
- <el-table-column label="员工" align="center" prop="companyUserName" sortable="custom" :sort-orders="['ascending', 'descending']">
- <template slot="header" slot-scope="scope">
- <span>员工</span>
- <el-tooltip content="按员工姓名排序" placement="top"/>
- </template>
- </el-table-column>
- <el-table-column label="店铺名称" align="center" prop="storeName" />
- <el-table-column label="小程序名称" align="center" prop="miniProgramName" width="120px" />
- <el-table-column label="就诊人" align="center" prop="patientName" />
- <el-table-column label="收货人" align="center" prop="userName" />
- <el-table-column label="套餐名称" align="center" prop="packageName" width="100px" sortable="custom" :sort-orders="['ascending', 'descending']">
- <template slot="header" slot-scope="scope">
- <span>套餐名称</span>
- <el-tooltip content="按套餐名称排序" placement="top"/>
- </template>
- </el-table-column>
- <el-table-column label="套餐别名" align="center" prop="packageSecondName" width="100px"/>
- <el-table-column label="应收金额" align="center" prop="payPrice" width="100px" sortable="custom" :sort-orders="['ascending', 'descending']">
- <template slot="header" slot-scope="scope">
- <span>应收金额</span>
- <el-tooltip content="按应收金额排序" placement="top"/>
- </template>
- </el-table-column>
- <el-table-column label="实收金额" align="center" prop="payMoney" width="100px" sortable="custom" :sort-orders="['ascending', 'descending']">
- <template slot="header" slot-scope="scope">
- <span>实收金额</span>
- <el-tooltip content="按实收金额排序" placement="top"/>
- </template>
- </el-table-column>
- <el-table-column label="支付方式" align="center" prop="payType" >
- <template slot-scope="scope">
- <dict-tag :options="PayOptions" :value="scope.row.payType"/>
- </template>
- </el-table-column>
- <el-table-column label="下单时间" align="center" prop="createTime" width="180" />
- <el-table-column label="支付时间" align="center" prop="payTime" width="180" />
- <el-table-column label="订单状态" align="center" prop="status" >
- <template slot-scope="scope">
- <dict-tag :options="orderOptions" :value="scope.row.status"/>
- </template>
- </el-table-column>
- <el-table-column label="订单来源" align="center" prop="source" >
- <template slot-scope="scope">
- <dict-tag :options="sourceOptions" :value="scope.row.source"/>
- </template>
- </el-table-column>
- <el-table-column label="物流状态" align="center" prop="deliveryStatus" >
- <template slot-scope="scope">
- <dict-tag :options="deliveryStatusOptions" :value="scope.row.deliveryStatus"/>
- </template>
- </el-table-column>
- <el-table-column label="结算状态" align="center" prop="deliveryPayStatus" >
- <template slot-scope="scope">
- <dict-tag :options="deliveryPayStatusOptions" :value="scope.row.deliveryPayStatus"/>
- </template>
- </el-table-column>
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="100px" fixed="right">
- <template slot-scope="scope">
- <el-button
- size="mini"
- type="text"
- @click="handledetails(scope.row)"
- >查看
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- <div>
- 商品数量合计:{{ productInfo }}
- </div>
- <pagination
- v-show="total>0"
- :total="total"
- :page.sync="queryParams.pageNum"
- :limit.sync="queryParams.pageSize"
- @pagination="getList"
- />
- <!-- 排序状态显示 -->
- <div v-if="currentSort.prop" class="sort-info">
- <el-tag size="small" type="info" closable @close="clearSort">
- <i class="el-icon-sort"></i>
- 当前排序:{{ getSortLabel(currentSort.prop) }}
- {{ currentSort.order === 'ascending' ? '升序' : '降序' }}
- </el-tag>
- <el-button
- type="text"
- size="mini"
- @click="clearSort"
- style="margin-left: 8px; color: #909399;"
- >
- </el-button>
- </div>
- <el-drawer
- :with-header="false"
- size="75%"
- :title="show.title" :visible.sync="show.open">
- <storeOrderDetails ref="Details" />
- </el-drawer>
- <!-- 用户导入对话框 -->
- <el-dialog :title="importExpress.title" :visible.sync="importExpress.open" width="400px" append-to-body>
- <el-upload
- ref="importExpress"
- :limit="1"
- accept=".xlsx, .xls"
- :headers="importExpress.headers"
- :action="importExpress.url + '?updateSupport=' + importExpress.updateSupport"
- :disabled="importExpress.isUploading"
- :on-progress="handleFileUploadProgressExpress"
- :on-success="handleFileSuccessExpress"
- :auto-upload="false"
- drag
- >
- <i class="el-icon-upload"></i>
- <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
- <div class="el-upload__tip text-center" slot="tip">
- <div class="el-upload__tip" slot="tip">
- <!-- <el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的数据 -->
- </div>
- <span>仅允许导入xls、xlsx格式文件。</span>
- <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplateExpress">下载模板</el-link>
- </div>
- </el-upload>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="submitFileFormExpress">确 定</el-button>
- <el-button @click="importExpress.open = false">取 消</el-button>
- </div>
- </el-dialog>
- <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
- <el-upload
- ref="upload"
- :limit="1"
- accept=".xlsx, .xls"
- :headers="upload.headers"
- :action="upload.url + '?updateSupport=' + upload.updateSupport"
- :disabled="upload.isUploading"
- :on-progress="handleFileUploadProgress"
- :on-success="handleFileSuccess"
- :auto-upload="false"
- drag
- >
- <i class="el-icon-upload"></i>
- <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
- <div class="el-upload__tip text-center" slot="tip">
- <div class="el-upload__tip" slot="tip">
- </div>
- <span>仅允许导入xls、xlsx格式文件。</span>
- <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate">下载模板</el-link>
- </div>
- </el-upload>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="submitFileForm">确 定</el-button>
- <el-button @click="upload.open = false">取 消</el-button>
- </div>
- </el-dialog>
- <el-dialog :title="uploadStatus.title" :visible.sync="uploadStatus.open" width="400px" append-to-body>
- <el-upload
- ref="uploadStatus"
- :limit="1"
- accept=".xlsx, .xls"
- :headers="uploadStatus.headers"
- :action="uploadStatus.url + '?updateSupport=' + upload.updateSupport"
- :disabled="uploadStatus.isUploading"
- :on-progress="handleFileUploadProgressOrder"
- :on-success="handleFileSuccessOrder"
- :auto-upload="false"
- drag
- >
- <i class="el-icon-upload"></i>
- <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
- <div class="el-upload__tip text-center" slot="tip">
- <div class="el-upload__tip" slot="tip">
- </div>
- <span>仅允许导入xls、xlsx格式文件。</span>
- <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importUpdateOrderTemplate">下载模板</el-link>
- </div>
- </el-upload>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="submitOrderStatusFileForm">确 定</el-button>
- <el-button @click="uploadStatus.open = false">取 消</el-button>
- </div>
- </el-dialog>
-
- <!-- 设置推送手机对话框 -->
- <el-dialog :title="erpPhone.title" :visible.sync="erpPhone.open" width="600px" append-to-body>
- <div style="margin-bottom: 20px;">
- <el-button type="primary" size="small" @click="handleAddPhone">新增手机号</el-button>
- </div>
- <el-table :data="phoneList" border style="width: 100%">
- <el-table-column prop="phone" label="手机号" align="center">
- <template slot-scope="scope">
- <el-input
- v-if="scope.row.editing"
- v-model="scope.row.phone"
- placeholder="请输入手机号"
- @blur="validatePhone(scope.row)"
- @keyup.enter.native="handleSavePhone(scope.$index)"
- />
- <span v-else>{{ scope.row.phone }}</span>
- </template>
- </el-table-column>
- <el-table-column label="操作" align="center" width="300">
- <template slot-scope="scope">
- <el-button
- v-if="scope.row.editing"
- type="success"
- size="mini"
- @click="handleSavePhone(scope.$index)"
- >保存</el-button>
- <el-button
- v-if="scope.row.editing"
- type="info"
- size="mini"
- @click="handleCancelEdit(scope.$index)"
- >取消</el-button>
- <el-button
- v-if="!scope.row.editing"
- type="primary"
- size="mini"
- @click="handleEditPhone(scope.$index)"
- >修改</el-button>
- <el-button
- type="danger"
- size="mini"
- @click="handleDeletePhone(scope.$index)"
- >删除</el-button>
- </template>
- </el-table-column>
- </el-table>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="handleSavePhoneList">确 定</el-button>
- <el-button @click="handleCancelPhoneDialog">取 消</el-button>
- </div>
- </el-dialog>
- <el-dialog :title="erpPhone.title" :visible.sync="setPhoneOpen" width="600px" append-to-body>
- <el-select v-model="erpPhoneValue" multiple placeholder="请选择">
- <el-option
- v-for="item in phoneList"
- :key="item.phone"
- :label="item.phone"
- :value="item.phone">
- </el-option>
- </el-select>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="submitErpPhone">确 定</el-button>
- <el-button @click="handleCancelErpPhone">取 消</el-button>
- </div>
- </el-dialog>
- <!-- ERP账户选择对话框 -->
- <el-dialog :title="erpAccountDialog.title" :visible.sync="erpAccountDialog.open" width="600px" append-to-body>
- <div v-loading="erpAccountDialog.loading">
- <el-form :model="erpAccountForm" label-width="100px">
- <el-form-item label="ERP账户" required>
- <el-select
- v-model="erpAccountForm.selectedAccount"
- placeholder="请选择ERP账户"
- style="width: 100%"
- filterable
- >
- <el-option
- v-for="account in erpAccountList"
- :key="account"
- :label="account"
- :value="account"
- >
- <span style="float: left">{{ account}}</span>
- <span style="float: right; color: #8492a6; font-size: 13px">{{ account.accountCode }}</span>
- </el-option>
- </el-select>
- </el-form-item>
- </el-form>
-
- <!-- 订单统计信息 -->
- <div class="order-summary" v-if="orderSummary">
- <el-divider content-position="left">订单统计</el-divider>
- <el-row :gutter="20">
- <el-col :span="8">
- <div class="summary-item">
- <span class="label">选中订单数:</span>
- <span class="value">{{ orderSummary.selectedCount }}</span>
- </div>
- </el-col>
- <el-col :span="8">
- <div class="summary-item">
- <span class="label">总金额:</span>
- <span class="value">¥{{ orderSummary.totalAmount }}</span>
- </div>
- </el-col>
- <el-col :span="8">
- <div class="summary-item">
- <span class="label">查询条件订单:</span>
- <span class="value">{{ orderSummary.queryCount }}</span>
- </div>
- </el-col>
- </el-row>
- </div>
- </div>
-
- <div slot="footer" class="dialog-footer">
- <el-button @click="cancelErpAccountDialog">取 消</el-button>
- <el-button
- type="primary"
- @click="confirmCreateErpOrder"
- :disabled="!erpAccountForm.selectedAccount"
- :loading="erpAccountDialog.submitting"
- >确认</el-button>
- </div>
- </el-dialog>
- <!-- 导出字段选择对话框 -->
- <el-dialog :title="exportFieldDialog.title" :visible.sync="exportFieldDialog.open" width="800px" append-to-body>
- <div v-loading="exportFieldDialog.loading">
- <div style="margin-bottom: 20px;">
- <el-button type="primary" size="small" @click="selectAllFields">全选</el-button>
- <el-button type="default" size="small" @click="unselectAllFields">全不选</el-button>
- <el-button type="success" size="small" @click="selectDefaultFields">选择常用</el-button>
- </div>
-
- <div class="field-selection-container">
- <el-row :gutter="20">
- <el-col :span="8" v-for="field in exportFieldOptions" :key="field.key">
- <el-checkbox
- v-model="field.checked"
- :label="field.label"
- style="margin-bottom: 12px; width: 100%;"
- >
- {{ field.label }}
- </el-checkbox>
- </el-col>
- </el-row>
- </div>
-
- <div class="field-count-info" style="margin-top: 20px; padding: 10px; background: #f5f7fa; border-radius: 4px;">
- <i class="el-icon-info"></i>
- <span v-if="getSelectedFieldsCount() > 0">
- 已选择 <span style="color: #409EFF; font-weight: bold;">{{ getSelectedFieldsCount() }}</span> 个字段
- </span>
- <span v-else style="color: #E6A23C; font-weight: bold;">
- <i class="el-icon-warning"></i>
- 未选择任何字段,将导出所有字段
- </span>
- </div>
- </div>
-
- <div slot="footer" class="dialog-footer">
- <el-button @click="cancelExportFieldDialog">取 消</el-button>
- <el-button
- type="primary"
- @click="confirmExportFields"
- >确认导出</el-button>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import { listOrder, getOrder, delOrder, addOrder,importExpressTemplate, updateOrder, exportOrder,importTemplate,exportOrder2,queryErpPhone,
- saveErpPhone,editErpPhone,batchCreateErpOrder,getErpAccount,batchSetErpOrder,importUpdateOrderTemplate } from "@/api/his/storeOrder";
- import storeOrderDetails from '../../components/his/storeOrderDetails.vue';
- import { getToken } from "@/utils/auth";
- import {listStore} from "@/api/his/storeProduct";
- import { getCompanyList } from "@/api/company/company";
- import { getTcmScheduleList } from "@/api/company/schedule";
- import { treeselect } from "@/api/company/companyDept";
- import Treeselect from "@riophae/vue-treeselect";
- import "@riophae/vue-treeselect/dist/vue-treeselect.css";
- import { getTask } from "@/api/common";
- import {list as getAppMallOptions} from '@/api/course/coursePlaySourceConfig';
- export default {
- name: "Order",
- components: { storeOrderDetails,Treeselect },
- watch: {
- // 监听deptId
- 'deptId': 'currDeptChange'
- },
- data() {
- return {
- productInfo:"",
- payPriceTotal:"0",
- payMoneyTotal:"0",
- payRemainTotal:"0",
- // 新增排序相关数据
- currentSort: {
- prop: null,
- order: null
- },
-
- // 排序字段映射
- sortFieldMap: {
- 'companyUserName': '员工',
- 'packageName': '套餐名称',
- 'payPrice': '应收金额',
- 'payMoney': '实收金额',
- 'createTime': '下单时间'
- },
- erpSettingType:'set',
- SFDFopen:false,
- // 最大订单号数量限制
- maxOrderCodes: {
- type: Number,
- default: 50
- },
- // 输入框是否可见
- inputVisible: false,
-
- // 无效订单号对话框
- showInvalidDialog: false,
- // 当前输入值
- currentInput: '',
- deptOpen:true,
- // ERP账户相关数据
- erpAccountDialog: {
- open: false,
- title: "选择ERP账户",
- loading: false,
- submitting: false
- },
- erpAccountList: [], // ERP账户列表
- erpAccountQueryList:[], // ERP账户查询条件列表
- erpAccountForm: {
- selectedAccount: [] // 选中的账户ID
- },
- orderSummary: null, // 订单统计信息
- erpPhoneValue:[],
- setPhoneOpen:false,
- erpPhone:{
- open:false,
- title:"设置推送手机号"
- },
- phoneList: [], // 手机号列表
- originalPhoneList: [], // 原始手机号列表,用于取消时恢复
- orderStatus:null,
- scheduleOptions:[],
- companys:[],
- deptOptions:[],
- companyId:undefined,
- companyIds:[],
- deptId:undefined,
- actName:"10",
- show:{
- title:"订单详情",
- open:false,
- },
- sourceOptions:[],
- importExpress: {
- // 是否显示弹出层
- open: false,
- // 弹出层标题
- title: "",
- // 是否禁用上传
- isUploading: false,
- // 是否更新已经存在的用户数据
- updateSupport: 0,
- // 设置上传的请求头部
- headers: { Authorization: "Bearer " + getToken() },
- // 上传的地址
- url: process.env.VUE_APP_BASE_API + "/his/storeOrder/importExpress"
- },
- upload: {
- // 是否显示弹出层
- open: false,
- // 弹出层标题
- title: "",
- // 是否禁用上传
- isUploading: false,
- // 是否更新已经存在的用户数据
- updateSupport: 0,
- // 设置上传的请求头部
- headers: { Authorization: "Bearer " + getToken() },
- // 上传的地址
- url: process.env.VUE_APP_BASE_API + "/his/storeOrder/importData"
- },
- uploadStatus: {
- // 是否显示弹出层
- open: false,
- // 弹出层标题
- title: "",
- // 是否禁用上传
- isUploading: false,
- // 是否更新已经存在的用户数据
- updateSupport: 0,
- // 设置上传的请求头部
- headers: { Authorization: "Bearer " + getToken() },
- // 上传的地址
- url: process.env.VUE_APP_BASE_API + "/his/storeOrder/importOrderStatusData"
- },
- // 遮罩层
- loading: true,
- // 导出遮罩层
- exportLoading: false,
- // 导出字段选择弹窗
- exportFieldDialog: {
- open: false,
- title: "选择导出字段",
- loading: false
- },
- // 可选择的导出字段列表
- exportFieldOptions: [
- { key: 'orderCode', label: '订单号', checked: true },
- { key: 'prescribeCode', label: '处方单号', checked: true },
- { key: 'userId', label: '会员ID', checked: false },
- { key: 'extendOrderId', label: '管易云订单号', checked: false },
- { key: 'companyName', label: '所属公司', checked: true },
- { key: 'companyUserNickName', label: '所属销售', checked: true },
- { key: 'storeName', label: '店铺名称', checked: true },
- { key: 'miniProgramName', label: '小程序名称', checked: true },
- { key: 'orderType', label: '订单类型', checked: false },
- { key: 'userName', label: '收货人姓名', checked: true },
- { key: 'userPhone', label: '收货人电话', checked: true },
- { key: 'userAddress', label: '详细地址', checked: true },
- { key: 'totalPrice', label: '商品金额', checked: true },
- { key: 'totalNum', label: '商品数量', checked: true },
- { key: 'payPrice', label: '应付金额', checked: true },
- { key: 'payMoney', label: '实付金额', checked: true },
- { key: 'payRemain', label: '物流代收金额', checked: false },
- { key: 'discountMoney', label: '优惠金额', checked: false },
- { key: 'createTime', label: '下单时间', checked: true },
- { key: 'payTime', label: '支付时间', checked: true },
- { key: 'payType', label: '支付方式', checked: true },
- { key: 'status', label: '订单状态', checked: true },
- { key: 'refundTime', label: '退款时间', checked: false },
- { key: 'refundMoney', label: '退款金额', checked: false },
- { key: 'deliveryCode', label: '快递公司编号', checked: false },
- { key: 'deliveryName', label: '快递公司', checked: false },
- { key: 'deliverySn', label: '快递单号', checked: false },
- { key: 'remark', label: '备注', checked: false },
- { key: 'deliveryPayStatus', label: '物流代收结算状态', checked: false },
- { key: 'deliveryTime', label: '快递账单日期', checked: false },
- { key: 'deliveryPayTime', label: '快递结算日期', checked: false },
- { key: 'deliveryPayMoney', label: '物流结算费用', checked: false },
- { key: 'deliveryStatus', label: '物流状态', checked: false },
- { key: 'deliveryType', label: '物流跟踪状态', checked: false },
- { key: 'packageName', label: '套餐名称', checked: true },
- { key: 'packageSecondName', label: '套餐包别名', checked: false },
- { key: 'orderBuyType', label: '订单购买类型', checked: false },
- { key: 'channel', label: '公众号/渠道', checked: false },
- { key: 'scheduleName', label: '档期归属', checked: false },
- { key: 'tuiMoneyStatus', label: '推广佣金状态', checked: false },
- { key: 'orderChannel', label: '渠道', checked: false },
- { key: 'qwSubject', label: '企微主体', checked: false },
- { key: 'cycle', label: '疗程天数', checked: false },
- { key: 'followFrequency', label: '随访频率', checked: false },
- { key: 'followCount', label: '随访次数', checked: false },
- { key: 'patientName', label: '就诊人', checked: true },
- { key: 'relation', label: '与本人关系', checked: false },
- { key: 'user', label: '会员', checked: false },
- { key: 'doctorName', label: '医生', checked: false },
- { key: 'packageCateName', label: '套餐包分类', checked: false },
- { key: 'age', label: '年龄', checked: false },
- { key: 'sex', label: '性别', checked: false },
- { key: 'erpPhone', label: 'ERP电话', checked: false },
- { key: 'erpAccount', label: 'ERP账号', checked: false },
- { key: 'source', label: '订单来源', checked: false }
- ],
- // 已选择的导出字段
- selectedExportFields: [],
- // 选中数组
- ids: [],
- // 非单个禁用
- single: true,
- // 非多个禁用
- multiple: true,
- // 显示搜索条件
- showSearch: true,
- // 总条数
- total: 0,
- // 订单表格数据
- orderList: [],
- payTypeArr:[],
- scheduleIdArr:[],
- buyTypeArr:[],
- channelArr:[],
- qwSubjectArr:[],
- // 弹出层标题
- title: "",
- createTime:null,
- payTime:null,
- deliveryImportTime:null,
- deliverySendTime:null,
- tuiMoneyTime:null,
- // 是否显示弹出层
- open: false,
- // 查询参数
- queryParams: {
- pageNum: 1,
- pageSize: 10,
- storeId: null,
- orderCode: null,
- orderCodes: [],
- userId: null,
- userName: null,
- userPhone: null,
- userPhoneMk: null,
- userAddress: null,
- cartId: null,
- totalNum: null,
- totalPrice: null,
- payPrice: null,
- payMoney: null,
- isPay: null,
- payTime: null,
- payType: null,
- status: null,
- refundStatus: null,
- refundImg: null,
- refundExplain: null,
- refundTime: null,
- refundReason: null,
- refundMoney: null,
- deliveryCode: null,
- deliveryName: null,
- deliverySn: null,
- isDel: null,
- costPrice: null,
- verifyCode: null,
- shippingType: null,
- isChannel: null,
- isPrescribe: null,
- prescribeId: null,
- finishTime: null,
- patientName: null,
- doctorName: null,
- sTime:null,
- eTime:null,
- paysTime:null,
- payeTime:null,
- deliveryTime: null,
- tuiMoney: null,
- tuiMoneyStatus: null,
- tuisTime:null,
- tuieTime:null,
- tuiUserId: null,
- orderCreateType: null,
- companyUserName:null,
- companyName:null,
- packageSecondName:null,
- isFirst:null,
- source:null,
- companyId:null,
- companyIds:null,
- coursePlaySourceConfigId:null,
- },
- // 表单参数
- form: {},
- // 表单校验
- rules: {
- },
- PayOptions:[],
- orderOptions:[],
- payStatusOptions:[],
- refundOptions:[],
- channelOptions:[],
- qwSubjectOptions:[],
- orderTypeOptions:[],
- orderBuyTypeOptions:[],
- tuiOptions:[],
- orOptions:[],
- storeOPtions:[],
- deliveryPayStatusOptions:[],
- deliveryStatusOptions:[],
- appMallOptions:[],
- };
- },
- created() {
- getCompanyList().then(response => {
- this.companys = response.data;
- if(this.companys!=null&&this.companys.length>0){
- // this.companyId=this.companys[0].companyId;
- this.getTreeselect();
- }
- this.companys.push({companyId:"-1",companyName:"无"})
- });
- getTcmScheduleList().then(response => {
- this.scheduleOptions = response.data;
- this.scheduleOptions.push({id: "-1",
- name: "无"})
- });
- this.getstoreList();
- this.getList();
- this.getDicts("sys_store_order_buy_type").then(response => {
- this.orderBuyTypeOptions = response.data;
- this.orderBuyTypeOptions.push({dictLabel: "无",
- dictValue: "-1"})
- });
- this.getDicts("sys_store_pay_type").then(response => {
- this.PayOptions = response.data;
- });
- this.getDicts("sys_order_source").then(response => {
- this.sourceOptions = response.data;
- });
- this.getDicts("sys_store_order_type").then(response => {
- this.orderTypeOptions = response.data;
- });
- this.getDicts("sys_order_status").then(response => {
- this.orderOptions = response.data;
- });
- this.getDicts("sys_order_pay").then(response => {
- this.payStatusOptions = response.data;
- });
- this.getDicts("sys_refund_status").then(response => {
- this.refundOptions = response.data;
- });
- this.getDicts("sys_store_channel").then(response => {
- this.channelOptions = response.data;
- this.channelOptions.push({dictLabel: "无",
- dictValue: "-1"})
- });
- this.getDicts("sys_store_qw_subject").then(response => {
- this.qwSubjectOptions = response.data;
- this.qwSubjectOptions.push({dictLabel: "无",
- dictValue: "-1"})
- });
- this.getDicts("sys_tui_money_status").then(response => {
- this.tuiOptions = response.data;
- });
- this.getDicts("sys_company_or").then(response => {
- this.orOptions = response.data;
- });
- this.getDicts("sys_store_delivery_pay_status").then(response => {
- this.deliveryPayStatusOptions = response.data;
- });
- this.getDicts("sys_store_order_delivery_status").then(response => {
- this.deliveryStatusOptions = response.data;
- });
- this.getErpAccountList();
- this.getAppMallOptions();
- },
- methods: {
- // 新增排序处理方法
- handleSortChange({ column, prop, order }) {
- console.log('排序变化:', { column, prop, order });
-
- // 更新当前排序状态
- this.currentSort = {
- prop: prop,
- order: order
- };
-
- // 更新查询参数
- if (order) {
- this.queryParams.sortField = prop;
- this.queryParams.sortOrder = order === 'ascending' ? 'asc' : 'desc';
- } else {
- this.queryParams.sortField = null;
- this.queryParams.sortOrder = null;
- }
-
- // 重新查询数据
- this.queryParams.pageNum = 1; // 重置到第一页
- this.getList();
-
- // 显示排序提示
- if (order) {
- const fieldLabel = this.getSortLabel(prop);
- const orderLabel = order === 'ascending' ? '升序' : '降序';
- this.$message.success(`已按${fieldLabel}${orderLabel}排序`);
- }
- },
-
- // 获取排序字段的中文标签
- getSortLabel(prop) {
- return this.sortFieldMap[prop] || prop;
- },
-
- // 清除排序
- clearSort() {
- this.currentSort = {
- prop: null,
- order: null
- };
- this.queryParams.sortField = null;
- this.queryParams.sortOrder = null;
- this.queryParams.pageNum = 1;
- // 重置表格排序状态 - 关键代码
- this.$nextTick(() => {
- if (this.$refs.orderTable) {
- this.$refs.orderTable.clearSort();
- }
- });
- this.getList();
- this.$message.success('已清除排序');
- },
- // 修改查询列表方法,添加排序参数
- getList() {
- this.loading = true;
-
- // 处理多选参数
- if(this.payTypeArr.length>0){
- this.queryParams.payType=this.payTypeArr.toString();
- } else {
- this.queryParams.payType=null
- }
-
- if(this.scheduleIdArr.length>0){
- this.queryParams.scheduleId=this.scheduleIdArr.toString();
- } else {
- this.queryParams.scheduleId=null
- }
-
- if(this.buyTypeArr.length>0){
- this.queryParams.orderBuyType=this.buyTypeArr.toString();
- } else {
- this.queryParams.orderbuyType=null
- }
-
- if(this.channelArr.length>0){
- this.queryParams.orderChannel=this.channelArr.toString();
- } else {
- this.queryParams.orderChannel=null
- }
-
- if(this.qwSubjectArr.length>0){
- this.queryParams.qwSubject=this.qwSubjectArr.toString();
- } else {
- this.queryParams.qwSubject=null
- }
-
- // 处理公司参数
- if(this.companyIds && this.companyIds.length>1){
- this.queryParams.companyIds = this.companyIds
- this.queryParams.companyId = null;
- this.queryParams.deptId = null;
- } else {
- this.queryParams.companyId = this.companyId
- this.queryParams.companyIds = null;
- }
-
- // 处理订单号数组
- if (this.queryParams.orderCodes && this.queryParams.orderCodes.length > 0) {
- this.queryParams.orderCodeList = this.queryParams.orderCodes.join(',');
- } else {
- this.queryParams.orderCodeList = null;
- }
-
- console.log('查询参数:', this.queryParams);
-
- listOrder(this.queryParams).then(response => {
- this.orderList = response.rows;
- this.total = response.total;
- if(this.total>0){
- this.payPriceTotal = response.payPriceTotal;
- this.payMoneyTotal = response.payMoneyTotal;
- this.payRemainTotal = response.payRemainTotal;
- this.productInfo = response.productInfo;
- } else {
- this.payPriceTotal = "0"
- this.payMoneyTotal = "0"
- this.payRemainTotal = "0"
- this.productInfo = response.productInfo;
- }
-
- this.loading = false;
-
- if(response.msg == 'jnmy'){
- this.SFDFopen = true;
- } else{
- this.SFDFopen = false;
- }
-
- // 如果有排序,显示排序结果提示
- if (this.currentSort.prop) {
- const fieldLabel = this.getSortLabel(this.currentSort.prop);
- const orderLabel = this.currentSort.order === 'ascending' ? '升序' : '降序';
- console.log(`数据已按${fieldLabel}${orderLabel}加载`);
- }
- }).catch(error => {
- console.error('查询失败:', error);
- this.loading = false;
- this.$message.error('查询数据失败');
- });
- },
- // 处理键盘按下事件
- handleKeyDown(event) {
- const { key, target } = event
-
- // 处理退格键删除标签
- if (key === 'Backspace' && !target.value && this.queryParams.orderCodes.length > 0) {
- event.preventDefault()
- this.removeOrderCode(this.queryParams.orderCodes.length - 1)
- }
-
- // 处理分隔符
- if ([',', ',', ' ', 'Enter'].includes(key)) {
- event.preventDefault()
- this.handleInputConfirm()
- }
- },
-
- // 处理键盘抬起事件(实时分割输入)
- handleKeyUp(event) {
- const value = event.target.value
-
- // 检查是否包含分隔符
- if (/[,,\s]/.test(value)) {
- this.handleInputConfirm()
- }
- },
-
- // 确认输入
- handleInputConfirm() {
- const inputValue = this.currentInput.trim()
-
- if (inputValue) {
- // 分割多个订单号
- const codes = inputValue.split(/[,,\s]+/).filter(code => code.trim())
-
- codes.forEach(code => {
- this.addOrderCode(code.trim())
- })
- }
-
- this.currentInput = ''
- },
-
- // 添加订单号
- addOrderCode(code) {
- if (!code) return
-
- // 检查数量限制
- if (this.maxOrderCodes > 0 && this.queryParams.orderCodes.length >= this.maxOrderCodes) {
- this.$message.warning(`最多只能添加 ${this.maxOrderCodes} 个订单号`)
- return
- }
-
- // 检查重复
- if (this.queryParams.orderCodes.includes(code)) {
- this.$message.warning(`订单号 "${code}" 已存在`)
- return
- }
-
- // 添加到列表
- this.queryParams.orderCodes.push(code)
-
- },
-
- // 删除订单号
- removeOrderCode(index) {
- this.queryParams.orderCodes.splice(index, 1)
- },
-
- // 清空所有标签
- clearAllTags() {
- this.$confirm('确认清空所有订单号吗?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- this.queryParams.orderCodes = []
- this.$message.success('已清空所有订单号')
- })
- },
- // 显示输入框
- showInput() {
- this.inputVisible = true
- this.$nextTick(() => {
- this.$refs.tagInput.focus()
- })
- },
- // 删除订单号
- removeOrderCode(index) {
- this.queryParams.orderCodes.splice(index, 1)
- },
- // 聚焦输入框
- focusInput() {
- if (!this.inputVisible) {
- this.showInput()
- }
- },
- // 设置erp账户
- showErpAccountSetDialog() {
- this.erpAccountDialog.open = true;
- this.erpSettingType = 'set'
- this.calculateOrderSummary();
- },
- //显示ERP账户选择对话框
- showErpAccountDialog() {
- this.erpAccountDialog.open = true;
- this.erpSettingType = 'push'
- this.calculateOrderSummary();
- },
-
- //获取ERP账户列表
- async getErpAccountList() {
- try {
- const response = await getErpAccount();
- if (response.code === 200) {
- const list = response.data || [];
- this.erpAccountList = [...list];
- this.erpAccountQueryList = [...list, '未分拣'];
- // 设置默认值:第一条真实账户
- if (list.length && !this.queryParams.erpAccount) {
- this.$set(this.queryParams, 'erpAccount', list[0]);
- this.getList();
- }
- } else {
- this.$message.error(response.msg || '获取ERP账户列表失败');
- this.erpAccountList = [];
- }
-
- } catch (error) {
- console.error('获取ERP账户列表失败:', error);
- this.$message.error('获取ERP账户列表失败');
- this.erpAccountList = [];
- } finally {
- this.erpAccountDialog.loading = false;
- }
- },
-
- // 新增:计算订单统计信息
- calculateOrderSummary() {
- let selectedCount = 0;
- let totalAmount = 0;
- let queryCount = this.total || 0;
-
- if (this.ids.length > 0) {
- // 如果有选中的订单,统计选中的订单
- selectedCount = this.ids.length;
- this.orderList.forEach(order => {
- if (this.ids.includes(order.orderId)) {
- totalAmount += parseFloat(order.payMoney || 0);
- }
- });
- } else {
- // 如果没有选中订单,统计当前查询条件下的所有订单
- selectedCount = queryCount;
- this.orderList.forEach(order => {
- totalAmount += parseFloat(order.payMoney || 0);
- });
- }
-
- this.orderSummary = {
- selectedCount,
- totalAmount: totalAmount.toFixed(2),
- queryCount
- };
- },
-
- //确认创建ERP订单
- confirmCreateErpOrder() {
- if (!this.erpAccountForm.selectedAccount) {
- this.$message.warning('请选择ERP账户');
- return;
- }
- console.log("-----------------",this.erpSettingType)
- if(this.erpSettingType == 'set'){
- this.$confirm(
- `确认将订单设置ERP账户为"${this.erpAccountForm.selectedAccount}"吗?`,
- '确认',
- {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }
- ).then(() => {
- this.executSetErpOrder();
- });
- } else if(this.erpSettingType == 'push'){
- this.$confirm(
- `确认将订单推送到ERP账户"${this.erpAccountForm.selectedAccount}"吗?`,
- '确认推送',
- {
- confirmButtonText: '确定推送',
- cancelButtonText: '取消',
- type: 'warning'
- }
- ).then(() => {
- this.executeCreateErpOrder();
- });
- }
- },
- async executSetErpOrder() {
- this.erpAccountDialog.submitting = true;
-
- try {
- let param = {
- loginAccount: this.erpAccountForm.selectedAccount
- };
-
- if (this.ids.length > 0) {
- // 如果有选中的订单,只推送选中的
- param.orderIds = this.ids;
- } else {
- // 如果没有选中订单,推送查询条件下的所有订单
- if (this.payTypeArr.length > 0) {
- this.queryParams.payType = this.payTypeArr.toString();
- } else {
- this.queryParams.payType = null;
- }
- if (this.scheduleIdArr.length > 0) {
- this.queryParams.scheduleId = this.scheduleIdArr.toString();
- } else {
- this.queryParams.scheduleId = null;
- }
- if (this.buyTypeArr.length > 0) {
- this.queryParams.orderBuyType = this.buyTypeArr.toString();
- } else {
- this.queryParams.orderBuyType = null;
- }
- if (this.channelArr.length > 0) {
- this.queryParams.orderChannel = this.channelArr.toString();
- } else {
- this.queryParams.orderChannel = null;
- }
- if (this.qwSubjectArr.length > 0) {
- this.queryParams.qwSubject = this.qwSubjectArr.toString();
- } else {
- this.queryParams.qwSubject = null;
- }
-
- // 合并查询参数
- param = { ...param, ...this.queryParams };
- }
-
- const response = await batchSetErpOrder(param);
- if (response.code === 200) {
- this.$message.success('订单ERP账号设置成功');
- this.cancelErpAccountDialog();
- this.getErpAccountList(); // 刷新列表
- this.getList();
- } else {
- this.$message.error(response.msg || 'ERP账号设置失败');
- }
- } catch (error) {
- console.error('ERP账号设置失败:', error);
- this.$message.error('ERP账号设置失败');
- } finally {
- this.erpAccountDialog.submitting = false;
- }
- },
-
- //执行创建ERP订单
- async executeCreateErpOrder() {
- this.erpAccountDialog.submitting = true;
-
- try {
- let param = {
- loginAccount: this.erpAccountForm.selectedAccount
- };
-
- if (this.ids.length > 0) {
- // 如果有选中的订单,只推送选中的
- param.orderIds = this.ids;
- } else {
- // 如果没有选中订单,推送查询条件下的所有订单
- if (this.payTypeArr.length > 0) {
- this.queryParams.payType = this.payTypeArr.toString();
- } else {
- this.queryParams.payType = null;
- }
- if (this.scheduleIdArr.length > 0) {
- this.queryParams.scheduleId = this.scheduleIdArr.toString();
- } else {
- this.queryParams.scheduleId = null;
- }
- if (this.buyTypeArr.length > 0) {
- this.queryParams.orderBuyType = this.buyTypeArr.toString();
- } else {
- this.queryParams.orderBuyType = null;
- }
- if (this.channelArr.length > 0) {
- this.queryParams.orderChannel = this.channelArr.toString();
- } else {
- this.queryParams.orderChannel = null;
- }
- if (this.qwSubjectArr.length > 0) {
- this.queryParams.qwSubject = this.qwSubjectArr.toString();
- } else {
- this.queryParams.qwSubject = null;
- }
-
- // 合并查询参数
- param = { ...param, ...this.queryParams };
- }
-
- const response = await batchCreateErpOrder(param);
- if (response.code === 200) {
- this.$message.success('ERP订单创建成功');
- this.cancelErpAccountDialog();
- this.getErpAccountList(); // 刷新列表
- this.getList();
- } else {
- this.$message.error(response.msg || 'ERP订单创建失败');
- }
- } catch (error) {
- console.error('创建ERP订单失败:', error);
- this.$message.error('创建ERP订单失败');
- } finally {
- this.erpAccountDialog.submitting = false;
- }
- },
-
- // 新增:取消ERP账户选择对话框
- cancelErpAccountDialog() {
- this.erpAccountDialog.open = false;
- this.erpAccountForm.selectedAccount = null;
- this.orderSummary = null;
- this.erpAccountList = [];
- },
- handleCancelErpPhone(){
- this.erpPhoneValue = [];
- this.setPhoneOpen = false;
- },
- submitErpPhone(){
- let param = {};
- if(this.ids.length>0){
- param = {orderIds:this.ids,erpPhone:this.erpPhoneValue};
- } else {
- if(this.payTypeArr.length>0){
- this.queryParams.payType=this.payTypeArr.toString();
- }
- else{
- this.queryParams.payType=null
- }
- if(this.scheduleIdArr.length>0){
- this.queryParams.scheduleId=this.scheduleIdArr.toString();
- }
- else{
- this.queryParams.scheduleId=null
- }
- if(this.buyTypeArr.length>0){
- this.queryParams.orderBuyType=this.buyTypeArr.toString();
- }
- else{
- this.queryParams.orderbuyType=null
- }
- if(this.channelArr.length>0){
- this.queryParams.orderChannel=this.channelArr.toString();
- }
- else{
- this.queryParams.orderChannel=null
- }
- if(this.qwSubjectArr.length>0){
- this.queryParams.qwSubject=this.qwSubjectArr.toString();
- }
- else{
- this.queryParams.qwSubject=null
- }
- param = this.queryParams;
- param.erpPhone=this.erpPhoneValue;
- }
-
- editErpPhone(param).then(response=>{
- this.msgSuccess("修改成功");
- this.setPhoneOpen = false;
- this.getList();
- })
- },
- setErpPhone(){
- this.getErpPhoneList();
- this.setPhoneOpen = true;
- },
- // 设置推送手机相关方法
- handleErpPhone(){
- //查询配置手机号
- this.getErpPhoneList();
- this.erpPhone.open = true
- },
- getErpPhoneList(){
- queryErpPhone().then(response =>{
- if(response.data && response.data != null && response.data.length >0){
- const phones = response.data.filter(phone => phone.trim());
- this.phoneList = phones.map(phone => ({
- phone: phone.trim(),
- editing: false,
- originalPhone: phone.trim()
- }));
- }
-
- // 保存原始数据用于取消操作
- this.originalPhoneList = this.phoneList;
- });
- },
- // 新增手机号
- handleAddPhone() {
- this.phoneList.push({
- phone: '',
- editing: true,
- originalPhone: '',
- isNew: true
- });
- },
- // 编辑手机号
- handleEditPhone(index) {
- this.$set(this.phoneList[index], 'editing', true);
- this.$set(this.phoneList[index], 'originalPhone', this.phoneList[index].phone);
- },
- // 保存手机号
- handleSavePhone(index) {
- const phone = this.phoneList[index].phone.trim();
- if (!phone) {
- this.$message.error('手机号不能为空');
- return;
- }
- if (!this.validatePhoneFormat(phone)) {
- this.$message.error('请输入正确的手机号格式');
- return;
- }
- // 检查是否重复
- const duplicateIndex = this.phoneList.findIndex((item, idx) =>
- idx !== index && item.phone === phone
- );
- if (duplicateIndex !== -1) {
- this.$message.error('手机号已存在');
- return;
- }
- this.$set(this.phoneList[index], 'editing', false);
- this.$set(this.phoneList[index], 'isNew', false);
- },
- // 取消编辑
- handleCancelEdit(index) {
- if (this.phoneList[index].isNew) {
- // 如果是新增的,直接删除
- this.phoneList.splice(index, 1);
- } else {
- // 如果是编辑的,恢复原值
- this.$set(this.phoneList[index], 'phone', this.phoneList[index].originalPhone);
- this.$set(this.phoneList[index], 'editing', false);
- }
- },
- // 删除手机号
- handleDeletePhone(index) {
- this.$confirm('确认删除该手机号?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- this.phoneList.splice(index, 1);
- this.$message.success('删除成功');
- });
- },
- // 验证手机号格式
- validatePhoneFormat(phone) {
- const phoneRegex = /^1[3-9]\d{9}$/;
- return phoneRegex.test(phone);
- },
- // 验证手机号
- validatePhone(row) {
- if (row.phone && !this.validatePhoneFormat(row.phone)) {
- this.$message.error('请输入正确的手机号格式');
- }
- },
- // 保存手机号列表
- handleSavePhoneList() {
- // 检查是否有正在编辑的项
- const editingItem = this.phoneList.find(item => item.editing);
- if (editingItem) {
- this.$message.error('请先保存正在编辑的手机号');
- return;
- }
-
- // 检查是否有空的手机号
- const emptyPhone = this.phoneList.find(item => !item.phone.trim());
- if (emptyPhone) {
- this.$message.error('存在空的手机号,请删除或填写完整');
- return;
- }
-
- // 构造手机号列表
- const phoneList = this.phoneList.map(item => item.phone);
-
- // 调用保存接口
- saveErpPhone(phoneList).then(response => {
- if (response.code === 200) {
- this.$message.success('保存成功');
- this.erpPhone.open = false;
- } else {
- this.$message.error(response.msg || '保存失败');
- }
- this.getList();
- }).catch(() => {
- this.$message.error('保存失败');
- });
- },
- // 取消手机号对话框
- handleCancelPhoneDialog() {
- // 恢复原始数据
- this.phoneList = JSON.parse(JSON.stringify(this.originalPhoneList));
- this.erpPhone.open = false;
- },
-
- handleImportExpress() {
- this.importExpress.title = "导入";
- this.importExpress.open = true;
- },
- /** 下载模板操作 */
- importTemplateExpress() {
- importExpressTemplate().then(response => {
- this.download(response.msg);
- });
- },
- // 文件上传中处理
- handleFileUploadProgressExpress(event, file, fileList) {
- this.upload.isUploading = true;
- },
- // 文件上传中处理
- handleFileUploadProgressOrder(event, file, fileList) {
- this.uploadStatus.isUploading = true;
- },
- // 文件上传成功处理
- handleFileSuccessExpress(response, file, fileList) {
- this.importExpress.open = false;
- this.importExpress.isUploading = false;
- this.$refs.importExpress.clearFiles();
- this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
- this.getList();
- },
- // 文件上传成功处理
- handleFileSuccessOrder(response, file, fileList) {
- this.uploadStatus.open = false;
- this.uploadStatus.isUploading = false;
- this.$refs.uploadStatus.clearFiles();
- this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
- this.getList();
- },
-
- // 提交上传文件
- submitFileFormExpress() {
- this.$refs.importExpress.submit();
- },
- handleImportStatus() {
- this.uploadStatus.title = "导入";
- this.uploadStatus.open = true;
- },
- /** 导入按钮操作 */
- handleImport() {
- this.upload.title = "导入";
- this.upload.open = true;
- },
- /** 下载模板操作 */
- importTemplate() {
- importTemplate().then(response => {
- this.download(response.msg);
- });
- },
- importUpdateOrderTemplate(){
- importUpdateOrderTemplate().then(response => {
- this.download(response.msg);
- });
- },
- // 文件上传中处理
- handleFileUploadProgress(event, file, fileList) {
- this.upload.isUploading = true;
- },
- // 文件上传成功处理
- handleFileSuccess(response, file, fileList) {
- this.upload.open = false;
- this.upload.isUploading = false;
- this.$refs.upload.clearFiles();
- this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
- this.getList();
- },
- // 提交上传文件
- submitFileForm() {
- this.$refs.upload.submit();
- },
- submitOrderStatusFileForm(){
- this.$refs.uploadStatus.submit();
- },
- handledetails(row){
- this.show.open=true;
- setTimeout(() => {
- this.$refs.Details.getDetails(row.orderId,row.nickName,row.storeName);
- }, 1);
- },
- getstoreList() {
- listStore().then(response => {
- this.storeOPtions = response.rows;
- });
- },
- // 取消按钮
- cancel() {
- this.open = false;
- this.reset();
- },
- // 表单重置
- reset() {
- this.form = {
- orderId: null,
- storeId: null,
- orderCode: null,
- userId: null,
- userName: null,
- userPhone: null,
- userAddress: null,
- cartId: null,
- totalNum: null,
- totalPrice: null,
- payPrice: null,
- payMoney: null,
- isPay: null,
- payTime: null,
- payType: null,
- createTime: null,
- updateTime: null,
- status: null,
- refundStatus: "0",
- refundImg: null,
- refundExplain: null,
- refundTime: null,
- refundReason: null,
- refundMoney: null,
- deliveryCode: null,
- deliveryName: null,
- deliverySn: null,
- remark: null,
- isDel: null,
- costPrice: null,
- verifyCode: null,
- shippingType: null,
- isChannel: null,
- isPrescribe: null,
- prescribeId: null,
- finishTime: null,
- deliveryTime: null,
- tuiMoney: null,
- tuiMoneyStatus: 0,
- tuiUserId: null,
- orderCreateType: null
- };
- this.resetForm("form");
- this.payTypeArr = null;
- this.scheduleIdArr = null;
- this.buyTypeArr = null;
- this.channelArr = null;
- this.qwSubjectArr = null;
- },
- /** 搜索按钮操作 */
- handleQuery() {
- this.queryParams.pageNum = 1;
- this.getList();
- },
- handleClickX(tab, event) {
- this.orderStatus = tab.name;
- if(tab.name=="10"){
- this.queryParams.status=null;
- }else{
- this.queryParams.status=tab.name;
- }
- this.handleQuery();
- },
- changeTime(){
- if(this.createTime!=null){
- this.queryParams.sTime=this.createTime[0];
- this.queryParams.eTime=this.createTime[1];
- }else{
- this.queryParams.sTime=null;
- this.queryParams.eTime=null;
- }
- if(this.deliverySendTime!=null){
- this.queryParams.deliverySendsTime=this.deliverySendTime[0];
- this.queryParams.deliverySendeTime=this.deliverySendTime[1];
- }else{
- this.queryParams.deliverySendsTime=null;
- this.queryParams.deliverySendeTime=null;
- }
- if(this.deliveryImportTime!=null){
- this.queryParams.deliveryImportsTime=this.deliveryImportTime[0];
- this.queryParams.deliveryImporteTime=this.deliveryImportTime[1];
- }else{
- this.queryParams.deliveryImportsTime=null;
- this.queryParams.deliveryImporteTime=null;
- }
- if(this.tuiMoneyTime!=null){
- this.queryParams.tuisTime=this.tuiMoneyTime[0];
- this.queryParams.tuieTime=this.tuiMoneyTime[1];
- }else{
- this.queryParams.tuisTime=null;
- this.queryParams.tuieTime=null;
- }
- },
- changePayTime(){
- if(this.payTime!=null){
- this.queryParams.sTime=this.payTime[0];
- this.queryParams.eTime=this.payTime[1];
- }else{
- this.queryParams.paysTime=null;
- this.queryParams.payeTime=null;
- }
- },
- /** 重置按钮操作 */
- resetQuery() {
- this.resetForm("queryForm");
- this.createTime=null;
- this.queryParams.sTime=null;
- this.queryParams.eTime=null;
- this.payTime=null;
- this.queryParams.paysTime=null;
- this.queryParams.payeTime=null;
- this.queryParams.deliveryImportTime = null;
- this.queryParams.deliveryImportsTime = null;
- this.queryParams.deliveryImporteTime = null;
- this.queryParams.deliverySendTime = null;
- this.queryParams.deliverySendsTime = null;
- this.queryParams.deliverySendeTime = null;
- this.queryParams.tuisTIme = null;
- this.queryParams.tuieTIme = null;
- this.companyIds = null;
- this.companyId = null;
- // 清除排序
- this.currentSort = {
- prop: null,
- order: null
- };
- this.queryParams.sortField = null;
- this.queryParams.sortOrder = null;
-
- // 清除订单号标签
- this.queryParams.orderCodes = [];
- this.currentInput = '';
- this.inputVisible = false;
- // 重置表格排序状态 - 关键代码
- this.$nextTick(() => {
- if (this.$refs.orderTable) {
- this.$refs.orderTable.clearSort();
- }
- });
-
- this.handleQuery();
- },
- // 多选框选中数据
- handleSelectionChange(selection) {
- this.ids = selection.map(item => item.orderId)
- this.single = selection.length!==1
- this.multiple = !selection.length
- },
- /** 新增按钮操作 */
- handleAdd() {
- this.reset();
- this.open = true;
- this.title = "添加订单";
- },
- /** 修改按钮操作 */
- handleUpdate(row) {
- this.reset();
- const orderId = row.orderId || this.ids
- getOrder(orderId).then(response => {
- this.form = response.data;
- this.open = true;
- this.title = "修改订单";
- });
- },
- /** 提交按钮 */
- submitForm() {
- this.$refs["form"].validate(valid => {
- if (valid) {
- if (this.form.orderId != null) {
- updateOrder(this.form).then(response => {
- this.msgSuccess("修改成功");
- this.open = false;
- this.getList();
- });
- } else {
- addOrder(this.form).then(response => {
- this.msgSuccess("新增成功");
- this.open = false;
- this.getList();
- });
- }
- }
- });
- },
- /** 删除按钮操作 */
- handleDelete(row) {
- const orderIds = row.orderId || this.ids;
- this.$confirm('是否确认删除订单编号为"' + orderIds + '"的数据项?', "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(function() {
- return delOrder(orderIds);
- }).then(() => {
- this.getList();
- this.msgSuccess("删除成功");
- }).catch(() => {});
- },
- /** 导出按钮操作 */
- handleExport() {
- var that=this;
- if(this.payTypeArr.length>0){
- this.queryParams.payType=this.payTypeArr.toString();
- }
- else{
- this.queryParams.payType=null
- }
- if(this.scheduleIdArr.length>0){
- this.queryParams.scheduleId=this.scheduleIdArr.toString();
- }
- else{
- this.queryParams.scheduleId=null
- }
- if(this.buyTypeArr.length>0){
- this.queryParams.orderBuyType=this.buyTypeArr.toString();
- }
- else{
- this.queryParams.orderbuyType=null
- }
- if(this.channelArr.length>0){
- this.queryParams.orderChannel=this.channelArr.toString();
- }
- else{
- this.queryParams.orderChannel=null
- }
- if(this.qwSubjectArr.length>0){
- this.queryParams.qwSubject=this.qwSubjectArr.toString();
- }
- else{
- this.queryParams.qwSubject=null
- }
- const queryParams = this.queryParams;
- this.$confirm('是否确认导出所有订单数据项?', "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- this.exportLoading = true;
- return exportOrder(queryParams);
- }).then(response => {
- console.log(response)
- if(response.code==200){
-
- that.msgSuccess(response.msg);
- that.taskId=response.data;
- that.time=setInterval(function(){
- //查订单
- getTask(that.taskId).then(res => {
- if(res.data.status==1){
- that.exportLoading = false;
- clearTimeout(that.time)
- that.time=null;
- that.download(res.data.fileUrl);
- }
- });
- },10000);
- }
- }).catch(() => {});
- },
- /** 导出按钮操作 */
- handleOrderExport() {
- // 打开字段选择对话框
- this.exportFieldDialog.open = true;
- },
-
- // 导出字段选择相关方法
- // 全选字段
- selectAllFields() {
- this.exportFieldOptions.forEach(field => {
- field.checked = true;
- });
- },
-
- // 全不选字段
- unselectAllFields() {
- this.exportFieldOptions.forEach(field => {
- field.checked = false;
- });
- },
-
- // 选择常用字段
- selectDefaultFields() {
- // 先全不选
- this.unselectAllFields();
- // 然后选择常用字段
- const defaultFields = ['orderCode', 'prescribeCode', 'companyName', 'companyUserNickName',
- 'storeName', 'miniProgramName', 'userName', 'userPhone', 'userAddress', 'totalPrice',
- 'totalNum', 'payPrice', 'payMoney', 'createTime', 'payTime',
- 'payType', 'status', 'packageName', 'patientName'];
- this.exportFieldOptions.forEach(field => {
- if (defaultFields.includes(field.key)) {
- field.checked = true;
- }
- });
- },
-
- // 获取已选择字段数量
- getSelectedFieldsCount() {
- return this.exportFieldOptions.filter(field => field.checked).length;
- },
-
- // 取消导出字段选择
- cancelExportFieldDialog() {
- this.exportFieldDialog.open = false;
- },
-
- // 确认导出字段
- confirmExportFields() {
- // 获取已选择的字段
- const selectedFieldsArray = this.exportFieldOptions.filter(field => field.checked);
-
- let selectedFields = '';
- if (selectedFieldsArray.length === 0) {
- // 如果没有选择任何字段,则导出全部字段(不传filter参数)
- selectedFields = null;
- } else {
- // 如果选择了字段,则只导出选中的字段
- selectedFields = selectedFieldsArray.map(field => field.key).join(',');
- }
-
- // 关闭弹窗
- this.exportFieldDialog.open = false;
-
- // 执行导出操作
- this.doExportOrder(selectedFields);
- },
-
- // 执行导出操作
- doExportOrder(selectedFields) {
- var that = this;
-
- // 处理查询参数
- if(this.payTypeArr.length>0){
- this.queryParams.payType=this.payTypeArr.toString();
- } else {
- this.queryParams.payType=null
- }
-
- if(this.scheduleIdArr.length>0){
- this.queryParams.scheduleId=this.scheduleIdArr.toString();
- } else {
- this.queryParams.scheduleId=null
- }
-
- if(this.buyTypeArr.length>0){
- this.queryParams.orderBuyType=this.buyTypeArr.toString();
- } else {
- this.queryParams.orderbuyType=null
- }
-
- if(this.channelArr.length>0){
- this.queryParams.orderChannel=this.channelArr.toString();
- } else {
- this.queryParams.orderChannel=null
- }
-
- if(this.qwSubjectArr.length>0){
- this.queryParams.qwSubject=this.qwSubjectArr.toString();
- } else {
- this.queryParams.qwSubject=null
- }
-
- const queryParams = this.queryParams;
-
- // 根据是否选择字段显示不同的确认消息
- let confirmMessage = '';
- if (selectedFields === null) {
- confirmMessage = '没有选择字段,将导出所有字段的订单数据,确认继续?';
- } else {
- const fieldCount = selectedFields.split(',').length;
- confirmMessage = `确认导出选中的 ${fieldCount} 个字段的订单数据?`;
- }
-
- this.$confirm(confirmMessage, "确认导出", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- this.exportLoading = true;
-
- // 构建请求参数
- const requestParams = {...queryParams};
- // 只有当selectedFields不为null时才添加filter参数
- if (selectedFields !== null) {
- requestParams.filter = selectedFields;
- }
-
- return exportOrder2(requestParams);
- }).then(response => {
- console.log(response)
- if(response.code==200){
- console.log(response.msg)
- that.msgSuccess(response.msg);
- that.taskId=response.data;
- that.time=setInterval(function(){
- //查订单
- getTask(that.taskId).then(res => {
- if(res.data.status==1){
- that.exportLoading = false;
- clearTimeout(that.time)
- that.time=null;
- that.download(res.data.fileUrl);
- }
- });
- },10000);
- }
- }).catch(() => {
- this.exportLoading = false;
- });
- },
- /** 查询部门下拉树结构 */
- getTreeselect() {
- var that=this;
- var param={companyId:this.companyId}
- treeselect(param).then((response) => {
- this.deptOptions = response.data;
- console.log(this.deptOptions)
- if(response.data!=null&&response.data.length>0){
- //this.queryParams.deptId=response.data[0].id;
- }
- });
- },
- companyChange(val){
- console.log(this.companyIds);
- if(this.companyIds.length>1){
- this.deptOpen = false;
- } else {
- this.deptOpen = true
- if(this.companyIds.length=1){
- this.companyId=this.companyIds[0];
- this.getTreeselect();
- }
- }
-
- },
- // companyChange(val){
- // console.log(val);
- // this.companyId=val;
- // this.getTreeselect();
- // },
- currDeptChange(val){
- console.log(val)
- this.queryParams.deptId=val;
- this.getList();
- },
- // 获取小程序选项列表
- getAppMallOptions() {
- getAppMallOptions({pageNum:1,pageSize:100,isMall:1}).then(response => {
- this.appMallOptions = response.rows;
- })
- },
- }
- };
- </script>
- <style scoped>
- .tag-input-order-search {
- padding: 20px;
- background: #fff;
- border-radius: 4px;
- }
- .tag-input-container {
- min-width: 445px;
- }
- .tags-wrapper {
- min-height: 32px;
- padding: 4px 8px;
- border: 1px solid #dcdfe6;
- border-radius: 4px;
- cursor: text;
- display: flex;
- flex-wrap: wrap;
- align-items: center;
- gap: 4px;
- transition: border-color 0.2s;
- }
- .tags-wrapper:hover {
- border-color: #c0c4cc;
- }
- .tags-wrapper:focus-within {
- border-color: #409eff;
- box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
- }
- .order-tag {
- margin: 2px;
- flex-shrink: 0;
- }
- .tag-error {
- background-color: #fef0f0;
- border-color: #fbc4c4;
- color: #f56c6c;
- }
- .tag-input {
- border: none;
- outline: none;
- flex: 1;
- min-width: 120px;
- }
- .tag-input >>> .el-input__inner {
- border: none;
- padding: 0;
- height: 24px;
- line-height: 24px;
- }
- .button-new-tag {
- height: 24px;
- line-height: 22px;
- padding: 0 8px;
- margin: 2px;
- }
- .input-tips {
- margin-top: 4px;
- font-size: 12px;
- color: #909399;
- }
- /* 新增排序相关样式 */
- .sort-info {
- margin-top: 10px;
- padding: 8px 0;
- }
- /* 表格布局优化 */
- .el-table {
- min-width: 100%;
- table-layout: fixed;
- }
- .el-table .el-table__body-wrapper {
- overflow-x: auto;
- }
- .tip-text {
- display: flex;
- align-items: center;
- gap: 8px;
- }
- .quick-actions {
- margin-top: 12px;
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 8px 0;
- border-top: 1px solid #ebeef5;
- }
- .stats-info {
- font-size: 12px;
- color: #909399;
- display: flex;
- align-items: center;
- gap: 4px;
- }
- .invalid-codes-list {
- margin: 16px 0;
- max-height: 200px;
- overflow-y: auto;
- }
- .invalid-tag {
- margin: 4px;
- }
- .debug-preview {
- margin-top: 20px;
- }
- .debug-content {
- font-size: 12px;
- }
- .debug-content code {
- display: block;
- background: #f5f5f5;
- padding: 8px;
- border-radius: 4px;
- margin: 4px 0 12px 0;
- white-space: pre-wrap;
- }
- /* 响应式设计 */
- @media (max-width: 768px) {
- .tag-input-container {
- min-width: auto;
- width: 100%;
- }
-
- .tags-wrapper {
- min-height: 40px;
- }
-
- .quick-actions {
- flex-direction: column;
- align-items: flex-start;
- gap: 8px;
- }
- }
- </style>
|