| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616 |
- <div id="app" v-cloak>
- <el-card shadow="never" style="border:0;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
- <div slot="header">
- <div>
- <span>记帐本列表</span>
- </div>
- </div>
- <div class="table-body">
- <el-form :inline="true" :model="searchData" class="demo-form-inline">
- <el-col :span="24" v-if="type == 2">
- <el-button type="success" :loading="addLoading" @click="add(1)">新增(税务方)</el-button>
- <el-button type="primary" :loading="addLoading" @click="add(2)">新增(用工方)</el-button>
- <el-button v-if="payment_flow_status" type="warning" :loading="addLoading" @click="add(3)">新增(过流水)</el-button>
- </el-col>
- <el-col :span="24" v-else>
- <el-button type="success" :loading="addLoading" @click="add(1)">新增</el-button>
- </el-col>
- </el-form>
- <el-col :span="24" v-if="type == 2">
- <div class="notice">
- <ul>
- <li>
- <i class="el-icon-info" style="color: #E6A23C"></i>
- 当您使用「服务商版」的情况下, 打款前请务必给
- <el-tag type="primary" size="mini">用工方</el-tag>
- 的记账本进行充值, 充值时请使用和
- <el-tag type="primary" size="mini">用工方</el-tag>
- 签约一致的支付宝账号进行充值。
- </li>
- <li>
- <i class="el-icon-info" style="color: #E6A23C"></i>
- 当您的金额滞留在
- <el-tag type="success" size="mini">税务方</el-tag>
- 记账本情况下, 可
- <el-tag type="success" size="mini">税务方</el-tag>
- 记账本使用「逆流」功能进行资金转回到
- <el-tag type="primary" size="mini">用工方</el-tag>
- 默认记账本。
- </li>
- </ul>
- </div>
- </el-col>
- <!-- 订单信息 -->
- <template>
- <el-table ref="multipleTable" :data="list" @selection-change="handleSelectionChange" v-loading="listLoading">
- <!-- 空数据 -->
- <template slot="empty">
- <el-empty description="暂无记帐本"></el-empty>
- </template>
- <el-table-column type="selection"></el-table-column>
- <el-table-column prop="id" align="center" label="ID"></el-table-column>
- <el-table-column prop="book_type" align="center" label="记账本类型" v-if="type == 2">
- <template slot-scope="scope">
- <el-tag type="success" size="mini" v-if="scope.row.book_type == 1">税务方</el-tag>
- <el-tag type="primary" size="mini" v-if="scope.row.book_type == 2">用工方</el-tag>
- <el-tag type="warning" size="mini" v-if="scope.row.book_type == 3">过流水</el-tag>
- </template>
- </el-table-column>
- <el-table-column prop="external_agreement_no" align="center" label="签约号"></el-table-column>
- <el-table-column prop="book_id" align="center" label="记帐本ID">
- <template slot-scope="scope">
- {{
- (scope.row.status == 'NORMAL' && scope.row.book)
- ? scope.row.book.account_book_id
- : '--'
- }}
- </template>
- </el-table-column>
- <el-table-column prop="alipay_logon_id" align="center" label="签约方账户">
- <template slot-scope="scope">
- {{
- scope.row.status == 'NORMAL'
- ? scope.row.alipay_logon_id
- : '--'
- }}
- </template>
- </el-table-column>
- <el-table-column prop="sign_time" label="签约时间" align="center">
- <template slot-scope="scope">
- {{
- scope.row.status != 'NORMAL'
- ? '--'
- : scope.row.sign_time|dateTimeFormat('Y-m-d H:i:s')
- }}
- </template>
- </el-table-column>
- <el-table-column prop="default" label="是否默认" align="center">
- <template slot-scope="scope">
- <el-icon class="el-icon-success" v-if="scope.row.is_default == 1"></el-icon>
- <el-icon class="el-icon-circle-check" v-if="scope.row.is_default == 0"></el-icon>
- </template>
- </el-table-column>
- <el-table-column prop="right_btn" label="操作" align="center">
- <template slot-scope="scope">
- <el-button
- type="text"
- :loading="queryAccountLoad"
- @click="queryAccount(scope.row.id)"
- v-if="scope.row.status != 'NORMAL'"
- >查询签约</el-button>
- <el-button
- type="text"
- :loading="queryBookLoad"
- @click="queryBook(scope.row.id)"
- v-if="scope.row.status == 'NORMAL'"
- >查询账户</el-button>
- <el-button
- type="text"
- @click="setDefault(scope.row.id, scope.row.book_type)"
- v-if="scope.row.is_default == 0 && scope.row.status == 'NORMAL'"
- >默认</el-button>
- <el-button
- type="text"
- @click="rechargeBook(scope.row.book)"
- v-if="scope.row.status == 'NORMAL' && scope.row.book.book_type == 2"
- >充值</el-button>
- <el-button
- type="text"
- @click="returnBook(scope.row.id)"
- v-if="scope.row.status == 'NORMAL' && scope.row.book.book_type == 2"
- >退回</el-button>
- <el-button
- type="text"
- :loading="queryBookLoad"
- @click="anarrheaBook(scope.row.id)"
- v-if="scope.row.status == 'NORMAL' && type == 2 && (scope.row.book.book_type == 1 || scope.row.book.book_type == 3)"
- >逆流</el-button>
- <el-button
- type="text"
- :loading="queryBookLoad"
- @click="refundBook(scope.row.id)"
- v-if="scope.row.status == 'NORMAL' && type == 1 && scope.row.book.book_type == 1"
- >退回</el-button>
- <el-button
- type="text"
- :loading="queryBookLoad"
- @click="delBook(scope.row.id)"
- v-if="scope.row.status != 'NORMAL'"
- >删除</el-button>
- </template>
- </el-table-column>
- </el-table>
- </template>
- <!-- 记帐本信息 -->
- <el-dialog :visible.sync="bookVisible" width="30%">
- <template slot="title">
- <h3 style="text-align: center;">记帐本信息</h3>
- </template>
- <el-form label-width="150px">
- <el-form-item label="记帐本ID:">
- {{ book.account_book_id }}
- </el-form-item>
- <el-form-item label="可用余额:">
- {{ book.available_amount }}
- </el-form-item>
- </el-form>
- <span slot="footer" class="dialog-footer">
- <el-button type="primary" @click="bookVisible = false">确 定</el-button>
- </span>
- </el-dialog>
- <!-- 充值 -->
- <el-dialog :visible.sync="rechargeVisible" width="30%">
- <template slot="title">
- <h3 style="text-align: center;">充值</h3>
- </template>
- <el-form label-width="150px" :model="rechargeheForm" :rules="rechargeheRules" ref="rechargeheForm">
- <el-form-item label="记帐本ID:">
- {{ book.account_book_id }}
- </el-form-item>
- <el-form-item label="充值金额:" prop="amount">
- <el-input
- v-model="rechargeheForm.amount"
- style="width: 350px"
- maxlength="10"
- placeholder="请输入充值金额"
- >
- <template slot="append">元</template>
- </el-input>
- </el-form-item>
- </el-form>
- <span slot="footer" class="dialog-footer">
- <el-button type="primary" @click="toRecharge">确 定</el-button>
- </span>
- </el-dialog>
- <!-- 退回 -->
- <el-dialog :visible.sync="returnVisible" width="30%">
- <template slot="title">
- <h3 style="text-align: center;">退回</h3>
- </template>
- <el-form label-width="150px" :model="returnForm" :rules="returnRules" ref="returnForm">
- <el-form-item label="当前记账本余额:">
- {{ amount }}
- </el-form-item>
- <el-form-item label="退回账户金额:" prop="amount">
- <el-input
- v-model="returnForm.amount"
- style="width: 350px"
- placeholder="请输入充值金额"
- >
- <template slot="append">元</template>
- </el-input>
- </el-form-item>
- <el-form-item label="退回账户名称:" prop="account_name">
- <el-input
- v-model="returnForm.account_name"
- style="width: 350px"
- placeholder="请输入账户名称"
- >
- </el-input>
- </el-form-item>
- <el-form-item label="退回账户账号:" prop="account_number">
- <el-input
- v-model="returnForm.account_number"
- style="width: 350px"
- placeholder="请输入账户账号"
- >
- </el-input>
- </el-form-item>
- </el-form>
- <span slot="footer" class="dialog-footer">
- <el-button type="primary" @click="toReturn">确 定</el-button>
- </span>
- </el-dialog>
- <!-- 分页 -->
- <el-row type="flex" class="page" justify="end" style="margin-top: 20px;">
- <el-pagination @current-change="pagination" background layout="prev, pager, next" :page-count="pageCount" v-if="list"></el-pagination>
- </el-row>
- </div>
- </el-card>
- </div>
- <script>
- const app = new Vue({
- el: '#app',
- data() {
- return {
- searchData: {
- name: '',
- },
- list: [],
- pageCount: 0,
- page: 1,
- currentPage: null,
- listLoading: false,
- addLoading: false,
- btnLoading: false,
- checked: false,
- bookVisible: false,
- book: {},
- type: 1,
- queryAccountLoad: false,
- queryBookLoad: false,
- rechargeVisible: false,
- rechargeheForm: {
- amount: undefined,
- },
- rechargeheRules: {
- amount: [
- { required: true, message: '请输入金额', trigger: 'blur' },
- ]
- },
- book: {},
- returnVisible: false,
- amount: 0,
- returnId: '',
- returnForm: {
- amount: '',
- account_name: '',
- account_number: '',
- },
- returnRules: {
- amount: [
- { required: true, message: '请输入金额', trigger: 'blur' },
- ],
- account_name: [
- { required: true, message: '请输入名称', trigger: 'blur' },
- ],
- account_number: [
- { required: true, message: '请输入账号', trigger: 'blur' },
- ],
- },
- payment_flow_status: 0,
- };
- },
- methods: {
- handleSelectionChange(val) {
- this.select_order = val
- },
- // 全选
- allSelect() {
- if (this.checked) {
- this.goods_list.forEach(function(item, index) {
- if (!item.storage) {
- item.is_select = true
- }
- })
- } else {
- this.goods_list.forEach(function(item, index) {
- item.is_select = false
- })
- }
- },
- //搜索
- onSubmit() {
- this.page = 1
- this.getOrderList()
- },
- pagination(currentPage) {
- this.page = currentPage
- this.getOrderList()
- },
- getOrderList() {
- this.listLoading = true;
- var param = {
- r: 'avoid-tax/account/index',
- page: this.page,
- limit: 20
- }
- Object.assign(param, param, this.searchData)
- request({
- params: param,
- }).then(e => {
- if (e.data.code === 0) {
- this.list = e.data.data.list
- this.pageCount = e.data.data.page_count
- this.currentPage = e.data.data.pagination.current_page
- } else {
- this.$message.error(e.data.msg)
- }
- this.listLoading = false
- }).catch(e => {
- this.listLoading = false
- })
- },
- // 添加
- add(type) {
- let self = this
- this.addLoading = true
- request({
- params: {
- r: 'avoid-tax/account/is-sign',
- type: type
- }
- }).then(e => {
- if (e.data.code == 0) {
- const {is_new_sign} = e.data.data
- self.toSign(is_new_sign, type)
- }
- })
- },
- // 去添加
- toSign(bool, type) {
- if (bool) {
- this.addLoading = false
- navigateTo({
- r: 'avoid-tax/account/sign',
- type: type,
- }, true)
- } else {
- request({
- params: {
- r: 'avoid-tax/account/add-sign',
- type: type
- }
- }).then(e => {
- if (e.data.code == 0) {
- this.$message.success('添加成功')
- this.addLoading = false
- setTimeout(() => {
- this.getOrderList()
- }, 1500)
- }
- })
- }
- },
- // 签约查询
- queryAccount(id) {
- this.queryAccountLoad = true
- var param = {
- r: 'avoid-tax/account/query',
- id: id,
- }
- request({
- params: param,
- }).then(e => {
- if (e.data.code === 0) {
- this.$message.success('查询成功')
- setTimeout(() => {
- self.getOrderList()
- this.queryAccountLoad = false
- }, 1000);
- } else {
- this.$message.error(e.data.msg)
- this.queryAccountLoad = false
- }
- }).catch(e => {})
- },
- // 记帐本查询
- queryBook(id) {
- this.queryBookLoad = true
- var param = {
- r: 'avoid-tax/account/query-book',
- id: id,
- }
- request({
- params: param,
- }).then(e => {
- if (e.data.code === 0) {
- this.bookVisible = true
- this.queryBookLoad = false
- this.book = e.data.data
- } else {
- this.queryBookLoad = false
- this.$message.error(e.data.msg)
- }
- }).catch(e => {})
- },
- // 默认设置
- setDefault (id, type) {
- var param = {
- r: 'avoid-tax/account/set-default',
- id: id,
- type: type,
- }
- var self = this
- request({
- params: param,
- }).then(e => {
- if (e.data.code === 0) {
- this.$message.success('设置成功')
- setTimeout(() => {
- self.getOrderList()
- }, 1000);
- } else {
- this.$message.error(e.data.msg)
- }
- }).catch(e => {})
- },
- // 获取配置
- getConfig () {
- request({
- params: {
- r: 'avoid-tax/default/read',
- },
- method: 'get',
- }).then(e => {
- if (e.data.code === 0) {
- this.type = e.data.data.type
- this.payment_flow_status = e.data.data.payment_flow_status ?? 0
- }
- }).catch(e => {})
- },
- // 记账本充值
- rechargeBook (book) {
- this.book = book
- this.rechargeVisible = true
- },
- // 去充值
- toRecharge () {
- this.$refs['rechargeheForm'].validate((valid) => {
- if (valid) {
- navigateTo({
- r: 'avoid-tax/account/recharge',
- amount: this.rechargeheForm.amount,
- id: this.book.account_id,
- }, true)
- } else {
- this.$message.error('参数有误')
- return false
- }
- })
- },
- // 逆流
- anarrheaBook (id) {
- this.$confirm('是否确定逆流?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- this.queryBookLoad = true
- request({
- params: {
- r: 'avoid-tax/account/anarrhea',
- id: id,
- }
- }).then(e => {
- if (e.data.code == 0) {
- this.$message.success('操作成功')
- } else {
- this.$message.error(e.data.msg)
- }
- this.queryBookLoad = false
- }).catch(e => {})
- }).catch()
- },
- // 退回
- refundBook(id) {
- this.$confirm('是否确定退回?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- this.queryBookLoad = true
- request({
- params: {
- r: 'avoid-tax/account/refund',
- id: id,
- }
- }).then(e => {
- if (e.data.code == 0) {
- this.$message.success('操作成功')
- } else {
- this.$message.error(e.data.msg)
- }
- this.queryBookLoad = false
- }).catch(e => {})
- }).catch()
- },
- returnBook(id) {
- this.returnId = id
- this.returnVisible = true
- // 查询账户余额
- this.queryBookAmount(id)
- },
- toReturn() {
- this.$refs['returnForm'].validate((valid) => {
- if (valid) {
- if (this.queryBookLoad) return
- this.queryBookLoad = true
- request({
- params: {
- r: 'avoid-tax/account/return',
- id: this.returnId
- },
- data: this.returnForm,
- method: 'post'
- }).then(e => {
- if (e.data.code == 0) {
- this.$message.success('操作成功')
- } else {
- this.$message.error(e.data.msg)
- }
- this.queryBookLoad = false
- })
- }
- })
- },
- // 查询账户余额
- queryBookAmount(id) {
- request({
- params: {
- r: 'avoid-tax/account/query-book',
- id: id,
- },
- }).then(e => {
- if (e.data.code === 0) {
- this.amount = e.data.data.available_amount
- }
- })
- },
- // 删除
- delBook(id) {
- this.$confirm('是否确定删除?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- this.queryBookLoad = true
- request({
- params: {
- r: 'avoid-tax/account/del',
- id: id,
- }
- }).then(e => {
- if (e.data.code == 0) {
- this.$message.success('操作成功')
- setTimeout(() => {
- this.getOrderList()
- }, 1500)
- } else {
- this.$message.error(e.data.msg)
- }
- this.queryBookLoad = false
- }).catch(e => {})
- }).catch()
- },
- },
- mounted: function() {
- this.page = getQuery('page') ? getQuery('page') : 1
- this.getConfig()
- this.getOrderList()
- }
- });
- </script>
- <style>
- .el-form-item__label {
- font-weight: 900;
- }
- .notice {
- border: 1px solid rgb(250, 236, 216);
- background: rgb(253, 246, 236);
- margin-top: 10px;
- padding: 10px;
- border-radius: 5px;
- }
- .notice li + li {
- margin-top: 5px;
- }
- </style>
|