WithdrawalProceduresPending.vue 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. <template>
  2. <div>
  3. <el-main ref="elMain" style="padding: 0px;">
  4. <el-row>
  5. <el-form
  6. :inline="true"
  7. :model="queryForm"
  8. class="demo-form-inline"
  9. label-width="130px"
  10. size="small"
  11. >
  12. <el-form-item label="业务员工号">
  13. <el-input v-model="queryForm.userId" placeholder="业务员工号" clearable></el-input>
  14. </el-form-item>
  15. <el-form-item label="业务员姓名">
  16. <el-input v-model="queryForm.userName" placeholder="业务员姓名" clearable></el-input>
  17. </el-form-item>
  18. <el-form-item label="电话">
  19. <el-input v-model="queryForm.mobile" placeholder="电话" clearable></el-input>
  20. </el-form-item>
  21. <el-form-item label="提现单号">
  22. <el-input v-model="queryForm.id" placeholder="提现单号" clearable></el-input>
  23. </el-form-item>
  24. <el-form-item label="提现时间">
  25. <el-date-picker
  26. v-model="queryForm.date"
  27. type="datetimerange"
  28. range-separator="至"
  29. value-format="yyyy-MM-dd"
  30. start-placeholder="开始日期"
  31. end-placeholder="结束日期">
  32. </el-date-picker>
  33. </el-form-item>
  34. <el-form-item>
  35. <el-button type="primary" size="small" @click="findPage">查询</el-button>
  36. </el-form-item>
  37. </el-form>
  38. </el-row>
  39. <kt-common-table
  40. button2Type="text"
  41. button3Type="text"
  42. :showBatchDelete="false"
  43. :showBatchPrint="true"
  44. permsButton3="sys:withdrawalProceduresPending:examine"
  45. permsButton2="sys:withdrawalProceduresPending:examinepay"
  46. :data="pageResult"
  47. :columns="columns"
  48. @findPage="findPage"
  49. button3Name="审核并支付"
  50. @handleButton3="handleButton3"
  51. button2Name="审核提现"
  52. @handleButton2="handleButton2"
  53. ></kt-common-table>
  54. <el-dialog
  55. :visible.sync="dialogVisibleBatch"
  56. width="35%"
  57. :before-close="handleCloseBatch">
  58. <p >凭证号 :<el-input style="width: 200px;" v-model="voucherId" placeholder="请输入凭证号"></el-input></p>
  59. <div style="display: flex">上传图片: <el-upload
  60. action="#"
  61. :auto-upload="false"
  62. accept=".png, .jpg, .jpeg"
  63. :show-file-list="false"
  64. :on-change="drivingupload">
  65. <img v-if="qrCodeImage" :src="qrCodeImage" class="avatar">
  66. <i v-else class="el-icon-plus avatar-uploader-icon"></i>
  67. </el-upload>
  68. </div>
  69. <span slot="footer" class="dialog-footer">
  70. <el-button size="small" @click="dialogVisibleBatch = false">取 消</el-button>
  71. <el-button size="small" type="primary" @click="handleSumbit()">确 定</el-button>
  72. </span>
  73. </el-dialog>
  74. </el-main>
  75. </div>
  76. </template>
  77. <script>
  78. import Cookies from "js-cookie";
  79. import KtCommonTable from "@/views/Core/KtCommonTable.vue"; //表格组件
  80. import KtButton from "@/views/Core/KtButton";
  81. import CommonUtil from "@/utils/comutil.js";
  82. export default {
  83. components: {
  84. KtCommonTable,
  85. KtButton
  86. },
  87. data() {
  88. return {
  89. dialogVisibleBatch:false,
  90. voucherId:'',
  91. qrCodeImage:'',
  92. picId:'',
  93. rowlist:{},
  94. // 右侧列表查询数据Start
  95. queryForm: {},
  96. pageResult: {},
  97. pageRequest: {
  98. //查询的默认条件
  99. pageNum: 1,
  100. pageSize: 10,
  101. auditingStatus: "2"
  102. },
  103. columns: [
  104. //数据列
  105. { prop: "id", label: "提现单号" },
  106. { prop: "userId", label: "业务员工号" },
  107. { prop: "userName", label: "业务员姓名" },
  108. { prop: "mobile", label: "电话" },
  109. { prop: "deptId", label: "机构代码" },
  110. { prop: "deptName", label: "机构名称" },
  111. { prop: "amount", label: "提现金额" },
  112. { prop: "surplusAmount", label: "账户余额" },
  113. { prop: "bankAddress", label: "开户行" },
  114. { prop: "bankAccount", label: "银行" },
  115. { prop: "bankNumber", label: "账号" },
  116. { prop: "createTime", label: "提现时间" }
  117. ],
  118. };
  119. },
  120. created() {
  121. },
  122. mounted() {},
  123. methods: {
  124. handlePrint(index, row) {
  125. this.$api.task.AmountReview(this.pageRequest).then(res => {
  126. console.log(res);
  127. let blob = new Blob([res], {
  128. type: "application/vnd.ms-excel"
  129. }); // 2.获取请求返回的response对象中的blob 设置文件类型,这里以excel为例
  130. let url = window.URL.createObjectURL(blob); // 3.创建一个临时的url指向blob对象
  131. // 4.创建url之后可以模拟对此文件对象的一系列操作,例如:预览、下载
  132. let a = document.createElement("a");
  133. a.href = url;
  134. a.download = "提现待支付清单.xlsx";
  135. a.click();
  136. // 5.释放这个临时的对象url
  137. window.URL.revokeObjectURL(url);
  138. });
  139. },
  140. // 右侧列表的方法Start
  141. findPage(data) {
  142. // 获取分页数据
  143. let that = this;
  144. if (data && data.pageRequest) {
  145. this.pageRequest.pageNum = data.pageRequest.pageNum;
  146. this.pageRequest.pageSize = data.pageRequest.pageSize;
  147. }
  148. if (this.queryForm.date && this.queryForm.date.length>0) {
  149. this.queryForm.startTime = this.queryForm.date[0];
  150. this.queryForm.endTime = this.queryForm.date[1];
  151. } else {
  152. this.queryForm.startTime = "";
  153. this.queryForm.endTime = "";
  154. }
  155. that.$api.task
  156. .payqueryPage({ ...this.pageRequest, ...this.queryForm,amountStatus:'1' })
  157. .then(res => {
  158. if (res.code == 200) {
  159. that.pageResult = res.data;
  160. }
  161. })
  162. .then(data != null ? data.callback : "");
  163. },
  164. drivingupload(file) {
  165. let fileRaw = file.raw;
  166. this.qrCodeImage = window.URL.createObjectURL(fileRaw);
  167. const params = new FormData(); // 声明formData数据类型
  168. params.append("multipartFile", fileRaw);
  169. params.append("type", "image");
  170. this.$api.letter.uploadFile(params).then(res => {
  171. if (res.code == "200") {
  172. this.picId=res.data.id
  173. } else {
  174. this.$message({ message: res.msg, type: "warning" });
  175. }
  176. });
  177. },
  178. handleSumbit(){
  179. this.$api.task.AmountReview({ ...this.rowlist, status: '1',picId:this.picId,voucherId:this.voucherId }).then(res => {
  180. if (res.code == 200) {
  181. this.dialogVisibleBatch = false
  182. this.findPage();
  183. this.$message({
  184. type: "success",
  185. message: res.msg
  186. });
  187. }
  188. else {
  189. this.$message.error(res.msg)
  190. }
  191. })
  192. },
  193. handleButton2({ row, index }) {
  194. this.dialogVisibleBatch=true
  195. this.rowlist=row
  196. this.picId=''
  197. this.voucherId=''
  198. // this.$api.task.AmountReview(row).then(res => {
  199. // if (res.code == 200) {
  200. // this.$message({
  201. // type: "success",
  202. // message: res.msg
  203. // });
  204. // this.findPage();
  205. // }
  206. // });
  207. },
  208. handleButton3({ row, index }) {
  209. let auditid = Cookies.get("user"); // 放置token到Cookie
  210. let auditname = Cookies.get("name"); // 放置token到Cookie
  211. this.$confirm("是否确认审核并线下支付?", "提示", {})
  212. .then(() => {
  213. var data = {
  214. applyno: row.applyno,
  215. applystatus: "2",
  216. auditid: auditid,
  217. auditname: auditname,
  218. paytime: this.formatTime(new Date().getTime(), "Y-M-D h:m:s")
  219. };
  220. this.$api.task.insPayApplyAudit(data).then(res => {
  221. this.dialogVisible = false;
  222. this.findPage(null);
  223. this.$message({
  224. type: "success",
  225. message: "已提交"
  226. });
  227. });
  228. })
  229. .catch(() => {
  230. this.$message({
  231. type: "info",
  232. message: "已取消审核"
  233. });
  234. });
  235. },
  236. // 格式化日期,如月、日、时、分、秒保证为2位数
  237. formatNumber(n) {
  238. n = n.toString();
  239. return n[1] ? n : "0" + n;
  240. },
  241. // 参数number为毫秒时间戳,format为需要转换成的日期格式
  242. formatTime(number, format) {
  243. let time = new Date(number);
  244. let newArr = [];
  245. let formatArr = ["Y", "M", "D", "h", "m", "s"];
  246. newArr.push(time.getFullYear());
  247. newArr.push(this.formatNumber(time.getMonth() + 1));
  248. newArr.push(this.formatNumber(time.getDate()));
  249. newArr.push(this.formatNumber(time.getHours()));
  250. newArr.push(this.formatNumber(time.getMinutes()));
  251. newArr.push(this.formatNumber(time.getSeconds()));
  252. for (let i in newArr) {
  253. format = format.replace(formatArr[i], newArr[i]);
  254. }
  255. return format;
  256. }
  257. }
  258. };
  259. </script>
  260. <style scoped>
  261. .avatar-uploader .el-upload {
  262. border: 1px dashed #d9d9d9;
  263. border-radius: 6px;
  264. cursor: pointer;
  265. position: relative;
  266. overflow: hidden;
  267. }
  268. .avatar-uploader-icon {
  269. font-size: 28px;
  270. color: #8c939d;
  271. width: 150px;
  272. height: 150px;
  273. line-height: 150px;
  274. text-align: center;
  275. border: 1px dashed #d9d9d9;
  276. }
  277. .avatar {
  278. border: 1px dashed #d9d9d9;
  279. padding: 5px;
  280. border-radius: 6px;
  281. width: 150px;
  282. height: 150px;
  283. display: block;
  284. }
  285. </style>