2
3
lining 6 жил өмнө
parent
commit
4e3841a05a

+ 7 - 3
src/dashoo.cn/backend/api/business/oilsupplier/selectbusiness/selectservice.go

@@ -20,7 +20,8 @@ func GetSelectService(xormEngine *xorm.Engine) *SelectService {
 	return s
 }
 
-func (s *SelectService) GetMyPagingEntitiesWithOrderBytbl(supplierTableName, supplierCertTableName, OilInfoChangeName, OilSupplierCertSubName,OilSupplierFileName string, pageIndex, itemsPerPage int64, orderby string, asc bool, entitiesPtr interface{}, where,having string) (total int64) {
+func (s *SelectService) GetMyPagingEntitiesWithOrderBytbl(supplierTableName, supplierCertTableName, OilInfoChangeName, OilSupplierCertSubName,
+	OilSupplierFileName string, pageIndex, itemsPerPage int64, orderby string, asc bool, entitiesPtr interface{}, where,having, liftjoon string) (total int64) {
 
 	//获取总记录数
 	/*sqlCount := `select count(*) from (`
@@ -42,11 +43,14 @@ func (s *SelectService) GetMyPagingEntitiesWithOrderBytbl(supplierTableName, sup
 	sql += `a.DepositBank,a.HseTraining,a.CompanyType,a.SetupTime,a.Address,a.Province,a.City,a.Street, `
 	sql += `a.LinkAddress,a.LinkProvince,a.LinkCity,a.LinkStreet,a.BusinessScope, `
 	sql += `b.InStyle, b.Id CertId,`
-	sql += `group_concat(distinct d.Name) CerSubName,group_concat(distinct e.NeedFileType) NeedFileType `
+	sql += `group_concat(distinct e.NeedFileType) NeedFileType `
+	if liftjoon != "" {
+		sql += `,group_concat(distinct d.Name) CerSubName `
+	}
 	sql += `from ` + supplierTableName + ` a `
 	sql += `left join ` + supplierCertTableName + ` b on b.SupplierId = a.Id `
 	sql += `left join ` + OilInfoChangeName + ` c  on c.SupplierId = a.Id `
-	sql += `left join ` + OilSupplierCertSubName + ` d  on d.SupplierCertId = b.Id `
+	sql += liftjoon
 	sql += `left join ` + OilSupplierFileName + ` e  on e.SupplierId = a.Id `
 	sql += `where ` + where
 

+ 14 - 2
src/dashoo.cn/backend/api/controllers/oilsupplier/select.go

@@ -85,7 +85,7 @@ func (this *SelectController) GetTList() {
 			asc = false
 		}
 	}
-
+	leftjoin := ""
 	//准入证号
 	if model.AccessCardNo != "" {
 		where = where + " and b.AccessCardNo like '%" + model.AccessCardNo + "%'"
@@ -213,6 +213,7 @@ func (this *SelectController) GetTList() {
 	//准入范围
 	if model.CerSubName!="" {
 		having = " having CerSubName like '%"+model.CerSubName+"%' "
+		leftjoin = "left join "+ OilSupplierCertSubName + " d  on d.SupplierCertId = b.Id "
 	}
 	//资质
 	if model.NeedFileType!="" {
@@ -220,11 +221,13 @@ func (this *SelectController) GetTList() {
 	}
 	if model.CerSubName!=""&& model.NeedFileType!=""{
 		having = " having CerSubName like '%"+model.CerSubName+"%' and  NeedFileType like '%"+model.NeedFileType+"%' "
+		leftjoin = "left join "+ OilSupplierCertSubName + " d  on d.SupplierCertId = b.Id "
 	}
 	svc := selectbusiness.GetSelectService(utils.DBE)
 	var list []supplier.OilSupplierSelect
 
-	total := svc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierName, OilSupplierCertName, OilInfoChangeName,OilSupplierCertSubName,OilSupplierFileName, page.CurrentPage, page.Size, orderby, asc, &list, where,having)
+	total := svc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierName, OilSupplierCertName, OilInfoChangeName,OilSupplierCertSubName,
+		OilSupplierFileName, page.CurrentPage, page.Size, orderby, asc, &list, where,having, leftjoin)
 
 	var datainfo DataInfo
 	datainfo.Items = list
@@ -662,6 +665,7 @@ func (this *SelectController) FileList() {
 	Prop := this.GetString("Prop")
     subfilename := this.GetString("subfileName")
 	supplierId := this.GetString("SupplierId")
+	createOn := this.GetString("CreateOn")
 
 
 	if Order != "" && Prop != "" {
@@ -690,6 +694,14 @@ func (this *SelectController) FileList() {
 	if subfilename != "" {
 		where = where + " and NeedFileType like '%" + subfilename + "%'"
 	}
+	if createOn != "" {
+		dates := strings.Split(createOn, ",")
+		if len(dates) == 2 {
+			minDate := dates[0]
+			maxDate := dates[1]
+			where = where + " and EffectDate>='" + minDate + "' and EffectDate<='" + maxDate + "'"
+		}
+	}
 
 	total := svc.GetPagingEntitiesWithoutAccCode(page.CurrentPage, page.Size, orderby, asc, &list, where)
 	var datainfo DataInfo

+ 33 - 1
src/dashoo.cn/frontend_web/src/pages/select/components/subfilelist.vue

@@ -5,6 +5,15 @@
         <span style="font-weight: bold"> 企业资质</span>
         <span style="float: right;">
           <el-form ref="form" :inline="true" style="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 size="mini" v-model="searchForm.subfileName" placeholder="请输入资质名称" style="width: 100%"></el-input>
             </el-form-item>
@@ -69,10 +78,12 @@
         subfileList: [],
 
         selectedorg: [],
+        CreateOn: [],
 
         Title: '',
         searchForm: {
-          subfileName: ''
+          subfileName: '',
+          CreateOn: ''
         }
 
       }
@@ -97,6 +108,16 @@
           _currentPage: this.currentPage,
           _size: this.size
         }
+        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]))
+        }
+        this.searchForm.CreateOn = myCreateOn.join(',')
         Object.assign(params, this.searchForm)
         _this.$axios.get('select/filelist', {
           params
@@ -124,6 +145,17 @@
         return retUrl
       },
 
+      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
+      },
       jstimehandle (val) {
         if (val === '') {
           return '----'