order_settlement.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <template>
  2. <el-drawer
  3. :title="`关联订单(发票总价:¥${fp_info.money})`"
  4. size="60%"
  5. :append-to-body="false"
  6. :destroy-on-close="true"
  7. :visible="true"
  8. :modal-append-to-body="false"
  9. :before-close="handleClose"
  10. :wrapperClosable="false"
  11. ref="drawer_close">
  12. <div v-loading="loading" style="padding: 20px" class="block">
  13. <div style="display: flex;justify-content: space-between">
  14. <div></div>
  15. <el-button size="small" @click="g_order" type="primary">关联订单</el-button>
  16. </div>
  17. <el-table row-key="id" show-summary :data="list">
  18. <el-table-column prop="title" width="400px" label="订单名称">
  19. <template slot-scope="scope">
  20. <a :href="`/main/orders_detail/?id=${scope.row.order_no}`" style="color: #006eff" target="_blank">{{scope.row.product_title}}</a>
  21. </template>
  22. </el-table-column>
  23. <el-table-column prop="amount" label="订单金额">
  24. <template slot-scope="scope">
  25. <span>{{scope.row.amount}}</span>
  26. </template>
  27. </el-table-column>
  28. <el-table-column prop="title" label="关联项目">
  29. <template slot-scope="scope">
  30. <a :href="scope.row.project_url" style="color: #006eff" target="_blank">{{scope.row.project_name}}</a>
  31. </template>
  32. </el-table-column>
  33. <el-table-column prop="title" label="订单编号">
  34. <template slot-scope="scope">
  35. <span>{{scope.row.order_no}}</span>
  36. </template>
  37. </el-table-column>
  38. <el-table-column prop="title" width="100px" fixed="right" label="操作">
  39. <template slot-scope="scope">
  40. <el-button type="text" @click="qx_g_order(scope.row)">取消关联</el-button>
  41. </template>
  42. </el-table-column>
  43. </el-table>
  44. </div>
  45. </el-drawer>
  46. </template>
  47. <script>
  48. export default {
  49. props: {
  50. action: {
  51. },
  52. pro: {
  53. },
  54. back:{
  55. type:Object
  56. },
  57. fp_info:{
  58. type:Object
  59. }
  60. },
  61. data() {
  62. return {
  63. search: {
  64. pagesize: 15,
  65. page:0,
  66. total:0,
  67. },
  68. loading:true,
  69. list: []
  70. };
  71. },
  72. computed: {},
  73. watch: {},
  74. created() {},
  75. mounted() {
  76. this.getList();
  77. },
  78. methods: {
  79. async qx_g_order(row) {
  80. this.$confirm('是否确认取消关联?', '提示', {
  81. confirmButtonText: '确定',
  82. cancelButtonText: '取消',
  83. type: 'warning'
  84. }).then(async () => {
  85. this.loading = true;
  86. let res =await this.$post("/uapi/pub/info/order/user_order/qx_g_order",{order_no:row.order_no,invoice_id:this.pro});
  87. if (res.status == 1) {
  88. this.$message({
  89. type: 'success',
  90. message: '成功!'
  91. });
  92. await this.getList();
  93. }
  94. this.loading = false;
  95. }).catch(() => {
  96. this.$message({
  97. type: 'info',
  98. message: '已取消删除'
  99. });
  100. });
  101. },
  102. handleClose:function()
  103. {
  104. this.back.drawer_obj.order_settlement=false;
  105. this.back.drawer_obj.id="";
  106. },
  107. async g_order() {
  108. this.$prompt('请输入关联的订单编号', '提示', {
  109. confirmButtonText: '确定',
  110. cancelButtonText: '取消',
  111. }).then(async ({ value }) => {
  112. this.loading = true;
  113. let res =await this.$post("/uapi/pub/info/order/user_order/bd_invoice_id",{id:this.pro,order_no:value});
  114. if (res.status == 1) {
  115. this.$message({
  116. type: 'success',
  117. message: '关联成功!'
  118. });
  119. await this.getList();
  120. }
  121. this.loading = false;
  122. }).catch(() => {
  123. this.$message({
  124. type: 'info',
  125. message: '已取消关联'
  126. });
  127. });
  128. },
  129. async getList() {
  130. this.loading = true;
  131. let res = await this.$post("/uapi/pub/info/order/user_order/invoice_order_list",{id:this.pro});
  132. this.loading = false;
  133. if (res.status == 1) {
  134. this.list = res.data.list;
  135. this.search.total = res.data.total;
  136. }
  137. },
  138. page_event(page) {
  139. this.search.page = page;
  140. this.getList();
  141. },
  142. }
  143. };
  144. </script>
  145. <style scoped>
  146. .el-tag {
  147. cursor: pointer;
  148. }
  149. </style>