gHost před 1 rokem
rodič
revize
63ab16b300

+ 166 - 0
components/drawer/invoice/user_invoice_add.vue

@@ -0,0 +1,166 @@
+<template>
+  <el-drawer
+    title="上传发票"
+    size="600px"
+    :append-to-body="false"
+    :destroy-on-close="true"
+    :visible="true"
+    :modal-append-to-body="false"
+    :before-close="handleClose"
+    :wrapperClosable="false"
+    ref="drawer_close">
+    <el-form label-width="100px" style="padding: 20px" v-loading="loading" class="qs-form-add">
+      <el-form-item label="公司名称">
+        <el-input v-model="ruleForm.company_name"></el-input>
+      </el-form-item>
+      <el-form-item label="发票金额">
+        <el-input v-model="ruleForm.money"></el-input>
+      </el-form-item>
+      <el-form-item label="发票类型">
+        <el-radio-group v-model="ruleForm.type">
+          <el-radio :label="1">普票</el-radio>
+          <el-radio :label="2">专票</el-radio>
+        </el-radio-group>
+      </el-form-item>
+      <el-form-item label="业务类型">
+        <el-radio-group v-model="ruleForm.is_income">
+          <el-radio :label="1">进账</el-radio>
+          <el-radio :label="2">出账</el-radio>
+        </el-radio-group>
+      </el-form-item>
+      <el-form-item label="发票文件">
+        <el-upload
+          class="upload-demo"
+          action="/uapi/pub/upload"
+          :data="{type:'invoice'}"
+          :on-success="(response, file, fileList)=> upload_success(response, file, fileList,1)"
+          :on-remove="(file, fileList)=> upload_remove(file, fileList,1)"
+          accept="application/pdf,image/jpeg,image/gif,image/png"
+          multiple
+          :on-exceed="handleExceed"
+          :limit="1"
+          :file-list="user_invoice_fileList">
+          <div style="display:flex;align-items: center">
+            <div><el-button size="small" type="primary">点击上传</el-button></div>
+          </div>
+        </el-upload>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" @click="add()">保存</el-button>
+      </el-form-item>
+    </el-form>
+  </el-drawer>
+</template>
+
+<script>
+  export default {
+    props: {
+      action: {
+      },
+      pro: {
+      },
+      back:{
+        type:Object
+      },
+    },
+    data() {
+      return {
+        search: {
+          pagesize: 15,
+          page:0,
+          total:0,
+        },
+        user_invoice_fileList:[],
+        loading:false,
+        ruleForm: {
+          type:1,
+          is_income:2,
+        }
+      };
+    },
+    computed: {},
+    watch: {},
+    created() {},
+    async mounted() {
+        await this.getInfo();
+    },
+    methods: {
+      handleClose:function()
+      {
+        this.back.drawer_obj.user_invoice_add=false;
+        this.back.drawer_obj.id="";
+      },
+      async getInfo()
+      {
+        let id=this.pro;
+        if(id)
+        {
+          let res = await this.$post("/uapi/pub/info/user/user_invoice/admin_info",{id:id});
+          if (res.status == 1) {
+            if(res.data.file)
+            {
+              this.user_invoice_fileList=[{"name":"发票文件","url":res.data.file}]
+            }
+            this.ruleForm=res.data;
+          }
+        }
+      },
+      async add() {
+        this.loading = true;
+        let data=this.ruleForm;
+        let res = await this.$post("/uapi/pub/info/user/user_invoice/admin_add", data);
+        this.loading = false;
+        if (res.status == 1) {
+          this.$message.success(`添加成功`);
+          this.back.drawer_obj.user_invoice_add=false;
+          this.back.drawer_obj.id="";
+          this.back.getList();
+        }
+      },
+      handleExceed(files, fileList) {
+        this.$message.warning(`只能上传一个文件`);
+      },
+      upload_success(res, file, fileList,type){
+        if(res.status!=1)
+        {
+          if(type==1)
+          {
+            let fileList_=[];
+            for(var i=0;i<fileList.length;i++)
+            {
+              let data=fileList[i];
+              if(data.response.status==1)
+              {
+                fileList_.push(fileList[i])
+              }
+            }
+            this.user_invoice_fileList=fileList_;
+            this.ruleForm.file="";
+          }
+          this.$message.error(res.info);
+        }
+        else
+        {
+          if(type==1)
+          {
+            this.user_invoice_fileList=fileList;
+            this.ruleForm.file=res.data.url;
+          }
+        }
+      },
+      upload_remove( file, fileList,type){
+        if(type==1)
+        {
+          this.user_invoice_fileList=fileList;
+          this.ruleForm.file="";
+        }
+      }
+    }
+  };
+</script>
+
+<style scoped>
+  .el-tag {
+    cursor: pointer;
+  }
+</style>

