index.vue 28 KB

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