浏览代码

对企业用户准入申请,直接跳过列表,看编辑页

yuedefeng 6 年之前
父节点
当前提交
5b27489beb

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

@@ -83,6 +83,7 @@ func (this *UserController) Get() {
 	user.Profile.Host = this.Ctx.Request.Host
 	user.Profile.Host = this.Ctx.Request.Host
 	user.Profile.AccCode = usermodel.AccCode
 	user.Profile.AccCode = usermodel.AccCode
 	user.Profile.DepartmentId = usermodel.Departmentid
 	user.Profile.DepartmentId = usermodel.Departmentid
+	user.Profile.IsCompanyUser = usermodel.IsCompanyUser
 	user.Profile.Id = usermodel.Id
 	user.Profile.Id = usermodel.Id
 	// todo 从this.User获取用户名,再查询出具体用户
 	// todo 从this.User获取用户名,再查询出具体用户
 	//	user := models.User{"user01", "张三", models.Profile{Gender: "male", Age: 20, Address: "china", Email: "123zs@gmail.com", Realname: "ppppppp"}}
 	//	user := models.User{"user01", "张三", models.Profile{Gender: "male", Age: 20, Address: "china", Email: "123zs@gmail.com", Realname: "ppppppp"}}

+ 18 - 0
src/dashoo.cn/backend/api/controllers/oilsupplier/suppliercert.go

@@ -288,6 +288,24 @@ func (this *OilSupplierCertController) GetEntity() {
 	this.ServeJSON()
 	this.ServeJSON()
 }
 }
 
 
+// @Title 获取实体
+// @Description 获取实体
+// @Success 200 {object} suppliercert.OilSupplierCert
+// @router /getbycreatorandtype/:typecode [get]
+func (this *OilSupplierCertController) GetEntityByCreatorId() {
+	creatorId := this.User.Id
+	typeCode := this.Ctx.Input.Param(":typecode")
+
+	var model suppliercert.OilSupplierCert
+	svc := suppliercert.GetOilSupplierCertService(utils.DBE)
+	where := " CreateUserId = '" + creatorId + "'"
+	where += " and SupplierTypeCode = '" + typeCode + "'"
+	svc.GetEntityByWhere(OilSupplierCertName, where, &model)
+
+	this.Data["json"] = &model
+	this.ServeJSON()
+}
+
 // @Title 添加
 // @Title 添加
 // @Description 新增
 // @Description 新增
 // @Success	200	{object} controllers.Request
 // @Success	200	{object} controllers.Request

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

@@ -40,6 +40,7 @@ type Profile struct {
 	Host         string //域名
 	Host         string //域名
 	AccCode      string //客户企业编号
 	AccCode      string //客户企业编号
 	DepartmentId string
 	DepartmentId string
+	IsCompanyUser int
 	Id           int
 	Id           int
 }
 }
 
 

+ 6 - 0
src/dashoo.cn/frontend_web/src/api/oilsupplier/suppliercert.js

@@ -12,6 +12,12 @@ export default {
       method: 'GET'
       method: 'GET'
     })
     })
   },
   },
