user_settlement_cw.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459
  1. <template>
  2. <div v-loading="loading" style="padding: 20px">
  3. <div v-if="role=='2'" class="qs_search" style="margin-bottom: 10px">
  4. 当前支付方式:{{pay_type}}
  5. <el-button size="small" @click="show_config" type="primary">结算渠道配置</el-button>
  6. <div class="flex_1" />
  7. </div>
  8. <div v-if="role=='2'" class="qs_search" style="margin-bottom: 10px">
  9. <span >待支付金额:{{payMoney}}元</span>
  10. </div>
  11. <div class="qs_search" style="margin-bottom: 10px">
  12. <el-tag
  13. v-for="v in status"
  14. :key="v.id"
  15. :type="v.id===search.status?'success':'info'"
  16. @click="getData_(v.id)"
  17. >{{ v.name }}
  18. </el-tag>
  19. <el-switch
  20. v-if="search.status==0"
  21. v-model="search.is_sx_js"
  22. @change="getData_(0)"
  23. active-text="结算订单">
  24. </el-switch>
  25. <el-button size="small" @click="export_data" type="primary">导出订单</el-button>
  26. <div class="flex_1" />
  27. </div>
  28. <div style="margin-bottom: 10px">
  29. <el-input v-model="search.uid" size="small" style="width: 200px" placeholder="用户的UID"></el-input>
  30. <el-button size="small" @click="search_" type="primary">搜索</el-button>
  31. <div class="flex_1" />
  32. </div>
  33. <div style="width: 100%">
  34. <el-table row-key="id" :data="list">
  35. <el-table-column prop="order_no" fixed width="170px" label="订单编号">
  36. <template slot-scope="scope">
  37. <span style="cursor: pointer" @click="show_pub_log(scope.row.id)">{{scope.row.order_no}}</span>
  38. </template>
  39. </el-table-column>
  40. <el-table-column prop="money" fixed width="160px" label="用户UID">
  41. <template slot-scope="scope">
  42. <a style="color: #006eff" target="_blank" :href="scope.row.user_info.link">{{scope.row.user_info.realname}}({{scope.row.uid}})</a>
  43. </template>
  44. </el-table-column>
  45. <el-table-column prop="money" width="140px" label="应付金额">
  46. <template slot-scope="scope">
  47. <span>{{scope.row.y_money}}</span>
  48. </template>
  49. </el-table-column>
  50. <el-table-column prop="is_income" width="140px" label="实付金额">
  51. <template slot-scope="scope">
  52. <span>{{scope.row.sf_money}}</span>
  53. <br/>
  54. <a v-if="scope.row.user_invoice.id" target="_blank" :href="scope.row.user_invoice.file">查看发票</a>
  55. <span v-if="scope.row.user_invoice.order_num>0" @click="show_user_settlement(scope.row.user_invoice)" style="color: red;cursor: pointer;"> <br/>关联了{{scope.row.user_invoice.order_num}}个订单</span>
  56. </template>
  57. </el-table-column>
  58. <el-table-column width="400px" prop="is_income" label="收款账户">
  59. <template slot-scope="scope">
  60. <div v-if="scope.row.account.account_name">
  61. 收款姓名:{{scope.row.account.account_name}}<br/>
  62. 收款账号:{{scope.row.account.card_number}}<br/>
  63. 银行信息:{{scope.row.account.bank_name}}<br/>
  64. </div>
  65. <div v-if="!scope.row.account.account_name">
  66. 收款姓名:************<br/>
  67. 收款账号:************,*******************<br/>
  68. 银行支行:************<br/>
  69. </div>
  70. </template>
  71. </el-table-column>
  72. <el-table-column prop="status" width="100px" label="订单状态">
  73. <template slot-scope="scope">
  74. {{scope.row.status_text}}
  75. </template>
  76. </el-table-column>
  77. <el-table-column prop="is_income" show-overflow-tooltip label="系统备注">
  78. <template slot-scope="scope">
  79. {{scope.row.memo?scope.row.memo:"-"}}
  80. </template>
  81. </el-table-column>
  82. <el-table-column prop="is_income" width="150px" label="结算服务费">
  83. <template slot-scope="scope">
  84. <span>{{scope.row.js_moeny}}({{scope.row.js_rate}})</span>
  85. </template>
  86. </el-table-column>
  87. <el-table-column prop="status" width="100px" label="发票">
  88. <template slot-scope="scope">
  89. {{scope.row.invoice_type_obj.name}}
  90. </template>
  91. </el-table-column>
  92. <el-table-column prop="txtime" width="160px" label="提现时间"></el-table-column>
  93. <el-table-column prop="paytime" width="160px" label="到账时间"></el-table-column>
  94. <el-table-column prop="status" width="100px" label="关联项目">
  95. <template slot-scope="scope">
  96. <a v-if="scope.row.link" :href="scope.row.link" style="color: #006eff" target="_blank">{{scope.row.title}}</a>
  97. <span v-if="!scope.row.link">--</span>
  98. </template>
  99. </el-table-column>
  100. <el-table-column prop="status" width="100px" label="备注">
  101. <template slot-scope="scope">
  102. <el-button type="text" size="small" @click="add_memo(scope.row.id,'添加备注')">添加备注</el-button>
  103. </template>
  104. </el-table-column>
  105. <el-table-column fixed="right" min-width="200px" prop="uid" label="操作">
  106. <template slot-scope="scope">
  107. <el-button type="primary" size="small" v-if="scope.row.status==1" @click="confirm_dj(scope.row.id,'是否确认帮客户代缴,操作不可逆?',3)">公司代缴</el-button>
  108. <el-button type="primary" size="small" v-if="scope.row.status==2 && scope.row.invoice_type!=3" @click="confirm_status(scope.row.id,'是否确认已核对?',3)">审核通过</el-button>
  109. <el-button type="primary" size="small" v-if="scope.row.status==2 && scope.row.invoice_type!=3" @click="confirm_refuse(scope.row.id)">驳回订单</el-button>
  110. <el-button type="primary" size="small" v-if="scope.row.status==4 && role=='1' && scope.row.invoice_type!=3" @click="confirm_status(scope.row.id,'是否确认制单?',5)">确认制单</el-button>
  111. <el-button type="danger" size="small" v-if="scope.row.status==5 && role=='1' && scope.row.invoice_type!=3" @click="confirm_status(scope.row.id,'是否确认打款?',6)">确认打款</el-button>
  112. <el-button type="primary" size="small" v-if="role=='2' && (scope.row.status==3 || scope.row.status==7)" @click="confirm_js(scope.row.id,'是否确认付款?')">确认付款</el-button>
  113. <el-button type="danger" size="small" v-if="role=='2' && (scope.row.status==3 || scope.row.status==7)" @click="confirm_reject(scope.row.id,'是否确认驳回?')">驳回提现</el-button>
  114. </template>
  115. </el-table-column>
  116. </el-table>
  117. </div>
  118. <el-pagination
  119. background
  120. style="margin-top: 10px"
  121. layout="total,prev, pager, next"
  122. :current-page="search.page"
  123. @current-change="page_event"
  124. :page-size="search.pagesize"
  125. :total="search.total">
  126. </el-pagination>
  127. <pub_log v-if="drawer_obj.pub_log" :back="this" :pro="drawer_obj.id" action="user_settlement"></pub_log>
  128. <user_settlement v-if="drawer_obj.user_settlement" :fp_info="drawer_obj.obj" :back="this" :pro="drawer_obj.id"></user_settlement>
  129. <config v-if="drawer_obj.config" :back="this" :pro="drawer_obj.id"></config>
  130. </div>
  131. </template>
  132. <script>
  133. import config from '@/components/drawer/invoice/config';
  134. import pub_log from '@/components/drawer/pub_log';
  135. import user_settlement from '@/components/drawer/invoice/user_settlement';
  136. export default {
  137. props: {
  138. status: {},
  139. role: {},
  140. invoice_type:{}
  141. },
  142. components: {config,pub_log,user_settlement},
  143. data() {
  144. return {
  145. loading: true,
  146. pay_type:"",
  147. drawer_obj:{
  148. user_settlement:false,
  149. user_invoice_add:false,
  150. id:0,
  151. pub_log:false,
  152. config:false,
  153. obj:{},
  154. },
  155. search: {
  156. pagesize: 10,
  157. total: 0,
  158. status:1,
  159. name: "",
  160. invoice_type:[],
  161. is_sx_js:true
  162. },
  163. status:[
  164. ],
  165. list: [],
  166. payMoney:0,
  167. };
  168. },
  169. computed: {},
  170. watch: {},
  171. created() {
  172. this.search.status=this.status;
  173. this.search.invoice_type=this.invoice_type;
  174. },
  175. mounted() {
  176. this.getList();
  177. this.get_status();
  178. this.get_config();
  179. },
  180. methods: {
  181. async export_data()
  182. {
  183. this.loading = true;
  184. this.drawer = false;
  185. let data=this.search;
  186. data.act="export";
  187. let res = await this.$post("/uapi/pub/info/user/user_settlement/admin_list",data);
  188. this.loading = false;
  189. if (res.status == 1) {
  190. window.open(res.data.file)
  191. }
  192. },
  193. show_config()
  194. {
  195. this.drawer_obj.id = 0;
  196. this.drawer_obj.config = true;
  197. },
  198. show_pub_log(id)
  199. {
  200. this.drawer_obj.id = id;
  201. this.drawer_obj.pub_log = true;
  202. },
  203. show_user_settlement(row)
  204. {
  205. this.drawer_obj.obj=row;
  206. this.drawer_obj.id = row.id;
  207. this.drawer_obj.user_settlement = true;
  208. },
  209. show_user_invoice_add(id)
  210. {
  211. this.drawer_obj.id = id;
  212. this.drawer_obj.user_invoice_add = true;
  213. },
  214. manager_space(command,id)
  215. {
  216. if(command=='log')
  217. {
  218. this.drawer_obj.id=id;
  219. this.drawer_obj.pub_log=true;
  220. }
  221. else if(command=='del')
  222. {
  223. this.admin_del(id);
  224. }
  225. else if(command=='agree')
  226. {
  227. this.admin_agree(id);
  228. }
  229. else if(command=='refuse')
  230. {
  231. this.admin_refuse(id);
  232. }
  233. else if(command=='edit')
  234. {
  235. this.show_user_invoice_add(id);
  236. }
  237. },
  238. async getList() {
  239. this.loading = true;
  240. this.drawer = false;
  241. let data=this.search;
  242. data.act="";
  243. let res = await this.$post("/uapi/pub/info/user/user_settlement/admin_list", this.search);
  244. this.loading = false;
  245. if (res.status == 1) {
  246. this.list = res.data.list;
  247. this.search.total = res.data.total;
  248. this.payMoney=res.data.payMoney;
  249. }
  250. },
  251. async get_config() {
  252. this.loading = true;
  253. let res = await this.$post("/uapi/pub/info/user/user_settlement/get_config",{});
  254. this.loading = false;
  255. if (res.status == 1) {
  256. this.pay_type = res.data;
  257. }
  258. },
  259. async get_status() {
  260. this.loading = true;
  261. let res = await this.$post("/uapi/pub/info/user/user_settlement/get_status",{act:this.role});
  262. this.loading = false;
  263. if (res.status == 1) {
  264. this.status = res.data.list;
  265. }
  266. },
  267. async confirm_reject(id) {
  268. this.$prompt('请输入驳回的原因', '提示', {
  269. confirmButtonText: '确定',
  270. cancelButtonText: '取消',
  271. }).then(async ({ value }) => {
  272. this.loading = true;
  273. let res =await this.$post("/uapi/pub/info/user/user_settlement/set_status",{id:id,reason:value,status:1});
  274. if (res.status == 1) {
  275. this.$message({
  276. type: 'success',
  277. message: '成功!'
  278. });
  279. await this.getList();
  280. await this.get_status();
  281. }
  282. this.loading = false;
  283. }).catch(() => {
  284. this.$message({
  285. type: 'info',
  286. message: '已取消'
  287. });
  288. });
  289. },
  290. async confirm_dj(id) {
  291. this.$confirm("是否确认次操作,行为不可逆?", '提示', {
  292. confirmButtonText: '确定',
  293. cancelButtonText: '取消',
  294. type: 'warning'
  295. }).then(async () => {
  296. this.loading = true;
  297. let res =await this.$post("/uapi/pub/info/user/user_settlement/dj",{id:id,status:1});
  298. if (res.status == 1) {
  299. this.$message({
  300. type: 'success',
  301. message: '成功!'
  302. });
  303. await this.getList();
  304. await this.get_status();
  305. }
  306. this.loading = false;
  307. }).catch(() => {
  308. this.$message({
  309. type: 'info',
  310. message: '已取消删除'
  311. });
  312. });
  313. },
  314. async confirm_refuse(id) {
  315. this.$prompt('请输入拒绝的理由', '提示', {
  316. confirmButtonText: '确定',
  317. cancelButtonText: '取消',
  318. }).then(async ({ value }) => {
  319. this.loading = true;
  320. let res =await this.$post("/uapi/pub/info/user/user_settlement/set_status",{id:id,reason:value,status:8});
  321. if (res.status == 1) {
  322. this.$message({
  323. type: 'success',
  324. message: '成功!'
  325. });
  326. await this.getList();
  327. await this.get_status();
  328. }
  329. this.loading = false;
  330. }).catch(() => {
  331. this.$message({
  332. type: 'info',
  333. message: '已取消'
  334. });
  335. });
  336. },
  337. async add_memo(id) {
  338. this.$prompt('请输入备注信息', '提示', {
  339. confirmButtonText: '确定',
  340. cancelButtonText: '取消',
  341. }).then(async ({ value }) => {
  342. this.loading = true;
  343. let res =await this.$post("/uapi/pub/info/user/user_settlement/add_memo",{id:id,memo:value});
  344. if (res.status == 1) {
  345. this.$message({
  346. type: 'success',
  347. message: '成功!'
  348. });
  349. await this.getList();
  350. await this.get_status();
  351. }
  352. this.loading = false;
  353. }).catch(() => {
  354. this.$message({
  355. type: 'info',
  356. message: '已取消'
  357. });
  358. });
  359. },
  360. async confirm_status(id,msg,status) {
  361. this.$confirm(msg, '提示', {
  362. confirmButtonText: '确定',
  363. cancelButtonText: '取消',
  364. type: 'warning'
  365. }).then(async () => {
  366. this.loading = true;
  367. let res =await this.$post("/uapi/pub/info/user/user_settlement/set_status",{id:id,status:status});
  368. if (res.status == 1) {
  369. this.$message({
  370. type: 'success',
  371. message: '成功!'
  372. });
  373. await this.getList();
  374. await this.get_status();
  375. }
  376. this.loading = false;
  377. }).catch(() => {
  378. this.$message({
  379. type: 'info',
  380. message: '已取消删除'
  381. });
  382. });
  383. },
  384. async confirm_js(id,msg) {
  385. this.$confirm(msg, '提示', {
  386. confirmButtonText: '确定',
  387. cancelButtonText: '取消',
  388. type: 'warning'
  389. }).then(async () => {
  390. this.loading = true;
  391. let res =await this.$post("/uapi/pub/info/user/user_settlement/confirm_js",{id:id});
  392. if (res.status == 1) {
  393. this.$message({
  394. type: 'success',
  395. message: '成功!'
  396. });
  397. await this.getList();
  398. await this.get_status();
  399. }
  400. this.loading = false;
  401. }).catch(() => {
  402. this.$message({
  403. type: 'info',
  404. message: '已取消删除'
  405. });
  406. });
  407. },
  408. async admin_del(id) {
  409. this.$confirm('是否确认删除?', '提示', {
  410. confirmButtonText: '确定',
  411. cancelButtonText: '取消',
  412. type: 'warning'
  413. }).then(async () => {
  414. this.loading = true;
  415. let res =await this.$post("/uapi/pub/info/user/user_invoice/admin_del",{id:id});
  416. if (res.status == 1) {
  417. this.$message({
  418. type: 'success',
  419. message: '成功!'
  420. });
  421. await this.getList();
  422. }
  423. this.loading = false;
  424. }).catch(() => {
  425. this.$message({
  426. type: 'info',
  427. message: '已取消删除'
  428. });
  429. });
  430. },
  431. page_event(page) {
  432. this.search.page = page;
  433. this.getList();
  434. },
  435. getData_(id) {
  436. this.search.status = id;
  437. this.search.page=0;
  438. this.getList();
  439. },
  440. search_() {
  441. this.search.page = 0;
  442. this.getList();
  443. },
  444. }
  445. };
  446. </script>
  447. <style scoped>
  448. .el-tag {
  449. cursor: pointer;
  450. }
  451. </style>