index.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
  4. <el-form-item label="公司名" prop="companyId">
  5. <el-select filterable style="width: 220px" v-model="queryParams.companyId" placeholder="请选择公司名" clearable size="small">
  6. <el-option
  7. v-for="item in companys"
  8. :key="item.companyId"
  9. :label="item.companyName"
  10. :value="item.companyId"
  11. />
  12. </el-select>
  13. </el-form-item>
  14. <el-form-item label="提现状态" prop="profitStatus">
  15. <el-select style="width: 220px" v-model="queryParams.profitStatus" placeholder="请选择状态" clearable size="small">
  16. <el-option
  17. v-for="dict in statusOptions"
  18. :key="dict.dictValue"
  19. :label="dict.dictLabel"
  20. :value="dict.dictValue"
  21. />
  22. </el-select>
  23. </el-form-item>
  24. <el-form-item label="提交时间">
  25. <el-date-picker v-model="dateRange" size="small" style="width: 220px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
  26. </el-form-item>
  27. <el-form-item>
  28. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  29. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  30. </el-form-item>
  31. </el-form>
  32. <el-row :gutter="10" class="mb8">
  33. <el-col :span="1.5">
  34. <el-button
  35. type="warning"
  36. icon="el-icon-download"
  37. size="mini"
  38. @click="handleExport"
  39. v-hasPermi="['company:companyProfit:export']"
  40. >导出</el-button>
  41. </el-col>
  42. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  43. </el-row>
  44. <el-table height="500" border v-loading="loading" :data="companyProfitList" @selection-change="handleSelectionChange">
  45. <el-table-column type="selection" width="55" align="center" />
  46. <el-table-column label="ID" align="center" prop="profitId" />
  47. <el-table-column label="公司" align="center" prop="companyName" />
  48. <el-table-column label="提现金额" align="center" prop="money" />
  49. <el-table-column label="余额" align="center" prop="balances" />
  50. <el-table-column label="银行名称" align="center" prop="bankName" />
  51. <el-table-column label="支行名称" align="center" prop="bankBranchName" />
  52. <el-table-column label="银行卡号" align="center" prop="bankCardNo" />
  53. <el-table-column label="开户名" align="center" prop="bankUserName" />
  54. <el-table-column label="状态" align="center" prop="profitStatus" width="160px" >
  55. <template slot-scope="scope">
  56. <el-tag prop="status" v-for="(item, index) in statusOptions" :type="scope.row.profitStatus==0?'danger':'success'" v-if="scope.row.profitStatus==item.dictValue">{{item.dictLabel}}</el-tag>
  57. </template>
  58. </el-table-column>
  59. <el-table-column label="提交时间" align="center" prop="createTime" />
  60. <el-table-column label="审核时间" align="center" prop="updateTime" />
  61. <el-table-column label="备注" align="center" prop="remark" />
  62. <el-table-column label="凭证" align="center" width="120">
  63. <template slot-scope="scope">
  64. <el-popover
  65. placement="right"
  66. title=""
  67. trigger="hover"
  68. >
  69. <img slot="reference" :src="scope.row.imgUrl" width="100">
  70. <img :src="scope.row.imgUrl" style="max-width: 500px;">
  71. </el-popover>
  72. </template>
  73. </el-table-column>
  74. <el-table-column label="操作" align="center" fixed="right" width="120px" class-name="small-padding fixed-width">
  75. <template slot-scope="scope">
  76. <el-button
  77. size="mini"
  78. type="text"
  79. @click="handleShow(scope.row)"
  80. v-hasPermi="['company:companyProfit:query']"
  81. >查看</el-button>
  82. </template>
  83. </el-table-column>
  84. </el-table>
  85. <pagination
  86. v-show="total>0"
  87. :total="total"
  88. :page.sync="queryParams.pageNum"
  89. :limit.sync="queryParams.pageSize"
  90. @pagination="getList"
  91. />
  92. <el-dialog :title="show.title" :visible.sync="show.open" width="1000px" append-to-body>
  93. <company-profit ref="profit" />
  94. </el-dialog>
  95. </div>
  96. </template>
  97. <script>
  98. import { audit,listCompanyProfit, getCompanyProfit, delCompanyProfit, addCompanyProfit, updateCompanyProfit, exportCompanyProfit } from "@/api/company/companyProfit";
  99. import { getCompanyList } from "@/api/company/company";
  100. import companyProfit from "../components/companyProfit";
  101. export default {
  102. components: {companyProfit },
  103. name: "CompanyProfit",
  104. data() {
  105. return {
  106. show:{
  107. title:'查看',
  108. open:false,
  109. },
  110. companys:[],
  111. statusOptions:[],
  112. // 遮罩层
  113. loading: true,
  114. // 选中数组
  115. ids: [],
  116. // 非单个禁用
  117. single: true,
  118. // 非多个禁用
  119. multiple: true,
  120. // 显示搜索条件
  121. showSearch: true,
  122. // 总条数
  123. total: 0,
  124. dateRange: [],
  125. // 提现表格数据
  126. companyProfitList: [],
  127. // 弹出层标题
  128. title: "",
  129. // 是否显示弹出层
  130. open: false,
  131. // 查询参数
  132. queryParams: {
  133. pageNum: 1,
  134. pageSize: 10,
  135. companyId: null,
  136. bankName: null,
  137. bankBranchName: null,
  138. bankCardNo: null,
  139. bankUserName: null,
  140. money: null,
  141. balances: null,
  142. profitStatus: null,
  143. profitType: null,
  144. },
  145. // 表单参数
  146. form: {},
  147. // 表单校验
  148. rules: {
  149. companyId: [
  150. { required: true, message: "公司ID不能为空", trigger: "blur" }
  151. ],
  152. profitStatus: [
  153. { required: true, message: "提现状态不能为空", trigger: "blur" }
  154. ],
  155. }
  156. };
  157. },
  158. created() {
  159. this.getDicts("company_profit_status").then((response) => {
  160. this.statusOptions = response.data;
  161. });
  162. getCompanyList().then(response => {
  163. this.companys = response.data;
  164. });
  165. this.getList();
  166. },
  167. methods: {
  168. handleShow(row){
  169. this.show.open=true;
  170. this.show.open=true;
  171. const profitId = row.profitId ;
  172. setTimeout(() => {
  173. this.$refs.profit.getData(row.companyName,profitId);
  174. }, 500);
  175. },
  176. /** 查询提现列表 */
  177. getList() {
  178. this.loading = true;
  179. listCompanyProfit(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
  180. this.companyProfitList = response.rows;
  181. this.total = response.total;
  182. this.loading = false;
  183. });
  184. },
  185. // 取消按钮
  186. cancel() {
  187. this.open = false;
  188. this.reset();
  189. },
  190. // 表单重置
  191. reset() {
  192. this.form = {
  193. profitId: null,
  194. companyId: null,
  195. bankName: null,
  196. bankBranchName: null,
  197. bankCardNo: null,
  198. bankUserName: null,
  199. money: null,
  200. balances: null,
  201. profitStatus:1,
  202. profitType: null,
  203. remark: null,
  204. createTime: null,
  205. updateTime: null
  206. };
  207. this.resetForm("form");
  208. },
  209. /** 搜索按钮操作 */
  210. handleQuery() {
  211. this.queryParams.pageNum = 1;
  212. this.getList();
  213. },
  214. /** 重置按钮操作 */
  215. resetQuery() {
  216. this.resetForm("queryForm");
  217. this.handleQuery();
  218. },
  219. // 多选框选中数据
  220. handleSelectionChange(selection) {
  221. this.ids = selection.map(item => item.profitId)
  222. this.single = selection.length!==1
  223. this.multiple = !selection.length
  224. },
  225. /** 导出按钮操作 */
  226. handleExport() {
  227. const queryParams = this.queryParams;
  228. this.$confirm('是否确认导出所有提现数据项?', "警告", {
  229. confirmButtonText: "确定",
  230. cancelButtonText: "取消",
  231. type: "warning"
  232. }).then(function() {
  233. return exportCompanyProfit(queryParams);
  234. }).then(response => {
  235. this.download(response.msg);
  236. }).catch(function() {});
  237. }
  238. }
  239. };
  240. </script>