qingtuanbao.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358
  1. <template>
  2. <el-tabs v-model="activeTabName" type="border-card">
  3. <el-tab-pane label="青团宝结算订单" name="first">
  4. <div id="cloud-job">
  5. <div class="title">
  6. <el-form label-width="180px">
  7. <el-form-item label="已结算总金额(税后):">{{titleInfo.totalSuccessPay}}元</el-form-item>
  8. <el-form-item label="已提现总金额(税后):">{{titleInfo.totalDraw}}元</el-form-item>
  9. <el-form-item label="待提现总额(税后):">{{titleInfo.totalWaitDraw}}元</el-form-item>
  10. </el-form>
  11. </div>
  12. <div class="table">
  13. <el-table v-if="tableData.length" border stripe style="width: 100%" :data="tableData">
  14. <el-table-column
  15. v-for="(prop, index) of tableProps"
  16. :key="index"
  17. :prop="prop"
  18. :label="tableHeaders[index]"
  19. >
  20. <template slot-scope="scope">
  21. <a
  22. class="lblue point"
  23. v-if="prop === 'projectName'"
  24. :href="scope.row | projectLink"
  25. target="_blank"
  26. >{{scope.row[prop]}}</a>
  27. <a
  28. class="lblue point"
  29. v-else-if="prop === 'nickname'"
  30. @click="clickDev(scope.row.uid)"
  31. target="_blank"
  32. >{{scope.row[prop]}}</a>
  33. <span class="lblue point" v-else-if="prop === 'order_no'">
  34. <nuxt-link
  35. :to="{path:'/main/orders_detail?id='+scope.row.order_no}"
  36. >{{scope.row.order_no}}</nuxt-link>
  37. </span>
  38. <span v-else>{{scope.row[prop]}}</span>
  39. </template>
  40. </el-table-column>
  41. </el-table>
  42. </div>
  43. <el-pagination
  44. @current-change="changePagination"
  45. :current-page.sync="currentPage"
  46. :page-size="10"
  47. layout="total, prev, pager, next"
  48. :total="totalCount"
  49. ></el-pagination>
  50. </div>
  51. </el-tab-pane>
  52. <el-tab-pane label="青团宝提现订单" name="second">
  53. <div id="cloud-job">
  54. <div class="title">
  55. <el-form label-width="230px">
  56. <el-form-item label="青团宝企业账户可用余额:">{{drawData.accountBalance.money}}元</el-form-item>
  57. <el-form-item label="待管理员确认支付金额(税前):">{{drawData.totalWaitConfirmTax/100}}元</el-form-item>
  58. <el-form-item label="青团宝正在付款中(税前):">{{drawData.totalPayingTax/100}}元</el-form-item>
  59. <el-form-item label="成功提现总金额(税前):">{{drawData.totalSuccessTax/100}}元</el-form-item>
  60. <el-form-item label="成功提现总金额(税后):">{{drawData.totalSuccess/100}}元</el-form-item>
  61. </el-form>
  62. </div>
  63. <div class="table">
  64. <el-table
  65. v-if="drawData.list.length"
  66. border
  67. stripe
  68. style="width: 100%"
  69. :data="drawData.list"
  70. >
  71. <el-table-column prop="order_no" label="订单号">
  72. <template slot-scope="scope">
  73. <span class="lblue point">
  74. <nuxt-link
  75. target="_blank"
  76. :to="{path:'/main/orders_detail?id='+scope.row.order_no}"
  77. >{{scope.row.order_no}}</nuxt-link>
  78. </span>
  79. </template>
  80. </el-table-column>
  81. <el-table-column label="用户ID" width="66">
  82. <template slot-scope="scope">
  83. <span class="lblue point" @click="clickDev(scope.row.uid)">{{ scope.row.uid }}</span>
  84. </template>
  85. </el-table-column>
  86. <el-table-column label="真实姓名" width="70">
  87. <template slot-scope="scope">
  88. <span
  89. class="lblue point"
  90. @click="clickDev(scope.row.uid)"
  91. >{{ scope.row.userInfo.realname }}</span>
  92. </template>
  93. </el-table-column>
  94. <el-table-column prop="origin_amount" label="税前金额" width="70"></el-table-column>
  95. <el-table-column prop="real_amount" label="提现金额" width="70"></el-table-column>
  96. <el-table-column prop="true_amount" label="到账金额" width="70"></el-table-column>
  97. <el-table-column prop="after_amount" label="薪资余额"></el-table-column>
  98. <el-table-column prop="account" label="到账账户"></el-table-column>
  99. <el-table-column label="提现时间" width="120">
  100. <template slot-scope="scope">
  101. <span>{{ scope.row.taken_at }}</span>
  102. </template>
  103. </el-table-column>
  104. <el-table-column label="到账时间" width="120">
  105. <template slot-scope="scope">
  106. <span>{{ scope.row.paid_at }}</span>
  107. </template>
  108. </el-table-column>
  109. <el-table-column prop="extra" label="系统备注"></el-table-column>
  110. <el-table-column label="内部状态">
  111. <template slot-scope="scope">
  112. <span v-if="scope.row.status==1">待确认</span>
  113. <span v-else-if="scope.row.status==2">支付中</span>
  114. <span v-else-if="scope.row.status==4">支付中</span>
  115. <span v-else-if="scope.row.status==8">支付成功</span>
  116. <span v-else-if="scope.row.status==16">支付失败</span>
  117. <span v-else>--</span>
  118. </template>
  119. </el-table-column>
  120. <el-table-column label="操作" width="100">
  121. <template slot-scope="scope">
  122. <div v-if="scope.row.order_type_id == 0">
  123. <span v-if="scope.row.status==1" @click="confirmPay(scope.row)">
  124. <el-button type="primary" size="mini">确认付款</el-button>
  125. </span>
  126. <span v-else-if="scope.row.status==16" @click="confirmPay(scope.row)">
  127. <el-button type="primary" size="mini">失败重试</el-button>
  128. </span>
  129. <span v-else></span>
  130. </div>
  131. <div v-else>
  132. <span>领薪宝订单</span>
  133. </div>
  134. </template>
  135. </el-table-column>
  136. <el-table-column label="外部备注">
  137. <template slot-scope="scope">
  138. <span>{{scope.row.orderInfo.public_comment}}</span>
  139. </template>
  140. </el-table-column>
  141. </el-table>
  142. </div>
  143. <el-pagination
  144. @current-change="changePaginationDraw"
  145. :current-page.sync="currentDrawPage"
  146. :page-size="10"
  147. layout="total, prev, pager, next"
  148. :total="totalDrawCount"
  149. ></el-pagination>
  150. </div>
  151. </el-tab-pane>
  152. </el-tabs>
  153. </template>
  154. <script>
  155. const tableHeaders = [
  156. "项目名称",
  157. "付款类型",
  158. "用户昵称",
  159. "税前应付(项目)",
  160. "平台服务费",
  161. "所得税费",
  162. "开发者净收入",
  163. "本次应付",
  164. "实际到账",
  165. "结算时间",
  166. "订单号"
  167. ];
  168. const tableProps = [
  169. "projectName",
  170. "payTypeShow",
  171. "nickname",
  172. "prePay",
  173. "servicePay",
  174. "getPay",
  175. "realGet",
  176. "current_gongmall",
  177. "amount",
  178. "pay_timeShow",
  179. "order_no"
  180. ];
  181. export default {
  182. data() {
  183. return {
  184. activeTabName: "first",
  185. // 头部信息
  186. titleInfo: {},
  187. // 数据总条目
  188. totalCount: 0,
  189. totalDrawCount: 0,
  190. // 当前页面
  191. currentPage: 1,
  192. currentDrawPage: 1,
  193. totalDrawPage: 1,
  194. totalPage: 1,
  195. // 列表头显示内容
  196. tableHeaders,
  197. // 列表头字段
  198. tableProps,
  199. // 列表数据
  200. tableData: [],
  201. drawData: {
  202. accountBalance: {},
  203. list: []
  204. }
  205. };
  206. },
  207. mounted() {
  208. this.getTableData();
  209. this.getDrawData();
  210. },
  211. filters: {
  212. toDate(val) {
  213. return new Date(val * 1000).toLocaleDateString();
  214. },
  215. projectLink(i) {
  216. const type = i.entity_type;
  217. let link = "javascript:void(0);";
  218. if (type === "1")
  219. link =
  220. this.$store.state.domainConfig.siteUrl +
  221. `/rooter/outsourceitem/${i.entity_id}>`;
  222. else if (type === "3")
  223. link =
  224. this.$store.state.domainConfig.siteUrl +
  225. `/rooter/wagedetails?job_id=${i.entity_id}`;
  226. return link;
  227. }
  228. },
  229. methods: {
  230. // 重新支付
  231. async rePay(i) {
  232. const res = await this.$post("/api/admin/payment/redoSalaryDraw", {
  233. id: i.id
  234. });
  235. if (res) {
  236. this.getDrawData();
  237. }
  238. },
  239. // 确认支付
  240. confirmPay(i) {
  241. this.rePay(i);
  242. },
  243. // 页码变动
  244. changePagination() {
  245. this.getTableData();
  246. },
  247. // 页码变动
  248. changePaginationDraw() {
  249. this.getDrawData();
  250. },
  251. // 格式化列表数据
  252. formatTableData(data, rData) {
  253. console.log("formatTableData++++++++++++++++");
  254. console.log(data);
  255. console.log(rData);
  256. this.titleInfo = {
  257. totalDraw: rData.totalDraw ? rData.totalDraw / 100 : "--",
  258. totalWaitDraw: rData.totalWaitDraw ? rData.totalWaitDraw / 100 : "--",
  259. totalSuccessPay: rData.totalSuccessPay
  260. ? rData.totalSuccessPay / 100
  261. : "--"
  262. };
  263. return data.map(i => {
  264. let projectName = "--";
  265. let prePay = "";
  266. let servicePay = "";
  267. let getPay = "";
  268. let realGet = "";
  269. let d = new Date();
  270. let payTimeShow = "--";
  271. if (i.pay_time > 0) {
  272. d.setTime(i.pay_time + "000");
  273. payTimeShow =
  274. d.getFullYear() +
  275. "-" +
  276. (d.getMonth() + 1) +
  277. "-" +
  278. d.getDate() +
  279. " " +
  280. d.getHours() +
  281. ":" +
  282. d.getMinutes();
  283. }
  284. // 3 比较特殊,所以这样写
  285. projectName = i.pro_name;
  286. prePay = i.origin_price;
  287. servicePay = i.person_platform_fee;
  288. getPay = i.total_person_tax_fee;
  289. realGet = i.developer_fee;
  290. return {
  291. ...i,
  292. projectName,
  293. payTypeShow: i.pay_type === "1" ? "首付款" : "解冻款",
  294. prePay,
  295. servicePay,
  296. getPay,
  297. realGet,
  298. pay_timeShow: payTimeShow
  299. };
  300. });
  301. },
  302. // 点击开发者
  303. clickDev(uid) {
  304. window.open(
  305. this.$store.state.domainConfig.siteUrl + `/rooter/user/${uid}`
  306. );
  307. },
  308. // 获取列表数据
  309. async getTableData() {
  310. this.tableData = [];
  311. const p = this.currentPage;
  312. const res = await this.$post("/api/admin/payment/qingtuanbaoOrders", {
  313. p
  314. });
  315. // console.log(res)
  316. const data = res.data;
  317. const list = data.list;
  318. this.tableData = this.formatTableData(list, data);
  319. this.totalCount = Number(data.total);
  320. this.totalPage = data.totalPage;
  321. },
  322. // 获取列表数据
  323. async getDrawData() {
  324. const p = this.currentDrawPage;
  325. const res = await this.$post("/api/admin/payment/listSalaryDraw", {
  326. p
  327. });
  328. console.log("getDrawData+++++++");
  329. const data = res.data;
  330. this.drawData = data;
  331. console.log(this.drawData);
  332. this.totalDrawCount = Number(data.total);
  333. this.totalDrawPage = data.totalPage;
  334. }
  335. }
  336. };
  337. </script>
  338. <style scoped>
  339. .table {
  340. height: calc(100% - 80px);
  341. line-height: 1.5;
  342. }
  343. .el-form-item {
  344. margin-bottom: 0;
  345. }
  346. .el-form:last-child {
  347. margin-bottom: 22px;
  348. }
  349. .el-table td,
  350. .el-table th {
  351. padding: 4px 0;
  352. }
  353. </style>