2
3
فهرست منبع

年度统计表页面

Liuqi 6 سال پیش
والد
کامیت
fad4f346a9

+ 13 - 0
src/dashoo.cn/backend/api/business/oilsupplier/selectbusiness/selectbusiness.go

@@ -10,3 +10,16 @@ type SelectBusiness struct {
 	Preject      string    `xorm:"VARCHAR(40)"`      //  办理项目  1 准入 2 增项 3 年审 4 变更申请
 	CreateOn     time.Time `xorm:"DATETIME created"` // 申请时间
 }
+type TotalCount struct {
+	Month string
+	Store string
+	AnnualAudit string
+	Append string
+	InfoChange string
+	CatalogSelf string
+	CatalogWin string
+	CatalogTrade string
+	CatalogComp string
+	CatalogSpe string
+
+}

+ 119 - 0
src/dashoo.cn/backend/api/business/oilsupplier/selectbusiness/selectservice.go

@@ -112,3 +112,122 @@ func (s *SelectService) GetUp( supplierCertTableName string, pageIndex, itemsPer
 
 	return total
 }
+func (s *SelectService) GetTotalInMonth( orderby string, asc bool, entitiesTotal interface{}, where string) (total int64) {
+	var resultsSlice []map[string][]byte
+	endtime, _ := strconv.Atoi(where)
+	if endtime == 0 {
+		endtime = 5000
+	}else {
+	endtime = endtime+1}
+	timedone := strconv.Itoa(endtime)
+	var sql string
+	sql = `(SELECT AnnualAudit.Month,AnnualAudit,Store,Append,InfoChange,CatalogSelf,CatalogWin,CatalogTrade,CatalogComp,CatalogSpe FROM(
+SELECT  b.Month,a.AnnualAudit from (select extract(month from ApplyTime) time ,COUNT(*) AnnualAudit
+			from OilAnnualAudit
+			WHERE ApplyTime >= '` + where +`' AND ApplyTime < '` + timedone +`' AND Status = '11'
+			group by extract(month from ApplyTime)) a 
+			RIGHT JOIN OilCountMonth b ON b.Month = a.time) AnnualAudit
+LEFT JOIN (SELECT  b.Month,a.Store from (select extract(month from ApplyTime) time ,COUNT(*) Store
+			from OilSupplierCert
+			WHERE ApplyTime >= '` + where +`' AND ApplyTime < '` + timedone +`' AND InFlag = '1'
+			group by extract(month from ApplyTime)) a 
+			RIGHT JOIN OilCountMonth b ON b.Month = a.time) Store ON AnnualAudit.Month = Store.Month
+LEFT JOIN (SELECT  b.Month,a.Append from (select extract(month from ApplyDate) time ,COUNT(*) Append
+			from OilSupplierCertAppend
+			WHERE ApplyDate >= '` + where +`' AND ApplyDate < '` + timedone +`' AND Status = '11'
+			group by extract(month from ApplyDate)) a 
+			RIGHT JOIN OilCountMonth b ON b.Month = a.time) Append ON AnnualAudit.Month = Append.Month
+LEFT JOIN (SELECT  b.Month,a.InfoChange from (select extract(month from CreateOn) time ,COUNT(*) InfoChange
+			from OilInfoChange
+			WHERE CreateOn >= '` + where +`' AND CreateOn < '` + timedone +`' AND Status = '11'
+			group by extract(month from CreateOn)) a 
+			RIGHT JOIN OilCountMonth b ON b.Month = a.time) InfoChange ON AnnualAudit.Month = InfoChange.Month
+LEFT JOIN (SELECT  b.Month,a.CatalogSelf from (select extract(month from CreateOn) time ,COUNT(*) CatalogSelf
+			from OilCatalog
+			WHERE CreateOn >= '` + where +`' AND CreateOn < '` + timedone +`' AND CatalogType=1 
+			group by extract(month from CreateOn)) a 
+			RIGHT JOIN OilCountMonth b ON b.Month = a.time) CatalogSelf ON AnnualAudit.Month = CatalogSelf.Month
+LEFT JOIN (SELECT  b.Month,a.CatalogWin from (select extract(month from CreateOn) time ,COUNT(*) CatalogWin
+			from OilCatalog
+			WHERE CreateOn >= '` + where +`' AND CreateOn < '` + timedone +`' AND CatalogType=2 
+			group by extract(month from CreateOn)) a 
+			RIGHT JOIN OilCountMonth b ON b.Month = a.time) CatalogWin ON AnnualAudit.Month = CatalogWin.Month
+LEFT JOIN (SELECT  b.Month,a.CatalogTrade from (select extract(month from CreateOn) time ,COUNT(*) CatalogTrade
+			from OilCatalog
+			WHERE CreateOn >= '` + where +`' AND CreateOn < '` + timedone +`' AND CatalogType=3 
+			group by extract(month from CreateOn)) a 
+			RIGHT JOIN OilCountMonth b ON b.Month = a.time) CatalogTrade ON AnnualAudit.Month = CatalogTrade.Month
+LEFT JOIN (SELECT  b.Month,a.CatalogComp from (select extract(month from CreateOn) time ,COUNT(*) CatalogComp
+			from OilCatalog
+			WHERE CreateOn >= '` + where +`' AND CreateOn < '` + timedone +`' AND CatalogType=4 
+			group by extract(month from CreateOn)) a 
+			RIGHT JOIN OilCountMonth b ON b.Month = a.time) CatalogComp ON AnnualAudit.Month = CatalogComp.Month
+LEFT JOIN (SELECT  b.Month,a.CatalogSpe from (select extract(month from CreateOn) time ,COUNT(*) CatalogSpe
+			from OilCatalog
+			WHERE CreateOn >= '` + where +`' AND CreateOn < '` + timedone +`' AND CatalogType=4 
+			group by extract(month from CreateOn)) a 
+			RIGHT JOIN OilCountMonth b ON b.Month = a.time) CatalogSpe ON AnnualAudit.Month = CatalogSpe.Month ORDER BY AnnualAudit.Month)
+			union ALL
+			select '合计',sum(AnnualAudit),sum(Store),sum(Append),sum(InfoChange),sum(CatalogSelf),sum(CatalogWin),sum(CatalogTrade),sum(CatalogComp),sum(CatalogSpe) from (SELECT AnnualAudit.Month,AnnualAudit,Store,Append,InfoChange,CatalogSelf,CatalogWin,CatalogTrade,CatalogComp,CatalogSpe FROM(
+SELECT  b.Month,a.AnnualAudit from (select extract(month from ApplyTime) time ,COUNT(*) AnnualAudit
+			from OilAnnualAudit
+			WHERE ApplyTime >= '` + where +`' AND ApplyTime < '` + timedone +`' AND Status = '11'
+			group by extract(month from ApplyTime)) a 
+			RIGHT JOIN OilCountMonth b ON b.Month = a.time) AnnualAudit
+LEFT JOIN (SELECT  b.Month,a.Store from (select extract(month from ApplyTime) time ,COUNT(*) Store
+			from OilSupplierCert
+			WHERE ApplyTime >= '` + where +`' AND ApplyTime < '` + timedone +`' AND InFlag = '1'
+			group by extract(month from ApplyTime)) a 
+			RIGHT JOIN OilCountMonth b ON b.Month = a.time) Store ON AnnualAudit.Month = Store.Month
+LEFT JOIN (SELECT  b.Month,a.Append from (select extract(month from ApplyDate) time ,COUNT(*) Append
+			from OilSupplierCertAppend
+			WHERE ApplyDate >= '` + where +`' AND ApplyDate < '` + timedone +`' AND Status = '11'
+			group by extract(month from ApplyDate)) a 
+			RIGHT JOIN OilCountMonth b ON b.Month = a.time) Append ON AnnualAudit.Month = Append.Month
+LEFT JOIN (SELECT  b.Month,a.InfoChange from (select extract(month from CreateOn) time ,COUNT(*) InfoChange
+			from OilInfoChange
+			WHERE CreateOn >= '` + where +`' AND CreateOn < '` + timedone +`' AND Status = '11'
+			group by extract(month from CreateOn)) a 
+			RIGHT JOIN OilCountMonth b ON b.Month = a.time) InfoChange ON AnnualAudit.Month = InfoChange.Month
+LEFT JOIN (SELECT  b.Month,a.CatalogSelf from (select extract(month from CreateOn) time ,COUNT(*) CatalogSelf
+			from OilCatalog
+			WHERE CreateOn >= '` + where +`' AND CreateOn < '` + timedone +`' AND CatalogType=1 
+			group by extract(month from CreateOn)) a 
+			RIGHT JOIN OilCountMonth b ON b.Month = a.time) CatalogSelf ON AnnualAudit.Month = CatalogSelf.Month
+LEFT JOIN (SELECT  b.Month,a.CatalogWin from (select extract(month from CreateOn) time ,COUNT(*) CatalogWin
+			from OilCatalog
+			WHERE CreateOn >= '` + where +`' AND CreateOn < '` + timedone +`' AND CatalogType=2 
+			group by extract(month from CreateOn)) a 
+			RIGHT JOIN OilCountMonth b ON b.Month = a.time) CatalogWin ON AnnualAudit.Month = CatalogWin.Month
+LEFT JOIN (SELECT  b.Month,a.CatalogTrade from (select extract(month from CreateOn) time ,COUNT(*) CatalogTrade
+			from OilCatalog
+			WHERE CreateOn >= '` + where +`' AND CreateOn < '` + timedone +`' AND CatalogType=3 
+			group by extract(month from CreateOn)) a 
+			RIGHT JOIN OilCountMonth b ON b.Month = a.time) CatalogTrade ON AnnualAudit.Month = CatalogTrade.Month
+LEFT JOIN (SELECT  b.Month,a.CatalogComp from (select extract(month from CreateOn) time ,COUNT(*) CatalogComp
+			from OilCatalog
+			WHERE CreateOn >= '` + where +`' AND CreateOn < '` + timedone +`' AND CatalogType=4 
+			group by extract(month from CreateOn)) a 
+			RIGHT JOIN OilCountMonth b ON b.Month = a.time) CatalogComp ON AnnualAudit.Month = CatalogComp.Month
+LEFT JOIN (SELECT  b.Month,a.CatalogSpe from (select extract(month from CreateOn) time ,COUNT(*) CatalogSpe
+			from OilCatalog
+			WHERE CreateOn >= '` + where +`' AND CreateOn < '` + timedone +`' AND CatalogType=4 
+			group by extract(month from CreateOn)) a 
+			RIGHT JOIN OilCountMonth b ON b.Month = a.time) CatalogSpe ON AnnualAudit.Month = CatalogSpe.Month) countTotal`
+
+	//if asc {
+	//	sql += ` order by ` + orderby + ` ASC `
+	//} else {
+	//	sql += ` order by ` + orderby + ` DESC `
+	//}
+	s.DBE.SQL(sql).Find(entitiesTotal)
+	if len(resultsSlice) > 0 {
+		results := resultsSlice[0]
+		for _, value := range results {
+			total, _ = strconv.ParseInt(string(value), 10, 64)
+			break
+		}
+	}
+
+	return total
+}

