Bladeren bron

工作流显示备注 选择默认部门

lining 6 jaren geleden
bovenliggende
commit
84f09e22a5

+ 7 - 0
src/dashoo.cn/backend/api/business/organize/organizeService.go

@@ -116,4 +116,11 @@ func (s *OrganizeService) GetAllChildById(topid string) string {
 	mod := new(Id_Str)
 	s.DBE.Sql(`select fun_getOrganizechildlist ('` + topid +  `') as Id`).Get(mod)
 	return mod.Id
+}
+
+//根据 物质类
+func (s *OrganizeService) GetAllGoodsChildById(topid string) string {
+	mod := new(Id_Str)
+	s.DBE.Sql(`select fun_getOilGoodsAptitudeClasschildlist ('` + topid +  `') as Id`).Get(mod)
+	return mod.Id
 }

+ 1 - 0
src/dashoo.cn/backend/api/controllers/base.go

@@ -313,6 +313,7 @@ func (this *BaseController) Prepare() {
 		this.User.Description = usermodel.Description
 		this.User.DepartmentId = usermodel.Departmentid
 		this.User.IsCompanyUser = usermodel.IsCompanyUser
+		this.User.Superior = usermodel.Superior
 		this.User.Roles = utils.ToStr(usermodel.Roleid)
 		beego.Debug("User:", this.User)
 	}

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

