index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  1. <template>
  2. <div class="app-container withdrawalApp-table" :style="{'--q-height':qHeight}">
  3. <div class="app-container-query" ref="queryFormBox">
  4. <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
  5. <el-form-item label="分销商名称">
  6. <el-input
  7. v-model="queryParams.personName"
  8. placeholder="请输入分销商名称"
  9. clearable
  10. style="width: 220px;"
  11. @keyup.enter.native="handleQuery"
  12. />
  13. </el-form-item>
  14. <el-form-item label="真实名称">
  15. <el-input
  16. v-model="queryParams.salePerson"
  17. placeholder="请输入真实名称"
  18. clearable
  19. style="width: 220px;"
  20. @keyup.enter.native="handleQuery"
  21. />
  22. </el-form-item>
  23. <el-form-item label="打款状态">
  24. <el-select
  25. v-model="queryParams.voucherStatus"
  26. placeholder="打款状态"
  27. clearable
  28. style="width: 140px"
  29. >
  30. <el-option
  31. v-for="dict in statusList"
  32. :key="dict.value"
  33. :label="dict.name"
  34. :value="dict.value"
  35. />
  36. </el-select>
  37. </el-form-item>
  38. <el-form-item label="申请时间">
  39. <el-date-picker
  40. style="width: 240px"
  41. v-model="dateRange"
  42. type="daterange"
  43. value-format="yyyy-MM-dd"
  44. range-separator="至"
  45. start-placeholder="开始日期"
  46. end-placeholder="结束日期">
  47. </el-date-picker>
  48. </el-form-item>
  49. <el-form-item>
  50. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  51. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  52. </el-form-item>
  53. </el-form>
  54. </div>
  55. <div class="app-container-table-box">
  56. <el-row :gutter="10" class="mb8">
  57. <el-col :span="3">
  58. <el-button
  59. type="primary"
  60. size="mini"
  61. icon="el-icon-download"
  62. @click="handleExport"
  63. v-hasPermi="['withdrawalApp:export']"
  64. v-loading.fullscreen.lock="handleExportLoading"
  65. element-loading-text="正在拼命生成数据中..."
  66. element-loading-spinner="el-icon-loading"
  67. element-loading-background="rgba(0, 0, 0, 0.5)"
  68. >导出excel</el-button>
  69. </el-col>
  70. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  71. </el-row>
  72. <div class="app-container-table-info">
  73. <el-table ref="tables" v-loading="loading" height="100%" :data="dataList" border>
  74. <el-table-column label="序号" align="center" type="index" width="50"></el-table-column>
  75. <el-table-column label="分销商名称" align="center" prop="personName" width="100" />
  76. <el-table-column label="分销商类型" align="center" prop="type" width="100" >
  77. <template slot-scope="scope">
  78. <dict-tag :options="dict.type.distribution_type" :value="scope.row.personType"/>
  79. </template>
  80. </el-table-column>
  81. <el-table-column label="真实姓名" align="center" prop="realName" />
  82. <el-table-column label="开户行" align="center" prop="bankName" />
  83. <el-table-column label="银行卡号" align="center" prop="bankNo" />
  84. <el-table-column label="申请金额" align="center" prop="realPrice" />
  85. <el-table-column label="申请时间" align="center" prop="createTime" width="160" />
  86. <el-table-column label="打款状态" align="center" prop="voucherStatus">
  87. <template slot-scope="scope">
  88. {{ scope.row.voucherStatus === 1 ? '已打款':'未打款' }}
  89. </template>
  90. </el-table-column>
  91. <el-table-column label="打款凭证" align="center" prop="voucherImg" >
  92. <template slot-scope="scope">
  93. <el-button type="text" @click="seeCenter(scope.row, 'img')">查看</el-button>
  94. </template>
  95. </el-table-column>
  96. <el-table-column label="备注" align="center" prop="remark" />
  97. <el-table-column label="提现到账时间" align="center" prop="queryTime" width="160" />
  98. <el-table-column label="操作人" align="center" prop="auditUserName" />
  99. <el-table-column label="操作" align="center" width="180" fixed="right" class-name="small-padding fixed-width">
  100. <template slot-scope="scope">
  101. <!-- <el-button
  102. size="mini"
  103. type="text"
  104. @click="handleUpdate(scope.row)"
  105. v-hasPermi="['withdrawalApp:withdrawalApp:edit']"
  106. >修改</el-button> -->
  107. <el-button
  108. size="mini"
  109. type="text"
  110. v-if="scope.row.voucherStatus === 0"
  111. @click="withdrawImgAudit(scope.row)"
  112. v-hasPermi="['withdrawalApp:add']"
  113. >上传打款凭证</el-button>
  114. <el-button
  115. size="mini"
  116. type="text"
  117. v-if="scope.row.voucherStatus === 1"
  118. @click="withdrawImgAudit(scope.row)"
  119. v-hasPermi="['withdrawalApp:edit']"
  120. >修改打款凭证</el-button>
  121. </template>
  122. </el-table-column>
  123. </el-table>
  124. <pagination
  125. v-show="total>0"
  126. :total="total"
  127. :page.sync="queryParams.pageNum"
  128. :limit.sync="queryParams.pageSize"
  129. @pagination="getList"
  130. />
  131. </div>
  132. </div>
  133. <!-- 修改凭证 -->
  134. <imgAduit ref="imgAduit" @getList="getList" />
  135. <el-dialog
  136. title="查看凭证"
  137. :visible.sync="visibleStatus"
  138. width="600px"
  139. :destroy-on-close="true"
  140. :close-on-click-modal="false"
  141. >
  142. <div v-if="visibleType == 'img'">
  143. <el-image
  144. style="width: 260px; height: 100%;margin: 0 5px;"
  145. v-for="(item, index) in newObj.contractImgList"
  146. :key="index"
  147. :src="item"
  148. :preview-src-list="newObj.contractImgList"
  149. fit="cover"
  150. />
  151. </div>
  152. <!-- <div v-if="visibleType == 'html'">
  153. <div v-html="newObj.centent"></div>
  154. </div> -->
  155. <div slot="footer" class="dialog-footer">
  156. <el-button type="primary" @click="visibleStatus = false">确 定</el-button>
  157. </div>
  158. </el-dialog>
  159. </div>
  160. </template>
  161. <script>
  162. import {
  163. pageList,
  164. downOrderListXls
  165. } from '@/api/distribution/Withdrawl'
  166. import imgAduit from "./dialog/imgAduit.vue";
  167. import { exportExcel } from '@/utils/exportexcel'
  168. // import html2canvas from 'html2canvas'
  169. export default {
  170. name: "WithdrawalApp",
  171. dicts: ['distribution_type'],
  172. components: { imgAduit },
  173. data() {
  174. return {
  175. qHeight: '0px',
  176. resizeObserver: null,
  177. // 遮罩层
  178. loading: true,
  179. // 选中数组
  180. ids: [],
  181. // 非单个禁用
  182. single: true,
  183. // 非多个禁用
  184. multiple: true,
  185. // 显示搜索条件
  186. showSearch: true,
  187. // 总条数
  188. total: 0,
  189. // 用户表格数据
  190. dataList: null,
  191. // 弹出层标题
  192. title: "",
  193. // 是否显示弹出层
  194. open: false,
  195. // 日期范围
  196. dateRange: [],
  197. // 查询参数
  198. queryParams: {
  199. pageNum: 1,
  200. pageSize: 10,
  201. // type: undefined
  202. },
  203. statusList: [
  204. {id: 1, name: '未打款', value: 0},
  205. {id: 2, name: '已打款', value: 1},
  206. ],
  207. handleExportLoading: false,
  208. visibleStatus: false,
  209. newObj: {},
  210. visibleType: ''
  211. };
  212. },
  213. created() {
  214. this.getList();
  215. },
  216. mounted() {
  217. this.resizeObserver = new ResizeObserver(entries => {
  218. for (let entry of entries) {
  219. const { width, height } = entry.contentRect;
  220. this.qHeight = height + 'px'
  221. }
  222. });
  223. this.resizeObserver.observe(this.$refs.queryFormBox);
  224. },
  225. methods: {
  226. /** 查询列表 */
  227. getList() {
  228. this.dataList = []
  229. this.loading = true;
  230. if(this.dateRange && this.dateRange.length > 0){
  231. this.queryParams.beginDate = this.dateRange[0];
  232. this.queryParams.endDate = this.dateRange[1];
  233. } else {
  234. if(this.queryParams.beginDate) {
  235. delete this.queryParams.beginDate
  236. delete this.queryParams.endDate
  237. }
  238. }
  239. pageList(this.queryParams)
  240. .then(response => {
  241. let list = response.data.rows
  242. list.forEach(item =>{
  243. item.switchValue = item.status;
  244. })
  245. this.dataList = list
  246. this.total = response.data.total;
  247. this.loading = false;
  248. }
  249. ).catch(()=>{
  250. this.dataList = []
  251. this.loading = false;
  252. })
  253. },
  254. // 打款凭证
  255. withdrawImgAudit(row) {
  256. this.$refs["imgAduit"].openDialog("打款凭证", row);
  257. },
  258. /** 查看 */
  259. seeCenter(obj, type) {
  260. this.visibleStatus = true
  261. this.visibleType = type;
  262. this.newObj = obj;
  263. if(obj.voucherImg){
  264. this.newObj.contractImgList = obj.voucherImg.split(',')
  265. }
  266. },
  267. // 取消按钮
  268. cancel() {
  269. this.open = false;
  270. },
  271. /** 搜索按钮操作 */
  272. handleQuery() {
  273. this.queryParams.pageNum = 1;
  274. this.getList();
  275. },
  276. /** 重置按钮操作 */
  277. resetQuery() {
  278. this.dateRange = [];
  279. this.$set(this.queryParams, 'personName', '');
  280. // this.$set(this.queryParams, 'time', []);
  281. this.$set(this.queryParams, 'voucherStatus', '');
  282. this.$set(this.queryParams, 'salePerson', '');
  283. this.queryParams.pageNum = 1;
  284. this.handleQuery();
  285. },
  286. // 导出报表
  287. handleExport() {
  288. this.$confirm('您确定要导出当前查询的数据吗?', '提示', {
  289. confirmButtonText: '确定 ',
  290. cancelButtonText: '取消 ',
  291. type: 'warning'
  292. })
  293. .then(() => {
  294. this.handleExportLoading = true;
  295. // const { pageNum, pageSize} = this.params;
  296. let postMap = {}
  297. if(this.dateRange && this.dateRange.length > 0){
  298. this.queryParams.beginDate = this.dateRange[0];
  299. this.queryParams.endDate = this.dateRange[1];
  300. } else {
  301. if(this.queryParams.beginDate){
  302. delete this.queryParams.beginDate
  303. delete this.queryParams.endDate
  304. }
  305. }
  306. let params = JSON.parse(JSON.stringify(this.queryParams))
  307. for (let key in params) {
  308. if(key != 'pageNum' && key != 'pageSize' && key != 'time' && key != 'personName' && key != 'salePerson' && key != 'voucherStatus'){
  309. postMap[key] = params[key]
  310. }
  311. }
  312. downOrderListXls(postMap)
  313. .then((res) => {
  314. exportExcel(res, '提现申请', '.xlsx');
  315. this.handleExportLoading = false;
  316. })
  317. .catch((error) => {
  318. // console.log("error===",error)
  319. this.handleExportLoading = false;
  320. });
  321. })
  322. .catch(() => {
  323. this.$message.info('您已取消导出!');
  324. });
  325. },
  326. },
  327. beforeDestroy() {
  328. this.resizeObserver.unobserve(this.$refs.queryFormBox);
  329. this.resizeObserver.disconnect();
  330. },
  331. };
  332. </script>
  333. <style lang="scss" scoped>
  334. .app-container {
  335. height: calc( 100vh - 110px );
  336. box-sizing: border-box;
  337. }
  338. .app-container-table-box {
  339. height: calc( 100% - var(--q-height) );
  340. .app-container-table-info {
  341. height: calc( 100% - 100px );
  342. }
  343. }
  344. </style>