Browse Source

Merge branch 'qhse_person' of shuzhihua/pms-iot-vue into master

yanghao 3 days ago
parent
commit
1068f5a27e
2 changed files with 19 additions and 9 deletions
  1. 10 1
      src/views/pms/qhse/certificate.vue
  2. 9 8
      src/views/pms/qhse/monthlyReport/index.vue

+ 10 - 1
src/views/pms/qhse/certificate.vue

@@ -707,13 +707,22 @@ const submitForm = async () => {
     await formRef.value.validate()
     submitLoading.value = true
 
+    console.log('提交数据:', formData.value.certPic)
+
+    let certPic: any = null
+    if (isEdit.value) {
+      certPic = formData.value.certPic ? formData.value.certPic.join(',') : ''
+    } else {
+      certPic = formData.value.certPic
+    }
+
     // 准备提交数据
     const submitData = {
       ...formData.value,
       // 确保日期字段以正确的格式提交
       certIssue: formData.value.certIssue,
       certExpire: formData.value.certExpire,
-      certPic: formData.value.certPic ? formData.value.certPic.join(',') : '' // 将图片数组转换为逗号分隔的字符串
+      certPic // 将图片数组转换为逗号分隔的字符串
     }
 
     if (isEdit.value) {

+ 9 - 8
src/views/pms/qhse/monthlyReport/index.vue

@@ -214,10 +214,11 @@ const handleCurrentChange = (val) => {
 }
 
 const add = (row) => {
-  if (row.dutyPerson !== userInfo.value.id) {
-    ElMessage.error('您没有权限进行此操作')
-    return
-  }
+  // console.log(userInfo.value)
+  // if (row.dutyPerson !== userInfo.value.id && userInfo.value.username !== 'admin') {
+  //   ElMessage.error('您没有权限进行此操作')
+  //   return
+  // }
   router.push({
     name: 'MonthlyReportAdd',
     params: {
@@ -227,10 +228,10 @@ const add = (row) => {
 }
 
 const detail = (row) => {
-  if (row.dutyPerson !== userInfo.value.id) {
-    ElMessage.error('您没有权限进行此操作')
-    return
-  }
+  // if (row.dutyPerson !== userInfo.value.id && userInfo.value.username !== 'admin') {
+  //   ElMessage.error('您没有权限进行此操作')
+  //   return
+  // }
   router.push({
     name: 'MonthlyReportInfo',
     params: {