瀏覽代碼

按钮权限

lining 6 年之前
父節點
當前提交
87b935e338

+ 26 - 0
src/dashoo.cn/backend/api/controllers/lims/limsdataentry.go

@@ -4973,6 +4973,32 @@ func (this *LimsDataEntryController) GetAuditStepCode() {
 
 }
 
+// @Title 是否有权限
+// @Description
+// @Success	200	{object} controllers.Request
+// @router /ispermissionsbycode [get]
+func (this *LimsDataEntryController) IsPermissionsByCode() {
+	code := this.GetString("Code")
+	var users []userRole.Base_RoleList
+	var auditWorkflow auditsetting.Base_OilAuditSetting
+	rsvc := auditsetting.GetOilAuditSettingService(utils.DBE)
+	rsvc.GetAuditStepRoleEntity(OilAuditSettingName, this.User.DepartmentId, code, &auditWorkflow)
+	users = rsvc.GetUserByRole(strconv.Itoa(auditWorkflow.RoleId), this.User.AccCode)
+
+	res := false
+	for _, user := range users {
+		if this.User.Id == strconv.Itoa(int(user.Id))  {
+			res = true
+			break
+		}
+	}
+
+	this.Data["json"] = res
+	this.ServeJSON()
+
+
+}
+
 func (this *LimsDataEntryController) adddataentrydetail(entrustmainId, dataentryid, balanceid int, positionCheckId, entrustNo,templatecode, AccCode string) error {
 	var err error
 	svc := limsdataentry.GetLimsDataEntryService(utils.DBE)

+ 24 - 1
src/dashoo.cn/frontend_web/src/pages/lims/dataentry/onlyofficesframe.vue

@@ -52,6 +52,7 @@ export default {
     data () {
       return {
         data: {
+          isShow: false,
           entrustNo: '', // 是否审核  0 未审核  1已审核
           testDetail: '',
           testDetailId: '',
@@ -93,13 +94,35 @@ export default {
       // this.iframeSrc = "./onlyofficeshow?key=" + this.key + "&docurl=http://" + this.docurl
       this.iframeSrc = './pdfshow?key=' + this.key + '&docurl=http://' + this.docurl + '&docname=' + this.docname
       // this.iframeSrc = "http://" + this.docurl
+      this.isPermissionsByCode()
     },
     methods: {
+      isPermissionsByCode () {
+        let code = ''
+        if (this.checkstaus == 2) {
+          code = 'DATAPREAUDIT'
+        } else if (this.checkstaus == 4) {
+          code = 'DATAAUDIT'
+        } else if (this.checkstaus == 1) {
+          code = 'DATAJIAOHE'
+        }
+        let params = {
+          Code: code
+        }
+        this.$axios.get('/limsdataentry/ispermissionsbycode', {
+          params
+        }).then(res => {
+          this.buttonshow = res.data
+        })
+          .catch(err => {
+            console.error(err)
+          })
+      },
       // 返回
       backFunc () {
         let _this = this
         _this.$router.push({
-          path: '/lims/dataentry/tacktodo',
+          path: '/lims/dataentry/tasktodo2',
           query: ''
         })
       },

+ 22 - 12
src/dashoo.cn/frontend_web/src/pages/lims/dataentry/tasktodo2.vue

@@ -449,20 +449,30 @@
       }
     },
     methods: {
-      isShow (status, code) {
-        if (this.tjz) {
-
-        } else {
-          if (status === 1) {
-            return this.stepcode.indexOf(code) !== -1
-          } else if (status === 2) {
-            return this.stepcode.indexOf(code) !== -1
-          } else if (status === 4) {
-            return this.stepcode.indexOf(code) !== -1
+      isPermissionsByCode (status) {
+        let code = ''
+        if (status == 2) {
+          code = 'DATAPREAUDIT'
+        } else if (status == 4) {
+          code = 'DATAAUDIT'
+        } else if (status == 1) {
+          code = 'DATAJIAOHE'
+        }
+        let params = {
+          Code: code
+        }
+        this.$axios.get('/limsdataentry/ispermissionsbycode', {
+          params
+        }).then(res => {
+          if (res.data) {
+            return 'true'
           } else {
-            return false
+            return 'false'
           }
-        }
+        })
+          .catch(err => {
+            console.error(err)
+          })
       },
       getAuditStepCode () {
         let params = {

+ 24 - 1
src/dashoo.cn/frontend_web/src/pages/lims/reportairfoamgenerator/subdata/datalist.vue

@@ -12,7 +12,7 @@
         </span>
         <span style="float: right;">
           <el-button type="plain" size="mini" style="margin-right:10px; margin-top: -4px;"  v-if="this.DataStatus==0||this.DataStatus==5||this.DataStatus==3||this.DataStatus==7" @click="addDataEntity">添加明细</el-button>
-          <el-button type="primary" size="mini" v-if="this.ischeck===1" @click="jiaoheshowdialog">校核</el-button>
+          <el-button type="primary" size="mini" v-if="this.ischeck===1&&isShow" @click="jiaoheshowdialog">校核</el-button>
           <el-button type="primary" size="mini" v-if="this.DataStatus==0||this.DataStatus==5||this.DataStatus==3||this.DataStatus==7" @click="setProoFreadShow">提交校核</el-button>
           <!--<el-button type="plain" @click="searchCommand('search')" size="mini"-->
                      <!--style="margin-left:10px; margin-top: -4px;">查询</el-button>-->
@@ -331,6 +331,7 @@
 
     data () {
       return {
+        isShow: false,
         MaxOrderNo: 0,
         DataDocId: '0',
         sign: '2',
@@ -418,8 +419,30 @@
       this.initDatas()
       this.getUsersByRole()
       this.getDictOptions()
+      this.isPermissionsByCode()
     },
     methods: {
+      isPermissionsByCode () {
+        let code = ''
+        if (this.DataStatus == 2) {
+          code = 'DATAPREAUDIT'
+        } else if (this.DataStatus == 4) {
+          code = 'DATAAUDIT'
+        } else if (this.DataStatus == 1) {
+          code = 'DATAJIAOHE'
+        }
+        let params = {
+          Code: code
+        }
+        this.$axios.get('/limsdataentry/ispermissionsbycode', {
+          params
+        }).then(res => {
+          this.isShow = res.data
+        })
+          .catch(err => {
+            console.error(err)
+          })
+      },
       getEntrustEquipment (PositionCheckId) {
         let params = {
           EId: this.EId,

+ 26 - 1
src/dashoo.cn/frontend_web/src/pages/lims/reportatmosvalve/subdata/datalist.vue

@@ -13,7 +13,7 @@
 
         <span style="float: right;">
           <el-button type="plain" size="mini" style="margin-right:20px; margin-top: -4px;"  v-if="this.DataStatus==0||this.DataStatus==5||this.DataStatus==3||this.DataStatus==7" @click="addDataEntity">添加明细</el-button>
-          <el-button type="primary" size="mini" v-if="this.ischeck===1" @click="jiaoheshowdialog">校核</el-button>
+          <el-button type="primary" size="mini" v-if="this.ischeck===1&&isShow" @click="jiaoheshowdialog">校核</el-button>
           <el-button type="primary" size="mini" v-if="this.DataStatus==0||this.DataStatus==5||this.DataStatus==3||this.DataStatus==7" @click="setProoFreadShow">提交校核</el-button>
 
           <!--<el-button type="plain" @click="searchCommand('search')" size="mini"-->
@@ -842,6 +842,7 @@
 
     data () {
       return {
+        isShow: false,
         StatusOptions: [],
         dialogVisible: false,
         ProoFreadShow: false,
@@ -1040,8 +1041,32 @@
       this.initDatas()
       this.getUsersByRole()
       this.getDictOptions()
+      this.isPermissionsByCode()
     },
     methods: {
+      isPermissionsByCode () {
+        console.log(typeof this.DataStatus, this.DataStatus)
+        let code = ''
+        if (this.DataStatus == 2) {
+          code = 'DATAPREAUDIT'
+        } else if (this.DataStatus == 4) {
+          code = 'DATAAUDIT'
+        } else if (this.DataStatus == 1) {
+          code = 'DATAJIAOHE'
+        }
+        let params = {
+          Code: code
+        }
+        this.$axios.get('/limsdataentry/ispermissionsbycode', {
+          params
+        }).then(res => {
+          console.log(res.data)
+          this.isShow = res.data
+        })
+          .catch(err => {
+            console.error(err)
+          })
+      },
       getEntrustEquipment (PositionCheckId) {
         let params = {
           EId: this.EId,

+ 27 - 1
src/dashoo.cn/frontend_web/src/pages/lims/reportelecground/subdata/datalist.vue

@@ -12,7 +12,7 @@
           <i class="icon icon-table2"></i> 电气接地录入
         </span>
         <span style="float: right;">
-          <el-button type="primary" size="mini" v-if="this.ischeck===1" @click="jiaoheshowdialog">校核</el-button>
+          <el-button type="primary" size="mini" v-if="this.ischeck===1&&isShow" @click="jiaoheshowdialog">校核</el-button>
           <el-button type="primary" size="mini" v-if="this.DataStatus==0||this.DataStatus==5||this.DataStatus==3" @click="setProoFreadShow">提交校核</el-button>
           <el-button type="plain" size="mini" style="margin-left:10px; margin-top: -4px;" v-if="this.DataStatus==0||this.DataStatus==5||this.DataStatus==3" @click="addDataEntity">添加明细</el-button>
           <!--<el-button type="plain" @click="searchCommand('search')" size="mini" style="margin-left:10px; margin-top: -4px;">查询</el-button>-->
@@ -359,6 +359,7 @@
 
     data () {
       return {
+        isShow: false,
         MaxOrderNo: 0,
         activeName: '1',
         Id: 0,
@@ -476,9 +477,31 @@
       this.getDictOptions()
       this.getUsersByRole()
       this.getEntrustInfo()
+      this.isPermissionsByCode()
       // this.getDataEntry()
     },
     methods: {
+      isPermissionsByCode () {
+        let code = ''
+        if (this.DataStatus == 2) {
+          code = 'DATAPREAUDIT'
+        } else if (this.DataStatus == 4) {
+          code = 'DATAAUDIT'
+        } else if (this.DataStatus == 1) {
+          code = 'DATAJIAOHE'
+        }
+        let params = {
+          Code: code
+        }
+        this.$axios.get('/limsdataentry/ispermissionsbycode', {
+          params
+        }).then(res => {
+          this.isShow = res.data
+        })
+          .catch(err => {
+            console.error(err)
+          })
+      },
       TestDepartFilter (val) {
         if (val) {
           let len = val.length
@@ -843,6 +866,9 @@
       getDataEntry () {
         this.$axios.get('/limsdataentry/getdataentry/' + this.DataEntryId).then(res => {
           this.formData = res.data
+          if (!this.formData.CheckDate || this.formData.CheckDate.indexOf('0001-01-01') !== -1) {
+            this.formData.CheckDate = new Date()
+          }
           this.params.Id = res.data.Id
           // this.PositionCheckId = res.data.PositionCheckId
           // this.TestDepartChange(res.data.TestDepartId)

+ 24 - 1
src/dashoo.cn/frontend_web/src/pages/lims/reportequipotent/subdata/datalist.vue

@@ -12,7 +12,7 @@
           <i class="icon icon-table2"></i> 防雷装置(等电位)录入
         </span>
         <span style="float: right;">
-          <el-button type="primary" size="mini" v-if="this.ischeck===1" @click="jiaoheshowdialog">校核</el-button>
+          <el-button type="primary" size="mini" v-if="this.ischeck===1&&isShow" @click="jiaoheshowdialog">校核</el-button>
           <el-button type="primary" size="mini" v-if="this.DataStatus==0||this.DataStatus==5||this.DataStatus==3" @click="setProoFreadShow">提交校核</el-button>
           <el-button type="plain" size="mini" style="margin-left:10px; margin-top: -4px;" v-if="this.DataStatus==0||this.DataStatus==5||this.DataStatus==3" @click="addDataEntity">添加明细</el-button>
           <!--<el-button type="plain" @click="searchCommand('search')" size="mini" style="margin-left:10px; margin-top: -4px;">查询</el-button>-->
@@ -273,6 +273,7 @@
 
     data () {
       return {
+        isShow: false,
         MaxOrderNo: 0,
         DataDocId: '0',
         sign: '1',
@@ -359,8 +360,30 @@
       this.initDatas()
       this.getDictOptions()
       this.getUsersByRole()
+      this.isPermissionsByCode()
     },
     methods: {
+      isPermissionsByCode () {
+        let code = ''
+        if (this.DataStatus == 2) {
+          code = 'DATAPREAUDIT'
+        } else if (this.DataStatus == 4) {
+          code = 'DATAAUDIT'
+        } else if (this.DataStatus == 1) {
+          code = 'DATAJIAOHE'
+        }
+        let params = {
+          Code: code
+        }
+        this.$axios.get('/limsdataentry/ispermissionsbycode', {
+          params
+        }).then(res => {
+          this.isShow = res.data
+        })
+          .catch(err => {
+            console.error(err)
+          })
+      },
       getEntrustEquipment (PositionCheckId) {
         let params = {
           EId: this.EId,

+ 3 - 0
src/dashoo.cn/frontend_web/src/pages/lims/reportequipotent/subdata/datamain.vue

@@ -277,6 +277,9 @@
       getDataEntry () {
         this.$axios.get('/limsdataentry/getdataentry/' + this.DataEntryId).then(res => {
           this.formData = res.data
+          if (!this.formData.CheckDate || this.formData.CheckDate.indexOf('0001-01-01') !== -1) {
+            this.formData.CheckDate = new Date()
+          }
           this.params.Id = res.data.Id
           this.PositionCheckId = res.data.PositionCheckId
           this.MainProductsNoOptions = res.data.Instrument1.split(',')

+ 12 - 12
src/dashoo.cn/frontend_web/src/pages/lims/reportequipotent/subdata/dataopera.vue

@@ -31,18 +31,18 @@
                     </el-option>
                   </el-option-group>
                 </el-select>
-                <template>
-                  <el-popover
-                    placement="left"
-                    title="添加分布位置"
-                    width="150px"
-                    trigger="click">
-                    <el-input ref="inputDistrict" v-model="District" size="small" style="width: 70%"></el-input>
-                    <el-button size="small" style="width: 30%; text-align: center" @click="addDistrict">保存</el-button>
-                    <el-button slot="reference"><i class="el-icon-plus"></i>
-                    </el-button>
-                  </el-popover>
-                </template>
+                <!--<template>-->
+                  <!--<el-popover-->
+                    <!--placement="left"-->
+                    <!--title="添加分布位置"-->
+                    <!--width="150px"-->
+                    <!--trigger="click">-->
+                    <!--<el-input ref="inputDistrict" v-model="District" size="small" style="width: 70%"></el-input>-->
+                    <!--<el-button size="small" style="width: 30%; text-align: center" @click="addDistrict">保存</el-button>-->
+                    <!--<el-button slot="reference"><i class="el-icon-plus"></i>-->
+                    <!--</el-button>-->
+                  <!--</el-popover>-->
+                <!--</template>-->
               </el-form-item>
             </el-col>
             <el-col :span="8">

+ 24 - 1
src/dashoo.cn/frontend_web/src/pages/lims/reporthydraulicsafe/subdata/datalist.vue

@@ -12,7 +12,7 @@
         </span>
         <span style="float: right;">
           <el-button type="plain" size="mini" style="margin-right:10px; margin-top: -4px;"  v-if="this.DataStatus==0||this.DataStatus==5||this.DataStatus==3||this.DataStatus==7" @click="addDataEntity">添加明细</el-button>
-          <el-button type="primary" size="mini" v-if="this.ischeck===1" @click="jiaoheshowdialog">校核</el-button>
+          <el-button type="primary" size="mini" v-if="this.ischeck===1&&isShow" @click="jiaoheshowdialog">校核</el-button>
           <el-button type="primary" size="mini" v-if="this.DataStatus==0||this.DataStatus==5||this.DataStatus==3 && DataStatus!=7" @click="setProoFreadShow">提交校核</el-button>
           <!--<el-button type="plain" @click="searchCommand('search')" size="mini"-->
                      <!--style="margin-left:10px; margin-top: -4px;">查询</el-button>-->
@@ -355,6 +355,7 @@
 
     data () {
       return {
+        isShow: false,
         MaxOrderNo: 0,
         dialogVisible: false,
         ProoFreadShow: false,
@@ -428,8 +429,30 @@
       this.initDatas()
       // this.getDictOptions()
       this.getUsersByRole()
+      this.isPermissionsByCode()
     },
     methods: {
+      isPermissionsByCode () {
+        let code = ''
+        if (this.DataStatus == 2) {
+          code = 'DATAPREAUDIT'
+        } else if (this.DataStatus == 4) {
+          code = 'DATAAUDIT'
+        } else if (this.DataStatus == 1) {
+          code = 'DATAJIAOHE'
+        }
+        let params = {
+          Code: code
+        }
+        this.$axios.get('/limsdataentry/ispermissionsbycode', {
+          params
+        }).then(res => {
+          this.isShow = res.data
+        })
+          .catch(err => {
+            console.error(err)
+          })
+      },
       getEntrustEquipment (PositionCheckId) {
         let params = {
           EId: this.EId,

+ 24 - 1
src/dashoo.cn/frontend_web/src/pages/lims/reportleakprotect/subdata/datalist.vue

@@ -12,7 +12,7 @@
           <i class="icon icon-table2"></i> 漏电保护录入
         </span>
         <span style="float: right;">
-          <el-button type="primary" size="mini" v-if="this.ischeck===1" @click="jiaoheshowdialog">校核</el-button>
+          <el-button type="primary" size="mini" v-if="this.ischeck===1&&isShow" @click="jiaoheshowdialog">校核</el-button>
           <el-button type="primary" size="mini" v-if="this.DataStatus==0||this.DataStatus==5||this.DataStatus==3" @click="setProoFreadShow">提交校核</el-button>
           <el-button type="plain" size="mini" style="margin-left:10px; margin-top: -4px;" v-if="this.DataStatus==0||this.DataStatus==5||this.DataStatus==3" @click="addDataEntity">添加明细</el-button>
           <!--<el-button type="plain" @click="searchCommand('search')" size="mini" style="margin-left:10px; margin-top: -4px;">查询</el-button>-->
@@ -371,6 +371,7 @@
 
     data () {
       return {
+        isShow: false,
         MaxOrderNo: 0,
         dialogVisible: false,
         ProoFreadShow: false,
@@ -484,8 +485,30 @@
       // 查询列表
       this.initDatas()
       this.getUsersByRole()
+      this.isPermissionsByCode()
     },
     methods: {
+      isPermissionsByCode () {
+        let code = ''
+        if (this.DataStatus == 2) {
+          code = 'DATAPREAUDIT'
+        } else if (this.DataStatus == 4) {
+          code = 'DATAAUDIT'
+        } else if (this.DataStatus == 1) {
+          code = 'DATAJIAOHE'
+        }
+        let params = {
+          Code: code
+        }
+        this.$axios.get('/limsdataentry/ispermissionsbycode', {
+          params
+        }).then(res => {
+          this.isShow = res.data
+        })
+          .catch(err => {
+            console.error(err)
+          })
+      },
       getEntrustEquipment (PositionCheckId) {
         let params = {
           EId: this.EId,

+ 3 - 0
src/dashoo.cn/frontend_web/src/pages/lims/reportleakprotect/subdata/datamain.vue

@@ -245,6 +245,9 @@
       getDataEntry () {
         this.$axios.get('/limsdataentry/getdataentry/' + this.DataEntryId).then(res => {
           this.formData = res.data
+          if (!this.formData.CheckDate || this.formData.CheckDate.indexOf('0001-01-01') !== -1) {
+            this.formData.CheckDate = new Date()
+          }
           this.params.Id = res.data.Id
           this.PositionCheckId = res.data.PositionCheckId
           this.MainProductsNoOptions = res.data.Instrument1.split(',')

+ 24 - 1
src/dashoo.cn/frontend_web/src/pages/lims/reportlightprotect/datareview.vue

@@ -12,7 +12,7 @@
           <i class="icon icon-table2"></i> 查看
         </span>
         <span style="float: right;">
-          <el-button type="primary" size="mini" v-if="this.ischeck===1" @click="jiaoheshowdialog">校核</el-button>
+          <el-button type="primary" size="mini" v-if="this.ischeck===1&&isShow" @click="jiaoheshowdialog">校核</el-button>
           <el-button type="primary" size="mini" v-if="this.queryParams.DataStatus==0||this.queryParams.DataStatus==5||queryParams.DataStatus ==3" @click="setProoFreadShow">提交校核</el-button>
           <!-- <el-button type="primary" size="mini" :disabled="this.queryParams.DataStatus!=2" @click="auditorShow = true">提交审核</el-button> -->
           <el-button type="plain" size="mini" v-if="this.queryParams.DataStatus==0||this.queryParams.DataStatus==5||queryParams.DataStatus ==3" style="margin-left:10px; margin-top: -4px;"
@@ -290,6 +290,7 @@
 
     data () {
       return {
+        isShow: false,
         sign: '1',
         dialogVisible: false,
         ProoFreadShow: false,
@@ -439,8 +440,30 @@
       this.initDatas()
       this.getUsersByRole()
       this.getDictOptions()
+      this.isPermissionsByCode()
     },
     methods: {
+      isPermissionsByCode () {
+        let code = ''
+        if (this.queryParams.DataStatus == 2) {
+          code = 'DATAPREAUDIT'
+        } else if (this.queryParams.DataStatus == 4) {
+          code = 'DATAAUDIT'
+        } else if (this.queryParams.DataStatus == 1) {
+          code = 'DATAJIAOHE'
+        }
+        let params = {
+          Code: code
+        }
+        this.$axios.get('/limsdataentry/ispermissionsbycode', {
+          params
+        }).then(res => {
+          this.isShow = res.data
+        })
+          .catch(err => {
+            console.error(err)
+          })
+      },
       getEntrustEquipment (PositionCheckId) {
         let params = {
           EId: this.queryParams.EId,

+ 3 - 0
src/dashoo.cn/frontend_web/src/pages/lims/reportlightprotect/subdata/datamain.vue

@@ -253,6 +253,9 @@
       getDataEntry () {
         this.$axios.get('/limsdataentry/getdataentry/' + this.DataEntryId).then(res => {
           this.formData = res.data
+          if (!this.formData.CheckDate || this.formData.CheckDate.indexOf('0001-01-01') !== -1) {
+            this.formData.CheckDate = new Date()
+          }
           this.params.Id = res.data.Id
           this.CGRMeterOptions = res.data.Instrument1.split(',')
           this.GRMeterOptions = res.data.Instrument2.split(',')

+ 26 - 1
src/dashoo.cn/frontend_web/src/pages/lims/reportzuhq/subdata/datalist.vue

@@ -12,7 +12,7 @@
         </span>
         <span style="float: right;">
           <el-button type="plain" size="mini" style="margin-right:10px; margin-top: -4px;"  v-if="this.DataStatus==0||this.DataStatus==5||this.DataStatus==3||this.DataStatus==7" @click="addDataEntity">添加明细</el-button>
-          <el-button type="primary" size="mini" v-if="this.ischeck===1" @click="jiaoheshowdialog">校核</el-button>
+          <el-button type="primary" size="mini" v-if="this.ischeck===1&&isShow" @click="jiaoheshowdialog">校核</el-button>
            <el-button type="primary" size="mini" v-if="this.DataStatus==0||this.DataStatus==5||this.DataStatus==3||this.DataStatus==7" @click="setProoFreadShow">提交校核</el-button>
           <!--<el-button type="plain" @click="searchCommand('search')" size="mini"-->
                      <!--style="margin-left:10px; margin-top: -4px;">查询</el-button>-->
@@ -302,6 +302,7 @@
 
     data () {
       return {
+        isShow: false,
         MaxOrderNo: 0,
         dialogVisible: false,
         ProoFreadShow: false,
@@ -378,8 +379,32 @@
       this.initDatas()
       this.getUsersByRole()
       this.getDictOptions()
+      this.isPermissionsByCode()
     },
     methods: {
+      isPermissionsByCode () {
+        console.log(typeof this.DataStatus, this.DataStatus)
+        let code = ''
+        if (this.DataStatus == 2) {
+          code = 'DATAPREAUDIT'
+        } else if (this.DataStatus == 4) {
+          code = 'DATAAUDIT'
+        } else if (this.DataStatus == 1) {
+          code = 'DATAJIAOHE'
+        }
+        let params = {
+          Code: code
+        }
+        this.$axios.get('/limsdataentry/ispermissionsbycode', {
+          params
+        }).then(res => {
+          console.log(res.data)
+          this.isShow = res.data
+        })
+          .catch(err => {
+            console.error(err)
+          })
+      },
       getEntrustEquipment (PositionCheckId) {
         let params = {
           EId: this.EId,