2
3
shiyi преди 6 години
родител
ревизия
c29bfef72c

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

@@ -29,10 +29,10 @@ type PaymentselectList struct {
 	SupplierTypeName string
 	SupplierName     string
 	AccessCardNo     string
-	Zhunru 			 string
-	Zengxiang 		 string
-	Nianshen		 string
-	Zongji			 string
-	Beizhu			 string
+	Access 			 string
+	Addition 		 string
+	Annual			 string
+	Sums			 string
+	Remarks			 string
 
 }

+ 26 - 30
src/dashoo.cn/backend/api/business/oilsupplier/paymentselect/paymentselectService.go

@@ -17,55 +17,51 @@ func GetPaymentSelectService(xormEngine *xorm.Engine) *PaymentSelectService {
 }
 
 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' "
+	sqlconunt := "SELECT COUNT(Id) FROM OilPaymentInfo WHERE Amount > 0 "
 
 	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 " +
+		"sum(case  when p.PayType = '1' then Amount   else 0 end) as Access, " +
+		"sum(case  when p.PayType = '2' then Amount   else 0 end) as Annual, " +
+		"sum(case  when p.PayType = '3' then Amount   else 0 end) as Addition, " +
+		"sum(p.Amount) as Sums, " +
+		"min(p.Remark) as Remarks " +
 		"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 " +
+		"having " + where +
 		" 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)
+	s.DBE.SQL(sql).Find(entitiesPtr)
+
+	resultsSlice, _ = s.DBE.Query(sqlconunt)
+
 	if len(resultsSlice) > 0 {
 		results := resultsSlice[0]
 		for _, value := range results {
-			total, err = strconv.ParseInt(string(value), 10, 64)
-			LogError(err)
+			total, _ = strconv.ParseInt(string(value), 10, 64)
 			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)
+func (s *PaymentSelectService) GetPaymentselectSumList( order string, asc string, entitiesPtr interface{}, where string) {
 
-	LogError(err)
-
-	return err
+	sql := "SELECT c.SupplierTypeName, " +
+		"sum(case  when p.PayType = '1' then Amount   else 0 end) as Access, " +
+		"sum(case  when p.PayType = '2' then Amount   else 0 end) as Annual, " +
+		"sum(case  when p.PayType = '3' then Amount   else 0 end) as Addition, " +
+		"sum(p.Amount) as Sums " +
+		"FROM OilPaymentInfo p " +
+		"LEFT JOIN OilSupplier s ON p.SupplierId = s.Id "+
+		"LEFT JOIN OilSupplierCert c ON p.SupplierCertId = c.Id " +
+		"group by c.SupplierTypeName " +
+		" Order By " + order + asc
 
-}*/
+	s.DBE.SQL(sql).Find(entitiesPtr)
+}

+ 30 - 17
src/dashoo.cn/backend/api/controllers/oilsupplier/paymentselect.go

@@ -4,15 +4,16 @@ import (
 	"dashoo.cn/backend/api/business/oilsupplier/paymentselect"
 	. "dashoo.cn/backend/api/controllers"
 	"dashoo.cn/utils"
+	"strings"
 )
 
 type PaymentSelectController struct {
 	BaseController
 }
 
-// @Title 获取列表
+// @Title 获取明细列表
 // @Description get user by token