+ 44 - 0
src/dashoo.cn/backend/api/controllers/oilsupplier/select.go

@@ -750,6 +750,50 @@ func (this *SelectController) FileList() {
 	this.Data["json"] = &datainfo
 	this.ServeJSON()
 }
+// @Title 获取列表
+// @Description
+// @Success 200 {object}
+// @router /totallist [get]
+func (this *SelectController) GetTotalList() {
+	//获取分页信息
+	page := this.GetPageInfoForm()
+	where := "0"
+	orderby := "Id"
+	asc := false
+	Order := this.GetString("Order")
+	Prop := this.GetString("Prop")
+	if Order != "" && Prop != "" {
+		orderby = Prop
+		if Order == "asc" {
+			asc = true
+		}
+	}
+	Years := this.GetString("Years")
+	if Years != "" {
+		where = Years
+	}
+	//CreateOn := this.GetString("CreateOn")
+	//
+	//if CreateOn != "" {
+	//	dates := strings.Split(CreateOn, ",")
+	//	if len(dates) == 2 {
+	//		minDate := dates[0]
+	//		maxDate := dates[1]
+	//		where = where + " and ValidityTo>='" + minDate + "' and ValidityTo<='" + maxDate + "'"
+	//	}
+	//}
+	svc := selectbusiness.GetSelectService(utils.DBE)
+	var list []selectbusiness.TotalCount
+
+	svc.GetTotalInMonth(orderby, asc, &list, where)
+
+	var datainfo DataInfo
+	datainfo.Items = list
+	datainfo.PageIndex = page.CurrentPage
+	datainfo.ItemsPerPage = page.Size
+	this.Data["json"] = &datainfo
+	this.ServeJSON()
+}
 
 
 

