Bladeren bron

计划-任务BUG

yuedefeng 6 jaren geleden
bovenliggende
commit
bac1c07789

+ 2 - 0
src/dashoo.cn/backend/api/business/limsentrust/limsentrust.go

@@ -30,6 +30,7 @@ type LimsEntrustMain struct {
 	Samplelist        string    `xorm:VARCHAR(50)`
 	SampleNum         float32   `xorm:"FLOAT"`
 	Unit              string    `xorm:VARCHAR(50)`
+	IsPlan            string    `xorm:VARCHAR(50)`
 	Remarks           string    `xorm:VARCHAR(255)`       //描述
 	CreateOn          time.Time `xorm:"DATETIME created"` //创建时间
 	CreateUserId      int       `xorm:"INT(10)"`
@@ -63,6 +64,7 @@ type CustomerEntrustModel struct {
 	Samplelist        string
 	SampleNum         float32
 	Unit              string
+	IsPlan            string
 	Remarks           string
 	CustomerCode      string
 	Person            string

+ 41 - 14
src/dashoo.cn/backend/api/controllers/lims/limsentrust.go

@@ -1,6 +1,7 @@
 package lims
 
 import (
+	"dashoo.cn/backend/api/business/limscustomerposition"
 	"dashoo.cn/backend/api/business/testtype"
 	"encoding/json"
 	"strconv"
@@ -21,9 +22,6 @@ import (
 	"dashoo.cn/backend/api/business/limsentrustsample"
 	"dashoo.cn/backend/api/business/limsentrustsampletype"
 
-	//	"dashoo.cn/backend/api/business/testtype"
-
-	//"dashoo.cn/backend/api/business/authcode"
 	. "dashoo.cn/backend/api/controllers"
 	"dashoo.cn/utils"
 )
@@ -59,13 +57,14 @@ func (this *LimsEnturstController) GetEntrustPlanList() {
 		}
 	}
 
-	userSvc := userRole.GetUserService(utils.DBE)
-	organizeSvc := organize.GetOrganizeService(utils.DBE)
-	departList := organizeSvc.GetChildByTopId(this.User.DepartmentId)
+	// userSvc := userRole.GetUserService(utils.DBE)
+	// organizeSvc := organize.GetOrganizeService(utils.DBE)
+	// departList := organizeSvc.GetChildByTopId(this.User.DepartmentId)
 	//取出当前部门及下级部门的所有用户列表
-	var subUserList []userRole.Base_User
-	whereUser := " 1=1 "
-	whereUser += " and DepartmentId in (" + departList + ")"
+	/*
+	 * var subUserList []userRole.Base_User
+	"*/
+	/*whereUser += " and DepartmentId in (" + departList + ")"
 	// whereUser += " and EntrustStatus<0 "
 	userSvc.GetEntities(&subUserList, whereUser)
 	var userIds string
@@ -76,8 +75,9 @@ func (this *LimsEnturstController) GetEntrustPlanList() {
 	userIds = strings.Trim(userIds, ",")
 
 	where := " 1=1 "
-	where += " AND CreateUserId in (" + userIds + ")"
+	where += " AND CreateUserId in (" + userIds + ")"*/
 
+	where := " 1=1 and IsPlan = '1' "
 	if entrustno != "" {
 		where = where + " and EntrustNo like '%" + entrustno + "%'"
 	}
@@ -186,7 +186,6 @@ func (this *LimsEnturstController) GetEntrustList() {
 	var subUserList []userRole.Base_User
 	whereUser := " 1=1 "
 	whereUser += " and DepartmentId in (" + departList + ")"
-	whereUser += " and EntrustStatus>=0 "
 	userSvc.GetEntities(&subUserList, whereUser)
 	var userIds string
 
@@ -196,7 +195,9 @@ func (this *LimsEnturstController) GetEntrustList() {
 	userIds = strings.Trim(userIds, ",")
 
 	where := " 1=1 "
-	where += " AND CreateUserId in (" + userIds + ")"
+	where += " and EntrustStatus>=0 "
+	where += " AND ( CreateUserId in (" + userIds + ")"
+	where += " OR ModifiedUserId = '" + this.User.Id + "')"
 
 	if entrustno != "" {
 		where = where + " and EntrustNo like '%" + entrustno + "%'"
@@ -378,7 +379,7 @@ func (this *LimsEnturstController) ReceiveEntrustInfo() {
 	Id := this.Ctx.Input.Param(":id")
 	var model limsentrust.CustomerEntrustModel
 	svc := limsentrust.GetLimsEnturstService(utils.DBE)
-	sqlUpdate := "update " + this.User.AccCode + LimsEntrustMainName + " set EntrustStatus = '0' where Id='" + Id + "'"
+	sqlUpdate := "update " + this.User.AccCode + LimsEntrustMainName + " set EntrustStatus = '0', ModifiedOn=now(), ModifiedBy='" + this.User.Username + "', ModifiedUserId = '" + this.User.Id + "' where Id='" + Id + "'"
 	svc.DBE.Exec(sqlUpdate)
 
 	this.Data["json"] = &model
@@ -466,7 +467,7 @@ func (this *LimsEnturstController) EditEntrust() {
 	svc := limsentrust.GetLimsEnturstService(utils.DBE)
 
 	opdesc := "委托单-" + model.EntrustNo
-	var cols []string = []string{"EntrustNo", "EntrustTime", "EndTime", "EntrustStatus", "EntrustType", "EntrustTypeId", "CustomerId", "CustomerName", "CustomerPerson", "CustomerTelephone", "AddressId", "Address", "ProjectType", "ProjectTypeId", "DetectSample", "DetectSampleId", "Samplelist", "SampleNum", "SampleCode", "Unit", "Remarks", "ModifiedUserId", "ModifiedBy"}
+	var cols []string = []string{"EntrustNo", "EntrustTime", "EndTime", "EntrustStatus", "EntrustType", "EntrustTypeId", "CustomerId", "CustomerName", "CustomerPerson", "CustomerTelephone", "AddressId", "Address", "ProjectType", "ProjectTypeId", "DetectSample", "DetectSampleId", "Samplelist", "SampleNum", "SampleCode", "Unit", "IsPlan", "Remarks", "ModifiedUserId", "ModifiedBy"}
 	err := svc.UpdateOperationAndWriteLogBytbl(this.User.AccCode+LimsEntrustMainName, BaseOperationLogName, id, &model, &entityempty, cols, utils.ToStr(this.User.Id), this.User.Username, opdesc, this.User.AccCode, "委托管理")
 	if err == nil {
 		errinfo.Message = "操作成功!"
@@ -1007,3 +1008,29 @@ func (this *LimsEnturstController) GetShow() {
 	this.Data["json"] = &datainfo
 	this.ServeJSON()
 }
+
+// @Title 获取委托方信息
+// @Description 获取委托方信息
+// @Success 200 object} map[string]interface{}
+// @router /getallcheckposition [get]
+func (this *LimsReportZuhqController) GetAllCheckPosition() {
+	dictList := make(map[string]interface{})
+
+	var model []limscustomerposition.LimsCustomerPosition
+	svc := limscustomerposition.GetLimsCustomerpositionService(utils.DBE)
+
+	where := "ParentId = 0"
+	svc.GetEntitysByWhere(this.User.AccCode+LimsCustomerpositionName, where,&model)
+	dictList["PositionCheck"] = model
+
+	var Positionmodel []limscustomerposition.LimsCustomerPosition
+	//where = "CustomerId=" + cId + " and ParentId <> 0"
+	where = "ParentId <> 0"
+	svc.GetEntitysByWhere(this.User.AccCode+LimsCustomerpositionName,where, &Positionmodel)
+	dictList["Position"] = Positionmodel
+
+	var datainfo DataInfo
+	datainfo.Items = dictList
+	this.Data["json"] = &datainfo
+	this.ServeJSON()
+}

+ 13 - 14
src/dashoo.cn/frontend_web/nuxt.config.ignore.js

@@ -162,19 +162,18 @@ module.exports = {
 	  baseURL: '//localhost:10091/api/'
   },
   ignore: [
-    'pages/lims/report*/*.*',
-    'pages/lims/createreport/*.*',
-    'pages/lims/dataentry/*.*',
-    'pages/lims/deliver/*.*',
-    'pages/lims/drillingdaily/*.*',
-    'pages/lims/oiltestingdaily/*.*',
-    'pages/lims/preparation/*.*',
-    'pages/lims/tasksbalance/*.*',
-    'pages/lims/tasksentrust/*.*',
-    'pages/system/*.*',
-    'pages/setting/*.*',
-    'pages/prototype/*.*',
-    'pages/material/*.*',
-    'pages/report/*.*',
+    'pages/lims/report*/**/*.*',
+    'pages/lims/createreport/**/*.*',
+    'pages/lims/dataentry/**/*.*',
+    'pages/lims/deliver/**/*.*',
+    'pages/lims/drillingdaily/**/*.*',
+    'pages/lims/oiltestingdaily/**/*.*',
+    'pages/lims/preparation/**/*.*',
+    'pages/lims/tasksbalance/**/*.*',
+    'pages/system/**/*.*',
+    'pages/setting/**/*.*',
+    'pages/prototype/**/*.*',
+    'pages/material/**/*.*',
+    'pages/report/**/*.*',
   ]
 }

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

@@ -21,10 +21,10 @@
         </el-breadcrumb>
 
         <span style="float: right;">
-          <el-button size="mini" type="primary" class="el-button--small" style="margin-left: 8px" :disabled="mainForm.EntrustStatus >= 0"
+          <el-button size="mini" type="primary" class="el-button--small" style="margin-left: 8px"
                      @click="ReceiveEntrustNo">接收计划</el-button>
 
-          <el-button size="mini" type="primary" class="el-button--small" style="margin-left: 8px" :disabled="mainForm.EntrustStatus >= 0"
+          <el-button size="mini" type="primary" class="el-button--small" style="margin-left: 8px"
                      @click="trueEntrustNo">保存</el-button>
 
           <router-link :to="'/lims/taskplan'">
@@ -548,7 +548,7 @@
       // 获取委托类型
       this.getEntypeList()
       this.getsamplesnumlist()
-      this.getCustomer()
+      // this.getCustomer()
       this.getProjectType()
       this.getSampleTypeOrigList()
       this.getDictList()
@@ -645,6 +645,7 @@
         this.$refs['mainForm'].validate((valid) => {
           if (valid) {
             _this.mainForm.EntrustStatus = -1
+            _this.mainForm.IsPlan = '1'
             _this.mainForm.SampleNum = parseFloat(_this.mainForm.SampleNum)
             _this.mainForm.CustomerId = parseInt(_this.mainForm.CustomerId)
             _this.mainForm.AddressId = parseInt(_this.mainForm.AddressId)

+ 3 - 4
src/dashoo.cn/frontend_web/src/pages/lims/taskplan/index.vue

@@ -7,7 +7,7 @@
         </span>
         <el-breadcrumb class="heading" style="float: left; margin-left: 5px">
           <el-breadcrumb-item :to="{ path: '/' }">平台首页</el-breadcrumb-item>
-          <el-breadcrumb-item :to="{ path: '/lims/taskplan' }">检测任务</el-breadcrumb-item>
+          <el-breadcrumb-item :to="{ path: '/lims/taskplan' }">检测计划</el-breadcrumb-item>
         </el-breadcrumb>
         <span style="float: right;">
           <router-link :to="'/lims/taskplan/add/operation'">
@@ -191,14 +191,14 @@
       this.getPermissions() //权限
     },
     methods: {
-      initdata() {
+      initdata () {
         let _this = this
         let EntrustTime = []
         if (!_this.EntrustTime) {
           _this.EntrustTime = []
         }
         // 解析时间
-        if (_this.EntrustTime || _this.EntrustTime.length === 2) {
+        if (_this.EntrustTime && _this.EntrustTime.length === 2) {
           _this.EntrustTime[1].setHours(23)
           _this.EntrustTime[1].setMinutes(59)
           _this.EntrustTime[1].setSeconds(59)
@@ -210,7 +210,6 @@
           _size: this.size,
           Order: this.Column.Order,
           Prop: this.Column.Prop,
-          EntrustStatus: -1
         }
         Object.assign(params, this.searchform)
         api.entrustPlanList(EntrustTime.join(','), params, this.$axios)

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

@@ -1450,7 +1450,7 @@
               return false
             }
             for (var i = 0; i < _this.testTypeList.length; i++) {
-              if (_this.testTypeList[i].ParentId == 0) {
+              if (_this.testTypeList[i].ParentId === 0) {
                 _this.projectTypeList.push(_this.testTypeList[i])
               }
             }