index.vue 36 KB

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