3
2
Răsfoiți Sursa

导出word 电动机

lining 6 ani în urmă
părinte
comite
4214a3f25c

+ 4 - 0
src/dashoo.cn/backend/api/business/limsdoctemplate/limstemplateenum.go

@@ -97,4 +97,8 @@ const (
 	DAYT_LIQUIDTRANSPORTATION_DETAIL string = "DAYT.LiquidTransportation.Detail"
 	// 柱塞泵机组液体输送系统
 	DAYT_REPORTPISTONPUMPUNIT_DETAIL string = "DAYT.ReportPistonPumpUnit.Detail"
+	// 电动机
+	DAYT_LIMSREPORTMOTOR_DETAIL string = "DAYT.LimsReportMotor.Detail"
+	// 电泵井
+	DAYT_LIMSREPORTELECPUMPWELL_DETAIL string = "DAYT.LimsReportElecPumpWell.Detail"
 )

+ 2 - 2
src/dashoo.cn/backend/api/business/workflow/ActivitiService.go

@@ -36,8 +36,8 @@ func GetActivitiService(xormEngine *xorm.Engine) *ActivitiService {
 	s.BaseUrl = "http://47.92.212.59:8080/acti-api/api/acti"
 	//s.BaseUrl = "http://192.168.0.171:8081/api/acti"
 	s.AposeUrl = "http://47.92.212.59:8080/acti-api/api/apose"
-	s.OriginUrl = "http://localhost:8081/api"
-	//s.OriginUrl = "http://47.92.212.59:8080/acti-api/api"
+	//s.OriginUrl = "http://localhost:8081/api"
+	s.OriginUrl = "http://47.92.212.59:8080/acti-api/api"
 	//s.AposeUrl = "http://localhost:8081/api/apose"
 	//s.AposeUrl = "http://192.168.0.171:8081/api/apose"
 	s.Username = "leader"

+ 45 - 0
src/dashoo.cn/backend/api/controllers/lims/limsdataentry.go

@@ -1,7 +1,9 @@
 package lims
 
 import (
+	"dashoo.cn/backend/api/business/limsreportelecpumpwell"
 	"dashoo.cn/backend/api/business/limsreportliquidtransportation"
+	"dashoo.cn/backend/api/business/limsreportmotor"
 	"dashoo.cn/backend/api/business/limsreportpistonpumpunit"
 	"encoding/base64"
 	"encoding/json"
@@ -1350,6 +1352,49 @@ func (this *LimsDataEntryController) exportdatatoexcel(fileurl string, dataentry
 			DocUrl = ""
 			err = errors.New("")
 		}
+	case limsdoctemplate.DAYT_LIMSREPORTMOTOR_DETAIL:
+		// 电动机
+		var model limsreportmotor.LimsReportMotor
+		svc := limsreportmotor.GetLimsReportMotorService(utils.DBE)
+		where1 := "DataEntryId=" + strconv.Itoa(dataentrylist.Id)
+		has := svc.GetEntityByWhere(this.User.AccCode+LimsReportMotorName, where1, &model)
+		datamap := StructToMapDemo(model)
+		svcActiviti := workflow.GetActivitiService(utils.DBE)
+		var template limsdoctemplate.LimsDocTemplate
+		wheretem := "Id=" + strconv.Itoa(entrustlist[0].DocId)
+		has = svc.GetEntityByWhere(this.User.AccCode+LimsDocTemplateName, wheretem, &template)
+		if (has) {
+			urlArr := strings.Split(template.FileURL, "|")
+			templateUrl := "http://" + urlArr[0]
+			fileName := urlArr[1]
+			DocUrl = svcActiviti.FillWordTemplate(datamap, templateUrl, fileName)
+			err = nil
+		} else {
+			DocUrl = ""
+			err = errors.New("")
+		}
+	case limsdoctemplate.DAYT_LIMSREPORTELECPUMPWELL_DETAIL:
+		// 电动机
+		var model limsreportelecpumpwell.LimsReportElecPumpWell
+		svc := limsreportelecpumpwell.GetLimsReportElecPumpWellService(utils.DBE)
+		where1 := "DataEntryId=" + strconv.Itoa(dataentrylist.Id)
+		has := svc.GetEntityByWhere(this.User.AccCode+LimsReportElecPumpWellName, where1, &model)
+		datamap := StructToMapDemo(model)
+		datamap["CheckDate"] = model.CheckDate.Format("2006年01月02日")
+		svcActiviti := workflow.GetActivitiService(utils.DBE)
+		var template limsdoctemplate.LimsDocTemplate
+		wheretem := "Id=" + strconv.Itoa(entrustlist[0].DocId)
+		has = svc.GetEntityByWhere(this.User.AccCode+LimsDocTemplateName, wheretem, &template)
+		if (has) {
+			urlArr := strings.Split(template.FileURL, "|")
+			templateUrl := "http://" + urlArr[0]
+			fileName := urlArr[1]
+			DocUrl = svcActiviti.FillWordTemplate(datamap, templateUrl, fileName)
+			err = nil
+		} else {
+			DocUrl = ""
+			err = errors.New("")
+		}
 	}
 	return DocUrl, err
 }