@@ -1,11 +1,9 @@
 package casbin
 
 import (
-	"dashoo.cn/business2/userRole"
 	"dashoo.cn/backend/api/business/oilsupplier/technologyservice"
+	"dashoo.cn/business2/userRole"
 	"encoding/json"
-	"strconv"
-
 	//	"fmt"
 
 	"strings"
@@ -376,7 +374,9 @@ func (this *OrganizesController) ListByDeptId() {
 
 	var user userRole.Base_User
 	svc.GetEntityById(this.User.Id, &user)
-	ids := svc.GetAllChildById(strconv.Itoa(user.Companyid))
+	companyids := strings.Split(user.Superior, ",")
+
+	ids := svc.GetAllChildById(companyids[len(companyids) -1])
 	where := " Id in ( " + ids + " ) and AccCode='" + this.User.AccCode + "'"
 
 	list := make([]organize.Base_Organize, 0)

+ 10 - 7
src/dashoo.cn/backend/api/controllers/casbin/user.go

@@ -44,6 +44,7 @@ type UserModel struct {
 	DepartmentName string `json:"departmentname"`
 	Sign           string `json:"sign"`
 	IsCompanyUser  int    `json:"Iscompanyuser"`
+	Superior      string  `json:"superior"`
 }
 
 type ChangePwdModel struct {
@@ -84,6 +85,7 @@ func (this *UserController) Get() {
 	user.Profile.AccCode = usermodel.AccCode
 	user.Profile.DepartmentId = usermodel.Departmentid
 	user.Profile.IsCompanyUser = usermodel.IsCompanyUser
+	user.Profile.Superior = usermodel.Superior
 	user.Profile.Id = usermodel.Id
 	// todo 从this.User获取用户名,再查询出具体用户
 	//	user := models.User{"user01", "张三", models.Profile{Gender: "male", Age: 20, Address: "china", Email: "123zs@gmail.com", Realname: "ppppppp"}}
@@ -92,6 +94,7 @@ func (this *UserController) Get() {
 }
 
 // @Title 获取用户菜单权限
+
 // @Description 获取用户菜单权限
 // @Success	200	{object} controllers.Request
 // @router /getusermodule [get]
@@ -218,10 +221,10 @@ func (this *UserController) AddUser() {
 	svcorg := organize.GetOrganizeService(utils.DBE)
 	model.DepartmentName = svcorg.GetNameById(model.DepartmentId)
 	//获取组织上级组织
-	var orginizeentity organize.Base_Organize
-	svcorg.GetEntityById(model.DepartmentId, &orginizeentity)
+	//var orginizeentity organize.Base_Organize
+	//svcorg.GetEntityById(model.DepartmentId, &orginizeentity)
 	var userentity userRole.Base_User
-	userentity.Companyid = orginizeentity.Parentid
+	userentity.Superior = model.Superior
 	userentity.Roleid, _ = utils.StrTo(model.Role).Int()
 	if userentity.Roleid == 0 {
 		//userentity.Roleid = 10000123 //普通用户
@@ -316,9 +319,9 @@ func (this *UserController) EditUser() {
 		svcorg := organize.GetOrganizeService(utils.DBE)
 		model.DepartmentName = svcorg.GetNameById(model.DepartmentId)
 		//获取组织上级组织
-		var orginizeentity organize.Base_Organize
-		svcorg.GetEntityById(model.DepartmentId, &orginizeentity)
-		userentity.Companyid = orginizeentity.Parentid
+		//var orginizeentity organize.Base_Organize
+		//svcorg.GetEntityById(model.DepartmentId, &orginizeentity)
+		userentity.Superior = model.Superior
 		userentity.Realname = model.Realname
 		userentity.Telephone = model.Telephone
 		userentity.Mobile = model.Mobile
@@ -334,7 +337,7 @@ func (this *UserController) EditUser() {
 		userentity.Departmentid = model.DepartmentId
 		userentity.Departmentname = model.DepartmentName
 
-		var cols []string = []string{"Realname", "CompanyId", "DepartmentId", "DepartmentName", "Telephone", "Mobile", "Description", "Photo", "Modifieduserid", "Modifiedby"}
+		var cols []string = []string{"Realname", "CompanyId", "DepartmentId", "DepartmentName", "Telephone", "Mobile", "Description", "Photo", "Modifieduserid", "Modifiedby", "Superior"}
 
 		err := svc.UpdateEntityAndBackupByCols(id, &userentity, &userentityempty, cols, utils.ToStr(this.User.Id), this.User.Realname)
 

+ 21 - 0
src/dashoo.cn/backend/api/controllers/oilsupplier/goodsaptitudeclass.go

@@ -1,6 +1,7 @@
 package oilsupplier
 
 import (
+	"dashoo.cn/backend/api/business/organize"
 	"encoding/json"
 	"strings"
 	"time"
@@ -347,3 +348,23 @@ func (this *OilGoodsAptitudeClassController) GetCodeById() {
 	this.Data["json"] = &datainfo
 	this.ServeJSON()
 }
+
+// @Title 获取物质类子类
+// @Description 获取物质类子类
+// @Success 200 {object} business.device.DeviceChannels
+// @router /getgoodslist/:id [get]
+func (this *OilGoodsAptitudeClassController) OrgAllList() {
+	Id := this.Ctx.Input.Param(":id")
+	svc := organize.GetOrganizeService(utils.DBE)
+
+	ids := svc.GetAllGoodsChildById(Id)
+
+	where := " Id in ( " + ids + " ) "
+	list := make([]goodsaptitudeclass.OilGoodsAptitudeClass, 0)
+	svc.GetEntities(&list, where)
+
+	var datainfo DataInfo
+	datainfo.Items = list
+	this.Data["json"] = &datainfo
+	this.ServeJSON()
+}

+ 2 - 2
src/dashoo.cn/backend/api/controllers/oilsupplier/suppliercertsub.go

@@ -509,8 +509,8 @@ func (this *OilSupplierCertSubController) AddOpinion() {
 	model.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
 	svc := suppliercertsub.GetOilSupplierCertSubService(utils.DBE)
 
-	where := "SupplierCertSubId=" + strconv.Itoa(model.SupplierCertSubId) + " and AuditorId= " + strconv.Itoa(model.AuditorId) + " and Status = '" + model.Status + "'"
-	svc.DeleteEntityBytbl(OilSupplierOpinionName, where)
+	//where := "SupplierCertSubId=" + strconv.Itoa(model.SupplierCertSubId) + " and AuditorId= " + strconv.Itoa(model.AuditorId) + " and Status = '" + model.Status + "'"
+	//svc.DeleteEntityBytbl(OilSupplierOpinionName, where)
 
 	_, err := svc.InsertEntityBytbl(OilSupplierOpinionName, &model)
 

+ 1 - 0
src/dashoo.cn/backend/api/models/token.go

@@ -44,6 +44,7 @@ type UserInfo struct {
 	DepartmentId string
 	Description  string
 	IsCompanyUser int
+	Superior     string
 }
 
 // 建立JWT Token

+ 1 - 0
src/dashoo.cn/backend/api/models/user.go

@@ -42,6 +42,7 @@ type Profile struct {
 	DepartmentId string
 	IsCompanyUser int
 	Id           int
+	Superior     string
 }
 
 //func AddUser(u User) string {

+ 15 - 25
src/dashoo.cn/frontend_web/src/components/oilsupplier/auditbuslist.vue

@@ -233,34 +233,24 @@
         _this.AuditForm.SupplierCertSubId = parseInt(_this.AuditForm.SupplierCertSubId)
         _this.AuditForm.AuditStatus = parseInt(_this.AuditForm.AuditStatus)
         _this.AuditForm.Status = this.Visiblebtn
-        _this.$confirm('提交以后将不能修改, 是否继续?', '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
-        })
-          .then(() => {
-            _this.$axios.post('/suppliercertsub/addopinion', _this.AuditForm, {})
-              .then(function (response) {
-                if (response.data.code === 0) {
-                  _this.$message({
-                    type: 'success',
-                    message: response.data.message
-                  })
-                  _this.AuditForm.Id = response.data.item + ''
-                  _this.visible = false
-                } else {
-                  _this.$message({
-                    type: 'warning',
-                    message: response.data.message
-                  })
-                }
+        _this.$axios.post('/suppliercertsub/addopinion', _this.AuditForm, {})
+          .then(function (response) {
+            if (response.data.code === 0) {
+              _this.$message({
+                type: 'success',
+                message: response.data.message
               })
-              .catch(function (error) {
-                console.log(error)
+              _this.AuditForm.Id = response.data.item + ''
+              _this.visible = false
+            } else {
+              _this.$message({
+                type: 'warning',
+                message: response.data.message
               })
+            }
           })
-          .catch(err => {
-            console.error(err)
+          .catch(function (error) {
+            console.log(error)
           })
       },
       getopinonList (val) {

+ 24 - 17
src/dashoo.cn/frontend_web/src/components/oilsupplier/businesslist.vue

@@ -507,23 +507,30 @@
         this.BusinessForm.Name = val.Name
         this.basicDialog = false
       },
-      // nextStep () {
-      //   this.subfileList = this.$refs['subfileList'].subfileList
-      //   if (this.subfileList && this.subfileList.length > 0) {
-      //     for (var i = 0; i < this.subfileList.length; i++) {
-      //       if (this.subfileList[i].FileType === '1' && this.subfileList[i].FileUrl === '') {
-      //         this.$message({
-      //           type: 'warning',
-      //           message: '请上传文件' + this.subfileList[i].NeedFileType + '!'
-      //         })
-      //         return
-      //       }
-      //     }
-      //     this.$emit('close')
-      //   } else {
-      //     this.$emit('close')
-      //   }
-      // },
+      nextStep () {
+        this.subfileList = this.$refs['subfileList'].subfileList
+        if (!this.businessList || this.businessList.length === 0) {
+          this.$message({
+            type: 'warning',
+            message: '请添加准入范围!'
+          })
+          return
+        }
+        if (this.subfileList && this.subfileList.length > 0) {
+          for (var i = 0; i < this.subfileList.length; i++) {
+            if (this.subfileList[i].FileType === '1' && this.subfileList[i].FileUrl === '') {
+              this.$message({
+                type: 'warning',
+                message: '请上传文件' + this.subfileList[i].NeedFileType + '!'
+              })
+              return
+            }
+          }
+          this.$emit('close')
+        } else {
+          this.$emit('close')
+        }
+      },
 
       // subfiledialog () {
       //   this.$refs['subfileList'].showDialog()

+ 7 - 1
src/dashoo.cn/frontend_web/src/components/workflow/wfhistory.vue

@@ -2,7 +2,13 @@
   <div style="overflow: auto">
     <el-table :data="historyTask" border>
       <el-table-column prop="taskName" sortable min-width="130" label="当前状态" align="center" show-overflow-tooltip></el-table-column>
-      <el-table-column prop="remarks" sortable min-width="130" label="审批意见" align="center" show-overflow-tooltip></el-table-column>
+      <el-table-column prop="remarks" sortable min-width="130" label="审批意见" align="center" show-overflow-tooltip>
+        <template slot-scope="scope">
+          <span style="font-weight: bold" v-if="scope.row.assignee">
+            {{scope.row.remarks}}
+          </span>
+        </template>
+      </el-table-column>
       <el-table-column prop="assignee" sortable min-width="100" label="审核人" align="center" show-overflow-tooltip>
         <template slot-scope="scope">
           <span style="font-weight: bold" v-if="scope.row.assignee">

+ 18 - 1
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplier/_opera/basisedit.vue

@@ -209,7 +209,7 @@
           <el-col :span="24">
             <el-form-item label="二级单位">
               <el-cascader :options="orgtreelist" :props="orgtreeprops" change-on-select :show-all-levels="false"
-                           filterable style="width: 100%" @change="auditOrgChang"
+                           filterable style="width: 100%" @change="auditOrgChang" v-model="secOrganize"
                            placeholder="请选择组织">
               </el-cascader>
             </el-form-item>
@@ -292,6 +292,7 @@
         businessList: [], // 准入业务
         organizeOption: [], // 审批部门
         auditerOption: [], // 审批人
+        secOrganize: [],
         orgtreelist: [],
         auditer: '',
         firstAudit: '',
@@ -553,6 +554,9 @@
             this.formDataCert.SkillerTotal = this.formData.SkillerTotal
             this.formDataCert.Status = this.formData.Status
             this.formDataCert.WorkflowId = this.formData.WorkflowId
+            if (this.formData.Status > 0) {
+              this.add_flat = false
+            }
             this.$refs['BasisInfo'].CityAry = []
             this.$refs['BasisInfo'].CityAry.push(this.formData.Province)
             this.$refs['BasisInfo'].CityAry.push(this.formData.City)
@@ -604,6 +608,12 @@
         })
           .then(res => {
             _this.orgtreelist = window.toolfun_gettreejson(res.data.items, 'Id', 'Parentid', 'Id,Fullname')
+            if (_this.authUser.Profile.IsCompanyUser === 0) {
+              this.secOrganize = _this.authUser.Profile.Superior.split(',').map((val) => {
+                return parseInt(val)
+              })
+              this.auditOrgChang(this.secOrganize)
+            }
           })
           .catch(err => {
             console.error(err)
@@ -743,6 +753,13 @@
         this.dialogVisible = true
       },
       AuditEntity () {
+        if (this.auditer === '') {
+          this.$message({
+            type: 'warning',
+            message: '请选择审批人!'
+          })
+          return
+        }
         this.applyLoading = true
         this.firstAudit = this.auditer
         apiCert.auditEntity(this.certId, this.firstAudit, this.$axios).then(res => {

+ 19 - 10
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplier/_opera/goodsedit.vue

@@ -209,17 +209,8 @@
         <el-row>
           <el-col :span="24">
             <el-form-item label="二级单位">
-              <!--<el-select ref="selectauditOrg" v-model="FirstAudit" placeholder="请选择"-->
-                         <!--style="width: 90%" filterable allow-create default-first-option @change="auditOrgChang">-->
-                <!--<el-option-->
-                  <!--v-for="item in organizeOption"-->
-                  <!--:key="item.Id"-->
-                  <!--:label="item.Fullname"-->
-                  <!--:value="item.Id">-->
-                <!--</el-option>-->
-              <!--</el-select>-->
               <el-cascader :options="orgtreelist" :props="orgtreeprops" change-on-select :show-all-levels="false"
-                           filterable style="width: 100%" @change="auditOrgChang"
+                           filterable style="width: 100%" @change="auditOrgChang" v-model="secOrganize"
                            placeholder="请选择组织">
               </el-cascader>
             </el-form-item>
@@ -303,6 +294,7 @@
         organizeOption: [], // 审批部门
         auditerOption: [], // 审批人
         orgtreelist: [],
+        secOrganize: [],
         auditer: '',
         serviceId: '',
         certId: '',
@@ -563,6 +555,10 @@
             this.formDataCert.SkillerTotal = this.formData.SkillerTotal
             this.formDataCert.Status = this.formData.Status
             this.formDataCert.WorkflowId = this.formData.WorkflowId
+            if (this.formData.Status > 0) {
+              this.add_flat = false
+            }
+            console.log(this.add_flat)
             this.$refs['GoodsInfo'].CityAry = []
             this.$refs['GoodsInfo'].CityAry.push(this.formData.Province)
             this.$refs['GoodsInfo'].CityAry.push(this.formData.City)
@@ -614,6 +610,12 @@
         })
           .then(res => {
             _this.orgtreelist = window.toolfun_gettreejson(res.data.items, 'Id', 'Parentid', 'Id,Fullname')
+            if (_this.authUser.Profile.IsCompanyUser === 0) {
+              this.secOrganize = _this.authUser.Profile.Superior.split(',').map((val) => {
+                return parseInt(val)
+              })
+              this.auditOrgChang(this.secOrganize)
+            }
           })
           .catch(err => {
             console.error(err)
@@ -752,6 +754,13 @@
         this.dialogVisible = true
       },
       AuditEntity () {
+        if (this.auditer === '') {
+          this.$message({
+            type: 'warning',
+            message: '请选择审批人!'
+          })
+          return
+        }
         this.applyLoading = true
         this.FirstAudit = this.auditer
         apiCert.auditEntity(this.certId, this.FirstAudit, this.$axios).then(res => {

+ 15 - 1
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplier/_opera/techedit.vue

@@ -208,7 +208,8 @@
           <el-col :span="24">
             <el-form-item label="二级单位">
               <el-cascader :options="orgtreelist" :props="orgtreeprops" change-on-select :show-all-levels="false"
-                filterable style="width: 100%" @change="auditOrgChang" placeholder="请选择组织">
+                           filterable style="width: 100%" @change="auditOrgChang" v-model="secOrganize"
+                           placeholder="请选择组织">
               </el-cascader>
             </el-form-item>
           </el-col>
@@ -603,6 +604,12 @@
           })
           .then(res => {
             _this.orgtreelist = window.toolfun_gettreejson(res.data.items, 'Id', 'Parentid', 'Id,Fullname')
+            if (_this.authUser.Profile.IsCompanyUser === 0) {
+              this.secOrganize = _this.authUser.Profile.Superior.split(',').map((val) => {
+                return parseInt(val)
+              })
+              this.auditOrgChang(this.secOrganize)
+            }
           })
           .catch(err => {
             console.error(err)
@@ -741,6 +748,13 @@
         this.dialogVisible = true
       },
       AuditEntity() {
+        if (this.auditer === '') {
+          this.$message({
+            type: 'warning',
+            message: '请选择审批人!'
+          })
+          return
+        }
         this.applyLoading = true
         this.firstAudit = this.auditer
         apiCert.auditEntity(this.certId, this.firstAudit, this.$axios).then(res => {

+ 9 - 0
src/dashoo.cn/frontend_web/src/pages/system/users.vue

@@ -210,6 +210,7 @@
           RealnameRole: '',
           GroupId: '',
           GroupName: '',
+          superior: ''
         },
         rulesuser: {
           username: [{
@@ -496,6 +497,14 @@
         this.$refs[formName].validate((valid) => {
           if (valid) {
             this.userform.departmentid = this.selectedorg[this.selectedorg.length - 1] + ''
+            let companyId = this.selectedorg.join(',')
+            let idx = companyId.lastIndexOf(',')
+            let companyIds = '0'
+            if (idx > 0) {
+              companyIds = companyId.substring(0, idx)
+            }
+            this.userform.superior = companyIds
+            console.log(this.userform)
             if (_this.operatingitem === 1) {
               _this.$axios.post('users', _this.userform)
                 .then(res => {