order1.vue 86 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589
  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. focusInput() {
  1403. if (!this.inputVisible) {
  1404. this.showInput()
  1405. }
  1406. },
  1407. // 设置erp账户
  1408. showErpAccountSetDialog() {
  1409. this.erpAccountDialog.open = true;
  1410. this.erpSettingType = 'set'
  1411. this.calculateOrderSummary();
  1412. },
  1413. //显示ERP账户选择对话框
  1414. showErpAccountDialog() {
  1415. this.erpAccountDialog.open = true;
  1416. this.erpSettingType = 'push'
  1417. this.calculateOrderSummary();
  1418. },
  1419. //获取ERP账户列表
  1420. async getErpAccountList() {
  1421. try {
  1422. const response = await getErpAccount();
  1423. if (response.code === 200) {
  1424. const list = response.data || [];
  1425. this.erpAccountList = [...list];
  1426. this.erpAccountQueryList = [...list, '未分拣'];
  1427. // 设置默认值:第一条真实账户
  1428. if (list.length && !this.queryParams.erpAccount) {
  1429. this.$set(this.queryParams, 'erpAccount', list[0]);
  1430. this.getList();
  1431. }
  1432. } else {
  1433. this.$message.error(response.msg || '获取ERP账户列表失败');
  1434. this.erpAccountList = [];
  1435. }
  1436. } catch (error) {
  1437. console.error('获取ERP账户列表失败:', error);
  1438. this.$message.error('获取ERP账户列表失败');
  1439. this.erpAccountList = [];
  1440. } finally {
  1441. this.erpAccountDialog.loading = false;
  1442. }
  1443. },
  1444. // 新增:计算订单统计信息
  1445. calculateOrderSummary() {
  1446. let selectedCount = 0;
  1447. let totalAmount = 0;
  1448. let queryCount = this.total || 0;
  1449. if (this.ids.length > 0) {
  1450. // 如果有选中的订单,统计选中的订单
  1451. selectedCount = this.ids.length;
  1452. this.orderList.forEach(order => {
  1453. if (this.ids.includes(order.orderId)) {
  1454. totalAmount += parseFloat(order.payMoney || 0);
  1455. }
  1456. });
  1457. } else {
  1458. // 如果没有选中订单,统计当前查询条件下的所有订单
  1459. selectedCount = queryCount;
  1460. this.orderList.forEach(order => {
  1461. totalAmount += parseFloat(order.payMoney || 0);
  1462. });
  1463. }
  1464. this.orderSummary = {
  1465. selectedCount,
  1466. totalAmount: totalAmount.toFixed(2),
  1467. queryCount
  1468. };
  1469. },
  1470. //确认创建ERP订单
  1471. confirmCreateErpOrder() {
  1472. if (!this.erpAccountForm.selectedAccount) {
  1473. this.$message.warning('请选择ERP账户');
  1474. return;
  1475. }
  1476. console.log("-----------------",this.erpSettingType)
  1477. if(this.erpSettingType == 'set'){
  1478. this.$confirm(
  1479. `确认将订单设置ERP账户为"${this.erpAccountForm.selectedAccount}"吗?`,
  1480. '确认',
  1481. {
  1482. confirmButtonText: '确定',
  1483. cancelButtonText: '取消',
  1484. type: 'warning'
  1485. }
  1486. ).then(() => {
  1487. this.executSetErpOrder();
  1488. });
  1489. } else if(this.erpSettingType == 'push'){
  1490. this.$confirm(
  1491. `确认将订单推送到ERP账户"${this.erpAccountForm.selectedAccount}"吗?`,
  1492. '确认推送',
  1493. {
  1494. confirmButtonText: '确定推送',
  1495. cancelButtonText: '取消',
  1496. type: 'warning'
  1497. }
  1498. ).then(() => {
  1499. this.executeCreateErpOrder();
  1500. });
  1501. }
  1502. },
  1503. async executSetErpOrder() {
  1504. this.erpAccountDialog.submitting = true;
  1505. try {
  1506. let param = {
  1507. loginAccount: this.erpAccountForm.selectedAccount
  1508. };
  1509. if (this.ids.length > 0) {
  1510. // 如果有选中的订单,只推送选中的
  1511. param.orderIds = this.ids;
  1512. } else {
  1513. // 如果没有选中订单,推送查询条件下的所有订单
  1514. if (this.payTypeArr.length > 0) {
  1515. this.queryParams.payType = this.payTypeArr.toString();
  1516. } else {
  1517. this.queryParams.payType = null;
  1518. }
  1519. if (this.scheduleIdArr.length > 0) {
  1520. this.queryParams.scheduleId = this.scheduleIdArr.toString();
  1521. } else {
  1522. this.queryParams.scheduleId = null;
  1523. }
  1524. if (this.buyTypeArr.length > 0) {
  1525. this.queryParams.orderBuyType = this.buyTypeArr.toString();
  1526. } else {
  1527. this.queryParams.orderBuyType = null;
  1528. }
  1529. if (this.channelArr.length > 0) {
  1530. this.queryParams.orderChannel = this.channelArr.toString();
  1531. } else {
  1532. this.queryParams.orderChannel = null;
  1533. }
  1534. if (this.qwSubjectArr.length > 0) {
  1535. this.queryParams.qwSubject = this.qwSubjectArr.toString();
  1536. } else {
  1537. this.queryParams.qwSubject = null;
  1538. }
  1539. // 合并查询参数
  1540. param = { ...param, ...this.queryParams };
  1541. }
  1542. const response = await batchSetErpOrder(param);
  1543. if (response.code === 200) {
  1544. this.$message.success('订单ERP账号设置成功');
  1545. this.cancelErpAccountDialog();
  1546. this.getErpAccountList(); // 刷新列表
  1547. this.getList();
  1548. } else {
  1549. this.$message.error(response.msg || 'ERP账号设置失败');
  1550. }
  1551. } catch (error) {
  1552. console.error('ERP账号设置失败:', error);
  1553. this.$message.error('ERP账号设置失败');
  1554. } finally {
  1555. this.erpAccountDialog.submitting = false;
  1556. }
  1557. },
  1558. //执行创建ERP订单
  1559. async executeCreateErpOrder() {
  1560. this.erpAccountDialog.submitting = true;
  1561. try {
  1562. let param = {
  1563. loginAccount: this.erpAccountForm.selectedAccount
  1564. };
  1565. if (this.ids.length > 0) {
  1566. // 如果有选中的订单,只推送选中的
  1567. param.orderIds = this.ids;
  1568. } else {
  1569. // 如果没有选中订单,推送查询条件下的所有订单
  1570. if (this.payTypeArr.length > 0) {
  1571. this.queryParams.payType = this.payTypeArr.toString();
  1572. } else {
  1573. this.queryParams.payType = null;
  1574. }
  1575. if (this.scheduleIdArr.length > 0) {
  1576. this.queryParams.scheduleId = this.scheduleIdArr.toString();
  1577. } else {
  1578. this.queryParams.scheduleId = null;
  1579. }
  1580. if (this.buyTypeArr.length > 0) {
  1581. this.queryParams.orderBuyType = this.buyTypeArr.toString();
  1582. } else {
  1583. this.queryParams.orderBuyType = null;
  1584. }
  1585. if (this.channelArr.length > 0) {
  1586. this.queryParams.orderChannel = this.channelArr.toString();
  1587. } else {
  1588. this.queryParams.orderChannel = null;
  1589. }
  1590. if (this.qwSubjectArr.length > 0) {
  1591. this.queryParams.qwSubject = this.qwSubjectArr.toString();
  1592. } else {
  1593. this.queryParams.qwSubject = null;
  1594. }
  1595. // 合并查询参数
  1596. param = { ...param, ...this.queryParams };
  1597. }
  1598. const response = await batchCreateErpOrder(param);
  1599. if (response.code === 200) {
  1600. this.$message.success('ERP订单创建成功');
  1601. this.cancelErpAccountDialog();
  1602. this.getErpAccountList(); // 刷新列表
  1603. this.getList();
  1604. } else {
  1605. this.$message.error(response.msg || 'ERP订单创建失败');
  1606. }
  1607. } catch (error) {
  1608. console.error('创建ERP订单失败:', error);
  1609. this.$message.error('创建ERP订单失败');
  1610. } finally {
  1611. this.erpAccountDialog.submitting = false;
  1612. }
  1613. },
  1614. // 新增:取消ERP账户选择对话框
  1615. cancelErpAccountDialog() {
  1616. this.erpAccountDialog.open = false;
  1617. this.erpAccountForm.selectedAccount = null;
  1618. this.orderSummary = null;
  1619. this.erpAccountList = [];
  1620. },
  1621. handleCancelErpPhone(){
  1622. this.erpPhoneValue = [];
  1623. this.setPhoneOpen = false;
  1624. },
  1625. submitErpPhone(){
  1626. let param = {};
  1627. if(this.ids.length>0){
  1628. param = {orderIds:this.ids,erpPhone:this.erpPhoneValue};
  1629. } else {
  1630. if(this.payTypeArr.length>0){
  1631. this.queryParams.payType=this.payTypeArr.toString();
  1632. }
  1633. else{
  1634. this.queryParams.payType=null
  1635. }
  1636. if(this.scheduleIdArr.length>0){
  1637. this.queryParams.scheduleId=this.scheduleIdArr.toString();
  1638. }
  1639. else{
  1640. this.queryParams.scheduleId=null
  1641. }
  1642. if(this.buyTypeArr.length>0){
  1643. this.queryParams.orderBuyType=this.buyTypeArr.toString();
  1644. }
  1645. else{
  1646. this.queryParams.orderbuyType=null
  1647. }
  1648. if(this.channelArr.length>0){
  1649. this.queryParams.orderChannel=this.channelArr.toString();
  1650. }
  1651. else{
  1652. this.queryParams.orderChannel=null
  1653. }
  1654. if(this.qwSubjectArr.length>0){
  1655. this.queryParams.qwSubject=this.qwSubjectArr.toString();
  1656. }
  1657. else{
  1658. this.queryParams.qwSubject=null
  1659. }
  1660. param = this.queryParams;
  1661. param.erpPhone=this.erpPhoneValue;
  1662. }
  1663. editErpPhone(param).then(response=>{
  1664. this.msgSuccess("修改成功");
  1665. this.setPhoneOpen = false;
  1666. this.getList();
  1667. })
  1668. },
  1669. setErpPhone(){
  1670. this.getErpPhoneList();
  1671. this.setPhoneOpen = true;
  1672. },
  1673. // 设置推送手机相关方法
  1674. handleErpPhone(){
  1675. //查询配置手机号
  1676. this.getErpPhoneList();
  1677. this.erpPhone.open = true
  1678. },
  1679. getErpPhoneList(){
  1680. queryErpPhone().then(response =>{
  1681. if(response.data && response.data != null && response.data.length >0){
  1682. const phones = response.data.filter(phone => phone.trim());
  1683. this.phoneList = phones.map(phone => ({
  1684. phone: phone.trim(),
  1685. editing: false,
  1686. originalPhone: phone.trim()
  1687. }));
  1688. }
  1689. // 保存原始数据用于取消操作
  1690. this.originalPhoneList = this.phoneList;
  1691. });
  1692. },
  1693. // 新增手机号
  1694. handleAddPhone() {
  1695. this.phoneList.push({
  1696. phone: '',
  1697. editing: true,
  1698. originalPhone: '',
  1699. isNew: true
  1700. });
  1701. },
  1702. // 编辑手机号
  1703. handleEditPhone(index) {
  1704. this.$set(this.phoneList[index], 'editing', true);
  1705. this.$set(this.phoneList[index], 'originalPhone', this.phoneList[index].phone);
  1706. },
  1707. // 保存手机号
  1708. handleSavePhone(index) {
  1709. const phone = this.phoneList[index].phone.trim();
  1710. if (!phone) {
  1711. this.$message.error('手机号不能为空');
  1712. return;
  1713. }
  1714. if (!this.validatePhoneFormat(phone)) {
  1715. this.$message.error('请输入正确的手机号格式');
  1716. return;
  1717. }
  1718. // 检查是否重复
  1719. const duplicateIndex = this.phoneList.findIndex((item, idx) =>
  1720. idx !== index && item.phone === phone
  1721. );
  1722. if (duplicateIndex !== -1) {
  1723. this.$message.error('手机号已存在');
  1724. return;
  1725. }
  1726. this.$set(this.phoneList[index], 'editing', false);
  1727. this.$set(this.phoneList[index], 'isNew', false);
  1728. },
  1729. // 取消编辑
  1730. handleCancelEdit(index) {
  1731. if (this.phoneList[index].isNew) {
  1732. // 如果是新增的,直接删除
  1733. this.phoneList.splice(index, 1);
  1734. } else {
  1735. // 如果是编辑的,恢复原值
  1736. this.$set(this.phoneList[index], 'phone', this.phoneList[index].originalPhone);
  1737. this.$set(this.phoneList[index], 'editing', false);
  1738. }
  1739. },
  1740. // 删除手机号
  1741. handleDeletePhone(index) {
  1742. this.$confirm('确认删除该手机号?', '提示', {
  1743. confirmButtonText: '确定',
  1744. cancelButtonText: '取消',
  1745. type: 'warning'
  1746. }).then(() => {
  1747. this.phoneList.splice(index, 1);
  1748. this.$message.success('删除成功');
  1749. });
  1750. },
  1751. // 验证手机号格式
  1752. validatePhoneFormat(phone) {
  1753. const phoneRegex = /^1[3-9]\d{9}$/;
  1754. return phoneRegex.test(phone);
  1755. },
  1756. // 验证手机号
  1757. validatePhone(row) {
  1758. if (row.phone && !this.validatePhoneFormat(row.phone)) {
  1759. this.$message.error('请输入正确的手机号格式');
  1760. }
  1761. },
  1762. // 保存手机号列表
  1763. handleSavePhoneList() {
  1764. // 检查是否有正在编辑的项
  1765. const editingItem = this.phoneList.find(item => item.editing);
  1766. if (editingItem) {
  1767. this.$message.error('请先保存正在编辑的手机号');
  1768. return;
  1769. }
  1770. // 检查是否有空的手机号
  1771. const emptyPhone = this.phoneList.find(item => !item.phone.trim());
  1772. if (emptyPhone) {
  1773. this.$message.error('存在空的手机号,请删除或填写完整');
  1774. return;
  1775. }
  1776. // 构造手机号列表
  1777. const phoneList = this.phoneList.map(item => item.phone);
  1778. // 调用保存接口
  1779. saveErpPhone(phoneList).then(response => {
  1780. if (response.code === 200) {
  1781. this.$message.success('保存成功');
  1782. this.erpPhone.open = false;
  1783. } else {
  1784. this.$message.error(response.msg || '保存失败');
  1785. }
  1786. this.getList();
  1787. }).catch(() => {
  1788. this.$message.error('保存失败');
  1789. });
  1790. },
  1791. // 取消手机号对话框
  1792. handleCancelPhoneDialog() {
  1793. // 恢复原始数据
  1794. this.phoneList = JSON.parse(JSON.stringify(this.originalPhoneList));
  1795. this.erpPhone.open = false;
  1796. },
  1797. handleImportExpress() {
  1798. this.importExpress.title = "导入";
  1799. this.importExpress.open = true;
  1800. },
  1801. /** 下载模板操作 */
  1802. importTemplateExpress() {
  1803. importExpressTemplate().then(response => {
  1804. this.download(response.msg);
  1805. });
  1806. },
  1807. // 文件上传中处理
  1808. handleFileUploadProgressExpress(event, file, fileList) {
  1809. this.upload.isUploading = true;
  1810. },
  1811. // 文件上传中处理
  1812. handleFileUploadProgressOrder(event, file, fileList) {
  1813. this.uploadStatus.isUploading = true;
  1814. },
  1815. // 文件上传成功处理
  1816. handleFileSuccessExpress(response, file, fileList) {
  1817. this.importExpress.open = false;
  1818. this.importExpress.isUploading = false;
  1819. this.$refs.importExpress.clearFiles();
  1820. this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
  1821. this.getList();
  1822. },
  1823. // 文件上传成功处理
  1824. handleFileSuccessOrder(response, file, fileList) {
  1825. this.uploadStatus.open = false;
  1826. this.uploadStatus.isUploading = false;
  1827. this.$refs.uploadStatus.clearFiles();
  1828. this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
  1829. this.getList();
  1830. },
  1831. // 提交上传文件
  1832. submitFileFormExpress() {
  1833. this.$refs.importExpress.submit();
  1834. },
  1835. handleImportStatus() {
  1836. this.uploadStatus.title = "导入";
  1837. this.uploadStatus.open = true;
  1838. },
  1839. /** 导入按钮操作 */
  1840. handleImport() {
  1841. this.upload.title = "导入";
  1842. this.upload.open = true;
  1843. },
  1844. /** 下载模板操作 */
  1845. importTemplate() {
  1846. importTemplate().then(response => {
  1847. this.download(response.msg);
  1848. });
  1849. },
  1850. importUpdateOrderTemplate(){
  1851. importUpdateOrderTemplate().then(response => {
  1852. this.download(response.msg);
  1853. });
  1854. },
  1855. // 文件上传中处理
  1856. handleFileUploadProgress(event, file, fileList) {
  1857. this.upload.isUploading = true;
  1858. },
  1859. // 文件上传成功处理
  1860. handleFileSuccess(response, file, fileList) {
  1861. this.upload.open = false;
  1862. this.upload.isUploading = false;
  1863. this.$refs.upload.clearFiles();
  1864. this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
  1865. this.getList();
  1866. },
  1867. // 提交上传文件
  1868. submitFileForm() {
  1869. this.$refs.upload.submit();
  1870. },
  1871. submitOrderStatusFileForm(){
  1872. this.$refs.uploadStatus.submit();
  1873. },
  1874. handledetails(row){
  1875. this.show.open=true;
  1876. setTimeout(() => {
  1877. this.$refs.Details.getDetails(row.orderId,row.nickName,row.storeName);
  1878. }, 1);
  1879. },
  1880. getstoreList() {
  1881. listStore().then(response => {
  1882. this.storeOPtions = response.rows;
  1883. });
  1884. },
  1885. // 取消按钮
  1886. cancel() {
  1887. this.open = false;
  1888. this.reset();
  1889. },
  1890. // 表单重置
  1891. reset() {
  1892. this.form = {
  1893. orderId: null,
  1894. storeId: null,
  1895. orderCode: null,
  1896. userId: null,
  1897. userName: null,
  1898. userPhone: null,
  1899. userAddress: null,
  1900. cartId: null,
  1901. totalNum: null,
  1902. totalPrice: null,
  1903. payPrice: null,
  1904. payMoney: null,
  1905. isPay: null,
  1906. payTime: null,
  1907. payType: null,
  1908. createTime: null,
  1909. updateTime: null,
  1910. status: null,
  1911. refundStatus: "0",
  1912. refundImg: null,
  1913. refundExplain: null,
  1914. refundTime: null,
  1915. refundReason: null,
  1916. refundMoney: null,
  1917. deliveryCode: null,
  1918. deliveryName: null,
  1919. deliverySn: null,
  1920. remark: null,
  1921. isDel: null,
  1922. costPrice: null,
  1923. verifyCode: null,
  1924. shippingType: null,
  1925. isChannel: null,
  1926. isPrescribe: null,
  1927. prescribeId: null,
  1928. finishTime: null,
  1929. deliveryTime: null,
  1930. tuiMoney: null,
  1931. tuiMoneyStatus: 0,
  1932. tuiUserId: null,
  1933. orderCreateType: null
  1934. };
  1935. this.resetForm("form");
  1936. this.payTypeArr = null;
  1937. this.scheduleIdArr = null;
  1938. this.buyTypeArr = null;
  1939. this.channelArr = null;
  1940. this.qwSubjectArr = null;
  1941. },
  1942. /** 搜索按钮操作 */
  1943. handleQuery() {
  1944. this.queryParams.pageNum = 1;
  1945. this.getList();
  1946. },
  1947. handleClickX(tab, event) {
  1948. this.orderStatus = tab.name;
  1949. if(tab.name=="10"){
  1950. this.queryParams.status=null;
  1951. }else{
  1952. this.queryParams.status=tab.name;
  1953. }
  1954. this.handleQuery();
  1955. },
  1956. changeTime(){
  1957. if(this.createTime!=null){
  1958. this.queryParams.sTime=this.createTime[0];
  1959. this.queryParams.eTime=this.createTime[1];
  1960. }else{
  1961. this.queryParams.sTime=null;
  1962. this.queryParams.eTime=null;
  1963. }
  1964. if(this.deliverySendTime!=null){
  1965. this.queryParams.deliverySendsTime=this.deliverySendTime[0];
  1966. this.queryParams.deliverySendeTime=this.deliverySendTime[1];
  1967. }else{
  1968. this.queryParams.deliverySendsTime=null;
  1969. this.queryParams.deliverySendeTime=null;
  1970. }
  1971. if(this.deliveryImportTime!=null){
  1972. this.queryParams.deliveryImportsTime=this.deliveryImportTime[0];
  1973. this.queryParams.deliveryImporteTime=this.deliveryImportTime[1];
  1974. }else{
  1975. this.queryParams.deliveryImportsTime=null;
  1976. this.queryParams.deliveryImporteTime=null;
  1977. }
  1978. if(this.tuiMoneyTime!=null){
  1979. this.queryParams.tuisTime=this.tuiMoneyTime[0];
  1980. this.queryParams.tuieTime=this.tuiMoneyTime[1];
  1981. }else{
  1982. this.queryParams.tuisTime=null;
  1983. this.queryParams.tuieTime=null;
  1984. }
  1985. },
  1986. changePayTime(){
  1987. if(this.payTime!=null){
  1988. this.queryParams.sTime=this.payTime[0];
  1989. this.queryParams.eTime=this.payTime[1];
  1990. }else{
  1991. this.queryParams.paysTime=null;
  1992. this.queryParams.payeTime=null;
  1993. }
  1994. },
  1995. /** 重置按钮操作 */
  1996. resetQuery() {
  1997. this.resetForm("queryForm");
  1998. this.createTime=null;
  1999. this.queryParams.sTime=null;
  2000. this.queryParams.eTime=null;
  2001. this.payTime=null;
  2002. this.queryParams.paysTime=null;
  2003. this.queryParams.payeTime=null;
  2004. this.queryParams.deliveryImportTime = null;
  2005. this.queryParams.deliveryImportsTime = null;
  2006. this.queryParams.deliveryImporteTime = null;
  2007. this.queryParams.deliverySendTime = null;
  2008. this.queryParams.deliverySendsTime = null;
  2009. this.queryParams.deliverySendeTime = null;
  2010. this.queryParams.tuisTIme = null;
  2011. this.queryParams.tuieTIme = null;
  2012. this.companyIds = null;
  2013. this.companyId = null;
  2014. // 清除排序
  2015. this.currentSort = {
  2016. prop: null,
  2017. order: null
  2018. };
  2019. this.queryParams.sortField = null;
  2020. this.queryParams.sortOrder = null;
  2021. // 清除订单号标签
  2022. this.queryParams.orderCodes = [];
  2023. this.currentInput = '';
  2024. this.inputVisible = false;
  2025. // 重置表格排序状态 - 关键代码
  2026. this.$nextTick(() => {
  2027. if (this.$refs.orderTable) {
  2028. this.$refs.orderTable.clearSort();
  2029. }
  2030. });
  2031. this.handleQuery();
  2032. },
  2033. // 多选框选中数据
  2034. handleSelectionChange(selection) {
  2035. this.ids = selection.map(item => item.orderId)
  2036. this.single = selection.length!==1
  2037. this.multiple = !selection.length
  2038. },
  2039. /** 新增按钮操作 */
  2040. handleAdd() {
  2041. this.reset();
  2042. this.open = true;
  2043. this.title = "添加订单";
  2044. },
  2045. /** 修改按钮操作 */
  2046. handleUpdate(row) {
  2047. this.reset();
  2048. const orderId = row.orderId || this.ids
  2049. getOrder(orderId).then(response => {
  2050. this.form = response.data;
  2051. this.open = true;
  2052. this.title = "修改订单";
  2053. });
  2054. },
  2055. /** 提交按钮 */
  2056. submitForm() {
  2057. this.$refs["form"].validate(valid => {
  2058. if (valid) {
  2059. if (this.form.orderId != null) {
  2060. updateOrder(this.form).then(response => {
  2061. this.msgSuccess("修改成功");
  2062. this.open = false;
  2063. this.getList();
  2064. });
  2065. } else {
  2066. addOrder(this.form).then(response => {
  2067. this.msgSuccess("新增成功");
  2068. this.open = false;
  2069. this.getList();
  2070. });
  2071. }
  2072. }
  2073. });
  2074. },
  2075. /** 删除按钮操作 */
  2076. handleDelete(row) {
  2077. const orderIds = row.orderId || this.ids;
  2078. this.$confirm('是否确认删除订单编号为"' + orderIds + '"的数据项?', "警告", {
  2079. confirmButtonText: "确定",
  2080. cancelButtonText: "取消",
  2081. type: "warning"
  2082. }).then(function() {
  2083. return delOrder(orderIds);
  2084. }).then(() => {
  2085. this.getList();
  2086. this.msgSuccess("删除成功");
  2087. }).catch(() => {});
  2088. },
  2089. /** 导出按钮操作 */
  2090. handleExport() {
  2091. var that=this;
  2092. if(this.payTypeArr.length>0){
  2093. this.queryParams.payType=this.payTypeArr.toString();
  2094. }
  2095. else{
  2096. this.queryParams.payType=null
  2097. }
  2098. if(this.scheduleIdArr.length>0){
  2099. this.queryParams.scheduleId=this.scheduleIdArr.toString();
  2100. }
  2101. else{
  2102. this.queryParams.scheduleId=null
  2103. }
  2104. if(this.buyTypeArr.length>0){
  2105. this.queryParams.orderBuyType=this.buyTypeArr.toString();
  2106. }
  2107. else{
  2108. this.queryParams.orderbuyType=null
  2109. }
  2110. if(this.channelArr.length>0){
  2111. this.queryParams.orderChannel=this.channelArr.toString();
  2112. }
  2113. else{
  2114. this.queryParams.orderChannel=null
  2115. }
  2116. if(this.qwSubjectArr.length>0){
  2117. this.queryParams.qwSubject=this.qwSubjectArr.toString();
  2118. }
  2119. else{
  2120. this.queryParams.qwSubject=null
  2121. }
  2122. const queryParams = this.queryParams;
  2123. this.$confirm('是否确认导出所有订单数据项?', "警告", {
  2124. confirmButtonText: "确定",
  2125. cancelButtonText: "取消",
  2126. type: "warning"
  2127. }).then(() => {
  2128. this.exportLoading = true;
  2129. return exportOrder(queryParams);
  2130. }).then(response => {
  2131. console.log(response)
  2132. if(response.code==200){
  2133. that.msgSuccess(response.msg);
  2134. that.taskId=response.data;
  2135. that.time=setInterval(function(){
  2136. //查订单
  2137. getTask(that.taskId).then(res => {
  2138. if(res.data.status==1){
  2139. that.exportLoading = false;
  2140. clearTimeout(that.time)
  2141. that.time=null;
  2142. that.download(res.data.fileUrl);
  2143. }
  2144. });
  2145. },10000);
  2146. }
  2147. }).catch(() => {});
  2148. },
  2149. /** 导出按钮操作 */
  2150. handleOrderExport() {
  2151. // 打开字段选择对话框
  2152. this.exportFieldDialog.open = true;
  2153. },
  2154. // 导出字段选择相关方法
  2155. // 全选字段
  2156. selectAllFields() {
  2157. this.exportFieldOptions.forEach(field => {
  2158. field.checked = true;
  2159. });
  2160. },
  2161. // 全不选字段
  2162. unselectAllFields() {
  2163. this.exportFieldOptions.forEach(field => {
  2164. field.checked = false;
  2165. });
  2166. },
  2167. // 选择常用字段
  2168. selectDefaultFields() {
  2169. // 先全不选
  2170. this.unselectAllFields();
  2171. // 然后选择常用字段
  2172. const defaultFields = ['orderCode', 'prescribeCode', 'companyName', 'companyUserNickName',
  2173. 'storeName', 'miniProgramName', 'userName', 'userPhone', 'userAddress', 'totalPrice',
  2174. 'totalNum', 'payPrice', 'payMoney', 'createTime', 'payTime',
  2175. 'payType', 'status', 'packageName', 'patientName'];
  2176. this.exportFieldOptions.forEach(field => {
  2177. if (defaultFields.includes(field.key)) {
  2178. field.checked = true;
  2179. }
  2180. });
  2181. },
  2182. // 获取已选择字段数量
  2183. getSelectedFieldsCount() {
  2184. return this.exportFieldOptions.filter(field => field.checked).length;
  2185. },
  2186. // 取消导出字段选择
  2187. cancelExportFieldDialog() {
  2188. this.exportFieldDialog.open = false;
  2189. },
  2190. // 确认导出字段
  2191. confirmExportFields() {
  2192. // 获取已选择的字段
  2193. const selectedFieldsArray = this.exportFieldOptions.filter(field => field.checked);
  2194. let selectedFields = '';
  2195. if (selectedFieldsArray.length === 0) {
  2196. // 如果没有选择任何字段,则导出全部字段(不传filter参数)
  2197. selectedFields = null;
  2198. } else {
  2199. // 如果选择了字段,则只导出选中的字段
  2200. selectedFields = selectedFieldsArray.map(field => field.key).join(',');
  2201. }
  2202. // 关闭弹窗
  2203. this.exportFieldDialog.open = false;
  2204. // 执行导出操作
  2205. this.doExportOrder(selectedFields);
  2206. },
  2207. // 执行导出操作
  2208. doExportOrder(selectedFields) {
  2209. var that = this;
  2210. // 处理查询参数
  2211. if(this.payTypeArr.length>0){
  2212. this.queryParams.payType=this.payTypeArr.toString();
  2213. } else {
  2214. this.queryParams.payType=null
  2215. }
  2216. if(this.scheduleIdArr.length>0){
  2217. this.queryParams.scheduleId=this.scheduleIdArr.toString();
  2218. } else {
  2219. this.queryParams.scheduleId=null
  2220. }
  2221. if(this.buyTypeArr.length>0){
  2222. this.queryParams.orderBuyType=this.buyTypeArr.toString();
  2223. } else {
  2224. this.queryParams.orderbuyType=null
  2225. }
  2226. if(this.channelArr.length>0){
  2227. this.queryParams.orderChannel=this.channelArr.toString();
  2228. } else {
  2229. this.queryParams.orderChannel=null
  2230. }
  2231. if(this.qwSubjectArr.length>0){
  2232. this.queryParams.qwSubject=this.qwSubjectArr.toString();
  2233. } else {
  2234. this.queryParams.qwSubject=null
  2235. }
  2236. const queryParams = this.queryParams;
  2237. // 根据是否选择字段显示不同的确认消息
  2238. let confirmMessage = '';
  2239. if (selectedFields === null) {
  2240. confirmMessage = '没有选择字段,将导出所有字段的订单数据,确认继续?';
  2241. } else {
  2242. const fieldCount = selectedFields.split(',').length;
  2243. confirmMessage = `确认导出选中的 ${fieldCount} 个字段的订单数据?`;
  2244. }
  2245. this.$confirm(confirmMessage, "确认导出", {
  2246. confirmButtonText: "确定",
  2247. cancelButtonText: "取消",
  2248. type: "warning"
  2249. }).then(() => {
  2250. this.exportLoading = true;
  2251. // 构建请求参数
  2252. const requestParams = {...queryParams};
  2253. // 只有当selectedFields不为null时才添加filter参数
  2254. if (selectedFields !== null) {
  2255. requestParams.filter = selectedFields;
  2256. }
  2257. return exportOrder2(requestParams);
  2258. }).then(response => {
  2259. console.log(response)
  2260. if(response.code==200){
  2261. console.log(response.msg)
  2262. that.msgSuccess(response.msg);
  2263. that.taskId=response.data;
  2264. that.time=setInterval(function(){
  2265. //查订单
  2266. getTask(that.taskId).then(res => {
  2267. if(res.data.status==1){
  2268. that.exportLoading = false;
  2269. clearTimeout(that.time)
  2270. that.time=null;
  2271. that.download(res.data.fileUrl);
  2272. }
  2273. });
  2274. },10000);
  2275. }
  2276. }).catch(() => {
  2277. this.exportLoading = false;
  2278. });
  2279. },
  2280. /** 查询部门下拉树结构 */
  2281. getTreeselect() {
  2282. var that=this;
  2283. var param={companyId:this.companyId}
  2284. treeselect(param).then((response) => {
  2285. this.deptOptions = response.data;
  2286. console.log(this.deptOptions)
  2287. if(response.data!=null&&response.data.length>0){
  2288. //this.queryParams.deptId=response.data[0].id;
  2289. }
  2290. });
  2291. },
  2292. companyChange(val){
  2293. console.log(this.companyIds);
  2294. if(this.companyIds.length>1){
  2295. this.deptOpen = false;
  2296. } else {
  2297. this.deptOpen = true
  2298. if(this.companyIds.length=1){
  2299. this.companyId=this.companyIds[0];
  2300. this.getTreeselect();
  2301. }
  2302. }
  2303. },
  2304. // companyChange(val){
  2305. // console.log(val);
  2306. // this.companyId=val;
  2307. // this.getTreeselect();
  2308. // },
  2309. currDeptChange(val){
  2310. console.log(val)
  2311. this.queryParams.deptId=val;
  2312. this.getList();
  2313. },
  2314. // 获取小程序选项列表
  2315. getAppMallOptions() {
  2316. getAppMallOptions({pageNum:1,pageSize:100,isMall:1}).then(response => {
  2317. this.appMallOptions = response.rows;
  2318. })
  2319. },
  2320. }
  2321. };
  2322. </script>
  2323. <style scoped>
  2324. .tag-input-order-search {
  2325. padding: 20px;
  2326. background: #fff;
  2327. border-radius: 4px;
  2328. }
  2329. .tag-input-container {
  2330. min-width: 445px;
  2331. }
  2332. .tags-wrapper {
  2333. min-height: 32px;
  2334. padding: 4px 8px;
  2335. border: 1px solid #dcdfe6;
  2336. border-radius: 4px;
  2337. cursor: text;
  2338. display: flex;
  2339. flex-wrap: wrap;
  2340. align-items: center;
  2341. gap: 4px;
  2342. transition: border-color 0.2s;
  2343. }
  2344. .tags-wrapper:hover {
  2345. border-color: #c0c4cc;
  2346. }
  2347. .tags-wrapper:focus-within {
  2348. border-color: #409eff;
  2349. box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
  2350. }
  2351. .order-tag {
  2352. margin: 2px;
  2353. flex-shrink: 0;
  2354. }
  2355. .tag-error {
  2356. background-color: #fef0f0;
  2357. border-color: #fbc4c4;
  2358. color: #f56c6c;
  2359. }
  2360. .tag-input {
  2361. border: none;
  2362. outline: none;
  2363. flex: 1;
  2364. min-width: 120px;
  2365. }
  2366. .tag-input >>> .el-input__inner {
  2367. border: none;
  2368. padding: 0;
  2369. height: 24px;
  2370. line-height: 24px;
  2371. }
  2372. .button-new-tag {
  2373. height: 24px;
  2374. line-height: 22px;
  2375. padding: 0 8px;
  2376. margin: 2px;
  2377. }
  2378. .input-tips {
  2379. margin-top: 4px;
  2380. font-size: 12px;
  2381. color: #909399;
  2382. }
  2383. /* 新增排序相关样式 */
  2384. .sort-info {
  2385. margin-top: 10px;
  2386. padding: 8px 0;
  2387. }
  2388. /* 表格布局优化 */
  2389. .el-table {
  2390. min-width: 100%;
  2391. table-layout: fixed;
  2392. }
  2393. .el-table .el-table__body-wrapper {
  2394. overflow-x: auto;
  2395. }
  2396. .tip-text {
  2397. display: flex;
  2398. align-items: center;
  2399. gap: 8px;
  2400. }
  2401. .quick-actions {
  2402. margin-top: 12px;
  2403. display: flex;
  2404. justify-content: space-between;
  2405. align-items: center;
  2406. padding: 8px 0;
  2407. border-top: 1px solid #ebeef5;
  2408. }
  2409. .stats-info {
  2410. font-size: 12px;
  2411. color: #909399;
  2412. display: flex;
  2413. align-items: center;
  2414. gap: 4px;
  2415. }
  2416. .invalid-codes-list {
  2417. margin: 16px 0;
  2418. max-height: 200px;
  2419. overflow-y: auto;
  2420. }
  2421. .invalid-tag {
  2422. margin: 4px;
  2423. }
  2424. .debug-preview {
  2425. margin-top: 20px;
  2426. }
  2427. .debug-content {
  2428. font-size: 12px;
  2429. }
  2430. .debug-content code {
  2431. display: block;
  2432. background: #f5f5f5;
  2433. padding: 8px;
  2434. border-radius: 4px;
  2435. margin: 4px 0 12px 0;
  2436. white-space: pre-wrap;
  2437. }
  2438. /* 响应式设计 */
  2439. @media (max-width: 768px) {
  2440. .tag-input-container {
  2441. min-width: auto;
  2442. width: 100%;
  2443. }
  2444. .tags-wrapper {
  2445. min-height: 40px;
  2446. }
  2447. .quick-actions {
  2448. flex-direction: column;
  2449. align-items: flex-start;
  2450. gap: 8px;
  2451. }
  2452. }
  2453. </style>