index.vue 35 KB

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