user_settlement_cw.vue 14 KB

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