order1.vue 86 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
  4. <el-form-item label="公司名" prop="companyId">
  5. <el-select filterable v-model="companyIds" placeholder="请选择公司名" multiple @change="companyChange" clearable size="small">
  6. <el-option
  7. v-for="item in companys"
  8. :key="item.companyId"
  9. :label="item.companyName"
  10. :value="item.companyId"
  11. />
  12. </el-select>
  13. </el-form-item>
  14. <el-form-item v-if="deptOpen">
  15. <treeselect style="width: 220px" :clearable="false" v-model="queryParams.deptId" :options="deptOptions" clearable :show-count="true" placeholder="请选择归属部门" />
  16. </el-form-item>
  17. <el-form-item label="会员ID" prop="userId">
  18. <el-input
  19. v-model="queryParams.userId"
  20. placeholder="请输入会员ID"
  21. clearable
  22. size="small"
  23. @keyup.enter.native="handleQuery"
  24. />
  25. </el-form-item>
  26. <el-form-item label="店铺" prop="storeId">
  27. <el-select v-model="queryParams.storeId" placeholder="店铺" clearable size="small" filterable>
  28. <el-option
  29. v-for="dict in storeOPtions"
  30. :key="dict.dictValue"
  31. :label="dict.dictLabel"
  32. :value="dict.dictValue"
  33. />
  34. </el-select>
  35. </el-form-item>
  36. <el-form-item label="订单号" prop="orderCodes">
  37. <div class="tag-input-container">
  38. <!-- 标签显示区域 -->
  39. <div class="tags-wrapper" @click="focusInput">
  40. <!-- 已添加的订单号标签 -->
  41. <el-tag
  42. v-for="(code, index) in queryParams.orderCodes"
  43. :key="index"
  44. closable
  45. size="small"
  46. @close="removeOrderCode(index)"
  47. class="order-tag"
  48. :class="{ 'tag-error': false }"
  49. >
  50. {{ code }}
  51. </el-tag>
  52. <!-- 输入框 -->
  53. <el-input
  54. ref="tagInput"
  55. v-model="currentInput"
  56. v-show="inputVisible || queryParams.orderCodes.length === 0"
  57. :placeholder="queryParams.orderCodes.length === 0 ? '请输入订单号,按回车或逗号分隔' : '继续输入...'"
  58. size="small"
  59. class="tag-input"
  60. @keydown.native="handleKeyDown"
  61. @keyup.native="handleKeyUp"
  62. @blur="handleInputConfirm"
  63. @focus="inputVisible = true"
  64. clearable
  65. />
  66. <!-- 添加按钮(当没有输入时显示) -->
  67. <el-button
  68. v-if="!inputVisible && queryParams.orderCodes.length > 0"
  69. class="button-new-tag"
  70. size="small"
  71. @click="showInput"
  72. icon="el-icon-plus"
  73. type="text"
  74. >
  75. 添加订单号
  76. </el-button>
  77. </div>
  78. <!-- 输入提示 -->
  79. <div class="input-tips">
  80. <span class="tip-text">
  81. 支持:回车、逗号、空格分隔 |
  82. 已添加 {{ queryParams.orderCodes.length }} 个订单号
  83. <span v-if="maxOrderCodes > 0"> (最多{{ maxOrderCodes }}个)</span>
  84. </span>
  85. </div>
  86. </div>
  87. </el-form-item>
  88. <el-form-item label="快递单号" prop="deliverySn">
  89. <el-input
  90. v-model="queryParams.deliverySn"
  91. placeholder="请输入快递单号"
  92. clearable
  93. size="small"
  94. @keyup.enter.native="handleQuery"
  95. />
  96. </el-form-item>
  97. <el-form-item label="处方单号" prop="prescribeCode">
  98. <el-input
  99. v-model="queryParams.prescribeCode"
  100. placeholder="请输入处方单号"
  101. clearable
  102. size="small"
  103. @keyup.enter.native="handleQuery"
  104. />
  105. </el-form-item>
  106. <el-form-item label="支付方式" prop="payType">
  107. <el-select multiple v-model="payTypeArr" placeholder="请选择支付方式" clearable filterable size="small" >
  108. <el-option
  109. v-for="item in PayOptions"
  110. :key="'type'+item.dictValue"
  111. :label="item.dictLabel"
  112. :value="item.dictValue"
  113. />
  114. </el-select>
  115. </el-form-item>
  116. <el-form-item label="员工姓名" prop="companyUserNickName">
  117. <el-input
  118. v-model="queryParams.companyUserNickName"
  119. placeholder="请输入员工姓名"
  120. clearable
  121. size="small"
  122. @keyup.enter.native="handleQuery"
  123. />
  124. </el-form-item>
  125. <el-form-item label="套餐名称" prop="packageName">
  126. <el-input
  127. v-model="queryParams.packageName"
  128. placeholder="请输套餐名称"
  129. clearable
  130. size="small"
  131. @keyup.enter.native="handleQuery"
  132. />
  133. </el-form-item>
  134. <el-form-item label="套餐别名" prop="packageSecondName">
  135. <el-input
  136. v-model="queryParams.packageSecondName"
  137. placeholder="请输套餐别名"
  138. clearable
  139. size="small"
  140. @keyup.enter.native="handleQuery"
  141. />
  142. </el-form-item>
  143. <el-form-item label="收货人" prop="userName">
  144. <el-input
  145. v-model="queryParams.userName"
  146. placeholder="请输入收货人"
  147. clearable
  148. size="small"
  149. @keyup.enter.native="handleQuery"
  150. />
  151. </el-form-item>
  152. <el-form-item label="电话" prop="userPhone">
  153. <el-input
  154. v-model="queryParams.userPhone"
  155. placeholder="请输入收货人电话"
  156. clearable
  157. size="small"
  158. @keyup.enter.native="handleQuery"
  159. />
  160. </el-form-item>
  161. <el-form-item label="加密号码" prop="userPhoneMk">
  162. <el-input
  163. v-model="queryParams.userPhoneMk"
  164. placeholder="请输入收货人电话"
  165. clearable
  166. size="small"
  167. @keyup.enter.native="handleQuery"
  168. />
  169. </el-form-item>
  170. <el-form-item label="医生姓名" prop="doctorName">
  171. <el-input
  172. v-model="queryParams.doctorName"
  173. placeholder="请输入医生姓名"
  174. clearable
  175. size="small"
  176. @keyup.enter.native="handleQuery"
  177. />
  178. </el-form-item>
  179. <el-form-item label="患者姓名" prop="patientName">
  180. <el-input
  181. v-model="queryParams.patientName"
  182. placeholder="请输入患者姓名"
  183. clearable
  184. size="small"
  185. @keyup.enter.native="handleQuery"
  186. />
  187. </el-form-item>
  188. <el-form-item label="物流状态" prop="deliveryStatus">
  189. <el-select v-model="queryParams.deliveryStatus" placeholder="请选择物流状态" clearable size="small" >
  190. <el-option
  191. v-for="item in deliveryStatusOptions"
  192. :key="item.dictValue"
  193. :label="item.dictLabel"
  194. :value="item.dictValue"
  195. />
  196. </el-select>
  197. </el-form-item>
  198. <el-form-item label="结算状态" prop="deliveryPayStatus">
  199. <el-select style="width: 200px" v-model="queryParams.deliveryPayStatus" placeholder="请选择物流结算状态" clearable size="small" >
  200. <el-option
  201. v-for="item in deliveryPayStatusOptions"
  202. :key="item.dictValue"
  203. :label="item.dictLabel"
  204. :value="item.dictValue"
  205. />
  206. </el-select>
  207. </el-form-item>
  208. <el-form-item label="订单类型" prop="orderType">
  209. <el-select filterable v-model="queryParams.orderType" placeholder="状态" clearable size="small">
  210. <el-option
  211. v-for="dict in orderTypeOptions"
  212. :key="dict.dictValue"
  213. :label="dict.dictLabel"
  214. :value="dict.dictValue"
  215. />
  216. </el-select>
  217. </el-form-item>
  218. <el-form-item label="是否首次进线" prop="isFirst">
  219. <el-select filterable v-model="queryParams.isFirst" placeholder="状态" clearable size="small">
  220. <el-option
  221. v-for="dict in orOptions"
  222. :key="dict.dictValue"
  223. :label="dict.dictLabel"
  224. :value="dict.dictValue"
  225. />
  226. </el-select>
  227. </el-form-item>
  228. <el-form-item label="档期归属" prop="scheduleId" >
  229. <el-select multiple filterable style="width: 200px" v-model="scheduleIdArr" placeholder="请选择档期" clearable size="small" >
  230. <el-option
  231. v-for="item in scheduleOptions"
  232. :key="'scheduleId'+item.id"
  233. :label="item.name"
  234. :value="item.id"
  235. />
  236. </el-select>
  237. </el-form-item>
  238. <el-form-item label="订单购买类型" prop="orderBuyType">
  239. <el-select multiple filterable style="width: 200px" v-model="buyTypeArr" placeholder="请选择购买类型" clearable size="small" >
  240. <el-option
  241. v-for="item in orderBuyTypeOptions"
  242. :key="'bugType'+item.dictValue"
  243. :label="item.dictLabel"
  244. :value="item.dictValue"
  245. />
  246. </el-select>
  247. </el-form-item>
  248. <el-form-item label="渠道" prop="channel">
  249. <el-select multiple filterable style="width: 200px" v-model="channelArr" placeholder="请选择渠道" clearable size="small" >
  250. <el-option
  251. v-for="item in channelOptions"
  252. :key="'channel'+item.dictValue"
  253. :label="item.dictLabel"
  254. :value="item.dictValue"
  255. />
  256. </el-select>
  257. </el-form-item>
  258. <el-form-item label="企微主体" prop="qwSubject">
  259. <el-select multiple filterable style="width: 200px" v-model="qwSubjectArr" placeholder="请选择企微主体" clearable size="small" >
  260. <el-option
  261. v-for="item in qwSubjectOptions"
  262. :key="'qwSubject'+item.dictValue"
  263. :label="item.dictLabel"
  264. :value="item.dictValue"
  265. />
  266. </el-select>
  267. </el-form-item>
  268. <el-form-item label="推广佣金状态" prop="tuiMoneyStatus">
  269. <el-select filterable style="width: 200px" v-model="queryParams.tuiMoneyStatus" placeholder="请选择推广佣金状态" clearable size="small" >
  270. <el-option
  271. v-for="item in tuiOptions"
  272. :key="item.dictValue"
  273. :label="item.dictLabel"
  274. :value="item.dictValue"
  275. />
  276. </el-select>
  277. </el-form-item>
  278. <el-form-item label="订单来源" prop="source">
  279. <el-select v-model="queryParams.source" placeholder="请选择是否支付" clearable size="small">
  280. <el-option
  281. v-for="dict in sourceOptions"
  282. :key="dict.dictValue"
  283. :label="dict.dictLabel"
  284. :value="dict.dictValue"
  285. />
  286. </el-select>
  287. </el-form-item>
  288. <el-form-item label="所属小程序" prop="coursePlaySourceConfigId">
  289. <el-select v-model="queryParams.coursePlaySourceConfigId" placeholder="请选择所属小程序" clearable size="small">
  290. <el-option
  291. v-for="dict in appMallOptions"
  292. :key="dict.id"
  293. :label="dict.name + '(' + dict.appid + ')'"
  294. :value="dict.id"
  295. />
  296. </el-select>
  297. </el-form-item>
  298. <el-form-item label="下单时间" prop="createTime">
  299. <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>
  300. </el-form-item>
  301. <el-form-item label="支付时间" prop="payTime">
  302. <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>
  303. </el-form-item>
  304. <el-form-item label="发货时间" prop="deliverySendTime">
  305. <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>
  306. </el-form-item>
  307. <el-form-item label="回单时间" prop="deliveryImportTime">
  308. <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>
  309. </el-form-item>
  310. <el-form-item label="入账时间" prop="tuiMoneyTime">
  311. <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>
  312. </el-form-item>
  313. <el-form-item label="ERP账户" prop="erpAccount" v-if="SFDFopen">
  314. <el-select v-model="queryParams.erpAccount" placeholder="ERP账户" clearable size="small">
  315. <el-option
  316. v-for="dict in erpAccountQueryList"
  317. :key="dict"
  318. :label="dict"
  319. :value="dict"
  320. />
  321. </el-select>
  322. </el-form-item>
  323. <el-form-item label="ERP电话" prop="erpPhoneNumber" v-if="SFDFopen">
  324. <el-input
  325. v-model="queryParams.erpPhoneNumber"
  326. placeholder="ERP电话"
  327. clearable
  328. size="small"
  329. @keyup.enter.native="handleQuery"
  330. />
  331. </el-form-item>
  332. <el-form-item>
  333. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  334. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  335. </el-form-item>
  336. </el-form>
  337. <el-row :gutter="10" class="mb8">
  338. <el-col :span="1.5">
  339. <el-button
  340. type="warning"
  341. plain
  342. icon="el-icon-download"
  343. size="mini"
  344. :loading="exportLoading"
  345. @click="handleExport"
  346. v-hasPermi="['his:storeOrder:export']"
  347. >财务导出</el-button>
  348. </el-col>
  349. <el-col :span="1.5">
  350. <el-button
  351. type="warning"
  352. plain
  353. icon="el-icon-download"
  354. size="mini"
  355. :loading="exportLoading"
  356. @click="handleOrderExport"
  357. v-hasPermi="['store:storeOrder:export']"
  358. >导出订单</el-button>
  359. </el-col>
  360. <el-col :span="1.5">
  361. <el-button
  362. type="info"
  363. plain
  364. icon="el-icon-upload2"
  365. size="mini"
  366. @click="handleImport"
  367. v-hasPermi="['his:storeOrder:exportDeliver']"
  368. >导入发货</el-button>
  369. </el-col>
  370. <el-col :span="1.5">
  371. <el-button
  372. type="info"
  373. plain
  374. icon="el-icon-upload2"
  375. size="mini"
  376. @click="handleImportStatus"
  377. v-hasPermi="['his:storeOrder:editImport']"
  378. >导入订单状态</el-button>
  379. </el-col>
  380. <el-col :span="1.5">
  381. <el-button
  382. type="info"
  383. plain
  384. icon="el-icon-upload2"
  385. size="mini"
  386. @click="handleImportExpress"
  387. v-hasPermi="['store:storeOrder:importExpress']"
  388. >导入银行回单</el-button>
  389. </el-col>
  390. <el-col :span="1.5" v-if="SFDFopen && orderStatus == 6"> <!--待推送erp-->
  391. <el-tooltip content="默认erp推送手机号" placement="top">
  392. <el-button
  393. type="warning"
  394. plain
  395. icon="el-icon-phone"
  396. size="mini"
  397. @click="handleErpPhone"
  398. v-hasPermi="['store:storeOrder:erpphone']"
  399. >推送手机号码</el-button>
  400. </el-tooltip>
  401. </el-col>
  402. <el-col :span="1.5" v-if="SFDFopen && orderStatus == 6">
  403. <el-tooltip content="批量设置erp推送手机号" placement="top">
  404. <el-button
  405. type="warning"
  406. plain
  407. icon="el-icon-phone"
  408. size="mini"
  409. @click="setErpPhone"
  410. v-hasPermi="['his:storeOrder:createErpOrder']"
  411. >设置推送手机</el-button>
  412. </el-tooltip>
  413. </el-col>
  414. <el-col :span="1.5" v-if="SFDFopen && orderStatus == 6">
  415. <el-tooltip content="批量设置erp账户" placement="top">
  416. <el-button
  417. type="warning"
  418. plain
  419. icon="el-icon-s-cooperation"
  420. size="mini"
  421. @click="showErpAccountSetDialog"
  422. v-hasPermi="['his:storeOrder:createErpOrder']"
  423. >数据分捡</el-button>
  424. </el-tooltip>
  425. </el-col>
  426. <el-col :span="1.5" v-if="SFDFopen && orderStatus == 6">
  427. <el-tooltip content="批量推送erp" placement="top">
  428. <el-button
  429. type="warning"
  430. plain
  431. icon="el-icon-s-cooperation"
  432. size="mini"
  433. @click="showErpAccountDialog"
  434. v-hasPermi="['his:storeOrder:createErpOrder']"
  435. >创建erp</el-button>
  436. </el-tooltip>
  437. </el-col>
  438. <el-col :span="1.5">
  439. <el-button
  440. disabled
  441. plain
  442. type="primary"
  443. size="mini"
  444. >应付金额: {{ payPriceTotal}}</el-button>
  445. </el-col>
  446. <el-col :span="1.5">
  447. <el-button
  448. disabled
  449. plain
  450. type="primary"
  451. size="mini"
  452. >实付金额: {{payMoneyTotal}}</el-button>
  453. </el-col>
  454. <el-col :span="1.5">
  455. <el-button
  456. disabled
  457. plain
  458. type="primary"
  459. size="mini"
  460. >物流代收金额: {{payRemainTotal }}</el-button>
  461. </el-col>
  462. <el-col :span="1.5">
  463. <el-button
  464. disabled
  465. plain
  466. type="primary"
  467. size="mini"
  468. >订单量/金额: {{ total }}/{{payPriceTotal }}</el-button>
  469. </el-col>
  470. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  471. </el-row>
  472. <el-tabs type="card" v-model="actName" @tab-click="handleClickX">
  473. <el-tab-pane label="全部订单" name="10"></el-tab-pane>
  474. <el-tab-pane v-for="(item,index) in orderOptions" :label="item.dictLabel" :name="item.dictValue"></el-tab-pane>
  475. </el-tabs>
  476. <el-table ref="orderTable" height="500" v-loading="loading" border :data="orderList" @selection-change="handleSelectionChange"
  477. @sort-change="handleSortChange" :default-sort="{prop: 'createTime', order: 'descending'}">
  478. <el-table-column type="selection" width="55" align="center" />
  479. <el-table-column label="ERP电话" align="center" prop="erpPhone" width="120px" v-if="SFDFopen && orderStatus!=null && orderStatus != 1"/>
  480. <el-table-column label="ERP账号" align="center" prop="erpAccount" width="120px" v-if="SFDFopen && orderStatus!=null && orderStatus != 1"/>
  481. <el-table-column label="处方单编号" align="center" prop="prescribeCode" width="180px"/>
  482. <el-table-column label="药品订单号" align="center" prop="orderCode" width="180px"/>
  483. <el-table-column label="所属公司" align="center" prop="companyName" />
  484. <el-table-column label="员工" align="center" prop="companyUserName" sortable="custom" :sort-orders="['ascending', 'descending']">
  485. <template slot="header" slot-scope="scope">
  486. <span>员工</span>
  487. <el-tooltip content="按员工姓名排序" placement="top"/>
  488. </template>
  489. </el-table-column>
  490. <el-table-column label="店铺名称" align="center" prop="storeName" />
  491. <el-table-column label="小程序名称" align="center" prop="miniProgramName" width="120px" />
  492. <el-table-column label="就诊人" align="center" prop="patientName" />
  493. <el-table-column label="收货人" align="center" prop="userName" />
  494. <el-table-column label="套餐名称" align="center" prop="packageName" width="100px" sortable="custom" :sort-orders="['ascending', 'descending']">
  495. <template slot="header" slot-scope="scope">
  496. <span>套餐名称</span>
  497. <el-tooltip content="按套餐名称排序" placement="top"/>
  498. </template>
  499. </el-table-column>
  500. <el-table-column label="套餐别名" align="center" prop="packageSecondName" width="100px"/>
  501. <el-table-column label="应收金额" align="center" prop="payPrice" width="100px" sortable="custom" :sort-orders="['ascending', 'descending']">
  502. <template slot="header" slot-scope="scope">
  503. <span>应收金额</span>
  504. <el-tooltip content="按应收金额排序" placement="top"/>
  505. </template>
  506. </el-table-column>
  507. <el-table-column label="实收金额" align="center" prop="payMoney" width="100px" sortable="custom" :sort-orders="['ascending', 'descending']">
  508. <template slot="header" slot-scope="scope">
  509. <span>实收金额</span>
  510. <el-tooltip content="按实收金额排序" placement="top"/>
  511. </template>
  512. </el-table-column>
  513. <el-table-column label="支付方式" align="center" prop="payType" >
  514. <template slot-scope="scope">
  515. <dict-tag :options="PayOptions" :value="scope.row.payType"/>
  516. </template>
  517. </el-table-column>
  518. <el-table-column label="下单时间" align="center" prop="createTime" width="180" />
  519. <el-table-column label="支付时间" align="center" prop="payTime" width="180" />
  520. <el-table-column label="订单状态" align="center" prop="status" >
  521. <template slot-scope="scope">
  522. <dict-tag :options="orderOptions" :value="scope.row.status"/>
  523. </template>
  524. </el-table-column>
  525. <el-table-column label="订单来源" align="center" prop="source" >
  526. <template slot-scope="scope">
  527. <dict-tag :options="sourceOptions" :value="scope.row.source"/>
  528. </template>
  529. </el-table-column>
  530. <el-table-column label="物流状态" align="center" prop="deliveryStatus" >
  531. <template slot-scope="scope">
  532. <dict-tag :options="deliveryStatusOptions" :value="scope.row.deliveryStatus"/>
  533. </template>
  534. </el-table-column>
  535. <el-table-column label="结算状态" align="center" prop="deliveryPayStatus" >
  536. <template slot-scope="scope">
  537. <dict-tag :options="deliveryPayStatusOptions" :value="scope.row.deliveryPayStatus"/>
  538. </template>
  539. </el-table-column>
  540. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="100px" fixed="right">
  541. <template slot-scope="scope">
  542. <el-button
  543. size="mini"
  544. type="text"
  545. @click="handledetails(scope.row)"
  546. >查看
  547. </el-button>
  548. </template>
  549. </el-table-column>
  550. </el-table>
  551. <div>
  552. 商品数量合计:{{ productInfo }}
  553. </div>
  554. <pagination
  555. v-show="total>0"
  556. :total="total"
  557. :page.sync="queryParams.pageNum"
  558. :limit.sync="queryParams.pageSize"
  559. @pagination="getList"
  560. />
  561. <!-- 排序状态显示 -->
  562. <div v-if="currentSort.prop" class="sort-info">
  563. <el-tag size="small" type="info" closable @close="clearSort">
  564. <i class="el-icon-sort"></i>
  565. 当前排序:{{ getSortLabel(currentSort.prop) }}
  566. {{ currentSort.order === 'ascending' ? '升序' : '降序' }}
  567. </el-tag>
  568. <el-button
  569. type="text"
  570. size="mini"
  571. @click="clearSort"
  572. style="margin-left: 8px; color: #909399;"
  573. >
  574. </el-button>
  575. </div>
  576. <el-drawer
  577. :with-header="false"
  578. size="75%"
  579. :title="show.title" :visible.sync="show.open">
  580. <storeOrderDetails ref="Details" />
  581. </el-drawer>
  582. <!-- 用户导入对话框 -->
  583. <el-dialog :title="importExpress.title" :visible.sync="importExpress.open" width="400px" append-to-body>
  584. <el-upload
  585. ref="importExpress"
  586. :limit="1"
  587. accept=".xlsx, .xls"
  588. :headers="importExpress.headers"
  589. :action="importExpress.url + '?updateSupport=' + importExpress.updateSupport"
  590. :disabled="importExpress.isUploading"
  591. :on-progress="handleFileUploadProgressExpress"
  592. :on-success="handleFileSuccessExpress"
  593. :auto-upload="false"
  594. drag
  595. >
  596. <i class="el-icon-upload"></i>
  597. <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
  598. <div class="el-upload__tip text-center" slot="tip">
  599. <div class="el-upload__tip" slot="tip">
  600. <!-- <el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的数据 -->
  601. </div>
  602. <span>仅允许导入xls、xlsx格式文件。</span>
  603. <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplateExpress">下载模板</el-link>
  604. </div>
  605. </el-upload>
  606. <div slot="footer" class="dialog-footer">
  607. <el-button type="primary" @click="submitFileFormExpress">确 定</el-button>
  608. <el-button @click="importExpress.open = false">取 消</el-button>
  609. </div>
  610. </el-dialog>
  611. <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
  612. <el-upload
  613. ref="upload"
  614. :limit="1"
  615. accept=".xlsx, .xls"
  616. :headers="upload.headers"
  617. :action="upload.url + '?updateSupport=' + upload.updateSupport"
  618. :disabled="upload.isUploading"
  619. :on-progress="handleFileUploadProgress"
  620. :on-success="handleFileSuccess"
  621. :auto-upload="false"
  622. drag
  623. >
  624. <i class="el-icon-upload"></i>
  625. <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
  626. <div class="el-upload__tip text-center" slot="tip">
  627. <div class="el-upload__tip" slot="tip">
  628. </div>
  629. <span>仅允许导入xls、xlsx格式文件。</span>
  630. <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate">下载模板</el-link>
  631. </div>
  632. </el-upload>
  633. <div slot="footer" class="dialog-footer">
  634. <el-button type="primary" @click="submitFileForm">确 定</el-button>
  635. <el-button @click="upload.open = false">取 消</el-button>
  636. </div>
  637. </el-dialog>
  638. <el-dialog :title="uploadStatus.title" :visible.sync="uploadStatus.open" width="400px" append-to-body>
  639. <el-upload
  640. ref="uploadStatus"
  641. :limit="1"
  642. accept=".xlsx, .xls"
  643. :headers="uploadStatus.headers"
  644. :action="uploadStatus.url + '?updateSupport=' + upload.updateSupport"
  645. :disabled="uploadStatus.isUploading"
  646. :on-progress="handleFileUploadProgressOrder"
  647. :on-success="handleFileSuccessOrder"
  648. :auto-upload="false"
  649. drag
  650. >
  651. <i class="el-icon-upload"></i>
  652. <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
  653. <div class="el-upload__tip text-center" slot="tip">
  654. <div class="el-upload__tip" slot="tip">
  655. </div>
  656. <span>仅允许导入xls、xlsx格式文件。</span>
  657. <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importUpdateOrderTemplate">下载模板</el-link>
  658. </div>
  659. </el-upload>
  660. <div slot="footer" class="dialog-footer">
  661. <el-button type="primary" @click="submitOrderStatusFileForm">确 定</el-button>
  662. <el-button @click="uploadStatus.open = false">取 消</el-button>
  663. </div>
  664. </el-dialog>
  665. <!-- 设置推送手机对话框 -->
  666. <el-dialog :title="erpPhone.title" :visible.sync="erpPhone.open" width="600px" append-to-body>
  667. <div style="margin-bottom: 20px;">
  668. <el-button type="primary" size="small" @click="handleAddPhone">新增手机号</el-button>
  669. </div>
  670. <el-table :data="phoneList" border style="width: 100%">
  671. <el-table-column prop="phone" label="手机号" align="center">
  672. <template slot-scope="scope">
  673. <el-input
  674. v-if="scope.row.editing"
  675. v-model="scope.row.phone"
  676. placeholder="请输入手机号"
  677. @blur="validatePhone(scope.row)"
  678. @keyup.enter.native="handleSavePhone(scope.$index)"
  679. />
  680. <span v-else>{{ scope.row.phone }}</span>
  681. </template>
  682. </el-table-column>
  683. <el-table-column label="操作" align="center" width="300">
  684. <template slot-scope="scope">
  685. <el-button
  686. v-if="scope.row.editing"
  687. type="success"
  688. size="mini"
  689. @click="handleSavePhone(scope.$index)"
  690. >保存</el-button>
  691. <el-button
  692. v-if="scope.row.editing"
  693. type="info"
  694. size="mini"
  695. @click="handleCancelEdit(scope.$index)"
  696. >取消</el-button>
  697. <el-button
  698. v-if="!scope.row.editing"
  699. type="primary"
  700. size="mini"
  701. @click="handleEditPhone(scope.$index)"
  702. >修改</el-button>
  703. <el-button
  704. type="danger"
  705. size="mini"
  706. @click="handleDeletePhone(scope.$index)"
  707. >删除</el-button>
  708. </template>
  709. </el-table-column>
  710. </el-table>
  711. <div slot="footer" class="dialog-footer">
  712. <el-button type="primary" @click="handleSavePhoneList">确 定</el-button>
  713. <el-button @click="handleCancelPhoneDialog">取 消</el-button>
  714. </div>
  715. </el-dialog>
  716. <el-dialog :title="erpPhone.title" :visible.sync="setPhoneOpen" width="600px" append-to-body>
  717. <el-select v-model="erpPhoneValue" multiple placeholder="请选择">
  718. <el-option
  719. v-for="item in phoneList"
  720. :key="item.phone"
  721. :label="item.phone"
  722. :value="item.phone">
  723. </el-option>
  724. </el-select>
  725. <div slot="footer" class="dialog-footer">
  726. <el-button type="primary" @click="submitErpPhone">确 定</el-button>
  727. <el-button @click="handleCancelErpPhone">取 消</el-button>
  728. </div>
  729. </el-dialog>
  730. <!-- ERP账户选择对话框 -->
  731. <el-dialog :title="erpAccountDialog.title" :visible.sync="erpAccountDialog.open" width="600px" append-to-body>
  732. <div v-loading="erpAccountDialog.loading">
  733. <el-form :model="erpAccountForm" label-width="100px">
  734. <el-form-item label="ERP账户" required>
  735. <el-select
  736. v-model="erpAccountForm.selectedAccount"
  737. placeholder="请选择ERP账户"
  738. style="width: 100%"
  739. filterable
  740. >
  741. <el-option
  742. v-for="account in erpAccountList"
  743. :key="account"
  744. :label="account"
  745. :value="account"
  746. >
  747. <span style="float: left">{{ account}}</span>
  748. <span style="float: right; color: #8492a6; font-size: 13px">{{ account.accountCode }}</span>
  749. </el-option>
  750. </el-select>
  751. </el-form-item>
  752. </el-form>
  753. <!-- 订单统计信息 -->
  754. <div class="order-summary" v-if="orderSummary">
  755. <el-divider content-position="left">订单统计</el-divider>
  756. <el-row :gutter="20">
  757. <el-col :span="8">
  758. <div class="summary-item">
  759. <span class="label">选中订单数:</span>
  760. <span class="value">{{ orderSummary.selectedCount }}</span>
  761. </div>
  762. </el-col>
  763. <el-col :span="8">
  764. <div class="summary-item">
  765. <span class="label">总金额:</span>
  766. <span class="value">¥{{ orderSummary.totalAmount }}</span>
  767. </div>
  768. </el-col>
  769. <el-col :span="8">
  770. <div class="summary-item">
  771. <span class="label">查询条件订单:</span>
  772. <span class="value">{{ orderSummary.queryCount }}</span>
  773. </div>
  774. </el-col>
  775. </el-row>
  776. </div>
  777. </div>
  778. <div slot="footer" class="dialog-footer">
  779. <el-button @click="cancelErpAccountDialog">取 消</el-button>
  780. <el-button
  781. type="primary"
  782. @click="confirmCreateErpOrder"
  783. :disabled="!erpAccountForm.selectedAccount"
  784. :loading="erpAccountDialog.submitting"
  785. >确认</el-button>
  786. </div>
  787. </el-dialog>
  788. <!-- 导出字段选择对话框 -->
  789. <el-dialog :title="exportFieldDialog.title" :visible.sync="exportFieldDialog.open" width="800px" append-to-body>
  790. <div v-loading="exportFieldDialog.loading">
  791. <div style="margin-bottom: 20px;">
  792. <el-button type="primary" size="small" @click="selectAllFields">全选</el-button>
  793. <el-button type="default" size="small" @click="unselectAllFields">全不选</el-button>
  794. <el-button type="success" size="small" @click="selectDefaultFields">选择常用</el-button>
  795. </div>
  796. <div class="field-selection-container">
  797. <el-row :gutter="20">
  798. <el-col :span="8" v-for="field in exportFieldOptions" :key="field.key">
  799. <el-checkbox
  800. v-model="field.checked"
  801. :label="field.label"
  802. style="margin-bottom: 12px; width: 100%;"
  803. >
  804. {{ field.label }}
  805. </el-checkbox>
  806. </el-col>
  807. </el-row>
  808. </div>
  809. <div class="field-count-info" style="margin-top: 20px; padding: 10px; background: #f5f7fa; border-radius: 4px;">
  810. <i class="el-icon-info"></i>
  811. <span v-if="getSelectedFieldsCount() > 0">
  812. 已选择 <span style="color: #409EFF; font-weight: bold;">{{ getSelectedFieldsCount() }}</span> 个字段
  813. </span>
  814. <span v-else style="color: #E6A23C; font-weight: bold;">
  815. <i class="el-icon-warning"></i>
  816. 未选择任何字段,将导出所有字段
  817. </span>
  818. </div>
  819. </div>
  820. <div slot="footer" class="dialog-footer">
  821. <el-button @click="cancelExportFieldDialog">取 消</el-button>
  822. <el-button
  823. type="primary"
  824. @click="confirmExportFields"
  825. >确认导出</el-button>
  826. </div>
  827. </el-dialog>
  828. </div>
  829. </template>
  830. <script>
  831. import { listOrder, getOrder, delOrder, addOrder,importExpressTemplate, updateOrder, exportOrder,importTemplate,exportOrder2,queryErpPhone,
  832. saveErpPhone,editErpPhone,batchCreateErpOrder,getErpAccount,batchSetErpOrder,importUpdateOrderTemplate } from "@/api/his/storeOrder";
  833. import storeOrderDetails from '../../components/his/storeOrderDetails.vue';
  834. import { getToken } from "@/utils/auth";
  835. import {listStore} from "@/api/his/storeProduct";
  836. import { getCompanyList } from "@/api/company/company";
  837. import { getTcmScheduleList } from "@/api/company/schedule";
  838. import { treeselect } from "@/api/company/companyDept";
  839. import Treeselect from "@riophae/vue-treeselect";
  840. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  841. import { getTask } from "@/api/common";
  842. import {list as getAppMallOptions} from '@/api/course/coursePlaySourceConfig';
  843. export default {
  844. name: "Order",
  845. components: { storeOrderDetails,Treeselect },
  846. watch: {
  847. // 监听deptId
  848. 'deptId': 'currDeptChange'
  849. },
  850. data() {
  851. return {
  852. productInfo:"",
  853. payPriceTotal:"0",
  854. payMoneyTotal:"0",
  855. payRemainTotal:"0",
  856. // 新增排序相关数据
  857. currentSort: {
  858. prop: null,
  859. order: null
  860. },
  861. // 排序字段映射
  862. sortFieldMap: {
  863. 'companyUserName': '员工',
  864. 'packageName': '套餐名称',
  865. 'payPrice': '应收金额',
  866. 'payMoney': '实收金额',
  867. 'createTime': '下单时间'
  868. },
  869. erpSettingType:'set',
  870. SFDFopen:false,
  871. // 最大订单号数量限制
  872. maxOrderCodes: {
  873. type: Number,
  874. default: 50
  875. },
  876. // 输入框是否可见
  877. inputVisible: false,
  878. // 无效订单号对话框
  879. showInvalidDialog: false,
  880. // 当前输入值
  881. currentInput: '',
  882. deptOpen:true,
  883. // ERP账户相关数据
  884. erpAccountDialog: {
  885. open: false,
  886. title: "选择ERP账户",
  887. loading: false,
  888. submitting: false
  889. },
  890. erpAccountList: [], // ERP账户列表
  891. erpAccountQueryList:[], // ERP账户查询条件列表
  892. erpAccountForm: {
  893. selectedAccount: [] // 选中的账户ID
  894. },
  895. orderSummary: null, // 订单统计信息
  896. erpPhoneValue:[],
  897. setPhoneOpen:false,
  898. erpPhone:{
  899. open:false,
  900. title:"设置推送手机号"
  901. },
  902. phoneList: [], // 手机号列表
  903. originalPhoneList: [], // 原始手机号列表,用于取消时恢复
  904. orderStatus:null,
  905. scheduleOptions:[],
  906. companys:[],
  907. deptOptions:[],
  908. companyId:undefined,
  909. companyIds:[],
  910. deptId:undefined,
  911. actName:"10",
  912. show:{
  913. title:"订单详情",
  914. open:false,
  915. },
  916. sourceOptions:[],
  917. importExpress: {
  918. // 是否显示弹出层
  919. open: false,
  920. // 弹出层标题
  921. title: "",
  922. // 是否禁用上传
  923. isUploading: false,
  924. // 是否更新已经存在的用户数据
  925. updateSupport: 0,
  926. // 设置上传的请求头部
  927. headers: { Authorization: "Bearer " + getToken() },
  928. // 上传的地址
  929. url: process.env.VUE_APP_BASE_API + "/his/storeOrder/importExpress"
  930. },
  931. upload: {
  932. // 是否显示弹出层
  933. open: false,
  934. // 弹出层标题
  935. title: "",
  936. // 是否禁用上传
  937. isUploading: false,
  938. // 是否更新已经存在的用户数据
  939. updateSupport: 0,
  940. // 设置上传的请求头部
  941. headers: { Authorization: "Bearer " + getToken() },
  942. // 上传的地址
  943. url: process.env.VUE_APP_BASE_API + "/his/storeOrder/importData"
  944. },
  945. uploadStatus: {
  946. // 是否显示弹出层
  947. open: false,
  948. // 弹出层标题
  949. title: "",
  950. // 是否禁用上传
  951. isUploading: false,
  952. // 是否更新已经存在的用户数据
  953. updateSupport: 0,
  954. // 设置上传的请求头部
  955. headers: { Authorization: "Bearer " + getToken() },
  956. // 上传的地址
  957. url: process.env.VUE_APP_BASE_API + "/his/storeOrder/importOrderStatusData"
  958. },
  959. // 遮罩层
  960. loading: true,
  961. // 导出遮罩层
  962. exportLoading: false,
  963. // 导出字段选择弹窗
  964. exportFieldDialog: {
  965. open: false,
  966. title: "选择导出字段",
  967. loading: false
  968. },
  969. // 可选择的导出字段列表
  970. exportFieldOptions: [
  971. { key: 'orderCode', label: '订单号', checked: true },
  972. { key: 'prescribeCode', label: '处方单号', checked: true },
  973. { key: 'userId', label: '会员ID', checked: false },
  974. { key: 'extendOrderId', label: '管易云订单号', checked: false },
  975. { key: 'companyName', label: '所属公司', checked: true },
  976. { key: 'companyUserNickName', label: '所属销售', checked: true },
  977. { key: 'storeName', label: '店铺名称', checked: true },
  978. { key: 'miniProgramName', label: '小程序名称', checked: true },
  979. { key: 'orderType', label: '订单类型', checked: false },
  980. { key: 'userName', label: '收货人姓名', checked: true },
  981. { key: 'userPhone', label: '收货人电话', checked: true },
  982. { key: 'userAddress', label: '详细地址', checked: true },
  983. { key: 'totalPrice', label: '商品金额', checked: true },
  984. { key: 'totalNum', label: '商品数量', checked: true },
  985. { key: 'payPrice', label: '应付金额', checked: true },
  986. { key: 'payMoney', label: '实付金额', checked: true },
  987. { key: 'payRemain', label: '物流代收金额', checked: false },
  988. { key: 'discountMoney', label: '优惠金额', checked: false },
  989. { key: 'createTime', label: '下单时间', checked: true },
  990. { key: 'payTime', label: '支付时间', checked: true },
  991. { key: 'payType', label: '支付方式', checked: true },
  992. { key: 'status', label: '订单状态', checked: true },
  993. { key: 'refundTime', label: '退款时间', checked: false },
  994. { key: 'refundMoney', label: '退款金额', checked: false },
  995. { key: 'deliveryCode', label: '快递公司编号', checked: false },
  996. { key: 'deliveryName', label: '快递公司', checked: false },
  997. { key: 'deliverySn', label: '快递单号', checked: false },
  998. { key: 'remark', label: '备注', checked: false },
  999. { key: 'deliveryPayStatus', label: '物流代收结算状态', checked: false },
  1000. { key: 'deliveryTime', label: '快递账单日期', checked: false },
  1001. { key: 'deliveryPayTime', label: '快递结算日期', checked: false },
  1002. { key: 'deliveryPayMoney', label: '物流结算费用', checked: false },
  1003. { key: 'deliveryStatus', label: '物流状态', checked: false },
  1004. { key: 'deliveryType', label: '物流跟踪状态', checked: false },
  1005. { key: 'packageName', label: '套餐名称', checked: true },
  1006. { key: 'packageSecondName', label: '套餐包别名', checked: false },
  1007. { key: 'orderBuyType', label: '订单购买类型', checked: false },
  1008. { key: 'channel', label: '公众号/渠道', checked: false },
  1009. { key: 'scheduleName', label: '档期归属', checked: false },
  1010. { key: 'tuiMoneyStatus', label: '推广佣金状态', checked: false },
  1011. { key: 'orderChannel', label: '渠道', checked: false },
  1012. { key: 'qwSubject', label: '企微主体', checked: false },
  1013. { key: 'cycle', label: '疗程天数', checked: false },
  1014. { key: 'followFrequency', label: '随访频率', checked: false },
  1015. { key: 'followCount', label: '随访次数', checked: false },
  1016. { key: 'patientName', label: '就诊人', checked: true },
  1017. { key: 'relation', label: '与本人关系', checked: false },
  1018. { key: 'user', label: '会员', checked: false },
  1019. { key: 'doctorName', label: '医生', checked: false },
  1020. { key: 'packageCateName', label: '套餐包分类', checked: false },
  1021. { key: 'age', label: '年龄', checked: false },
  1022. { key: 'sex', label: '性别', checked: false },
  1023. { key: 'erpPhone', label: 'ERP电话', checked: false },
  1024. { key: 'erpAccount', label: 'ERP账号', checked: false },
  1025. { key: 'source', label: '订单来源', checked: false }
  1026. ],
  1027. // 已选择的导出字段
  1028. selectedExportFields: [],
  1029. // 选中数组
  1030. ids: [],
  1031. // 非单个禁用
  1032. single: true,
  1033. // 非多个禁用
  1034. multiple: true,
  1035. // 显示搜索条件
  1036. showSearch: true,
  1037. // 总条数
  1038. total: 0,
  1039. // 订单表格数据
  1040. orderList: [],
  1041. payTypeArr:[],
  1042. scheduleIdArr:[],
  1043. buyTypeArr:[],
  1044. channelArr:[],
  1045. qwSubjectArr:[],
  1046. // 弹出层标题
  1047. title: "",
  1048. createTime:null,
  1049. payTime:null,
  1050. deliveryImportTime:null,
  1051. deliverySendTime:null,
  1052. tuiMoneyTime:null,
  1053. // 是否显示弹出层
  1054. open: false,
  1055. // 查询参数
  1056. queryParams: {
  1057. pageNum: 1,
  1058. pageSize: 10,
  1059. storeId: null,
  1060. orderCode: null,
  1061. orderCodes: [],
  1062. userId: null,
  1063. userName: null,
  1064. userPhone: null,
  1065. userPhoneMk: null,
  1066. userAddress: null,
  1067. cartId: null,
  1068. totalNum: null,
  1069. totalPrice: null,
  1070. payPrice: null,
  1071. payMoney: null,
  1072. isPay: null,
  1073. payTime: null,
  1074. payType: null,
  1075. status: null,
  1076. refundStatus: null,
  1077. refundImg: null,
  1078. refundExplain: null,
  1079. refundTime: null,
  1080. refundReason: null,
  1081. refundMoney: null,
  1082. deliveryCode: null,
  1083. deliveryName: null,
  1084. deliverySn: null,
  1085. isDel: null,
  1086. costPrice: null,
  1087. verifyCode: null,
  1088. shippingType: null,
  1089. isChannel: null,
  1090. isPrescribe: null,
  1091. prescribeId: null,
  1092. finishTime: null,
  1093. patientName: null,
  1094. doctorName: null,
  1095. sTime:null,
  1096. eTime:null,
  1097. paysTime:null,
  1098. payeTime:null,
  1099. deliveryTime: null,
  1100. tuiMoney: null,
  1101. tuiMoneyStatus: null,
  1102. tuisTime:null,
  1103. tuieTime:null,
  1104. tuiUserId: null,
  1105. orderCreateType: null,
  1106. companyUserName:null,
  1107. companyName:null,
  1108. packageSecondName:null,
  1109. isFirst:null,
  1110. source:null,
  1111. companyId:null,
  1112. companyIds:null,
  1113. coursePlaySourceConfigId:null,
  1114. },
  1115. // 表单参数
  1116. form: {},
  1117. // 表单校验
  1118. rules: {
  1119. },
  1120. PayOptions:[],
  1121. orderOptions:[],
  1122. payStatusOptions:[],
  1123. refundOptions:[],
  1124. channelOptions:[],
  1125. qwSubjectOptions:[],
  1126. orderTypeOptions:[],
  1127. orderBuyTypeOptions:[],
  1128. tuiOptions:[],
  1129. orOptions:[],
  1130. storeOPtions:[],
  1131. deliveryPayStatusOptions:[],
  1132. deliveryStatusOptions:[],
  1133. appMallOptions:[],
  1134. };
  1135. },
  1136. created() {
  1137. getCompanyList().then(response => {
  1138. this.companys = response.data;
  1139. if(this.companys!=null&&this.companys.length>0){
  1140. // this.companyId=this.companys[0].companyId;
  1141. this.getTreeselect();
  1142. }
  1143. this.companys.push({companyId:"-1",companyName:"无"})
  1144. });
  1145. getTcmScheduleList().then(response => {
  1146. this.scheduleOptions = response.data;
  1147. this.scheduleOptions.push({id: "-1",
  1148. name: "无"})
  1149. });
  1150. this.getstoreList();
  1151. this.getList();
  1152. this.getDicts("sys_store_order_buy_type").then(response => {
  1153. this.orderBuyTypeOptions = response.data;
  1154. this.orderBuyTypeOptions.push({dictLabel: "无",
  1155. dictValue: "-1"})
  1156. });
  1157. this.getDicts("sys_store_pay_type").then(response => {
  1158. this.PayOptions = response.data;
  1159. });
  1160. this.getDicts("sys_order_source").then(response => {
  1161. this.sourceOptions = response.data;
  1162. });
  1163. this.getDicts("sys_store_order_type").then(response => {
  1164. this.orderTypeOptions = response.data;
  1165. });
  1166. this.getDicts("sys_order_status").then(response => {
  1167. this.orderOptions = response.data;
  1168. });
  1169. this.getDicts("sys_order_pay").then(response => {
  1170. this.payStatusOptions = response.data;
  1171. });
  1172. this.getDicts("sys_refund_status").then(response => {
  1173. this.refundOptions = response.data;
  1174. });
  1175. this.getDicts("sys_store_channel").then(response => {
  1176. this.channelOptions = response.data;
  1177. this.channelOptions.push({dictLabel: "无",
  1178. dictValue: "-1"})
  1179. });
  1180. this.getDicts("sys_store_qw_subject").then(response => {
  1181. this.qwSubjectOptions = response.data;
  1182. this.qwSubjectOptions.push({dictLabel: "无",
  1183. dictValue: "-1"})
  1184. });
  1185. this.getDicts("sys_tui_money_status").then(response => {
  1186. this.tuiOptions = response.data;
  1187. });
  1188. this.getDicts("sys_company_or").then(response => {
  1189. this.orOptions = response.data;
  1190. });
  1191. this.getDicts("sys_store_delivery_pay_status").then(response => {
  1192. this.deliveryPayStatusOptions = response.data;
  1193. });
  1194. this.getDicts("sys_store_order_delivery_status").then(response => {
  1195. this.deliveryStatusOptions = response.data;
  1196. });
  1197. this.getErpAccountList();
  1198. this.getAppMallOptions();
  1199. },
  1200. methods: {
  1201. // 新增排序处理方法
  1202. handleSortChange({ column, prop, order }) {
  1203. console.log('排序变化:', { column, prop, order });
  1204. // 更新当前排序状态
  1205. this.currentSort = {
  1206. prop: prop,
  1207. order: order
  1208. };
  1209. // 更新查询参数
  1210. if (order) {
  1211. this.queryParams.sortField = prop;
  1212. this.queryParams.sortOrder = order === 'ascending' ? 'asc' : 'desc';
  1213. } else {
  1214. this.queryParams.sortField = null;
  1215. this.queryParams.sortOrder = null;
  1216. }
  1217. // 重新查询数据
  1218. this.queryParams.pageNum = 1; // 重置到第一页
  1219. this.getList();
  1220. // 显示排序提示
  1221. if (order) {
  1222. const fieldLabel = this.getSortLabel(prop);
  1223. const orderLabel = order === 'ascending' ? '升序' : '降序';
  1224. this.$message.success(`已按${fieldLabel}${orderLabel}排序`);
  1225. }
  1226. },
  1227. // 获取排序字段的中文标签
  1228. getSortLabel(prop) {
  1229. return this.sortFieldMap[prop] || prop;
  1230. },
  1231. // 清除排序
  1232. clearSort() {
  1233. this.currentSort = {
  1234. prop: null,
  1235. order: null
  1236. };
  1237. this.queryParams.sortField = null;
  1238. this.queryParams.sortOrder = null;
  1239. this.queryParams.pageNum = 1;
  1240. // 重置表格排序状态 - 关键代码
  1241. this.$nextTick(() => {
  1242. if (this.$refs.orderTable) {
  1243. this.$refs.orderTable.clearSort();
  1244. }
  1245. });
  1246. this.getList();
  1247. this.$message.success('已清除排序');
  1248. },
  1249. // 修改查询列表方法,添加排序参数
  1250. getList() {
  1251. this.loading = true;
  1252. // 处理多选参数
  1253. if(this.payTypeArr.length>0){
  1254. this.queryParams.payType=this.payTypeArr.toString();
  1255. } else {
  1256. this.queryParams.payType=null
  1257. }
  1258. if(this.scheduleIdArr.length>0){
  1259. this.queryParams.scheduleId=this.scheduleIdArr.toString();
  1260. } else {
  1261. this.queryParams.scheduleId=null
  1262. }
  1263. if(this.buyTypeArr.length>0){
  1264. this.queryParams.orderBuyType=this.buyTypeArr.toString();
  1265. } else {
  1266. this.queryParams.orderbuyType=null
  1267. }
  1268. if(this.channelArr.length>0){
  1269. this.queryParams.orderChannel=this.channelArr.toString();
  1270. } else {
  1271. this.queryParams.orderChannel=null
  1272. }
  1273. if(this.qwSubjectArr.length>0){
  1274. this.queryParams.qwSubject=this.qwSubjectArr.toString();
  1275. } else {
  1276. this.queryParams.qwSubject=null
  1277. }
  1278. // 处理公司参数
  1279. if(this.companyIds && this.companyIds.length>1){
  1280. this.queryParams.companyIds = this.companyIds
  1281. this.queryParams.companyId = null;
  1282. this.queryParams.deptId = null;
  1283. } else {
  1284. this.queryParams.companyId = this.companyId
  1285. this.queryParams.companyIds = null;
  1286. }
  1287. // 处理订单号数组
  1288. if (this.queryParams.orderCodes && this.queryParams.orderCodes.length > 0) {
  1289. this.queryParams.orderCodeList = this.queryParams.orderCodes.join(',');
  1290. } else {
  1291. this.queryParams.orderCodeList = null;
  1292. }
  1293. console.log('查询参数:', this.queryParams);
  1294. listOrder(this.queryParams).then(response => {
  1295. this.orderList = response.rows;
  1296. this.total = response.total;
  1297. if(this.total>0){
  1298. this.payPriceTotal = response.payPriceTotal;
  1299. this.payMoneyTotal = response.payMoneyTotal;
  1300. this.payRemainTotal = response.payRemainTotal;
  1301. this.productInfo = response.productInfo;
  1302. } else {
  1303. this.payPriceTotal = "0"
  1304. this.payMoneyTotal = "0"
  1305. this.payRemainTotal = "0"
  1306. this.productInfo = response.productInfo;
  1307. }
  1308. this.loading = false;
  1309. if(response.msg == 'jnmy'){
  1310. this.SFDFopen = true;
  1311. } else{
  1312. this.SFDFopen = false;
  1313. }
  1314. // 如果有排序,显示排序结果提示
  1315. if (this.currentSort.prop) {
  1316. const fieldLabel = this.getSortLabel(this.currentSort.prop);
  1317. const orderLabel = this.currentSort.order === 'ascending' ? '升序' : '降序';
  1318. console.log(`数据已按${fieldLabel}${orderLabel}加载`);
  1319. }
  1320. }).catch(error => {
  1321. console.error('查询失败:', error);
  1322. this.loading = false;
  1323. this.$message.error('查询数据失败');
  1324. });
  1325. },
  1326. // 处理键盘按下事件
  1327. handleKeyDown(event) {
  1328. const { key, target } = event
  1329. // 处理退格键删除标签
  1330. if (key === 'Backspace' && !target.value && this.queryParams.orderCodes.length > 0) {
  1331. event.preventDefault()
  1332. this.removeOrderCode(this.queryParams.orderCodes.length - 1)
  1333. }
  1334. // 处理分隔符
  1335. if ([',', ',', ' ', 'Enter'].includes(key)) {
  1336. event.preventDefault()
  1337. this.handleInputConfirm()
  1338. }
  1339. },
  1340. // 处理键盘抬起事件(实时分割输入)
  1341. handleKeyUp(event) {
  1342. const value = event.target.value
  1343. // 检查是否包含分隔符
  1344. if (/[,,\s]/.test(value)) {
  1345. this.handleInputConfirm()
  1346. }
  1347. },
  1348. // 确认输入
  1349. handleInputConfirm() {
  1350. const inputValue = this.currentInput.trim()
  1351. if (inputValue) {
  1352. // 分割多个订单号
  1353. const codes = inputValue.split(/[,,\s]+/).filter(code => code.trim())
  1354. codes.forEach(code => {
  1355. this.addOrderCode(code.trim())
  1356. })
  1357. }
  1358. this.currentInput = ''
  1359. },
  1360. // 添加订单号
  1361. addOrderCode(code) {
  1362. if (!code) return
  1363. // 检查数量限制
  1364. if (this.maxOrderCodes > 0 && this.queryParams.orderCodes.length >= this.maxOrderCodes) {
  1365. this.$message.warning(`最多只能添加 ${this.maxOrderCodes} 个订单号`)
  1366. return
  1367. }
  1368. // 检查重复
  1369. if (this.queryParams.orderCodes.includes(code)) {
  1370. this.$message.warning(`订单号 "${code}" 已存在`)
  1371. return
  1372. }
  1373. // 添加到列表
  1374. this.queryParams.orderCodes.push(code)
  1375. },
  1376. // 删除订单号
  1377. removeOrderCode(index) {
  1378. this.queryParams.orderCodes.splice(index, 1)
  1379. },
  1380. // 清空所有标签
  1381. clearAllTags() {
  1382. this.$confirm('确认清空所有订单号吗?', '提示', {
  1383. confirmButtonText: '确定',
  1384. cancelButtonText: '取消',
  1385. type: 'warning'
  1386. }).then(() => {
  1387. this.queryParams.orderCodes = []
  1388. this.$message.success('已清空所有订单号')
  1389. })
  1390. },
  1391. // 显示输入框
  1392. showInput() {
  1393. this.inputVisible = true
  1394. this.$nextTick(() => {
  1395. this.$refs.tagInput.focus()
  1396. })
  1397. },
  1398. // 删除订单号
  1399. removeOrderCode(index) {
  1400. this.queryParams.orderCodes.splice(index, 1)
  1401. },
  1402. // 聚焦输入框
  1403. focusInput() {
  1404. if (!this.inputVisible) {
  1405. this.showInput()
  1406. }
  1407. },
  1408. // 设置erp账户
  1409. showErpAccountSetDialog() {
  1410. this.erpAccountDialog.open = true;
  1411. this.erpSettingType = 'set'
  1412. this.calculateOrderSummary();
  1413. },
  1414. //显示ERP账户选择对话框
  1415. showErpAccountDialog() {
  1416. this.erpAccountDialog.open = true;
  1417. this.erpSettingType = 'push'
  1418. this.calculateOrderSummary();
  1419. },
  1420. //获取ERP账户列表
  1421. async getErpAccountList() {
  1422. try {
  1423. const response = await getErpAccount();
  1424. if (response.code === 200) {
  1425. const list = response.data || [];
  1426. this.erpAccountList = [...list];
  1427. this.erpAccountQueryList = [...list, '未分拣'];
  1428. // 设置默认值:第一条真实账户
  1429. if (list.length && !this.queryParams.erpAccount) {
  1430. this.$set(this.queryParams, 'erpAccount', list[0]);
  1431. this.getList();
  1432. }
  1433. } else {
  1434. this.$message.error(response.msg || '获取ERP账户列表失败');
  1435. this.erpAccountList = [];
  1436. }
  1437. } catch (error) {
  1438. console.error('获取ERP账户列表失败:', error);
  1439. this.$message.error('获取ERP账户列表失败');
  1440. this.erpAccountList = [];
  1441. } finally {
  1442. this.erpAccountDialog.loading = false;
  1443. }
  1444. },
  1445. // 新增:计算订单统计信息
  1446. calculateOrderSummary() {
  1447. let selectedCount = 0;
  1448. let totalAmount = 0;
  1449. let queryCount = this.total || 0;
  1450. if (this.ids.length > 0) {
  1451. // 如果有选中的订单,统计选中的订单
  1452. selectedCount = this.ids.length;
  1453. this.orderList.forEach(order => {
  1454. if (this.ids.includes(order.orderId)) {
  1455. totalAmount += parseFloat(order.payMoney || 0);
  1456. }
  1457. });
  1458. } else {
  1459. // 如果没有选中订单,统计当前查询条件下的所有订单
  1460. selectedCount = queryCount;
  1461. this.orderList.forEach(order => {
  1462. totalAmount += parseFloat(order.payMoney || 0);
  1463. });
  1464. }
  1465. this.orderSummary = {
  1466. selectedCount,
  1467. totalAmount: totalAmount.toFixed(2),
  1468. queryCount
  1469. };
  1470. },
  1471. //确认创建ERP订单
  1472. confirmCreateErpOrder() {
  1473. if (!this.erpAccountForm.selectedAccount) {
  1474. this.$message.warning('请选择ERP账户');
  1475. return;
  1476. }
  1477. console.log("-----------------",this.erpSettingType)
  1478. if(this.erpSettingType == 'set'){
  1479. this.$confirm(
  1480. `确认将订单设置ERP账户为"${this.erpAccountForm.selectedAccount}"吗?`,
  1481. '确认',
  1482. {
  1483. confirmButtonText: '确定',
  1484. cancelButtonText: '取消',
  1485. type: 'warning'
  1486. }
  1487. ).then(() => {
  1488. this.executSetErpOrder();
  1489. });
  1490. } else if(this.erpSettingType == 'push'){
  1491. this.$confirm(
  1492. `确认将订单推送到ERP账户"${this.erpAccountForm.selectedAccount}"吗?`,
  1493. '确认推送',
  1494. {
  1495. confirmButtonText: '确定推送',
  1496. cancelButtonText: '取消',
  1497. type: 'warning'
  1498. }
  1499. ).then(() => {
  1500. this.executeCreateErpOrder();
  1501. });
  1502. }
  1503. },
  1504. async executSetErpOrder() {
  1505. this.erpAccountDialog.submitting = true;
  1506. try {
  1507. let param = {
  1508. loginAccount: this.erpAccountForm.selectedAccount
  1509. };
  1510. if (this.ids.length > 0) {
  1511. // 如果有选中的订单,只推送选中的
  1512. param.orderIds = this.ids;
  1513. } else {
  1514. // 如果没有选中订单,推送查询条件下的所有订单
  1515. if (this.payTypeArr.length > 0) {
  1516. this.queryParams.payType = this.payTypeArr.toString();
  1517. } else {
  1518. this.queryParams.payType = null;
  1519. }
  1520. if (this.scheduleIdArr.length > 0) {
  1521. this.queryParams.scheduleId = this.scheduleIdArr.toString();
  1522. } else {
  1523. this.queryParams.scheduleId = null;
  1524. }
  1525. if (this.buyTypeArr.length > 0) {
  1526. this.queryParams.orderBuyType = this.buyTypeArr.toString();
  1527. } else {
  1528. this.queryParams.orderBuyType = null;
  1529. }
  1530. if (this.channelArr.length > 0) {
  1531. this.queryParams.orderChannel = this.channelArr.toString();
  1532. } else {
  1533. this.queryParams.orderChannel = null;
  1534. }
  1535. if (this.qwSubjectArr.length > 0) {
  1536. this.queryParams.qwSubject = this.qwSubjectArr.toString();
  1537. } else {
  1538. this.queryParams.qwSubject = null;
  1539. }
  1540. // 合并查询参数
  1541. param = { ...param, ...this.queryParams };
  1542. }
  1543. const response = await batchSetErpOrder(param);
  1544. if (response.code === 200) {
  1545. this.$message.success('订单ERP账号设置成功');
  1546. this.cancelErpAccountDialog();
  1547. this.getErpAccountList(); // 刷新列表
  1548. this.getList();
  1549. } else {
  1550. this.$message.error(response.msg || 'ERP账号设置失败');
  1551. }
  1552. } catch (error) {
  1553. console.error('ERP账号设置失败:', error);
  1554. this.$message.error('ERP账号设置失败');
  1555. } finally {
  1556. this.erpAccountDialog.submitting = false;
  1557. }
  1558. },
  1559. //执行创建ERP订单
  1560. async executeCreateErpOrder() {
  1561. this.erpAccountDialog.submitting = true;
  1562. try {
  1563. let param = {
  1564. loginAccount: this.erpAccountForm.selectedAccount
  1565. };
  1566. if (this.ids.length > 0) {
  1567. // 如果有选中的订单,只推送选中的
  1568. param.orderIds = this.ids;
  1569. } else {
  1570. // 如果没有选中订单,推送查询条件下的所有订单
  1571. if (this.payTypeArr.length > 0) {
  1572. this.queryParams.payType = this.payTypeArr.toString();
  1573. } else {
  1574. this.queryParams.payType = null;
  1575. }
  1576. if (this.scheduleIdArr.length > 0) {
  1577. this.queryParams.scheduleId = this.scheduleIdArr.toString();
  1578. } else {
  1579. this.queryParams.scheduleId = null;
  1580. }
  1581. if (this.buyTypeArr.length > 0) {
  1582. this.queryParams.orderBuyType = this.buyTypeArr.toString();
  1583. } else {
  1584. this.queryParams.orderBuyType = null;
  1585. }
  1586. if (this.channelArr.length > 0) {
  1587. this.queryParams.orderChannel = this.channelArr.toString();
  1588. } else {
  1589. this.queryParams.orderChannel = null;
  1590. }
  1591. if (this.qwSubjectArr.length > 0) {
  1592. this.queryParams.qwSubject = this.qwSubjectArr.toString();
  1593. } else {
  1594. this.queryParams.qwSubject = null;
  1595. }
  1596. // 合并查询参数
  1597. param = { ...param, ...this.queryParams };
  1598. }
  1599. const response = await batchCreateErpOrder(param);
  1600. if (response.code === 200) {
  1601. this.$message.success('ERP订单创建成功');
  1602. this.cancelErpAccountDialog();
  1603. this.getErpAccountList(); // 刷新列表
  1604. this.getList();
  1605. } else {
  1606. this.$message.error(response.msg || 'ERP订单创建失败');
  1607. }
  1608. } catch (error) {
  1609. console.error('创建ERP订单失败:', error);
  1610. this.$message.error('创建ERP订单失败');
  1611. } finally {
  1612. this.erpAccountDialog.submitting = false;
  1613. }
  1614. },
  1615. // 新增:取消ERP账户选择对话框
  1616. cancelErpAccountDialog() {
  1617. this.erpAccountDialog.open = false;
  1618. this.erpAccountForm.selectedAccount = null;
  1619. this.orderSummary = null;
  1620. this.erpAccountList = [];
  1621. },
  1622. handleCancelErpPhone(){
  1623. this.erpPhoneValue = [];
  1624. this.setPhoneOpen = false;
  1625. },
  1626. submitErpPhone(){
  1627. let param = {};
  1628. if(this.ids.length>0){
  1629. param = {orderIds:this.ids,erpPhone:this.erpPhoneValue};
  1630. } else {
  1631. if(this.payTypeArr.length>0){
  1632. this.queryParams.payType=this.payTypeArr.toString();
  1633. }
  1634. else{
  1635. this.queryParams.payType=null
  1636. }
  1637. if(this.scheduleIdArr.length>0){
  1638. this.queryParams.scheduleId=this.scheduleIdArr.toString();
  1639. }
  1640. else{
  1641. this.queryParams.scheduleId=null
  1642. }
  1643. if(this.buyTypeArr.length>0){
  1644. this.queryParams.orderBuyType=this.buyTypeArr.toString();
  1645. }
  1646. else{
  1647. this.queryParams.orderbuyType=null
  1648. }
  1649. if(this.channelArr.length>0){
  1650. this.queryParams.orderChannel=this.channelArr.toString();
  1651. }
  1652. else{
  1653. this.queryParams.orderChannel=null
  1654. }
  1655. if(this.qwSubjectArr.length>0){
  1656. this.queryParams.qwSubject=this.qwSubjectArr.toString();
  1657. }
  1658. else{
  1659. this.queryParams.qwSubject=null
  1660. }
  1661. param = this.queryParams;
  1662. param.erpPhone=this.erpPhoneValue;
  1663. }
  1664. editErpPhone(param).then(response=>{
  1665. this.msgSuccess("修改成功");
  1666. this.setPhoneOpen = false;
  1667. this.getList();
  1668. })
  1669. },
  1670. setErpPhone(){
  1671. this.getErpPhoneList();
  1672. this.setPhoneOpen = true;
  1673. },
  1674. // 设置推送手机相关方法
  1675. handleErpPhone(){
  1676. //查询配置手机号
  1677. this.getErpPhoneList();
  1678. this.erpPhone.open = true
  1679. },
  1680. getErpPhoneList(){
  1681. queryErpPhone().then(response =>{
  1682. if(response.data && response.data != null && response.data.length >0){
  1683. const phones = response.data.filter(phone => phone.trim());
  1684. this.phoneList = phones.map(phone => ({
  1685. phone: phone.trim(),
  1686. editing: false,
  1687. originalPhone: phone.trim()
  1688. }));
  1689. }
  1690. // 保存原始数据用于取消操作
  1691. this.originalPhoneList = this.phoneList;
  1692. });
  1693. },
  1694. // 新增手机号
  1695. handleAddPhone() {
  1696. this.phoneList.push({
  1697. phone: '',
  1698. editing: true,
  1699. originalPhone: '',
  1700. isNew: true
  1701. });
  1702. },
  1703. // 编辑手机号
  1704. handleEditPhone(index) {
  1705. this.$set(this.phoneList[index], 'editing', true);
  1706. this.$set(this.phoneList[index], 'originalPhone', this.phoneList[index].phone);
  1707. },
  1708. // 保存手机号
  1709. handleSavePhone(index) {
  1710. const phone = this.phoneList[index].phone.trim();
  1711. if (!phone) {
  1712. this.$message.error('手机号不能为空');
  1713. return;
  1714. }
  1715. if (!this.validatePhoneFormat(phone)) {
  1716. this.$message.error('请输入正确的手机号格式');
  1717. return;
  1718. }
  1719. // 检查是否重复
  1720. const duplicateIndex = this.phoneList.findIndex((item, idx) =>
  1721. idx !== index && item.phone === phone
  1722. );
  1723. if (duplicateIndex !== -1) {
  1724. this.$message.error('手机号已存在');
  1725. return;
  1726. }
  1727. this.$set(this.phoneList[index], 'editing', false);
  1728. this.$set(this.phoneList[index], 'isNew', false);
  1729. },
  1730. // 取消编辑
  1731. handleCancelEdit(index) {
  1732. if (this.phoneList[index].isNew) {
  1733. // 如果是新增的,直接删除
  1734. this.phoneList.splice(index, 1);
  1735. } else {
  1736. // 如果是编辑的,恢复原值
  1737. this.$set(this.phoneList[index], 'phone', this.phoneList[index].originalPhone);
  1738. this.$set(this.phoneList[index], 'editing', false);
  1739. }
  1740. },
  1741. // 删除手机号
  1742. handleDeletePhone(index) {
  1743. this.$confirm('确认删除该手机号?', '提示', {
  1744. confirmButtonText: '确定',
  1745. cancelButtonText: '取消',
  1746. type: 'warning'
  1747. }).then(() => {
  1748. this.phoneList.splice(index, 1);
  1749. this.$message.success('删除成功');
  1750. });
  1751. },
  1752. // 验证手机号格式
  1753. validatePhoneFormat(phone) {
  1754. const phoneRegex = /^1[3-9]\d{9}$/;
  1755. return phoneRegex.test(phone);
  1756. },
  1757. // 验证手机号
  1758. validatePhone(row) {
  1759. if (row.phone && !this.validatePhoneFormat(row.phone)) {
  1760. this.$message.error('请输入正确的手机号格式');
  1761. }
  1762. },
  1763. // 保存手机号列表
  1764. handleSavePhoneList() {
  1765. // 检查是否有正在编辑的项
  1766. const editingItem = this.phoneList.find(item => item.editing);
  1767. if (editingItem) {
  1768. this.$message.error('请先保存正在编辑的手机号');
  1769. return;
  1770. }
  1771. // 检查是否有空的手机号
  1772. const emptyPhone = this.phoneList.find(item => !item.phone.trim());
  1773. if (emptyPhone) {
  1774. this.$message.error('存在空的手机号,请删除或填写完整');
  1775. return;
  1776. }
  1777. // 构造手机号列表
  1778. const phoneList = this.phoneList.map(item => item.phone);
  1779. // 调用保存接口
  1780. saveErpPhone(phoneList).then(response => {
  1781. if (response.code === 200) {
  1782. this.$message.success('保存成功');
  1783. this.erpPhone.open = false;
  1784. } else {
  1785. this.$message.error(response.msg || '保存失败');
  1786. }
  1787. this.getList();
  1788. }).catch(() => {
  1789. this.$message.error('保存失败');
  1790. });
  1791. },
  1792. // 取消手机号对话框
  1793. handleCancelPhoneDialog() {
  1794. // 恢复原始数据
  1795. this.phoneList = JSON.parse(JSON.stringify(this.originalPhoneList));
  1796. this.erpPhone.open = false;
  1797. },
  1798. handleImportExpress() {
  1799. this.importExpress.title = "导入";
  1800. this.importExpress.open = true;
  1801. },
  1802. /** 下载模板操作 */
  1803. importTemplateExpress() {
  1804. importExpressTemplate().then(response => {
  1805. this.download(response.msg);
  1806. });
  1807. },
  1808. // 文件上传中处理
  1809. handleFileUploadProgressExpress(event, file, fileList) {
  1810. this.upload.isUploading = true;
  1811. },
  1812. // 文件上传中处理
  1813. handleFileUploadProgressOrder(event, file, fileList) {
  1814. this.uploadStatus.isUploading = true;
  1815. },
  1816. // 文件上传成功处理
  1817. handleFileSuccessExpress(response, file, fileList) {
  1818. this.importExpress.open = false;
  1819. this.importExpress.isUploading = false;
  1820. this.$refs.importExpress.clearFiles();
  1821. this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
  1822. this.getList();
  1823. },
  1824. // 文件上传成功处理
  1825. handleFileSuccessOrder(response, file, fileList) {
  1826. this.uploadStatus.open = false;
  1827. this.uploadStatus.isUploading = false;
  1828. this.$refs.uploadStatus.clearFiles();
  1829. this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
  1830. this.getList();
  1831. },
  1832. // 提交上传文件
  1833. submitFileFormExpress() {
  1834. this.$refs.importExpress.submit();
  1835. },
  1836. handleImportStatus() {
  1837. this.uploadStatus.title = "导入";
  1838. this.uploadStatus.open = true;
  1839. },
  1840. /** 导入按钮操作 */
  1841. handleImport() {
  1842. this.upload.title = "导入";
  1843. this.upload.open = true;
  1844. },
  1845. /** 下载模板操作 */
  1846. importTemplate() {
  1847. importTemplate().then(response => {
  1848. this.download(response.msg);
  1849. });
  1850. },
  1851. importUpdateOrderTemplate(){
  1852. importUpdateOrderTemplate().then(response => {
  1853. this.download(response.msg);
  1854. });
  1855. },
  1856. // 文件上传中处理
  1857. handleFileUploadProgress(event, file, fileList) {
  1858. this.upload.isUploading = true;
  1859. },
  1860. // 文件上传成功处理
  1861. handleFileSuccess(response, file, fileList) {
  1862. this.upload.open = false;
  1863. this.upload.isUploading = false;
  1864. this.$refs.upload.clearFiles();
  1865. this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
  1866. this.getList();
  1867. },
  1868. // 提交上传文件
  1869. submitFileForm() {
  1870. this.$refs.upload.submit();
  1871. },
  1872. submitOrderStatusFileForm(){
  1873. this.$refs.uploadStatus.submit();
  1874. },
  1875. handledetails(row){
  1876. this.show.open=true;
  1877. setTimeout(() => {
  1878. this.$refs.Details.getDetails(row.orderId,row.nickName,row.storeName);
  1879. }, 1);
  1880. },
  1881. getstoreList() {
  1882. listStore().then(response => {
  1883. this.storeOPtions = response.rows;
  1884. });
  1885. },
  1886. // 取消按钮
  1887. cancel() {
  1888. this.open = false;
  1889. this.reset();
  1890. },
  1891. // 表单重置
  1892. reset() {
  1893. this.form = {
  1894. orderId: null,
  1895. storeId: null,
  1896. orderCode: null,
  1897. userId: null,
  1898. userName: null,
  1899. userPhone: null,
  1900. userAddress: null,
  1901. cartId: null,
  1902. totalNum: null,
  1903. totalPrice: null,
  1904. payPrice: null,
  1905. payMoney: null,
  1906. isPay: null,
  1907. payTime: null,
  1908. payType: null,
  1909. createTime: null,
  1910. updateTime: null,
  1911. status: null,
  1912. refundStatus: "0",
  1913. refundImg: null,
  1914. refundExplain: null,
  1915. refundTime: null,
  1916. refundReason: null,
  1917. refundMoney: null,
  1918. deliveryCode: null,
  1919. deliveryName: null,
  1920. deliverySn: null,
  1921. remark: null,
  1922. isDel: null,
  1923. costPrice: null,
  1924. verifyCode: null,
  1925. shippingType: null,
  1926. isChannel: null,
  1927. isPrescribe: null,
  1928. prescribeId: null,
  1929. finishTime: null,
  1930. deliveryTime: null,
  1931. tuiMoney: null,
  1932. tuiMoneyStatus: 0,
  1933. tuiUserId: null,
  1934. orderCreateType: null
  1935. };
  1936. this.resetForm("form");
  1937. this.payTypeArr = null;
  1938. this.scheduleIdArr = null;
  1939. this.buyTypeArr = null;
  1940. this.channelArr = null;
  1941. this.qwSubjectArr = null;
  1942. },
  1943. /** 搜索按钮操作 */
  1944. handleQuery() {
  1945. this.queryParams.pageNum = 1;
  1946. this.getList();
  1947. },
  1948. handleClickX(tab, event) {
  1949. this.orderStatus = tab.name;
  1950. if(tab.name=="10"){
  1951. this.queryParams.status=null;
  1952. }else{
  1953. this.queryParams.status=tab.name;
  1954. }
  1955. this.handleQuery();
  1956. },
  1957. changeTime(){
  1958. if(this.createTime!=null){
  1959. this.queryParams.sTime=this.createTime[0];
  1960. this.queryParams.eTime=this.createTime[1];
  1961. }else{
  1962. this.queryParams.sTime=null;
  1963. this.queryParams.eTime=null;
  1964. }
  1965. if(this.deliverySendTime!=null){
  1966. this.queryParams.deliverySendsTime=this.deliverySendTime[0];
  1967. this.queryParams.deliverySendeTime=this.deliverySendTime[1];
  1968. }else{
  1969. this.queryParams.deliverySendsTime=null;
  1970. this.queryParams.deliverySendeTime=null;
  1971. }
  1972. if(this.deliveryImportTime!=null){
  1973. this.queryParams.deliveryImportsTime=this.deliveryImportTime[0];
  1974. this.queryParams.deliveryImporteTime=this.deliveryImportTime[1];
  1975. }else{
  1976. this.queryParams.deliveryImportsTime=null;
  1977. this.queryParams.deliveryImporteTime=null;
  1978. }
  1979. if(this.tuiMoneyTime!=null){
  1980. this.queryParams.tuisTime=this.tuiMoneyTime[0];
  1981. this.queryParams.tuieTime=this.tuiMoneyTime[1];
  1982. }else{
  1983. this.queryParams.tuisTime=null;
  1984. this.queryParams.tuieTime=null;
  1985. }
  1986. },
  1987. changePayTime(){
  1988. if(this.payTime!=null){
  1989. this.queryParams.sTime=this.payTime[0];
  1990. this.queryParams.eTime=this.payTime[1];
  1991. }else{
  1992. this.queryParams.paysTime=null;
  1993. this.queryParams.payeTime=null;
  1994. }
  1995. },
  1996. /** 重置按钮操作 */
  1997. resetQuery() {
  1998. this.resetForm("queryForm");
  1999. this.createTime=null;
  2000. this.queryParams.sTime=null;
  2001. this.queryParams.eTime=null;
  2002. this.payTime=null;
  2003. this.queryParams.paysTime=null;
  2004. this.queryParams.payeTime=null;
  2005. this.queryParams.deliveryImportTime = null;
  2006. this.queryParams.deliveryImportsTime = null;
  2007. this.queryParams.deliveryImporteTime = null;
  2008. this.queryParams.deliverySendTime = null;
  2009. this.queryParams.deliverySendsTime = null;
  2010. this.queryParams.deliverySendeTime = null;
  2011. this.queryParams.tuisTIme = null;
  2012. this.queryParams.tuieTIme = null;
  2013. this.companyIds = null;
  2014. this.companyId = null;
  2015. // 清除排序
  2016. this.currentSort = {
  2017. prop: null,
  2018. order: null
  2019. };
  2020. this.queryParams.sortField = null;
  2021. this.queryParams.sortOrder = null;
  2022. // 清除订单号标签
  2023. this.queryParams.orderCodes = [];
  2024. this.currentInput = '';
  2025. this.inputVisible = false;
  2026. // 重置表格排序状态 - 关键代码
  2027. this.$nextTick(() => {
  2028. if (this.$refs.orderTable) {
  2029. this.$refs.orderTable.clearSort();
  2030. }
  2031. });
  2032. this.handleQuery();
  2033. },
  2034. // 多选框选中数据
  2035. handleSelectionChange(selection) {
  2036. this.ids = selection.map(item => item.orderId)
  2037. this.single = selection.length!==1
  2038. this.multiple = !selection.length
  2039. },
  2040. /** 新增按钮操作 */
  2041. handleAdd() {
  2042. this.reset();
  2043. this.open = true;
  2044. this.title = "添加订单";
  2045. },
  2046. /** 修改按钮操作 */
  2047. handleUpdate(row) {
  2048. this.reset();
  2049. const orderId = row.orderId || this.ids
  2050. getOrder(orderId).then(response => {
  2051. this.form = response.data;
  2052. this.open = true;
  2053. this.title = "修改订单";
  2054. });
  2055. },
  2056. /** 提交按钮 */
  2057. submitForm() {
  2058. this.$refs["form"].validate(valid => {
  2059. if (valid) {
  2060. if (this.form.orderId != null) {
  2061. updateOrder(this.form).then(response => {
  2062. this.msgSuccess("修改成功");
  2063. this.open = false;
  2064. this.getList();
  2065. });
  2066. } else {
  2067. addOrder(this.form).then(response => {
  2068. this.msgSuccess("新增成功");
  2069. this.open = false;
  2070. this.getList();
  2071. });
  2072. }
  2073. }
  2074. });
  2075. },
  2076. /** 删除按钮操作 */
  2077. handleDelete(row) {
  2078. const orderIds = row.orderId || this.ids;
  2079. this.$confirm('是否确认删除订单编号为"' + orderIds + '"的数据项?', "警告", {
  2080. confirmButtonText: "确定",
  2081. cancelButtonText: "取消",
  2082. type: "warning"
  2083. }).then(function() {
  2084. return delOrder(orderIds);
  2085. }).then(() => {
  2086. this.getList();
  2087. this.msgSuccess("删除成功");
  2088. }).catch(() => {});
  2089. },
  2090. /** 导出按钮操作 */
  2091. handleExport() {
  2092. var that=this;
  2093. if(this.payTypeArr.length>0){
  2094. this.queryParams.payType=this.payTypeArr.toString();
  2095. }
  2096. else{
  2097. this.queryParams.payType=null
  2098. }
  2099. if(this.scheduleIdArr.length>0){
  2100. this.queryParams.scheduleId=this.scheduleIdArr.toString();
  2101. }
  2102. else{
  2103. this.queryParams.scheduleId=null
  2104. }
  2105. if(this.buyTypeArr.length>0){
  2106. this.queryParams.orderBuyType=this.buyTypeArr.toString();
  2107. }
  2108. else{
  2109. this.queryParams.orderbuyType=null
  2110. }
  2111. if(this.channelArr.length>0){
  2112. this.queryParams.orderChannel=this.channelArr.toString();
  2113. }
  2114. else{
  2115. this.queryParams.orderChannel=null
  2116. }
  2117. if(this.qwSubjectArr.length>0){
  2118. this.queryParams.qwSubject=this.qwSubjectArr.toString();
  2119. }
  2120. else{
  2121. this.queryParams.qwSubject=null
  2122. }
  2123. const queryParams = this.queryParams;
  2124. this.$confirm('是否确认导出所有订单数据项?', "警告", {
  2125. confirmButtonText: "确定",
  2126. cancelButtonText: "取消",
  2127. type: "warning"
  2128. }).then(() => {
  2129. this.exportLoading = true;
  2130. return exportOrder(queryParams);
  2131. }).then(response => {
  2132. console.log(response)
  2133. if(response.code==200){
  2134. that.msgSuccess(response.msg);
  2135. that.taskId=response.data;
  2136. that.time=setInterval(function(){
  2137. //查订单
  2138. getTask(that.taskId).then(res => {
  2139. if(res.data.status==1){
  2140. that.exportLoading = false;
  2141. clearTimeout(that.time)
  2142. that.time=null;
  2143. that.download(res.data.fileUrl);
  2144. }
  2145. });
  2146. },10000);
  2147. }
  2148. }).catch(() => {});
  2149. },
  2150. /** 导出按钮操作 */
  2151. handleOrderExport() {
  2152. // 打开字段选择对话框
  2153. this.exportFieldDialog.open = true;
  2154. },
  2155. // 导出字段选择相关方法
  2156. // 全选字段
  2157. selectAllFields() {
  2158. this.exportFieldOptions.forEach(field => {
  2159. field.checked = true;
  2160. });
  2161. },
  2162. // 全不选字段
  2163. unselectAllFields() {
  2164. this.exportFieldOptions.forEach(field => {
  2165. field.checked = false;
  2166. });
  2167. },
  2168. // 选择常用字段
  2169. selectDefaultFields() {
  2170. // 先全不选
  2171. this.unselectAllFields();
  2172. // 然后选择常用字段
  2173. const defaultFields = ['orderCode', 'prescribeCode', 'companyName', 'companyUserNickName',
  2174. 'storeName', 'miniProgramName', 'userName', 'userPhone', 'userAddress', 'totalPrice',
  2175. 'totalNum', 'payPrice', 'payMoney', 'createTime', 'payTime',
  2176. 'payType', 'status', 'packageName', 'patientName'];
  2177. this.exportFieldOptions.forEach(field => {
  2178. if (defaultFields.includes(field.key)) {
  2179. field.checked = true;
  2180. }
  2181. });
  2182. },
  2183. // 获取已选择字段数量
  2184. getSelectedFieldsCount() {
  2185. return this.exportFieldOptions.filter(field => field.checked).length;
  2186. },
  2187. // 取消导出字段选择
  2188. cancelExportFieldDialog() {
  2189. this.exportFieldDialog.open = false;
  2190. },
  2191. // 确认导出字段
  2192. confirmExportFields() {
  2193. // 获取已选择的字段
  2194. const selectedFieldsArray = this.exportFieldOptions.filter(field => field.checked);
  2195. let selectedFields = '';
  2196. if (selectedFieldsArray.length === 0) {
  2197. // 如果没有选择任何字段,则导出全部字段(不传filter参数)
  2198. selectedFields = null;
  2199. } else {
  2200. // 如果选择了字段,则只导出选中的字段
  2201. selectedFields = selectedFieldsArray.map(field => field.key).join(',');
  2202. }
  2203. // 关闭弹窗
  2204. this.exportFieldDialog.open = false;
  2205. // 执行导出操作
  2206. this.doExportOrder(selectedFields);
  2207. },
  2208. // 执行导出操作
  2209. doExportOrder(selectedFields) {
  2210. var that = this;
  2211. // 处理查询参数
  2212. if(this.payTypeArr.length>0){
  2213. this.queryParams.payType=this.payTypeArr.toString();
  2214. } else {
  2215. this.queryParams.payType=null
  2216. }
  2217. if(this.scheduleIdArr.length>0){
  2218. this.queryParams.scheduleId=this.scheduleIdArr.toString();
  2219. } else {
  2220. this.queryParams.scheduleId=null
  2221. }
  2222. if(this.buyTypeArr.length>0){
  2223. this.queryParams.orderBuyType=this.buyTypeArr.toString();
  2224. } else {
  2225. this.queryParams.orderbuyType=null
  2226. }
  2227. if(this.channelArr.length>0){
  2228. this.queryParams.orderChannel=this.channelArr.toString();
  2229. } else {
  2230. this.queryParams.orderChannel=null
  2231. }
  2232. if(this.qwSubjectArr.length>0){
  2233. this.queryParams.qwSubject=this.qwSubjectArr.toString();
  2234. } else {
  2235. this.queryParams.qwSubject=null
  2236. }
  2237. const queryParams = this.queryParams;
  2238. // 根据是否选择字段显示不同的确认消息
  2239. let confirmMessage = '';
  2240. if (selectedFields === null) {
  2241. confirmMessage = '没有选择字段,将导出所有字段的订单数据,确认继续?';
  2242. } else {
  2243. const fieldCount = selectedFields.split(',').length;
  2244. confirmMessage = `确认导出选中的 ${fieldCount} 个字段的订单数据?`;
  2245. }
  2246. this.$confirm(confirmMessage, "确认导出", {
  2247. confirmButtonText: "确定",
  2248. cancelButtonText: "取消",
  2249. type: "warning"
  2250. }).then(() => {
  2251. this.exportLoading = true;
  2252. // 构建请求参数
  2253. const requestParams = {...queryParams};
  2254. // 只有当selectedFields不为null时才添加filter参数
  2255. if (selectedFields !== null) {
  2256. requestParams.filter = selectedFields;
  2257. }
  2258. return exportOrder2(requestParams);
  2259. }).then(response => {
  2260. console.log(response)
  2261. if(response.code==200){
  2262. console.log(response.msg)
  2263. that.msgSuccess(response.msg);
  2264. that.taskId=response.data;
  2265. that.time=setInterval(function(){
  2266. //查订单
  2267. getTask(that.taskId).then(res => {
  2268. if(res.data.status==1){
  2269. that.exportLoading = false;
  2270. clearTimeout(that.time)
  2271. that.time=null;
  2272. that.download(res.data.fileUrl);
  2273. }
  2274. });
  2275. },10000);
  2276. }
  2277. }).catch(() => {
  2278. this.exportLoading = false;
  2279. });
  2280. },
  2281. /** 查询部门下拉树结构 */
  2282. getTreeselect() {
  2283. var that=this;
  2284. var param={companyId:this.companyId}
  2285. treeselect(param).then((response) => {
  2286. this.deptOptions = response.data;
  2287. console.log(this.deptOptions)
  2288. if(response.data!=null&&response.data.length>0){
  2289. //this.queryParams.deptId=response.data[0].id;
  2290. }
  2291. });
  2292. },
  2293. companyChange(val){
  2294. console.log(this.companyIds);
  2295. if(this.companyIds.length>1){
  2296. this.deptOpen = false;
  2297. } else {
  2298. this.deptOpen = true
  2299. if(this.companyIds.length=1){
  2300. this.companyId=this.companyIds[0];
  2301. this.getTreeselect();
  2302. }
  2303. }
  2304. },
  2305. // companyChange(val){
  2306. // console.log(val);
  2307. // this.companyId=val;
  2308. // this.getTreeselect();
  2309. // },
  2310. currDeptChange(val){
  2311. console.log(val)
  2312. this.queryParams.deptId=val;
  2313. this.getList();
  2314. },
  2315. // 获取小程序选项列表
  2316. getAppMallOptions() {
  2317. getAppMallOptions({pageNum:1,pageSize:100,isMall:1}).then(response => {
  2318. this.appMallOptions = response.rows;
  2319. })
  2320. },
  2321. }
  2322. };
  2323. </script>
  2324. <style scoped>
  2325. .tag-input-order-search {
  2326. padding: 20px;
  2327. background: #fff;
  2328. border-radius: 4px;
  2329. }
  2330. .tag-input-container {
  2331. min-width: 445px;
  2332. }
  2333. .tags-wrapper {
  2334. min-height: 32px;
  2335. padding: 4px 8px;
  2336. border: 1px solid #dcdfe6;
  2337. border-radius: 4px;
  2338. cursor: text;
  2339. display: flex;
  2340. flex-wrap: wrap;
  2341. align-items: center;
  2342. gap: 4px;
  2343. transition: border-color 0.2s;
  2344. }
  2345. .tags-wrapper:hover {
  2346. border-color: #c0c4cc;
  2347. }
  2348. .tags-wrapper:focus-within {
  2349. border-color: #409eff;
  2350. box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
  2351. }
  2352. .order-tag {
  2353. margin: 2px;
  2354. flex-shrink: 0;
  2355. }
  2356. .tag-error {
  2357. background-color: #fef0f0;
  2358. border-color: #fbc4c4;
  2359. color: #f56c6c;
  2360. }
  2361. .tag-input {
  2362. border: none;
  2363. outline: none;
  2364. flex: 1;
  2365. min-width: 120px;
  2366. }
  2367. .tag-input >>> .el-input__inner {
  2368. border: none;
  2369. padding: 0;
  2370. height: 24px;
  2371. line-height: 24px;
  2372. }
  2373. .button-new-tag {
  2374. height: 24px;
  2375. line-height: 22px;
  2376. padding: 0 8px;
  2377. margin: 2px;
  2378. }
  2379. .input-tips {
  2380. margin-top: 4px;
  2381. font-size: 12px;
  2382. color: #909399;
  2383. }
  2384. /* 新增排序相关样式 */
  2385. .sort-info {
  2386. margin-top: 10px;
  2387. padding: 8px 0;
  2388. }
  2389. /* 表格布局优化 */
  2390. .el-table {
  2391. min-width: 100%;
  2392. table-layout: fixed;
  2393. }
  2394. .el-table .el-table__body-wrapper {
  2395. overflow-x: auto;
  2396. }
  2397. .tip-text {
  2398. display: flex;
  2399. align-items: center;
  2400. gap: 8px;
  2401. }
  2402. .quick-actions {
  2403. margin-top: 12px;
  2404. display: flex;
  2405. justify-content: space-between;
  2406. align-items: center;
  2407. padding: 8px 0;
  2408. border-top: 1px solid #ebeef5;
  2409. }
  2410. .stats-info {
  2411. font-size: 12px;
  2412. color: #909399;
  2413. display: flex;
  2414. align-items: center;
  2415. gap: 4px;
  2416. }
  2417. .invalid-codes-list {
  2418. margin: 16px 0;
  2419. max-height: 200px;
  2420. overflow-y: auto;
  2421. }
  2422. .invalid-tag {
  2423. margin: 4px;
  2424. }
  2425. .debug-preview {
  2426. margin-top: 20px;
  2427. }
  2428. .debug-content {
  2429. font-size: 12px;
  2430. }
  2431. .debug-content code {
  2432. display: block;
  2433. background: #f5f5f5;
  2434. padding: 8px;
  2435. border-radius: 4px;
  2436. margin: 4px 0 12px 0;
  2437. white-space: pre-wrap;
  2438. }
  2439. /* 响应式设计 */
  2440. @media (max-width: 768px) {
  2441. .tag-input-container {
  2442. min-width: auto;
  2443. width: 100%;
  2444. }
  2445. .tags-wrapper {
  2446. min-height: 40px;
  2447. }
  2448. .quick-actions {
  2449. flex-direction: column;
  2450. align-items: flex-start;
  2451. gap: 8px;
  2452. }
  2453. }
  2454. </style>