+  getEntityByCreatorAndType (typeCode, myAxios) {
+    return myAxios({
+      url: '/suppliercert/getbycreatorandtype/' + typeCode,
+      method: 'GET'
+    })
+  },
   getEntity (entityId, myAxios) {
   getEntity (entityId, myAxios) {
     return myAxios({
     return myAxios({
       url: '/suppliercert/get/' + entityId,
       url: '/suppliercert/get/' + entityId,

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

@@ -236,7 +236,7 @@
         businessList: [], //准入业务
         businessList: [], //准入业务
         serviceId: '',
         serviceId: '',
         certId: '',
         certId: '',
-        classId: '03',
+        classId: '02',
         formData: {
         formData: {
           Id: '',
           Id: '',
           SupplierName: '',
           SupplierName: '',
@@ -312,8 +312,8 @@
           ModifiedUserId: '',
           ModifiedUserId: '',
           ModifiedBy: '',
           ModifiedBy: '',
           CertId: 0,
           CertId: 0,
-          SupplierTypeCode: '03',
-          SupplierTypeName: '技术服务类',
+          SupplierTypeCode: '02',
+          SupplierTypeName: '基建类',
           Step: 0,
           Step: 0,
           HseTraining: 0,
           HseTraining: 0,
         },
         },

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

@@ -236,7 +236,7 @@
         businessList: [], //准入业务
         businessList: [], //准入业务
         serviceId: '',
         serviceId: '',
         certId: '',
         certId: '',
-        classId: '03',
+        classId: '01',
         formData: {
         formData: {
           Id: '',
           Id: '',
           SupplierName: '',
           SupplierName: '',

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

@@ -15,7 +15,7 @@
           <!--v-if="formData.Step>=5"-->
           <!--v-if="formData.Step>=5"-->
           <el-button type="primary" plain size="mini">增项申请</el-button>
           <el-button type="primary" plain size="mini">增项申请</el-button>
           <router-link :to="'/oilsupplier/supplier/techlist'">
           <router-link :to="'/oilsupplier/supplier/techlist'">
-            <el-button type="primary" size="mini" style="margin-left: 8px">返回</el-button>
+            <el-button type="primary" size="mini" style="margin-left: 8px" v-if="authUser.Profile.IsCompanyUser != 1">返回</el-button>
           </router-link>
           </router-link>
         </span>
         </span>
       </div>
       </div>
@@ -340,8 +340,8 @@
       }
       }
     },
     },
     created () {
     created () {
-      this.serviceId = this.$route.params.opera
-      this.certId = this.$route.query.certid
+      this.serviceId = this.$route.params.opera + ''
+      this.certId = this.$route.query.certid + ''
       this.getDictOptions()
       this.getDictOptions()
       if (this.serviceId !== 'add' && this.serviceId > 0) {
       if (this.serviceId !== 'add' && this.serviceId > 0) {
         this.formData.Id = this.serviceId
         this.formData.Id = this.serviceId

+ 39 - 7
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplier/techlist.vue

@@ -1,5 +1,5 @@
 <template>
 <template>
-  <div>
+  <div v-if="!IsCompanyUser">
     <el-breadcrumb class="heading">
     <el-breadcrumb class="heading">
       <el-breadcrumb-item :to="{ path: '/' }">平台首页</el-breadcrumb-item>
       <el-breadcrumb-item :to="{ path: '/' }">平台首页</el-breadcrumb-item>
       <el-breadcrumb-item :to="{ path: '/oilsupplier/supplier' }">技术服务类列表</el-breadcrumb-item>
       <el-breadcrumb-item :to="{ path: '/oilsupplier/supplier' }">技术服务类列表</el-breadcrumb-item>
@@ -434,6 +434,7 @@
 <script>
 <script>
   import { mapGetters } from 'vuex';
   import { mapGetters } from 'vuex';
   import api from '@/api/oilsupplier/supplier';
   import api from '@/api/oilsupplier/supplier';
+  import certApi from '@/api/oilsupplier/suppliercert'
 
 
   export default {
   export default {
     computed: {
     computed: {
@@ -445,6 +446,7 @@
 
 
     data() {
     data() {
       return {
       return {
+        IsCompanyUser: 0,
         canApply: false,
         canApply: false,
         dialogVisible: false,
         dialogVisible: false,
         //列表数据
         //列表数据
@@ -462,6 +464,10 @@
         CreateOn: [new Date(new Date().getTime() - 30 * 24 * 60 * 60 * 1000), new Date()],
         CreateOn: [new Date(new Date().getTime() - 30 * 24 * 60 * 60 * 1000), new Date()],
         //查询项
         //查询项
         searchFormReset: {},
         searchFormReset: {},
+        CompanyApprovedData: {
+          SupplierId: '',
+          CertId: '',
+        },
         searchForm: {
         searchForm: {
           Id: '',
           Id: '',
           SupplierName: '',
           SupplierName: '',
@@ -892,12 +898,38 @@
       }
       }
     },
     },
     created () {
     created () {
-      this.isCanApply()
-      //查询条件初始值备份
-      Object.assign(this.searchFormReset, this.searchForm)
-      //查询列表
-      this.initDatas()
-      //this.getDictOptions()
+      this.IsCompanyUser = this.authUser.Profile.IsCompanyUser
+      if (this.IsCompanyUser) {
+        certApi.getEntityByCreatorAndType('03', this.$axios).then(res => {
+          this.CompanyApprovedData.CertId = res.data.Id
+          this.CompanyApprovedData.SupplierId = res.data.SupplierId
+          if (this.CompanyApprovedData.CertId) {
+            this.$router.push({
+              path: '/oilsupplier/supplier/' + this.CompanyApprovedData.SupplierId + '/techedit',
+              query: {
+                certid: this.CompanyApprovedData.CertId
+              }
+            })
+          } else {
+            this.$router.push({
+              path: '/oilsupplier/supplier/add/techedit',
+              query: {}
+            })
+          }
+
+        }).catch(err => {
+          console.error(err)
+        })
+
+      } else {
+        this.isCanApply()
+        //查询条件初始值备份
+        Object.assign(this.searchFormReset, this.searchForm)
+        //查询列表
+        this.initDatas()
+        //this.getDictOptions()
+      }
+
     },
     },
     methods: {
     methods: {
       initDatas() {
       initDatas() {