Jelajahi Sumber

外部单位地点台账, 二级三级地点及设备台账完成

yuedefeng 6 tahun lalu
induk
melakukan
5367d398f4

+ 15 - 0
src/dashoo.cn/backend/api/business/limscustomerposition/limscustomerpositionService.go

@@ -15,4 +15,19 @@ func GetLimsCustomerpositionService(xormEngine *xorm.Engine) *LimsCustomerpositi
 	return s
 }
 
+// 根据用户的3级单位ID,取出检测地点
+func (s *LimsCustomerpositionService) GetPositionCheckList(tableName, ThrUnitIds string) (entitys []LimsCustomerPosition) {
+	sql := "select * from " + tableName + "  where PositionTypeId='1' and ThrUnitId in (" + ThrUnitIds + ")"
+	s.DBE.SQL(sql).Find(&entitys)
+	return entitys
+}
+
+// 根据用户的3级单位ID,取出安装位置
+func (s *LimsCustomerpositionService) GetPositionList(tableName, ThrUnitIds string) (entitys []LimsCustomerPosition) {
+	sql := "select * from " + tableName + "  where PositionTypeId='2' and (" + ThrUnitIds + ")"
+	s.DBE.SQL(sql).Find(&entitys)
+	return entitys
+}
+
+
 

+ 30 - 3
src/dashoo.cn/backend/api/controllers/lims/Limscustomerposition.go

@@ -39,6 +39,7 @@ func (this *LimsCustomerpositionController) GetEntityList() {
 			asc = false
 		}
 	}
+	outCustomer := this.GetString("outCustomer")
 	Id := this.GetString("Id")
 	CustomerId := this.GetString("CustomerId")
 	ParentId := this.GetString("ParentId")
