Browse Source

176
工艺文件上传后无法在工艺管理中查看和在线浏览

yusheng 10 months ago
parent
commit
4de0760835

+ 1 - 1
qiankun_config/store.js

@@ -19,7 +19,7 @@ export default function (state) {
     store.commit('user/setUserInfo', state.user.info);
   }
   if (state.user?.authorityDept) {
-    store.dispatch('user/getCurrentUserAuthorityDept');
+    // store.dispatch('user/getCurrentUserAuthorityDept');
   }
   if (state.paramsSetData) {
     store.dispatch('paramsSetData/setParamsDataInfo');

+ 5 - 1
src/components/addDoc/main.vue

@@ -185,7 +185,11 @@
       },
       async init() {
         if (this.fileId.length > 0) {
-          this.tableList = await queryIds({ ids: "'" + this.fileId + "'" });
+          if (typeof(this.fileId[0])=='object' ) {
+            this.tableList = [];
+          } else {
+            this.tableList = await queryIds({ ids: "'" + this.fileId + "'" });
+          }
         } else {
           this.tableList = [];
         }

+ 1 - 0
src/store/modules/user.js

@@ -90,6 +90,7 @@ export default {
   },
   actions: {
     async getCurrentUserAuthorityDept({ commit }) {
+      return []
       const info = await getCurrentUserAuthorityDeptAPI();
       commit('setAuthorityDept', info);
     },

+ 1 - 1
src/views/login/index.vue

@@ -203,7 +203,7 @@ export default {
             } else {
               localStorage.removeItem('accountInfo');
             }
-            this.$store.dispatch('user/getCurrentUserAuthorityDept');
+            // this.$store.dispatch('user/getCurrentUserAuthorityDept');
             this.goHome();
           })
           .catch((e) => {

+ 55 - 15
src/views/system/organization/components/org-user-list.vue

@@ -191,8 +191,11 @@
     unbindLoginName
   } from '@/api/system/organization';
   import { pageUsers, exportUsers } from '@/api/system/user';
+  import dictMixins from '@/mixins/dictMixins';
+  import { getFactoryarea } from '@/api/factoryModel';
+
   export default {
-    mixins: [tabMixins],
+    mixins: [tabMixins, dictMixins],
     components: {
       importDialog,
       OrgUserSearch,
@@ -207,17 +210,21 @@
       organizationList: Array,
       institutionList: Array
     },
-    data() {
-      return {
-        moudleName: 'mainUser',
-        showEdit1: false,
-        userShow: false,
-        userRow: null,
-        currentRow: null,
-        dialogVisible: false,
-        radio: '2',
-        // 表格列配置
-        columns: [
+    created() {
+      this.requestDict('岗位');
+      getFactoryarea({
+        pageNum: 1,
+        size: 999,
+        type: 1
+      }).then((res) => {
+        this.factoryList = res.list || [];
+      });
+    },
+    computed: {
+      // 表格列配置
+      columns() {
+        let columnsVersion = this.columnsVersion;
+        return [
           {
             columnKey: 'index',
             type: 'index',
@@ -241,6 +248,27 @@
             showOverflowTooltip: true,
             minWidth: 110
           },
+          {
+            prop: 'postName',
+            label: '岗位',
+            sortable: 'custom',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (_row, _column, cellValue) => {
+              return this.getDictValue('岗位', cellValue);
+            }
+          },
+          {
+            prop: 'factoryId',
+            label: '所属工厂',
+            sortable: 'custom',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (_row, _column, cellValue) => {
+              return this.factoryList.find((item) => item.id == cellValue)
+                ?.name;
+            }
+          },
           {
             prop: 'loginName',
             label: '用户账号',
@@ -303,7 +331,20 @@
             slot: 'action',
             showOverflowTooltip: true
           }
-        ],
+        ];
+      }
+    },
+    data() {
+      return {
+        moudleName: 'mainUser',
+        showEdit1: false,
+        userShow: false,
+        userRow: null,
+        currentRow: null,
+        dialogVisible: false,
+        radio: '2',
+        columnsVersion: 0,
+        factoryList: [],
         // 表格列配置
         columns1: [
           {
@@ -417,7 +458,6 @@
           size: limit,
           groupId: this.organizationId,
           isQueryLZ: 1
-
         });
       },
       /* 表格数据源 */
@@ -426,7 +466,7 @@
           ...where,
           ...order,
           pageNum: page,
-          size: limit,
+          size: limit
         });
       },
       /* 刷新表格 */

+ 215 - 191
src/views/system/user/components/user-edit.vue

@@ -10,7 +10,13 @@
     @update:visible="updateVisible"
     :maxable="true"
   >
-    <el-form ref="form" :autoComplete="false" :model="form" :rules="rules" label-width="100px">
+    <el-form
+      ref="form"
+      :autoComplete="false"
+      :model="form"
+      :rules="rules"
+      label-width="100px"
+    >
       <el-row>
         <el-col :span="12">
           <el-form-item label="用户账号:" prop="loginName">
@@ -43,6 +49,17 @@
             />
           </el-form-item>
         </el-col>
+        <el-col :span="12">
+          <el-form-item label="岗位:" prop="postName">
+            <DictSelection
+              dictName="岗位"
+              placeholder=" "
+              v-model="userInfo.postName"
+              :isProhibit="true"
+            >
+            </DictSelection>
+          </el-form-item>
+        </el-col>
         <el-col :span="12">
           <el-form-item label="启用状态:" prop="enable">
             <el-switch
@@ -112,212 +129,219 @@
 </template>
 
 <script>
-// import { emailReg, phoneReg } from 'ele-admin';
-import RoleSelect from './role-select.vue';
-import add from './add.vue';
-import { addUsers, putUsers, getById } from '@/api/system/user';
-
-export default {
-  components: { RoleSelect, add },
-  props: {
-    // 弹窗是否打开
-    visible: Boolean,
-    // isUpdate: Boolean,
-    // 修改回显的数据
-    data: Object,
-    organizationList: {
-      type: Array,
-      default: () => {
-        return [];
+  // import { emailReg, phoneReg } from 'ele-admin';
+  import RoleSelect from './role-select.vue';
+  import add from './add.vue';
+  import { addUsers, putUsers, getById } from '@/api/system/user';
+  import { getUserDetail } from '@/api/system/organization';
+  export default {
+    components: { RoleSelect, add },
+    props: {
+      // 弹窗是否打开
+      visible: Boolean,
+      // isUpdate: Boolean,
+      // 修改回显的数据
+      data: Object,
+      organizationList: {
+        type: Array,
+        default: () => {
+          return [];
+        }
       }
-    }
-  },
-  data() {
-    const defaultForm = {
-      id: null,
-      loginName: '',
-      mainUserId: '',
-      name: '',
-      loginPwd: 123456,
-      enable: 1,
-      groupRolePOList: [],
-      jobNumber: '',
-      phone: ''
-    };
-    return {
-      defaultForm,
-      defaultProps: {
-        multiple: true,
-        checkStrictly: true,
-        emitPath: false,
-        children: 'children',
-        value: 'id',
-        label: 'name'
+    },
+    data() {
+      const defaultForm = {
+        id: null,
+        loginName: '',
+        mainUserId: '',
+        name: '',
+        loginPwd: 123456,
+        enable: 1,
+        groupRolePOList: [],
+        jobNumber: '',
+        phone: ''
+      };
+      return {
+        defaultForm,
+        defaultProps: {
+          multiple: true,
+          checkStrictly: true,
+          emitPath: false,
+          children: 'children',
+          value: 'id',
+          label: 'name'
+        },
+        // 表单数据
+        form: { ...defaultForm },
+        // 表单验证规则
+        rules: {
+          loginName: [
+            { required: true, message: '请输入用户账号', trigger: 'blur' }
+          ],
+          name: [{ required: true, message: '请选择员工', trigger: 'change' }],
+          loginPwd: [
+            {
+              required: true,
+              pattern: /^[\S]{5,18}$/,
+              message: '密码必须为5-18位非空白字符',
+              trigger: 'blur'
+            }
+          ]
+        },
+        // 提交状态
+        loading: false,
+        // 是否是修改
+        isUpdate: false,
+        userInfo: {
+          postName: ''
+        }
+      };
+    },
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive() {
+        return this.$store.state.theme.styleResponsive;
+      }
+    },
+    methods: {
+      setUsers() {
+        this.$refs.addREf.open('0');
+      },
+      async getUserDetail() {
+        this.userInfo = await getUserDetail(this.form.mainUserId);
       },
-      // 表单数据
-      form: { ...defaultForm },
-      // 表单验证规则
-      rules: {
-        loginName: [
-          { required: true, message: '请输入用户账号', trigger: 'blur' }
-        ],
-        name: [{ required: true, message: '请选择员工', trigger: 'change' }],
-        loginPwd: [
-          {
-            required: true,
-            pattern: /^[\S]{5,18}$/,
-            message: '密码必须为5-18位非空白字符',
-            trigger: 'blur'
+      userBk(data) {
+        if (data) {
+          this.form.name = data.name;
+          this.form.mainUserId = data.id;
+          this.getUserDetail();
+          this.form.jobNumber = data.jobNumber;
+          this.form.phone = data.phone;
+          this.form.groupRolePOList = [];
+          if (!data.deptIds.includes(data.groupId)) {
+            this.form.groupRolePOList.push({
+              groupName: data.groupName,
+              groupId: data.groupId,
+              roleIds: []
+            });
           }
-        ]
+
+          if (data.deptIds.length > 0) {
+            const deptNames = data.deptName.split('/');
+            data.deptIds.forEach((item, index) => {
+              this.form.groupRolePOList.push({
+                groupName: deptNames[index],
+                groupId: item,
+                roleIds: []
+              });
+            });
+          }
+          this.$forceUpdate();
+        }
       },
-      // 提交状态
-      loading: false,
-      // 是否是修改
-      isUpdate: false
-    };
-  },
-  computed: {
-    // 是否开启响应式布局
-    styleResponsive() {
-      return this.$store.state.theme.styleResponsive;
-    }
-  },
-  methods: {
-    setUsers() {
-      this.$refs.addREf.open('0');
-    },
-    userBk(data) {
-      if (data) {
-        this.form.name = data.name;
-        this.form.mainUserId = data.id;
-        this.form.jobNumber = data.jobNumber;
-        this.form.phone = data.phone;
-        this.form.groupRolePOList = [];
-        if (!data.deptIds.includes(data.groupId)) {
-          this.form.groupRolePOList.push({
-            groupName: data.groupName,
-            groupId: data.groupId,
-            roleIds: []
+      /* 保存编辑 */
+      save() {
+        this.$refs.form.validate((valid) => {
+          let isRole = true;
+          if (!valid) {
+            return false;
+          }
+          this.form.groupRolePOList.forEach((item) => {
+            if (item.roleIds.length == 0) {
+              isRole = false;
+            }
           });
-        }
+          if (!isRole) {
+            this.$message.warning('请选择角色!');
+            return;
+          }
+          this.loading = true;
+          if (!this.isUpdate) {
+            delete this.form.id;
+          }
 
-        if (data.deptIds.length > 0) {
-          const deptNames = data.deptName.split('/');
-          data.deptIds.forEach((item, index) => {
+          const data = {
+            ...this.form
+            // roleId: this.form.roleIds.map((d) => {
+            //   return { roleId: d };
+            // })
+          };
+          const saveOrUpdate = this.isUpdate ? putUsers : addUsers;
+          saveOrUpdate(data)
+            .then((msg) => {
+              this.loading = false;
+              this.$message.success(msg);
+              this.updateVisible(false);
+              this.$emit('done');
+            })
+            .catch((e) => {
+              this.loading = false;
+              // this.$message.error(e.message);
+            });
+        });
+      },
+      /* 更新visible */
+      updateVisible(value) {
+        this.$emit('update:visible', value);
+      },
+      getByData(userRow, currentRow) {
+        let id = this.data?.id || userRow?.id;
+        getById(id).then((res) => {
+          this.form = res.data;
+          this.getUserDetail();
+          this.form.groupRolePOList = [];
+          res.data.groupRoleList.forEach((item) => {
             this.form.groupRolePOList.push({
-              groupName: deptNames[index],
-              groupId: item,
-              roleIds: []
+              groupName: item.groupName,
+              groupId: item.groupId,
+              roleIds: item.roleVOList.map((ids) => ids.id)
             });
           });
-        }
-        this.$forceUpdate();
-      }
-    },
-    /* 保存编辑 */
-    save() {
-      this.$refs.form.validate((valid) => {
-        let isRole = true;
-        if (!valid) {
-          return false;
-        }
-        this.form.groupRolePOList.forEach((item) => {
-          if (item.roleIds.length == 0) {
-            isRole = false;
+          if (currentRow) {
+            this.isUpdate = true;
+            this.userBk(currentRow);
           }
         });
-        if (!isRole) {
-          this.$message.warning('请选择角色!');
-          return;
-        }
-        this.loading = true;
-        if (!this.isUpdate) {
-          delete this.form.id;
-        }
-
-        const data = {
-          ...this.form
-          // roleId: this.form.roleIds.map((d) => {
-          //   return { roleId: d };
-          // })
-        };
-        const saveOrUpdate = this.isUpdate ? putUsers : addUsers;
-        saveOrUpdate(data)
-          .then((msg) => {
-            this.loading = false;
-            this.$message.success(msg);
-            this.updateVisible(false);
-            this.$emit('done');
-          })
-          .catch((e) => {
-            this.loading = false;
-            // this.$message.error(e.message);
-          });
-      });
-    },
-    /* 更新visible */
-    updateVisible(value) {
-      this.$emit('update:visible', value);
+      }
     },
-    getByData(userRow, currentRow) {
-      let id = this.data?.id || userRow?.id;
-      getById(id).then((res) => {
-        this.form = res.data;
-        this.form.groupRolePOList = [];
-        res.data.groupRoleList.forEach((item) => {
-          this.form.groupRolePOList.push({
-            groupName: item.groupName,
-            groupId: item.groupId,
-            roleIds: item.roleVOList.map((ids) => ids.id)
-          });
-        });
-        if (currentRow) {
-          this.isUpdate = true;
-          this.userBk(currentRow);
-        }
-      });
-    }
-  },
-  watch: {
-    visible(visible) {
-      if (visible) {
-        if (this.data) {
-          this.getByData(this.data);
-          // this.isUpdate = true;
+    watch: {
+      visible(visible) {
+        if (visible) {
+          if (this.data) {
+            this.getByData(this.data);
+            // this.isUpdate = true;
+          } else {
+            // this.isUpdate = false;
+          }
         } else {
-          // this.isUpdate = false;
+          this.$refs.form.clearValidate();
+          this.form = { ...this.defaultForm };
         }
-      } else {
-        this.$refs.form.clearValidate();
-        this.form = { ...this.defaultForm };
       }
-    },
-    // isUpdate(v){
-    //   console.log(v,66666);
-    //   this.isUpdate = v;
-    // }
-  }
-};
+      // isUpdate(v){
+      //   console.log(v,66666);
+      //   this.isUpdate = v;
+      // }
+    }
+  };
 </script>
 <style lang="scss" scoped>
-:deep(.el-input--medium .el-input__inner) {
-  height: auto !important;
-}
-:deep(.el-table) {
-  .el-form-item {
-    margin-bottom: 0;
+  :deep(.el-input--medium .el-input__inner) {
+    height: auto !important;
+  }
+  :deep(.el-table) {
+    .el-form-item {
+      margin-bottom: 0;
+    }
+  }
+  :deep(.organizationList .el-input__inner) {
+    border: 0;
+    background: none;
+  }
+  :deep(.organizationList .el-input__suffix) {
+    display: none;
+  }
+  :deep(.organizationList .el-tag) {
+    background: none;
   }
-}
-:deep(.organizationList .el-input__inner) {
-  border: 0;
-  background: none;
-}
-:deep(.organizationList .el-input__suffix) {
-  display: none;
-}
-:deep(.organizationList .el-tag) {
-  background: none;
-}
-
 </style>

+ 3 - 1
src/views/technology/production/components/user-edit.vue

@@ -82,7 +82,9 @@
         </el-col>
         <el-col :span="8">
           <el-form-item label="附件上传:" prop="sort">
-            <fileUpload v-model="form.files"></fileUpload>
+            <!-- <fileUpload v-model="form.files"></fileUpload> -->
+            <fileMain v-model="form.files" ></fileMain>
+
           </el-form-item>
         </el-col>
       </el-row>

+ 3 - 1
src/views/technology/stepManagement/components/user-edit.vue

@@ -69,7 +69,9 @@
         </el-col>
         <el-col :span="8">
           <el-form-item label="附件上传:" prop="sort">
-            <fileUpload v-model="form.files" :disabled="isView"></fileUpload>
+            <!-- <fileUpload v-model="form.files" :disabled="isView"></fileUpload> -->
+            <fileMain v-model="form.files" :type="isView?'view':'add'"></fileMain>
+
           </el-form-item>
         </el-col>
       </el-row>