childOrder.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. <!--
  2. * @Description: 新增/编辑弹框
  3. -->
  4. <template>
  5. <el-dialog
  6. :title="subTitle"
  7. v-if="isShow"
  8. :visible.sync="isShow"
  9. width="90%"
  10. append-to-body
  11. :close-on-click-modal="false"
  12. @close="cancel"
  13. >
  14. <div class="dialog">
  15. <!-- 表格 -->
  16. <el-button class="addBtn" type="primary" v-if="orderList.length < 3" @click="addChildOrder">添加子订单</el-button>
  17. <div class="app-container-table-info">
  18. <el-table ref="tables" v-loading="isLoading" height="500px" :data="orderList" border>
  19. <el-table-column label="序号" align="center" type="index" width="60"></el-table-column>
  20. <el-table-column label="订单号" align="center" prop="id" width="170" />
  21. <el-table-column label="票档" align="center" prop="seatTypeName" />
  22. <el-table-column label="团购数量" align="center" prop="quantity" />
  23. <el-table-column label="应收金额" align="center" prop="orderPrice">
  24. <template slot-scope="scope">
  25. <span>¥{{ scope.row.orderPrice }}</span>
  26. </template>
  27. </el-table-column>
  28. <el-table-column label="实收金额" align="center" prop="realPrice">
  29. <template slot-scope="scope">
  30. <span v-if="scope.row.status != 0">¥{{ scope.row.realPrice }}</span>
  31. </template>
  32. </el-table-column>
  33. <el-table-column label="支付方式" align="center" prop="type">
  34. <template slot-scope="scope">
  35. <dict-tag :options="dict.type.pay_way_type" :value="scope.row.payWay"/>
  36. </template>
  37. </el-table-column>
  38. <el-table-column label="支付时间" align="center" prop="payTime" width="160" >
  39. <template slot-scope="scope">
  40. <span>{{ parseTime(scope.row.payTime) }}</span>
  41. </template>
  42. </el-table-column>
  43. <el-table-column label="支付单号" align="center" prop="paymentId" />
  44. <el-table-column label="订单状态" align="center" prop="status">
  45. <template slot-scope="scope">
  46. <dict-tag :options="dict.type.order_status_type" :value="scope.row.status"/>
  47. </template>
  48. </el-table-column>
  49. <el-table-column label="商户退款单号" align="center" prop="refundPaymentId" />
  50. <el-table-column label="已核销票数" align="center" prop="usedTotal">
  51. <template slot-scope="scope">
  52. <span>{{ scope.row.usedTotal }}</span>
  53. </template>
  54. </el-table-column>
  55. <el-table-column label="已核销金额" align="center" prop="usedPriceTotal">
  56. <template slot-scope="scope">
  57. <span>{{ scope.row.usedPriceTotal }}</span>
  58. </template>
  59. </el-table-column>
  60. <el-table-column label="退票数量" align="center" prop="refundTotal">
  61. <template slot-scope="scope">
  62. <span>{{ scope.row.refundTotal }}</span>
  63. </template>
  64. </el-table-column>
  65. <el-table-column label="退票金额" align="center" prop="refundPriceTotal">
  66. <template slot-scope="scope">
  67. <span>{{ scope.row.refundPriceTotal && scope.row.refundPriceTotal !=0 ?('-' + scope.row.refundPriceTotal) : '' }}</span>
  68. </template>
  69. </el-table-column>
  70. <el-table-column label="是否成功开票" align="center">
  71. <template slot-scope="scope">
  72. <el-tag type="danger" v-if="scope.row.ifSuccessInvoice == '0'">否</el-tag>
  73. <el-tag type="success" v-else-if="scope.row.ifSuccessInvoice == '1'">是</el-tag>
  74. </template>
  75. </el-table-column>
  76. <el-table-column label="开票时间" align="center" prop="invoiceTime">
  77. <template slot-scope="scope">
  78. <span>{{ scope.row.invoiceTime }}</span>
  79. </template>
  80. </el-table-column>
  81. <el-table-column label="是否其他团队代付" align="center" prop="ifRepay">
  82. <template slot-scope="scope">
  83. <el-tag type="danger" v-if="scope.row.ifRepay == '0'">否</el-tag>
  84. <el-tag type="success" v-else-if="scope.row.ifRepay == '1'">是</el-tag>
  85. <span v-else></span>
  86. </template>
  87. </el-table-column>
  88. <el-table-column label="操作" align="center" fixed="right" width="180px" class-name="small-padding fixed-width">
  89. <template slot-scope="scope">
  90. <el-button
  91. size="mini"
  92. type="text"
  93. @click="openDetails(scope.row,'normal')"
  94. v-hasPermi="['groupBuyingMr:groupBuyingMr:details']"
  95. >详情</el-button>
  96. <el-button size="mini" type="text" v-if="scope.row.status === 0" @click="payOrder(scope.row)">代客下单</el-button>
  97. <el-button size="mini" type="text" v-if="scope.row.status == 3 || scope.row.status == 7" @click="handleOpenPrint(scope.row)">打印小票</el-button>
  98. <el-button size="mini" type="text" v-if="scope.row.status == 3 || scope.row.status == 7" @click="handlePayOrCredit(scope.row)">修改凭证</el-button>
  99. <el-button size="mini" type="text" v-if="scope.row.status == 7" @click="handleInvoicing(scope.row)">开具发票</el-button>
  100. <el-button size="mini" type="text" v-if="scope.row.status === 0" @click="closedOrder(scope.row)">关闭订单</el-button>
  101. </template>
  102. </el-table-column>
  103. </el-table>
  104. <!-- <pagination
  105. v-show="total>0"
  106. :total="total"
  107. :page.sync="queryParams.pageNum"
  108. :limit.sync="queryParams.pageSize"
  109. @pagination="getList"
  110. /> -->
  111. </div>
  112. </div>
  113. </el-dialog>
  114. </template>
  115. <script>
  116. import {
  117. pageList,
  118. } from '@/api/order/groupBuyingMr';
  119. import { orderInfoCancel } from '@/api/windowTicketSales/ticketingSales';
  120. export default {
  121. name: "ChildOrder",
  122. dicts: ['order_status_type','pay_way_type'],
  123. data() {
  124. return {
  125. model: "ORDER",
  126. isShow: false,
  127. loading: false,
  128. isLoading: false,
  129. subTitle: "子订单信息",
  130. orderList: [],
  131. orderInfo: {}
  132. };
  133. },
  134. methods: {
  135. // 打开弹框
  136. openDialog(title, obj, type) {
  137. this.isShow = true;
  138. this.subTitle = title;
  139. this.orderInfo = obj;
  140. this.getChildOrderApi(obj);
  141. },
  142. /** 获取子订单 */
  143. getChildOrderApi(row) {
  144. this.loading = true;
  145. let params = {
  146. masterOrderId: row.id,
  147. pageNum: 1,
  148. pageSize: 100,
  149. };
  150. pageList(params).then(response => {
  151. this.orderList = response.data.rows;
  152. this.isLoading = false;
  153. }).catch(()=>{
  154. this.orderList = [];
  155. this.isLoading = false;
  156. })
  157. },
  158. // 添加子订单
  159. addChildOrder() {
  160. this.$emit('addChild', this.orderInfo)
  161. this.isShow = false;
  162. },
  163. // 查看子订单详情
  164. openDetails(row) {
  165. this.$emit('orderInfo', row)
  166. this.isShow = false;
  167. },
  168. // 代课下单
  169. payOrder(row) {
  170. this.$emit('payOrder', row)
  171. this.isShow = false;
  172. },
  173. // 修改凭证
  174. handlePayOrCredit(row) {
  175. this.$emit('handPayOrCredit', row)
  176. this.isShow = false;
  177. },
  178. // 打印小票
  179. handleOpenPrint(row) {
  180. this.$emit('handleOpen', [row])
  181. this.isShow = false;
  182. },
  183. // 开具发票
  184. handleInvoicing(row) {
  185. this.$emit('handleInvoicing', row)
  186. this.isShow = false;
  187. },
  188. // 关闭订单
  189. closedOrder(row) {
  190. this.$confirm("是否关闭" + row.id + "的订单?", '提示', {
  191. confirmButtonText: '确定',
  192. cancelButtonText: '取消',
  193. type: 'warning'
  194. }).then(() => {
  195. orderInfoCancel({ orderId: row.id}).then((res) => {
  196. if (res.code == 200) {
  197. this.$message({
  198. type: 'success',
  199. message: '操作成功!'
  200. });
  201. this.getList();
  202. }
  203. });
  204. }).catch(() => {});
  205. },
  206. // 关闭弹框
  207. cancel() {
  208. this.isShow = false;
  209. },
  210. },
  211. };
  212. </script>
  213. <style lang="scss" scoped>
  214. .dialog {
  215. padding: 0 10px;
  216. max-height: 85vh;
  217. overflow-y: auto;
  218. .addBtn {
  219. float: right;
  220. margin: 10px 0;
  221. }
  222. }
  223. </style>