Browse Source

流程查询数据

lining 6 years ago
parent
commit
b6cc5aada0

+ 47 - 7
src/dashoo.cn/backend/api/controllers/oilsupplier/select.go

@@ -330,6 +330,8 @@ func (this *SelectController) GetProcessAuditList() {
 	tabinx := this.GetString("tabinx")
 	supplierTypeCode := this.GetString("SupplierTypeCode")
 	supplierName := this.GetString("SupplierName")
+	CreateOn := this.GetString("CreateOn")
+
 	//企业用户必须加创建人条件
 	var registerUser register.OilCorporateInfo
 	sql := " UserName='" + this.User.Username + "'"
@@ -344,12 +346,18 @@ func (this *SelectController) GetProcessAuditList() {
 	if supplierName != "" {
 		where = where + " and a.SupplierName like '%" + supplierName + "%'"
 	}
-
 	var total int64 = 0
 	var datainfo DataInfo
 	if tabinx == "1" || tabinx == "0" {
 		var list []Processinfo //[]supplier.OilSupplierView
-
+		if CreateOn != "" {
+			dates := strings.Split(CreateOn, ",")
+			if len(dates) == 2 {
+				minDate := dates[0]
+				maxDate := dates[1]
+				where = where + " and b.CreateOn>='" + minDate + "' and b.CreateOn<='" + maxDate + "'"
+			}
+		}
 		total = total + svc.GetProcessInfoWithOrderBytbl(OilSupplierName, OilSupplierCertName, page.CurrentPage, page.Size, "b.Id", asc, &list, where)
 		processinfolist = append(processinfolist, list...)
 		//datainfo.Items = processinfolist
@@ -366,6 +374,14 @@ func (this *SelectController) GetProcessAuditList() {
 		if supplierName != "" {
 			whereapp = whereapp + " and a.SupplierName like '%" + supplierName + "%'"
 		}
+		if CreateOn != "" {
+			dates := strings.Split(CreateOn, ",")
+			if len(dates) == 2 {
+				minDate := dates[0]
+				maxDate := dates[1]
+				whereapp = whereapp + " a.and CreateOn>='" + minDate + "' and a.CreateOn<='" + maxDate + "'"
+			}
+		}
 		var list []Processinfo//[]suppliercertappend.OilSupplierCertAppend
 		svc := suppliercertappend.GetOilSupplierCertAppendService(utils.DBE)
 		total = total + svc.GetProcessInfoWithOrderBytbl(OilSupplierCertAppendName, page.CurrentPage, page.Size, "a.Id", asc, &list, whereapp)
@@ -376,13 +392,21 @@ func (this *SelectController) GetProcessAuditList() {
 		whereapp := "1=1"
 		//企业用户必须加创建人条件
 		if this.User.IsCompanyUser == 1 {
-			whereapp = whereapp + " and CreateUserId = '" + this.User.Id + "'"
+			whereapp = whereapp + " and a.CreateUserId = '" + this.User.Id + "'"
 		}
 		if supplierTypeCode != "" {
-			whereapp = whereapp + " and SupplierTypeName like '%" + supplierTypeCode + "%'"
+			whereapp = whereapp + " and a.SupplierTypeName like '%" + supplierTypeCode + "%'"
 		}
 		if supplierName != "" {
-			whereapp = whereapp + " and SupplierName like '%" + supplierName + "%'"
+			whereapp = whereapp + " and a.SupplierName like '%" + supplierName + "%'"
+		}
+		if CreateOn != "" {
+			dates := strings.Split(CreateOn, ",")
+			if len(dates) == 2 {
+				minDate := dates[0]
+				maxDate := dates[1]
+				whereapp = whereapp + " and a.CreateOn>='" + minDate + "' and a.CreateOn<='" + maxDate + "'"
+			}
 		}
 		var list []Processinfo//[]annualaudit.OilAnnualAudit
 		svc := annualaudit.GetOilAnnualAuditService(utils.DBE)
@@ -394,10 +418,18 @@ func (this *SelectController) GetProcessAuditList() {
 		whereapp := "1=1"
 		//企业用户必须加创建人条件
 		if this.User.IsCompanyUser == 1 {
-			whereapp = whereapp + " and CreateUserId = '" + this.User.Id + "'"
+			whereapp = whereapp + " and a.CreateUserId = '" + this.User.Id + "'"
 		}
 		if supplierName != "" {
-			whereapp = whereapp + " and SupplierName like '%" + supplierName + "%'"
+			whereapp = whereapp + " and a.SupplierName like '%" + supplierName + "%'"
+		}
+		if CreateOn != "" {
+			dates := strings.Split(CreateOn, ",")
+			if len(dates) == 2 {
+				minDate := dates[0]
+				maxDate := dates[1]
+				whereapp = whereapp + " and a.CreateOn>='" + minDate + "' and a.CreateOn<='" + maxDate + "'"
+			}
 		}
 		var list []Processinfo//[]infochange.OilInfoChange
 		svc := infochange.GetInfoChangeService(utils.DBE)
@@ -414,6 +446,14 @@ func (this *SelectController) GetProcessAuditList() {
 		if supplierName != "" {
 			whereapp = whereapp + " and SupplierName like '%" + supplierName + "%'"
 		}
+		if CreateOn != "" {
+			dates := strings.Split(CreateOn, ",")
+			if len(dates) == 2 {
+				minDate := dates[0]
+				maxDate := dates[1]
+				whereapp = whereapp + " and CreateOn>='" + minDate + "' and CreateOn<='" + maxDate + "'"
+			}
+		}
 		svc := qualchange.GetQualChangeService(utils.DBE)
 		var list []qualchange.OilQualChangeMain
 		total = svc.GetPagingEntitiesWithOrderBytbl("", page.CurrentPage, page.Size, orderby, asc, &list, whereapp)

+ 11 - 2
src/dashoo.cn/frontend_web/src/pages/select/processselect/index.vue

@@ -25,6 +25,15 @@
               <el-option label="技术服务类" value="03"></el-option>
             </el-select>
           </el-form-item>
+          <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>
             <el-dropdown split-button type="primary" size="mini" @command="searchCommand"  @click="initDatas(tabinx,$event)">
               查询
@@ -325,7 +334,7 @@
           Prop: ''
         },
         // 查询时间
-        CreateOn: [new Date(new Date().getTime() - 30 * 24 * 60 * 60 * 1000), new Date()],
+        CreateOn: [],
         // 查询项
         searchFormReset: {},
         searchForm: {
@@ -410,7 +419,7 @@
         }
         let myCreateOn = []
         // 解析时间
-        if (this.CreateOn.length === 2) {
+        if (this.CreateOn != null && this.CreateOn.length === 2) {
           this.CreateOn[1].setHours(23)
           this.CreateOn[1].setMinutes(59)
           this.CreateOn[1].setSeconds(59)