Browse Source

缴费查询页面初版

shiyi 7 years ago
parent
commit
347155396a

+ 38 - 0
src/dashoo.cn/backend/api/business/oilsupplier/paymentselect/paymentselect.go

@@ -0,0 +1,38 @@
+package paymentselect
+
+import "time"
+
+type OilPaymentSelect struct {
+	Id             int       `xorm:"not null pk autoincr INT(11)"`
+	SupplierId     int       `xorm:"comment('Supplier表') INT(11)"`
+	SupplierCertId int       `xorm:"comment('SupplierCert表') INT(11)"`
+	Amount         string    `xorm:"comment('缴费金额') DECIMAL(10,2)"`
+	IsPay          string    `xorm:"comment('是否缴费 1 是 2否') VARCHAR(5)"`
+	PayMode        string    `xorm:"comment('缴费方式') VARCHAR(10)"`
+	PayType        string    `xorm:"comment('缴费类型 1 准入缴费 2 年审缴费') VARCHAR(10)"`
+	PayDate        time.Time `xorm:"comment('缴费日期') DATETIME"`
+	BankSerialNum  string    `xorm:"comment('银行流水号') VARCHAR(50)"`
+	BankName       string    `xorm:"comment('银行名称') VARCHAR(100)"`
+	Remark         string    `xorm:"comment('备注') VARCHAR(255)"`
+	CreateUserId   int       `xorm:"INT(11)"`
+	CreateOn       time.Time `xorm:"DATETIME"`
+	CreateBy       string    `xorm:"VARCHAR(50)"`
+	ModifiedOn     time.Time `xorm:"DATETIME"`
+	ModifiedUserId int       `xorm:"INT(11)"`
+	ModifiedBy     string    `xorm:"VARCHAR(50)"`
+
+}
+
+type PaymentselectList struct {
+	OilPaymentSelect      `xorm:"extends"`
+	SupplierTypeCode string
+	SupplierTypeName string
+	SupplierName     string
+	AccessCardNo     string
+	Zhunru 			 string
+	Zengxiang 		 string
+	Nianshen		 string
+	Zongji			 string
+	Beizhu			 string
+
+}

+ 71 - 0
src/dashoo.cn/backend/api/business/oilsupplier/paymentselect/paymentselectService.go

