| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367 |
- <template>
- <div v-loading="loading" style="padding: 20px">
- <div class="qs_search" style="margin-bottom: 10px">
- <el-tag
- v-for="v in status"
- :key="v.id"
- :type="v.id===search.status?'success':'info'"
- @click="getData_(v.id)"
- >{{ v.name }}
- </el-tag>
- <el-button size="small" @click="show_user_invoice_order_my(0)" type="primary">待开票<span v-if="user_invoice_order>0">({{user_invoice_order}}个)</span></el-button>
- <div class="flex_1" />
- </div>
- <div class="qs_search" style="margin-bottom: 0px;display: flex;justify-content: space-between;align-items: center;">
- <el-form ref="form" label-width="80px" style="display: flex;flex-direction: row;">
- <el-form-item label="销售方">
- <el-input size="small" v-model="search.sale_company_name"></el-input>
- </el-form-item>
- <el-form-item label="购买方">
- <el-input size="small" v-model="search.buy_company_name"></el-input>
- </el-form-item>
- <el-form-item label-width="5px">
- <el-button @click="search_" size="small" type="primary">查询</el-button>
- <el-checkbox style="margin-left: 15px" @change="search_" true-label="1" false-label="0" v-model="search.is_gd">挂单({{search.gd_total}}个)</el-checkbox>
- </el-form-item>
- </el-form>
- <div>
- <el-button size="small" @click="show_user_invoice_add(0)" type="primary">上传发票</el-button>
- </div>
- </div>
- <el-row>
- <el-col :span="24">
- <el-table row-key="id" :data="list">
- <el-table-column prop="sale_company_name" width="220px" label="销售方"></el-table-column>
- <el-table-column prop="buy_company_name" width="220px" label="购买方"></el-table-column>
- <el-table-column prop="money" label="发票金额">
- <template slot-scope="scope">
- <span>{{scope.row.money}}</span>
- <br/>
- <a style="color: red" target="_blank" :href="scope.row.file">查看发票</a>
- </template>
- </el-table-column>
- <el-table-column prop="is_income" width="200px" label="发票号码">
- <template slot-scope="scope">
- <span>{{scope.row.tax_number}}</span>
- </template>
- </el-table-column>
- <el-table-column prop="is_income" label="进账类型">
- <template slot-scope="scope">
- <span :style="`color:${scope.row.is_income_obj.color}`">{{scope.row.is_income_obj.name}}</span>
- </template>
- </el-table-column>
- <el-table-column prop="is_income" label="发票类型">
- <template slot-scope="scope">
- <span>{{scope.row.type_obj.name}}</span>
- </template>
- </el-table-column>
- <el-table-column prop="status" label="审核状态">
- <template slot-scope="scope">
- <span :style="`color:${scope.row.status_obj.color}`">{{scope.row.status_obj.name}}</span>
- </template>
- </el-table-column>
- <el-table-column prop="status" label="备注">
- <template slot-scope="scope">
- <el-button type="text" size="small" @click="manager_space('log',scope.row.id)">查看备注</el-button>
- </template>
- </el-table-column>
- <el-table-column prop="addtime" width="160px" label="发票日期"></el-table-column>
- <el-table-column prop="uid" label="关联用户">
- <template slot-scope="scope">
- <a :href="scope.row.user_link" style="color:#409EFF" target="_blank">{{scope.row.uid}}</a>
- </template>
- </el-table-column>
- <el-table-column fixed="right" width="250px" prop="uid" label="操作">
- <template slot-scope="scope">
- <el-button v-if="scope.row.order_type==1" type="text" @click="show_user_settlement(scope.row)">关联订单</el-button>
- <el-button v-if="scope.row.order_type==2" type="text" @click="show_order_settlement(scope.row)">关联订单</el-button>
- <el-button v-if="scope.row.is_gd==0" type="text" @click="add_gd(scope.row.id)">申请挂单</el-button>
- <el-button v-if="scope.row.is_gd==1" style="color: #E6A23C" type="text" @click="add_gd(scope.row.id)">取消挂单</el-button>
- <el-button type="text" @click="add_memo(scope.row.id,'添加备注')">备注</el-button>
- <el-dropdown @command="(command) => manager_space(command, scope.row.id)" style="margin-left: 10px">
- <el-button type="text">更多</el-button>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item v-if="scope.row.status!=4" command="edit">编辑</el-dropdown-item>
- <el-dropdown-item v-if="scope.row.status==1" command="agree">审核通过</el-dropdown-item>
- <el-dropdown-item v-if="scope.row.status==1" command="refuse">审核拒绝</el-dropdown-item>
- <el-dropdown-item command="log">操作日志</el-dropdown-item>
- <el-dropdown-item v-if="scope.row.status!=4" command="del">删除</el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
- </template>
- </el-table-column>
- </el-table>
- </el-col>
- </el-row>
- <el-pagination
- background
- style="margin-top: 10px"
- layout="prev, pager, next"
- @current-change="page_event"
- :page-size="search.pagesize"
- :total="search.total">
- </el-pagination>
- <pub_log v-if="drawer_obj.pub_log" :back="this" :pro="drawer_obj.id" action="user_invoice"></pub_log>
- <user_settlement v-if="drawer_obj.user_settlement" :fp_info="drawer_obj.obj" :back="this" :pro="drawer_obj.id"></user_settlement>
- <user_invoice_add v-if="drawer_obj.user_invoice_add" :back="this" :pro="drawer_obj.id"></user_invoice_add>
- <order_settlement v-if="drawer_obj.order_settlement" :fp_info="drawer_obj.obj" :back="this" :pro="drawer_obj.id"></order_settlement>
- <user_invoice_order_all v-if="drawer_obj.user_invoice_order_all" :fp_info="drawer_obj.obj" :back="this" :pro="drawer_obj.id"></user_invoice_order_all>
- </div>
- </template>
- <script>
- import user_invoice_add from '@/components/drawer/invoice/user_invoice_add';
- import pub_log from '@/components/drawer/pub_log';
- import user_settlement from '@/components/drawer/invoice/user_settlement';
- import order_settlement from '@/components/drawer/invoice/order_settlement';
- import user_invoice_order_all from '@/components/drawer/user_invoice_order/all';
- export default {
- props: [],
- components: {order_settlement,user_invoice_add,pub_log,user_settlement,user_invoice_order_all},
- props: {
- back:{
- type:Object
- },
- },
- data() {
- return {
- loading: true,
- drawer_obj:{
- user_settlement:false,
- order_settlement:false,
- user_invoice_add:false,
- user_invoice_order_all:false,
- id:0,
- pub_log:false,
- obj:{},
- },
- user_invoice_order:0,
- search: {
- pagesize: 15,
- total: 0,
- status:1,
- name: "",
- gd_total:0,
- },
- status:[
- ],
- list: []
- };
- },
- computed: {},
- watch: {},
- created() {
- },
- mounted() {
- this.getList();
- this.get_status();
- },
- methods: {
- show_user_settlement(row)
- {
- this.drawer_obj.obj=row;
- this.drawer_obj.id = row.id;
- this.drawer_obj.user_settlement = true;
- },
- show_user_invoice_order_my()
- {
- this.drawer_obj.obj={};
- this.drawer_obj.id = 0;
- this.drawer_obj.user_invoice_order_all = true;
- },
- show_order_settlement(row)
- {
- this.drawer_obj.obj=row;
- this.drawer_obj.id = row.id;
- this.drawer_obj.order_settlement = true;
- },
- show_user_invoice_add(id)
- {
- this.drawer_obj.id = id;
- this.drawer_obj.user_invoice_add = true;
- },
- async add_memo(id) {
- this.$prompt('请输入备注信息', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- }).then(async ({ value }) => {
- this.loading = true;
- let res =await this.$post("/uapi/pub/info/user/user_invoice/add_memo",{id:id,memo:value});
- if (res.status == 1) {
- this.$message({
- type: 'success',
- message: '成功!'
- });
- await this.getList();
- }
- this.loading = false;
- }).catch(() => {
- this.$message({
- type: 'info',
- message: '已取消'
- });
- });
- },
- async add_gd(id) {
- this.$prompt('请输入原因', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- }).then(async ({ value }) => {
- this.loading = true;
- let res =await this.$post("/uapi/pub/info/user/user_invoice/add_gd",{id:id,memo:value});
- if (res.status == 1) {
- this.$message({
- type: 'success',
- message: '成功!'
- });
- await this.getList();
- }
- this.loading = false;
- }).catch(() => {
- this.$message({
- type: 'info',
- message: '已取消'
- });
- });
- },
- manager_space(command,id)
- {
- if(command=='log')
- {
- this.drawer_obj.id=id;
- this.drawer_obj.pub_log=true;
- }
- else if(command=='del')
- {
- this.admin_del(id);
- }
- else if(command=='agree')
- {
- this.admin_agree(id);
- }
- else if(command=='refuse')
- {
- this.admin_refuse(id);
- }
- else if(command=='edit')
- {
- this.show_user_invoice_add(id);
- }
- },
- async getList() {
- this.loading = true;
- this.drawer = false;
- let res = await this.$post("/uapi/pub/info/user/user_invoice/admin_list", this.search);
- this.loading = false;
- if (res.status == 1) {
- this.list = res.data.list;
- this.search.total = res.data.total;
- this.search.pagesize = res.data.pagesize;
- this.search.gd_total=res.data.gd_total;
- }
- },
- async get_status() {
- this.loading = true;
- let res = await this.$post("/uapi/pub/info/user/user_invoice/get_status", this.search);
- this.loading = false;
- if (res.status == 1) {
- this.status = res.data.list;
- this.user_invoice_order=res.data.user_invoice_order;
- }
- },
- async admin_refuse(id) {
- this.$prompt('请输入拒绝的理由', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- }).then(async ({ value }) => {
- this.loading = true;
- let res =await this.$post("/uapi/pub/info/user/user_invoice/admin_refuse",{id:id,reason:value});
- if (res.status == 1) {
- this.$message({
- type: 'success',
- message: '成功!'
- });
- await this.getList();
- await this.get_status();
- }
- this.loading = false;
- }).catch(() => {
- this.$message({
- type: 'info',
- message: '已取消删除'
- });
- });
- },
- async admin_agree(id) {
- this.$confirm('是否确认通过?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(async () => {
- this.loading = true;
- let res =await this.$post("/uapi/pub/info/user/user_invoice/admin_agree",{id:id});
- if (res.status == 1) {
- this.$message({
- type: 'success',
- message: '成功!'
- });
- await this.getList();
- await this.get_status();
- }
- this.loading = false;
- }).catch(() => {
- this.$message({
- type: 'info',
- message: '已取消删除'
- });
- });
- },
- async admin_del(id) {
- this.$confirm('是否确认删除?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(async () => {
- this.loading = true;
- let res =await this.$post("/uapi/pub/info/user/user_invoice/admin_del",{id:id});
- if (res.status == 1) {
- this.$message({
- type: 'success',
- message: '成功!'
- });
- await this.getList();
- }
- this.loading = false;
- }).catch(() => {
- this.$message({
- type: 'info',
- message: '已取消删除'
- });
- });
- },
- page_event(page) {
- this.search.page = page;
- this.getList();
- },
- getData_(id) {
- this.search.status = id;
- this.search.page=0;
- this.getList();
- },
- search_() {
- this.search.page = 0;
- this.getList();
- }
- }
- };
- </script>
- <style scoped>
- .el-tag {
- cursor: pointer;
- }
- </style>
|