index.vue 86 KB

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