index.vue 28 KB

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