order1.vue 86 KB

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