+ 14 - 1
src/dashoo.cn/frontend_web/src/pages/lims/dataentry/alltask.vue

@@ -731,7 +731,20 @@
               query: queryParams
             })
             break
-
+          // 电动机节能
+          case 'DAYT.LimsReportMotor.Detail':
+            this.$router.push({
+              path: '/lims/reportmotor/operation',
+              query: queryParams
+            })
+            break
+          // 电泵井节能
+          case 'DAYT.LimsReportElecPumpWell.Detail':
+            this.$router.push({
+              path: '/lims/reportelecpumpwell/operation',
+              query: queryParams
+            })
+            break
           default:
             this.$message.warning('无模板类型相匹配,请重试');
         }

+ 3 - 3
src/dashoo.cn/frontend_web/src/pages/lims/reportelecpumpwell/_opera/operation.vue

@@ -354,9 +354,9 @@
       }
     },
     created () {
-      // this.EId = this.$route.query.eid
-      // this.TaskBalanceId = this.$route.query.tbid
-      this.DataEntryId = 15// this.$route.query.deid
+      this.EId = this.$route.query.eid
+      this.TaskBalanceId = this.$route.query.tbid
+      this.DataEntryId = this.$route.query.deid
       this.formData.DataEntryId = parseInt(this.DataEntryId)
       this.initData()
     },

+ 11 - 3
src/dashoo.cn/frontend_web/src/pages/lims/reportmotor/_opera/operation.vue

@@ -60,6 +60,14 @@
               </el-input>
             </el-form-item>
           </el-col>
+          <el-col :span="6">
+            <el-form-item label="额定电流"
+                          prop="RatedCurrent">
+              <el-input type="number" step="0.01" v-model.number="formData.RatedCurrent" placeholder="请输入" style="width: 100%">
+                <template slot="append">V</template>
+              </el-input>
+            </el-form-item>
+          </el-col>
           <el-col :span="6">
             <el-form-item label="额定转速"
                           prop="RatedSpeed">
@@ -289,9 +297,9 @@
       }
     },
     created () {
-      // this.EId = this.$route.query.eid
-      // this.TaskBalanceId = this.$route.query.tbid
-      this.DataEntryId = 15// this.$route.query.deid
+      this.EId = this.$route.query.eid
+      this.TaskBalanceId = this.$route.query.tbid
+      this.DataEntryId = this.$route.query.deid
       this.initData()
     },
     methods: {

+ 1 - 1
src/dashoo.cn/frontend_web/src/pages/lims/tasksentrust/_opera/operation.vue

@@ -24,7 +24,7 @@
           <!-- <el-button size="mini" type="primary" class="el-button--small" style="margin-left: 8px" v-if="ServiceId > '0' && ServiceId!='addentrust' && !tjz"
             :disabled="mainForm.EntrustStatus != 0" @click="auditorShow=true">审核</el-button> -->
           <el-button size="mini" type="primary" class="el-button--small" style="margin-left: 8px" v-if="ServiceId > '0' && ServiceId!='addentrust' && mainForm.ISdeliver == 2"
-             @click="balanceaction">分配</el-button>
+                     :disabled="mainForm.EntrustStatus != 0 || !permissions[permissionscode.balance]" @click="balanceaction">分配</el-button>
           <el-button size="mini" type="primary" class="el-button--small" style="margin-left: 8px" v-if="mainForm.EntrustStatus == 0"
             @click="trueEntrustNo">保存</el-button>
           <router-link :to="'/lims/tasksentrust'">