@@ -0,0 +1,71 @@
+package paymentselect
+
+import (
+	. "dashoo.cn/utils/db"
+	"github.com/go-xorm/xorm"
+	"strconv"
+)
+
+type PaymentSelectService struct {
+	ServiceBase
+}
+
+func GetPaymentSelectService(xormEngine *xorm.Engine) *PaymentSelectService {
+	s := new(PaymentSelectService)
+	s.DBE = xormEngine
+	return s
+}
+
+func (s *PaymentSelectService) GetPaymentselectList(pageIndex, itemsPerPage int64, order string, asc string, entitiesPtr interface{}, where string) (total int64) {
+	var err error
+	var resultsSlice []map[string][]byte
+	sqlconunt := "SELECT COUNT(Id) FROM OilPaymentInfo WHERE IsPay = '1' "
+
+	sql := "SELECT c.AccessCardNo,s.SupplierName,c.SupplierTypeName,p.PayDate, " +
+		"sum(case  when p.PayType = '1' then Amount   else 0 end) as Zhunru, " +
+		"sum(case  when p.PayType = '2' then Amount   else 0 end) as Nianshen, " +
+		"sum(case  when p.PayType = '3' then Amount   else 0 end) as Zengxiang, " +
+		"sum(p.Amount) as Zongji, " +
+		"min(p.Remark) as Beizhu " +
+		"FROM OilPaymentInfo p " +
+		"LEFT JOIN OilSupplier s ON p.SupplierId = s.Id "+
+		"LEFT JOIN OilSupplierCert c ON p.SupplierCertId = c.Id " +
+		"group by c.AccessCardNo,s.SupplierName,c.SupplierTypeName,p.PayDate " +
+		" Order By " + order + asc + " Limit " + strconv.Itoa(int(itemsPerPage)) +" OFFSET " + strconv.Itoa((int(pageIndex)-1)*int(itemsPerPage))
+
+	resultsSlice, err = s.DBE.Query(sqlconunt)
+	err = s.DBE.SQL(sql).Find(entitiesPtr)
+
+	LogError(err)
+	if len(resultsSlice) > 0 {
+		results := resultsSlice[0]
+		for _, value := range results {
+			total, err = strconv.ParseInt(string(value), 10, 64)
+			LogError(err)
+			break
+		}
+	}
+	return total
+
+}
+
+/*func (s *PaymentSelectService) GetPaymentselectById(Id string, entitiesPtr interface{}) (err error) {
+
+	sql := "SELECT c.AccessCardNo,b.SupplierName,c.SupplierTypeName,a.PayDate, " +
+		"sum(case  when a.PayType = '1' then Amount   else 0 end) as zhunru, " +
+		"sum(case  when a.PayType = '2' then Amount   else 0 end) as nianshen, " +
+		"sum(case  when a.PayType = '3' then Amount   else 0 end) as zengxiang, " +
+		"sum(a.Amount) as amount, " +
+		"min(a.Remark) as remark " +
+		"FROM OilPaymentInfo a " +
+		"LEFT JOIN OilSupplier b ON a.SupplierId = b.Id "+
+		"LEFT JOIN OilSupplierCert c ON a.SupplierCertId = c.Id " +
+		"group by c.AccessCardNo,b.SupplierName,c.SupplierTypeName,a.PayDate "
+
+	err = s.DBE.SQL(sql).Find(&entitiesPtr)
+
+	LogError(err)
+
+	return err
+
+}*/

+ 72 - 0
src/dashoo.cn/backend/api/controllers/oilsupplier/paymentselect.go

@@ -0,0 +1,72 @@
+package oilsupplier
+
+import (
+	"dashoo.cn/backend/api/business/oilsupplier/paymentselect"
+	. "dashoo.cn/backend/api/controllers"
+	"dashoo.cn/utils"
+)
+
+type PaymentSelectController struct {
+	BaseController
+}
+
+// @Title 获取列表
+// @Description get user by token
+// @Success 200 {object} []paymentinfo.PaymentinfoList
+// @router /list [get]
+func (this *PaymentSelectController) GetEntityList() {
+
+	//获取分页信息
+	page := this.GetPageInfoForm()
+
+	orderby := "p.PayDate"
+	where := " 1=1 "
+	asc := " DESC"
+	SupplierTypeCode := this.GetString("SupplierTypeCode")
+	SupplierName := this.GetString("SupplierName")
+	IsPay := this.GetString("IsPay")
+
+	if IsPay != "" {
+		where = where + " and p.IsPay = '" + IsPay +"'"
+	}
+
+	if SupplierTypeCode != "" {
+		where = where + " and c.SupplierTypeCode like '%" + SupplierTypeCode + "%'"
+	}
+	if SupplierName != "" {
+		where = where + " and s.SupplierName like '%" + SupplierName + "%'"
+	}
+
+
+	//svc := suppliercert.GetOilSupplierCertService(utils.DBE)
+	//var list []suppliercert.OilSupplierCert
+	svc := paymentselect.GetPaymentSelectService(utils.DBE)
+	var list []paymentselect.PaymentselectList
+
+
+	total := svc.GetPaymentselectList( page.CurrentPage, page.Size, orderby, asc, &list, where)
+	//total := svc.GetPagingEntitiesWithOrderBytbl("", page.CurrentPage, page.Size, orderby, asc, &list, where)
+
+
+	var datainfo DataInfo
+	datainfo.Items = list
+	datainfo.CurrentItemCount = total
+	datainfo.PageIndex = page.CurrentPage
+	datainfo.ItemsPerPage = page.Size
+	this.Data["json"] = &datainfo
+	this.ServeJSON()
+}
+
+// @Title 获取实体
+// @Description 获取实体
+// @Success 200 {object} paymentselect.PaymentselectList
+// @router /get/:id [get]
+/*func (this *PaymentSelectController) GetEntity() {
+	Id := this.Ctx.Input.Param(":id")
+	var model []paymentselect.PaymentselectList
+	svc := paymentselect.GetPaymentSelectService(utils.DBE)
+	svc.GetPaymentselectById(Id, &model)
+
+	this.Data["json"] = &model[0]
+	this.ServeJSON()
+}*/

