cash.php 56 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191
  1. <?php
  2. use common\helpers\ComponentHelper;
  3. ComponentHelper::loadComponentView('com-export-dialog');
  4. ?>
  5. <div id="app" v-cloak>
  6. <el-card shadow="never" style="border:0;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  7. <div slot="header">
  8. <div class="header-box">
  9. <span>提现审核</span>
  10. <div style="float: right; margin: -10px 10px;">
  11. <el-button type="primary" size="small" @click="handle('open', 1)">批量审核</el-button>
  12. <el-button type="primary" size="small" @click="handle('open', 2)">批量打款</el-button>
  13. </div>
  14. <div style="float: right; margin: -5px 0">
  15. <com-export-dialog style="float: right;margin-top: -5px" :field_list='export_list' :action_url="export_url" :params="search">
  16. </com-export-dialog>
  17. </div>
  18. </div>
  19. <div class="el-card is-never-shadow" style="border: 0px; min-width: 800px; margin-bottom: 10px;">
  20. <div class="stat_details">
  21. <div class="order_module" v-for="(item, index) in statistic" :key="item.title">
  22. <div class="oirder_modul_title">
  23. <div class="text">{{ item.title }}</div>
  24. </div>
  25. <div class="price">
  26. {{ item.value }}
  27. </div>
  28. </div>
  29. </div>
  30. </div>
  31. </div>
  32. <div class="content">
  33. <el-form ref="form" :inline="true" :model="search" label-width="0px">
  34. <el-form-item label="">
  35. <el-input size="small" placeholder="请输入会员id" v-model="search.user_id" clearable></el-input>
  36. </el-form-item>
  37. <el-form-item label="">
  38. <el-input size="small" placeholder="会员昵称/手机号" v-model="search.keyword" clearable></el-input>
  39. </el-form-item>
  40. <el-form-item>
  41. <!--因为提现方式由后台配置。所以这里不能写死,要渲染后台数据-->
  42. <el-select size="small" v-model="search.withdraw_type" clearable placeholder="提现方式" @change='handleClick' class="select">
  43. <el-option :key="index" v-for="(item, index) in DefaultWithDrawWayMap" :label="item" :value="index"></el-option>
  44. </el-select>
  45. </el-form-item>
  46. <el-form-item>
  47. <el-select size="small" v-model="search.withdraw_from" placeholder="提现类型" @change='handleClick' class="select">
  48. <el-option
  49. v-for="item in withdraw_from_list"
  50. :key="item.key"
  51. :label="item.label"
  52. :value="item.value">
  53. </el-option>
  54. </el-select>
  55. </el-form-item>
  56. <el-form-item>
  57. <el-date-picker
  58. size="small"
  59. v-model="date"
  60. type="datetimerange"
  61. value-format="yyyy-MM-dd HH:mm:ss"
  62. range-separator="至"
  63. start-placeholder="开始日期"
  64. @change="selectDateTime"
  65. end-placeholder="结束日期"
  66. >
  67. </el-date-picker>
  68. </el-form-item>
  69. <el-form-item>
  70. <el-button type="primary" size="small" icon="el-icon-search" @click="handleClick" class="search_button">搜索</el-button>
  71. </el-form-item>
  72. </el-form>
  73. <el-tabs v-model="activeName" @tab-click="handleClick">
  74. <el-tab-pane label="全部" name="-1"></el-tab-pane>
  75. <el-tab-pane label="未审核" name="0"></el-tab-pane>
  76. <el-tab-pane label="待打款" name="1"></el-tab-pane>
  77. <el-tab-pane label="打款中" name="5"></el-tab-pane>
  78. <el-tab-pane label="已打款" name="2"></el-tab-pane>
  79. <el-tab-pane label="驳回" name="3"></el-tab-pane>
  80. <div class="table-body">
  81. <div v-if="activeName == 1">
  82. <el-button type="primary" v-if="alipay.alitopay_switch" size="mini" @click="alitopayBatch">
  83. 支付宝批量
  84. </el-button>
  85. <el-button type="primary" v-if="alipay.avoidtax_switch" size="mini" @click="avoidtaxBatch" style="background-color: #189794">
  86. 合规批量
  87. </el-button>
  88. </div>
  89. <el-table :data="list" size="small" stripe @selection-change="handleSelectionChange" v-loading="loading" style="margin-bottom: 15px">
  90. <el-table-column type="selection" align="center" width="60"></el-table-column>
  91. <el-table-column prop="id" label="ID" min-width="60" align="center"></el-table-column>
  92. <el-table-column prop="user.id" label="会员ID" min-width="100" align="center"></el-table-column>
  93. <el-table-column label="基本信息" min-width="180">
  94. <template slot-scope="scope">
  95. <div class="table-info-img-text">
  96. <el-image class="table-info-img circle" :src="scope.row.user.avatar">
  97. <div slot="error" class="image-slot">
  98. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  99. </div>
  100. </el-image>
  101. <div class="table-info-text">
  102. <div v-if="scope.row.user.nickname">{{scope.row.user.nickname}}</div>
  103. <div>{{scope.row.user.mobile}}</div>
  104. <div>{{scope.row.user.avatar_url}}</div>
  105. </div>
  106. </div>
  107. <img src="statics/img/mall/wx.png" v-if="scope.row.user.platform == 'mp-wx'" alt="">
  108. <img src="statics/img/mall/ali.png" v-else-if="scope.row.user.platform == 'mp-ali'" alt="">
  109. <img src="statics/img/mall/toutiao.png" v-else-if="scope.row.user.platform == 'mp-tt'" alt="">
  110. <img src="statics/img/mall/baidu.png" v-else-if="scope.row.user.platform == 'mp-bd'" alt="">
  111. </template>
  112. </el-table-column>
  113. <el-table-column label="提现类型" min-width="130">
  114. <template slot-scope="scope">
  115. <template v-if="scope.row.from == 1">
  116. <div>佣金收益提现</div>
  117. </template>
  118. <template v-if="scope.row.from == 2">
  119. <div>余额提现</div>
  120. </template>
  121. <template v-if="scope.row.from == 3">
  122. <div>货款提现</div>
  123. </template>
  124. <template v-if="scope.row.from == 4">
  125. <div>积分提现</div>
  126. </template>
  127. <template v-if="scope.row.from == 9" >
  128. <div>{{scope.row.from_msg}}</div>
  129. </template>
  130. <template v-if="scope.row.from == 10" >
  131. <div>{{scope.row.from_msg}}</div>
  132. </template>
  133. </template>
  134. </el-table-column>
  135. <el-table-column label="账户信息" min-width="200" align="center">
  136. <template slot-scope="scope">
  137. <template v-if="scope.row.type == 'wechat'">
  138. <div style="text-align: center"> 微信收款码
  139. <br>
  140. <el-image @click.stop="handleClickItem" :src="scope.row.extra.wechat_qrcode" :preview-src-list="[scope.row.extra.wechat_qrcode]" style="height: 80px;width: 80px;">
  141. </el-image>
  142. </div>
  143. </template>
  144. <template v-if="scope.row.type == 'alitopay' || scope.row.type == 'alipay_tax' || scope.row.type == 'alipay_offline' ">
  145. <div>支付宝姓名:{{scope.row.extra.name}}</div>
  146. <div>支付宝账号:{{scope.row.extra.mobile}}</div>
  147. </template>
  148. <template v-if="scope.row.type == 'bank'">
  149. <div>开户人:{{scope.row.extra.name}}</div>
  150. <div>银行卡号:{{scope.row.extra.bank_account}}</div>
  151. <div>开户行:{{scope.row.extra.bank_name}}</div>
  152. <div v-if="scope.row.extra.bank_address">开户行地址:{{scope.row.extra.bank_address}}</div>
  153. <div v-if="scope.row.extra.idcard">身份证:{{scope.row.extra.idcard}}</div>
  154. </template>
  155. <template v-if="scope.row.type == 'yunfast_pay'">
  156. <div>开户人:{{scope.row.extra.name}}</div>
  157. <div>银行卡号:{{scope.row.extra.bank_account}}</div>
  158. </template>
  159. <template v-if="scope.row.type == 'joinpay'">
  160. <div v-if="scope.row.extra.bank_account_type==1">账户类型:对私账户</div>
  161. <div v-if="scope.row.extra.bank_account_type==2">账户类型:对公账户</div>
  162. <div>持卡人:{{scope.row.extra.name}}</div>
  163. <div>银行卡号:{{scope.row.extra.bank_account}}</div>
  164. <div v-if="scope.row.extra.bank_address">开户行地址:{{scope.row.extra.bank_address}}</div>
  165. </template>
  166. <template v-if="scope.row.type == 'digital'">
  167. <div v-if="scope.row.extra.bank_account_type==1">账户类型:银行卡</div>
  168. <div v-if="scope.row.extra.bank_account_type==2">账户类型:支付宝</div>
  169. <div v-if="scope.row.extra.bank_account_type==3">账户类型:微信</div>
  170. <div>姓名:{{scope.row.extra.name}}</div>
  171. <div v-if="scope.row.extra.bank_account_type!=3">
  172. 账号:{{scope.row.extra.bank_account}}
  173. </div>
  174. </template>
  175. <template v-if="scope.row.type == 'bank_tax'">
  176. <div>开户人:{{scope.row.extra.name}}</div>
  177. <div>银行卡号:{{scope.row.extra.bank_account}}</div>
  178. </template>
  179. <template v-if="scope.row.type == 'linggong'">
  180. <div>姓名:{{scope.row.extra.name}}</div>
  181. <div>收款人账号:{{scope.row.extra.bank_account}}</div>
  182. </template>
  183. </template>
  184. </el-table-column>
  185. <el-table-column label="提现信息" min-width="200" align="left">
  186. <template slot-scope="scope">
  187. <div>用户申请提现金额:{{scope.row.cash.price}}元</div>
  188. <div>手续费:{{scope.row.cash.service_fee_rate}}元</div>
  189. <div>转积分扣除:{{scope.row.cash.score_money}}元</div>
  190. <div>转余额扣除:{{scope.row.cash.exchange_balance_num}}元</div>
  191. <div>实际打款金额:<span style="color: #ff4544">{{scope.row.cash.fact_price}}</span>元</div>
  192. </template>
  193. </el-table-column>
  194. <el-table-column label="提现方式" min-width="150" align="left">
  195. <template slot-scope="scope">
  196. <div>{{DefaultWithDrawWayMap[scope.row.type]}}</div>
  197. </template>
  198. </el-table-column>
  199. <el-table-column label="状态" prop="status_text" min-width="120" align="center">
  200. <template slot-scope="scope">
  201. <div v-if="scope.row.status==0">待审核</div>
  202. <div v-if="scope.row.status==1">待打款</div>
  203. <div v-if="scope.row.status==2">已打款</div>
  204. <div v-if="scope.row.status==5">打款中</div>
  205. <div v-if="scope.row.status==3">已驳回</div>
  206. <div v-if="scope.row.status==4">打款失败</div>
  207. </template>
  208. </el-table-column>
  209. <el-table-column label="时间" min-width="200" align="center">
  210. <template slot-scope="scope">
  211. <div>申请时间:{{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}</div>
  212. <div v-if="scope.row.status == 1">审核时间:{{scope.row.updated_at|dateTimeFormat('Y-m-d H:i:s')}}</div>
  213. <div v-if="scope.row.status == 2">打款时间:{{scope.row.updated_at|dateTimeFormat('Y-m-d H:i:s')}}</div>
  214. <div v-if="scope.row.status == 3">驳回时间:{{scope.row.updated_at|dateTimeFormat('Y-m-d H:i:s')}}</div>
  215. </template>
  216. </el-table-column>
  217. <el-table-column label="备注" min-width="200" align="center">
  218. <template slot-scope="scope">
  219. <div v-if="scope.row.status == 1 ">审核备注:{{scope.row.content.validate_content}}<br>打款备注:{{scope.row.content.remit_content}}</div>
  220. <div v-if="scope.row.status == 2">审核备注:{{scope.row.content.validate_content}}<br>打款备注:{{scope.row.content.remit_content}}</div>
  221. <div v-if="scope.row.status == 3">驳回备注:{{scope.row.content.reject_content}}</div>
  222. <div v-if="scope.row.type == 'joinpay'">汇聚备注:{{scope.row.joinpay_msg}}</div>
  223. </template>
  224. </el-table-column>
  225. <el-table-column label="操作" min-width="200" align="center">
  226. <template slot-scope="scope">
  227. <!-- <el-button size="mini" circle class="btn" v-if="scope.row.status == 0" @click="apply(scope.row, 1)">
  228. <el-tooltip class="item" effect="dark" content="同意" placement="top">
  229. <img src="resources/img/mall/pass.png" alt="">
  230. </el-tooltip>
  231. </el-button> -->
  232. <el-button size="mini" circle class="btn" v-if="scope.row.status == 0" @click="openDialogForm(scope.row,1)">
  233. <el-tooltip class="item" effect="dark" content="同意" placement="top">
  234. <img src="resources/img/mall/pass.png" alt="">
  235. </el-tooltip>
  236. </el-button>
  237. <!--支付宝代付打款-->
  238. <el-button size="mini" circle v-if="scope.row.status == 1 && alipay.alitopay_switch && scope.row.type == 'alitopay'" class="btn" @click="alitopayApply(scope.row, 2)">
  239. <el-tooltip class="item" effect="dark" content="支付宝代付" placement="top">
  240. <img width="32px" style="border-radius: 32px;" src="resources/img/mall/alipay_dai.png" alt="">
  241. </el-tooltip>
  242. </el-button>
  243. <!-- 银典代付 -->
  244. <el-button size="mini" circle v-if="scope.row.status == 1 && scope.row.type == 'yunfast_pay'" class="btn" @click="yunfastApply(scope.row, 2)">
  245. <el-tooltip class="item" effect="dark" content="银典代付" placement="top">
  246. <img width="25px" style="border-radius: 32px;" src="resources/img/mall/yunfast_agent.png" alt="">
  247. </el-tooltip>
  248. </el-button>
  249. <!--支付宝合规打款-->
  250. <el-button size="mini" circle v-if="scope.row.status == 1 && alipay.avoidtax_switch && scope.row.type == 'alipay_tax'" class="btn" @click="avoidtaxApply(scope.row, 2)">
  251. <el-tooltip class="item" effect="dark" content="支付宝合规" placement="top">
  252. <img width="32px" style="border-radius: 32px;" src="resources/img/mall/alipay_shui.png" alt="">
  253. </el-tooltip>
  254. </el-button>
  255. <!-- 银行卡打款 -->
  256. <el-button size="mini" circle v-if="scope.row.status == 1 && scope.row.type == 'bank_tax'" class="btn" @click="banktaxApply(scope.row, 2)">
  257. <el-tooltip class="item" effect="dark" content="银企直联" placement="top">
  258. <img width="32px" style="border-radius: 32px;" src="resources/img/mall/alipay_shui.png" alt="">
  259. </el-tooltip>
  260. </el-button>
  261. <!-- <el-button size="mini" circle v-if="scope.row.status == 1 && scope.row.type == 'linggong'" class="btn" @click="linggongApply(scope.row, 2)">
  262. <el-tooltip class="item" effect="dark" content="点薪灵工" placement="top">
  263. <img width="32px" style="border-radius: 32px;" src="resources/img/mall/alipay_shui.png" alt="">
  264. </el-tooltip>
  265. </el-button> -->
  266. <!-- <el-button size="mini" circle v-if="scope.row.status == 1" class="btn" @click="apply(scope.row, 2)">
  267. <el-tooltip class="item" effect="dark" content="打款" placement="top">
  268. <img src="resources/img/mall/pay.png" alt="">
  269. </el-tooltip>
  270. </el-button> -->
  271. <el-button size="mini" circle v-if="scope.row.status == 1 && scope.row.type != 'linggong'" class="btn" @click="openDialogForm(scope.row,2)">
  272. <el-tooltip class="item" effect="dark" content="打款" placement="top">
  273. <img src="resources/img/mall/pay.png" alt="">
  274. </el-tooltip>
  275. </el-button>
  276. <!-- <el-button size="mini" circle style="margin-left: 10px;margin-top: 10px" v-if="scope.row.status < 2" @click="apply(scope.row, 3)">
  277. <el-tooltip class="item" effect="dark" content="拒绝" placement="top">
  278. <img src="resources/img/mall/nopass.png" alt="">
  279. </el-tooltip>
  280. </el-button> -->
  281. <el-button size="mini" circle class="btn" v-if="scope.row.status < 2" @click="openDialogForm(scope.row,3)">
  282. <el-tooltip class="item" effect="dark" content="拒绝" placement="top">
  283. <img src="resources/img/mall/nopass.png" alt="">
  284. </el-tooltip>
  285. </el-button>
  286. </template>
  287. </el-table-column>
  288. </el-table>
  289. <div flex="box:last cross:center">
  290. <div>
  291. <el-pagination v-if="list.length > 0" style="display: inline-block;float: right;" background :page-size="pagination.defaultPageSize" @current-change="pageChange" layout="prev, pager, next" :current-page="pagination.current_page" :total="pagination.totalCount">
  292. </el-pagination>
  293. </div>
  294. </div>
  295. </div>
  296. </el-tabs>
  297. </div>
  298. </el-card>
  299. <el-dialog :close-on-click-modal="false" title="备注信息" :visible.sync="dialogFormVisible" width="20%" center>
  300. <el-form :model="check_form">
  301. <el-form-item label="备注" label-width="100px" required>
  302. <el-col :span="18">
  303. <el-input v-model="check_form.remark" type="textarea" autocomplete="off"></el-input>
  304. </el-col>
  305. </el-form-item>
  306. <el-form-item label="验证码" label-width="100px" required v-if="this.new_status == 2 && this.need_risk">
  307. <el-col :span="10">
  308. <el-input v-model="check_form.verification_code" autocomplete="off" type="number"></el-input>
  309. </el-col>
  310. <el-col :span="2">
  311. <div style="height:10px"></div>
  312. </el-col>
  313. <el-col :span="6">
  314. <el-button @click="getVerificationCode" :disabled="is_disabled">获取验证码</el-button>
  315. </el-col>
  316. </el-form-item>
  317. </el-form>
  318. <div slot="footer" class="dialog-footer">
  319. <el-button @click="closeDialogForm">取 消</el-button>
  320. <el-button type="primary" v-loading="applyLoading" @click="apply()">确 定</el-button>
  321. </div>
  322. </el-dialog>
  323. <el-dialog :close-on-click-modal="false" :title="dialogTitle" :visible.sync="dialogVisible" width="30%">
  324. <el-form :model="batch_cash" label-width="80px">
  325. <el-form-item label="操作">
  326. <el-radio v-model="batch_cash.status" v-if="apply_status == 1" :label="1" border>同意</el-radio>
  327. <el-radio v-model="batch_cash.status" v-if="apply_status == 2" :label="2" border>打款</el-radio>
  328. <el-radio v-model="batch_cash.status" :label="3" border>拒绝</el-radio>
  329. </el-form-item>
  330. <el-form-item label="备注">
  331. <el-input v-model="batch_cash.content"></el-input>
  332. </el-form-item>
  333. </el-form>
  334. <span slot="footer" class="dialog-footer">
  335. <el-button @click="dialogVisible = false">取 消</el-button>
  336. <el-button type="primary" v-loading="dialogLoading" @click="handle(apply_status == 1 ? 'batch_apply' : 'batch_remit', batch_cash)">确 定</el-button>
  337. </span>
  338. </el-dialog>
  339. </div>
  340. <script>
  341. const app = new Vue({
  342. el: '#app',
  343. data() {
  344. return {
  345. dialogFormVisible: false,
  346. dialogVisible: false,
  347. dialogTitle: '批量审核',
  348. export_url: 'mall/finance/cash',
  349. search: {
  350. keyword: '',
  351. status: -1,
  352. user_id: '',
  353. withdraw_type: '',
  354. withdraw_from: '',
  355. date: '',
  356. start_date: '',
  357. end_date: '',
  358. },
  359. multipleSelection: [],
  360. checkedData: undefined,
  361. alipay: {
  362. content: '',
  363. showAlipay: false,
  364. alipay_way: "",
  365. alitopay_switch: false,
  366. avoidtax_switch: false,
  367. },
  368. loading: false,
  369. activeName: '-1',
  370. list: [],
  371. pagination: null,
  372. export_list: [],
  373. user_id: '',
  374. withdraw_type: '',
  375. withdraw_from: '',
  376. keyword: '',
  377. date: '',
  378. start_date: '',
  379. end_date: '',
  380. page: 1,
  381. batch_cash: {
  382. status: null,
  383. content: null,
  384. },
  385. dialogLoading: false,
  386. apply_status: 1,
  387. check_form: {
  388. remark: '',
  389. verification_code: ''
  390. },
  391. new_status: 0,
  392. is_disabled: false,
  393. mobile : '',
  394. need_risk : 0,
  395. mall_id:0,
  396. cash_log :null,
  397. applyLoading: false,
  398. DefaultWithDrawWayMap: {},
  399. statistic: [
  400. {
  401. title: '待审核总佣金',
  402. name: 'audit_commision',
  403. value: '0.00',
  404. },
  405. {
  406. title: '待打款总佣金',
  407. name: 'pending_commision',
  408. value: '0.00',
  409. },
  410. {
  411. title: '已打款总佣金',
  412. name: 'paid_commision',
  413. value: '0.00',
  414. },
  415. {
  416. title: '已驳回总佣金',
  417. name: 'rejected_commision',
  418. value: '0.00',
  419. },
  420. {
  421. title: '平台总佣金',
  422. name: 'total_commision',
  423. value: '0.00',
  424. },
  425. ],
  426. withdraw_from_list: [],
  427. };
  428. },
  429. mounted() {
  430. this.loadData();
  431. },
  432. created() {
  433. this.checkChannel()
  434. },
  435. methods: {
  436. handleSelectionChange(val) {
  437. this.multipleSelection = val;
  438. this.checkedData = val;
  439. },
  440. alitopayBatch() {
  441. let self = this;
  442. var status = 1;
  443. var arrList = new Array();
  444. $.each(this.checkedData, function(k, v) {
  445. if (v.type !== "alitopay") {
  446. status = 2;
  447. }
  448. arrList.push(v.id);
  449. });
  450. if (status == 2) {
  451. this.$message.error("请只选择支付宝提现单");
  452. return false;
  453. }
  454. if (arrList.length <= 0) {
  455. this.$message.error("请选择记录");
  456. return false;
  457. }
  458. self.$confirm('确定使用支付宝打款', '提示', {
  459. confirmButtonText: '确定',
  460. cancelButtonText: '取消',
  461. type: 'warning',
  462. beforeClose: (action, instance, done) => {
  463. if (action === 'confirm') {
  464. instance.confirmButtonLoading = true;
  465. instance.confirmButtonText = '执行中...';
  466. request({
  467. params: {
  468. r: 'mall/finance/alitopay',
  469. },
  470. method: 'post',
  471. data: {
  472. id: arrList,
  473. }
  474. }).then(e => {
  475. instance.confirmButtonLoading = false;
  476. instance.confirmButtonText = '确认';
  477. self.listLoading = false;
  478. if (e.data.code === 0) {
  479. html = e.data.data.res
  480. // win = window.open(); //打开新的空白窗口
  481. // win.document.write(html);
  482. // this.loadData(this.activeName, this.page);
  483. this.$message.success(e.data.data.res);
  484. done();
  485. setTimeout(() => {
  486. this.loadData(this.activeName)
  487. }, 1500)
  488. } else {
  489. this.$message.error(e.data.msg);
  490. }
  491. }).catch(e => {
  492. instance.confirmButtonLoading = false;
  493. instance.confirmButtonText = '确认';
  494. this.$message.error(e.message);
  495. done();
  496. });
  497. } else {
  498. done();
  499. }
  500. }
  501. })
  502. },
  503. avoidtaxBatch() {
  504. let self = this;
  505. var status = 1;
  506. var arrList = new Array();
  507. $.each(this.checkedData, function(k, v) {
  508. if (v.type !== "alipay_tax") {
  509. status = 2;
  510. }
  511. arrList.push(v.id);
  512. });
  513. if (status == 2) {
  514. this.$message.error("请只选择支付宝提现单");
  515. return false;
  516. }
  517. if (arrList.length <= 0) {
  518. this.$message.error("请选择记录");
  519. return false;
  520. }
  521. self.$confirm('确定使用支付宝合规打款', '提示', {
  522. confirmButtonText: '确定',
  523. cancelButtonText: '取消',
  524. type: 'warning',
  525. beforeClose: (action, instance, done) => {
  526. if (action === 'confirm') {
  527. instance.confirmButtonLoading = true;
  528. instance.confirmButtonText = '执行中...';
  529. request({
  530. params: {
  531. r: 'mall/finance/avoidtax',
  532. },
  533. method: 'post',
  534. data: {
  535. id: arrList,
  536. }
  537. }).then(e => {
  538. instance.confirmButtonLoading = false;
  539. instance.confirmButtonText = '确认';
  540. self.listLoading = false;
  541. if (e.data.code === 0) {
  542. this.$message.success('添加成功');
  543. setTimeout(() => {
  544. this.loadData()
  545. }, 1000)
  546. done();
  547. } else {
  548. this.$message.error(e.data.msg);
  549. done();
  550. }
  551. }).catch(e => {
  552. instance.confirmButtonLoading = false;
  553. instance.confirmButtonText = '确认';
  554. this.$message.error(e.message);
  555. done();
  556. });
  557. } else {
  558. done();
  559. }
  560. }
  561. })
  562. },
  563. handleClickItem() { //图片预览点击遮罩层关闭
  564. // 获取遮罩层dom
  565. setTimeout(() => {
  566. let domImageMask = document.querySelector(".el-image-viewer__mask");
  567. if (!domImageMask) {
  568. return;
  569. }
  570. domImageMask.addEventListener("click", () => {
  571. // 点击遮罩层时调用关闭按钮的 click 事件
  572. document.querySelector(".el-image-viewer__close").click();
  573. });
  574. }, 300)
  575. },
  576. confirmSubmit() {
  577. if (this.date) {
  578. this.search.start_date = this.date[0];
  579. this.search.end_date = this.date[1];
  580. }
  581. this.search.status = this.activeName
  582. },
  583. selectDateTime(e) {
  584. if (e != null) {
  585. this.start_date = e[0];
  586. this.end_date = e[1];
  587. this.search.start_date = e[0];
  588. this.search.end_date = e[1];
  589. } else {
  590. this.start_date = '';
  591. this.end_date = '';
  592. }
  593. this.page = 1;
  594. this.loadData();
  595. },
  596. loadData(status = -1, page = 1) {
  597. this.loading = true;
  598. let params = {
  599. r: 'mall/finance/cash',
  600. status: status,
  601. page: page,
  602. user_id: this.search.user_id,
  603. withdraw_type: this.search.withdraw_type,
  604. withdraw_from: this.search.withdraw_from,
  605. keyword: this.search.keyword,
  606. };
  607. if (this.date) {
  608. Object.assign(params, {
  609. start_date: this.date[0],
  610. end_date: this.date[1],
  611. });
  612. }
  613. request({
  614. params,
  615. method: 'get'
  616. }).then(e => {
  617. this.loading = false;
  618. if (e.data.code == 0) {
  619. this.page = page
  620. this.list = e.data.data.list;
  621. this.DefaultWithDrawWayMap = e.data.data.DefaultWithDrawWayMap;
  622. this.export_list = e.data.data.export_list;
  623. this.pagination = e.data.data.pagination;
  624. this.need_risk = e.data.data.need_risk;
  625. this.mobile = e.data.data.mobile;
  626. this.mall_id = e.data.data.mall_id;
  627. // 平台数据
  628. this.statistic.map(item => {
  629. item.value = e.data.data.statistic[item.name]
  630. })
  631. this.withdraw_from_list = e.data.data.withdraw_from_list;
  632. } else {
  633. if (e.data.msg == 'User Id必须是整数。') {
  634. e.data.msg = '会员id必须是整数';
  635. }
  636. this.$message.error(e.data.msg);
  637. }
  638. }).catch(e => {
  639. this.loading = false;
  640. });
  641. },
  642. pageChange(page) {
  643. this.loadData(this.activeName, page);
  644. },
  645. handleClick(tab, event) {
  646. // console.log(this.user_id);
  647. // console.log(this.withdraw_type);
  648. // console.log(this.withdraw_from);
  649. // console.log(this.keyword);
  650. this.search.status = this.activeName
  651. this.loadData(this.activeName)
  652. },
  653. checkChannel() {
  654. request({
  655. params: {
  656. r: 'mall/finance/check-channel',
  657. },
  658. method: 'get',
  659. }).then(e => {
  660. if (e.data.code === 0) {
  661. this.alipay.alitopay_switch = e.data.data.alitopay && e.data.data.alitopay.is_install == 1 ? true : false
  662. this.alipay.avoidtax_switch = e.data.data.avoidtax && e.data.data.avoidtax.is_install == 1 ? true : false
  663. console.log(e.data)
  664. } else {
  665. this.$message.error(e.data.msg);
  666. }
  667. }).catch(e => {
  668. done();
  669. instance.confirmButtonLoading = false;
  670. });
  671. },
  672. alitopayApply(cash, status) {
  673. this.checkedData = [cash];
  674. this.alitopayBatch()
  675. },
  676. avoidtaxApply(cash, status) {
  677. this.checkedData = [cash];
  678. this.avoidtaxBatch()
  679. },
  680. openDialogForm(cash,status) {
  681. this.dialogFormVisible = true;
  682. this.new_status = status;
  683. this.cash_log = cash;
  684. },
  685. closeDialogForm() {
  686. this.dialogFormVisible = false;
  687. this.new_status = 0;
  688. this.check_form.remark = ''
  689. this.check_form.verification_code = '';
  690. },
  691. getVerificationCode() {
  692. this.is_disabled = true;
  693. request({
  694. params: {
  695. r: 'common/sms/send',
  696. },
  697. method: 'post',
  698. data: {
  699. mobile : this.mobile,
  700. sms_type : 'cash_risk_cash_check_'+this.cash_log.id,
  701. valid_time : 60,
  702. mall_id : this.mall_id
  703. }
  704. }).then(e => {
  705. this.is_disabled = false;
  706. if (e.data.code == 0) {
  707. this.is_disabled = true;
  708. this.$message.success(e.data.msg+',验证码已发送到:'+this.mobile);
  709. } else {
  710. this.$message.error(e.data.msg);
  711. }
  712. }).catch(e => {
  713. });
  714. },
  715. apply() {
  716. if (this.applyLoading === true) return;
  717. this.applyLoading = true;
  718. request({
  719. params: {
  720. r: 'mall/finance/cash-apply',
  721. },
  722. method: 'post',
  723. data: {
  724. id: this.cash_log.id,
  725. status: this.new_status,
  726. content: this.check_form.remark,
  727. verification_code: this.check_form.verification_code
  728. }
  729. }).then(e => {
  730. if (e.data.code === 0) {
  731. this.closeDialogForm();
  732. this.loadData(this.activeName, this.page);
  733. } else {
  734. this.$message.error(e.data.msg);
  735. }
  736. this.applyLoading = false;
  737. }).catch(e => {
  738. this.applyLoading = false;
  739. });
  740. },
  741. /* apply(cash, status) {
  742. this.$prompt('请输入备注', '提示', {
  743. confirmButtonText: '确定',
  744. cancelButtonText: '取消',
  745. beforeClose: (action, instance, done) => {
  746. if (action === 'confirm') {
  747. instance.confirmButtonLoading = true;
  748. instance.confirmButtonText = '执行中...';
  749. request({
  750. params: {
  751. r: 'mall/finance/cash-apply',
  752. },
  753. method: 'post',
  754. data: {
  755. id: cash.id,
  756. status: status,
  757. content: instance.inputValue,
  758. }
  759. }).then(e => {
  760. instance.confirmButtonLoading = false;
  761. if (e.data.code === 0) {
  762. this.loadData(this.activeName, this.page);
  763. done();
  764. } else {
  765. instance.confirmButtonText = '确定';
  766. this.$message.error(e.data.msg);
  767. }
  768. }).catch(e => {
  769. done();
  770. instance.confirmButtonLoading = false;
  771. });
  772. } else {
  773. done();
  774. }
  775. }
  776. }).then(value => {
  777. }).catch(e => {
  778. this.$message({
  779. type: 'info',
  780. message: '取消输入'
  781. });
  782. });
  783. }, */
  784. handle(type, data = null) {
  785. let ids = [];
  786. switch (type) {
  787. case 'open':
  788. if (this.multipleSelection.length == 0) {
  789. this.$message({
  790. type: 'warning',
  791. message: '请选择要审核的数据'
  792. });
  793. return;
  794. }
  795. this.batch_cash.status = data
  796. if (data == 1) {
  797. this.apply_status = 1;
  798. this.dialogTitle = '批量审核';
  799. } else {
  800. this.apply_status = 2;
  801. this.dialogTitle = '批量打款';
  802. }
  803. this.dialogVisible = true;
  804. break;
  805. case 'batch_apply': // 批量审核
  806. var is_return = false;
  807. this.multipleSelection.forEach(item => {
  808. if (item.status != 0 && is_return == false) {
  809. this.$message({
  810. type: 'warning',
  811. message: 'ID:' + item.id + ' 的数据非待审核状态'
  812. });
  813. is_return = true;
  814. }
  815. ids.push(item.id)
  816. })
  817. if (is_return == true) return;
  818. this.dialogLoading = true;
  819. data.ids = ids;
  820. this.send(data, 'mall/finance/batch-cash-apply', (resp) => {
  821. this.dialogLoading = false;
  822. this.dialogVisible = false;
  823. this.loadData();
  824. });
  825. break;
  826. case 'batch_remit': // 批量打款
  827. var is_return = false;
  828. this.multipleSelection.forEach(item => {
  829. if (item.status != 1 && is_return == false) {
  830. this.$message({
  831. type: 'warning',
  832. message: 'ID:' + item.id + ' 的数据非待打款状态'
  833. });
  834. is_return = true;
  835. }
  836. if (item.type != 'linggong') {
  837. ids.push(item.id)
  838. }
  839. })
  840. if (ids.length <= 0) {
  841. this.$message({
  842. type: 'warning',
  843. message: '批量打款不支持点薪灵工'
  844. });
  845. return;
  846. }
  847. if (is_return == true) return;
  848. this.dialogLoading = true;
  849. data.ids = ids;
  850. this.send(data, 'mall/finance/batch-cash-apply', (resp) => {
  851. this.dialogLoading = false;
  852. this.dialogVisible = false;
  853. this.loadData();
  854. });
  855. break;
  856. }
  857. },
  858. send(params, url, callback = null) {
  859. let self = this;
  860. let basic_params = {
  861. r: url
  862. };
  863. request({
  864. params: basic_params,
  865. method: 'post',
  866. data: params
  867. }).then(e => {
  868. if (e.data.code == 0) {
  869. self.$message.success(e.data.msg);
  870. } else {
  871. self.$message.error(e.data.msg);
  872. }
  873. if (callback) callback(e.data);
  874. }).catch(e => {
  875. console.log(e);
  876. });
  877. },
  878. /**
  879. * 银典代付
  880. */
  881. yunfastApply(cash, status) {
  882. this.checkedData = [cash];
  883. this.yunfastBatch()
  884. },
  885. /**
  886. * 银典代付
  887. */
  888. yunfastBatch() {
  889. let self = this;
  890. var status = 1;
  891. var arrList = new Array();
  892. $.each(this.checkedData, function(k, v) {
  893. if (v.type !== "yunfast_pay") {
  894. status = 2;
  895. }
  896. arrList.push(v.id);
  897. });
  898. if (status == 2) {
  899. this.$message.error("请只选择银典代付提现单");
  900. return false;
  901. }
  902. if (arrList.length <= 0) {
  903. this.$message.error("请选择记录");
  904. return false;
  905. }
  906. self.$confirm('确定使用银典代付打款', '提示', {
  907. confirmButtonText: '确定',
  908. cancelButtonText: '取消',
  909. type: 'warning',
  910. beforeClose: (action, instance, done) => {
  911. if (action === 'confirm') {
  912. instance.confirmButtonLoading = true;
  913. instance.confirmButtonText = '执行中...';
  914. request({
  915. params: {
  916. r: 'mall/finance/yunfast-pay',
  917. },
  918. method: 'post',
  919. data: {
  920. id: arrList,
  921. }
  922. }).then(e => {
  923. instance.confirmButtonLoading = false;
  924. instance.confirmButtonText = '确认';
  925. self.listLoading = false;
  926. if (e.data.code === 0) {
  927. this.$message.success(e.data.msg)
  928. setTimeout(() => {
  929. this.loadData()
  930. }, 1000)
  931. done();
  932. } else {
  933. this.$message.error(e.data.msg);
  934. }
  935. }).catch(e => {
  936. instance.confirmButtonLoading = false;
  937. instance.confirmButtonText = '确认';
  938. this.$message.error(e.message);
  939. done();
  940. });
  941. } else {
  942. done();
  943. }
  944. }
  945. })
  946. },
  947. /**
  948. * 银企直联打款
  949. */
  950. banktaxApply(cash, status) {
  951. this.checkedData = [cash];
  952. this.banktaxBatch()
  953. },
  954. /**
  955. * 银企直联打款
  956. */
  957. banktaxBatch() {
  958. let self = this;
  959. var status = 1;
  960. var arrList = new Array();
  961. $.each(this.checkedData, function(k, v) {
  962. if (v.type !== "bank_tax") {
  963. status = 2;
  964. }
  965. arrList.push(v.id);
  966. });
  967. if (status == 2) {
  968. this.$message.error("请只选择银企直联提现单");
  969. return false;
  970. }
  971. if (arrList.length <= 0) {
  972. this.$message.error("请选择记录");
  973. return false;
  974. }
  975. self.$confirm('确定使用银企直联打款', '提示', {
  976. confirmButtonText: '确定',
  977. cancelButtonText: '取消',
  978. type: 'warning',
  979. beforeClose: (action, instance, done) => {
  980. if (action === 'confirm') {
  981. instance.confirmButtonLoading = true;
  982. instance.confirmButtonText = '执行中...';
  983. request({
  984. params: {
  985. r: 'mall/finance/banktax',
  986. },
  987. method: 'post',
  988. data: {
  989. id: arrList,
  990. }
  991. }).then(e => {
  992. instance.confirmButtonLoading = false;
  993. instance.confirmButtonText = '确认';
  994. self.listLoading = false;
  995. if (e.data.code === 0) {
  996. this.$message.success(e.data.msg)
  997. setTimeout(() => {
  998. this.loadData()
  999. }, 1000)
  1000. done();
  1001. } else {
  1002. this.$message.error(e.data.msg);
  1003. }
  1004. }).catch(e => {
  1005. instance.confirmButtonLoading = false;
  1006. instance.confirmButtonText = '确认';
  1007. this.$message.error(e.message);
  1008. done();
  1009. });
  1010. } else {
  1011. done();
  1012. }
  1013. }
  1014. })
  1015. },
  1016. /**
  1017. * 点薪灵工打款
  1018. */
  1019. linggongApply(cash, status) {
  1020. this.checkedData = [cash];
  1021. this.linggongBatch()
  1022. },
  1023. /**
  1024. * 点薪灵工打款
  1025. */
  1026. linggongBatch() {
  1027. let self = this;
  1028. var status = 1;
  1029. var arrList = new Array();
  1030. $.each(this.checkedData, function(k, v) {
  1031. if (v.type !== "linggong") {
  1032. status = 2;
  1033. }
  1034. arrList.push(v.id);
  1035. });
  1036. if (status == 2) {
  1037. this.$message.error("请只选择点薪灵工提现单");
  1038. return false;
  1039. }
  1040. if (arrList.length <= 0) {
  1041. this.$message.error("请选择记录");
  1042. return false;
  1043. }
  1044. self.$confirm('确定使用点薪灵工打款', '提示', {
  1045. confirmButtonText: '确定',
  1046. cancelButtonText: '取消',
  1047. type: 'warning',
  1048. beforeClose: (action, instance, done) => {
  1049. if (action === 'confirm') {
  1050. instance.confirmButtonLoading = true;
  1051. instance.confirmButtonText = '执行中...';
  1052. request({
  1053. params: {
  1054. r: 'mall/finance/linggong',
  1055. },
  1056. method: 'post',
  1057. data: {
  1058. id: arrList,
  1059. }
  1060. }).then(e => {
  1061. instance.confirmButtonLoading = false;
  1062. instance.confirmButtonText = '确认';
  1063. self.listLoading = false;
  1064. if (e.data.code === 0) {
  1065. this.$message.success(e.data.msg)
  1066. setTimeout(() => {
  1067. this.loadData()
  1068. }, 1000)
  1069. done();
  1070. } else {
  1071. this.$message.error(e.data.msg);
  1072. }
  1073. }).catch(e => {
  1074. instance.confirmButtonLoading = false;
  1075. instance.confirmButtonText = '确认';
  1076. this.$message.error(e.message);
  1077. done();
  1078. });
  1079. } else {
  1080. done();
  1081. }
  1082. }
  1083. })
  1084. },
  1085. }
  1086. })
  1087. </script>
  1088. <style class="less">
  1089. .content {
  1090. background: #fff;
  1091. padding: 20px;
  1092. }
  1093. .table-body {
  1094. padding: 0;
  1095. }
  1096. .default-avatar {
  1097. width: 50px;
  1098. height: 50px;
  1099. border-radius: 50%;
  1100. margin-right: 8px;
  1101. }
  1102. .uer-nickname {
  1103. flex: 1;
  1104. }
  1105. .btn {
  1106. margin-top: 10px !important;
  1107. border: 0 !important;
  1108. padding: 0 !important;
  1109. }
  1110. .stat_details{
  1111. /* padding-bottom: 30px; */
  1112. padding-top: 20px;
  1113. display: flex;
  1114. }
  1115. .order_module{
  1116. flex: 1;
  1117. background: #F2F2F2;
  1118. margin: 0 5px;
  1119. padding: 20px 25px;
  1120. }
  1121. .order_module:last-child{
  1122. margin-right: 0;
  1123. }
  1124. .order_module:first-child{
  1125. margin-left: 0;
  1126. }
  1127. .price{
  1128. font-size: 22px;
  1129. font-weight: bold;
  1130. }
  1131. .oirder_modul_title{
  1132. font-size: 12px;
  1133. margin-bottom: 10px;
  1134. display: flex;
  1135. align-items: center;
  1136. }
  1137. .oirder_modul_title .text{
  1138. margin-right: 10px;
  1139. }
  1140. .stat_icon{
  1141. font-size: 19px;
  1142. color: #BFBFBF;
  1143. }
  1144. </style>