Просмотр исходного кода

Merge branch 'master' of http://git.minpay.cc/SupplyChain/front

zhaigk 3 лет назад
Родитель
Сommit
c3ef37758d

+ 18 - 0
front-vue/src/api/service/invoice/invoice.js

@@ -0,0 +1,18 @@
+import request from '@/utils/request'
+
+// 查询发票信息列表
+export function listInvoice(query) {
+  return request({
+    url: '/sc-service/ownInvoice/list',
+    method: 'get',
+    params: query
+  })
+}
+
+//查询发票详情
+export function getInvoiceDetail(ziiId) {
+  return request({
+    url: '/sc-service/ownInvoice/' + ziiId,
+    method: 'get'
+  })
+}

+ 387 - 0
front-vue/src/views/service/invoice/invoice.vue

@@ -0,0 +1,387 @@
+<template>
+  <div class="app-container">
+       <el-card class="fiche">
+          <right-toolbar :showSearch.sync="showSearch" @queryTable="getList">收起</right-toolbar>
+          <span style="margin-bottom: 10px;color:#333333;font:14px Helvetica Neue, Helvetica, PingFang SC, Tahoma, Arial,sans-serif">所选条件:</span>
+         <div  style="float: right;margin-right:1%">
+            <el-button type="cyan"  icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"  style="float: ;">重置</el-button>
+                         <column-setting :checkList="checkList" :tableList="tableList" :selfDom="selfDom" :tableId="tableId" style="margin-left:5px"></column-setting>
+
+         </div>
+         <hr  style="margin-top: 16px;">
+        <el-form :model="queryParams" ref="queryForm" :inline="true" v-if="showSearch" label-width="68px">
+            <el-form-item label="发票编码" prop="ziiNo">
+                <el-input
+                v-model.trim="queryParams.ziiNo"
+                placeholder="请输入发票编码"
+                clearable
+                size="small"
+                maxlength="25"
+                @keyup.enter.native="handleQuery"
+                />
+        </el-form-item>
+        <el-form-item label="购方识别" prop="ziiPurchaserNo">
+            <el-input
+            v-model.trim="queryParams.ziiPurchaserNo"
+            placeholder="请输入购方识别码"
+            clearable
+            size="small"
+            maxlength="25"
+            @keyup.enter.native="handleQuery"
+            />
+        </el-form-item>
+        <el-form-item label="销方识别" prop="ziiSellerNo">
+            <el-input
+            v-model.trim="queryParams.ziiSellerNo"
+            placeholder="请输入销方识别码"
+            clearable
+            size="small"
+            maxlength="25"
+            @keyup.enter.native="handleQuery"
+            />
+        </el-form-item>
+        <el-form-item label="开票日期" prop="ziiDate">
+            <el-date-picker  size="small"
+            v-model="queryParams.ziiDate"
+            style="width: 240px" 
+            unlink-panels
+            value-format="yyyy-MM-dd" 
+            type="daterange" 
+            range-separator="-" 
+            start-placeholder="开始日期" 
+            end-placeholder="结束日期">
+            </el-date-picker>
+        </el-form-item>
+        <el-form-item label="发票类型" prop="ziiType">
+            <el-input
+            v-model.trim="queryParams.ziiType"
+            placeholder="请输入发票类型"
+            clearable
+            size="small"
+            maxlength="25"
+            @keyup.enter.native="handleQuery"
+            />
+        </el-form-item>
+        <el-form-item label="购方" prop="ziiPurchaserName">
+            <el-input
+            v-model.trim="queryParams.ziiPurchaserName"
+            placeholder="请输入购方名称"
+            clearable
+            size="small"
+            maxlength="25"
+            @keyup.enter.native="handleQuery"
+            />
+        </el-form-item>
+        <el-form-item label="销方" prop="ziiSellerName">
+            <el-input
+            v-model.trim="queryParams.ziiSellerName"
+            placeholder="请输入销方名称"
+            clearable
+            size="small"
+            maxlength="25"
+            @keyup.enter.native="handleQuery"
+            />
+        </el-form-item>
+    </el-form>
+ </el-card>
+    <el-table v-loading="loading" :data="infList" @selection-change="handleSelectionChange" border>
+     <el-table-column label="序号" type="index" width="50" align="center">
+        <template slot-scope="scope">
+          <span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="发票编号" align="center" prop="ziiNo" v-if="uncheckList.ziiNo" :show-overflow-tooltip="true"/>
+      <el-table-column label="购方"  align="center" prop="ziiPurchaserName"  v-if="uncheckList.ziiPurchaserName" :show-overflow-tooltip="true"/>
+      <el-table-column label="购方识别码"  align="center" prop="ziiPurchaserNo"  v-if="uncheckList.ziiPurchaserNo" :show-overflow-tooltip="true"/>
+      <el-table-column label="销方"  align="center" prop="ziiSellerName"  v-if="uncheckList.ziiSellerName" :show-overflow-tooltip="true"/>
+      <el-table-column label="销方识别码" align="center" prop="ziiSellerNo"   v-if="uncheckList.ziiSellerNo" :show-overflow-tooltip="true"/>
+      <el-table-column label="开票日期" align="center" prop="ziiDate" :show-overflow-tooltip="true" v-if="uncheckList.ziiDate"/>
+      <el-table-column label="开票金额" align="center" :formatter="moneyFormat" prop="ziiAmount" :show-overflow-tooltip="true" v-if="uncheckList.ziiAmount"/>
+      <el-table-column label="合计金额" align="center" :formatter="moneyFormat" prop="ziiTotalAmount" :show-overflow-tooltip="true" v-if="uncheckList.ziiTotalAmount"/>
+      <el-table-column label="发票类型" align="center" prop="ziiType" :show-overflow-tooltip="true" v-if="uncheckList.ziiType"/>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='300' fixed="right" >
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-view"
+            @click="handleDetail(scope.row)"
+            v-hasPermi="['invoice:invoice:query']"
+          >详情</el-button>
+          <el-button
+            :disabled="!scope.row.ziiFile"
+            style="font-size:12px"
+            type="text"
+            icon="el-icon-download"
+            @click="handleDownload(scope.row)"
+            v-hasPermi="['invoice:invoice:download']"
+          >下载</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+    <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body :before-close = "cancel">
+      <el-form ref="form" :disabled="true" :model="form" :rules="rules" v-if="open" label-width="110px" class="demo-form-inline" :inline="true">
+        <el-form-item label="发票编号" prop="ziiNo">
+          <el-input v-model.trim="form.ziiNo"  maxlength="30" style="width: 200px"/>
+        </el-form-item>
+        <el-form-item label="购方" prop="ziiPurchaserName">
+          <el-input v-model.trim="form.ziiPurchaserName"  maxlength="30" style="width: 200px"/>
+        </el-form-item>
+        <el-form-item label="购方识别码" prop="ziiPurchaserNo">
+          <el-input v-model.trim="form.ziiPurchaserNo"  maxlength="30" style="width: 200px"/>
+        </el-form-item>
+        <el-form-item label="销方" prop="ziiSellerName">
+          <el-input v-model.trim="form.ziiSellerName"  maxlength="30" style="width: 200px"/>
+        </el-form-item>
+        <el-form-item label="销方识别码" prop="ziiSellerNo">
+          <el-input v-model.trim="form.ziiSellerNo"  maxlength="30" style="width: 200px"/>
+        </el-form-item>
+        <el-form-item label="开票日期" prop="ziiDate">
+          <el-date-picker clearable size="small" style="width: 200px"
+            v-model="form.ziiDate"
+            type="date"
+            value-format="yyyy-MM-dd"
+            >
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="开票金额" prop="ziiAmount">
+            <el-input v-model="form.ziiAmount" :max="9999999999.99" :precision="2" style="width: 200px" />
+        </el-form-item>
+        <el-form-item label="合计金额" prop="ziiTotalAmount">
+            <el-input v-model="form.ziiTotalAmount" :max="9999999999.99" :precision="2" style="width: 200px"/>
+        </el-form-item>
+        <el-form-item label="发票类型" prop="ziiType">
+          <el-input v-model.trim="form.ziiType"   style="width: 200px"/>
+        </el-form-item>
+      </el-form>  
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listInvoice,getInvoiceDetail} from "@/api/service/invoice/invoice";
+import Editor from '@/components/Editor';
+import {columnQuery,columnfilter} from "@/api/common/columnSetting";
+import ColumnSetting from '../../../components/Table/columnSetting.vue';
+export default {
+  name: "invoice",
+  components: {
+    Editor,
+    ColumnSetting 
+  },
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+       pageNum: 1,
+        pageSize: 10,
+        ziiId: null,
+        ziiNo:null,
+        ziiDate:[],
+        ziiAmount:null,
+        ziiType:null,
+        ziiPurchaserNo:null,
+        ziiSellerNo:null,
+        ziiTotalAmount:null
+      },
+      //发票数据
+      infList:[],
+      // 表单参数
+      form: {
+      },
+      //筛选按钮的数据列表,与table表头的数据一致 --显示隐藏列用
+      tableList: [
+            {
+              label: 'ziiNo',
+              value: '发票编号'
+            },
+            {
+              label: 'ziiPurchaserName',
+              value: '购方'
+            },
+            {
+              label: 'ziiPurchaserNo',
+              value: '购方识别码'
+            },
+            {
+              label: 'ziiSellerName',
+              value: '销方'
+            },
+            {
+              label: 'ziiSellerNo',
+              value: '销方识别码'
+            },
+            {
+              label: 'ziiDate',
+              value: '开票日期'
+            },
+            {
+              label: 'ziiAmount',
+              value: '开票金额'
+            },
+            {
+              label: 'ziiTotalAmount',
+              value: '合计金额'
+            },
+            {
+              label: 'ziiType',
+              value: '发票类型'
+            }
+            ],
+      checkList: [],//筛选列选中的数据列表--显示隐藏列用
+      uncheckList: {},//控制筛选列显示隐藏--显示隐藏列用
+      selfDom : this,
+      tableId:"/sc-service/ownInvoice/list",
+    };
+  },
+  created() {
+    this.getList();
+  },
+  activated () {
+    this.getList();
+  },  
+  mounted() {
+    this.columnQuery();
+  },
+  methods: {
+    //获取当前客户是否之前设置过列展示隐藏
+    columnQuery(){
+        //获取页面路径
+        var psfPagePath = window.location.pathname;
+        //用请求后台的url作为唯一标识
+        var psfTableName = this.tableId;
+        var columnForm = {};
+        columnForm.psfPagePath = psfPagePath;
+        columnForm.psfTableName = psfTableName;
+        columnQuery(columnForm).then(response => {
+         if(response.data && response.data.psfShowData){
+                this.checkList = response.data.psfShowData;
+         }
+         this.filter();
+      })
+    },
+    //控制隐藏显示的函数
+    filter(checkList) {
+      if (!!checkList) {
+        this.checkList = checkList;
+      }
+      columnfilter(this.selfDom);
+    },
+    /** 查询收开票信息列表 */
+    getList() {
+      this.loading = true;
+      listInvoice(this.queryParams).then(response => {
+        this.infList = response.data.records;
+        this.total = response.data.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    /** 查看按钮操作 */
+    handleDetail(row) {
+      this.reset();
+      const ziiId = row.ziiId || this.ziiId;
+      getInvoiceDetail(ziiId).then(response => {
+          this.open = true;
+          if(response.data){
+            this.form = response.data[0];
+            this.form.ziiAmount = this.amtFormat(this.form.ziiAmount);
+            this.form.ziiTotalAmount = this.amtFormat(this.form.ziiTotalAmount);
+          }
+      });
+     
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        ziiId: null,
+        ziiNo:null,
+        ziiDate:[],
+        ziiAmount:null,
+        ziiType:null,
+        ziiPurchaserNo:null,
+        ziiSellerNo:null,
+        ziiTotalAmount:null
+      };
+      this.resetForm("form");
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.cifId)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    //列表格式化金额
+    moneyFormat(row, column, cellValue) {
+        if(cellValue == null || cellValue== undefined || cellValue == ''){
+            cellValue = '0.00'
+        }
+        cellValue += '';
+        if (!cellValue.includes('.')) {
+            cellValue += '.00';
+        }
+        return cellValue.replace(/(\d)(?=(\d{3})+\.)/g, function ($0, $1) {
+            return $1 + ',';
+          }).replace(/\.$/, '');
+    },
+    //input格式化金额
+    amtFormat(cellValue) {
+      if(cellValue == null || cellValue== undefined || cellValue == ''){
+      cellValue = '0.00'
+      }
+      cellValue += '';
+            if (!cellValue.includes('.')) {
+      cellValue += '.00';
+      }
+      console.log(cellValue);
+            return cellValue.replace(/(\d)(?=(\d{3})+\.)/g, function ($0, $1) {
+              return $1 + ',';
+            }).replace(/\.$/, '');
+    }
+    
+
+  }
+};
+</script>