index.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  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.orderId"
  7. placeholder="请输入订单号"
  8. clearable
  9. style="width: 240px;"
  10. @keyup.enter.native="handleQuery"
  11. />
  12. </el-form-item>
  13. <el-form-item label="抬头名称">
  14. <el-input
  15. v-model="queryParams.name"
  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.handlerType"
  25. placeholder="类型"
  26. clearable
  27. style="width: 100%"
  28. >
  29. <el-option
  30. v-for="dict in dict.type.lookup_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.status"
  40. placeholder="状态"
  41. clearable
  42. style="width: 100%"
  43. >
  44. <el-option
  45. v-for="dict in dict.type.Invoicing_type"
  46. :key="dict.value"
  47. :label="dict.label"
  48. :value="dict.value"
  49. />
  50. </el-select>
  51. </el-form-item>
  52. <el-form-item>
  53. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  54. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  55. </el-form-item>
  56. </el-form>
  57. <el-row :gutter="10" class="mb8">
  58. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  59. </el-row>
  60. <el-table ref="tables" v-loading="loading" :data="dataList" border>
  61. <el-table-column label="序号" align="center" type="index" width="60"></el-table-column>
  62. <el-table-column label="订单号" align="center" prop="orderId" />
  63. <el-table-column label="订单金额(元)" align="center" prop="invoiceAmount" />
  64. <el-table-column label="类型" align="center">
  65. <template slot-scope="scope">
  66. <dict-tag :options="dict.type.lookup_type" :value="scope.row.handlerType"/>
  67. </template>
  68. </el-table-column>
  69. <el-table-column label="抬头名称" align="center" prop="name" />
  70. <el-table-column label="税号" align="center" prop="creditCode" />
  71. <el-table-column label="状态" align="center">
  72. <template slot-scope="scope">
  73. <dict-tag :options="dict.type.Invoicing_type" :value="scope.row.status"/>
  74. </template>
  75. </el-table-column>
  76. <el-table-column label="申请时间" align="center">
  77. <template slot-scope="scope">
  78. <span>{{ parseTime(scope.row.createTime) }}</span>
  79. </template>
  80. </el-table-column>
  81. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  82. <template slot-scope="scope">
  83. <el-button
  84. size="mini"
  85. type="text"
  86. @click="openDetails(scope.row)"
  87. v-hasPermi="['finance:InvoiceRecords:details']"
  88. >详情</el-button>
  89. <el-button
  90. size="mini"
  91. type="text"
  92. v-if="scope.row.status == 1"
  93. @click="openRedBlood(scope.row)"
  94. v-hasPermi="['finance:InvoiceRecords:redblood']"
  95. >冲红</el-button>
  96. </template>
  97. </el-table-column>
  98. </el-table>
  99. <pagination
  100. v-show="total>0"
  101. :total="total"
  102. :page.sync="queryParams.pageNum"
  103. :limit.sync="queryParams.pageSize"
  104. @pagination="getList"
  105. />
  106. <!-- 详情 -->
  107. <details-dia ref="detailsDia" @getList="getList"></details-dia>
  108. </div>
  109. </template>
  110. <script>
  111. import { pageList,orderInvoiceRed } from '@/api/financeMr/InvoiceRecords'
  112. import detailsDia from "./dialog/details.vue";
  113. export default {
  114. name: "InvoiceRecords",
  115. dicts: ['Invoicing_type','lookup_type'],
  116. components: { detailsDia },
  117. data() {
  118. return {
  119. // 遮罩层
  120. loading: true,
  121. // 选中数组
  122. ids: [],
  123. // 非单个禁用
  124. single: true,
  125. // 非多个禁用
  126. multiple: true,
  127. // 显示搜索条件
  128. showSearch: true,
  129. // 总条数
  130. total: 0,
  131. // 用户表格数据
  132. dataList: null,
  133. // 弹出层标题
  134. title: "",
  135. // 是否显示弹出层
  136. open: false,
  137. // 日期范围
  138. dateRange: [],
  139. // 查询参数
  140. queryParams: {
  141. pageNum: 1,
  142. pageSize: 10,
  143. }
  144. };
  145. },
  146. created() {
  147. this.getList();
  148. },
  149. methods: {
  150. /** 查询列表 */
  151. getList() {
  152. this.loading = true;
  153. pageList(this.addDateRange(this.queryParams, this.dateRange))
  154. .then(response => {
  155. this.dataList = response.data.rows;
  156. this.total = response.data.total;
  157. this.loading = false;
  158. }
  159. );
  160. },
  161. // 取消按钮
  162. cancel() {
  163. this.open = false;
  164. },
  165. /** 搜索按钮操作 */
  166. handleQuery() {
  167. this.queryParams.pageNum = 1;
  168. this.getList();
  169. },
  170. /** 重置按钮操作 */
  171. resetQuery() {
  172. this.dateRange = [];
  173. this.$set(this.queryParams, 'orderId', '');
  174. this.$set(this.queryParams, 'name', '');
  175. this.$set(this.queryParams, 'status', '');
  176. this.$set(this.queryParams, 'handlerType', '');
  177. this.queryParams.pageNum = 1;
  178. this.handleQuery();
  179. },
  180. /** 详情按钮操作 */
  181. openDetails(row, type) {
  182. this.$refs["detailsDia"].openDialog("详情", row, type);
  183. },
  184. openRedBlood(row){
  185. this.$confirm('您即将进行冲红操作,是否继续?', '提示', {
  186. confirmButtonText: '确定',
  187. cancelButtonText: '取消',
  188. type: 'warning'
  189. }).then(async () => {
  190. try {
  191. let res = await orderInvoiceRed({
  192. orderId: row.orderId
  193. })
  194. if(res.code == 200){
  195. this.$message({
  196. type: 'success',
  197. message: '冲红成功!'
  198. });
  199. }else {
  200. this.$message.error(res.msg);
  201. }
  202. } catch (error) {
  203. this.$message.error('冲红失败!');
  204. }
  205. }).catch(() => {
  206. this.$message({
  207. type: 'info',
  208. message: '已取消冲红'
  209. });
  210. });
  211. }
  212. }
  213. };
  214. </script>