3
2
Bläddra i källkod

二级单位-位置台账

yuedefeng 6 år sedan
förälder
incheckning
546d88900d

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

@@ -22,6 +22,8 @@ type Customer struct {
 	Representative string    `xorm:"VARCHAR(50)"`  //法定代表人
 	MainBusiness   string    `xorm:"VARCHAR(50)"`  //主营业务
 	ViceBusiness   string    `xorm:"VARCHAR(50)"`  //兼营业务
+	DepartmentId   string    `xorm:"VARCHAR(50)"`  //部门ID
+	DepartmentName string    `xorm:"VARCHAR(50)"`  //部门名称
 	CreateUserId   int       `xorm:"INT(10)"`
 	CreateBy       string    `xorm:"VARCHAR(255)"`
 	CreateOn       time.Time `xorm:"DATETIME created"`

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

@@ -13,6 +13,9 @@ type LimsCustomerPosition struct {
 	PositionCode   string    `xorm:"comment('客户位置码') VARCHAR(50)"`
 	PositionType   string    `xorm:"comment('位置类型(1-检测地点,2-安装区域)') VARCHAR(50)"`
 	PositionTypeId string    `xorm:"comment('位置类型ID') VARCHAR(50)"`
+	ProjectTypeId  int    	 `xorm:"comment('数据录入模板类型ID') INT(10)"`
+	ProjectType    string    `xorm:"comment('数据录入模板名称') VARCHAR(50)"`
+	SortCode  	   int    	 `xorm:"comment('排序码') INT(10)"`
 	CreateOn       time.Time `xorm:"DATETIME"`
 	CreateUserId   int       `xorm:"INT(10)"`
 	CreateBy       string    `xorm:"VARCHAR(255)"`

+ 51 - 4
src/dashoo.cn/backend/api/controllers/lims/Limscustomerposition.go

@@ -25,14 +25,16 @@ func (this *LimsCustomerpositionController) GetEntityList() {
 	//获取分页信息
 	page := this.GetPageInfoForm()
 	where := " 1=1 "
-	orderby := "Id"
-	asc := false
+	orderby := "SortCode, Id"
+	asc := true
 	Order := this.GetString("Order")
 	Prop := this.GetString("Prop")
 	if Order != "" && Prop != "" {
 		orderby = Prop
 		if Order == "asc" {
 			asc = true
+		} else {
+			asc = false
 		}
 	}
 	Id := this.GetString("Id")
@@ -49,6 +51,11 @@ func (this *LimsCustomerpositionController) GetEntityList() {
 	ModifiedUserId := this.GetString("ModifiedUserId")
 	ModifiedBy := this.GetString("ModifiedBy")
 
+	ProjectTypeId := this.GetString("ProjectTypeId")
+	if ProjectTypeId != "" && ProjectTypeId != "null"{
+		where = where + " and ProjectTypeId = '" + ProjectTypeId + "'"
+	}
+
 	if Id != "" {
 		where = where + " and Id like '%" + Id + "%'"
 	}
@@ -136,7 +143,29 @@ func (this *LimsCustomerpositionController) CustomerpositionTree() {
 		where = where + " and CustomerId = '" + CustomerId + "'"
 	}
 
-	svc.GetEntitysByOrderbyWhere(this.User.AccCode+LimsCustomerpositionName, where, "Id desc", &list)
+	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
+// @router /customercheckbuildlist [get]
+func (this *LimsCustomerpositionController) CustomerCheckBuildList() {
+	var list []limscustomerposition.LimsCustomerPosition
+	svc := limscustomerposition.GetLimsCustomerpositionService(utils.DBE)
+
+	where := " 1=1 "
+	CustomerId := this.GetString("CustomerId")
+	if CustomerId != "" {
+		where = where + " and CustomerId = '" + CustomerId + "'"
+	}
+	where = where + " and PositionTypeId = '1'"
+
+	svc.GetEntitysByOrderbyWhere(this.User.AccCode+LimsCustomerpositionName, where, "SortCode, Id asc", &list)
 	var datainfo DataInfo
 	datainfo.Items = list
 	this.Data["json"] = &datainfo
@@ -259,6 +288,12 @@ func (this *LimsCustomerpositionController) UpdateEntity() {
 
 		"PositionTypeId",
 
+		"ProjectTypeId",
+
+		"ProjectType",
+
+		"SortCode",
+
 		"CreateOn",
 
 		"CreateUserId",
@@ -300,9 +335,21 @@ func (this *LimsCustomerpositionController) DeleteEntity() {
 		this.ServeJSON()
 		return
 	}
+
+	svc := limscustomerposition.GetLimsCustomerpositionService(utils.DBE)
+	var children []limscustomerposition.LimsCustomerPosition
+	cntWhere := "ParentId='" + Id + "'"
+	svc.GetEntitysByWhere(this.User.AccCode+LimsCustomerpositionName, cntWhere, &children)
+	if children != nil && len(children) > 0 {
+		errinfo.Message = "包括子节点不允许删除,请先删除子节点!"
+		errinfo.Code = -3
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+		return
+	}
+
 	var model limscustomerposition.LimsCustomerPosition
 	var entityempty limscustomerposition.LimsCustomerPosition
-	svc := limscustomerposition.GetLimsCustomerpositionService(utils.DBE)
 	opdesc := "删除-" + Id
 	err := svc.DeleteOperationAndWriteLogBytbl(this.User.AccCode+LimsCustomerpositionName, BaseOperationLogName, Id, &model, &entityempty, utils.ToStr(this.User.Id), this.User.Username, opdesc, this.User.AccCode, "钻井日报")
 	if err == nil {

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

@@ -124,6 +124,21 @@ func (this *CustomerController) Getcustomerlist() {
 	this.ServeJSON()
 }
 
+// @Title 获取编辑时的客户原始信息内容
+// @Description 获取编辑时的客户原始信息内容
+// @Success 200 {object} business.device.DeviceChannels
+// @router /getcustomerbydepartid [get]
+func (this *CustomerController) GetCustomerByDepartmentId() {
+	var model customer2.Customer
+	svc := customer2.GetCustomerService(utils.DBE)
+	where := "DepartmentId = '" + this.User.DepartmentId + "'"
+	svc.GetEntityByWhere(this.User.AccCode+CustomerName, where, &model)
+	var datainfo DataInfo
+	datainfo.Items = model
+	this.Data["json"] = &datainfo
+	this.ServeJSON()
+}
+
 // @Title 编辑试管信息
 // @Description 编辑试管信息
 // @Param	id	path	string	true		"需要修改的试管信息"

+ 15 - 0
src/dashoo.cn/backend/api/controllers/lims/testtype.go

@@ -134,6 +134,21 @@ func (this *TestTypeController) TestTypeTreeByOrg() {
 	this.ServeJSON()
 }
 
+// @Title 按组织结构获取树形结构
+// @Description 按组织结构获取树形结构
+// @Success 200 {object} business.device.DeviceChannels
+// @router /testypetreeall [get]
+func (this *TestTypeController) TestTypeTreeAll() {
+	var list []testtype.TestTemplateModel
+	svc := testtype.GetTestTypeService(utils.DBE)
+	where := " 1=1 "
+	list = svc.GetListWithTemplate(this.User.AccCode+TestPackageTypesName, this.User.AccCode+LimsDocTemplateName, where, "a.Id desc")
+	var datainfo DataInfo
+	datainfo.Items = list
+	this.Data["json"] = &datainfo
+	this.ServeJSON()
+}
+
 // @Title 添加检验套餐
 // @Description 新增检验套餐
 // @Param	body	body	business.device.DeviceChannels	"检验套餐"

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

@@ -14,11 +14,11 @@ module.exports = {
   ** Headers of the page
   */
   head: {
-    title: '大港油田检测监督评价管理系统',
+    title: '检测监督评价管理系统',
     meta: [
       { charset: 'utf-8' },
       { name: 'viewport', content: 'width=device-width, initial-scale=1' },
-      { hid: 'description', name: 'description', content: '大港油田检测监督评价管理系统' }
+      { hid: 'description', name: 'description', content: '检测监督评价管理系统' }
     ],
     link: [
       { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
@@ -159,8 +159,22 @@ module.exports = {
     onlyofficeUrl: 'http://47.92.212.59:9221', //onlyoffice地址 Lims
     onlyofficeCallBackUrl: 'http://47.92.212.59:10091', //onlyofficeCallBack地址  Lims
     // baseURL: '//47.92.212.59:10091/api/'
-	baseURL: '//localhost:10091/api/'
+	  baseURL: '//localhost:10091/api/'
   },
-  ignore: [
-  ]
+  /*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/!*.*',
+  ]*/
 }

+ 4 - 4
src/dashoo.cn/frontend_web/nuxt.config.js

@@ -14,7 +14,7 @@ module.exports = {
    ** Headers of the page
    */
   head: {
-    title: '大港油田检测监督评价管理系统', //细胞制备系统
+    title: '检测监督评价管理系统', //细胞制备系统
     meta: [{
         charset: 'utf-8'
       },
@@ -25,7 +25,7 @@ module.exports = {
       {
         hid: 'description',
         name: 'description',
-        content: '大港油田检测监督评价管理系统'
+        content: '检测监督评价管理系统'
       }
     ],
     link: [{
@@ -165,7 +165,7 @@ module.exports = {
   axios: {
     // baseURL: '//localhost:10091/api/' // 本机开发使用
     baseURL: '//47.92.212.59:10091/api/' // Lims使用
-   
+
     // proxyHeaders: false
   },
   /*
@@ -178,7 +178,7 @@ module.exports = {
     imgserverhost: 'http://47.92.212.59:10091', //图片上传文件
     upfilehost: 'http://weed1.labsop.cn:9333/dir/assign', // 附件上传
 
-   
+
     //onlyofficeUrl: 'http://192.168.0.252:9221', //onlyoffice地址
     //onlyofficeCallBackUrl: 'http://192.168.0.108:10091', //onlyofficeCallBack的本地地址
     //onlyofficeUrl: 'http://47.92.212.59:9221', //onlyoffice地址 Lims

+ 1 - 1
src/dashoo.cn/frontend_web/package.json

@@ -26,7 +26,7 @@
     "chart.js": "^2.7.0",
     "cross-env": "^5.1.1",
     "echarts": "^3.8.5",
-    "element-ui": "^2.2.2",
+    "element-ui": "^2.9.1",
     "es6-promise": "^4.1.1",
     "highcharts": "^5.0.15",
     "js-cookie": "^2.1.4",

+ 10 - 1
src/dashoo.cn/frontend_web/src/api/lims/customerposition.js

@@ -1,6 +1,5 @@
 export default {
   getList(CreateOn, params, myAxios) {
-    console.log(params);
     return myAxios({
       url: '/limscustomerposition/list?CreateOn='+ CreateOn,
       method: 'GET',
@@ -48,4 +47,14 @@ export default {
     })
   },
 
+  customerCheckBuildList(params, myAxios) {
+    return myAxios({
+      url: '/limscustomerposition/customercheckbuildlist',
+      method: 'GET',
+      params: params
+    })
+  },
+
+
+
 }

BIN
src/dashoo.cn/frontend_web/src/assets/img/title_dagang3.png


+ 2 - 0
src/dashoo.cn/frontend_web/src/components/Headbar.vue

@@ -118,6 +118,8 @@
               this.department = '质检中心'
             }else if  (res.data.items === 'zj') {
               this.department = '物资商品检验所'
+            } else {
+              this.department = '欢迎使用'
             }
           })
           .catch(err => {

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

@@ -68,7 +68,7 @@
         </el-row>
       </el-form>
 
-      <customer-position :CustomerId="customerId" v-if="service_flag != 'addservice'"></customer-position>
+      <customer-position :CustomerId="customerId" DivStyle="height: 700px" v-if="service_flag != 'addservice'"></customer-position>
     </el-card>
 
 

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

@@ -1,12 +1,16 @@
 <template>
   <div>
-    <el-card class="box-card" style="height: 700px;">
+    <el-card class="box-card" :style="DivStyle">
       <div slot="header">
         <span>
           <i class="icon icon-table2">位置树</i>
         </span>
         <span style="float: right;">
-          <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" @click="opendatadialog(1,null,-1)">新增位置</el-button>
+          <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="样品名称">
@@ -24,12 +28,12 @@
           </el-tree>
         </el-col>
         <el-col :span="18">
-          <el-table :data="entityList" border style="height: 570px; overflow: auto;">
+          <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="opendatadialog(2,scope.row,scope.$index)"
+                <el-button  type="primary" plain size="mini" @click="editEntity(scope.row)"
                            title="编辑">编辑</el-button>
-                <el-button  type="primary" plain size="mini" @click="deleteEntity(scope.row)" title="删除"
+                <el-button plain size="mini" @click="deleteConfirm(scope.row)" title="删除"
                            style="margin-left: 3px">删除</el-button>
               </template>
             </el-table-column>
@@ -50,7 +54,49 @@
       </el-pagination>
     </el-card>
     <!--新增、编辑样品类型-->
-    <el-dialog title="编辑" :visible.sync="dialogVisible" width="720px" size="small">
+    <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-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="上级位置">
@@ -88,16 +134,16 @@
           <el-input v-model="formData.PositionName" placeholder="请输入"  style="width: 100%"></el-input>
         </el-form-item>
 
-        <el-form-item label="位置类型">
+        &lt;!&ndash;<el-form-item label="位置类型">
           <el-input v-model="formData.PositionTypeId" placeholder="请输入"  style="width: 100%"></el-input>
-        </el-form-item>
+        </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>
+    </el-dialog>-->
 
   </div>
 </template>
@@ -115,15 +161,19 @@
     name: 'customerposition',
     props: {
       CustomerId: Number,
+      DivStyle: String,
     },
 
     data() {
       return {
+        QueryProjectTypeId: null,
         otherNodeVisible: false,
         dialogVisible: false,
+        positionDialogVisible: false,
         defaultSelect: [],
         customerTreeList: [],
         customerOrigList: [],
+        projectTypeList: [],
         selectedorg: [],
         selectNodeId: '0',
         selectNodeName: '根节点',
@@ -145,16 +195,19 @@
           Prop: ''
         },
         formDataReset: {
-          Id: '',
-          CustomerId: '',
-          ParentId: '',
+          Id: 0,
+          CustomerId: 0,
+          ParentId: 0,
           AuthCode: '',
           PositionName: '',
           PositionCode: '',
           PositionType: '',
-          PositionTypeId: '',
+          PositionTypeId: 1,
+          ProjectType: '',
+          ProjectTypeId: 0,
+          SortCode: 0,
           CreateOn: '',
-          CreateUserId: '',
+          CreateUserId: 0,
           CreateBy: '',
           ModifiedOn: '',
           ModifiedUserId: '',
@@ -162,16 +215,19 @@
 
         },
         formData: {
-          Id: '',
-          CustomerId: '',
-          ParentId: '',
+          Id: 0,
+          CustomerId: 0,
+          ParentId: 0,
           AuthCode: '',
           PositionName: '',
           PositionCode: '',
           PositionType: '',
-          PositionTypeId: '',
+          PositionTypeId: 0,
+          ProjectType: '',
+          ProjectTypeId: 0,
+          SortCode: 0,
           CreateOn: '',
-          CreateUserId: '',
+          CreateUserId: 0,
           CreateBy: '',
           ModifiedOn: '',
           ModifiedUserId: '',
@@ -188,19 +244,27 @@
             sort: true
           },
 
-          /*{
-            prop: "PositionCode",
-            label: '客户位置码',
+          {
+            prop: "PositionTypeId",
+            label: '位置类型',
             width: 100,
             sort: true
           },
 
           {
-            prop: "PositionType",
-            label: '位置类型',
-            width: 100,
+            prop: "ProjectType",
+            label: '检测项目',
+            sort: true
+          },
+
+          {
+            prop: "SortCode",
+            label: '排序码',
+            width: 80,
             sort: true
-          },*/
+          },
+
+
 
           // {
           //   prop: "CreateOn",
@@ -221,21 +285,31 @@
     },
     created() {
       //查询列表
-      this.gettreelist();
-      this.initDatas();
+      this.customerCheckBuildList()
+      this.gettreelist()
+      this.initDatas()
       //this.getDictOptions()
+      this.getProjectType()
     },
     methods: {
-      initEntity() {
-        if(this.formData.Id) {
-          api.getEntity(this.formData.Id, this.$axios).then(res => {
-            this.formData = res.data;
+      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 = {
@@ -245,6 +319,7 @@
           Prop: this.Column.Prop,
           ParentId: this.selectNodeId + "",
           CustomerId: this.CustomerId + "",
+          ProjectTypeId: this.QueryProjectTypeId + '',
         };
 
         //访问接口
@@ -260,20 +335,54 @@
       saveEntity() {
         this.$refs['EntityForm'].validate((valid) => {
           if (valid) {
-            this.formData.CustomerId = this.CustomerId;
-            this.formData.ParentId = parseInt(this.formData.ParentId);
-            if(this.formData.Id !=0 && this.formData.Id == this.formData.ParentId) {
-              this.$message({
-                type: 'error',
-                message: '父节点不能选自己'
-              });
-              return false;
+            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();
+              this.addEntity()
             } else {
-              this.updateEntity();
+              this.updateEntity()
             }
 
           } else {
@@ -289,11 +398,13 @@
             this.formData.Id = res.data.item;
             this.initDatas();
             this.gettreelist();
+            this.customerCheckBuildList();
             this.$message({
               type: 'success',
               message: res.data.message
             });
-            this.dialogVisible = false;
+            this.dialogVisible = false
+            this.positionDialogVisible = false
 
           } else {
             this.$message({
@@ -312,11 +423,13 @@
             //保存成功后,初始化数据,变成修改
             this.initDatas();
             this.gettreelist();
+            this.customerCheckBuildList();
             this.$message({
               type: 'success',
               message: res.data.message
             });
-            this.dialogVisible = false;
+            this.dialogVisible = false
+            this.positionDialogVisible = false
 
           } else {
             this.$message({
@@ -339,19 +452,6 @@
         })
       },
 
-      getProject() {
-        let tmpValue = 0;
-        if(this.selectedorg.length > 0) {
-          tmpValue = this.selectedorg[this.selectedorg.length-1];
-        }
-
-        for (var i = 0; i < this.customerOrigList.length; i++) {
-          if (tmpValue == this.customerOrigList[i].Id) {
-            this.formData.ParentId = this.customerOrigList[i].Id;
-            this.tmpShowSelectNodeName = this.customerOrigList[i].PositionName;
-          }
-        }
-      },
 
       setNodeParentZero() {
         this.formData.ParentId = 0;
@@ -397,6 +497,15 @@
         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 => {
@@ -419,13 +528,25 @@
         });
       },
 
+      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.customerPositionTree(params, this.$axios).then(res => {
-            this.customerOrigList = res.data.items;
             this.customerTreeList = window.toolfun_gettreejson(res.data.items, 'Id', 'ParentId',
               'Id,CustomerId,ParentId,PositionName,PositionCode,PositionType,PositionTypeId');
           })
@@ -434,21 +555,51 @@
             console.error(err)
           })
       },
-      opendatadialog(item, v, index) {
-        Object.assign(this.formData, this.formDataReset);
-        if(item == 1) {
-          this.formData.Id = 0;
-          this.formData.ParentId = this.selectNodeId;
-          this.tmpShowSelectNodeName = this.selectNodeName;
+
+      editEntity (row) {
+        this.initEntity(row.Id)
+        if (row.PositionTypeId === '1') {
+          this.dialogVisible = true
         } else {
-          this.formData.Id = v.Id;
-          this.formData.ParentId = v.ParentId;
-          this.getParentNode(this.formData.ParentId);
-          this.initEntity();
+          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.dialogVisible = true;
+        this.positionDialogVisible = true
       },
+
       getParentNode(parentId) {
         api.getEntity(parentId, this.$axios).then(res => {
           this.tmpShowSelectNodeName = res.data.PositionName;
@@ -481,7 +632,29 @@
         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)
+          })
+      },
+
     }
   }
 

+ 81 - 107
src/dashoo.cn/frontend_web/src/pages/lims/secondunitform/index.vue

@@ -9,27 +9,20 @@
 
 <template>
   <div>
-    <el-breadcrumb class="heading">
-      <el-breadcrumb-item :to="{ path: '/' }">平台首页</el-breadcrumb-item>
-      <el-breadcrumb-item :to="{ path: '/lims/principal' }">委托方信息</el-breadcrumb-item>
-      <el-breadcrumb-item>{{pagetitle}}</el-breadcrumb-item>
-    </el-breadcrumb>
     <el-card class="box-card">
       <div slot="header">
         <span>
-          <i class="icon icon-table2"></i> {{pagetitle}}
+          <i class="icon icon-table2"></i> 单位信息
         </span>
         <span style="float: right;">
-          <el-button v-if="service_flag == 'addservice'" type="primary" @click="addCustomer('customerForm')" class="el-button--small">保存</el-button>
-          <el-button v-if="service_flag == 'editservice'" type="primary" @click="editCustomer('customerForm')" class="el-button--small">保存</el-button>
-          <el-button type="primary" class="el-button--small" onclick="window.history.go(-1)">返回</el-button>
+          <el-button type="primary" @click="saveCustomer" icon="el-icon-success" size="small" :loading="saveLoading">保存信息</el-button>
         </span>
       </div>
       <el-form :model="customerForm" :rules="rulestestlistform" label-width="110px" ref="customerForm">
         <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%" :default-first-option="true" placeholder="请选择委托方类型">
                 <el-option label="大港油田" value="大港油田"></el-option>
                 <el-option label="外部委托方" value="外部委托方"></el-option>
               </el-select>
@@ -68,84 +61,45 @@
         </el-row>
       </el-form>
 
-      <el-row :gutter="10" style="margin-top: 10px; width: 100%; overflow: hidden">
-        <el-col :span="12">
-          <el-card class="box-card">
-            <div slot="header">
-              <legend style="color:#436EEE"></legend>
-              <i class="icon icon-database"> 检测地点</i>
-              <span style="float: right;">
-                <el-button size="mini" plain type="primary">添加</el-button>
-              </span>
-            </div>
-            <el-table
-              :data="tableData"
-              stripe
-              style="width: 100%">
+      <el-tabs v-model="activeName">
+        <el-tab-pane label="检测地点及安装位置" name="1">
+          <customer-position :CustomerId="this.customerForm.Id" DivStyle="height: 700px" v-if="this.customerForm.Id"></customer-position>
+        </el-tab-pane>
 
-              <el-table-column
-                prop="name"
-                label="设备分类"
-              >
-              </el-table-column>
-
-              <el-table-column
-                prop="address"
-                label="检测地点"
-              >
-              </el-table-column>
-
-            </el-table>
-          </el-card>
-        </el-col>
-
-        <el-col :span="12">
-          <el-card class="box-card">
-            <div slot="header">
-              <legend style="color:#436EEE"></legend>
-              <i class="icon icon-database"> 安装位置及设备列表</i>
-              <span style="float: right;">
-                <el-button size="mini" plain type="primary">添加</el-button>
-              </span>
-            </div>
-
-            <el-table
-              :data="tableData2"
-              stripe
-              style="width: 100%">
-              <el-table-column
-                prop="seqNo"
-                label="序号"
-              >
-              </el-table-column>
-              <el-table-column
-                prop="name"
-                label="设备分类"
-              >
-              </el-table-column>
-              <el-table-column
-                prop="address"
-                label="地点名称"
-                width="180">
-              </el-table-column>
-              <el-table-column
-                prop="address2"
-                label="设备厂家">
-              </el-table-column>
-              <el-table-column
-                prop="address3"
-                label="设备型号">
-              </el-table-column>
-            </el-table>
-
-          </el-card>
-        </el-col>
-
-      </el-row>
+        <el-tab-pane label="设备列表" name="2">
+          <el-table
+            :data="tableData2"
+            stripe
+            style="width: 100%">
+            <el-table-column
+              prop="seqNo"
+              label="序号"
+            >
+            </el-table-column>
+            <el-table-column
+              prop="name"
+              label="设备分类"
+            >
+            </el-table-column>
+            <el-table-column
+              prop="address"
+              label="地点名称"
+              width="180">
+            </el-table-column>
+            <el-table-column
+              prop="address2"
+              label="设备厂家">
+            </el-table-column>
+            <el-table-column
+              prop="address3"
+              label="设备型号">
+            </el-table-column>
+          </el-table>
+        </el-tab-pane>
+      </el-tabs>
 
     </el-card>
 
-
   </div>
 </template>
 
@@ -153,12 +107,19 @@
   import {
     mapGetters
   } from 'vuex'
+
   import api from '@/api/lims/customerposition'
+  import CustomerPosition from '../principal/subdata/customerposition'
 
   export default {
     name: 'labsetingadd',
+    components: {
+      CustomerPosition,
+    },
     data() {
       return {
+        activeName: '1',
+        saveLoading: false,
         customerId: 0,
         pagetitle: '', //界面标题
         customerForm: {
@@ -170,6 +131,8 @@
           Telephone: '',
           Mailbox: '',
           Address: '',
+          DepartmentId: '',
+          DepartmentName: ''
         },
         rulestestlistform: {
           CustomerName: [{
@@ -269,32 +232,38 @@
       }
     },
     created() {
-      this.operaid = 195 // initial data
-      this.ServiceId = 195
-      if (this.ServiceId == 'principaladd') {
-        this.pagetitle = '委托方信息'
-        this.service_flag = 'addservice'
-      } else if (this.ServiceId != '0') {
-        this.pagetitle = '委托方信息'
-        this.service_flag = 'editservice'
-        this.customerId = parseInt(this.ServiceId)
-        this.getCustomerInfo()
-      }
+      this.getCustomerInfo()
+    },
+    computed: {
+      ...mapGetters({
+        authUser: 'authUser'
+      })
     },
     methods: {
+      saveCustomer () {
+        if (this.customerForm.Id && this.customerForm.Id > 0) {
+          this.editCustomer('customerForm')
+        } else {
+          this.customerForm.DepartmentId = this.authUser.Profile.DepartmentId
+          this.addCustomer('customerForm')
+        }
+      },
+
       addCustomer(formName) {
         let _this = this
         this.$refs[formName].validate((valid) => {
           if (valid) {
+            this.saveLoading = true
             _this.$axios.post('customer/customerlistadd', _this.customerForm)
               .then(res => {
+                this.saveLoading = false
+                this.getCustomerInfo()
                 // response
                 if (res.data.code === 0) {
                   _this.$message({
                     type: 'success',
                     message: res.data.message
                   })
-                  window.history.go(-1)
                 } else {
                   _this.$message({
                     type: 'warning',
@@ -311,29 +280,22 @@
           }
         })
       },
-      getCustomerInfo() {
-        let _this = this // request
-        this.$axios.get('customer/getcustomerlist/' + _this.ServiceId, {})
-          .then(res => {
-            _this.customerForm = res.data.items
-          }).catch(err => {
-          // handle error
-          console.error(err)
-        })
-      },
+
       editCustomer(formName) {
         let _this = this
         this.$refs[formName].validate((valid) => {
           if (valid) {
+            this.saveLoading = true
             _this.$axios.put('/customer/customerlistedit/' + _this.customerForm.Id, _this.customerForm)
               .then(res => {
+                this.saveLoading = false
+                this.getCustomerInfo()
                 // response
                 if (res.data.code === 0) {
                   _this.$message({
                     type: 'success',
                     message: res.data.message
                   })
-                  window.history.go(-1)
                 } else {
                   _this.$message({
                     type: 'warning',
@@ -350,6 +312,18 @@
           }
         })
       },
+
+      getCustomerInfo() {
+        let _this = this // request
+        this.$axios.get('customer/getcustomerbydepartid', {})
+          .then(res => {
+            _this.customerForm = res.data.items
+          }).catch(err => {
+          // handle error
+          console.error(err)
+        })
+      },
+
     }
   }
 

+ 55 - 0
src/dashoo.cn/frontend_web/src/pages/lims/secondunitform/positionmgr.vue

@@ -0,0 +1,55 @@
+<template>
+  <div style="width: 100%; overflow-y: auto">
+    <customer-position :CustomerId="this.customerForm.Id" DivStyle="height: (100vh - 100px);"></customer-position>
+  </div>
+</template>
+
+<script>
+  import {
+    mapGetters
+  } from 'vuex'
+
+  import CustomerPosition from '../principal/subdata/customerposition'
+
+  export default {
+    name: 'positionmgr',
+    components: {
+      CustomerPosition,
+    },
+    computed: {
+      ...mapGetters({
+        authUser: 'authUser'
+      })
+    },
+    created () {
+      this.getCustomerInfo()
+    },
+    data () {
+      return {
+        customerForm: {
+          Id: '',
+          ViceBusiness: '',
+          CustomerName: '',
+          CustomerCode: '',
+          Person: '',
+          Telephone: '',
+          Mailbox: '',
+          Address: '',
+          DepartmentId: '',
+          DepartmentName: ''
+        },
+      }
+    },
+    methods: {
+      getCustomerInfo () {
+        let _this = this
+        this.$axios.get('customer/getcustomerbydepartid', {})
+          .then(res => {
+            _this.customerForm = res.data.items
+          }).catch(err => {
+            console.error(err)
+        })
+      },
+    }
+  }
+</script>

+ 28 - 4
src/dashoo.cn/frontend_web/src/pages/login.vue

@@ -1,8 +1,8 @@
 <template>
 
   <div style="height: calc(100vh); width: 100%; background-color:#FFFFFF" >
-    <img src="../assets/img/title_dagang2.png" style="height:50px; margin-top: 20px;margin-left: 100px;"  >
-    <div class="back-width">
+    <img src="../assets/img/title_dagang3.png" style="height:50px; margin-top: 30px;margin-left: 100px;"  >
+    <div class="back-width" style="margin-top: 20px">
       <div class="login-body">
         <section class="login">
           <!--<header class="login-header">
@@ -31,7 +31,7 @@
     </div>
     <div >
       <footer class="login-footer" style="color:#A9A9A9">
-        ©大港油田信息中心 版权所有
+        ©信息中心 版权所有
       </footer>
     </div>
   </div>
@@ -68,13 +68,37 @@
         error: null,
         loading: false
       }
-    }
+    },
+
+	methods: {
+		isChrome() {
+		  //取得浏览器的userAgent字符串
+		  let userAgent = navigator.userAgent;
+
+		  //判断是否Chrome浏览器
+		  if (userAgent.indexOf("Chrome") > -1) {
+			return true;
+		  } else {
+			return false;
+		  }
+		}
+	}
+
   })
   export default class Login extends Vue {
     layout() {
       return 'empty'
     }
     login() {
+	  if (!this.isChrome()) {
+		  this.$alert(
+			"请用谷歌浏览器、360浏览器(极速模式)等,Chrome内核浏览器打开本系统",
+			"不支持的浏览器",
+			{}
+		  );
+		  return false;
+	 }
+
       this.logging = true
       this.$refs.user.validate(async (valid) => {
         try {