index.vue 25 KB

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