index.vue 43 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186
  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.time" label="支付时间">
  80. <el-date-picker
  81. v-model="queryParams.time"
  82. type="daterange"
  83. value-format="yyyy-MM-dd"
  84. range-separator="至"
  85. start-placeholder="开始日期"
  86. end-placeholder="结束日期">
  87. </el-date-picker>
  88. <span @click="clearQuery('time')" class="query_clear"><i class="el-icon-circle-close"></i></span>
  89. </el-form-item>
  90. <el-form-item v-if="queryShow.paymentId" label="支付单号">
  91. <el-input
  92. v-model="queryParams.paymentId"
  93. placeholder="请输入支付单号"
  94. clearable
  95. style="width: 240px;"
  96. @keyup.enter.native="handleQuery"
  97. />
  98. <span @click="clearQuery('paymentId')" class="query_clear"><i class="el-icon-circle-close"></i></span>
  99. </el-form-item>
  100. <!-- <el-form-item label="场次时间">
  101. <el-date-picker
  102. style="width: 230px;"
  103. v-model="queryParams.performDate"
  104. @change="pagePerformTimeListFun"
  105. type="date"
  106. value-format="yyyy-MM-dd"
  107. placeholder="选择日期">
  108. </el-date-picker>
  109. </el-form-item> -->
  110. <el-form-item v-if="queryShow.performDate" label="场次时间" label-width="70px">
  111. <el-date-picker
  112. style="width: 250px;"
  113. v-model="queryParams.performDate"
  114. @change="pagePerformTimeListFun"
  115. type="daterange"
  116. value-format="yyyy-MM-dd"
  117. range-separator="至"
  118. start-placeholder="开始日期"
  119. end-placeholder="结束日期">
  120. </el-date-picker>
  121. <span @click="clearQuery('performDate')" class="query_clear"><i class="el-icon-circle-close"></i></span>
  122. </el-form-item>
  123. <el-form-item label="场次" v-if="!multiPerformDate && queryShow.performDate">
  124. <el-select
  125. v-model="queryParams.performTimeId"
  126. placeholder="场次"
  127. clearable
  128. style="width: 100%"
  129. >
  130. <el-option
  131. v-for="dict in pagePerformTimeList"
  132. :key="dict.id"
  133. :label="dict.timeSnapshot+'('+dict.performTimeStart+'-'+dict.performTimeEnd+')'"
  134. :value="dict.id"
  135. />
  136. </el-select>
  137. <span @click="clearQuery('performDate')" class="query_clear"><i class="el-icon-circle-close"></i></span>
  138. </el-form-item>
  139. <el-form-item v-if="queryShow.invoiceTime" label="开票时间">
  140. <el-date-picker
  141. style="width: 230px;"
  142. v-model="queryParams.invoiceTime"
  143. type="daterange"
  144. value-format="yyyy-MM-dd"
  145. range-separator="至"
  146. start-placeholder="开始日期"
  147. end-placeholder="结束日期">
  148. </el-date-picker>
  149. <span @click="clearQuery('invoiceTime')" class="query_clear"><i class="el-icon-circle-close"></i></span>
  150. </el-form-item>
  151. <el-form-item v-if="queryShow.refundPaymentId" label="商户退款单号" label-width="100px">
  152. <el-input
  153. v-model="queryParams.refundPaymentId"
  154. placeholder="请输入商户退款单号"
  155. clearable
  156. style="width: 240px;"
  157. @keyup.enter.native="handleQuery"
  158. />
  159. <span @click="clearQuery('refundPaymentId')" class="query_clear"><i class="el-icon-circle-close"></i></span>
  160. </el-form-item>
  161. <el-form-item>
  162. <el-dropdown @command="openQuery">
  163. <el-button size="mini" type="primary" icon="el-icon-plus"></el-button>
  164. <el-dropdown-menu slot="dropdown">
  165. <el-dropdown-item command="id">订单号</el-dropdown-item>
  166. <el-dropdown-item command="teamName">团队名称</el-dropdown-item>
  167. <el-dropdown-item command="salerPerson">销售员</el-dropdown-item>
  168. <el-dropdown-item command="teamTypeId">团队类型</el-dropdown-item>
  169. <el-dropdown-item command="ifSuccessInvoice">是否成功开票</el-dropdown-item>
  170. <el-dropdown-item command="status">订单状态</el-dropdown-item>
  171. <el-dropdown-item command="time">支付时间</el-dropdown-item>
  172. <el-dropdown-item command="paymentId">支付单号</el-dropdown-item>
  173. <el-dropdown-item command="performDate">场次时间/场次</el-dropdown-item>
  174. <el-dropdown-item command="invoiceTime">开票时间</el-dropdown-item>
  175. <el-dropdown-item command="refundPaymentId">商户退款单号</el-dropdown-item>
  176. </el-dropdown-menu>
  177. </el-dropdown>
  178. <el-button style="margin-left: 10px;" type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  179. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  180. </el-form-item>
  181. </el-form>
  182. </div>
  183. <div class="app-container-table-box">
  184. <el-row :gutter="10" class="mb8">
  185. <el-button
  186. type="primary"
  187. size="mini"
  188. icon="el-icon-download"
  189. v-hasPermi="['groupBuyingMr:groupBuyingMr:excel']"
  190. @click="handleExport"
  191. v-loading.fullscreen.lock="handleExportLoading"
  192. element-loading-text="正在拼命生成数据中..."
  193. element-loading-spinner="el-icon-loading"
  194. element-loading-background="rgba(0, 0, 0, 0.5)"
  195. >导出excel</el-button>
  196. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  197. </el-row>
  198. <div class="app-container-table-info">
  199. <el-table ref="tables" v-loading="loading" height="100%" :data="dataList" border>
  200. <el-table-column label="序号" align="center" :fixed="fixed" type="index" width="60"></el-table-column>
  201. <el-table-column label="订单号" align="center" :fixed="fixed" prop="id" />
  202. <el-table-column label="团队名称" align="center" :fixed="fixed" prop="teamName" />
  203. <el-table-column label="团队类型" align="center" :fixed="fixed" prop="type">
  204. <template slot-scope="scope">
  205. <dict-tag :options="dict.type.team_type" :value="scope.row.teamType"/>
  206. </template>
  207. </el-table-column>
  208. <el-table-column label="联系电话" align="center" prop="teamMobile" />
  209. <el-table-column label="客户负责人" align="center" prop="teamContact" />
  210. <el-table-column label="销售员" align="center" prop="salerPerson" />
  211. <el-table-column label="剧目名称" align="center" prop="performName" />
  212. <el-table-column label="票务名称" align="center" prop="goodsName" />
  213. <el-table-column label="座位类型" align="center" prop="seatTypeName" />
  214. <el-table-column label="场次时间" align="center" prop="performDate" />
  215. <el-table-column label="场次" width="120" align="center" prop="timeSnapshot">
  216. <template slot-scope="scope">
  217. <span>{{ scope.row.timeSnapshot }} <br /> ({{ scope.row.performTimeStart + '-' + scope.row.performTimeEnd }})</span>
  218. </template>
  219. </el-table-column>
  220. <el-table-column label="团购数量" align="center" prop="quantity" />
  221. <!-- <el-table-column label="支付总额" align="center" prop="orderPrice">
  222. <template slot-scope="scope">
  223. <span>¥{{ scope.row.orderPrice }}</span>
  224. </template>
  225. </el-table-column> -->
  226. <el-table-column label="应收金额" align="center" prop="orderPrice">
  227. <template slot-scope="scope">
  228. <span>¥{{ scope.row.orderPrice }}</span>
  229. </template>
  230. </el-table-column>
  231. <el-table-column label="实收金额" align="center" prop="realPrice">
  232. <template slot-scope="scope">
  233. <span>¥{{ scope.row.realPrice }}</span>
  234. </template>
  235. </el-table-column>
  236. <el-table-column label="支付方式" align="center" prop="type">
  237. <template slot-scope="scope">
  238. <dict-tag :options="dict.type.pay_way_type" :value="scope.row.payWay"/>
  239. </template>
  240. </el-table-column>
  241. <el-table-column label="支付时间" align="center" prop="payTime" width="160" >
  242. <template slot-scope="scope">
  243. <span>{{ parseTime(scope.row.payTime) }}</span>
  244. </template>
  245. </el-table-column>
  246. <el-table-column label="支付单号" align="center" prop="paymentId" />
  247. <el-table-column label="订单状态" align="center" prop="status">
  248. <template slot-scope="scope">
  249. <dict-tag :options="dict.type.order_status_type" :value="scope.row.status"/>
  250. </template>
  251. </el-table-column>
  252. <el-table-column label="商户退款单号" align="center" prop="refundPaymentId" />
  253. <el-table-column label="已核销票数" align="center" prop="usedTotal">
  254. <template slot-scope="scope">
  255. <span>{{ scope.row.usedTotal }}</span>
  256. </template>
  257. </el-table-column>
  258. <el-table-column label="已核销金额" align="center" prop="usedPriceTotal">
  259. <template slot-scope="scope">
  260. <span>{{ scope.row.usedPriceTotal }}</span>
  261. </template>
  262. </el-table-column>
  263. <el-table-column label="退票数量" align="center" prop="refundTotal">
  264. <template slot-scope="scope">
  265. <span>{{ scope.row.refundTotal }}</span>
  266. </template>
  267. </el-table-column>
  268. <el-table-column label="退票金额" align="center" prop="refundPriceTotal">
  269. <template slot-scope="scope">
  270. <span>{{ scope.row.refundPriceTotal && scope.row.refundPriceTotal !=0 ?('-' + scope.row.refundPriceTotal) : '' }}</span>
  271. </template>
  272. </el-table-column>
  273. <el-table-column label="是否成功开票" align="center">
  274. <template slot-scope="scope">
  275. <el-tag type="danger" v-if="scope.row.ifSuccessInvoice == '0'">否</el-tag>
  276. <el-tag type="success" v-else-if="scope.row.ifSuccessInvoice == '1'">是</el-tag>
  277. </template>
  278. </el-table-column>
  279. <el-table-column label="开票时间" align="center" prop="invoiceTime">
  280. <template slot-scope="scope">
  281. <span>{{ scope.row.invoiceTime }}</span>
  282. </template>
  283. </el-table-column>
  284. <el-table-column label="操作" align="center" width="100" class-name="small-padding fixed-width">
  285. <template slot-scope="scope">
  286. <el-button
  287. size="mini"
  288. type="text"
  289. @click="openDetails(scope.row)"
  290. v-hasPermi="['groupBuyingMr:groupBuyingMr:details']"
  291. >详情</el-button>
  292. <el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)">
  293. <el-button size="mini" type="text" icon="el-icon-d-arrow-right">更多</el-button>
  294. <el-dropdown-menu slot="dropdown">
  295. <el-dropdown-item
  296. command="1"
  297. v-if="hasPermi('groupBuyingMr:groupBuyingMr:details') && (scope.row.payWay == 'corporate'||scope.row.status === 0)">对公转账</el-dropdown-item>
  298. <el-dropdown-item
  299. command="2"
  300. v-if="hasPermi('groupBuyingMr:groupBuyingMr:cancel') && scope.row.status == 0">关闭订单</el-dropdown-item>
  301. <el-dropdown-item
  302. command="3"
  303. v-if="hasPermi('groupBuyingMr:groupBuyingMr:print') && (scope.row.status == 3 || scope.row.status == 7)">打印小票</el-dropdown-item>
  304. <el-dropdown-item
  305. command="4"
  306. v-if="hasPermi('groupBuyingMr:groupBuyingMr:reset') && scope.row.status == 0">修改订单</el-dropdown-item>
  307. </el-dropdown-menu>
  308. </el-dropdown>
  309. <!-- <span v-hasPermi="['groupBuyingMr:groupBuyingMr:details']" style="display: inline-block;">
  310. <el-button
  311. v-if="scope.row.payWay == 'corporate'||scope.row.status === 0"
  312. size="mini"
  313. type="text"
  314. style="margin-left: 10px;"
  315. @click="handleCorporatePay(scope.row)"
  316. >对公转账</el-button>
  317. </span>
  318. <span v-hasPermi="['groupBuyingMr:groupBuyingMr:cancel']" style="display: inline-block;">
  319. <el-button
  320. v-if="scope.row.status == 0"
  321. size="mini"
  322. type="text"
  323. style="margin-left: 10px;"
  324. @click="handleCancelOrder(scope.row)"
  325. >关闭订单</el-button>
  326. </span>
  327. <span v-hasPermi="['groupBuyingMr:groupBuyingMr:print']" style="display: inline-block;">
  328. <el-button
  329. v-if="scope.row.status == 3 || scope.row.status == 7"
  330. size="mini"
  331. type="text"
  332. style="margin-left: 10px;"
  333. @click="handleOpen([scope.row])"
  334. >打印小票</el-button>
  335. </span>
  336. <span v-hasPermi="['groupBuyingMr:groupBuyingMr:reset']" style="display: inline-block;">
  337. <el-button
  338. v-if="scope.row.status == 0"
  339. size="mini"
  340. type="text"
  341. style="margin-left: 10px;"
  342. @click="handleResetOpen(scope.row)"
  343. >修改订单</el-button>
  344. </span> -->
  345. </template>
  346. </el-table-column>
  347. </el-table>
  348. <pagination
  349. v-show="total>0"
  350. :total="total"
  351. :page.sync="queryParams.pageNum"
  352. :limit.sync="queryParams.pageSize"
  353. @pagination="getList"
  354. />
  355. </div>
  356. </div>
  357. <!-- 详情 -->
  358. <details-dia ref="detailsDia" :dict="dict" @getList="getList"></details-dia>
  359. <!-- 重新生成订单 -->
  360. <resetOrder ref="resetOrder" :dict="dict" @getList="getList" />
  361. <el-dialog
  362. title="选择小票机"
  363. :visible.sync="dialogVisible"
  364. width="30%"
  365. :before-close="handleClose">
  366. <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
  367. <el-form-item label="小票机" prop="region">
  368. <el-select v-model="ruleForm.region" placeholder="选择小票机">
  369. <el-option :label="item.deviceName" :key="item.id" :value="item.id" v-for="(item,index) in printList"></el-option>
  370. </el-select>
  371. </el-form-item>
  372. </el-form>
  373. <span slot="footer" class="dialog-footer">
  374. <el-button @click="dialogVisible = false">取 消</el-button>
  375. <el-button type="primary" :loading="dialogVisibleLoading" @click="print(viewerList)">{{ dialogVisibleLoading?'打印中...':'打印' }}</el-button>
  376. </span>
  377. </el-dialog>
  378. <el-dialog
  379. title="对公信息凭证"
  380. :visible.sync="showCorporatePay"
  381. width="50%"
  382. @close="handleCorporatePayClose"
  383. :before-close="handleCorporatePayClose">
  384. <el-form v-loading="corporatePayLoading" :model="ruleForm" :rules="corporatePayRules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
  385. <!-- <el-form-item label="凭证上传" prop="photoList" required>
  386. <el-upload
  387. ref="upload"
  388. :class="form.photoList && form.photoList.length>=15 ? 'upload-box':''"
  389. :action="uploadObj.url"
  390. :headers="uploadObj.headers"
  391. accept=".jpg,.png"
  392. :on-success="handlePhotoListSuccess"
  393. :before-upload="beforeAvatarUpload"
  394. list-type="picture-card"
  395. :file-list="form.photoList"
  396. :on-remove="handleRemove"
  397. :limit="15"
  398. >
  399. <i class="el-icon-plus"></i>
  400. </el-upload>
  401. </el-form-item> -->
  402. <el-form-item label="凭证上传" prop="photoList">
  403. <div style="display: flex;flex-wrap: wrap;">
  404. <div
  405. v-for="(item,index) in form.photoList"
  406. :key="index"
  407. style="width: 100px; height: 100px;margin-top: 5px; position: relative;border: 1px solid #999;border-radius: 5px;margin-right: 20px;">
  408. <el-image
  409. style="width: 100%; height: 100%"
  410. :src="item"
  411. :preview-src-list="form.photoList">
  412. </el-image>
  413. <span @click="handleRemove(index)" style="position: absolute;top: -15px;right: -15px;color: red;font-size: 24px;z-index: 999;cursor: pointer;">
  414. <i class="el-icon-error"></i>
  415. </span>
  416. </div>
  417. <div
  418. style="width: 100px; height: 100px;margin-top: 5px;"
  419. v-if="!form.photoList||form.photoList.length<15"
  420. v-loading="actionUrlLoading"
  421. element-loading-text="上传中..."
  422. element-loading-spinner="el-icon-loading"
  423. element-loading-background="rgba(0, 0, 0, 0.8)"
  424. >
  425. <el-upload
  426. class="avatar-uploader"
  427. :action="uploadObj.url"
  428. :headers="uploadObj.headers"
  429. :show-file-list="false"
  430. :before-upload="beforeAvatarUpload"
  431. :on-success="handleAvatarSuccess"
  432. :on-progress="handleAvatarProgress"
  433. :disabled="actionUrlLoading"
  434. :on-error="handleAvatarError"
  435. >
  436. <i class="el-icon-plus avatar-uploader-icon"></i>
  437. </el-upload>
  438. </div>
  439. </div>
  440. </el-form-item>
  441. <el-form-item label="备注">
  442. <el-input placeholder="请备注" type="textarea" maxlength="300" show-word-limit v-model="form.corporate.remark"></el-input>
  443. </el-form-item>
  444. </el-form>
  445. <span slot="footer" class="dialog-footer">
  446. <el-button @click="showCorporatePay = false">取 消</el-button>
  447. <el-button type="primary" :loading="corporatePayLoading" @click="corporatePay">{{ dialogVisibleLoading?'操作中...':'确定' }}</el-button>
  448. </span>
  449. </el-dialog>
  450. </div>
  451. </template>
  452. <script>
  453. import { getToken } from "@/utils/auth";
  454. import auth from '@/plugins/auth'
  455. import { pageList,gotoCorporatePay, downOrderListXls } from '@/api/order/groupBuyingMr';
  456. import { orderInfoCancel } from '@/api/windowTicketSales/ticketingSales';
  457. import detailsDia from "./dialog/details.vue";
  458. import resetOrder from "./dialog/resetOrder.vue";
  459. import { printApi } from '@/api/order/orderMr'
  460. import { getSelectById } from '@/api/order/groupBuyingMr'
  461. import { pageList as getPrintListApi } from "@/api/device/pda";
  462. import { pagePerformTimeList } from "@/api/schedulingMr/schedulingMr"
  463. import { exportExcel } from '@/utils/exportexcel'
  464. import moment from "moment"
  465. const https = require('https');
  466. const axios = require('axios');
  467. export default {
  468. name: "GroupBuyingMr",
  469. dicts: ['agreement_type', 'team_type','order_status_type','pay_way_type'],
  470. components: { detailsDia, resetOrder },
  471. data() {
  472. return {
  473. qHeight: '0px',
  474. resizeObserver: null,
  475. // 遮罩层
  476. loading: true,
  477. // 选中数组
  478. ids: [],
  479. // 非单个禁用
  480. single: true,
  481. // 非多个禁用
  482. multiple: true,
  483. // 显示搜索条件
  484. showSearch: true,
  485. // 总条数
  486. total: 0,
  487. // 用户表格数据
  488. dataList: null,
  489. // 弹出层标题
  490. title: "",
  491. // 是否显示弹出层
  492. open: false,
  493. // 日期范围
  494. dateRange: [],
  495. // 查询参数
  496. queryParams: {
  497. pageNum: 1,
  498. pageSize: 10,
  499. },
  500. statusList: {
  501. 0: '待支付',
  502. 2: '超时取消',
  503. 3: '待使用',
  504. 4: '退款中',
  505. 5: '己退款',
  506. 6: '退款失败',
  507. 7: '己使用',
  508. 8: '己超期',
  509. 9: '关闭',
  510. },
  511. statusMapList: [
  512. {id: 1, name: '待支付', value: 0},
  513. {id: 2, name: '超时取消', value: 2},
  514. {id: 3, name: '待使用', value: 3},
  515. {id: 4, name: '退款中', value: 4},
  516. {id: 5, name: '己退款', value: 5},
  517. {id: 6, name: '退款失败', value: 6},
  518. {id: 7, name: '己使用', value: 7},
  519. {id: 8, name: '己超期', value: 8},
  520. {id: 9, name: '关闭', value: 9},
  521. ],
  522. payList: {
  523. 0: '未支付',
  524. 1: '已支付',
  525. 2: '支付中',
  526. 3: '支付失败',
  527. 4: '支付退款',
  528. },
  529. payWayList: {
  530. 'cahsh': '现金',
  531. 'wecaht.applet': '微信小程序支付',
  532. 'alipay': '支付宝OTA',
  533. 'wecaht.h5': '微信公众号支付',
  534. 'meituan': '美团支付',
  535. 'corporate': '对公支付',
  536. },
  537. sourceList: {
  538. 1: '小程序',
  539. 2: '公众号',
  540. 3: '美团',
  541. 4: '携程',
  542. 5: '团购',
  543. },
  544. sourceMapList: [
  545. {id: 1, name: '小程序', value: 1},
  546. {id: 2, name: '公众号', value: 2},
  547. {id: 3, name: '美团', value: 3},
  548. {id: 4, name: '携程', value: 4},
  549. {id: 5, name: '团购', value: 5},
  550. ],
  551. visibleStatus: false,
  552. newObj: {},
  553. visibleType: '',
  554. viewerList: [],
  555. printList: [],
  556. dialogVisible: false,
  557. ruleForm: {},
  558. rules: {
  559. region: [
  560. { required: true, message: '请选择打印机', trigger: ['change','blur' ]}
  561. ],
  562. },
  563. dialogVisibleLoading: false,
  564. showCorporatePay:false,
  565. form:{
  566. orderId:'',
  567. photoList:[],
  568. corporate:{
  569. voucherUrl:'',
  570. remark:'',
  571. }
  572. },
  573. corporatePayRules: {
  574. photoList: [{ required: true, message: "请上传凭证", trigger: ["change","blur"] }],
  575. },
  576. uploadObj: {
  577. url: process.env.VUE_APP_UPLOAD_FILE_API + "/upload/single/minio",
  578. Headers: { Authorization: "Bearer " + getToken() },
  579. },
  580. corporatePayLoading:false,
  581. handleExportLoading: false,
  582. pagePerformTimeList: [], // 场次列表
  583. multiPerformDate:false,
  584. fixed: 'left',
  585. actionUrlLoading: false,
  586. queryShow: {
  587. id: true,
  588. teamName: true,
  589. salerPerson: false,
  590. teamTypeId: false,
  591. ifSuccessInvoice: false,
  592. status: false,
  593. time: false,
  594. paymentId: false,
  595. performDate: true,
  596. invoiceTime: false,
  597. refundPaymentId: false,
  598. },
  599. };
  600. },
  601. created() {
  602. this.$set(this.queryParams,'performDate',[moment().format("yyyy-MM-DD"),moment().format("yyyy-MM-DD")])
  603. this.pagePerformTimeListFun(this.queryParams.performDate)
  604. this.getList();
  605. },
  606. activated(){
  607. this.getList();
  608. },
  609. mounted() {
  610. this.resizeObserver = new ResizeObserver(entries => {
  611. for (let entry of entries) {
  612. const { width, height } = entry.contentRect;
  613. this.qHeight = height + 'px'
  614. }
  615. if(document.body.clientWidth<765) {
  616. this.fixed = false
  617. }else {
  618. this.fixed = 'left'
  619. }
  620. });
  621. this.resizeObserver.observe(this.$refs.queryFormBox);
  622. },
  623. methods: {
  624. hasPermi(value){
  625. return auth.hasPermi(value)
  626. },
  627. /** 查询列表 */
  628. getList() {
  629. this.loading = true;
  630. let params = {...this.addDateRange(this.queryParams, this.dateRange)};
  631. if(params.id && params.id.length>19) {
  632. this.$message({
  633. type: 'error',
  634. message: '订单号不存在!!!'
  635. });
  636. this.loading = false
  637. return
  638. }
  639. if(params.performDate&&params.performDate.length==2){
  640. params.performDateStart = params.performDate[0];
  641. params.performDateEnd = params.performDate[1];
  642. }else {
  643. params.performDateStart = null
  644. params.performDateEnd =null
  645. }
  646. delete params.performDate;
  647. pageList(params)
  648. .then(response => {
  649. this.dataList = response.data.rows;
  650. this.total = response.data.total;
  651. this.loading = false;
  652. }).catch(()=>{
  653. this.dataList = [];
  654. this.total = 0;
  655. this.loading = false;
  656. })
  657. },
  658. // 取消按钮
  659. cancel() {
  660. this.open = false;
  661. },
  662. /** 搜索按钮操作 */
  663. handleQuery() {
  664. this.queryParams.pageNum = 1;
  665. if(this.queryParams.time){
  666. this.queryParams.beginTime = this.queryParams.time[0];
  667. this.queryParams.endTime = this.queryParams.time[1];
  668. }else{
  669. this.queryParams.beginTime = null
  670. this.queryParams.endTime = null
  671. }
  672. if(this.queryParams.invoiceTime&&this.queryParams.invoiceTime.length==2){
  673. this.queryParams.invoiceBeginTime =this.queryParams.invoiceTime[0];
  674. this.queryParams.invoiceEndTime =this.queryParams.invoiceTime[1];
  675. }else {
  676. this.queryParams.invoiceBeginTime = null
  677. this.queryParams.invoiceEndTime = null
  678. }
  679. this.getList();
  680. },
  681. /** 重置按钮操作 */
  682. resetQuery() {
  683. this.dateRange = [];
  684. this.$set(this.queryParams, 'paymentId', '');
  685. this.$set(this.queryParams, 'id', '');
  686. this.$set(this.queryParams, 'status', '');
  687. this.$set(this.queryParams, 'teamTypeId', '');
  688. this.$set(this.queryParams, 'teamName', '');
  689. this.$set(this.queryParams, 'performName', '');
  690. this.$set(this.queryParams, 'beginTime', '');
  691. this.$set(this.queryParams, 'endTime', '');
  692. this.$set(this.queryParams, 'time', '');
  693. this.$set(this.queryParams, 'performDate', '');
  694. this.$set(this.queryParams, 'performTimeId', '');
  695. this.$set(this.queryParams, 'invoiceTime', '');
  696. this.$set(this.queryParams, 'salerPerson', '');
  697. this.$set(this.queryParams, 'refundPaymentId', '');
  698. this.queryParams.pageNum = 1;
  699. this.handleQuery();
  700. },
  701. /** 详情按钮操作 */
  702. openDetails(row, type) {
  703. this.$refs["detailsDia"].openDialog("详情", row, type);
  704. },
  705. /** 修改订单按钮操作 */
  706. handleResetOpen(row, type) {
  707. /** 关闭订单 */
  708. this.$confirm("原订单以及原订单中已选择的座位将会被一并取消,确认要修改吗?", '修改订单提示', {
  709. confirmButtonText: '确定',
  710. cancelButtonText: '取消',
  711. type: 'warning'
  712. }).then(() => {
  713. orderInfoCancel({ orderId: row.id}).then((res) => {
  714. if (res.code == 200) {
  715. this.$message({
  716. type: 'success',
  717. message: '操作成功!'
  718. });
  719. this.$refs["resetOrder"].openDialog("重新生成订单", row, type);
  720. }else{
  721. this.$message({
  722. type: 'error',
  723. message: '取消失败!!!'
  724. });
  725. }
  726. });
  727. }).catch(() => {});
  728. //this.$refs["resetOrder"].openDialog("重新生成订单", row, type);
  729. },
  730. handleOpen(list=[]){
  731. if(!list||list.length==0) return
  732. let idList = []
  733. list.forEach((item,index)=>{
  734. idList.push(item.id)
  735. })
  736. this.viewerList = idList
  737. this.getPrintListApi()
  738. this.$set(this.ruleForm, 'region', '');
  739. this.$nextTick(()=>{
  740. this.$refs.ruleForm.clearValidate('region')
  741. })
  742. this.dialogVisible = true
  743. },
  744. handleClose(){
  745. this.dialogVisible = false
  746. },
  747. /** 查询打印机列表 */
  748. getPrintListApi() {
  749. getPrintListApi({deviceType:5,pageNum: 1,
  750. pageSize: 999,})
  751. .then(response => {
  752. this.printList = response.data.rows;
  753. }
  754. );
  755. },
  756. /** 选择打印机 */
  757. selectPrint(){
  758. },
  759. // 打印
  760. async print(list = []){
  761. this.$refs.ruleForm.validate(async (valid) => {
  762. if (valid) {
  763. this.dialogVisibleLoading = true
  764. try {
  765. let res = await printApi({
  766. //viewerList:list,
  767. orderId: list[0],
  768. source: 2,
  769. deviceId: this.ruleForm.region
  770. })
  771. if(res.code == 200) {
  772. let url = res.data.linkIp
  773. let printInfo = res.data.printInfo
  774. this.connectPrint(url,printInfo)
  775. }else {
  776. throw new Error(res)
  777. }
  778. } catch (error) {
  779. this.dialogVisible = false
  780. this.dialogVisibleLoading = false
  781. console.error("error=====",error)
  782. }
  783. } else {
  784. console.log('error submit!!');
  785. return false;
  786. }
  787. });
  788. },
  789. /** 连接打印机 */
  790. connectPrint(url,data){
  791. // let xhr = new XMLHttpRequest();
  792. // xhr.onreadystatechange = ()=>{
  793. // if(xhr.readyState == 4){ // 监听请求完成
  794. // if((xhr.status >=200 && xhr.status <300) || xhr.status == 304){
  795. // console.log(xhr.responseText)
  796. // this.dialogVisible = false
  797. // this.dialogVisibleLoading = false
  798. // }else{
  799. // console.log('请求失败')
  800. // this.dialogVisible = false
  801. // this.dialogVisibleLoading = false
  802. // }
  803. // }
  804. // }
  805. // xhr.open("post", url, true); // 异步请求
  806. // xhr.send(JSON.stringify(data));
  807. const ignoreSSL = axios.create({
  808. httpsAgent: new https.Agent({
  809. rejectUnauthorized: false
  810. }),
  811. withCredentials: true, // 跨域请求时发送Cookie
  812. timeout: 60000, // 请求超时
  813. headers: {
  814. "Content-Type": "application/json; charset=UTF-8;"
  815. }
  816. });
  817. ignoreSSL.post(url,
  818. { ...data }
  819. ).then(()=>{
  820. this.dialogVisible = false
  821. this.dialogVisibleLoading = false
  822. }).catch(()=>{
  823. this.dialogVisible = false
  824. this.dialogVisibleLoading = false
  825. })
  826. },
  827. async handleCorporatePay(row){
  828. this.actionUrlLoading = false
  829. console.log('corporatePay',row);
  830. this.showCorporatePay = true;
  831. this.corporatePayLoading = true;
  832. let res = await getSelectById(row.id)
  833. this.form.orderId = row.id;
  834. this.$set(this.form,'photoList',[])
  835. if(res.data.corporate){
  836. let urlList = res.data.corporate.voucherUrl.split(',')||[]
  837. // let urlListObj = []
  838. // urlList.forEach((item,index)=>{
  839. // urlListObj.push({
  840. // name: 'url_'+index,
  841. // url: item
  842. // })
  843. // })
  844. this.$set(this.form,'photoList',urlList)
  845. this.$set(this.form.corporate,'remark',res.data.corporate.remark)
  846. }else {
  847. this.$set(this.form,'photoList',[])
  848. this.$set(this.form.corporate,'remark','')
  849. }
  850. this.corporatePayLoading = false;
  851. },
  852. handleCorporatePayClose(){
  853. this.$set(this.form,'photoList',[])
  854. console.log('1111');
  855. this.corporatePayLoading = false;
  856. this.showCorporatePay = false;
  857. },
  858. corporatePay(){
  859. console.log('form',this.form);
  860. if(this.form.photoList.length<1){
  861. this.$message.error('请上传凭证');
  862. return
  863. }
  864. this.corporatePayLoading = true;
  865. const voucherUrl = this.form.photoList.map(item => item).join(",");
  866. this.form.corporate.voucherUrl = voucherUrl;
  867. gotoCorporatePay(this.form).then((res)=>{
  868. this.$message.success(res.msg);
  869. this.corporatePayLoading = false;
  870. this.handleCorporatePayClose();
  871. }).catch((err)=>{
  872. this.corporatePayLoading = false;
  873. this.$message.error(err.msg);
  874. console.log('corporatePay err',err);
  875. })
  876. },
  877. /**
  878. * 剧目海报上传成功
  879. * @date 2023-11-22
  880. * @param {any} res
  881. * @returns {any}
  882. */
  883. handlePhotoListSuccess(res) {
  884. if (res.code === 200) {
  885. let photo = {
  886. imageUrl: res?.data?.url,
  887. url: res?.data?.url,
  888. photoType: '2'
  889. }
  890. if(!this.form.photoList){
  891. this.form.photoList = []
  892. }
  893. // this.form.photoList.push(photo);
  894. this.$set(this.form.photoList, this.form.photoList.length, photo);
  895. }
  896. },
  897. // handleRemove(file, fileList) {
  898. // this.form.photoList.forEach((item, index) => {
  899. // if(item.uid == file.uid){
  900. // this.form.photoList.splice(index, 1)
  901. // }
  902. // })
  903. // },
  904. /**
  905. * 上传文件之前之前
  906. * @date 2023-11-22
  907. * @param {any} file
  908. * @returns {any}
  909. */
  910. // beforeAvatarUpload(file) {
  911. // const isJPG = file.type === "image/jpeg" || "image/png";
  912. // if (!isJPG) {
  913. // this.$message.error("上传头像图片只能是jpg或png格式!");
  914. // }
  915. // return isJPG;
  916. // },
  917. /**
  918. * 导出报表
  919. * @date 2022-10-24
  920. * @returns {any}
  921. */
  922. handleExport() {
  923. this.$confirm('您确定要导出当前查询的数据吗?', '提示', {
  924. confirmButtonText: '确定 ',
  925. cancelButtonText: '取消 ',
  926. type: 'warning'
  927. })
  928. .then(() => {
  929. this.handleExportLoading = true;
  930. // const { pageNum, pageSize} = this.params;
  931. let postMap = {}
  932. if(this.queryParams.time){
  933. this.queryParams.beginTime = this.queryParams.time[0];
  934. this.queryParams.endTime = this.queryParams.time[1];
  935. }else{
  936. this.queryParams.beginTime = null
  937. this.queryParams.endTime = null
  938. }
  939. if(this.queryParams.performDate&&this.queryParams.performDate.length==2){
  940. this.queryParams.performDateStart = this.queryParams.performDate[0];
  941. this.queryParams.performDateEnd = this.queryParams.performDate[1];
  942. }else {
  943. this.queryParams.performDateStart = null
  944. this.queryParams.performDateEnd =null
  945. }
  946. if(this.queryParams.invoiceTime&&this.queryParams.invoiceTime.length==2){
  947. this.queryParams.invoiceBeginTime =this.queryParams.invoiceTime[0];
  948. this.queryParams.invoiceEndTime =this.queryParams.invoiceTime[1];
  949. }else {
  950. this.queryParams.invoiceBeginTime = null
  951. this.queryParams.invoiceEndTime = null
  952. }
  953. let params = JSON.parse(JSON.stringify(this.queryParams))
  954. for (let key in params) {
  955. if(key != 'pageNum' && key != 'pageSize' && key != 'time' && key != 'performDate' && key != 'invoiceTime'){
  956. postMap[key] = params[key]
  957. }
  958. }
  959. downOrderListXls(postMap)
  960. .then((res) => {
  961. exportExcel(res, '团购订单', '.xlsx');
  962. this.handleExportLoading = false;
  963. })
  964. .catch((error) => {
  965. console.log("error===",error)
  966. this.handleExportLoading = false;
  967. });
  968. })
  969. .catch(() => {
  970. this.$message.info('您已取消导出!');
  971. });
  972. },
  973. async pagePerformTimeListFun(value) {
  974. try {
  975. this.pagePerformTimeList = []
  976. this.$set(this.queryParams,'performTimeId',null)
  977. if(!value){
  978. return
  979. }
  980. if(value.length==2&&value[0]==value[1]){
  981. this.multiPerformDate = false
  982. }else{
  983. this.multiPerformDate = true
  984. return
  985. }
  986. let { data,code } = await pagePerformTimeList({
  987. performDate: value[0],
  988. pageNum: 1,
  989. pageSize: 999
  990. })
  991. this.pagePerformTimeList = [].concat(data.rows)
  992. } catch (error) {
  993. }
  994. },
  995. /** 关闭订单 */
  996. handleCancelOrder(row) {
  997. this.$confirm("是否关闭" + row.id + "的订单?", '提示', {
  998. confirmButtonText: '确定',
  999. cancelButtonText: '取消',
  1000. type: 'warning'
  1001. }).then(() => {
  1002. orderInfoCancel({ orderId: row.id}).then((res) => {
  1003. if (res.code == 200) {
  1004. this.$message({
  1005. type: 'success',
  1006. message: '操作成功!'
  1007. });
  1008. this.getList();
  1009. }
  1010. });
  1011. }).catch(() => {});
  1012. },
  1013. /** 上传图片 单张 */
  1014. handleAvatarSuccess(response, file, fileList) {
  1015. console.log("res, file",response, file, fileList)
  1016. this.actionUrlLoading = false
  1017. if(response.code == 200) {
  1018. this.form.photoList.push(response.data.url)
  1019. }
  1020. },
  1021. beforeAvatarUpload(file) {
  1022. const isLt2M = file.size / 1024 / 1024 <= 100;
  1023. let testmsg = file.name.substring(file.name.lastIndexOf('.')+1)
  1024. let typeList = ['png','jepg','jpg','gif']
  1025. const isJPG = typeList.includes(testmsg);
  1026. if (!isJPG) {
  1027. this.$message.error(`上传图片图片只能是 ${typeList} 格式!`);
  1028. }
  1029. if (!isLt2M) {
  1030. this.$message.error('上传图片图片大小不能超过 100MB!');
  1031. }
  1032. return isJPG && isLt2M;
  1033. },
  1034. handleAvatarProgress(){
  1035. this.actionUrlLoading = true
  1036. },
  1037. handleAvatarError() {
  1038. this.actionUrlLoading = false
  1039. },
  1040. handleRemove(index) {
  1041. this.form.photoList.splice(index,1)
  1042. },
  1043. // 更多操作触发
  1044. handleCommand(command, row) {
  1045. switch (command) {
  1046. case "1":
  1047. this.handleCorporatePay(row);
  1048. break;
  1049. case "2":
  1050. this.handleCancelOrder(row);
  1051. break;
  1052. case "3":
  1053. this.handleOpen(row);
  1054. break;
  1055. case "4":
  1056. this.handleResetOpen(row);
  1057. break;
  1058. default:
  1059. break;
  1060. }
  1061. },
  1062. clearQuery(key) {
  1063. this.$set(this.queryShow,key,false)
  1064. this.$set(this.queryParams,key,'')
  1065. if(key == 'performDate') {
  1066. this.$set(this.queryParams,'performTimeId','')
  1067. }
  1068. },
  1069. openQuery(key) {
  1070. this.$set(this.queryShow,key,true)
  1071. }
  1072. },
  1073. beforeDestroy() {
  1074. this.resizeObserver.unobserve(this.$refs.queryFormBox);
  1075. this.resizeObserver.disconnect();
  1076. },
  1077. };
  1078. </script>
  1079. <style lang="scss" scoped>
  1080. .upload-btn {
  1081. width: 100px;
  1082. height: 100px;
  1083. background-color: #fbfdff;
  1084. border: dashed 1px #c0ccda;
  1085. border-radius: 5px;
  1086. i {
  1087. font-size: 30px;
  1088. margin-top: 20px;
  1089. }
  1090. &-text {
  1091. margin-top: -10px;
  1092. }
  1093. }
  1094. .avatar {
  1095. cursor: pointer;
  1096. }
  1097. .app-container {
  1098. height: calc( 100vh - 110px );
  1099. box-sizing: border-box;
  1100. }
  1101. .app-container-query {
  1102. }
  1103. .app-container-table-box {
  1104. height: calc( 100% - var(--q-height) );
  1105. .app-container-table-info {
  1106. height: calc( 100% - 100px );
  1107. }
  1108. }
  1109. .upload-box {
  1110. ::v-deep .el-upload--picture-card {
  1111. display: none;
  1112. }
  1113. }
  1114. ::v-deep .avatar-uploader .el-upload {
  1115. border: 1px dashed #d9d9d9;
  1116. border-radius: 6px;
  1117. cursor: pointer;
  1118. position: relative;
  1119. overflow: hidden;
  1120. }
  1121. ::v-deep .avatar-uploader .el-upload:hover {
  1122. border-color: #409EFF;
  1123. }
  1124. ::v-deep .avatar-uploader-icon {
  1125. font-size: 28px;
  1126. color: #8c939d;
  1127. width: 100px;
  1128. height: 100px;
  1129. line-height: 100px;
  1130. text-align: center;
  1131. }
  1132. ::v-deep .avatar {
  1133. width: 100px;
  1134. height: 100px;
  1135. display: block;
  1136. }
  1137. .app-container-scheduling ::v-deep .el-select__tags {
  1138. flex-wrap: inherit !important;
  1139. overflow-x: auto !important;
  1140. }
  1141. .app-container-scheduling ::v-deep .el-form-item__content {
  1142. position: relative;
  1143. }
  1144. .app-container-scheduling ::v-deep .el-form-item__content .query_clear{
  1145. position: absolute;
  1146. top: -15px;
  1147. right: -10px;
  1148. display: none;
  1149. cursor: pointer;
  1150. z-index: 99;
  1151. }
  1152. .app-container-scheduling ::v-deep .el-form-item__content:hover .query_clear {
  1153. display: block;
  1154. }
  1155. </style>