-// @Success 200 {object} []paymentinfo.PaymentinfoList
+// @Success 200 {object} []paymentselect.PaymentselectList
 // @router /list [get]
 func (this *PaymentSelectController) GetEntityList() {
 
@@ -24,18 +25,22 @@ func (this *PaymentSelectController) GetEntityList() {
 	asc := " DESC"
 	SupplierTypeCode := this.GetString("SupplierTypeCode")
 	SupplierName := this.GetString("SupplierName")
-	IsPay := this.GetString("IsPay")
-
-	if IsPay != "" {
-		where = where + " and p.IsPay = '" + IsPay +"'"
-	}
+	CreateOn := this.GetString("CreateOn")
 
 	if SupplierTypeCode != "" {
-		where = where + " and c.SupplierTypeCode like '%" + SupplierTypeCode + "%'"
+		where = where + " and c.SupplierTypeName like '%" + SupplierTypeCode + "%'"
 	}
 	if SupplierName != "" {
 		where = where + " and s.SupplierName like '%" + SupplierName + "%'"
 	}
+	if CreateOn != "" {
+		dates := strings.Split(CreateOn, ",")
+		if len(dates) == 2 {
+			minDate := dates[0]
+			maxDate := dates[1]
+			where = where + " and PayDate>='" + minDate + "' and PayDate<='" + maxDate + "'"
+		}
+	}
 
 
 	//svc := suppliercert.GetOilSupplierCertService(utils.DBE)
@@ -57,16 +62,24 @@ func (this *PaymentSelectController) GetEntityList() {
 	this.ServeJSON()
 }
 
-// @Title 获取实体
-// @Description 获取实体
+// @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
+// @router /sumlist [get]
+func (this *PaymentSelectController) GetEntitySumList() {
+
+	orderby := "c.SupplierTypeName"
+	where := " 1=1 "
+	asc := " DESC"
+
 	svc := paymentselect.GetPaymentSelectService(utils.DBE)
-	svc.GetPaymentselectById(Id, &model)
+	var list []paymentselect.PaymentselectList
+
+
+	svc.GetPaymentselectSumList(orderby, asc, &list, where)
 
-	this.Data["json"] = &model[0]
+	var datainfo DataInfo
+	datainfo.Items = list
+	this.Data["json"] = &datainfo
 	this.ServeJSON()
-}*/
+}

+ 4 - 3
src/dashoo.cn/frontend_web/src/api/oilsupplier/paymentselect.js

@@ -6,10 +6,11 @@ export default {
       params: params
     })
   },
-  getEntity (entityId, myAxios) {
+  getSumList (CreateOn, params, myAxios) {
     return myAxios({
-      url: '/paymentselect/get/' + entityId,
-      method: 'GET'
+      url: '/paymentselect/sumlist?CreateOn=' + CreateOn,
+      method: 'GET',
+      params: params
     })
   }
 }

+ 79 - 56
src/dashoo.cn/frontend_web/src/pages/oilsupplier/paymentselect/index.vue

@@ -7,14 +7,8 @@
     <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="年度">
@@ -27,9 +21,9 @@
           <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-option label="物资类" value="物资类"></el-option>
+              <el-option label="基建类" value="基建类"></el-option>
+              <el-option label="技术服务类" value="技术服务类"></el-option>
             </el-select>
           </el-form-item>
           <el-form-item>
@@ -42,56 +36,94 @@
             </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">
 
+      </div>
 
-          <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-tabs v-model="activeName" type="card" @tab-click="handleClick">
+        <el-tab-pane label="缴费明细表" name="first">
+          <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="新准入">
+            <el-table-column min-width="210" align="center" show-overflow-tooltip label="款项类别">
               <template slot-scope="scope">
-                {{ scope.row.Zhunru <= 0 ? "" : scope.row.Zhunru}}
+                {{ transferStr(scope.row.PayType) }}
               </template>
+              <el-table-column sortable min-width="70" align="center" show-overflow-tooltip prop="Access" label="新准入">
+                <template slot-scope="scope">
+                  {{ scope.row.Access <= 0 ? "" : scope.row.Access}}
+                </template>
+              </el-table-column>
+
+              <el-table-column sortable min-width="70" align="center" show-overflow-tooltip prop="Annual" label="年审">
+                <template slot-scope="scope">
+                  {{ scope.row.Annual <= 0 ? "" : scope.row.Annual}}
+                </template>
+              </el-table-column>
 
