3
2
Răsfoiți Sursa

检测地点

lining 6 ani în urmă
părinte
comite
450164a857

+ 1 - 1
src/dashoo.cn/backend/api/business/limsbalance/limsbalanceService.go

@@ -284,7 +284,7 @@ func (this *LimsBalanceService) CreateDataentry(AccCode string, UserNames string
 		dataentryentity.CreateBy = ConUserList[i]
 		dataentryentity.CreateUserId, _ = utils.StrTo(ConUserIdList[i]).Int()
 		_, err = svc.InsertEntityBytbl(AccCode+LimsDateEntryName, &dataentryentity)
-		err = this.adddataentrydetail(entrustmaindata.Id, dataentryentity.Id, balancedata.Id, templatecode, AccCode)
+		//err = this.adddataentrydetail(entrustmaindata.Id, dataentryentity.Id, balancedata.Id, templatecode, AccCode) ====20190828ln
 		//启动数据录入工作流
 		svcActiviti := workflow.GetActivitiService(utils.DBE)
 		var processInstanceId string

+ 15 - 6
src/dashoo.cn/backend/api/controllers/lims/customer.go

@@ -1,12 +1,14 @@
 package lims
 
 import (
+	"dashoo.cn/business_lims/organize"
 	"encoding/json"
 	"strconv"
 	"strings"
 
-	. "dashoo.cn/backend/api/controllers"
 	customer2 "dashoo.cn/backend/api/business/customer"
+	myorganize "dashoo.cn/backend/api/business/organize"
+	. "dashoo.cn/backend/api/controllers"
 	"dashoo.cn/utils"
 )
 
@@ -134,12 +136,19 @@ func (this *CustomerController) Getcustomerlist() {
 // @Success 200 {object} business.device.DeviceChannels
 // @router /getcustomerbydepartid [get]
 func (this *CustomerController) GetCustomerByDepartmentId() {
-	var model customer2.Customer
-	svc := customer2.GetCustomerService(utils.DBE)
-	where := "DepartmentId = '" + strconv.Itoa( this.User.UnitId ) + "'"
-	svc.GetEntityByWhere(this.User.AccCode+CustomerName, where, &model)
+	//var model customer2.Customer
+	//svc := customer2.GetCustomerService(utils.DBE)
+	//where := "DepartmentId = '" + strconv.Itoa( this.User.UnitId ) + "'"
+	//svc.GetEntityByWhere(this.User.AccCode+CustomerName, where, &model)
+
+	var org organize.Base_Organize
+	svc := myorganize.GetOrganizeService(utils.DBE)
+	//unitId := svc.GetMyUnitDepartmentId(this.User.DepartmentId)
+	where := "Id=" + strconv.Itoa(this.User.UnitId)
+	svc.GetEntity(&org, where)
+
 	var datainfo DataInfo
-	datainfo.Items = model
+	datainfo.Items = org
 	this.Data["json"] = &datainfo
 	this.ServeJSON()
 }

+ 20 - 1
src/dashoo.cn/backend/api/controllers/lims/limsentrust.go

@@ -24,6 +24,7 @@ import (
 
 	. "dashoo.cn/backend/api/controllers"
 	"dashoo.cn/utils"
+     myorganize "dashoo.cn/backend/api/business/organize"
 )
 
 type LimsEnturstController struct {
@@ -271,13 +272,31 @@ func (this *LimsEnturstController) AddEntrust() {
 	//	if err == nil {
 	//		this.AddSampleType(strconv.Itoa(model.Id), SampleCode)
 	//	}
+
+	orgSvc := myorganize.GetOrganizeService(utils.DBE)
+	positionSvc := limscustomerposition.GetLimsCustomerpositionService(utils.DBE)
+	orgEntityList := orgSvc.GetAllThirdChildByTopId(strconv.Itoa(this.User.UnitId), this.User.Id)
+	//取消3级单位ID列表
+	thrOrgList := ""
+	strPositionList := ""
+	for _, orgValue := range orgEntityList {
+		thrOrgList += strconv.Itoa(orgValue.Id) + ","
+	}
+	thrOrgList += "0"
+	var entitys []limscustomerposition.LimsCustomerPosition
+	entitys = positionSvc.GetPositionCheckList(this.User.AccCode+LimsCustomerpositionName, thrOrgList)
+	for _, value := range entitys {
+		strPositionList += strconv.Itoa(value.Id) + ","
+	}
+	strPositionList += "0"
+
 	// 保存设备明细
 	queryCheckDate := this.GetString("querycheckdate")
 	insertEquipmentSQL := "INSERT INTO " + this.User.AccCode + LimsEntrustEquipmentName
 	insertEquipmentSQL += "(Entrustmainid, Departmentid, Departmentname, Orderno, Positioncheckid, Positioncheck, Positionid, Position, Custno, DeviceId, Devicename, Templatetypeid, Templatetypename, Spec, Specid, Manufacturer, Status, Remark, CreateOn, CreateUserId, CreateBy)"
 	insertEquipmentSQL += " SELECT '" + strconv.Itoa(model.Id) + "' as EntrustMainId, Departmentid, Departmentname, Orderno, Positioncheckid, Positioncheck, Positionid, Position, Custno, Id, Devicename, Templatetypeid, Templatetypename, Spec, Specid, Manufacturer, Status, Remark, now() as CreateOn, '" + this.User.Id + "' as CreateUserId, '" + this.User.Realname + "' as CreateBy FROM "
 	insertEquipmentSQL += this.User.AccCode + LimsCheckEquipmentListName
-	insertEquipmentSQL += " WHERE PositionCheckId=" + strconv.Itoa(model.AddressId)
+	insertEquipmentSQL += " WHERE PositionCheckId in (" + strPositionList + ")"
 	insertEquipmentSQL += " and TemplateTypeId=" + strconv.Itoa(model.ProjectTypeId)
 	if queryCheckDate != "" {
 		insertEquipmentSQL = insertEquipmentSQL + " and  date_add(LastCheckDate, interval " + queryCheckDate + " month) >= now()"

+ 5 - 2
src/dashoo.cn/frontend_web/src/pages/lims/principal/subdata/customerposition.vue

@@ -57,7 +57,7 @@
     <el-dialog title="检测地点信息" :visible.sync="dialogVisible" width="720px" size="small">
       <el-form :model="formData" ref="EntityForm" label-width="120px" label-position="top">
         <el-form-item label="受检单位" required>
-          <el-select ref="ThrUnitSelect" v-model="formData.ThrUnitId" style="width:100%" placeholder="请选择" filterable >
+          <el-select ref="ThrUnitSelect" v-model="formData.ThrUnitId" style="width:100%" placeholder="请选择" filterable>
             <el-option v-for="item in thrUnitList" :key="item.Id" :label="item.Fullname" :value="item.Id"></el-option>
           </el-select>
         </el-form-item>
@@ -226,6 +226,8 @@
           CustomerId: 0,
           ParentId: 0,
           AuthCode: '',
+          ThrUnit: '',
+          ThrUnitId: '',
           PositionName: '',
           PositionCode: '',
           PositionType: '',
@@ -238,7 +240,7 @@
           CreateBy: '',
           ModifiedOn: '',
           ModifiedUserId: '',
-          ModifiedBy: '',
+          ModifiedBy: ''
 
         },
         //查询时间
@@ -460,6 +462,7 @@
 
       getDictOptions () {
         api.getDictList(this.$axios).then(res => {
+          console.log(res)
           this.thrUnitList = res.data.items['ThrUnitList']
           if (this.thrUnitList != null && this.thrUnitList.length > 0) {
             this.formData.ThrUnitId = this.thrUnitList[0].Id

+ 32 - 27
src/dashoo.cn/frontend_web/src/pages/lims/taskplan/_opera/operation.vue

@@ -74,14 +74,14 @@
               <el-input v-model="mainForm.Address" placeholder="委托方地址" disabled></el-input>
             </el-form-item>
           </el-col>
-          <el-col :span="8" v-if="!tjz">
-            <el-form-item label="检测地点" required>
-              <el-select ref="refAddress" v-model="mainForm.AddressId" style="width:100%" placeholder="请选择检测地点" @change="AddressChangeHandler">
-                <el-option v-for="item in addressList" :key="item.Id" :label="item.PositionName" :value="item.Id">
-                </el-option>
-              </el-select>
-            </el-form-item>
-          </el-col>
+          <!--<el-col :span="8" v-if="!tjz">-->
+            <!--<el-form-item label="检测地点" required>-->
+              <!--<el-select ref="refAddress" v-model="mainForm.AddressId" style="width:100%" placeholder="请选择检测地点" @change="AddressChangeHandler">-->
+                <!--<el-option v-for="item in addressList" :key="item.Id" :label="item.PositionName" :value="item.Id">-->
+                <!--</el-option>-->
+              <!--</el-select>-->
+            <!--</el-form-item>-->
+          <!--</el-col>-->
           <!-- <el-col :span="8">
             <el-form-item label="机构代码">
               <el-input v-model="mainForm.CustomerCode" placeholder="请输入委托方机构代码" disabled></el-input>
@@ -556,6 +556,7 @@
       if (this.ServiceId === 'add') {
         this.pagetitle = '新增检测计划'
         this.mainForm.EntrustTypeId = 329 // 委托检测
+        this.AddressChangeHandler()
         // this.getEntrustNo()
         // this.testcodec()
       } else if (this.ServiceId != '0') {
@@ -610,18 +611,21 @@
         let _this = this
         if (_this.selectedorg && _this.selectedorg.length > 0) { // 验证样本
           if (_this.mainForm.CustomerId && _this.mainForm.CustomerId > 0) { // 验证委托方
-            if (!_this.tjz) {
-              if (_this.mainForm.AddressId && _this.mainForm.AddressId > 0) { // 验证检测地点
-                _this.saveEntity()
-              } else {
-                _this.$message({
-                  type: 'warning',
-                  message: '请选择检测地点!'
-                })
-              }
-            } else {
-              _this.saveEntity()
-            }
+            // if (!_this.tjz) {
+            //   if (_this.mainForm.AddressId && _this.mainForm.AddressId > 0) { // 验证检测地点
+            //     _this.saveEntity()
+            //   } else {
+            //     _this.$message({
+            //       type: 'warning',
+            //       message: '请选择检测地点!'
+            //     })
+            //   }
+            // } else {
+            //   _this.saveEntity()
+            // }
+
+            _this.saveEntity()
+
           } else {
             _this.$message({
               type: 'warning',
@@ -765,7 +769,7 @@
             // } else {
             //   _this.selectedorg = []
             // }
-            _this.getAddress(_this.mainForm.CustomerId)
+            // _this.getAddress(_this.mainForm.CustomerId) =====
             _this.getpartuserlist(this.mainForm.DataTemplateId)
             _this.initDeviceList()
           }).catch(err => {
@@ -1003,7 +1007,7 @@
             Order: this.Column.Order,
             Prop: this.Column.Prop,
             TemplateTypeId: tmpTypeId,
-            PositionCheckId: this.mainForm.AddressId,
+            // PositionCheckId: this.mainForm.AddressId,
             QueryCheckDate: this.QueryCheckDate
           }
           // 访问接口
@@ -1456,12 +1460,13 @@
         let _this = this // request
         this.$axios.get('customer/getcustomerbydepartid', {})
           .then(res => {
+            console.log(res.data)
             _this.mainForm.CustomerId = res.data.items['Id']
-            _this.mainForm.CustomerName = res.data.items['CustomerName']
-            _this.mainForm.CustomerPerson = res.data.items['Person']
-            _this.mainForm.CustomerTelephone = res.data.items['Telephone']
-            _this.mainForm.Address = res.data.items['Address']
-            _this.getAddress(_this.mainForm.CustomerId)
+            _this.mainForm.CustomerName = res.data.items['Fullname']
+            // _this.mainForm.CustomerPerson = res.data.items['Person']
+            // _this.mainForm.CustomerTelephone = res.data.items['Telephone']
+            // _this.mainForm.Address = res.data.items['Address']
+            // _this.getAddress(_this.mainForm.CustomerId)
           }).catch(err => {
             // handle error
             console.error(err)