+ 7 - 0
src/dashoo.cn/frontend_web/src/api/oilsupplier/select.js

@@ -7,6 +7,13 @@ export default {
       data: formdata
     })
   },
+  getList (params, myAxios) {
+    return myAxios({
+      url: '/select/totallist',
+      method: 'GET',
+      params: params
+    })
+  },
   getProcessAuditList (CreateOn, params, myAxios) {
     return myAxios({
       url: '/select/getprocessauditlist?CreateOn=' + CreateOn,

+ 171 - 16
src/dashoo.cn/frontend_web/src/pages/oilsupplier/analysis/index.vue

@@ -12,30 +12,41 @@
         <span>
           <i class="icon icon-table2"></i> 大港油田公司市场管理信息统计表
         </span>
-      </div>
 
+
+        <el-form ref="form" :inline="true" style="float: right; margin-top: -10px">
+          <el-form-item label="年份">
+            <el-input size="mini" v-model="Years" style="width:100%" placeholder="请输入查询年份"></el-input>
+          </el-form-item>
+          <el-form-item>
+            <el-button type="primary" size="mini" @click="handleSearch">
+              查询
+            </el-button>
+          </el-form-item>
+        </el-form>
+      </div>
       <!--内框表格显示-->
-      <el-table id="rebateSetTable" :data="entityList" size="mini" border height="calc(100vh - 243px)" style="width: 100%"
+      <el-table id="rebateSetTable" :data="entityList" size="mini" border height="calc(100vh - 230px)" style="width: 100%"
         @sort-change="orderby" >
         <!--内框表格剩余栏显示-->
-        <el-table-column label="日期" width="100px" sortable align="center"></el-table-column>
+        <el-table-column label="日期" width="100px"  align="center" prop="Month" :formatter="formatUnit0"></el-table-column>
         <el-table-column label="准入管理">
-          <el-table-column label="新准入" width="100px"  sortable align="center"></el-table-column>
-          <el-table-column label="增项" width="100px"  sortable align="center"></el-table-column>
-          <el-table-column label="年审" width="100px"  sortable align="center"></el-table-column>
-          <el-table-column label="变更" width="100px"  sortable align="center"></el-table-column>
+          <el-table-column label="新准入"    align="center" prop="Store" :formatter="formatUnit1"></el-table-column>
+          <el-table-column label="增项"    align="center" prop="Append" :formatter="formatUnit2"></el-table-column>
+          <el-table-column label="年审"    align="center" prop="AnnualAudit" :formatter="formatUnit3"></el-table-column>
+          <el-table-column label="变更"    align="center" prop="InfoChange" :formatter="formatUnit4"></el-table-column>
         </el-table-column>
         <el-table-column label="目录管理">
-          <el-table-column label="自建项目" width="100px"  sortable align="center"></el-table-column>
-          <el-table-column label="优势项目" width="100px"  sortable align="center"></el-table-column>
-          <el-table-column label="关联交易" width="100px"  sortable align="center"></el-table-column>
-          <el-table-column label="战略合作" width="100px"  sortable align="center"></el-table-column>
-          <el-table-column label="特殊业务" width="100px"  sortable align="center"></el-table-column>
+          <el-table-column label="自建项目"    align="center" prop="CatalogSelf" :formatter="formatUnit5"></el-table-column>
+          <el-table-column label="优势项目"    align="center" prop="CatalogWin" :formatter="formatUnit6"></el-table-column>
+          <el-table-column label="关联交易"    align="center" prop="CatalogTrade" :formatter="formatUnit7"></el-table-column>
+          <el-table-column label="战略合作"    align="center" prop="CatalogComp" :formatter="formatUnit8"></el-table-column>
+          <el-table-column label="特殊业务"    align="center" prop="CatalogSpe" :formatter="formatUnit9"></el-table-column>
         </el-table-column>
       </el-table>
 
       <!-- 分页 -->
-      <el-pagination
+      <!-- <el-pagination
         @size-change="handleSizeChange"
         @current-change="handleCurrentChange"
         :current-page="currentPage"
@@ -43,7 +54,7 @@
         :page-size="size"
         layout="total, sizes, prev, pager, next, jumper"
         :total="currentItemCount"
-      ></el-pagination>
+      ></el-pagination> -->
     </el-card>
   </div>
 </template>
@@ -57,17 +68,157 @@ import api from '@/api/oilsupplier/select'
 
 export default {
   created () {
-
+    this.initDatas()
   },
   data () {
     return {
       // 定义列表数据
-      entityList: []
+      entityList: [
+      ],
+      // 列表排序
+      Column: {
+        Order: '',
+        Prop: ''
+      },
+      Years: '',
+      // currentPage: 1
     }
   },
 
   methods: {
+    initDatas() {
+      // 分页及列表条件
+      let params = {
+        // _currentPage: this.currentPage,
+        // _size: this.size,
+        // Order: this.Column.Order,
+        // Prop: this.Column.Prop
+        Years: this.Years
+      }
+      // let myCreateOn = []
+      // // 解析时间
+      // if (this.CreateOn != null && 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)
+      // 访问接口
+      api.getList(params, this.$axios).then(res => {
+        this.entityList = res.data.items
+        // this.currentItemCount = res.data.currentItemCount
+      }).catch(err => {
+        console.error(err)
+      })
+    },
 
+        // 分页方法
+    handleCurrentChange (value) {
+      this.currentPage = value
+      this.initDatas()
+    },
+    handleSizeChange (value) {
+      this.size = value
+      this.currentPage = 1
+      this.initDatas()
+    },
+    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()
+    },
+    handleSearch(){
+      this.initDatas()
+    },
+    formatUnit1 (row, column) {
+      if (row.Store === '') {
+        return '-'
+      }
+      return row.Store
+    },
+    formatUnit2 (row, column) {
+      if (row.Append === '') {
+        return '-'
+      }
+      return row.Append
+    },
+    formatUnit3 (row, column) {
+      if (row.AnnualAudit === '') {
+        return '-'
+      }
+      return row.AnnualAudit
+    },
+    formatUnit4 (row, column) {
+      if (row.InfoChange === '') {
+        return '-'
+      }
+      return row.InfoChange
+    },
+    formatUnit5 (row, column) {
+      if (row.CatalogSelf === '') {
+        return '-'
+      }
+      return row.CatalogSelf
+    },
+    formatUnit6 (row, column) {
+      if (row.CatalogWin === '') {
+        return '-'
+      }
+      return row.CatalogWin
+    },
+    formatUnit7 (row, column) {
+      if (row.CatalogTrade === '') {
+        return '-'
+      }
+      return row.CatalogTrade
+    },
+    formatUnit8 (row, column) {
+      if (row.CatalogComp === '') {
+        return '-'
+      }
+      return row.CatalogComp
+    },
+    formatUnit9 (row, column) {
+      if (row.CatalogSpe === '') {
+        return '-'
+      }
+      return row.CatalogSpe
+    },
+    formatUnit0 (row, column) {
+      if (row.Month === '1') {
+        return '1月'
+      }else if (row.Month === '2') {
+        return '2月'
+      }else if (row.Month === '3') {
+        return '3月'
+      }else if (row.Month === '4') {
+        return '4月'
+      }else if (row.Month === '5') {
+        return '5月'
+      }else if (row.Month === '6') {
+        return '6月'
+      }else if (row.Month === '7') {
+        return '7月'
+      }else if (row.Month === '8') {
+        return '8月'
+      }else if (row.Month === '9') {
+        return '9月'
+      }else if (row.Month === '10') {
+        return '10月'
+      }else if (row.Month === '11') {
+        return '11月'
+      }else if (row.Month === '12') {
+        return '12月'
+      }
+      return row.Month
+    }
   }
 }
 </script>
@@ -81,5 +232,9 @@ export default {
   resize: none;
   height: 70px;
 }
+  .el-pagination {
+    margin: 1rem 0 2rem;
+    text-align: right;
+  }
 </style>