+ 106 - 0
components/drawer/invoice/user_settlement.vue

@@ -0,0 +1,106 @@
+<template>
+  <el-drawer
+    title="关联订单"
+    size="60%"
+    :append-to-body="false"
+    :destroy-on-close="true"
+    :visible="true"
+    :modal-append-to-body="false"
+    :before-close="handleClose"
+    :wrapperClosable="false"
+    ref="drawer_close">
+    <div v-loading="loading" style="padding: 20px"  class="block">
+      <el-table row-key="id" :data="list">
+        <el-table-column prop="title" label="关联项目">
+          <template slot-scope="scope">
+            <a :href="scope.row.link" style="color: #006eff" target="_blank">{{scope.row.title}}</a>
+          </template>
+        </el-table-column>
+        <el-table-column prop="money" label="应付金额">
+          <template slot-scope="scope">
+            <span>{{scope.row.y_money}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="sf_money" label="实付金额">
+          <template slot-scope="scope">
+            <span>{{scope.row.sf_money}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="sf_money" label="结算费率">
+          <template slot-scope="scope">
+            <span>{{scope.row.js_rate}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="status" label="开票类型">
+          <template slot-scope="scope">
+            <span>{{scope.row.invoice_type_text}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="status" label="订单状态">
+          <template slot-scope="scope">
+            <span>{{scope.row.status_text}}</span>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+  </el-drawer>
+</template>
+
+<script>
+  export default {
+    props: {
+      action: {
+      },
+      pro: {
+      },
+      back:{
+        type:Object
+      },
+    },
+    data() {
+      return {
+        search: {
+          pagesize: 15,
+          page:0,
+          total:0,
+        },
+        loading:true,
+        list: []
+      };
+    },
+    computed: {},
+    watch: {},
+    created() {},
+    mounted() {
+      this.getList();
+    },
+    methods: {
+      handleClose:function()
+      {
+        this.back.drawer_obj.user_settlement=false;
+        this.back.drawer_obj.id="";
+      },
+      async getList() {
+        this.loading = true;
+        let data = this.search;
+        data.user_invoice_id = this.pro;
+        let res = await  this.$post("/uapi/pub/info/user/user_settlement/admin_list",data);
+        this.loading = false;
+        if (res.status == 1) {
+          this.list = res.data.list;
+          this.search.total = res.data.total;
+        }
+      },
+      page_event(page) {
+        this.search.page = page;
+        this.getList();
+      },
+    }
+  };
+</script>
+
+<style scoped>
+  .el-tag {
+    cursor: pointer;
+  }
+</style>

+ 98 - 0
components/drawer/pub_log.vue

@@ -0,0 +1,98 @@
+<template>
+  <el-drawer
+    title="操作日志"
+    size="40%"
+    :append-to-body="false"
+    :destroy-on-close="true"
+    :visible="true"
+    :modal-append-to-body="false"
+    :before-close="handleClose"
+    :wrapperClosable="false"
+    ref="drawer_close">
+    <div v-loading="loading" style="margin-top: 20px;"  class="block">
+      <el-timeline>
+        <el-timeline-item v-for="item in list" :timestamp="item.addtime" placement="top">
+          <p style="display:flex;flex-direction: row">
+            <span style="display: flex;flex-direction: column">
+              <span :style="`margin-right:5px;width: 40px;height: 40px;display: inline-block;border: 50%;background:url(${item.user.icon_url});background-size: contain;background-position: center;`"></span>
+              <div style="flex: 1"></div>
+            </span>
+            <span style="flex: 1;line-height: 30px;word-break:break-all">
+              <a  style="color: #006eff;margin-right: 5px;" target="_blank" :href="`${item.root_url}/rooter/user/${item.user.uid}`">{{item.user.nickname}}</a>{{item.content}}
+            </span>
+          </p>
+        </el-timeline-item>
+      </el-timeline>
+
+      <el-pagination
+        v-if="search.total>search.pagesize"
+        background
+        style="margin-left: 30px;margin-top: 30px"
+        layout="total,prev, pager, next"
+        @current-change="page_event"
+        :page-size="search.pagesize"
+        :total="search.total">
+      </el-pagination>
+    </div>
+  </el-drawer>
+</template>
+
+<script>
+  export default {
+    props: {
+      action: {
+      },
+      pro: {
+      },
+      back:{
+        type:Object
+      },
+    },
+    data() {
+      return {
+        search: {
+          pagesize: 15,
+          page:0,
+          total:0,
+        },
+        loading:true,
+        list: []
+      };
+    },
+    computed: {},
+    watch: {},
+    created() {},
+    mounted() {
+      this.getList();
+    },
+    methods: {
+      handleClose:function()
+      {
+        this.back.drawer_obj.pub_log=false;
+        this.back.drawer_obj.id="";
+      },
+      async getList() {
+        this.loading = true;
+        let data = this.search;
+        data.pro = this.pro;
+        data.action = this.action;
+        let res = await  this.$post("/uapi/pub/info/user/behavior_log/list",data);
+        this.loading = false;
+        if (res.status == 1) {
+          this.list = res.data.list;
+          this.search.total = res.data.total;
+        }
+      },
+      page_event(page) {
+        this.search.page = page;
+        this.getList();
+      },
+    }
+  };
+</script>
+
+<style scoped>
+  .el-tag {
+    cursor: pointer;
+  }
+</style>

+ 264 - 0
pages/main/index/invoice.vue

@@ -0,0 +1,264 @@
+<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>
+      <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.name"></el-input>
+        </el-form-item>
+        <el-form-item label-width="5px">
+          <el-button @click="search_" size="small" type="primary">查询</el-button>
+        </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="company_name" 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" 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="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="addtime" label="发票日期"></el-table-column>
+          <el-table-column fixed="right" width="160px" prop="uid" label="操作">
+            <template  slot-scope="scope">
+              <el-button type="text" @click="show_user_settlement(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" :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>
+  </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';
+  export default {
+    props: [],
+    components: {user_invoice_add,pub_log,user_settlement,user_invoice_add},
+    data() {
+      return {
+        loading: true,
+        drawer_obj:{
+          user_settlement:false,
+          user_invoice_add:false,
+          id:0,
+          pub_log:false,
+        },
+        search: {
+          pagesize: 15,
+          total: 0,
+          status:1,
+          name: "",
+        },
+        status:[
+
+        ],
+        list: []
+      };
+    },
+    computed: {},
+    watch: {},
+    created() {
+    },
+    mounted() {
+      this.getList();
+      this.get_status();
+    },
+    methods: {
+      show_user_settlement(id)
+      {
+        this.drawer_obj.id = id;
+        this.drawer_obj.user_settlement = true;
+      },
+      show_user_invoice_add(id)
+      {
+        this.drawer_obj.id = id;
+        this.drawer_obj.user_invoice_add = true;
+      },
+      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;
+        }
+      },
+      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;
+        }
+      },
+      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>