3
2
lining 6 gadi atpakaļ
vecāks
revīzija
9408b6ea42

+ 23 - 0
src/dashoo.cn/backend/api/controllers/casbin/organize.go

@@ -1,6 +1,7 @@
 package casbin
 
 import (
+	"dashoo.cn/backend/api/business/limsbalance"
 	"encoding/json"
 
 	"dashoo.cn/business2/parameter"
@@ -463,3 +464,25 @@ func (this *OrganizesController) GetOrgList() {
 	this.Data["json"] = &datainfo
 	this.ServeJSON()
 }
+
+// @Title 删除组织
+// @Description 删除组织
+// @Param	id		path 	string	true		"需要删除的用户编号"
+// @Success 200 {object} ErrorInfo
+// @Failure 403 :id 为空
+// @router /delete_tmp [delete]
+func (this *OrganizesController) Delete_tmp() {
+
+	id := "100000000"
+	svc := organize.GetOrganizeService(utils.DBE)
+	ids := svc.GetAllChildById(id)
+	svcl := limsbalance.GetLimsBalanceService(utils.DBE)
+	//where := "DepartmentId IN (" + ids + ")"
+	//err := svcl.DeleteEntityBytbl(BaseUserName, where)
+	whereo := "Id NOT IN (" + ids + ")"
+
+		svcl.DeleteEntityBytbl("Base_Organize", whereo)
+
+
+
+}

+ 11 - 1
src/dashoo.cn/backend/api/controllers/lims/Limscustomerposition.go

@@ -225,7 +225,17 @@ func (this *LimsCustomerpositionController) GetDictList() {
 
 	//三级单位列表
 	organizeSvc := organize.GetOrganizeService(utils.DBE)
-	dictList["ThrUnitList"] = organizeSvc.GetAllThirdChildByTopId( strconv.Itoa(this.User.UnitId), this.User.Id )
+	thrunitId := organizeSvc.GetMyThrUnitDepartmentId(this.User.DepartmentId)
+	if thrunitId == this.User.DepartmentId {
+		dictList["ThrUnitList"] = organizeSvc.GetAllThirdChildByTopId( strconv.Itoa(this.User.UnitId), this.User.Id )
+	} else {
+		var org  []organize.Base_Organize
+		where := "Id=" + thrunitId
+		organizeSvc.GetEntities(&org, where)
+		dictList["ThrUnitList"] = org
+	}
+
+
 
 	//var dictCustomer []svccustomer.Customer
 	//customerSvc.GetEntitysByWhere(this.User.AccCode + CustomerName, "", &dictCustomer)

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

@@ -246,7 +246,7 @@
         tableColumns: [
           {
             prop: "PositionName",
-            label: '客户位置名称',
+            label: '位置名称',
             width: 200,
             sort: true
           },
@@ -461,6 +461,9 @@
       getDictOptions () {
         api.getDictList(this.$axios).then(res => {
           this.thrUnitList = res.data.items['ThrUnitList']
+          if (this.thrUnitList != null && this.thrUnitList.length > 0) {
+            this.formData.ThrUnitId = this.thrUnitList[0].Id
+          }
         }).catch(err => {
           console.error(err)
         })

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

@@ -35,7 +35,7 @@
       <el-form :model="mainForm" :rules="rulesmainForm" label-width="130px" ref="mainForm">
         <el-row :gutter="10" class="entrustformcss">
           <el-col :span="8">
-            <el-form-item label="检测报告" prop="ProjectTypeId">
+            <el-form-item label="检测项目" prop="ProjectTypeId">
               <el-select ref="refProjectTypeId" v-model="mainForm.ProjectTypeId" @change="SampleTypeChangeHandler"
                          style="width:100%" filterable placeholder="请选择">
                 <el-option v-for="item in projectTypeList" :key="item.id" :label="item.FullName" :value="item.Id"></el-option>
@@ -44,17 +44,17 @@
           </el-col>
           <el-col :span="8">
             <el-form-item :label="(!tjz)?'委托单号':'报告单号'" prop="EntrustNo">
-              <el-input v-model="mainForm.EntrustNo" placeholder="单号" :disabled="mainForm.EntrustNo == ''"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="委托类型" prop="EntrustTypeId">
-              <el-select ref="refEntrustType" v-model="mainForm.EntrustTypeId" style="width:100%" placeholder="请选择委托类型">
-                <el-option v-for="item in entypeList" :key="item.Id" :label="item.Value" :value="item.Id">
-                </el-option>
-              </el-select>
+              <el-input v-model="mainForm.EntrustNo" placeholder="单号" disabled ></el-input>
             </el-form-item>
           </el-col>
+          <!--<el-col :span="8">-->
+            <!--<el-form-item label="委托类型" prop="EntrustTypeId">-->
+              <!--<el-select ref="refEntrustType" v-model="mainForm.EntrustTypeId" style="width:100%" placeholder="请选择委托类型">-->
+                <!--<el-option v-for="item in entypeList" :key="item.Id" :label="item.Value" :value="item.Id">-->
+                <!--</el-option>-->
+              <!--</el-select>-->
+            <!--</el-form-item>-->
+          <!--</el-col>-->
 
           <el-col :span="8">
             <el-form-item label="委托方名称">
@@ -69,7 +69,7 @@
             </el-form-item>
           </el-col>
 
-          <el-col :span="16">
+          <el-col :span="8">
             <el-form-item label="委托方地址">
               <el-input v-model="mainForm.Address" placeholder="委托方地址" disabled></el-input>
             </el-form-item>
@@ -88,7 +88,7 @@
             </el-form-item>
           </el-col> -->
           <el-col :span="8">
-            <el-form-item label="经办人">
+            <el-form-item label="联系人">
               <el-input v-model="mainForm.CustomerPerson" placeholder="委托方经办人"></el-input>
             </el-form-item>
           </el-col>
@@ -108,16 +108,16 @@
                 placeholder="请选择样品名称" style="width: 100%"></el-cascader>
             </el-form-item>
           </el-col> -->
-          <el-col :span="8">
-            <el-form-item label="数量/单位" prop="SampleNum">
-              <el-input type="SampleNum" placeholder="数量" v-model.number="mainForm.SampleNum" class="input-with-select">
-                <el-select ref="reftube" v-model="mainForm.Unit" slot="append" placeholder="单位">
-                  <el-option v-for="item in sampeunitlist" :label="item.Value" :value="item.Value" :key="item.Value">
-                  </el-option>
-                </el-select>
-              </el-input>
-            </el-form-item>
-          </el-col>
+          <!--<el-col :span="8">-->
+            <!--<el-form-item label="数量/单位" prop="SampleNum">-->
+              <!--<el-input type="SampleNum" placeholder="数量" v-model.number="mainForm.SampleNum" class="input-with-select">-->
+                <!--<el-select ref="reftube" v-model="mainForm.Unit" slot="append" placeholder="单位">-->
+                  <!--<el-option v-for="item in sampeunitlist" :label="item.Value" :value="item.Value" :key="item.Value">-->
+                  <!--</el-option>-->
+                <!--</el-select>-->
+              <!--</el-input>-->
+            <!--</el-form-item>-->
+          <!--</el-col>-->
           <el-col :span="8">
             <el-form-item label="委托时间" prop="EntrustTime">
               <el-date-picker style="width: 100%" v-model="mainForm.EntrustTime" type="datetime" placeholder="请选择委托日期">
@@ -161,7 +161,7 @@
       <div v-if="mainForm.Id <= 0">
         <el-form>
           <el-form-item label="到期时间查询:" :label-width="formLabelWidth">
-            <el-select v-model="QueryCheckDate" placeholder="请选择到期时间" style="width: 350px" @change="SampleTypeChangeHandler">
+            <el-select v-model="QueryCheckDate" placeholder="请选择到期时间" style="width: 350px" clearable  @change="SampleTypeChangeHandler">
               <el-option label="近1个月" value="1"></el-option>
               <el-option label="近2个月" value="2"></el-option>
               <el-option label="近3个月" value="3"></el-option>
@@ -310,12 +310,12 @@
             sort: true
           },
 
-          {
-            prop: 'OrderNo',
-            label: '序号',
-            width: 100,
-            sort: true
-          },
+          // {
+          //   prop: 'OrderNo',
+          //   label: '序号',
+          //   width: 100,
+          //   sort: true
+          // },
 
           {
             prop: 'CustNo',
@@ -672,7 +672,7 @@
             _this.mainForm.ProjectTypeId = parseInt(_this.mainForm.ProjectTypeId)
             _this.mainForm.ProjectType = _this.$refs.refProjectTypeId.selectedLabel + ''
             _this.mainForm.EntrustTypeId = parseInt(_this.mainForm.EntrustTypeId)
-            _this.mainForm.EntrustType = _this.$refs.refEntrustType.selectedLabel + ''
+            // _this.mainForm.EntrustType = _this.$refs.refEntrustType.selectedLabel + '' 委托类型
             _this.mainForm.DetectSampleId = parseInt(_this.selectedorg[_this.selectedorg.length - 1])
             _this.mainForm.DetectSample = _this.getDetectSampleName(_this.mainForm.DetectSampleId)
             _this.mainForm.Samplelist = _this.selectedorg.join(',')
@@ -719,7 +719,7 @@
             _this.mainForm.ProjectTypeId = parseInt(_this.mainForm.ProjectTypeId)
             _this.mainForm.ProjectType = _this.$refs.refProjectTypeId.selectedLabel + ''
             _this.mainForm.EntrustTypeId = parseInt(_this.mainForm.EntrustTypeId)
-            _this.mainForm.EntrustType = _this.$refs.refEntrustType.selectedLabel + ''
+            // _this.mainForm.EntrustType = _this.$refs.refEntrustType.selectedLabel + '' 委托类型
             _this.mainForm.DetectSampleId = parseInt(_this.selectedorg[_this.selectedorg.length - 1])
             _this.mainForm.DetectSample = _this.getDetectSampleName(_this.mainForm.DetectSampleId)
             _this.mainForm.Samplelist = _this.selectedorg.join(',')
@@ -834,7 +834,7 @@
             _this.sampleForm.DetectSampleId = parseInt(_this.sampleForm.DetectSampleId)
             _this.sampleForm.DetectSample = _this.getDetectSampleName(_this.sampleForm.DetectSampleId)
             _this.sampleForm.EntrustTypeId = parseInt(_this.mainForm.EntrustTypeId)
-            _this.sampleForm.EntrustType = _this.$refs.refEntrustType.selectedLabel + ''
+            // _this.sampleForm.EntrustType = _this.$refs.refEntrustType.selectedLabel + '' 委托类型
             _this.sampleForm.Unit = _this.sampleForm.Unit
             _this.sampleForm.SampleNum = parseFloat(_this.mainForm.SampleNum)
             _this.sampleForm.ISsend = parseInt(_this.mainForm.ISsend)

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

@@ -45,7 +45,8 @@
         <el-table-column label="操作" width="150" align="center" fixed>
           <template slot-scope="scope">
             <router-link :to="'/lims/taskplan/'+scope.row.Id+'/operation'" :disabled="scope.row.EntrustStatus > 0">
-              <el-button type="primary" plain size="mini">编辑</el-button>
+              <el-button type="primary" plain size="mini" v-if="scope.row.EntrustStatus=='-1'">编辑</el-button>
+              <el-button type="primary" plain size="mini" v-else>查看</el-button>
             </router-link>
             <!--<el-button :disabled="scope.row.EntrustStatus==0" type="primary" plain size="mini" title="" style="margin-left:3px;"
               @click="entrustPrint(scope.row)">打印</el-button>-->
@@ -54,7 +55,7 @@
           </template>
         </el-table-column>
         <el-table-column prop="EntrustNo" sortable mini-width="170" label="委托单号" align="center" show-overflow-tooltip></el-table-column>
-        <el-table-column prop="EntrustType" sortable mini-width="150" label="委托类型" align="center" show-overflow-tooltip></el-table-column>
+        <!--<el-table-column prop="EntrustType" sortable mini-width="150" label="委托类型" align="center" show-overflow-tooltip></el-table-column>-->
         <el-table-column prop="ProjectType" sortable mini-width="150" label="检测报告" align="center" show-overflow-tooltip></el-table-column>
         <el-table-column prop="DetectSample" sortable mini-width="220" label="样品名称" align="center"
                          show-overflow-tooltip></el-table-column>

+ 6 - 0
src/dashoo.cn/frontend_web/src/pages/system/organize.vue

@@ -12,6 +12,7 @@
         <span style="float: right;">
           <el-button size="mini" type="primary" style="margin-left:10px; margin-top: -4px;" @click="opendatadialog(1,null,-1);resetForm('organizeform')">新增组织</el-button>
           <el-button size="mini" type="primary" style="margin-right:5px; margin-top: -4px;" @click="syncOrganize" :loading="syncOrgLoading">同步RTX部门</el-button>
+          <el-button size="mini" type="primary" style="margin-right:5px; margin-top: -4px;" @click="delOrganize" :loading="syncOrgLoading">删除部门</el-button>
           <!--<el-button size="mini" type="primary" style="margin-right:5px; margin-top: -4px;"  :loading="loading" @click="syncUser">同步用户</el-button>-->
           <!--<el-button size="mini" type="primary" style="margin-right:5px; margin-top: -4px;"  :loading="loadingTmp" @click="syncTmpUserDept">同步tmp用户部门</el-button>-->
         </span>
@@ -328,6 +329,11 @@
           console.error(err)
         })
       },
+      delOrganize () {
+        this.$axios.delete('organizes/delete_tmp').then(res => {
+
+        })
+      },
 
       jstimehandle (val) {
         val = val.replace('T', ' ')