index.vue 54 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526
  1. <template>
  2. <div class="app-container app-container-scheduling" :style="{'--q-height':qHeight}">
  3. <div class="app-container-query" ref="queryFormBox">
  4. <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
  5. <el-form-item v-if="queryShow.id" label="订单号">
  6. <el-input
  7. v-model="queryParams.id"
  8. placeholder="请输入订单号"
  9. clearable
  10. style="width: 240px;"
  11. @keyup.enter.native="handleQuery"
  12. />
  13. <span @click="clearQuery('id')" class="query_clear"><i class="el-icon-circle-close"></i></span>
  14. </el-form-item>
  15. <el-form-item v-if="queryShow.teamName" label="团队名称" label-width="100px">
  16. <el-input
  17. v-model="queryParams.teamName"
  18. placeholder="请输入团队名称"
  19. clearable
  20. style="width: 240px;"
  21. @keyup.enter.native="handleQuery"
  22. />
  23. <span @click="clearQuery('teamName')" class="query_clear"><i class="el-icon-circle-close"></i></span>
  24. </el-form-item>
  25. <el-form-item v-if="queryShow.salerPerson" label="销售员" label-width="100px">
  26. <el-input
  27. v-model="queryParams.salerPerson"
  28. placeholder="请输入销售员"
  29. clearable
  30. style="width: 240px;"
  31. @keyup.enter.native="handleQuery"
  32. />
  33. <span @click="clearQuery('salerPerson')" class="query_clear"><i class="el-icon-circle-close"></i></span>
  34. </el-form-item>
  35. <el-form-item v-if="queryShow.teamTypeId" label="团队类型">
  36. <el-select
  37. v-model="queryParams.teamTypeId"
  38. placeholder="请选择团队类型"
  39. clearable
  40. style="width: 240px"
  41. >
  42. <el-option
  43. v-for="dict in dict.type.team_type"
  44. :key="dict.value"
  45. :label="dict.label"
  46. :value="dict.value"
  47. />
  48. </el-select>
  49. <span @click="clearQuery('teamTypeId')" class="query_clear"><i class="el-icon-circle-close"></i></span>
  50. </el-form-item>
  51. <el-form-item v-if="queryShow.ifSuccessInvoice" label="是否成功开票" label-width="100">
  52. <el-select
  53. v-model="queryParams.ifSuccessInvoice"
  54. placeholder="请选择是否成功开票"
  55. clearable
  56. style="width: 100%"
  57. >
  58. <el-option label="否" value="0" />
  59. <el-option label="是" value="1" />
  60. </el-select>
  61. <span @click="clearQuery('ifSuccessInvoice')" class="query_clear"><i class="el-icon-circle-close"></i></span>
  62. </el-form-item>
  63. <el-form-item v-if="queryShow.status" label="订单状态">
  64. <el-select
  65. v-model="queryParams.status"
  66. placeholder="订单状态"
  67. clearable
  68. style="width: 100%"
  69. >
  70. <el-option
  71. v-for="dict in dict.type.order_status_type"
  72. :key="dict.value"
  73. :label="dict.label"
  74. :value="dict.value"
  75. />
  76. </el-select>
  77. <span @click="clearQuery('status')" class="query_clear"><i class="el-icon-circle-close"></i></span>
  78. </el-form-item>
  79. <el-form-item v-if="queryShow.payWay" label="支付方式">
  80. <el-select
  81. v-model="queryParams.payWay"
  82. placeholder="支付方式"
  83. clearable
  84. style="width: 100%"
  85. >
  86. <el-option
  87. v-for="dict in dict.type.pay_way_type"
  88. :key="dict.value"
  89. :label="dict.label"
  90. :value="dict.value"
  91. />
  92. </el-select>
  93. <span @click="clearQuery('payWay')" class="query_clear"><i class="el-icon-circle-close"></i></span>
  94. </el-form-item>
  95. <el-form-item v-if="queryShow.time" label="支付时间">
  96. <el-date-picker
  97. v-model="queryParams.time"
  98. type="daterange"
  99. value-format="yyyy-MM-dd"
  100. range-separator="至"
  101. start-placeholder="开始日期"
  102. end-placeholder="结束日期">
  103. </el-date-picker>
  104. <span @click="clearQuery('time')" class="query_clear"><i class="el-icon-circle-close"></i></span>
  105. </el-form-item>
  106. <el-form-item v-if="queryShow.paymentId" label="支付单号">
  107. <el-input
  108. v-model="queryParams.paymentId"
  109. placeholder="请输入支付单号"
  110. clearable
  111. style="width: 240px;"
  112. @keyup.enter.native="handleQuery"
  113. />
  114. <span @click="clearQuery('paymentId')" class="query_clear"><i class="el-icon-circle-close"></i></span>
  115. </el-form-item>
  116. <!-- <el-form-item label="场次时间">
  117. <el-date-picker
  118. style="width: 230px;"
  119. v-model="queryParams.performDate"
  120. @change="pagePerformTimeListFun"
  121. type="date"
  122. value-format="yyyy-MM-dd"
  123. placeholder="选择日期">
  124. </el-date-picker>
  125. </el-form-item> -->
  126. <el-form-item v-if="queryShow.performDate" label="场次时间" label-width="70px">
  127. <el-date-picker
  128. style="width: 250px;"
  129. v-model="queryParams.performDate"
  130. @change="pagePerformTimeListFun"
  131. type="daterange"
  132. value-format="yyyy-MM-dd"
  133. range-separator="至"
  134. start-placeholder="开始日期"
  135. end-placeholder="结束日期">
  136. </el-date-picker>
  137. <span @click="clearQuery('performDate')" class="query_clear"><i class="el-icon-circle-close"></i></span>
  138. </el-form-item>
  139. <el-form-item label="场次" v-if="!multiPerformDate && queryShow.performDate">
  140. <el-select
  141. v-model="queryParams.performTimeId"
  142. placeholder="场次"
  143. clearable
  144. style="width: 100%"
  145. >
  146. <el-option
  147. v-for="dict in pagePerformTimeList"
  148. :key="dict.id"
  149. :label="dict.timeSnapshot+'('+dict.performTimeStart+'-'+dict.performTimeEnd+')'"
  150. :value="dict.id"
  151. />
  152. </el-select>
  153. <span @click="clearQuery('performDate')" class="query_clear"><i class="el-icon-circle-close"></i></span>
  154. </el-form-item>
  155. <el-form-item v-if="queryShow.invoiceTime" label="开票时间">
  156. <el-date-picker
  157. style="width: 230px;"
  158. v-model="queryParams.invoiceTime"
  159. type="daterange"
  160. value-format="yyyy-MM-dd"
  161. range-separator="至"
  162. start-placeholder="开始日期"
  163. end-placeholder="结束日期">
  164. </el-date-picker>
  165. <span @click="clearQuery('invoiceTime')" class="query_clear"><i class="el-icon-circle-close"></i></span>
  166. </el-form-item>
  167. <el-form-item v-if="queryShow.refundPaymentId" label="商户退款单号" label-width="100px">
  168. <el-input
  169. v-model="queryParams.refundPaymentId"
  170. placeholder="请输入商户退款单号"
  171. clearable
  172. style="width: 240px;"
  173. @keyup.enter.native="handleQuery"
  174. />
  175. <span @click="clearQuery('refundPaymentId')" class="query_clear"><i class="el-icon-circle-close"></i></span>
  176. </el-form-item>
  177. <el-form-item>
  178. <el-dropdown @command="openQuery">
  179. <el-button size="mini" type="primary" icon="el-icon-plus"></el-button>
  180. <el-dropdown-menu slot="dropdown">
  181. <el-dropdown-item command="id">订单号</el-dropdown-item>
  182. <el-dropdown-item command="teamName">团队名称</el-dropdown-item>
  183. <el-dropdown-item command="salerPerson">销售员</el-dropdown-item>
  184. <el-dropdown-item command="teamTypeId">团队类型</el-dropdown-item>
  185. <el-dropdown-item command="ifSuccessInvoice">是否成功开票</el-dropdown-item>
  186. <el-dropdown-item command="status">订单状态</el-dropdown-item>
  187. <el-dropdown-item command="payWay">支付方式</el-dropdown-item>
  188. <el-dropdown-item command="time">支付时间</el-dropdown-item>
  189. <el-dropdown-item command="paymentId">支付单号</el-dropdown-item>
  190. <el-dropdown-item command="performDate">场次时间/场次</el-dropdown-item>
  191. <el-dropdown-item command="invoiceTime">开票时间</el-dropdown-item>
  192. <el-dropdown-item command="refundPaymentId">商户退款单号</el-dropdown-item>
  193. </el-dropdown-menu>
  194. </el-dropdown>
  195. <el-button style="margin-left: 10px;" type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  196. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  197. </el-form-item>
  198. </el-form>
  199. </div>
  200. <div class="app-container-table-box">
  201. <el-row :gutter="10" class="mb8">
  202. <el-button
  203. type="primary"
  204. size="mini"
  205. icon="el-icon-download"
  206. v-hasPermi="['groupBuyingMr:groupBuyingMr:excel']"
  207. @click="handleExport"
  208. v-loading.fullscreen.lock="handleExportLoading"
  209. element-loading-text="正在拼命生成数据中..."
  210. element-loading-spinner="el-icon-loading"
  211. element-loading-background="rgba(0, 0, 0, 0.5)"
  212. >导出excel</el-button>
  213. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  214. </el-row>
  215. <div class="app-container-table-info">
  216. <el-table ref="tables" v-loading="loading" height="100%" :data="dataList" border>
  217. <el-table-column label="序号" align="center" :fixed="fixed" type="index" width="60"></el-table-column>
  218. <el-table-column label="订单号" align="center" :fixed="fixed" prop="id" />
  219. <el-table-column label="团队名称" align="center" :fixed="fixed" prop="teamName" />
  220. <el-table-column label="团队类型" align="center" :fixed="fixed" prop="type">
  221. <template slot-scope="scope">
  222. <dict-tag :options="dict.type.team_type" :value="scope.row.teamType"/>
  223. </template>
  224. </el-table-column>
  225. <el-table-column label="联系电话" align="center" prop="teamMobile" />
  226. <el-table-column label="客户负责人" align="center" prop="teamContact" />
  227. <el-table-column label="销售员" align="center" prop="salerPerson" />
  228. <el-table-column label="剧目名称" align="center" prop="performName" />
  229. <el-table-column label="票务名称" align="center" prop="goodsName" />
  230. <el-table-column label="座位类型" align="center" prop="seatTypeName" />
  231. <el-table-column label="场次时间" align="center" prop="performDate" />
  232. <el-table-column label="场次" width="120" align="center" prop="timeSnapshot">
  233. <template slot-scope="scope">
  234. <span>{{ scope.row.timeSnapshot }} <br /> ({{ scope.row.performTimeStart + '-' + scope.row.performTimeEnd }})</span>
  235. </template>
  236. </el-table-column>
  237. <el-table-column label="团购数量" align="center" prop="quantity" />
  238. <!-- <el-table-column label="支付总额" align="center" prop="orderPrice">
  239. <template slot-scope="scope">
  240. <span>¥{{ scope.row.orderPrice }}</span>
  241. </template>
  242. </el-table-column> -->
  243. <el-table-column label="应收金额" align="center" prop="orderPrice">
  244. <template slot-scope="scope">
  245. <span>¥{{ scope.row.orderPrice }}</span>
  246. </template>
  247. </el-table-column>
  248. <el-table-column label="实收金额" align="center" prop="realPrice">
  249. <template slot-scope="scope">
  250. <span>¥{{ scope.row.realPrice }}</span>
  251. </template>
  252. </el-table-column>
  253. <el-table-column label="支付方式" align="center" prop="type">
  254. <template slot-scope="scope">
  255. <dict-tag :options="dict.type.pay_way_type" :value="scope.row.payWay"/>
  256. </template>
  257. </el-table-column>
  258. <el-table-column label="支付时间" align="center" prop="payTime" width="160" >
  259. <template slot-scope="scope">
  260. <span>{{ parseTime(scope.row.payTime) }}</span>
  261. </template>
  262. </el-table-column>
  263. <el-table-column label="支付单号" align="center" prop="paymentId" />
  264. <el-table-column label="订单状态" align="center" prop="status">
  265. <template slot-scope="scope">
  266. <dict-tag :options="dict.type.order_status_type" :value="scope.row.status"/>
  267. </template>
  268. </el-table-column>
  269. <el-table-column label="商户退款单号" align="center" prop="refundPaymentId" />
  270. <el-table-column label="已核销票数" align="center" prop="usedTotal">
  271. <template slot-scope="scope">
  272. <span>{{ scope.row.usedTotal }}</span>
  273. </template>
  274. </el-table-column>
  275. <el-table-column label="已核销金额" align="center" prop="usedPriceTotal">
  276. <template slot-scope="scope">
  277. <span>{{ scope.row.usedPriceTotal }}</span>
  278. </template>
  279. </el-table-column>
  280. <el-table-column label="退票数量" align="center" prop="refundTotal">
  281. <template slot-scope="scope">
  282. <span>{{ scope.row.refundTotal }}</span>
  283. </template>
  284. </el-table-column>
  285. <el-table-column label="退票金额" align="center" prop="refundPriceTotal">
  286. <template slot-scope="scope">
  287. <span>{{ scope.row.refundPriceTotal && scope.row.refundPriceTotal !=0 ?('-' + scope.row.refundPriceTotal) : '' }}</span>
  288. </template>
  289. </el-table-column>
  290. <el-table-column label="是否成功开票" align="center">
  291. <template slot-scope="scope">
  292. <el-tag type="danger" v-if="scope.row.ifSuccessInvoice == '0'">否</el-tag>
  293. <el-tag type="success" v-else-if="scope.row.ifSuccessInvoice == '1'">是</el-tag>
  294. </template>
  295. </el-table-column>
  296. <el-table-column label="开票时间" align="center" prop="invoiceTime">
  297. <template slot-scope="scope">
  298. <span>{{ scope.row.invoiceTime }}</span>
  299. </template>
  300. </el-table-column>
  301. <el-table-column label="是否其他团队代付" align="center" prop="ifRepay">
  302. <template slot-scope="scope">
  303. <el-tag type="danger" v-if="scope.row.ifRepay == '0'">否</el-tag>
  304. <el-tag type="success" v-else-if="scope.row.ifRepay == '1'">是</el-tag>
  305. <span v-else></span>
  306. </template>
  307. </el-table-column>
  308. <el-table-column label="操作" align="center" width="120px" class-name="small-padding fixed-width">
  309. <template slot-scope="scope">
  310. <el-button
  311. size="mini"
  312. type="text"
  313. @click="openDetails(scope.row,'normal')"
  314. v-hasPermi="['groupBuyingMr:groupBuyingMr:details']"
  315. >详情</el-button>
  316. <span v-hasPermi="['groupBuyingMr:groupBuyingMr:details']" style="display: inline-block;">
  317. <el-button
  318. v-if="scope.row.newOrderId"
  319. size="mini"
  320. type="text"
  321. style="margin-left: 10px;"
  322. @click="openDetails(scope.row,'new')"
  323. >新订单</el-button>
  324. </span>
  325. <span v-hasPermi="['groupBuyingMr:groupBuyingMr:details']" style="display: inline-block;">
  326. <el-button
  327. v-if="scope.row.orgOrderId"
  328. size="mini"
  329. type="text"
  330. style="margin-left: 10px;"
  331. @click="openDetails(scope.row,'old')"
  332. >原订单</el-button>
  333. </span>
  334. <el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)">
  335. <el-button size="mini" type="text" icon="el-icon-d-arrow-right">更多</el-button>
  336. <el-dropdown-menu slot="dropdown">
  337. <!-- (scope.row.payWay == 'corporate'||scope.row.status === 0) -->
  338. <el-dropdown-item
  339. command="1"
  340. v-if="hasPermi('groupBuyingMr:groupBuyingMr:duigong') && (scope.row.status === 0)">代客下单</el-dropdown-item>
  341. <el-dropdown-item
  342. command="2"
  343. v-if="hasPermi('groupBuyingMr:groupBuyingMr:cancel') && scope.row.status == 0">关闭订单</el-dropdown-item>
  344. <el-dropdown-item
  345. command="3"
  346. v-if="hasPermi('groupBuyingMr:groupBuyingMr:print') && (scope.row.status == 3 || scope.row.status == 7)">打印小票</el-dropdown-item>
  347. <!-- scope.row.status == 0 -->
  348. <el-dropdown-item
  349. command="4"
  350. v-if="hasPermi('groupBuyingMr:groupBuyingMr:reset') && scope.row.status == 9">修改订单</el-dropdown-item>
  351. <!-- <el-dropdown-item
  352. command="5"
  353. v-if="hasPermi('groupBuyingMr:groupBuyingMr:place')"
  354. >代客下单</el-dropdown-item> -->
  355. <el-dropdown-item
  356. command="6"
  357. v-if="hasPermi('groupBuyingMr:groupBuyingMr:rebook') && scope.row.status == 3 && scope.row.allowReSubmit == 1"
  358. >改签</el-dropdown-item>
  359. <el-dropdown-item
  360. command="7"
  361. v-if="hasPermi('groupBuyingMr:groupBuyingMr:duigongedit') && (scope.row.status == 3 || scope.row.status == 7) && scope.row.payWay== 'corporate'"
  362. >修改凭证</el-dropdown-item>
  363. <el-dropdown-item
  364. command="8"
  365. v-if="scope.row.status == 7"
  366. >开具发票
  367. </el-dropdown-item>
  368. </el-dropdown-menu>
  369. </el-dropdown>
  370. </template>
  371. </el-table-column>
  372. </el-table>
  373. <pagination
  374. v-show="total>0"
  375. :total="total"
  376. :page.sync="queryParams.pageNum"
  377. :limit.sync="queryParams.pageSize"
  378. @pagination="getList"
  379. />
  380. </div>
  381. </div>
  382. <!-- 详情 -->
  383. <details-dia ref="detailsDia" :dict="dict" @getList="getList"></details-dia>
  384. <!-- 重新生成订单 -->
  385. <resetOrder ref="resetOrder" :dict="dict" @getList="getList" />
  386. <!-- 编辑 -->
  387. <editBox ref="editBox" @getList="getList" />
  388. <!-- 修改凭证 -->
  389. <payOrCredit ref="payOrCredit" @getList="getList" />
  390. <!-- 开票详情 -->
  391. <detail-invoice ref="detailInvoice" @goOrderInvoice="goOrderInvoice" @getList="getList"></detail-invoice>
  392. <!-- 申请开票 -->
  393. <aduit-invoice ref="aduitInvoice" @getList="getList"></aduit-invoice>
  394. <el-dialog
  395. title="选择小票机"
  396. :visible.sync="dialogVisible"
  397. width="30%"
  398. :before-close="handleClose">
  399. <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
  400. <el-form-item label="小票机" prop="region">
  401. <el-select v-model="ruleForm.region" placeholder="选择小票机">
  402. <el-option :label="item.deviceName" :key="item.id" :value="item.id" v-for="(item) in printList"></el-option>
  403. </el-select>
  404. </el-form-item>
  405. </el-form>
  406. <span slot="footer" class="dialog-footer">
  407. <el-button @click="dialogVisible = false">取 消</el-button>
  408. <el-button type="primary" :loading="dialogVisibleLoading" @click="print(viewerList)">{{ dialogVisibleLoading?'打印中...':'打印' }}</el-button>
  409. </span>
  410. </el-dialog>
  411. <el-dialog
  412. title="代客下单"
  413. :visible.sync="showCorporatePay"
  414. width="50%"
  415. @close="handleCorporatePayClose"
  416. :before-close="handleCorporatePayClose">
  417. <el-form v-loading="corporatePayLoading" :model="form" :rules="corporatePayRules" ref="ruleForm1" label-width="120px" class="demo-ruleForm pay-type-dialog">
  418. <el-form-item v-if="form.payWay != 3" label="支付团队:" prop="payerId">
  419. <el-select
  420. v-model="form.payerId"
  421. clearable
  422. style="width: 100%"
  423. placeholder="请输入团队名称"
  424. >
  425. <el-option
  426. v-for="item in nameList"
  427. :key="item.id"
  428. :label="item.name"
  429. :value="item.id">
  430. </el-option>
  431. </el-select>
  432. </el-form-item>
  433. <el-form-item v-if="!form.eaitType" label="支付方式" prop="payWay">
  434. <el-radio-group v-model="form.payWay">
  435. <el-radio :label="1">对公转账</el-radio>
  436. <el-radio :label="2">挂账</el-radio>
  437. <el-radio :label="3">链接支付</el-radio>
  438. <el-radio :label="4">授信支付</el-radio>
  439. <el-radio :label="5">储值余额</el-radio>
  440. </el-radio-group>
  441. </el-form-item>
  442. <el-form-item v-if="form.eaitType" label="支付方式" prop="payWay">
  443. <span>{{ getPayWayText(form.payWay) }}</span>
  444. </el-form-item>
  445. <!-- 对公转账和挂账显示原有内容 -->
  446. <template v-if="form.payWay === 1 || form.payWay === 2">
  447. <el-form-item v-if="form.payWay === 2" label="账期" prop="rePaymentTime">
  448. <el-date-picker
  449. v-model="form.rePaymentTime"
  450. type="date"
  451. value-format="yyyy-MM-dd"
  452. placeholder="选择日期">
  453. </el-date-picker>
  454. </el-form-item>
  455. <el-form-item :label="form.payWay === 1 ? '凭证上传' : '挂账类型凭证'" prop="photoList">
  456. <div style="display: flex;flex-wrap: wrap;">
  457. <div
  458. v-for="(item,index) in form.photoList"
  459. :key="index"
  460. style="width: 100px; height: 100px;margin-top: 5px; position: relative;border: 1px solid #999;border-radius: 5px;margin-right: 20px;">
  461. <el-image
  462. style="width: 100%; height: 100%"
  463. :src="item"
  464. :preview-src-list="form.photoList">
  465. </el-image>
  466. <span @click="handleRemove(index)" style="position: absolute;top: -15px;right: -15px;color: red;font-size: 24px;z-index: 999;cursor: pointer;">
  467. <i class="el-icon-error"></i>
  468. </span>
  469. </div>
  470. <div
  471. style="width: 100px; height: 100px;margin-top: 5px;"
  472. v-if="!form.photoList||form.photoList.length<15"
  473. v-loading="actionUrlLoading"
  474. element-loading-text="上传中..."
  475. element-loading-spinner="el-icon-loading"
  476. element-loading-background="rgba(0, 0, 0, 0.8)"
  477. >
  478. <el-upload
  479. class="avatar-uploader"
  480. :action="uploadObj.url"
  481. :headers="uploadObj.headers"
  482. :show-file-list="false"
  483. :before-upload="beforeAvatarUpload"
  484. :on-success="handleAvatarSuccess"
  485. :on-progress="handleAvatarProgress"
  486. :disabled="actionUrlLoading"
  487. :on-error="handleAvatarError"
  488. >
  489. <i class="el-icon-plus avatar-uploader-icon"></i>
  490. </el-upload>
  491. </div>
  492. </div>
  493. </el-form-item>
  494. </template>
  495. <!-- 授信支付显示额度信息 -->
  496. <template v-if="form.payWay === 4 && balanceInfo">
  497. <el-form-item label="剩余授信额度">
  498. <span>¥{{ balanceInfo.grantSurplus }}</span>
  499. </el-form-item>
  500. <el-form-item label="实收金额">
  501. <span>¥{{ currentOrder.realPrice }}</span>
  502. </el-form-item>
  503. </template>
  504. <!-- 储值余额支付显示余额信息 -->
  505. <template v-if="form.payWay === 5 && balanceInfo">
  506. <el-form-item label="剩余储值余额">
  507. <span>¥{{ balanceInfo.balance }}</span>
  508. </el-form-item>
  509. <el-form-item label="实收金额">
  510. <span>¥{{ currentOrder.realPrice }}</span>
  511. </el-form-item>
  512. </template>
  513. <!-- 只有对公转账和挂账显示备注 -->
  514. <el-form-item label="备注" v-if="form.payWay === 1 || form.payWay === 2">
  515. <el-input placeholder="请备注" type="textarea" maxlength="300" show-word-limit v-model="form.corporate.remark"></el-input>
  516. </el-form-item>
  517. </el-form>
  518. <span slot="footer" class="dialog-footer">
  519. <el-button @click="showCorporatePay = false">取 消</el-button>
  520. <el-button type="primary" :loading="corporatePayLoading" @click="corporatePay">{{ dialogVisibleLoading?'操作中...':'确定' }}</el-button>
  521. </span>
  522. </el-dialog>
  523. </div>
  524. </template>
  525. <script>
  526. import { getToken } from "@/utils/auth";
  527. import auth from '@/plugins/auth'
  528. import {
  529. pageList,
  530. gotoCorporatePay,
  531. downOrderListXls,
  532. teamPayOrderUrlApi,
  533. balancePay,
  534. creditPay
  535. } from '@/api/order/groupBuyingMr';
  536. import { getBindTeamList, getSelectById as getBalanceInfo } from '@/api/team/teamMr'
  537. import { orderInfoCancel } from '@/api/windowTicketSales/ticketingSales';
  538. import detailsDia from "./dialog/details.vue";
  539. import detailInvoice from "./dialog/detailInvoice.vue";
  540. import aduitInvoice from "./dialog/aduitInvoice.vue";
  541. import resetOrder from "./dialog/resetOrder.vue";
  542. import payOrCredit from "./dialog/payOrCredit.vue";
  543. import { printApi } from '@/api/order/orderMr'
  544. import { getSelectById } from '@/api/order/groupBuyingMr'
  545. import { pageList as getPrintListApi } from "@/api/device/pda";
  546. import { pagePerformTimeList } from "@/api/schedulingMr/schedulingMr"
  547. import { exportExcel } from '@/utils/exportexcel'
  548. import editBox from './dialog/editBox.vue';
  549. import moment from "moment"
  550. const https = require('https');
  551. const axios = require('axios');
  552. export default {
  553. name: "GroupBuyingMr",
  554. dicts: ['agreement_type', 'team_type','order_status_type','pay_way_type'],
  555. components: {
  556. detailsDia,
  557. resetOrder,
  558. editBox,
  559. payOrCredit,
  560. detailInvoice,
  561. aduitInvoice
  562. },
  563. data() {
  564. return {
  565. qHeight: '0px',
  566. resizeObserver: null,
  567. // 遮罩层
  568. loading: true,
  569. // 选中数组
  570. ids: [],
  571. // 非单个禁用
  572. single: true,
  573. // 非多个禁用
  574. multiple: true,
  575. // 显示搜索条件
  576. showSearch: true,
  577. // 总条数
  578. total: 0,
  579. // 用户表格数据
  580. dataList: null,
  581. // 弹出层标题
  582. title: "",
  583. // 是否显示弹出层
  584. open: false,
  585. // 日期范围
  586. dateRange: [],
  587. // 查询参数
  588. queryParams: {
  589. pageNum: 1,
  590. pageSize: 10,
  591. },
  592. visibleStatus: false,
  593. newObj: {},
  594. visibleType: '',
  595. viewerList: [],
  596. printList: [],
  597. dialogVisible: false,
  598. ruleForm: {},
  599. rules: {
  600. region: [
  601. { required: true, message: '请选择打印机', trigger: ['change','blur' ]}
  602. ],
  603. },
  604. dialogVisibleLoading: false,
  605. showCorporatePay:false,
  606. form:{
  607. payOrCredit: '',
  608. orderId:'',
  609. photoList:[],
  610. corporate:{
  611. voucherUrl:'',
  612. remark:'',
  613. }
  614. },
  615. corporatePayRules: {
  616. payWay: [{ required: true, message: "请选择支付方式", trigger: ["change","blur"] }],
  617. rePaymentTime: [{ required: true, message: "请选择账期", trigger: ["change","blur"] }],
  618. photoList: [{ required: true, message: "请上传凭证", trigger: ["change","blur"] }],
  619. },
  620. uploadObj: {
  621. url: process.env.VUE_APP_UPLOAD_FILE_API + "/upload/single/minio",
  622. Headers: { Authorization: "Bearer " + getToken() },
  623. },
  624. corporatePayLoading:false,
  625. handleExportLoading: false,
  626. pagePerformTimeList: [], // 场次列表
  627. multiPerformDate:false,
  628. fixed: 'left',
  629. actionUrlLoading: false,
  630. queryShow: {
  631. id: true,
  632. teamName: true,
  633. salerPerson: false,
  634. teamTypeId: false,
  635. ifSuccessInvoice: false,
  636. payWay: false,
  637. status: false,
  638. time: false,
  639. paymentId: false,
  640. performDate: true,
  641. invoiceTime: false,
  642. refundPaymentId: false,
  643. },
  644. balanceInfo: null, // 余额信息
  645. currentOrder: null, // 当前操作的订单
  646. nameList: [],
  647. };
  648. },
  649. created() {
  650. this.$set(this.queryParams,'performDate',[moment().format("yyyy-MM-DD"),moment().format("yyyy-MM-DD")])
  651. this.pagePerformTimeListFun(this.queryParams.performDate)
  652. this.getList();
  653. },
  654. activated(){
  655. this.getList();
  656. },
  657. mounted() {
  658. this.resizeObserver = new ResizeObserver(entries => {
  659. for (let entry of entries) {
  660. const { width, height } = entry.contentRect;
  661. this.qHeight = height + 'px'
  662. }
  663. if(document.body.clientWidth<765) {
  664. this.fixed = false
  665. }else {
  666. this.fixed = 'left'
  667. }
  668. });
  669. this.resizeObserver.observe(this.$refs.queryFormBox);
  670. },
  671. methods: {
  672. moment,
  673. hasPermi(value){
  674. return auth.hasPermi(value)
  675. },
  676. //
  677. // handleChange(val) {
  678. // if(val === 3) {
  679. // this.$set(this.form,'payerId','')
  680. // }
  681. // },
  682. // 查询团队列表
  683. getTeamList(id) {
  684. this.nameList = []
  685. getBindTeamList({
  686. teamId: id
  687. })
  688. .then(response => {
  689. this.nameList = response.data.rows;
  690. }).catch(()=>{
  691. this.nameList = []
  692. })
  693. },
  694. /** 查询列表 */
  695. getList(value) {
  696. this.loading = true;
  697. if(value && value.orderId) {
  698. this.$set(this.queryParams,'id',value.orderId)
  699. }
  700. let params = {...this.addDateRange(this.queryParams, this.dateRange)};
  701. if(params.id && params.id.length>19) {
  702. this.$message({
  703. type: 'error',
  704. message: '订单号不存在!!!'
  705. });
  706. this.loading = false
  707. return
  708. }
  709. if(params.performDate&&params.performDate.length==2){
  710. params.performDateStart = params.performDate[0];
  711. params.performDateEnd = params.performDate[1];
  712. }else {
  713. params.performDateStart = null
  714. params.performDateEnd =null
  715. }
  716. delete params.performDate;
  717. pageList(params)
  718. .then(response => {
  719. this.dataList = response.data.rows;
  720. this.total = response.data.total;
  721. this.loading = false;
  722. }).catch(()=>{
  723. this.dataList = [];
  724. this.total = 0;
  725. this.loading = false;
  726. })
  727. },
  728. // 取消按钮
  729. cancel() {
  730. this.open = false;
  731. },
  732. /** 搜索按钮操作 */
  733. handleQuery() {
  734. this.queryParams.pageNum = 1;
  735. if(this.queryParams.time){
  736. this.queryParams.beginTime = this.queryParams.time[0];
  737. this.queryParams.endTime = this.queryParams.time[1];
  738. }else{
  739. this.queryParams.beginTime = null
  740. this.queryParams.endTime = null
  741. }
  742. if(this.queryParams.invoiceTime&&this.queryParams.invoiceTime.length==2){
  743. this.queryParams.invoiceBeginTime =this.queryParams.invoiceTime[0];
  744. this.queryParams.invoiceEndTime =this.queryParams.invoiceTime[1];
  745. }else {
  746. this.queryParams.invoiceBeginTime = null
  747. this.queryParams.invoiceEndTime = null
  748. }
  749. this.getList();
  750. },
  751. /** 重置按钮操作 */
  752. resetQuery() {
  753. this.dateRange = [];
  754. this.$set(this.queryParams, 'paymentId', '');
  755. this.$set(this.queryParams, 'id', '');
  756. this.$set(this.queryParams, 'status', '');
  757. this.$set(this.queryParams, 'teamTypeId', '');
  758. this.$set(this.queryParams, 'teamName', '');
  759. this.$set(this.queryParams, 'performName', '');
  760. this.$set(this.queryParams, 'beginTime', '');
  761. this.$set(this.queryParams, 'endTime', '');
  762. this.$set(this.queryParams, 'time', '');
  763. this.$set(this.queryParams, 'performDate', '');
  764. this.$set(this.queryParams, 'performTimeId', '');
  765. this.$set(this.queryParams, 'payWay', '');
  766. this.$set(this.queryParams, 'invoiceTime', '');
  767. this.$set(this.queryParams, 'salerPerson', '');
  768. this.$set(this.queryParams, 'refundPaymentId', '');
  769. this.queryParams.pageNum = 1;
  770. this.handleQuery();
  771. },
  772. /** 详情按钮操作 */
  773. openDetails(row, type) {
  774. this.$refs["detailsDia"].openDialog("详情", row, type);
  775. },
  776. /** 修改订单按钮操作 */
  777. handleResetOpen(row, type) {
  778. /** 关闭订单 */
  779. this.$confirm("原订单以及原订单中已选择的座位将会被一并取消,确认要修改吗?", '修改订单提示', {
  780. confirmButtonText: '确定',
  781. cancelButtonText: '取消',
  782. type: 'warning'
  783. }).then(() => {
  784. orderInfoCancel({ orderId: row.id}).then((res) => {
  785. if (res.code == 200) {
  786. this.$message({
  787. type: 'success',
  788. message: '操作成功!'
  789. });
  790. this.$refs["resetOrder"].openDialog("重新生成订单", row, type);
  791. }else{
  792. this.$message({
  793. type: 'error',
  794. message: '取消失败!!!'
  795. });
  796. }
  797. });
  798. }).catch(() => {});
  799. //this.$refs["resetOrder"].openDialog("重新生成订单", row, type);
  800. },
  801. handleOpen(list=[]){
  802. if(!list||list.length==0) return
  803. let idList = []
  804. list.forEach((item,index)=>{
  805. idList.push(item.id)
  806. })
  807. this.viewerList = idList
  808. this.getPrintListApi()
  809. this.$set(this.ruleForm, 'region', '');
  810. this.$nextTick(()=>{
  811. this.$refs.ruleForm.clearValidate('region')
  812. })
  813. this.dialogVisible = true
  814. },
  815. handleClose(){
  816. this.dialogVisible = false
  817. },
  818. /** 查询打印机列表 */
  819. getPrintListApi() {
  820. getPrintListApi({deviceType:5,pageNum: 1,
  821. pageSize: 999,})
  822. .then(response => {
  823. this.printList = response.data.rows;
  824. }
  825. );
  826. },
  827. /** 选择打印机 */
  828. selectPrint(){
  829. },
  830. // 打印
  831. async print(list = []){
  832. this.$refs.ruleForm.validate(async (valid) => {
  833. if (valid) {
  834. this.dialogVisibleLoading = true
  835. try {
  836. let res = await printApi({
  837. //viewerList:list,
  838. orderId: list[0],
  839. source: 2,
  840. deviceId: this.ruleForm.region
  841. })
  842. if(res.code == 200) {
  843. let url = res.data.linkIp
  844. let printInfo = res.data.printInfo
  845. this.connectPrint(url,printInfo)
  846. }else {
  847. throw new Error(res)
  848. }
  849. } catch (error) {
  850. this.dialogVisible = false
  851. this.dialogVisibleLoading = false
  852. console.error("error=====",error)
  853. }
  854. } else {
  855. console.log('error submit!!');
  856. return false;
  857. }
  858. });
  859. },
  860. /** 连接打印机 */
  861. connectPrint(url,data){
  862. // let xhr = new XMLHttpRequest();
  863. // xhr.onreadystatechange = ()=>{
  864. // if(xhr.readyState == 4){ // 监听请求完成
  865. // if((xhr.status >=200 && xhr.status <300) || xhr.status == 304){
  866. // console.log(xhr.responseText)
  867. // this.dialogVisible = false
  868. // this.dialogVisibleLoading = false
  869. // }else{
  870. // console.log('请求失败')
  871. // this.dialogVisible = false
  872. // this.dialogVisibleLoading = false
  873. // }
  874. // }
  875. // }
  876. // xhr.open("post", url, true); // 异步请求
  877. // xhr.send(JSON.stringify(data));
  878. const ignoreSSL = axios.create({
  879. httpsAgent: new https.Agent({
  880. rejectUnauthorized: false
  881. }),
  882. withCredentials: true, // 跨域请求时发送Cookie
  883. timeout: 60000, // 请求超时
  884. headers: {
  885. "Content-Type": "application/json; charset=UTF-8;"
  886. }
  887. });
  888. ignoreSSL.post(url,
  889. { ...data }
  890. ).then(()=>{
  891. this.dialogVisible = false
  892. this.dialogVisibleLoading = false
  893. }).catch(()=>{
  894. this.dialogVisible = false
  895. this.dialogVisibleLoading = false
  896. })
  897. },
  898. async handleCorporatePay(row) {
  899. this.actionUrlLoading = false
  900. this.showCorporatePay = true
  901. this.corporatePayLoading = true
  902. this.currentOrder = row
  903. let res = await getSelectById(row.id)
  904. this.getTeamList(row.id);
  905. this.form.orderId = row.id
  906. this.$set(this.form,'photoList',[])
  907. this.form.eaitType = null
  908. // 获取余额信息
  909. try {
  910. const balanceRes = await getBalanceInfo(row.memberId)
  911. if(balanceRes.code === 200) {
  912. this.balanceInfo = balanceRes.data
  913. }
  914. } catch(err) {
  915. console.error('获取余额信息失败', err)
  916. }
  917. this.getTeamList(res.data.teamId);
  918. this.$set(this.form,'payerId',res.data.teamId)
  919. if(res.data.corporate && JSON.stringify(res.data.corporate) != '{}'){
  920. let urlList = res.data.corporate.voucherUrl.split(',')||[]
  921. this.form.eaitType = 1
  922. this.$set(this.form,'payWay',1)
  923. // this.$set(this.form,'payerId',res.data.corporate.payerId)
  924. this.$set(this.form,'rePaymentTime','')
  925. this.$set(this.form,'photoList',urlList)
  926. this.$set(this.form.corporate,'remark',res.data.corporate.remark)
  927. }else if(res.data.teamCredit && JSON.stringify(res.data.teamCredit) != '{}'){
  928. this.form.eaitType = 2
  929. let urlList = res.data.teamCredit.voucherUrl.split(',')||[]
  930. this.$set(this.form,'payWay',2)
  931. // this.$set(this.form,'payerId',res.data.corporate.payerId)
  932. this.$set(this.form,'rePaymentTime',res.data.teamCredit.repaymentTime)
  933. this.$set(this.form,'photoList',urlList)
  934. this.$set(this.form.corporate,'remark',res.data.teamCredit.remark)
  935. }else {
  936. // 移除eaitType的设置,只设置默认支付方式
  937. this.$set(this.form,'payWay',1)
  938. this.$set(this.form,'rePaymentTime','')
  939. this.$set(this.form,'photoList',[])
  940. this.$set(this.form.corporate,'remark','')
  941. // this.$set(this.form,'payerId','')
  942. }
  943. this.$nextTick(()=>{
  944. this.$refs.ruleForm1.clearValidate()
  945. })
  946. this.corporatePayLoading = false
  947. },
  948. handleCorporatePayClose(){
  949. this.$set(this.form,'photoList',[])
  950. this.corporatePayLoading = false;
  951. this.showCorporatePay = false;
  952. },
  953. async corporatePay() {
  954. this.$refs['ruleForm1'].validate(async (valid) => {
  955. if (valid) {
  956. if(this.form.payWay === 1 || this.form.payWay === 2) {
  957. if(this.form.photoList.length<1){
  958. this.$message.error('请上传凭证')
  959. return
  960. }
  961. }
  962. this.corporatePayLoading = true
  963. try {
  964. let res = null
  965. // 对公转账和挂账
  966. if(this.form.payWay === 1 || this.form.payWay === 2) {
  967. const voucherUrl = this.form.photoList.map(item => item).join(",")
  968. const params = {
  969. orderId: this.form.orderId,
  970. payWay: this.form.payWay,
  971. payOrCredit: this.form.payWay,
  972. corporate: {
  973. voucherUrl,
  974. remark: this.form.corporate.remark
  975. }
  976. }
  977. if(this.form.payWay === 2) {
  978. params.rePaymentTime = this.form.rePaymentTime
  979. }
  980. res = await gotoCorporatePay(params)
  981. }
  982. // 链接支付
  983. if(this.form.payWay === 3) {
  984. this.handPlaceAnOrder(this.currentOrder)
  985. this.handleCorporatePayClose()
  986. return
  987. }
  988. // 授信支付
  989. if(this.form.payWay === 4) {
  990. if(this.balanceInfo.grantSurplus < this.currentOrder.orderPrice) {
  991. this.$message.error('授信额度不足')
  992. return
  993. }
  994. console.log('this.form',this.form);
  995. res = await creditPay({
  996. orderId: this.form.orderId
  997. })
  998. }
  999. // 储值余额支付
  1000. if(this.form.payWay === 5) {
  1001. if(this.balanceInfo.balance < this.currentOrder.orderPrice) {
  1002. this.$message.error('储值余额不足')
  1003. return
  1004. }
  1005. res = await balancePay({
  1006. orderId: this.form.orderId
  1007. })
  1008. }
  1009. if(res) {
  1010. this.$message.success(res.msg)
  1011. this.corporatePayLoading = false
  1012. this.handleCorporatePayClose()
  1013. this.getList()
  1014. }
  1015. } catch(err) {
  1016. this.corporatePayLoading = false
  1017. this.$message.error(err.msg || '操作失败')
  1018. }
  1019. }
  1020. })
  1021. },
  1022. /**
  1023. * 剧目海报上传成功
  1024. * @date 2023-11-22
  1025. * @param {any} res
  1026. * @returns {any}
  1027. */
  1028. handlePhotoListSuccess(res) {
  1029. if (res.code === 200) {
  1030. let photo = {
  1031. imageUrl: res?.data?.url,
  1032. url: res?.data?.url,
  1033. photoType: '2'
  1034. }
  1035. if(!this.form.photoList){
  1036. this.form.photoList = []
  1037. }
  1038. // this.form.photoList.push(photo);
  1039. this.$set(this.form.photoList, this.form.photoList.length, photo);
  1040. }
  1041. },
  1042. // handleRemove(file, fileList) {
  1043. // this.form.photoList.forEach((item, index) => {
  1044. // if(item.uid == file.uid){
  1045. // this.form.photoList.splice(index, 1)
  1046. // }
  1047. // })
  1048. // },
  1049. /**
  1050. * 上传文件之前之前
  1051. * @date 2023-11-22
  1052. * @param {any} file
  1053. * @returns {any}
  1054. */
  1055. // beforeAvatarUpload(file) {
  1056. // const isJPG = file.type === "image/jpeg" || "image/png";
  1057. // if (!isJPG) {
  1058. // this.$message.error("上传头像图片只能是jpg或png格式!");
  1059. // }
  1060. // return isJPG;
  1061. // },
  1062. /**
  1063. * 导出报表
  1064. * @date 2022-10-24
  1065. * @returns {any}
  1066. */
  1067. handleExport() {
  1068. this.$confirm('您确定要导出当前查询的数据吗?', '提示', {
  1069. confirmButtonText: '确定 ',
  1070. cancelButtonText: '取消 ',
  1071. type: 'warning'
  1072. })
  1073. .then(() => {
  1074. this.handleExportLoading = true;
  1075. // const { pageNum, pageSize} = this.params;
  1076. let postMap = {}
  1077. if(this.queryParams.time){
  1078. this.queryParams.beginTime = this.queryParams.time[0];
  1079. this.queryParams.endTime = this.queryParams.time[1];
  1080. }else{
  1081. this.queryParams.beginTime = null
  1082. this.queryParams.endTime = null
  1083. }
  1084. if(this.queryParams.performDate&&this.queryParams.performDate.length==2){
  1085. this.queryParams.performDateStart = this.queryParams.performDate[0];
  1086. this.queryParams.performDateEnd = this.queryParams.performDate[1];
  1087. }else {
  1088. this.queryParams.performDateStart = null
  1089. this.queryParams.performDateEnd =null
  1090. }
  1091. if(this.queryParams.invoiceTime&&this.queryParams.invoiceTime.length==2){
  1092. this.queryParams.invoiceBeginTime =this.queryParams.invoiceTime[0];
  1093. this.queryParams.invoiceEndTime =this.queryParams.invoiceTime[1];
  1094. }else {
  1095. this.queryParams.invoiceBeginTime = null
  1096. this.queryParams.invoiceEndTime = null
  1097. }
  1098. let params = JSON.parse(JSON.stringify(this.queryParams))
  1099. for (let key in params) {
  1100. if(key != 'pageNum' && key != 'pageSize' && key != 'time' && key != 'performDate' && key != 'invoiceTime'){
  1101. postMap[key] = params[key]
  1102. }
  1103. }
  1104. downOrderListXls(postMap)
  1105. .then((res) => {
  1106. exportExcel(res, '团购订单', '.xlsx');
  1107. this.handleExportLoading = false;
  1108. })
  1109. .catch((error) => {
  1110. console.log("error===",error)
  1111. this.handleExportLoading = false;
  1112. });
  1113. })
  1114. .catch(() => {
  1115. this.$message.info('您已取消导出!');
  1116. });
  1117. },
  1118. async pagePerformTimeListFun(value) {
  1119. try {
  1120. this.pagePerformTimeList = []
  1121. this.$set(this.queryParams,'performTimeId',null)
  1122. if(!value){
  1123. return
  1124. }
  1125. if(value.length==2&&value[0]==value[1]){
  1126. this.multiPerformDate = false
  1127. }else{
  1128. this.multiPerformDate = true
  1129. return
  1130. }
  1131. let { data,code } = await pagePerformTimeList({
  1132. performDate: value[0],
  1133. pageNum: 1,
  1134. pageSize: 999
  1135. })
  1136. this.pagePerformTimeList = [].concat(data.rows)
  1137. } catch (error) {
  1138. }
  1139. },
  1140. /** 关闭订单 */
  1141. handleCancelOrder(row) {
  1142. this.$confirm("是否关闭" + row.id + "的订单?", '提示', {
  1143. confirmButtonText: '确定',
  1144. cancelButtonText: '取消',
  1145. type: 'warning'
  1146. }).then(() => {
  1147. orderInfoCancel({ orderId: row.id}).then((res) => {
  1148. if (res.code == 200) {
  1149. this.$message({
  1150. type: 'success',
  1151. message: '操作成功!'
  1152. });
  1153. this.getList();
  1154. }
  1155. });
  1156. }).catch(() => {});
  1157. },
  1158. /** 上传图片 单张 */
  1159. handleAvatarSuccess(response, file, fileList) {
  1160. console.log("res, file",response, file, fileList)
  1161. this.actionUrlLoading = false
  1162. if(response.code == 200) {
  1163. this.form.photoList.push(response.data.url)
  1164. }
  1165. this.$refs.ruleForm1.validateField('photoList')
  1166. },
  1167. beforeAvatarUpload(file) {
  1168. const isLt2M = file.size / 1024 / 1024 <= 100;
  1169. let testmsg = file.name.substring(file.name.lastIndexOf('.')+1)
  1170. let typeList = ['png','jepg','jpg','gif']
  1171. const isJPG = typeList.includes(testmsg);
  1172. if (!isJPG) {
  1173. this.$message.error(`上传图片图片只能是 ${typeList} 格式!`);
  1174. }
  1175. if (!isLt2M) {
  1176. this.$message.error('上传图片图片大小不能超过 100MB!');
  1177. }
  1178. return isJPG && isLt2M;
  1179. },
  1180. handleAvatarProgress(){
  1181. this.actionUrlLoading = true
  1182. },
  1183. handleAvatarError() {
  1184. this.actionUrlLoading = false
  1185. },
  1186. handleRemove(index) {
  1187. this.form.photoList.splice(index,1)
  1188. this.$refs.ruleForm1.validateField('photoList')
  1189. },
  1190. /** 代课下单 */
  1191. handPlaceAnOrder(row) {
  1192. /** 关闭订单 */
  1193. this.$confirm("确认要生成该订单的支付链接吗?温馨提示:请勿随意将链接发送给陌生人", '提示', {
  1194. confirmButtonText: '生成并复制链接',
  1195. cancelButtonText: '取消',
  1196. type: 'warning'
  1197. }).then(() => {
  1198. teamPayOrderUrlApi({ orderId: row.id }).then((res) => {
  1199. if (res.code == 200) {
  1200. this.$message({
  1201. type: 'success',
  1202. message: res.msg
  1203. });
  1204. this.copyToClipboard(res.data.url)
  1205. }
  1206. });
  1207. }).catch(() => { }).finally(() => {
  1208. });
  1209. },
  1210. /** 复制内容 */
  1211. copyToClipboard(text) {
  1212. // 创建一个临时的textarea元素
  1213. const tempInput = document.createElement('textarea');
  1214. tempInput.value = text;
  1215. document.body.appendChild(tempInput);
  1216. tempInput.select();
  1217. document.execCommand('copy');
  1218. document.body.removeChild(tempInput);
  1219. },
  1220. // 更多操作触发
  1221. handleCommand(command, row) {
  1222. switch (command) {
  1223. case "1":
  1224. this.handleCorporatePay(row);
  1225. break;
  1226. case "2":
  1227. this.handleCancelOrder(row);
  1228. break;
  1229. case "3":
  1230. this.handleOpen(row);
  1231. break;
  1232. case "4":
  1233. this.handleEditOpen(row);
  1234. break;
  1235. case "5":
  1236. this.handPlaceAnOrder(row);
  1237. break;
  1238. case "6":
  1239. this.handGoRebook(row);
  1240. break;
  1241. case "7":
  1242. this.handPayOrCredit(row);
  1243. break;
  1244. case "8":
  1245. this.handleOrderInvoice(row);
  1246. break;
  1247. default:
  1248. break;
  1249. }
  1250. },
  1251. // 开具发票
  1252. handleOrderInvoice(row) {
  1253. console.log(row,'row1111');
  1254. if(row.ifInvoice === 1 ) {
  1255. // 已开票
  1256. this.$refs["detailInvoice"].openDialog("开票详情", row);
  1257. } else {
  1258. this.$refs["aduitInvoice"].openDialog("申请开票", row);
  1259. }
  1260. },
  1261. // 重新开票
  1262. goOrderInvoice(row) {
  1263. this.$refs["aduitInvoice"].openDialog("申请开票", row, 'next');
  1264. },
  1265. /** 修改凭证 */
  1266. handPayOrCredit(row){
  1267. this.$refs["payOrCredit"].openDialog("修改凭证", row, 'normal');
  1268. },
  1269. /** 打开修改订单 */
  1270. handleEditOpen(row) {
  1271. this.$refs["editBox"].openDialog("详情", row, 'normal');
  1272. },
  1273. handGoRebook(row) {
  1274. this.$router.push({path:'/windowTicketSales/rebook',query: { id: row.id }})
  1275. },
  1276. clearQuery(key) {
  1277. this.$set(this.queryShow,key,false)
  1278. this.$set(this.queryParams,key,'')
  1279. if(key == 'performDate') {
  1280. this.$set(this.queryParams,'performTimeId','')
  1281. }
  1282. },
  1283. openQuery(key) {
  1284. this.$set(this.queryShow,key,true)
  1285. },
  1286. getPayWayText(payWay) {
  1287. const payWayMap = {
  1288. 1: '对公转账',
  1289. 2: '挂账',
  1290. 3: '链接支付',
  1291. 4: '授信支付',
  1292. 5: '储值余额'
  1293. }
  1294. return payWayMap[payWay] || ''
  1295. },
  1296. },
  1297. beforeDestroy() {
  1298. this.resizeObserver.unobserve(this.$refs.queryFormBox);
  1299. this.resizeObserver.disconnect();
  1300. },
  1301. };
  1302. </script>
  1303. <style lang="scss" scoped>
  1304. .upload-btn {
  1305. width: 100px;
  1306. height: 100px;
  1307. background-color: #fbfdff;
  1308. border: dashed 1px #c0ccda;
  1309. border-radius: 5px;
  1310. i {
  1311. font-size: 30px;
  1312. margin-top: 20px;
  1313. }
  1314. &-text {
  1315. margin-top: -10px;
  1316. }
  1317. }
  1318. .avatar {
  1319. cursor: pointer;
  1320. }
  1321. .app-container {
  1322. height: calc( 100vh - 110px );
  1323. box-sizing: border-box;
  1324. }
  1325. .app-container-query {
  1326. }
  1327. .app-container-table-box {
  1328. height: calc( 100% - var(--q-height) );
  1329. .app-container-table-info {
  1330. height: calc( 100% - 100px );
  1331. }
  1332. }
  1333. .upload-box {
  1334. ::v-deep .el-upload--picture-card {
  1335. display: none;
  1336. }
  1337. }
  1338. ::v-deep .avatar-uploader .el-upload {
  1339. border: 1px dashed #d9d9d9;
  1340. border-radius: 6px;
  1341. cursor: pointer;
  1342. position: relative;
  1343. overflow: hidden;
  1344. }
  1345. ::v-deep .avatar-uploader .el-upload:hover {
  1346. border-color: #409EFF;
  1347. }
  1348. ::v-deep .avatar-uploader-icon {
  1349. font-size: 28px;
  1350. color: #8c939d;
  1351. width: 100px;
  1352. height: 100px;
  1353. line-height: 100px;
  1354. text-align: center;
  1355. }
  1356. ::v-deep .avatar {
  1357. width: 100px;
  1358. height: 100px;
  1359. display: block;
  1360. }
  1361. .app-container-scheduling ::v-deep .el-select__tags {
  1362. flex-wrap: inherit !important;
  1363. overflow-x: auto !important;
  1364. }
  1365. .app-container-scheduling ::v-deep .el-form-item__content {
  1366. position: relative;
  1367. }
  1368. .app-container-scheduling ::v-deep .el-form-item__content .query_clear{
  1369. position: absolute;
  1370. top: -15px;
  1371. right: -10px;
  1372. display: none;
  1373. cursor: pointer;
  1374. z-index: 99;
  1375. }
  1376. .app-container-scheduling ::v-deep .el-form-item__content:hover .query_clear {
  1377. display: block;
  1378. }
  1379. .pay-type-dialog{
  1380. ::v-deep .el-dialog__header {
  1381. border-bottom: 1px solid #EBEEF5;
  1382. }
  1383. // 代客下单对话框样式优化
  1384. ::v-deep .el-dialog__body {
  1385. padding: 20px 30px;
  1386. }
  1387. ::v-deep .el-form-item {
  1388. margin-bottom: 22px;
  1389. }
  1390. ::v-deep .el-radio-group {
  1391. display: flex;
  1392. flex-wrap: wrap;
  1393. gap: 15px;
  1394. }
  1395. ::v-deep .el-radio {
  1396. margin-right: 0;
  1397. padding: 8px 15px;
  1398. border: 1px solid #DCDFE6;
  1399. border-radius: 4px;
  1400. transition: all 0.3s;
  1401. &:hover {
  1402. border-color: #409EFF;
  1403. color: #409EFF;
  1404. }
  1405. &.is-checked {
  1406. border-color: #409EFF;
  1407. background-color: #ecf5ff;
  1408. }
  1409. }
  1410. ::v-deep .el-date-picker {
  1411. width: 100%;
  1412. }
  1413. ::v-deep .el-textarea__inner {
  1414. min-height: 80px;
  1415. resize: vertical;
  1416. }
  1417. ::v-deep .el-form-item__label {
  1418. font-weight: 500;
  1419. color: #606266;
  1420. }
  1421. ::v-deep .el-dialog__footer {
  1422. padding: 15px 30px;
  1423. border-top: 1px solid #EBEEF5;
  1424. }
  1425. ::v-deep .el-dialog__title {
  1426. font-size: 18px;
  1427. font-weight: 500;
  1428. }
  1429. ::v-deep .el-dialog__header {
  1430. padding: 20px 30px;
  1431. border-bottom: 1px solid #EBEEF5;
  1432. }
  1433. // 上传图片区域样式优化
  1434. ::v-deep .el-upload-list {
  1435. display: flex;
  1436. flex-wrap: wrap;
  1437. gap: 10px;
  1438. margin-top: 10px;
  1439. }
  1440. ::v-deep .el-upload-list__item {
  1441. width: 100px;
  1442. height: 100px;
  1443. border-radius: 4px;
  1444. overflow: hidden;
  1445. &:hover {
  1446. .el-upload-list__item-actions {
  1447. opacity: 1;
  1448. }
  1449. }
  1450. }
  1451. ::v-deep .el-upload-list__item-actions {
  1452. opacity: 0;
  1453. transition: opacity 0.3s;
  1454. background: rgba(0, 0, 0, 0.5);
  1455. }
  1456. // 支付方式选择区域样式
  1457. ::v-deep .el-form-item__content {
  1458. .el-radio-group {
  1459. .el-radio {
  1460. margin-bottom: 10px;
  1461. }
  1462. }
  1463. }
  1464. // 余额信息显示样式
  1465. ::v-deep .el-form-item__content {
  1466. span {
  1467. font-size: 16px;
  1468. color: #303133;
  1469. font-weight: 500;
  1470. }
  1471. }
  1472. }
  1473. </style>