@@ -91,7 +92,7 @@ func (this *LimsCustomerpositionController) GetEntityList() {
 	}
 
 	if CreateUserId != "" {
-		where = where + " and CreateUserId like '%" + CreateUserId + "%'"
+		where = where + " and CreateUserId = '" + this.User.Id + "'"
 	}
 
 	if CreateBy != "" {
@@ -110,10 +111,15 @@ func (this *LimsCustomerpositionController) GetEntityList() {
 		where = where + " and ModifiedBy like '%" + ModifiedBy + "%'"
 	}
 
-	if this.User.UintThirdId > 0 {
-		where = where + " and ThrUnitId = '" + strconv.Itoa(this.User.UintThirdId) + "'"
+	if len(outCustomer) > 0 {
+		where = where + " and CreateUserId = '" + this.User.Id + "'"
+	} else {
+		if this.User.UintThirdId > 0 {
+			where = where + " and ThrUnitId = '" + strconv.Itoa(this.User.UintThirdId) + "'"
+		}
 	}
 
+
 	if CreateOn != "" {
 		dates := strings.Split(CreateOn, ",")
 		if len(dates) == 2 {
@@ -160,6 +166,27 @@ func (this *LimsCustomerpositionController) CustomerpositionTree() {
 	this.ServeJSON()
 }
 
+// @Title 根据组织结构获取树形结构
+// @Description 获取树形结构
+// @Success 200 {object} limscustomerposition.LimsCustomerPosition
+// @router /customerpositiontreeout [get]
+func (this *LimsCustomerpositionController) CustomerpositionTreeOut() {
+	var list []limscustomerposition.LimsCustomerPosition
+	svc := limscustomerposition.GetLimsCustomerpositionService(utils.DBE)
+
+	where := " 1=1 "
+	CustomerId := this.GetString("CustomerId")
+	if CustomerId != "" {
+		where = where + " and CustomerId = '" + CustomerId + "'"
+	}
+
+	svc.GetEntitysByOrderbyWhere(this.User.AccCode+LimsCustomerpositionName, where, "SortCode, Id asc", &list)
+	var datainfo DataInfo
+	datainfo.Items = list
+	this.Data["json"] = &datainfo
+	this.ServeJSON()
+}
+
 // @Title 根据组织结构获取树形结构
 // @Description 获取树形结构
 // @Success 200 {object} limscustomerposition.LimsCustomerPosition

+ 4 - 0
src/dashoo.cn/backend/api/controllers/lims/customer.go

@@ -39,6 +39,7 @@ func (this *CustomerController) Customerlist() {
 	lianxiren := this.GetString("lianxiren")
 	telephone := this.GetString("telephone")
 	CreateBy := this.GetString("CreateBy")
+	CreateUserId := this.GetString("CreateUserId")
 	var list []customer2.Customer
 	svc := customer2.GetCustomerService(utils.DBE)
 	where := " 1=1 "
@@ -64,6 +65,9 @@ func (this *CustomerController) Customerlist() {
 	if telephone != "" {
 		where = where + " and Telephone like '%" + telephone + "%'"
 	}
+	if CreateUserId != "" {
+		where = where + " and CreateUserId = '" + CreateUserId + "'"
+	}
 	CreateOn := this.GetString("CreateOn")
 	if CreateOn != "" {
 		dates := strings.Split(CreateOn, ",")

+ 38 - 9
src/dashoo.cn/backend/api/controllers/lims/limscheckequipmentlist.go

@@ -1,8 +1,11 @@
 package lims
 
 import (
+	"dashoo.cn/backend/api/business/limscustomerposition"
 	"dashoo.cn/backend/api/business/organize"
 	"encoding/json"
+	"strconv"
+
 	//"strings"
 	"time"
 
@@ -51,6 +54,7 @@ func (this *LimsCheckEquipmentListController) GetEntityList() {
 	status := this.GetString("Status")
 
 	TemplateTypeId := this.GetString("TemplateTypeId")
+	PositionAllTypeId := this.GetString("PositionAllTypeId")
 
 	if Id != "" {
 		where = where + " and Id like '%" + Id + "%'"
@@ -60,6 +64,10 @@ func (this *LimsCheckEquipmentListController) GetEntityList() {
 		where = where + " and DepartmentId like '%" + DepartmentId + "%'"
 	}
 
+	if PositionAllTypeId != "" {
+		where = where + " and (PositionCheckId = '" + PositionAllTypeId + "' or PositionID = '" + PositionAllTypeId + "')"
+	}
+
 	if OrderNo != "" {
 		where = where + " and OrderNo like '%" + OrderNo + "%'"
 	}
@@ -77,7 +85,7 @@ func (this *LimsCheckEquipmentListController) GetEntityList() {
 	}
 
 	if PositionID != "" {
-		where = where + " and PositionID like '%" + PositionID + "%'"
+		where = where + " and PositionID = '" + PositionID + "'"
 	}
 
 	if Position != "" {
@@ -103,15 +111,36 @@ func (this *LimsCheckEquipmentListController) GetEntityList() {
 	if status != "" {
 		where = where + " and Status like '%" + status + "%'"
 	}
-
-	/** if CreateOn != "" {
-		dates := strings.Split(CreateOn, ",")
-		if len(dates) == 2 {
-			minDate := dates[0]
-			maxDate := dates[1]
-			where = where + " and CreateOn>='" + minDate + "' and CreateOn<='" + maxDate + "'"
+	// 把安装位置取出来
+	strPositionList := ""
+	orgSvc := organize.GetOrganizeService(utils.DBE)
+	positionSvc := limscustomerposition.GetLimsCustomerpositionService(utils.DBE)
+	if this.User.UintThirdId > 0 {
+		var entitys []limscustomerposition.LimsCustomerPosition
+		entitys = positionSvc.GetPositionCheckList( this.User.AccCode + LimsCustomerpositionName, strconv.Itoa(this.User.UintThirdId) )
+		for _, value := range entitys {
+			strPositionList += strconv.Itoa(value.Id) + ","
+		}
+		strPositionList += "0"
+	} else if this.User.UnitId > 0 {
+		orgEntityList := orgSvc.GetAllThirdChildByTopId(strconv.Itoa(this.User.UnitId), this.User.Id)
+		//取消3级单位ID列表
+		thrOrgList := ""
+		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"
+	}
+
+	if len(strPositionList) > 0 {
+		where = where + " and PositionCheckId in ('" + strPositionList + "')"
+	}
 
 	svc := limscheckequipmentlist.GetLimsCheckEquipmentListService(utils.DBE)
 	var list []limscheckequipmentlist.LimsCheckEquipmentList

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

@@ -162,18 +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/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/**/*.*',
   ]
 }

+ 8 - 0
src/dashoo.cn/frontend_web/src/api/lims/customerposition.js

@@ -47,6 +47,14 @@ export default {
     })
   },
 
+  customerPositionTreeOut(params, myAxios) {
+    return myAxios({
+      url: '/limscustomerposition/customerpositiontreeout',
+      method: 'GET',
+      params: params
+    })
+  },
+
   customerCheckBuildList(params, myAxios) {
     return myAxios({
       url: '/limscustomerposition/customercheckbuildlist',

+ 75 - 42
src/dashoo.cn/frontend_web/src/pages/lims/checkequipmentlist/index.vue

@@ -4,52 +4,67 @@
       <el-breadcrumb-item :to="{ path: '/' }">平台首页</el-breadcrumb-item>
       <el-breadcrumb-item :to="{ path: '/lims/s5ovelimscheckequipmentlist' }">二级单位设备台账表</el-breadcrumb-item>
     </el-breadcrumb>-->
-    <el-card class="box-card" style="height: calc(100vh - 90px);">
-      <div slot="header">
+    <el-row :gutter="20">
+      <el-col :span="6">
+        <el-tree style="height: calc(100vh - 243px); overflow: auto;" draggable highlight-current :expand-on-click-node="true" node-key="id" :data="customerTreeList" :props="orgtreeprops"
+                  @node-click="orgtreeNodeClick" ref="orgmanagetree">
+        </el-tree>
+      </el-col>
+      <el-col :span="18">
+        <el-card class="box-card" style="height: calc(100vh - 90px);">
+          <div slot="header">
         <span>
           <i class="icon icon-table2"></i> 设备台账
         </span>
-        <span style="float: right;">
+            <span style="float: right;">
           <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" @click="NewEntity">添加</el-button>
         </span>
-        <el-form ref="form" :inline="true" style="float: right; 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>
-            <el-dropdown split-button type="primary" size="mini" @click="handleSearch" @command="searchCommand">
-              查询
-              <el-dropdown-menu slot="dropdown">
-                <el-dropdown-item command="search">高级查询</el-dropdown-item>
-                <el-dropdown-item command="clear">查询重置</el-dropdown-item>
-              </el-dropdown-menu>
-            </el-dropdown>
-          </el-form-item>
-        </el-form>
-      </div>
-      <el-table :data="entityList" border height="calc(100vh - 243px)" style="width: 100%" @sort-change="orderby">
-        <el-table-column label="操作" width="160px" align="center" fixed>
-          <template slot-scope="scope">
-            <el-button type="primary" title="编辑" size="small" plain @click="ShowEntityDialog(scope.row.Id)">编辑</el-button>
-            <el-button type="plain" plain title="删除" size="small" style="margin-left:10px;" @click="deleteConfirm(scope.row)">删除</el-button>
-          </template>
-        </el-table-column>
-
-        <el-table-column v-for="column in tableColumns" :key="column.Id"
-                         v-if="column.prop != 'CreateOn'" :prop="column.prop" sortable min-width="100" :label="column.label" align="center" show-overflow-tooltip></el-table-column>
-
-        <!--<el-table-column prop="CreateOn" sortable min-width="150" label="生成时间" align="center" show-overflow-tooltip>
-          <template slot-scope="scope">
-            {{ jstimehandle(scope.row.CreateOn+'') }}
-          </template>
-        </el-table-column>-->
-      </el-table>
-      <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
-                     :page-sizes="[10, 15, 20, 25]" :page-size="size" layout="total, sizes, prev, pager, next, jumper" :total="currentItemCount">
-      </el-pagination>
-    </el-card>
+            <el-form ref="form" :inline="true" style="float: right; 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-select ref="refQueryProjectType" style="margin-right:10px; margin-top: -4px;" size="mini" v-model="QueryProjectTypeId" clearable filterable placeholder="按设备分类查询" @change="ProjectTypeChangeHandler" @clear="ProjectTypeClearHandler">
+                  <el-option v-for="item in projectTypeList" :key="item.id" :label="item.FullName" :value="item.Id"></el-option>
+                </el-select>
+              </el-form-item>
+
+              <el-form-item>
+                <el-dropdown split-button type="primary" size="mini" @click="handleSearch" @command="searchCommand">
+                  查询
+                  <el-dropdown-menu slot="dropdown">
+                    <el-dropdown-item command="search">高级查询</el-dropdown-item>
+                    <el-dropdown-item command="clear">查询重置</el-dropdown-item>
+                  </el-dropdown-menu>
+                </el-dropdown>
+              </el-form-item>
+            </el-form>
+          </div>
+          <el-table :data="entityList" border height="calc(100vh - 243px)" style="width: 100%" @sort-change="orderby">
+            <el-table-column label="操作" width="160px" align="center" fixed>
+              <template slot-scope="scope">
+                <el-button type="primary" title="编辑" size="small" plain @click="ShowEntityDialog(scope.row.Id)">编辑</el-button>
+                <el-button type="plain" plain title="删除" size="small" style="margin-left:10px;" @click="deleteConfirm(scope.row)">删除</el-button>
+              </template>
+            </el-table-column>
+
+            <el-table-column v-for="column in tableColumns" :key="column.Id"
+                             v-if="column.prop != 'CreateOn'" :prop="column.prop" sortable min-width="100" :label="column.label" align="center" show-overflow-tooltip></el-table-column>
+
+            <!--<el-table-column prop="CreateOn" sortable min-width="150" label="生成时间" align="center" show-overflow-tooltip>
+              <template slot-scope="scope">
+                {{ jstimehandle(scope.row.CreateOn+'') }}
+              </template>
+            </el-table-column>-->
+          </el-table>
+          <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
+                         :page-sizes="[10, 15, 20, 25]" :page-size="size" layout="total, sizes, prev, pager, next, jumper" :total="currentItemCount">
+          </el-pagination>
+        </el-card>
+      </el-col>
+    </el-row>
 
     <el-dialog title="高级查询" :visible.sync="dialogVisible" width="720px">
       <el-form ref="advancedsearchForm" label-width="110px">
@@ -167,9 +182,11 @@
 
     data () {
       return {
+        QueryProjectTypeId: '',
         dialogVisible: false,
         dialogFormVisible: false,
         saveLoading: false,
+        selectNodeId: '',
         // 列表数据
         entityList: [],
         PositionList: [],
@@ -306,13 +323,29 @@
       // this.getDictOptions()
     },
     methods: {
+      ProjectTypeChangeHandler () {
+        this.initDatas()
+      },
+
+      ProjectTypeClearHandler () {
+        this.initDatas()
+      },
+      orgtreeNodeClick (data) {
+        this.selectNodeId = data.id + ''
+        this.selectNodeName = data.PositionName + ''
+
+        this.currentPage = 1
+        this.initDatas()
+      },
       initDatas () {
         // 分页及列表条件
         let params = {
           _currentPage: this.currentPage,
           _size: this.size,
           Order: this.Column.Order,
-          Prop: this.Column.Prop
+          Prop: this.Column.Prop,
+          TemplateTypeId: this.QueryProjectTypeId + '',
+          PositionAllTypeId: this.selectNodeId + '',
         }
         let myCreateOn = []
         // 解析时间

+ 7 - 6
src/dashoo.cn/frontend_web/src/pages/lims/principal/_opera/operation.vue

@@ -29,10 +29,11 @@
         <el-row :gutter="20" class="donorsaddformcss">
           <el-col :span="8">
             <el-form-item label="类型" prop="ViceBusiness">
-              <el-select v-model="customerForm.ViceBusiness" style="width:100%" clearable placeholder="请选择委托方类型">
+              <!--<el-select v-model="customerForm.ViceBusiness" style="width:100%" placeholder="请选择委托方类型">
                 <el-option label="大港油田" value="大港油田"></el-option>
                 <el-option label="外部委托方" value="外部委托方"></el-option>
-              </el-select>
+              </el-select>-->
+              <el-input v-model="customerForm.ViceBusiness" placeholder="请输入委托方名称" readonly></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="8">
@@ -68,7 +69,7 @@
         </el-row>
       </el-form>
 
-      <customer-position :CustomerId="customerId" DivStyle="height: 700px" v-if="service_flag != 'addservice'"></customer-position>
+      <customer-position-out :CustomerId="customerId" DivStyle="height: 700px" v-if="service_flag != 'addservice'"></customer-position-out>
     </el-card>
 
 
@@ -80,11 +81,11 @@
     mapGetters
   } from 'vuex';
   import api from '@/api/lims/customerposition';
-  import CustomerPosition from '../subdata/customerposition';
+  import CustomerPositionOut from '../subdata/customerpositionout';
 
   export default {
     components: {
-      CustomerPosition,
+      CustomerPositionOut,
     },
     name: 'labsetingadd',
     data() {
@@ -93,7 +94,7 @@
         pagetitle: '', //界面标题
         customerForm: {
           Id: '',
-          ViceBusiness: '',
+          ViceBusiness: '外部委托方',
           CustomerName: '',
           CustomerCode: '',
           Person: '',

+ 11 - 3
src/dashoo.cn/frontend_web/src/pages/lims/principal/index.vue

@@ -98,9 +98,16 @@
   </div>
 </template>
 <script>
+  import { mapGetters } from 'vuex'
+
   export default {
+    computed: {
+      ...mapGetters({
+        authUser: 'authUser'
+      })
+    },
     name: 'principal',
-    data() {
+    data () {
       return {
         dialogVisible: false,
         searchform: {
@@ -108,7 +115,7 @@
           CreateBy: '',
           lianxiren: '',
           telephone: '',
-          CreateBy: '',
+          CreateBy: ''
         },
         CreateOn: [new Date(new Date().getTime() - 30 * 24 * 60 * 60 * 1000), new Date()], // 录入时期
         currentItemCount: 0,
@@ -157,7 +164,8 @@
           _currentPage: this.currentPage,
           _size: this.size,
           Order: this.Column.Order,
-          Prop: this.Column.Prop
+          Prop: this.Column.Prop,
+          CreateUserId: this.authUser.Id + ''
         }
         Object.assign(params, this.searchform)
         this.$axios.get('/customer/customerlist?CreateOn=' + CreateOn.join(','), {

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

@@ -6,7 +6,7 @@
           <i class="icon icon-table2">位置树</i>
         </span>
         <span style="float: right;">
-          <el-select ref="refQueryProjectType" style="margin-right:10px; margin-top: -4px;" size="mini" v-model="QueryProjectTypeId" clearable filterable placeholder="按检测项目查询" @change="ProjectTypeChangeHandler" @clear="ProjectTypeClearHandler">
+          <el-select ref="refQueryProjectType" style="margin-right:10px; margin-top: -4px;" size="mini" v-model="QueryProjectTypeId" clearable filterable placeholder="按设备类型查询" @change="ProjectTypeChangeHandler" @clear="ProjectTypeClearHandler">
             <el-option v-for="item in projectTypeList" :key="item.id" :label="item.FullName" :value="item.Id"></el-option>
           </el-select>
           <el-button type="primary" size="mini" style="margin-right:10px; margin-top: -4px;" @click="newEntity">新增检测地点</el-button>
@@ -260,7 +260,7 @@
 
           {
             prop: "ProjectType",
-            label: '检测项目',
+            label: '设备类型',
             sort: true
           },
 
@@ -354,8 +354,8 @@
             this.formData.ParentId = 0
             this.formData.PositionType = '检测地点'
             this.formData.PositionTypeId = '1'
-            this.formData.ThrUnitId = parseInt(this.formData.ThrUnitId)
-            this.formData.ThrUnit = this.$refs['ThrUnitSelect'].selectedLabel
+            this.formData.ThrUnitId = this.formData.ThrUnitId ? parseInt(this.formData.ThrUnitId) : 0
+            this.formData.ThrUnit = this.formData.ThrUnitId ? this.$refs['ThrUnitSelect'].selectedLabel : ''
             if (!this.formData.Id) {
               this.addEntity()
             } else {
@@ -378,7 +378,7 @@
         if (!this.formData.ProjectTypeId) {
           this.$message({
             type: 'warning',
-            message: '检测项目不能为空'
+            message: '设备类型不能为空'
           })
           return
         }

+ 692 - 0
src/dashoo.cn/frontend_web/src/pages/lims/principal/subdata/customerpositionout.vue

@@ -0,0 +1,692 @@
+<template>
+  <div>
+    <el-card class="box-card" :style="DivStyle">
+      <div slot="header">
+        <span>
+          <i class="icon icon-table2">位置树</i>
+        </span>
+        <span style="float: right;">
+          <el-select ref="refQueryProjectType" style="margin-right:10px; margin-top: -4px;" size="mini" v-model="QueryProjectTypeId" clearable filterable placeholder="按设备类型查询" @change="ProjectTypeChangeHandler" @clear="ProjectTypeClearHandler">
+            <el-option v-for="item in projectTypeList" :key="item.id" :label="item.FullName" :value="item.Id"></el-option>
+          </el-select>
+          <el-button type="primary" size="mini" style="margin-right:10px; margin-top: -4px;" @click="newEntity">新增检测地点</el-button>
+          <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" @click="newPositionEntity">新增安装位置</el-button>
+        </span>
+        <!--<el-form ref="form" :inline="true" style="float: right; margin-top: -10px;">
+          <el-form-item label="样品名称">
+            <el-input size="mini" style="width: 165px;" v-model="keyword" placeholder="请输入样品名称" clearable></el-input>
+          </el-form-item>
+          <el-form-item>
+            <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" @click="seachdata">查询</el-button>
+          </el-form-item>
+        </el-form>-->
+      </div>
+      <el-row :gutter="20">
+        <el-col :span="6">
+          <el-tree style="height: 570px; overflow: auto;" draggable highlight-current :expand-on-click-node="true" node-key="id" :data="customerTreeList" :props="orgtreeprops"
+                   :default-expanded-keys="defaultSelect" @node-click="orgtreeNodeClick" ref="orgmanagetree">
+          </el-tree>
+        </el-col>
+        <el-col :span="18">
+          <el-table :data="entityList" border style="height: 570px; overflow: auto;" size="small">
+            <el-table-column label="操作" width="150" align="center" fixed>
+              <template slot-scope="scope" v-if="scope.row.Parentid !== 0">
+                <el-button  type="primary" plain size="mini" @click="editEntity(scope.row)"
+                            title="编辑">编辑</el-button>
+                <el-button plain size="mini" @click="deleteConfirm(scope.row)" title="删除"
+                           style="margin-left: 3px">删除</el-button>
+              </template>
+            </el-table-column>
+            <el-table-column v-for="column in tableColumns"
+                             :prop="column.prop" sortable min-width="100" :label="column.label" align="center" show-overflow-tooltip :key="column.prop" ></el-table-column>
+
+            <el-table-column prop="CreateOn" sortable min-width="150" label="生成时间" align="center" show-overflow-tooltip>
+              <template slot-scope="scope">
+                {{ jstimehandle(scope.row.CreateOn+'') }}
+              </template>
+            </el-table-column>
+          </el-table>
+        </el-col>
+      </el-row>
+      <!--分页-->
+      <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
+                     :page-sizes="[10, 15, 20, 25]" :page-size="size" layout="total, sizes, prev, pager, next, jumper" :total="currentItemCount">
+      </el-pagination>
+    </el-card>
+    <!--新增、编辑样品类型-->
+    <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-option v-for="item in thrUnitList" :key="item.Id" :label="item.Fullname" :value="item.Id"></el-option>
+          </el-select>-->
+          <el-input v-model="formData.ThrUnit" placeholder="请输入"  style="width: 100%"></el-input>
+        </el-form-item>
+
+        <el-form-item label="检测地点名称" required>
+          <el-input v-model="formData.PositionName" placeholder="请输入"  style="width: 100%"></el-input>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisible = false" size="small">取 消</el-button>
+        <el-button type="primary" @click="saveEntity()" size="small">确 定</el-button>
+      </div>
+    </el-dialog>
+
+    <el-dialog title="安装位置信息" :visible.sync="positionDialogVisible" width="720px" size="small">
+      <el-form :model="formData" ref="EntityForm2" label-width="120px">
+
+        <el-form-item label="检测地点">
+          <el-select v-model="formData.ParentId" style="width:100%" placeholder="请选择" filterable required>
+            <el-option v-for="item in customerOrigList" :key="item.Id" :label="item.PositionName" :value="item.Id"></el-option>
+          </el-select>
+        </el-form-item>
+
+        <el-form-item label="设备类型" prop="ProjectTypeId" required>
+          <el-select ref="refProjectTypeId" v-model="formData.ProjectTypeId" style="width:100%" filterable placeholder="请选择">
+            <el-option v-for="item in projectTypeList" :key="item.id" :label="item.FullName" :value="item.Id"></el-option>
+          </el-select>
+        </el-form-item>
+
+        <el-form-item label="位置名称" required>
+          <el-input v-model="formData.PositionName" placeholder="请输入"  style="width: 100%"></el-input>
+        </el-form-item>
+
+        <el-form-item label="排序码" required>
+          <el-input-number v-model="formData.SortCode" :step="1" :min="0" label="排序码"></el-input-number>
+        </el-form-item>
+
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="positionDialogVisible = false" size="small">取 消</el-button>
+        <el-button type="primary" @click="savePositionEntity()" size="small">确 定</el-button>
+      </div>
+    </el-dialog>
+
+    <!--<el-dialog title="编辑" :visible.sync="dialogVisible" width="720px" size="small">
+      <el-form :model="formData" ref="EntityForm" label-width="120px">
+
+        <el-form-item label="上级位置">
+          <el-row>
+            <el-col :span="12">
+              <el-input ref="nodeRootInput" v-model="tmpShowSelectNodeName" placeholder="请输入" readonly style="width: 100%">
+              </el-input>
+            </el-col>
+            <el-col :span="12">
+              <el-button-group>
+                <el-button @click="setNodeParentZero">根节点</el-button>
+                <el-button @click="setNodeParentCurrent">当前</el-button>
+                <el-popover
+                  placement="top-start"
+                  title="其它节点"
+                  width="200"
+                  v-model="otherNodeVisible"
+                  trigger="manual">
+                  <el-cascader :options="customerTreeList" :props="orgtreeprops" v-model="selectedorg" @change="getProject"
+                               change-on-select placeholder="请选择位置" clearable filterable style="width: 100%"></el-cascader>
+                  <el-button slot="reference" @click="otherNodeVisible = !otherNodeVisible">其它</el-button>
+                </el-popover>
+              </el-button-group>
+            </el-col>
+            <el-col :span="4">
+
+            </el-col>
+            <el-col :span="4">
+
+            </el-col>
+          </el-row>
+        </el-form-item>
+
+        <el-form-item label="客户位置名称">
+          <el-input v-model="formData.PositionName" placeholder="请输入"  style="width: 100%"></el-input>
+        </el-form-item>
+
+        &lt;!&ndash;<el-form-item label="位置类型">
+          <el-input v-model="formData.PositionTypeId" placeholder="请输入"  style="width: 100%"></el-input>
+        </el-form-item>&ndash;&gt;
+
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisible = false">取 消</el-button>
+        <el-button type="primary" @click="saveEntity()">确 定</el-button>
+      </div>
+    </el-dialog>-->
+
+  </div>
+</template>
+
+<script>
+  import { mapGetters } from 'vuex'
+  import api from '@/api/lims/customerposition'
+
+  export default {
+    computed: {
+      ...mapGetters({
+        authUser: 'authUser'
+      })
+    },
+    name: 'customerposition',
+    props: {
+      CustomerId: Number,
+      DivStyle: String,
+    },
+
+    data() {
+      return {
+        QueryProjectTypeId: null,
+        otherNodeVisible: false,
+        dialogVisible: false,
+        positionDialogVisible: false,
+        defaultSelect: [],
+        customerTreeList: [],
+        customerOrigList: [],
+        projectTypeList: [],
+        selectedorg: [],
+        thrUnitList: [],
+        selectNodeId: '0',
+        selectNodeName: '根节点',
+        tmpShowSelectNodeName: '',
+        orgtreeprops: {
+          value: 'id',
+          label: 'PositionName',
+          children: 'children'
+        },
+        //列表数据
+        entityList: [],
+        //分页参数
+        size: 10,
+        currentPage: 1,
+        currentItemCount: 0,
+        //列表排序
+        Column: {
+          Order: '',
+          Prop: ''
+        },
+        formDataReset: {
+          Id: 0,
+          CustomerId: 0,
+          ParentId: 0,
+          AuthCode: '',
+          PositionName: '',
+          PositionCode: '',
+          PositionType: '',
+          PositionTypeId: 1,
+          ProjectType: '',
+          ProjectTypeId: 0,
+          SortCode: 0,
+          CreateOn: '',
+          CreateUserId: 0,
+          CreateBy: '',
+          ModifiedOn: '',
+          ModifiedUserId: '',
+          ModifiedBy: '',
+
+        },
+        formData: {
+          Id: 0,
+          CustomerId: 0,
+          ParentId: 0,
+          AuthCode: '',
+          PositionName: '',
+          PositionCode: '',
+          PositionType: '',
+          PositionTypeId: 0,
+          ProjectType: '',
+          ProjectTypeId: 0,
+          SortCode: 0,
+          CreateOn: '',
+          CreateUserId: 0,
+          CreateBy: '',
+          ModifiedOn: '',
+          ModifiedUserId: '',
+          ModifiedBy: '',
+
+        },
+        //查询时间
+        CreateOn: [new Date(new Date().getTime() - 30 * 24 * 60 * 60 * 1000), new Date()],
+        tableColumns: [
+          {
+            prop: "PositionName",
+            label: '客户位置名称',
+            width: 200,
+            sort: true
+          },
+
+          {
+            prop: "PositionType",
+            label: '位置类型',
+            width: 100,
+            sort: true
+          },
+
+          {
+            prop: "ProjectType",
+            label: '设备类型',
+            sort: true
+          },
+
+          {
+            prop: "SortCode",
+            label: '排序码',
+            width: 80,
+            sort: true
+          },
+
+
+
+          // {
+          //   prop: "CreateOn",
+          //   label: '创建时间',
+          //   width: 100,
+          //   sort: true
+          // },
+
+          {
+            prop: "CreateBy",
+            label: '创建人',
+            width: 100,
+            sort: true
+          },
+
+        ]
+      }
+    },
+    created() {
+      //查询列表
+      this.customerCheckBuildList()
+      this.gettreelist()
+      this.initDatas()
+      // this.getDictOptions()
+      this.getProjectType()
+    },
+    methods: {
+      initEntity (id) {
+        if (id) {
+          api.getEntity(id, this.$axios).then(res => {
+            this.formData = res.data
+          }).catch(err => {
+            console.error(err)
+          });
+        }
+      },
+
+      ProjectTypeChangeHandler() {
+        this.initDatas()
+      },
+
+      ProjectTypeClearHandler() {
+        this.initDatas()
+      },
+
+      initDatas() {
+        //分页及列表条件
+        let params = {
+          _currentPage: this.currentPage,
+          _size: this.size,
+          Order: this.Column.Order,
+          Prop: this.Column.Prop,
+          ParentId: this.selectNodeId + "",
+          CustomerId: this.CustomerId + "",
+          ProjectTypeId: this.QueryProjectTypeId + '',
+          outCustomer: 'true'
+        };
+
+        //访问接口
+        api.getList('', params, this.$axios).then(res => {
+          this.entityList = res.data.items;
+          this.currentItemCount = res.data.currentItemCount;
+        }).catch(err => {
+          console.error(err)
+        })
+      },
+
+      // 保存信息
+      saveEntity () {
+        if (!this.formData.ThrUnit) {
+          this.$message({
+            type: 'warning',
+            message: '受检单位不能为空'
+          })
+          return
+        }
+
+        this.$refs['EntityForm'].validate((valid) => {
+          if (valid) {
+            this.formData.CustomerId = this.CustomerId
+            this.formData.ParentId = 0
+            this.formData.PositionType = '检测地点'
+            this.formData.PositionTypeId = '1'
+            if (!this.formData.Id) {
+              this.addEntity()
+            } else {
+              this.updateEntity()
+            }
+          } else {
+            return false
+          }
+        })
+      },
+
+      savePositionEntity () {
+        if (!this.formData.ParentId) {
+          this.$message({
+            type: 'warning',
+            message: '检测地点不能为空'
+          })
+          return
+        }
+        if (!this.formData.ProjectTypeId) {
+          this.$message({
+            type: 'warning',
+            message: '设备类型不能为空'
+          })
+          return
+        }
+        if (!this.formData.PositionName) {
+          this.$message({
+            type: 'warning',
+            message: '位置名称不能为空'
+          })
+          return
+        }
+        this.$refs['EntityForm2'].validate((valid) => {
+          if (valid) {
+            this.formData.CustomerId = this.CustomerId
+            this.formData.PositionType = '安装位置'
+            this.formData.PositionTypeId = '2'
+            this.formData.ProjectType = this.$refs['refProjectTypeId'].selectedLabel
+            if (!this.formData.Id) {
+              this.addEntity()
+            } else {
+              this.updateEntity()
+            }
+
+          } else {
+            return false
+          }
+        })
+      },
+
+      addEntity() {
+        api.addEntity(this.formData, this.$axios).then(res => {
+          if (res.data.code === 0) {
+            //保存成功后,初始化数据,变成修改
+            this.formData.Id = res.data.item;
+            this.initDatas();
+            this.gettreelist();
+            this.customerCheckBuildList();
+            this.$message({
+              type: 'success',
+              message: res.data.message
+            });
+            this.dialogVisible = false
+            this.positionDialogVisible = false
+
+          } else {
+            this.$message({
+              type: 'warning',
+              message: res.data.message
+            });
+          }
+        }).catch(err => {
+          console.error(err)
+        });
+      },
+
+      updateEntity() {
+        api.updateEntity(this.formData.Id, this.formData, this.$axios).then(res => {
+          if (res.data.code === 0) {
+            //保存成功后,初始化数据,变成修改
+            this.initDatas();
+            this.gettreelist();
+            this.customerCheckBuildList();
+            this.$message({
+              type: 'success',
+              message: res.data.message
+            });
+            this.dialogVisible = false
+            this.positionDialogVisible = false
+
+          } else {
+            this.$message({
+              type: 'warning',
+              message: res.data.message
+            });
+          }
+        }).catch(err => {
+          console.error(err)
+        });
+      },
+
+      /*getDictOptions () {
+        api.getDictList(this.$axios).then(res => {
+          console.log(res.data.items)
+          this.thrUnitList = res.data.items['ThrUnitList']
+        }).catch(err => {
+          console.error(err)
+        })
+      },*/
+
+
+      setNodeParentZero() {
+        this.formData.ParentId = 0;
+        this.tmpShowSelectNodeName = "根节点";
+      },
+
+      setNodeParentCurrent() {
+        this.formData.ParentId = this.selectNodeId;
+        this.tmpShowSelectNodeName = this.selectNodeName;
+      },
+
+      orgtreeNodeClick(data) {
+        this.selectNodeId = data.id + '';
+        this.selectNodeName = data.PositionName + '';
+
+        this.currentPage = 1;
+        this.initDatas();
+      },
+
+      searchCommand(command) {
+        if (command == 'search') {
+          this.dialogVisible = true
+        } else if (command == 'clear') {
+          this.clearSearch()
+        }
+      },
+      //列表排序功能
+      orderby(column) {
+        if (column.order == 'ascending') {
+          this.Column.Order = 'asc'
+        } else if (column.order == 'descending') {
+          this.Column.Order = 'desc'
+        }
+        this.Column.Prop = column.prop
+        this.initDatas()
+      },
+      handleCurrentChange(value) {
+        this.currentPage = value
+        this.initDatas()
+      },
+      handleSizeChange(value) {
+        this.size = value
+        this.currentPage = 1
+        this.initDatas()
+      },
+      deleteConfirm(row) {
+        this.$confirm('此操作将永久删除该位置, 是否继续?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          this.deleteEntity(row)
+        })
+      },
+      deleteEntity(row) {
+        row.deleteConfirmFlag = false;
+        api.deleteEntity(row.Id, this.$axios).then(res => {
+          if (res.data.code === 0) {
+            this.initDatas();
+            this.gettreelist();
+            this.$message({
+              type: 'success',
+              message: res.data.message
+            });
+
+          } else {
+            this.$message({
+              type: 'warning',
+              message: res.data.message
+            });
+          }
+        }).catch(err => {
+          console.error(err)
+        });
+      },
+
+      customerCheckBuildList() {
+        let params = {
+          CustomerId: this.CustomerId + "",
+        }
+        api.customerCheckBuildList(params, this.$axios).then(res => {
+          this.customerOrigList = res.data.items
+        }).catch(err => {
+          // handle error
+          console.error(err)
+        })
+      },
+
+      gettreelist() {
+        let params = {
+          CustomerId: this.CustomerId + '',
+        };
+
+        api.customerPositionTreeOut(params, this.$axios).then(res => {
+          this.customerTreeList = window.toolfun_gettreejson(res.data.items, 'Id', 'ParentId',
+            'Id,CustomerId,ParentId,PositionName,PositionCode,PositionType,PositionTypeId');
+        })
+          .catch(err => {
+            // handle error
+            console.error(err)
+          })
+      },
+
+      editEntity (row) {
+        this.initEntity(row.Id)
+        if (row.PositionTypeId === '1') {
+          this.dialogVisible = true
+        } else {
+          this.positionDialogVisible = true
+        }
+      },
+
+      formReset () {
+        this.formData.Id = 0
+        this.formData.CustomerId = 0
+        this.formData.ParentId = 0
+        this.formData.AuthCode = ''
+        this.formData.PositionName = ''
+        this.formData.PositionCode = ''
+        this.formData.PositionType = ''
+        this.formData.PositionTypeId = 0
+        this.formData.ProjectType = ''
+        this.formData.ProjectTypeId = 0
+        this.formData.SortCode = 0
+        this.formData.CreateOn = ''
+        this.formData.CreateUserId = 0
+        this.formData.CreateBy = ''
+        this.formData.ModifiedOn = ''
+        this.formData.ModifiedUserId = ''
+        this.formData.ModifiedBy = ''
+      },
+
+      newEntity () {
+        this.formReset()
+        this.dialogVisible = true
+      },
+
+      newPositionEntity () {
+        this.formReset()
+        if (this.selectNodeId) {
+          this.formData.ParentId = parseInt(this.selectNodeId)
+        } else {
+          this.formData.ParentId = null
+        }
+        this.positionDialogVisible = true
+      },
+
+      getParentNode(parentId) {
+        api.getEntity(parentId, this.$axios).then(res => {
+          this.tmpShowSelectNodeName = res.data.PositionName;
+        }).catch(err => {
+          // handle error
+          console.error(err)
+        })
+      },
+
+      jstimehandle(val) {
+        if (val === '') {
+          return '----'
+        } else if (val === '0001-01-01T08:00:00+08:00') {
+          return '----'
+        } else if (val === '5000-01-01T23:59:59+08:00') {
+          return '永久'
+        } else {
+          val = val.replace('T', ' ')
+          return val.substring(0, 10)
+        }
+      },
+
+      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;
+      },
+
+      //设备类型
+      getProjectType() {
+        let _this = this
+        _this.$axios.get('/testtype/testypetreeall', {})
+          .then(res => {
+            _this.testTypeList = res.data.items
+            if (!_this.testTypeList) {
+              return false
+            }
+            for (var i = 0; i < _this.testTypeList.length; i++) {
+              if (_this.testTypeList[i].ParentId == 0) {
+                _this.projectTypeList.push(_this.testTypeList[i])
+              }
+            }
+          })
+          .catch(err => {
+            // handle error
+            console.error(err)
+          })
+      },
+
+    }
+  }
+
+</script>
+
+<style lang="scss">
+  .el-pagination {
+    margin: 1rem 0 2rem;
+    text-align: right;
+  }
+
+  .triggerone {
+    font-size: 13px;
+    margin-left: 80px;
+  }
+
+  .plab {
+    font-size: 13px;
+    color: #999;
+  }
+</style>

+ 5 - 6
src/dashoo.cn/frontend_web/src/pages/lims/secondunitform/index.vue

@@ -22,9 +22,9 @@
         <el-row :gutter="20" class="donorsaddformcss">
           <el-col :span="8">
             <el-form-item label="类型" prop="ViceBusiness">
-              <el-select v-model="customerForm.ViceBusiness" style="width:100%" :default-first-option="true" placeholder="请选择委托方类型">
+              <el-select v-model="customerForm.ViceBusiness" style="width:100%" :default-first-option="true" disabled placeholder="请选择委托方类型">
                 <el-option label="大港油田" value="大港油田"></el-option>
-                <el-option label="外部委托方" value="外部委托方"></el-option>
+                <!--<el-option label="外部委托方" value="外部委托方"></el-option>-->
               </el-select>
             </el-form-item>
           </el-col>
@@ -91,7 +91,7 @@
       CustomerPosition,
       CheckEquipmentList
     },
-    data() {
+    data () {
       return {
         activeName: '1',
         saveLoading: false,
@@ -99,7 +99,7 @@
         pagetitle: '', //界面标题
         customerForm: {
           Id: '',
-          ViceBusiness: '',
+          ViceBusiness: '大港油田',
           CustomerName: '',
           CustomerCode: '',
           Person: '',
@@ -302,11 +302,10 @@
             // handle error
             console.error(err)
           })
-      },
+      }
 
     }
   }
-
 </script>
 
 <style lang="scss">