+ 6 - 0
src/dashoo.cn/backend/api/routers/router.go

@@ -324,6 +324,12 @@ func init() {
 				&oilsupplier.PaymentInfoController{},
 			),
 		),
+		//缴费查询
+		beego.NSNamespace("/paymentselect",
+			beego.NSInclude(
+				&oilsupplier.PaymentSelectController{},
+			),
+		),
 		//资质变更
 		beego.NSNamespace("/qualchange",
 			beego.NSInclude(

+ 15 - 0
src/dashoo.cn/frontend_web/src/api/oilsupplier/paymentselect.js

@@ -0,0 +1,15 @@
+export default {
+  getList (CreateOn, params, myAxios) {
+    return myAxios({
+      url: '/paymentselect/list?CreateOn=' + CreateOn,
+      method: 'GET',
+      params: params
+    })
+  },
+  getEntity (entityId, myAxios) {
+    return myAxios({
+      url: '/paymentselect/get/' + entityId,
+      method: 'GET'
+    })
+  }
+}

+ 288 - 0
src/dashoo.cn/frontend_web/src/pages/oilsupplier/paymentselect/index.vue

@@ -0,0 +1,288 @@
+<template>
+  <div>
+    <el-breadcrumb class="heading">
+      <el-breadcrumb-item :to="{ path: '/' }">平台首页</el-breadcrumb-item>
+      <el-breadcrumb-item>缴费信息列表</el-breadcrumb-item>
+    </el-breadcrumb>
+    <el-card class="box-card" style="height: calc(100vh - 115px);">
+      <div slot="header">
+
+        <!--设置跳转明细表跟汇总表-->
+        <!--<span>
+          <el-button>缴费明细表</el-button>
+        </span>
+        <span>
+          <el-button>缴费汇总表</el-button>
+        </span>-->
+
+
+        <el-form ref="form" :inline="true" style="float: right; margin-top: -10px">
+          <el-form-item label="年度">
+            <el-date-picker size="mini" style="width: 220px" v-model="CreateOn" type="daterange" range-separator="至"
+                            start-placeholder="生成日期" end-placeholder="结束日期"></el-date-picker>
+          </el-form-item>
+          <el-form-item label="公司名称">
+            <el-input v-model="searchForm.SupplierName" placeholder="请输入" style="width: 100%"></el-input>
+          </el-form-item>
+          <el-form-item label="准入类型">
+            <el-select size="mini" style="width:100px" v-model="searchForm.SupplierTypeCode" placeholder="准入类别">
+              <el-option label="全部" value=""></el-option>
+              <el-option label="物资类" value="01"></el-option>
+              <el-option label="基建类" value="02"></el-option>
+              <el-option label="技术服务类" value="03"></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item>
+            <el-dropdown split-button type="primary" size="mini" @click="handleSearch" @command="searchCommand">
+              查询
+              <el-dropdown-menu slot="dropdown">
+
+                <el-dropdown-item command="clear">查询重置</el-dropdown-item>
+              </el-dropdown-menu>
+            </el-dropdown>
+          </el-form-item>
+        </el-form>
+      </div>
+
+      <!--<el-card class="payment_detail">  想要设置跳转页面-->
+        <el-table :data="entityList" border height="calc(100vh - 243px)" style="width: 100%" @sort-change="orderby">
+
+
+          <el-table-column sortable min-width="120" align="center" show-overflow-tooltip prop="AccessCardNo" label="准入证号"></el-table-column>
+          <el-table-column sortable min-width="120" align="center" show-overflow-tooltip prop="SupplierName" label="企业名称"></el-table-column>
+          <el-table-column sortable min-width="120" align="center" show-overflow-tooltip prop="SupplierTypeName" label="准入类别"></el-table-column>
+
+
+          <el-table-column min-width="210" align="center" show-overflow-tooltip label="款项类别">
+            <template slot-scope="scope">
+              {{ transferStr(scope.row.PayType) }}
+            </template>
+            <el-table-column sortable min-width="70" align="center" show-overflow-tooltip prop="Zhunru" label="新准入">
+              <template slot-scope="scope">
+                {{ scope.row.Zhunru <= 0 ? "" : scope.row.Zhunru}}
+              </template>
+
+            </el-table-column>
+            <el-table-column sortable min-width="70" align="center" show-overflow-tooltip prop="Zengxiang" label="增项">
+              <template slot-scope="scope">
+                {{ scope.row.Zengxiang <= 0 ? "" : scope.row.Zengxiang}}
+              </template>
+
+            </el-table-column>
+            <el-table-column sortable min-width="70" align="center" show-overflow-tooltip prop="Nianshen" label="年审">
+              <template slot-scope="scope">
+                {{ scope.row.Nianshen <= 0 ? "" : scope.row.Nianshen}}
+              </template>
+
+            </el-table-column>
+          </el-table-column>
+
+
+          <el-table-column sortable min-width="120" align="center" show-overflow-tooltip prop="Zongji" label="金额合计"></el-table-column>
+          <el-table-column sortable min-width="120" align="center" show-overflow-tooltip prop="PayDate" label="缴费日期">
+            <template slot-scope="scope">
+              {{ jstimehandle(scope.row.PayDate+'') }}
+            </template>
+          </el-table-column>
+          <el-table-column sortable min-width="120" align="center" show-overflow-tooltip prop="Beizhu" label="备注"></el-table-column>
+        </el-table>
+
+
+        <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
+                       :page-sizes="[10, 15, 20, 25]" :page-size="size" layout="total, sizes, prev, pager, next, jumper"
+                       :total="currentItemCount">
+        </el-pagination>
+      </el-card>
+
+  </div>
+</template>
+<script>
+  import {
+    mapGetters
+  } from 'vuex'
+  import api from '@/api/oilsupplier/paymentselect'
+
+  export default {
+    computed: {
+      ...mapGetters({
+        authUser: 'authUser'
+      })
+    },
+    name: 'paymentinfo',
+
+    data () {
+      return {
+        dialogVisible: false,
+        // 列表数据
+        selectsupplierlist: [],
+        entityList: [],
+        // 分页参数
+        size: 10,
+        currentPage: 1,
+        currentItemCount: 0,
+        // 列表排序
+        Column: {
+          Order: '',
+          Prop: ''
+        },
+        // 查询时间
+        CreateOn: [new Date(new Date().getTime() - 30 * 24 * 60 * 60 * 1000), new Date()],
+        // 查询项
+        searchFormReset: {},
+        entityForm: {
+          Id: '',
+          SupplierName: '',
+          SupplierId: '',
+          SupplierTypeName: ''
+        },
+        searchForm: {
+          Id: '',
+          SupplierTypeCode: '',
+          SupplierName: '',
+          IsPay: '1',
+          CreateOn: '',
+          CreateUserId: '',
+          CreateBy: '',
+          ModifiedOn: '',
+          ModifiedUserId: '',
+          ModifiedBy: ''
+
+        }
+      }
+    },
+    created () {
+      // 查询条件初始值备份
+      Object.assign(this.searchFormReset, this.searchForm)
+      // 查询列表
+      this.initDatas()
+      // this.getDictOptions()
+    },
+    methods: {
+      initDatas () {
+        // 分页及列表条件
+        let params = {
+          _currentPage: this.currentPage,
+          _size: this.size,
+          Order: this.Column.Order,
+          Prop: this.Column.Prop
+        }
+        let myCreateOn = []
+        // 解析时间
+        if (this.CreateOn.length === 2) {
+          this.CreateOn[1].setHours(23)
+          this.CreateOn[1].setMinutes(59)
+          this.CreateOn[1].setSeconds(59)
+          myCreateOn.push(this.formatDateTime(this.CreateOn[0]))
+          myCreateOn.push(this.formatDateTime(this.CreateOn[1]))
+        }
+        // 查询条件
+        Object.assign(params, this.searchForm)
+        // 访问接口
+        console.log(params)
+        api.getList(myCreateOn.join(','), params, this.$axios).then(res => {
+          this.entityList = res.data.items
+          this.currentItemCount = res.data.currentItemCount
+        }).catch(err => {
+          console.error(err)
+        })
+      },
+
+      getDictOptions () {
+        api.getDictList(this.$axios).then(res => {
+          // this.dictOptions.customerList = res.data.items['customerList']
+          // this.dictOptions.projectList = res.data.items['projectList']
+
+        }).catch(err => {
+          console.error(err)
+        })
+      },
+
+      searchCommand (command) {
+        if (command === 'search') {
+          this.dialogVisible = true
+        } else if (command === 'clear') {
+          this.clearSearch()
+        }
+      },
+      // 列表排序功能
+      orderby (column) {
+        if (column.order === 'ascending') {
+          this.Column.Order = 'asc'
+        } else if (column.order === 'descending') {
+          this.Column.Order = 'desc'
+        }
+        this.Column.Prop = column.prop
+        this.initDatas()
+      },
+      clearSearch () {
+        Object.assign(this.searchForm, this.searchFormReset)
+        // this.searchForm = this.searchFormReset;
+        this.CreateOn = ''
+        this.initDatas()
+      },
+
+      transferStr (val) {
+        if (val === '1') {
+          return '准入缴费'
+        }else if (val === '2') {
+          return '年审缴费'
+        }else if (val === '3') {
+          return '增项缴费'
+        } else {
+          return val
+        }
+      },
+
+      handleSearch () {
+        this.currentPage = 1
+        this.dialogVisible = false
+        this.initDatas()
+      },
+      handleCurrentChange (value) {
+        this.currentPage = value
+        this.initDatas()
+      },
+      handleSizeChange (value) {
+        this.size = value
+        this.currentPage = 1
+        this.initDatas()
+      },
+
+      GetCommand (cmdType, row) {
+        let cmd = {}
+        cmd.Command = cmdType
+        cmd.row = row
+        return cmd
+      },
+
+      jstimehandle (val) {
+        if (val === '') {
+          return '----'
+        } else if (val === '0001-01-01T08:00:00+08:00') {
+          return '----'
+        } else if (val === '5000-01-01T23:59:59+08:00') {
+          return '永久'
+        } else {
+          val = val.replace('T', ' ')
+          return val.substring(0, 10)
+        }
+      },
+
+      formatDateTime (date) {
+        var y = date.getFullYear()
+        var m = date.getMonth() + 1
+        m = m < 10 ? ('0' + m) : m
+        var d = date.getDate()
+        d = d < 10 ? ('0' + d) : d
+        var h = date.getHours()
+        var minute = date.getMinutes()
+        minute = minute < 10 ? ('0' + minute) : minute
+        return y + '-' + m + '-' + d + ' ' + h + ':' + minute
+      }
+    }
+  }
+</script>
+
+<style lang="scss">
+
+</style>