index.vue 28 KB

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