order1.vue 88 KB

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