+              <el-table-column sortable min-width="70" align="center" show-overflow-tooltip prop="Addition" label="增项">
+                <template slot-scope="scope">
+                  {{ scope.row.Addition <= 0 ? "" : scope.row.Addition}}
+                </template>
+              </el-table-column>
             </el-table-column>
-            <el-table-column sortable min-width="70" align="center" show-overflow-tooltip prop="Zengxiang" label="增项">
+
+            <el-table-column sortable min-width="120" align="center" show-overflow-tooltip prop="Sums" label="金额合计"></el-table-column>
+            <el-table-column sortable min-width="120" align="center" show-overflow-tooltip prop="PayDate" label="缴费日期">
               <template slot-scope="scope">
-                {{ scope.row.Zengxiang <= 0 ? "" : scope.row.Zengxiang}}
+                {{ jstimehandle(scope.row.PayDate+'') }}
               </template>
-
             </el-table-column>
-            <el-table-column sortable min-width="70" align="center" show-overflow-tooltip prop="Nianshen" label="年审">
+            <el-table-column sortable min-width="120" align="center" show-overflow-tooltip prop="Remarks" 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-tab-pane>
+
+
+        <el-tab-pane label="缴费汇总表" name="second">
+          <el-table :data="entitySumList" border show-summary height="calc(100vh - 243px)" style="width: 100%" @sort-change="orderby">
+
+            <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">
-                {{ scope.row.Nianshen <= 0 ? "" : scope.row.Nianshen}}
+                {{ transferStr(scope.row.PayType) }}
               </template>
+              <el-table-column sortable min-width="70" align="center" show-overflow-tooltip prop="Access" label="新准入">
+                <template slot-scope="scope">
+                  {{ scope.row.Access <= 0 ? "" : scope.row.Access}}
+                </template>
+              </el-table-column>
 
+              <el-table-column sortable min-width="70" align="center" show-overflow-tooltip prop="Annual" label="年审">
+                <template slot-scope="scope">
+                  {{ scope.row.Annual <= 0 ? "" : scope.row.Annual}}
+                </template>
+              </el-table-column>
+
+              <el-table-column sortable min-width="70" align="center" show-overflow-tooltip prop="Addition" label="增项">
+                <template slot-scope="scope">
+                  {{ scope.row.Addition <= 0 ? "" : scope.row.Addition}}
+                </template>
+              </el-table-column>
             </el-table-column>
-          </el-table-column>
+
+            <el-table-column sortable min-width="120" align="center" show-overflow-tooltip prop="Sums" label="金额合计"></el-table-column>
+          </el-table>
+        </el-tab-pane>
+
+      </el-tabs>
 
 
-          <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>
@@ -114,12 +146,14 @@
       return {
         dialogVisible: false,
         // 列表数据
-        selectsupplierlist: [],
         entityList: [],
+        entitySumList: [],
         // 分页参数
         size: 10,
         currentPage: 1,
         currentItemCount: 0,
+        //标签页初始项
+        activeName: 'first',
         // 列表排序
         Column: {
           Order: '',
@@ -129,12 +163,6 @@
         CreateOn: [new Date(new Date().getTime() - 30 * 24 * 60 * 60 * 1000), new Date()],
         // 查询项
         searchFormReset: {},
-        entityForm: {
-          Id: '',
-          SupplierName: '',
-          SupplierId: '',
-          SupplierTypeName: ''
-        },
         searchForm: {
           Id: '',
           SupplierTypeCode: '',
@@ -185,13 +213,8 @@
         }).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']
-
+        api.getSumList(myCreateOn.join(','), params, this.$axios).then(res => {
+          this.entitySumList = res.data.items
         }).catch(err => {
           console.error(err)
         })
@@ -238,11 +261,11 @@
         this.dialogVisible = false
         this.initDatas()
       },
-      handleCurrentChange (value) {
+      handleCurrentChange(value) {
         this.currentPage = value
         this.initDatas()
       },
-      handleSizeChange (value) {
+      handleSizeChange(value) {
         this.size = value
         this.currentPage = 1
         this.initDatas()