Просмотр исходного кода

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend into dev

# Conflicts:
#	vue.config.js
yanghe17378 1 год назад
Родитель
Сommit
c0cb05be6d
44 измененных файлов с 2429 добавлено и 1461 удалено
  1. 45 27
      src/api/system/file/index.js
  2. 152 0
      src/components/upload/comm-dialog.vue
  3. 157 152
      src/views/codeManagement/businessCode/codeList.vue
  4. 129 127
      src/views/codeManagement/businessCode/codeSegmentList.vue
  5. 3 1
      src/views/codeManagement/businessCode/codeValueList.vue
  6. 4 0
      src/views/codeManagement/components/code-list.vue
  7. 120 60
      src/views/documentManagement/certificateManagement/components/add-dialog.vue
  8. 43 6
      src/views/documentManagement/certificateManagement/components/detail-dialog.vue
  9. 67 9
      src/views/documentManagement/certificateManagement/index.vue
  10. 258 261
      src/views/factoryModel/plant/components/edit.vue
  11. 9 0
      src/views/factoryModel/plant/index.vue
  12. 18 17
      src/views/factoryModel/productionLine/components/edit.vue
  13. 184 163
      src/views/factoryModel/productionLine/index.vue
  14. 21 27
      src/views/factoryModel/station/components/edit.vue
  15. 9 0
      src/views/factoryModel/station/index.vue
  16. 7 9
      src/views/factoryModel/workshop/components/edit.vue
  17. 9 0
      src/views/factoryModel/workshop/index.vue
  18. 2 2
      src/views/material/BOMmanage/components/workmanship.vue
  19. 43 39
      src/views/material/product/detail.vue
  20. 5 0
      src/views/notifyManage/templateManage/index.vue
  21. 6 1
      src/views/rulesManagement/barCodeManagement/index.vue
  22. 7 0
      src/views/rulesManagement/earlyWarningRules/index.vue
  23. 3 0
      src/views/rulesManagement/inspectionPoint/index.vue
  24. 5 0
      src/views/rulesManagement/maintenance/index.vue
  25. 7 0
      src/views/rulesManagement/matterRules/index.vue
  26. 4 0
      src/views/rulesManagement/measuringSubmit/index.vue
  27. 4 2
      src/views/rulesManagement/meteringManagement/index.vue
  28. 6 0
      src/views/rulesManagement/warehouseInventory/index.vue
  29. 2 0
      src/views/system/dictionary/components/dict-data.vue
  30. 4 0
      src/views/system/dictionary/index.vue
  31. 7 1
      src/views/system/menu/index.vue
  32. 627 208
      src/views/system/organization/components/org-user-edit.vue
  33. 4 0
      src/views/system/parmasManage/index.vue
  34. 2 1
      src/views/system/role/index.vue
  35. 15 3
      src/views/system/unifiedPortal/index.vue
  36. 330 282
      src/views/technology/production/index.vue
  37. 3 7
      src/views/technology/stepManagement/index.vue
  38. 26 13
      src/views/technology/work/components/user-edit.vue
  39. 29 16
      src/views/technology/work/index.vue
  40. 4 2
      src/views/versionManage/index.vue
  41. 24 24
      src/views/workforceManagement/team/components/edit.vue
  42. 8 1
      src/views/workforceManagement/team/components/staffSelection.vue
  43. 8 0
      src/views/workforceManagement/team/components/userTable.vue
  44. 9 0
      src/views/workforceManagement/team/index.vue

+ 45 - 27
src/api/system/file/index.js

@@ -63,47 +63,57 @@ export async function getFile(params, fileName) {
  * 下载模板
  */
 export async function downLoadTemplate() {
-  const res = await request.post('/main/user/downLoadTemplate',{}, {
-    responseType: 'blob'
-  });
-  console.log(res.data,'***********');
+  const res = await request.post(
+    '/main/user/downLoadTemplate',
+    {},
+    {
+      responseType: 'blob'
+    }
+  );
+  console.log(res.data, '***********');
   download(res.data, '员工档案导入模板.xlsx');
-
 }
 /**
  * 下载模板
  */
-export async function downLoadTemplateNew(url,fileName) {
-  const res = await request.post(url,{}, {
-    responseType: 'blob'
-  });
-  console.log(res.data,'***********');
+export async function downLoadTemplateNew(url, fileName) {
+  const res = await request.post(
+    url,
+    {},
+    {
+      responseType: 'blob'
+    }
+  );
+  console.log(res.data, '***********');
   download(res.data, fileName);
-
 }
 
-
 export async function downLoadScript() {
   // 发送请求,下载模板
-  const res = await request.post('/main/file/downLoadScript',{}, {
-    responseType: 'blob'
-  });
+  const res = await request.post(
+    '/main/file/downLoadScript',
+    {},
+    {
+      responseType: 'blob'
+    }
+  );
 
   download(res.data, '脚本文件.zip');
-
 }
 
 export async function downLoadFiexs() {
   // 发送请求,下载模板
-  const res = await request.post('/main/file/downLoadCourse',{}, {
-    responseType: 'blob'
-  });
+  const res = await request.post(
+    '/main/file/downLoadCourse',
+    {},
+    {
+      responseType: 'blob'
+    }
+  );
 
   download(res.data, 'CS配置教程.docx');
-
 }
 
-
 /**
  * 删除文件
  */
@@ -147,20 +157,28 @@ export async function importBatch(data) {
   return Promise.reject(new Error(res.data.message));
 }
 
+// 通用上传接口
+export async function commUpload(data) {
+  const formData = new FormData();
+  data.multiPartFiles.forEach((item, index) => {
+    formData.append(`multiPartFiles`, item);
+  });
+  const res = await request.post(`${data.url}`, formData);
+  if (res.data.code === '0') {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
 // 导入pbom
 export async function importPBom(data) {
   const formData = new FormData();
   data.multiPartFiles.forEach((item, index) => {
     formData.append(`multiPartFiles`, item);
   });
-  const res = await request.post(
-    `/main/bomCategory/importPBom`,
-    formData
-  );
+  const res = await request.post(`/main/bomCategory/importPBom`, formData);
   if (res.data.code === '0') {
     return res.data;
   }
   return Promise.reject(new Error(res.data.message));
 }
-
-

+ 152 - 0
src/components/upload/comm-dialog.vue

@@ -0,0 +1,152 @@
+<template>
+  <!-- 上传 -->
+  <el-dialog title="导入文件上传" :visible.sync="dialogVisible" width="40%">
+    <el-form label-width="110px" class="zw-criterion" >
+      <el-form-item label="选择文件">
+        <el-upload
+          class="avatar-uploader"
+          action="#"
+          :show-file-list="false"
+          :http-request="handlSuccess"
+          :before-upload="beforeUpload"
+          :multiple="true"
+        >
+          <el-button icon="el-icon-plus" size="small" type="primary"
+            >文件上传</el-button
+          >
+          <div slot="tip" class="el-upload__tip" v-if="fileUrl">
+            只能上传excel文件,点击
+            <el-link
+              type="primary"
+              :underline="false"
+              :disabled="loading"
+              @click="downLoadTemplate()"
+            >
+              下载模板</el-link
+            >
+          </div>
+        </el-upload>
+      </el-form-item>
+      <el-form-item label="上传列表">
+        <div class="imgs-box">
+          <p v-for="(item, index) in attaments" :key="index" class="imgs-p">
+            <span> {{ item.name }}</span>
+            <el-link @click="delFileList(index)" type="primary">删除</el-link>
+          </p>
+        </div>
+      </el-form-item>
+    </el-form>
+    <div slot="footer" class="dialog-footer">
+      <el-button size="small" @click="dialogVisible = false">关 闭</el-button>
+      <el-button
+        size="small"
+        @click="upload"
+        type="primary"
+        :loading="loadingBtn"
+        >上 传</el-button
+      >
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+  import { commUpload } from '@/api/system/file/index.js';
+  // import { download1 } from '@/utils/file';
+  import { downLoadTemplateNew } from '@/api/system/file/index.js';
+  export default {
+    props: {
+      // eslint-disable-next-line vue/require-prop-type-constructor
+      fileUrl: '', // 下载的地址
+      fileName: '', // 下载的名称
+      apiUrl: '' // 提交的地址
+    },
+    //注册组件
+    data() {
+      return {
+        dialogVisible: false,
+        attaments: [], //上传文件
+        file: '',
+        loadingBtn: false,
+        loading: false
+      };
+    },
+
+    created() {},
+    methods: {
+      open() {
+        this.attaments = [];
+        // this.module = '';
+        this.dialogVisible = true;
+      },
+      //删除附件
+      delFileList(index) {
+        this.attaments.splice(index, 1);
+      },
+      //上传限制
+      beforeUpload(file) {
+        const isLt10M = file.size / 1024 / 1024 < 10;
+        if (!isLt10M) {
+          this.$message.error('导入单文件大小不能超过 10MB!');
+        }
+        return isLt10M;
+      },
+      //图片上传
+      handlSuccess(param) {
+        this.file = param.file;
+        this.attaments.push(param.file);
+      },
+      // 文件上传
+      async upload() {
+        if (this.attaments.length == 0) {
+          return this.$message.warning('文件不能为空!');
+        }
+        // this.module = this.$props.defModule;
+        this.loadingBtn = true;
+        try {
+          await commUpload({
+            url: this.apiUrl,
+            multiPartFiles: this.attaments
+          });
+          this.$message.success('操作成功!');
+          this.dialogVisible = false;
+          this.$emit('success');
+        } finally {
+          this.loadingBtn = false;
+        }
+      },
+      //下载模板
+      downLoadTemplate() {
+        console.log(1234)
+        this.loading = true;
+        try {
+          downLoadTemplateNew(this.fileUrl, this.fileName);
+        }finally {
+          this.loading = false;
+        }
+      }
+    }
+  };
+</script>
+
+<style lang="scss">
+  .zw-table-header {
+    float: right;
+  }
+
+  .imgs-box .imgs-p {
+    height: 30px;
+    background: #f0f3f3;
+    line-height: 30px;
+    width: 372px;
+    margin-bottom: 5px;
+    padding: 0 10px;
+    display: flex;
+    justify-content: space-between;
+  }
+  .zw-criterion-normal {
+    padding: 20px 0 0 0;
+  }
+  .el-main {
+    overflow: hidden;
+  }
+</style>

+ 157 - 152
src/views/codeManagement/businessCode/codeList.vue

@@ -20,7 +20,10 @@
       </span>
     </template>
     <template v-slot:toolbar>
-      <el-dropdown trigger="click">
+      <el-dropdown
+        trigger="click"
+        v-if="$hasPermission('mian:businessCode:save')"
+      >
         <el-button type="primary">
           新建<i class="el-icon-arrow-down el-icon--right"></i>
         </el-button>
@@ -39,6 +42,7 @@
         type="primary"
         @click.native="openEdit('edit')"
         :disabled="selection.length != 1"
+        v-if="$hasPermission('mian:businessCode:update')"
       >
         编辑
       </el-button>
@@ -46,6 +50,7 @@
         class="ele-action"
         title="确定要删除吗?"
         @confirm="remove()"
+        v-if="$hasPermission('mian:businessCode:delete')"
       >
         <template v-slot:reference>
           <el-button type="danger" :disabled="selection.length == 0">
@@ -68,168 +73,168 @@
     ></codeEdit>
   </ele-pro-table>
 </template>
-   
-  <script>
-import tabMixins from '@/mixins/tableColumnsMixin';
-import codeEdit from './components/codeEdit.vue';
-import TypeEdit from './components/typeEdit.vue';
 
-import { listParentId,removeCode } from '@/api/businessCode';
-export default {
-  mixins: [tabMixins],
-  components: {
-    codeEdit,
-    TypeEdit
-  },
-  props: {
-    // 上级
-    parentData: {
-      type: Object,
-      default: () => {}
-    }
-  },
+<script>
+  import tabMixins from '@/mixins/tableColumnsMixin';
+  import codeEdit from './components/codeEdit.vue';
+  import TypeEdit from './components/typeEdit.vue';
 
-  data() {
-    return {
-      selection: [],
-      // 表格列配置
-      columns: [
-        {
-          width: 45,
-          type: 'selection',
-          columnKey: 'selection',
-          align: 'center'
-          // selectable: (row, index) => {
-          //   return !this.disabledTableList
-          //     .map((item) => item.id)
-          //     .includes(row.id);
-          // }
-        },
-        {
-          label: '名称',
-          prop: 'name',
-          align: 'center',
-          showOverflowTooltip: true,
-          fixed: 'left',
-          slot: 'name'
-        },
-        {
-          prop: 'remark',
-          label: '描述',
-          align: 'center',
-          showOverflowTooltip: true
-        },
+  import { listParentId, removeCode } from '@/api/businessCode';
+  export default {
+    mixins: [tabMixins],
+    components: {
+      codeEdit,
+      TypeEdit
+    },
+    props: {
+      // 上级
+      parentData: {
+        type: Object,
+        default: () => {}
+      }
+    },
 
-        {
-          prop: 'createUserName',
-          label: '创建人',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'createTime',
-          label: '创建时间',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'updateUserName',
-          label: '修改人',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'updateTime',
-          label: '修改时间',
-          align: 'center',
-          showOverflowTooltip: true
-        },
+    data() {
+      return {
+        selection: [],
+        // 表格列配置
+        columns: [
+          {
+            width: 45,
+            type: 'selection',
+            columnKey: 'selection',
+            align: 'center'
+            // selectable: (row, index) => {
+            //   return !this.disabledTableList
+            //     .map((item) => item.id)
+            //     .includes(row.id);
+            // }
+          },
+          {
+            label: '名称',
+            prop: 'name',
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left',
+            slot: 'name'
+          },
+          {
+            prop: 'remark',
+            label: '描述',
+            align: 'center',
+            showOverflowTooltip: true
+          },
 
-        {
-          prop: '',
-          label: '状态',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 100,
-          formatter: (_row, _column, cellValue) => {
-            return this.$util.toDateString(cellValue);
-          }
-        }
-      ],
-      // 是否显示编辑弹窗
-      showEditFlag: false,
-      pageSize: this.$store.state.tablePageSize,
-      cacheKeyUrl: 'ad4181af-codeManagement-businessCode'
-    };
-  },
-  created() {},
+          {
+            prop: 'createUserName',
+            label: '创建人',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'createTime',
+            label: '创建时间',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'updateUserName',
+            label: '修改人',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'updateTime',
+            label: '修改时间',
+            align: 'center',
+            showOverflowTooltip: true
+          },
 
-  methods: {
-    /* 表格数据源 */
-    datasource({ page, limit, where, order }) {
-      return listParentId({
-        ...where,
-        pageNum: page,
-        size: limit,
-        parentId: this.parentData?.id
-      });
-    },
-    /* 刷新表格 */
-    reload(where) {
-      this.$nextTick(() => {
-        this.$refs.table.reload({ pageNum: 1, where: where });
-      });
+          {
+            prop: '',
+            label: '状态',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 100,
+            formatter: (_row, _column, cellValue) => {
+              return this.$util.toDateString(cellValue);
+            }
+          }
+        ],
+        // 是否显示编辑弹窗
+        showEditFlag: false,
+        pageSize: this.$store.state.tablePageSize,
+        cacheKeyUrl: 'ad4181af-codeManagement-businessCode'
+      };
     },
+    created() {},
 
-    /* 显示编辑 */
-    openEdit(type, row = '') {
-      if (type == 'edit' && this.selection[0].type == 1) {
-        this.openType(type, this.selection[0]);
-        return;
-      }
-      this.$refs.codeEditRef.open(type, this.selection[0]);
-    },
-    openType(type, row = '') {
-      this.$refs.typeEditRef.open(type, row);
-    },
+    methods: {
+      /* 表格数据源 */
+      datasource({ page, limit, where, order }) {
+        return listParentId({
+          ...where,
+          pageNum: page,
+          size: limit,
+          parentId: this.parentData?.id
+        });
+      },
+      /* 刷新表格 */
+      reload(where) {
+        this.$nextTick(() => {
+          this.$refs.table.reload({ pageNum: 1, where: where });
+        });
+      },
 
-    // async success(current) {
-    //   await this.reload();
-    //   this.current = current;
-    //   this.$nextTick(() => {
-    //     this.$refs.PowerRef &&
-    //       this.$refs.PowerRef.setTableList(this.current.userAuthority);
-    //   });
-    // },
+      /* 显示编辑 */
+      openEdit(type, row = '') {
+        if (type == 'edit' && this.selection[0].type == 1) {
+          this.openType(type, this.selection[0]);
+          return;
+        }
+        this.$refs.codeEditRef.open(type, this.selection[0]);
+      },
+      openType(type, row = '') {
+        this.$refs.typeEditRef.open(type, row);
+      },
 
-    /* 删除 */
-    remove(row) {
-      removeCode(this.selection.map((item) => item.id))
-        .then((msg) => {
-          this.$message.success('操作成功');
-          this.$emit('done', this.parentData);
-        })
-        .catch((e) => {
-          // this.$message.error(e.message);
-        });
-    },
-    done() {
-      this.$emit('done', this.parentData);
-    },
-    getTableList() {
-      return JSON.parse(JSON.stringify(this.selection));
+      // async success(current) {
+      //   await this.reload();
+      //   this.current = current;
+      //   this.$nextTick(() => {
+      //     this.$refs.PowerRef &&
+      //       this.$refs.PowerRef.setTableList(this.current.userAuthority);
+      //   });
+      // },
+
+      /* 删除 */
+      remove(row) {
+        removeCode(this.selection.map((item) => item.id))
+          .then((msg) => {
+            this.$message.success('操作成功');
+            this.$emit('done', this.parentData);
+          })
+          .catch((e) => {
+            // this.$message.error(e.message);
+          });
+      },
+      done() {
+        this.$emit('done', this.parentData);
+      },
+      getTableList() {
+        return JSON.parse(JSON.stringify(this.selection));
+      }
     }
-  }
-};
+  };
 </script>
 
 <style lang="scss" scoped>
-.listName {
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  img {
-    margin-right: 3px;
+  .listName {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    img {
+      margin-right: 3px;
+    }
   }
-}
-</style>
+</style>

+ 129 - 127
src/views/codeManagement/businessCode/codeSegmentList.vue

@@ -20,28 +20,23 @@
             <el-form-item label="状态" prop="status"> </el-form-item>
           </el-col>
           <el-col :span="13">
-            <el-form-item label="创建人" prop="createUserName"> 
-              <el-input v-model="parentData.createUserName" ></el-input>
-
+            <el-form-item label="创建人" prop="createUserName">
+              <el-input v-model="parentData.createUserName"></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="13">
             <el-form-item label="创建时间" prop="createTime">
-              <el-input v-model="parentData.createTime" ></el-input>
-              
+              <el-input v-model="parentData.createTime"></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="13">
             <el-form-item label="修改人" prop="updateUserName">
-              <el-input v-model="parentData.updateUserName" ></el-input>
-              
+              <el-input v-model="parentData.updateUserName"></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="13">
-            <el-form-item label="修改时间" prop="updateTime"> 
-              <el-input v-model="parentData.updateTime" ></el-input>
-
-
+            <el-form-item label="修改时间" prop="updateTime">
+              <el-input v-model="parentData.updateTime"></el-input>
             </el-form-item>
           </el-col>
         </el-row>
@@ -60,7 +55,11 @@
         :needPage="false"
       >
         <template v-slot:toolbar>
-          <el-button type="primary" @click.native="openEdit('add')">
+          <el-button
+            type="primary"
+            @click.native="openEdit('add')"
+            v-if="$hasPermission('mian:businessCode:save')"
+          >
             新建
           </el-button>
 
@@ -68,6 +67,7 @@
             type="primary"
             :disabled="selection.length != 1"
             @click.native="openEdit('edit')"
+            v-if="$hasPermission('mian:businessCode:update')"
           >
             编辑
           </el-button>
@@ -75,6 +75,7 @@
             class="ele-action"
             title="确定要删除此码段吗?"
             @confirm="remove()"
+            v-if="$hasPermission('mian:businessCode:delete')"
           >
             <template v-slot:reference>
               <el-button type="danger" :disabled="selection.length == 0">
@@ -97,127 +98,128 @@
   </el-tabs>
   <!-- 数据表格 -->
 </template>
-   
-  <script>
-import codeSegmentEdit from './components/codeSegmentEdit.vue';
-import { roughRule, fineRule } from '@/enum/dict.js';
-import { pageSegment, removeSegment } from '@/api/businessCode';
-export default {
-  components: {
-    codeSegmentEdit
-  },
-  props: {
-    // 上级
-    parentData: {
-      type: Object,
-      default: () => {}
-    }
-  },
 
-  data() {
-    return {
-      form: {},
-      selection: [],
-      // 表格列配置
-      columns: [
-        {
-          width: 45,
-          type: 'selection',
-          columnKey: 'selection',
-          align: 'center'
-        },
-        {
-          label: '名称',
-          prop: 'name',
-          align: 'center',
-          showOverflowTooltip: true,
-          fixed: 'left'
-        },
-        {
-          prop: 'remark',
-          label: '描述',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'length',
-          label: '长度',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'roughRule',
-          label: '粗规则',
-          align: 'center',
-          showOverflowTooltip: true,
-          formatter: (_row, _column, cellValue) => {
-            return roughRule.find((item) => item.value == cellValue)?.label;
-          }
-        },
-        {
-          prop: 'fineRule',
-          label: '细规则',
-          align: 'center',
-          showOverflowTooltip: true,
-          formatter: (_row, _column, cellValue) => {
-            let _fineRule=fineRule.filter(item=>item.pid==_row.roughRule)
-            return _fineRule.find((item) => item.value == cellValue)?.label;
-          }
-        },
-        {
-          prop: 'createUserName',
-          label: '创建人',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'createTime',
-          label: '创建时间',
-          align: 'center',
-          showOverflowTooltip: true
-        }
-      ]
-    };
-  },
-  created() {},
-
-  methods: {
-    /* 表格数据源 */
-    datasource({ page, limit, where, order }) {
-      return pageSegment({
-        ...where,
-        pageNum: page,
-        size: limit,
-        businessCodeCategoryId: this.parentData?.id
-      });
+<script>
+  import codeSegmentEdit from './components/codeSegmentEdit.vue';
+  import { roughRule, fineRule } from '@/enum/dict.js';
+  import { pageSegment, removeSegment } from '@/api/businessCode';
+  export default {
+    components: {
+      codeSegmentEdit
     },
-    /* 刷新表格 */
-    reload(where) {
-      this.$nextTick(() => {
-        this.$refs.table.reload({ pageNum: 1, where: where });
-      });
+    props: {
+      // 上级
+      parentData: {
+        type: Object,
+        default: () => {}
+      }
     },
 
-    /* 显示编辑 */
-    openEdit(type, row = '') {
-      this.$refs.codeSegmentEditRef.open(type, this.selection[0]);
+    data() {
+      return {
+        form: {},
+        selection: [],
+        // 表格列配置
+        columns: [
+          {
+            width: 45,
+            type: 'selection',
+            columnKey: 'selection',
+            align: 'center'
+          },
+          {
+            label: '名称',
+            prop: 'name',
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'remark',
+            label: '描述',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'length',
+            label: '长度',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'roughRule',
+            label: '粗规则',
+            align: 'center',
+            showOverflowTooltip: true,
+            formatter: (_row, _column, cellValue) => {
+              return roughRule.find((item) => item.value == cellValue)?.label;
+            }
+          },
+          {
+            prop: 'fineRule',
+            label: '细规则',
+            align: 'center',
+            showOverflowTooltip: true,
+            formatter: (_row, _column, cellValue) => {
+              let _fineRule = fineRule.filter(
+                (item) => item.pid == _row.roughRule
+              );
+              return _fineRule.find((item) => item.value == cellValue)?.label;
+            }
+          },
+          {
+            prop: 'createUserName',
+            label: '创建人',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'createTime',
+            label: '创建时间',
+            align: 'center',
+            showOverflowTooltip: true
+          }
+        ]
+      };
     },
+    created() {},
 
-    /* 删除 */
-    remove() {
-      removeSegment(this.selection.map((item) => item.id))
-        .then((msg) => {
-          this.$message.success('操作成功');
-          this.$emit('done', this.parentData);
-        })
-        .catch((e) => {
-          // this.$message.error(e.message);
+    methods: {
+      /* 表格数据源 */
+      datasource({ page, limit, where, order }) {
+        return pageSegment({
+          ...where,
+          pageNum: page,
+          size: limit,
+          businessCodeCategoryId: this.parentData?.id
         });
-    },
-    done() {
-      this.$emit('done', this.parentData);
+      },
+      /* 刷新表格 */
+      reload(where) {
+        this.$nextTick(() => {
+          this.$refs.table.reload({ pageNum: 1, where: where });
+        });
+      },
+
+      /* 显示编辑 */
+      openEdit(type, row = '') {
+        this.$refs.codeSegmentEditRef.open(type, this.selection[0]);
+      },
+
+      /* 删除 */
+      remove() {
+        removeSegment(this.selection.map((item) => item.id))
+          .then((msg) => {
+            this.$message.success('操作成功');
+            this.$emit('done', this.parentData);
+          })
+          .catch((e) => {
+            // this.$message.error(e.message);
+          });
+      },
+      done() {
+        this.$emit('done', this.parentData);
+      }
     }
-  }
-};
+  };
 </script>
-  

+ 3 - 1
src/views/codeManagement/businessCode/codeValueList.vue

@@ -72,6 +72,8 @@
             class="ele-action"
             title="确定要删除此码值吗?"
             @confirm="remove(scoped.$index)"
+            v-if="$hasPermission('mian:businessCode:delete')"
+
           >
             <template v-slot:reference>
               <el-button type="danger"> 删除 </el-button>
@@ -88,7 +90,7 @@
         <template v-slot:remark="{ row }">
           <el-input v-model="row.remark" @change="valueChange(row)"></el-input>
         </template>
-        <template v-slot:toolbar v-if="form.roughRule != 4">
+        <template v-slot:toolbar v-if="form.roughRule != 4&&$hasPermission('mian:businessCode:save')">
           <el-button type="primary" @click.native="openEdit('add')">
             增加
           </el-button>

+ 4 - 0
src/views/codeManagement/components/code-list.vue

@@ -21,6 +21,7 @@
             icon="el-icon-plus"
             class="ele-btn-icon"
             @click="openEdit()"
+            v-if="$hasPermission('mian:codeManage:save')"
           >
             添加
           </el-button>
@@ -33,6 +34,7 @@
           :underline="false"
           icon="el-icon-edit"
           @click="openEdit(row)"
+          v-if="$hasPermission('mian:codeManage:update')"
         >
           编辑
         </el-link>
@@ -40,6 +42,8 @@
           class="ele-action"
           title="确定要删除此用户吗?"
           @confirm="remove(row)"
+          v-if="$hasPermission('mian:codeManage:delete')"
+
         >
           <template v-slot:reference>
             <el-link type="danger" :underline="false" icon="el-icon-delete">

+ 120 - 60
src/views/documentManagement/certificateManagement/components/add-dialog.vue

@@ -1,20 +1,43 @@
 <template>
   <!-- 上传 -->
-  <el-dialog :title="title" :visible.sync="dialogVisible" @close="close" width="60%">
+  <ele-modal
+    :title="title"
+    :visible.sync="dialogVisible"
+    @close="close"
+    width="60%"
+    :maxable="true"
+  >
     <el-form ref="form" :model="form" :rules="rules" label-width="82px">
       <el-row :gutter="15">
         <el-col v-bind="styleResponsive ? { sm: 12 } : { span: 12 }">
           <el-form-item prop="holderType" label="持证类型">
-            <el-select style="width: 100%" v-model="form.holderType" @change="holderTypeChange">
-              <el-option :label="item.label" :value="item.value" v-for="(item, index) in holderTypeOptions" :key="index">
+            <el-select
+              style="width: 100%"
+              v-model="form.holderType"
+              @change="holderTypeChange"
+            >
+              <el-option
+                :label="item.label"
+                :value="item.value"
+                v-for="(item, index) in holderTypeOptions"
+                :key="index"
+              >
               </el-option>
             </el-select>
           </el-form-item>
         </el-col>
         <el-col v-bind="styleResponsive ? { sm: 12 } : { span: 12 }">
           <el-form-item prop="type" label="证件类型">
-            <DictSelection v-model="form.type" dictName="证件类型" v-if="['1'].includes(form.holderType)"></DictSelection>
-            <DictSelection v-model="form.type" dictName="客户/供应商资质类型" v-if="['2','3','4','5','6'].includes(form.holderType)"></DictSelection>
+            <DictSelection
+              v-model="form.type"
+              dictName="证件类型"
+              v-if="['1'].includes(form.holderType)"
+            ></DictSelection>
+            <DictSelection
+              v-model="form.type"
+              dictName="客户/供应商资质类型"
+              v-if="['2', '3', '4', '5', '6'].includes(form.holderType)"
+            ></DictSelection>
           </el-form-item>
         </el-col>
         <el-col v-bind="styleResponsive ? { sm: 12 } : { span: 12 }">
@@ -25,70 +48,111 @@
         <el-col v-bind="styleResponsive ? { sm: 12 } : { span: 12 }">
           <el-form-item label="等级:" prop="level">
             <el-select style="width: 100%" v-model="form.level" filterable>
-              <el-option :label="item.label" :value="item.value" v-for="(item, index) in levelOptions" :key="index">
+              <el-option
+                :label="item.label"
+                :value="item.value"
+                v-for="(item, index) in levelOptions"
+                :key="index"
+              >
               </el-option>
             </el-select>
           </el-form-item>
         </el-col>
         <el-col v-bind="styleResponsive ? { sm: 12 } : { span: 12 }">
           <el-form-item prop="status" label="状态">
-            <DictSelection v-model="form.status" dictName="规则状态"></DictSelection>
+            <DictSelection
+              v-model="form.status"
+              dictName="规则状态"
+            ></DictSelection>
           </el-form-item>
         </el-col>
-  
+
         <el-col v-bind="styleResponsive ? { sm: 12 } : { span: 12 }">
           <el-form-item prop="holder" label="持证对象">
-            <el-input v-if="form.holderType != 2" v-model="form.holder" clearable readonly placeholder="请选择"
-              @click.native="openStaffSelection"></el-input>
-              <ele-tree-select
-                v-if="form.holderType == 2"
-                ref="tree"
-                clearable
-                :data="companyData"
-                label-key="name"
-                value-key="id"
-                default-expand-all
-                v-model="form.holder"
-                @change="handleChange"
-              />
+            <el-input
+              v-if="form.holderType != 2"
+              v-model="form.holder"
+              clearable
+              readonly
+              placeholder="请选择"
+              @click.native="openStaffSelection"
+            ></el-input>
+            <ele-tree-select
+              v-if="form.holderType == 2"
+              ref="tree"
+              clearable
+              :data="companyData"
+              label-key="name"
+              value-key="id"
+              default-expand-all
+              v-model="form.holder"
+              @change="handleChange"
+            />
           </el-form-item>
         </el-col>
         <el-col v-bind="styleResponsive ? { sm: 12 } : { span: 12 }">
           <el-form-item label="颁发时间">
-            <el-date-picker style="width: 100%" v-model="form.enactorTime" type="date"
-              value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择日期">
+            <el-date-picker
+              style="width: 100%"
+              v-model="form.enactorTime"
+              type="date"
+              value-format="yyyy-MM-dd HH:mm:ss"
+              placeholder="选择日期"
+            >
             </el-date-picker>
           </el-form-item>
         </el-col>
         <el-col v-bind="styleResponsive ? { sm: 12 } : { span: 12 }">
           <el-form-item prop="date" label="有效期至">
-            <el-date-picker style="width: 100%" v-model="form.date" type="daterange" range-separator="至"
-              start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss"
-              :default-time="['00:00:00', '23:59:59']">
+            <el-date-picker
+              style="width: 100%"
+              v-model="form.date"
+              type="daterange"
+              range-separator="至"
+              start-placeholder="开始日期"
+              end-placeholder="结束日期"
+              value-format="yyyy-MM-dd HH:mm:ss"
+              :default-time="['00:00:00', '23:59:59']"
+            >
             </el-date-picker>
           </el-form-item>
         </el-col>
         <el-col v-bind="styleResponsive ? { sm: 24 } : { span: 24 }">
           <el-form-item prop="fileObj" label="附件">
-            <fileMain v-model="form.fileObj"  />
+            <fileMain v-model="form.fileObj" />
           </el-form-item>
         </el-col>
         <el-col v-bind="styleResponsive ? { sm: 24 } : { span: 24 }">
           <el-form-item prop="remark" label="备注">
-            <el-input placeholder="请输入" v-model="form.remark" type="textarea" :rows="3" :resize="`none`"></el-input>
+            <el-input
+              placeholder="请输入"
+              v-model="form.remark"
+              type="textarea"
+              :rows="3"
+              :resize="`none`"
+            ></el-input>
           </el-form-item>
         </el-col>
       </el-row>
     </el-form>
-    <staffSelection ref="staffSelection" @confirm="confirmStaffSelection"></staffSelection>
+    <staffSelection
+      ref="staffSelection"
+      @confirm="confirmStaffSelection"
+    ></staffSelection>
     <productTable ref="productTableRef" />
-    <supplierSelection ref="supplierSelectionRef" @confirm="confirmStaffSelection" />
-    <customerSelection ref="customerSelectionRef" @confirm="confirmStaffSelection" />
+    <supplierSelection
+      ref="supplierSelectionRef"
+      @confirm="confirmStaffSelection"
+    />
+    <customerSelection
+      ref="customerSelectionRef"
+      @confirm="confirmStaffSelection"
+    />
     <div slot="footer" class="dialog-footer">
       <el-button size="small" @click="save" type="primary">保 存</el-button>
       <el-button size="small" @click="close">关 闭</el-button>
     </div>
-  </el-dialog>
+  </ele-modal>
 </template>
 
 <script>
@@ -103,15 +167,15 @@
   import { listOrganizations } from '@/api/system/organization';
   import { holderTypeOptions } from '@/enum/dict.js';
   const defaultForm = {
-        code: '',
-        holder: '',
-        holderId: '',
-        type:'',
-        date: [],
-        fileObj: [],
-        holderType: '4',
-        status:1,
-      };
+    code: '',
+    holder: '',
+    holderId: '',
+    type: '',
+    date: [],
+    fileObj: [],
+    holderType: '4',
+    status: 1
+  };
   export default {
     components: {
       staffSelection,
@@ -122,7 +186,6 @@
     },
     //注册组件
     data() {
-
       return {
         dialogVisible: false,
         levelOptions: [
@@ -156,14 +219,12 @@
           status: [
             { required: true, trigger: 'change', message: '请选择状态' }
           ],
-          fileObj: [
-            { required: true, trigger: 'change', message: '请选择' }
-          ],
+          fileObj: [{ required: true, trigger: 'change', message: '请选择' }]
         },
         form: { ...defaultForm },
         title: '新增',
         holderTypeOptions,
-        companyData: [], //公司分类
+        companyData: [] //公司分类
       };
     },
     computed: {
@@ -173,14 +234,14 @@
       }
     },
     created() {
-      this.getCompanyData()
+      this.getCompanyData();
     },
     methods: {
       //选择负责人
       confirmStaffSelection(data) {
         console.log(data);
         this.form.holderId = data.map((item) => item.id).join(',');
-        
+
         this.form.holder = data.map((item) => item.name).join(',');
         this.$forceUpdate();
         console.log(this.form);
@@ -188,7 +249,7 @@
       openStaffSelection() {
         if (this.form.holderType == 1) {
           this.$refs.staffSelection.open([]);
-        } else if (this.form.holderType == 3||this.form.holderType == 6) {
+        } else if (this.form.holderType == 3 || this.form.holderType == 6) {
           this.$refs.supplierSelectionRef.open([]);
         } else if (this.form.holderType == 4) {
           this.$refs.customerSelectionRef.open([]);
@@ -213,20 +274,19 @@
         const data = await getPhotoInfo(id);
         this.form = {
           ...data,
-          type:data.type+'',
+          type: data.type + '',
           date: [data.validityStartTime, data.validityEndTime],
           holderType: data.holderType || '1'
         };
-        
 
-        this.$refs.productTableRef.putTableValue(data.categorys || [])
+        this.$refs.productTableRef.putTableValue(data.categorys || []);
       },
 
       close() {
         this.dialogVisible = false;
         // this.$refs.form.resetFields()
         this.form = { defaultForm };
-        this.$refs.productTableRef.initData()
+        this.$refs.productTableRef.initData();
       },
 
       save() {
@@ -239,9 +299,9 @@
             this.form.validityStartTime = this.form.date[0];
             this.form.validityEndTime = this.form.date[1];
           }
-         
+
           const data = {
-            ...this.form,
+            ...this.form
           };
           delete data.date;
           let productTable = this.$refs.productTableRef.getTableValue();
@@ -264,9 +324,9 @@
         if (e === 2) {
           this.getCompanyData();
         }
-        this.form.holder = ''
-        this.form.holderId = ''
-        this.form.type = ''
+        this.form.holder = '';
+        this.form.holderId = '';
+        this.form.type = '';
       },
 
       //查询公司分类
@@ -282,8 +342,8 @@
 
       //选择公司分类
       handleChange(val) {
-        if (!val) return this.form.processTypeName = ''
-        let node = this.$refs.tree.$refs.tree.getCurrentNode()
+        if (!val) return (this.form.processTypeName = '');
+        let node = this.$refs.tree.$refs.tree.getCurrentNode();
         this.form.holderId = node.id;
       }
     }

+ 43 - 6
src/views/documentManagement/certificateManagement/components/detail-dialog.vue

@@ -1,13 +1,39 @@
 <template>
-  <el-dialog title="证照详情" :visible.sync="dialogVisible" width="60%">
-    <el-descriptions title="" :column="3" size="medium" border>
+  <ele-modal
+    title="证照详情"
+    :visible.sync="dialogVisible"
+    width="60%"
+    :maxable="true"
+  >
+    <div class="switch">
+      <div class="switch_left">
+        <ul>
+          <li
+            v-for="item in tabOptions"
+            :key="item.key"
+            :class="{ active: activeComp == item.key }"
+            @click="activeComp = item.key"
+          >
+            {{ item.name }}
+          </li>
+        </ul>
+      </div>
+    </div>
+    <el-descriptions title="" :column="3" size="medium" border
+    v-if="activeComp == 'main'"
+    >
       <el-descriptions-item>
         <template slot="label"> 证照编号 </template>
         {{ form.code }}
       </el-descriptions-item>
       <el-descriptions-item>
         <template slot="label"> 类型 </template>
-        {{ getDictValue(form.holderType==1?'证件类型':'客户/供应商资质类型', form.type) }}
+        {{
+          getDictValue(
+            form.holderType == 1 ? '证件类型' : '客户/供应商资质类型',
+            form.type
+          )
+        }}
       </el-descriptions-item>
       <el-descriptions-item>
         <template slot="label"> 持证对象</template>
@@ -46,25 +72,35 @@
         {{ form.remark }}
       </el-descriptions-item>
     </el-descriptions>
+    <bpmDetail
+      v-if="activeComp == 'bpm' && form.processInstanceId"
+      :id="form.processInstanceId"
+    ></bpmDetail>
     <div slot="footer" class="dialog-footer">
       <el-button size="small" @click="dialogVisible = false">关 闭</el-button>
     </div>
-  </el-dialog>
+  </ele-modal>
 </template>
 
 <script>
   import { getPhotoInfo } from '@/api/documentManagement';
   import dictMixins from '@/mixins/dictMixins';
   import fileMain from '@/components/addDoc/index.vue';
+  import bpmDetail from '@/views/bpm/processInstance/businessDetail.vue';
 
   export default {
     mixins: [dictMixins],
-    components: {fileMain},
+    components: { fileMain,bpmDetail },
     //注册组件
     data() {
       return {
         dialogVisible: false,
-        form: {}
+        form: {},
+        activeComp: 'main',
+        tabOptions: [
+          { key: 'main', name: '详情' },
+          { key: 'bpm', name: '审批流程' }
+        ],
       };
     },
     computed: {},
@@ -75,6 +111,7 @@
     },
     methods: {
       open(row) {
+        this.activeComp='main'
         this.dialogVisible = true;
         this.getInfo(row.id);
       },

+ 67 - 9
src/views/documentManagement/certificateManagement/index.vue

@@ -15,9 +15,11 @@
       >
         <!-- 工具栏 -->
         <template v-slot:toolbar>
-          <el-button type="primary" icon="el-icon-plus" @click="handleUpload()"
-          v-if="$hasPermission('main:identityphoto:save')"
-
+          <el-button
+            type="primary"
+            icon="el-icon-plus"
+            @click="handleUpload()"
+            v-if="$hasPermission('main:identityphoto:save')"
             >新建</el-button
           >
           <!-- <el-button type="primary" @click="handleUpload">导入</el-button> -->
@@ -54,17 +56,33 @@
             :underline="false"
             icon="el-icon-edit"
             @click="handleUpload(row)"
-          v-if="$hasPermission('main:identityphoto:save')"
-
+            v-if="
+              [0, 3].includes(row.approvalStatus) &&
+              $hasPermission('main:identityphoto:save')
+            "
           >
             修改
           </el-link>
+          <el-link
+            type="primary"
+            :underline="false"
+            icon="el-icon-edit"
+            @click="submit(row)"
+            v-if="
+              [0, 3].includes(row.approvalStatus) &&
+              $hasPermission('main:identityphoto:save')
+            "
+          >
+            提交
+          </el-link>
           <el-popconfirm
             class="ele-action"
             title="确定要删除此信息吗?"
             @confirm="remove([row.id])"
-          v-if="$hasPermission('main:identityphoto:delete')"
-
+            v-if="
+              [0, 3].includes(row.approvalStatus) &&
+              $hasPermission('main:identityphoto:delete')
+            "
           >
             <template v-slot:reference>
               <el-link type="danger" :underline="false" icon="el-icon-delete">
@@ -77,12 +95,20 @@
     </el-card>
     <addDialog ref="addDialogRef" @success="reload" />
     <detailDialog ref="detailDialogRef" />
+    <process-submit-dialog
+      api-fun-name="purchaseinquiryStatusAPI"
+      :processSubmitDialogFlag.sync="processSubmitDialogFlag"
+      v-if="processSubmitDialogFlag"
+      ref="processSubmitDialogRef"
+      @reload="reload"
+
+    ></process-submit-dialog>
   </div>
 </template>
 
 <script>
   import tabMixins from '@/mixins/tableColumnsMixin';
-
+  import processSubmitDialog from '@/components/processSubmitDialog/processSubmitDialog.vue';
   import certificateSearch from './components/certificate-search';
   import addDialog from './components/add-dialog.vue';
   import detailDialog from './components/detail-dialog.vue';
@@ -92,12 +118,14 @@
   import { deepClone } from '@/utils';
   import { holderTypeOptions } from '@/enum/dict.js';
   import fileMain from '@/components/addDoc/index.vue';
+  import { reviewStatus } from '@/enum/dict';
 
   export default {
     mixins: [dictMixins, tabMixins],
-    components: { certificateSearch, addDialog, detailDialog, fileMain },
+    components: { certificateSearch, addDialog, detailDialog, fileMain,processSubmitDialog },
     data() {
       return {
+        processSubmitDialogFlag:false,
         columns: [
           {
             label: '序号',
@@ -166,6 +194,16 @@
             minWidth: '100',
             showOverflowTooltip: true
           },
+
+          {
+            label: '审核状态',
+            prop: 'approvalStatus',
+            align: 'center',
+            width: 120,
+            formatter: (_row, _column, cellValue) => {
+              return reviewStatus[_row.approvalStatus];
+            }
+          },
           {
             columnKey: 'action',
             label: '操作',
@@ -199,6 +237,26 @@
         });
         return res;
       },
+      async submit(row) {
+        this.processSubmitDialogFlag = true;
+
+        this.$nextTick(() => {
+          let params = {
+            businessId: row.id,
+            businessKey: row.holderType==1?'profession_person_approve':row.holderType==4?'contact_qc_approve':'supplier_qc_approve',
+            formCreateUserId: row.createUserId,
+            variables: {
+              businessCode: row.code,
+              businessName: row.holder,
+              businessType:
+                row.holderType == 1
+                  ? this.getDictValue('证件类型', row.type)
+                  : this.getDictValue('客户/供应商资质类型', row.type)
+            }
+          };
+          this.$refs.processSubmitDialogRef.init(params);
+        });
+      },
       reload(where = {}) {
         this.$refs.table.reload({ where });
       },

+ 258 - 261
src/views/factoryModel/plant/components/edit.vue

@@ -9,7 +9,6 @@
     :close-on-press-escape="false"
     width="1200px"
   >
-
     <el-form ref="form" :model="form" :rules="rules" label-width="120px">
       <el-row>
         <el-col :span="8">
@@ -24,7 +23,6 @@
               v-model="form.code"
               placeholder="请输入"
               :disabled="type === 'edit'"
-
             />
           </el-form-item>
         </el-col>
@@ -101,7 +99,7 @@
           <el-form-item label="负责人:" prop="leaderId">
             <el-select
               v-model="form.leaderId"
-              filterable 
+              filterable
               placeholder="请选择"
               @change="change_principal"
               style="width: 100%"
@@ -163,17 +161,17 @@
             ></el-input>
           </el-form-item>
         </el-col>
-<!--        <el-col :span="8" style="margin-bottom: 12px">-->
-<!--          <el-form-item prop="extInfo.campus" label="归属园院区">-->
-<!--            <el-input-->
-<!--              class="form-ipt"-->
-<!--              size="small"-->
-<!--              style="width: 100%"-->
-<!--              placeholder="请输入"-->
-<!--              v-model="form.extInfo.campus"-->
-<!--            ></el-input>-->
-<!--          </el-form-item>-->
-<!--        </el-col>-->
+        <!--        <el-col :span="8" style="margin-bottom: 12px">-->
+        <!--          <el-form-item prop="extInfo.campus" label="归属园院区">-->
+        <!--            <el-input-->
+        <!--              class="form-ipt"-->
+        <!--              size="small"-->
+        <!--              style="width: 100%"-->
+        <!--              placeholder="请输入"-->
+        <!--              v-model="form.extInfo.campus"-->
+        <!--            ></el-input>-->
+        <!--          </el-form-item>-->
+        <!--        </el-col>-->
         <el-col :span="8" style="margin-bottom: 12px">
           <el-form-item prop="extInfo.coveredArea" label="建筑面积">
             <el-input
@@ -231,7 +229,6 @@
         </el-col>
       </el-row>
       <el-row>
-
         <el-col :span="24" style="margin-bottom: 12px">
           <el-form-item label="备注:" prop="remark">
             <el-input
@@ -255,186 +252,180 @@
 </template>
 
 <script>
-import { saveOrUpdate, listWorkshopByParentId } from '@/api/factoryModel';
-import { getUserPage } from '@/api/system/organization';
-import { cityDataLabel } from 'ele-admin/packages/utils/regions';
-import AreaSelect from "@/views/enterpriseModel/regionalManage/components/area-cascader.vue";
-import {basicAreaPageAPI} from "@/api/regionalManage";
-export default {
-  components: {AreaSelect},
-  props: {
-    options_groupId: {
-      type: Array,
-      default() {
-        return [];
+  import { saveOrUpdate, listWorkshopByParentId } from '@/api/factoryModel';
+  import { getUserPage } from '@/api/system/organization';
+  import { cityDataLabel } from 'ele-admin/packages/utils/regions';
+  import AreaSelect from '@/views/enterpriseModel/regionalManage/components/area-cascader.vue';
+  import { basicAreaPageAPI } from '@/api/regionalManage';
+  export default {
+    components: { AreaSelect },
+    props: {
+      options_groupId: {
+        type: Array,
+        default() {
+          return [];
+        }
+      },
+      options_factory: {
+        type: Array,
+        default() {
+          return [];
+        }
       }
     },
-    options_factory: {
-      type: Array,
-      default() {
-        return [];
+    watch: {
+      options_groupId(nval) {
+        this.toTreeData(nval);
       }
-    }
-  },
-  watch: {
-    options_groupId(nval) {
-      this.toTreeData(nval);
-    }
-  },
-  created() {
-    this.getBasicAreaList();
-  },
-  data() {
-    const defaultForm = {
-      id: '',
-      code: '',
-      name: '',
-      leaderId:'',
-      areaId: '',
-      areaName: '',
-      extInfo: {
-        principalDep: '', // 负责人部门
-        phone: '', // 手机号
-        locationDetail: '', // 详细地址
-        location: [], // 省市区
-        assetCode: '', //房屋资产编码
-        campus: '', //归属园院区
-        coveredArea: '', //建筑面积
-        level: '', //楼层
-        moneyCeiling: '', //已配金额上限
-        useArea: '' // 使用面积
-      },
-      groupId: '',
-      enabled: 1,
-      parentId: '',
-      remark: '',
-      type: 2, //  FACTORY(1, "工厂"), WORKSHOP_PLAN(2, "厂房"), WORKSHOP(3, "车间"), LINE(4, "厂线");
-    };
-    return {
-      defaultForm,
-      // 表单数据
-      form: { ...defaultForm },
-      areaList: [],
-      areaTreeList: [],
-      // 表单验证规则
-      rules: {
-        code: [{ required: true, message: '请输入', trigger: 'blur' }],
-        name: [{ required: true, message: '请输入', trigger: 'blur' }],
-        'extInfo.factoryId': [
-          { required: true, message: '请输入', trigger: 'change' }
-        ],
-        parentId: { required: true, message: '请输入', trigger: 'change' },
-        enabled: { required: true, message: '请输入', trigger: 'change' },
-        'extInfo.principalDep': [
-          { required: true, message: '请输入', trigger: 'change' }
-        ],
-        leaderId: [
-          { required: true, message: '请选择', trigger: 'change' }
-        ],
-        'extInfo.phone': [
-          { min: 11, message: '手机号格式不正确', trigger: 'blur' }
-        ],
-
+    },
+    created() {
+      this.getBasicAreaList();
+    },
+    data() {
+      const defaultForm = {
+        id: '',
+        code: '',
+        name: '',
+        leaderId: '',
+        areaId: '',
+        areaName: '',
+        extInfo: {
+          principalDep: '', // 负责人部门
+          phone: '', // 手机号
+          locationDetail: '', // 详细地址
+          location: [], // 省市区
+          assetCode: '', //房屋资产编码
+          campus: '', //归属园院区
+          coveredArea: '', //建筑面积
+          level: '', //楼层
+          moneyCeiling: '', //已配金额上限
+          useArea: '' // 使用面积
+        },
+        groupId: '',
+        enabled: 1,
+        parentId: '',
+        remark: '',
+        type: 2 //  FACTORY(1, "工厂"), WORKSHOP_PLAN(2, "厂房"), WORKSHOP(3, "车间"), LINE(4, "厂线");
+      };
+      return {
+        defaultForm,
+        // 表单数据
+        form: { ...defaultForm },
+        areaList: [],
+        areaTreeList: [],
+        // 表单验证规则
+        rules: {
+          code: [{ required: true, message: '请输入', trigger: 'blur' }],
+          name: [{ required: true, message: '请输入', trigger: 'blur' }],
+          'extInfo.factoryId': [
+            { required: true, message: '请输入', trigger: 'change' }
+          ],
+          parentId: { required: true, message: '请输入', trigger: 'change' },
+          enabled: { required: true, message: '请输入', trigger: 'change' },
+          'extInfo.principalDep': [
+            { required: true, message: '请输入', trigger: 'change' }
+          ],
+          leaderId: [{ required: true, message: '请选择', trigger: 'change' }],
+          'extInfo.phone': [
+            { min: 11, message: '手机号格式不正确', trigger: 'blur' }
+          ]
 
-        // 'extInfo.assetCode': [
-        //   { required: true, message: '请输入', trigger: 'blur' }
-        // ],
+          // 'extInfo.assetCode': [
+          //   { required: true, message: '请输入', trigger: 'blur' }
+          // ],
 
-        // 'extInfo.campus': [
-        //   { required: true, message: '请输入', trigger: 'blur' }
-        // ],
-        // 'extInfo.coveredArea': [
-        //   { required: true, message: '请输入', trigger: 'blur' }
-        // ],
-        // 'extInfo.level': [
-        //   { required: true, message: '请输入', trigger: 'blur' }
-        // ],
+          // 'extInfo.campus': [
+          //   { required: true, message: '请输入', trigger: 'blur' }
+          // ],
+          // 'extInfo.coveredArea': [
+          //   { required: true, message: '请输入', trigger: 'blur' }
+          // ],
+          // 'extInfo.level': [
+          //   { required: true, message: '请输入', trigger: 'blur' }
+          // ],
 
-        // 'extInfo.moneyCeiling': [
-        //   { required: true, message: '请输入', trigger: 'blur' }
-        // ],
-        // 'extInfo.useArea': [
-        //   { required: true, message: '请输入', trigger: 'blur' }
-        // ]
-      },
-      visible: false,
-      type: '', // add/edit
-      loading: false,
-      options: {
-        principalDep: [],
-        principal: [],
-        workshop: [],
-        enabled: [
-          {
-            label: '生效',
-            value: 1
-          },
-          {
-            label: '未生效',
-            value: 0
-          }
-        ],
-        cityDataLabel
-      }
-    };
-  },
-  computed: {
-    title() {
-      switch (this.type) {
-        case 'add':
-          return '新增厂房';
-          break;
-        case 'edit':
-          return '编辑厂房';
-          break;
-        default:
-          break;
-      }
-    }
-  },
-  methods: {
-    /* 获取区域集合 */
-    async getBasicAreaList() {
-      this.areaList = await basicAreaPageAPI(
-        {
-          pageNum: 1,
-          size: 9999
+          // 'extInfo.moneyCeiling': [
+          //   { required: true, message: '请输入', trigger: 'blur' }
+          // ],
+          // 'extInfo.useArea': [
+          //   { required: true, message: '请输入', trigger: 'blur' }
+          // ]
+        },
+        visible: false,
+        type: '', // add/edit
+        loading: false,
+        options: {
+          principalDep: [],
+          principal: [],
+          workshop: [],
+          enabled: [
+            {
+              label: '生效',
+              value: 1
+            },
+            {
+              label: '未生效',
+              value: 0
+            }
+          ],
+          cityDataLabel
         }
-      )
-      this.areaTreeList = this.$util.toTreeData({
-        data: this.areaList,
-        idField: 'id',
-        parentIdField: 'parentId'
-      });
-
+      };
     },
-    getAreaInfo(nodeInfo) {
-      this.form.areaName = nodeInfo[0]?.pathLabels.join('/') || ''
-      this.form.areaId = this.form.areaId || ''
+    computed: {
+      title() {
+        switch (this.type) {
+          case 'add':
+            return '新增厂房';
+          case 'copy':
+            return '新增厂房';
+          case 'edit':
+            return '编辑厂房';
+          default:
+            break;
+        }
+      }
     },
-    open(type, row) {
-      this.type = type;
-      this.visible = true;
-      if (type == 'edit') {
-        for (const key of Object.keys(this.form)) {
-          if (key !== 'extInfo') {
-            this.form[key] = row[key];
-          } else {
-            for (const el of Object.keys(this.form.extInfo)) {
-              this.form.extInfo[el] = row.extInfo[el];
+    methods: {
+      /* 获取区域集合 */
+      async getBasicAreaList() {
+        this.areaList = await basicAreaPageAPI({
+          pageNum: 1,
+          size: 9999
+        });
+        this.areaTreeList = this.$util.toTreeData({
+          data: this.areaList,
+          idField: 'id',
+          parentIdField: 'parentId'
+        });
+      },
+      getAreaInfo(nodeInfo) {
+        this.form.areaName = nodeInfo[0]?.pathLabels.join('/') || '';
+        this.form.areaId = this.form.areaId || '';
+      },
+      open(type, row) {
+        this.type = type;
+        this.visible = true;
+        if (type == 'edit' || type == 'copy') {
+          for (const key of Object.keys(this.form)) {
+            if (key !== 'extInfo') {
+              this.form[key] = row[key];
+            } else {
+              for (const el of Object.keys(this.form.extInfo)) {
+                this.form.extInfo[el] = row.extInfo[el];
+              }
             }
           }
-        }
-        // 请求下拉数据
-        if (this.form.extInfo.factoryId) {
-          this.getListWorkshopByParentId();
-        }
-        if (this.form.extInfo.principalDep) {
-          this.getUserPage();
-        }
-      }else{
-        this.form = { ...this.defaultForm };
-        const info = {
+          // 请求下拉数据
+          if (this.form.extInfo.factoryId) {
+            this.getListWorkshopByParentId();
+          }
+          if (this.form.extInfo.principalDep) {
+            this.getUserPage();
+          }
+        } else {
+          this.form = { ...this.defaultForm };
+          const info = {
             principalDep: '', // 负责人部门
             phone: '', // 手机号
             locationDetail: '', // 详细地址
@@ -445,88 +436,94 @@ export default {
             level: '', //楼层
             moneyCeiling: '', //已配金额上限
             useArea: '' // 使用面积
+          };
+          this.$set(this.form, 'extInfo', info);
+          this.$refs.form.resetFields();
         }
-         this.$set(this.form,'extInfo',info)
-         this.$refs.form.resetFields();
-      }
-    },
-    /* 保存编辑 */
-    save() {
-      this.$refs.form.validate((valid) => {
-        if (!valid) {
-          return false;
+        if (type == 'copy') {
+          this.form.code = '';
         }
-        this.loading = true;
+      },
+      /* 保存编辑 */
+      save() {
+        this.$refs.form.validate((valid) => {
+          if (!valid) {
+            return false;
+          }
+          this.loading = true;
 
-        if (this.type == 'add') {
-          delete this.form.id;
-        }
-        saveOrUpdate(this.form)
-          .then((msg) => {
-            this.loading = false;
-            this.$message.success(msg);
-            this.handleClose();
-            this.$emit('done');
-          })
-          .catch((e) => {
-            this.loading = false;
-            this.$message.error(e.message);
-          });
-      });
-    },
-    restForm() {
-      this.$refs.form.clearValidate();
-      this.form = { ...this.defaultForm };
-    },
-    handleClose() {
-      this.restForm();
-      this.visible = false;
-    },
-    // 格式化公司数据
-    toTreeData(val) {
-      this.options.principalDep = this.$util.toTreeData({
-        data: val,
-        idField: 'id',
-        parentIdField: 'parentId'
-      });
-    },
-    // 获取人员
-    getUserPage() {
-      if (!this.form.extInfo.principalDep) return this.options.leaderId = []
-      let par = {
-        groupId: this.form.extInfo.principalDep,
-        size: 999
-      };
-      getUserPage(par).then((res) => {
-        this.options.principal = res.list;
-      });
-    },
-    // 选择工厂
-    change_factoryId() {
-      let result = this.options_factory.find((n) => n.id == this.form.parentId);
-      this.form.groupId = result.groupId;
-    },
-    // 选择负责人部门
-    change_principalDep() {
-      this.form.leaderId = '';
-      this.options.principal = [];
-      this.getUserPage();
-    },
-    // 选择负责人
-    change_principal() {
-      let result = this.options.principal.find(
-        (n) => n.id == this.form.leaderId
-      );
-      this.form.extInfo.phone = result.phone;
+          if (this.type != 'edit') {
+            delete this.form.id;
+          }
+          saveOrUpdate(this.form)
+            .then((msg) => {
+              this.loading = false;
+              this.$message.success(msg);
+              this.handleClose();
+              this.$emit('done');
+            })
+            .catch((e) => {
+              this.loading = false;
+              this.$message.error(e.message);
+            });
+        });
+      },
+      restForm() {
+        this.$refs.form.clearValidate();
+        this.form = { ...this.defaultForm };
+      },
+      handleClose() {
+        this.restForm();
+        this.visible = false;
+      },
+      // 格式化公司数据
+      toTreeData(val) {
+        this.options.principalDep = this.$util.toTreeData({
+          data: val,
+          idField: 'id',
+          parentIdField: 'parentId'
+        });
+      },
+      // 获取人员
+      getUserPage() {
+        if (!this.form.extInfo.principalDep)
+          return (this.options.leaderId = []);
+        let par = {
+          groupId: this.form.extInfo.principalDep,
+          size: 999
+        };
+        getUserPage(par).then((res) => {
+          this.options.principal = res.list;
+        });
+      },
+      // 选择工厂
+      change_factoryId() {
+        let result = this.options_factory.find(
+          (n) => n.id == this.form.parentId
+        );
+        this.form.groupId = result.groupId;
+      },
+      // 选择负责人部门
+      change_principalDep() {
+        this.form.leaderId = '';
+        this.options.principal = [];
+        this.getUserPage();
+      },
+      // 选择负责人
+      change_principal() {
+        let result = this.options.principal.find(
+          (n) => n.id == this.form.leaderId
+        );
+        this.form.extInfo.phone = result.phone;
+      }
     }
-  }
-};
+  };
 </script>
 <style lang="scss" scoped>
-.location-warp {
-  display: flex;
-  .detail {
-    margin-left: 10px;
+  .location-warp {
+    display: flex;
+    .detail {
+      margin-left: 10px;
+    }
   }
-}
 </style>

+ 9 - 0
src/views/factoryModel/plant/index.vue

@@ -43,6 +43,15 @@
         </template>
         <!-- 操作列 -->
         <template v-slot:action="{ row }">
+          <el-link
+            type="primary"
+            :underline="false"
+            icon="el-icon-edit"
+            @click="openEdit('copy', row)"
+            v-if="$hasPermission('main:factoryarea:saveOrUpdate')"
+          >
+            复制
+          </el-link>
           <el-link
             type="primary"
             :underline="false"

+ 18 - 17
src/views/factoryModel/productionLine/components/edit.vue

@@ -85,7 +85,6 @@
               </el-select>
             </el-form-item>
           </el-col>
-       
 
           {{ options.worksho }}
           <el-col :span="8" style="margin-bottom: 12px">
@@ -399,7 +398,9 @@
         rules: {
           code: [{ required: true, message: '请输入', trigger: 'blur' }],
           name: [{ required: true, message: '请输入', trigger: 'blur' }],
-          workshopPlanId: [{ required: true, message: '请输入', trigger: 'change' }],
+          workshopPlanId: [
+            { required: true, message: '请输入', trigger: 'change' }
+          ],
           factoryId: [{ required: true, message: '请输入', trigger: 'change' }],
           parentId: { required: true, message: '请输入', trigger: 'change' },
           'extInfo.principalDep': [
@@ -442,10 +443,10 @@
         switch (this.type) {
           case 'add':
             return '新增产线';
-            break;
+          case 'copy':
+            return '新增产线';
           case 'edit':
             return '编辑产线';
-            break;
           default:
             break;
         }
@@ -492,7 +493,7 @@
       open(type, row) {
         this.type = type;
         this.visible = true;
-        if (type == 'edit') {
+        if (type == 'edit' || type == 'copy') {
           for (const key of Object.keys(this.form)) {
             if (key !== 'extInfo') {
               this.form[key] = row[key];
@@ -530,22 +531,22 @@
             this.$refs.form.resetFields();
           });
         }
+        if (type == 'copy') {
+          this.form.code = '';
+        }
       },
       /* 获取区域集合 */
       async getBasicAreaList() {
-      this.areaList = await basicAreaPageAPI(
-        {
+        this.areaList = await basicAreaPageAPI({
           pageNum: 1,
           size: 9999
-        }
-      )
-      this.areaTreeList = this.$util.toTreeData({
-        data: this.areaList,
-        idField: 'id',
-        parentIdField: 'parentId'
-      });
-
-    },
+        });
+        this.areaTreeList = this.$util.toTreeData({
+          data: this.areaList,
+          idField: 'id',
+          parentIdField: 'parentId'
+        });
+      },
       getAreaInfo(nodeInfo) {
         this.form.areaName = nodeInfo[0]?.pathLabels.join('/') || '';
         this.form.areaId = this.form.areaId || '';
@@ -558,7 +559,7 @@
           }
           this.loading = true;
 
-          if (this.type == 'add') {
+          if (this.type != 'edit') {
             delete this.form.id;
           }
           let params = deepClone(this.form);

+ 184 - 163
src/views/factoryModel/productionLine/index.vue

@@ -1,7 +1,12 @@
 <template>
   <div class="ele-body">
     <el-card shadow="never">
-      <search ref="search" @search="search" :options_groupId="dict.groupId" :options_factory="dict.factory"></search>
+      <search
+        ref="search"
+        @search="search"
+        :options_groupId="dict.groupId"
+        :options_factory="dict.factory"
+      ></search>
       <ele-pro-table
         ref="table"
         :columns="columns"
@@ -13,32 +18,47 @@
       >
         <!-- 表头工具栏 -->
         <template v-slot:toolbar>
-          <el-button size="small" type="primary" icon="el-icon-plus" class="ele-btn-icon" @click="openEdit('add')"
-          v-if="$hasPermission('main:factoryarea:saveOrUpdate')"
+          <el-button
+            size="small"
+            type="primary"
+            icon="el-icon-plus"
+            class="ele-btn-icon"
+            @click="openEdit('add')"
+            v-if="$hasPermission('main:factoryarea:saveOrUpdate')"
           >
             添加
           </el-button>
         </template>
-    
-
-      
-    
-
 
         <template v-slot:enabled="{ row }">
           {{ dict.enabled[row.enabled] }}
         </template>
         <!-- 操作列 -->
         <template v-slot:action="{ row }">
-          <el-link type="primary" :underline="false" icon="el-icon-edit" @click="openEdit('edit', row)"
-          v-if="$hasPermission('main:factoryarea:saveOrUpdate')"
-          
+          <el-link
+            type="primary"
+            :underline="false"
+            icon="el-icon-edit"
+            @click="openEdit('copy', row)"
+            v-if="$hasPermission('main:factoryarea:saveOrUpdate')"
+          >
+            复制
+          </el-link>
+
+          <el-link
+            type="primary"
+            :underline="false"
+            icon="el-icon-edit"
+            @click="openEdit('edit', row)"
+            v-if="$hasPermission('main:factoryarea:saveOrUpdate')"
           >
             修改
           </el-link>
-          <el-popconfirm class="ele-action" title="确定要删除此角色吗?" @confirm="remove(row)"
-          v-if="$hasPermission('main:factoryarea:delete')"
-          
+          <el-popconfirm
+            class="ele-action"
+            title="确定要删除此角色吗?"
+            @confirm="remove(row)"
+            v-if="$hasPermission('main:factoryarea:delete')"
           >
             <template v-slot:reference>
               <el-link type="danger" :underline="false" icon="el-icon-delete">
@@ -49,171 +69,172 @@
         </template>
       </ele-pro-table>
     </el-card>
-    <edit ref="edit" @done="done" :options_groupId="dict.groupId" :options_factory="dict.factory"></edit>
+    <edit
+      ref="edit"
+      @done="done"
+      :options_groupId="dict.groupId"
+      :options_factory="dict.factory"
+    ></edit>
   </div>
 </template>
 <script>
-import tabMixins from '@/mixins/tableColumnsMixin';
-
-import search from './components/search.vue';
-import edit from './components/edit.vue';
-import { getFactoryarea, deletefactoryarea } from '@/api/factoryModel';
-import { listOrganizations } from '@/api/system/organization';
-export default {
-  mixins: [tabMixins],
-  components: {
-    search,
-    edit
-  },
-  data() {
-    return {
-      columns: [
-        {
-          width: 45,
-          type: 'index',
-          columnKey: 'index',
-          align: 'center'
-        },
-        {
-          prop: 'code',
-          label: '产线编码'
-        },
-        {
-          label: '产线名称',
-          prop: 'name'
-        },
-
-        {
-          label: '所属工厂',
-          prop: 'factoryName',
-         
-        },
+  import tabMixins from '@/mixins/tableColumnsMixin';
 
-        {
-          label: '所属厂房',
-          prop: 'workshopPlanName',
- 
-        },
+  import search from './components/search.vue';
+  import edit from './components/edit.vue';
+  import { getFactoryarea, deletefactoryarea } from '@/api/factoryModel';
+  import { listOrganizations } from '@/api/system/organization';
+  export default {
+    mixins: [tabMixins],
+    components: {
+      search,
+      edit
+    },
+    data() {
+      return {
+        columns: [
+          {
+            width: 45,
+            type: 'index',
+            columnKey: 'index',
+            align: 'center'
+          },
+          {
+            prop: 'code',
+            label: '产线编码'
+          },
+          {
+            label: '产线名称',
+            prop: 'name'
+          },
 
-        {
-          label: '所属车间',
-          prop: 'workshopName',
-        },
+          {
+            label: '所属工厂',
+            prop: 'factoryName'
+          },
 
+          {
+            label: '所属厂房',
+            prop: 'workshopPlanName'
+          },
 
-        {
-          label: '所属区域',
-          prop: 'areaName',
-        },
-     
+          {
+            label: '所属车间',
+            prop: 'workshopName'
+          },
 
+          {
+            label: '所属区域',
+            prop: 'areaName'
+          },
 
-        {
-          label: '省/市/区',
-          prop: 'extInfo.location'
-        },
-        {
-          label: '详细地址',
-          prop: 'extInfo.locationDetail'
-        },
-        {//修改此prop名称时,请同步修改columnKey属性和下方selectType方法
-          label: '状态',
-          prop: 'enabled',
-          slot: 'enabled',
-          filters: [
+          {
+            label: '省/市/区',
+            prop: 'extInfo.location'
+          },
+          {
+            label: '详细地址',
+            prop: 'extInfo.locationDetail'
+          },
+          {
+            //修改此prop名称时,请同步修改columnKey属性和下方selectType方法
+            label: '状态',
+            prop: 'enabled',
+            slot: 'enabled',
+            filters: [
               { value: 1, text: '生效' },
-              { value: 0, text: '未生效' },
+              { value: 0, text: '未生效' }
             ],
-          filterMultiple: false,
-          columnKey: 'enabled'
+            filterMultiple: false,
+            columnKey: 'enabled'
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 220,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            showOverflowTooltip: true
+          }
+        ],
+        dict: {
+          groupId: [],
+          factory: [],
+          enabled: {
+            1: '生效',
+            0: '未生效'
+          }
         },
-        {
-          columnKey: 'action',
-          label: '操作',
-          width: 220,
-          align: 'center',
-          resizable: false,
-          slot: 'action',
-          showOverflowTooltip: true
-        }
-      ],
-      dict: {
-        groupId: [],
-        factory: [],
-        enabled: {
-          1: '生效',
-          0: '未生效'
-        }
-      },
-      pageSize: this.$store.state.tablePageSize,
-      cacheKeyUrl: '015ef54f-factoryModel-productionLine'
-    };
-  },
-  created() {
-    this.getGs();
-    this.getFactoryarea();
-  },
-  methods: {
-    selectType(value) {
-      let where = {}
-      if (value.enabled.length > 0) {
-        where['enable'] = value.enabled[0]
-      }
-      this.search(where)
-    },
-    datasource({ page, where, limit }) {
-      return getFactoryarea({
-        ...where,
-        pageNum: page,
-        size: limit,
-        type: 4
-      });
+        pageSize: this.$store.state.tablePageSize,
+        cacheKeyUrl: '015ef54f-factoryModel-productionLine'
+      };
     },
-    search(where) {
-      this.$refs.table.reload({
-        where: where,
-        page: 1
-      });
+    created() {
+      this.getGs();
+      this.getFactoryarea();
     },
-    openEdit(type, row) {
-      if (row) {
-        if (typeof row.mainFactoryCapacityList == 'string') {
-          this.$set(row, 'mainFactoryCapacityList', [])
+    methods: {
+      selectType(value) {
+        let where = {};
+        if (value.enabled.length > 0) {
+          where['enable'] = value.enabled[0];
         }
-      }
-      this.$refs.edit.open(type, row);
-    },
-    // 获取公司数据
-    getGs() {
-      listOrganizations().then((list) => {
-        console.log(list);
-        this.dict.groupId = list;
-      });
-    },
+        this.search(where);
+      },
+      datasource({ page, where, limit }) {
+        return getFactoryarea({
+          ...where,
+          pageNum: page,
+          size: limit,
+          type: 4
+        });
+      },
+      search(where) {
+        this.$refs.table.reload({
+          where: where,
+          page: 1
+        });
+      },
+      openEdit(type, row) {
+        if (row) {
+          if (typeof row.mainFactoryCapacityList == 'string') {
+            this.$set(row, 'mainFactoryCapacityList', []);
+          }
+        }
+        this.$refs.edit.open(type, row);
+      },
+      // 获取公司数据
+      getGs() {
+        listOrganizations().then((list) => {
+          console.log(list);
+          this.dict.groupId = list;
+        });
+      },
 
-    // 获取工厂数据
-    getFactoryarea() {
-      let par = {
-        type: 2,
-        size: 9999
-      };
-      getFactoryarea(par).then((res) => {
-        this.dict.factory = res.list;
-      });
-    },
-    remove(row) {
-      deletefactoryarea(row.id)
-        .then((message) => {
-          this.$message.success(message);
-          this.done();
-        })
-        .catch((e) => {
-          this.$message.error(e.message);
+      // 获取工厂数据
+      getFactoryarea() {
+        let par = {
+          type: 2,
+          size: 9999
+        };
+        getFactoryarea(par).then((res) => {
+          this.dict.factory = res.list;
         });
-    },
-    done() {
-      this.$refs.search.search();
+      },
+      remove(row) {
+        deletefactoryarea(row.id)
+          .then((message) => {
+            this.$message.success(message);
+            this.done();
+          })
+          .catch((e) => {
+            this.$message.error(e.message);
+          });
+      },
+      done() {
+        this.$refs.search.search();
+      }
     }
-  }
-};
+  };
 </script>

+ 21 - 27
src/views/factoryModel/station/components/edit.vue

@@ -41,10 +41,7 @@
 
           <el-col :span="8">
             <el-form-item label="工位类型:" prop="extInfo.type">
-              <el-select
-                class="ele-fluid"
-                v-model="form.extInfo.type"
-              >
+              <el-select class="ele-fluid" v-model="form.extInfo.type">
                 <el-option
                   label="设备"
                   :value="1"
@@ -62,8 +59,6 @@
             </el-form-item>
           </el-col>
 
-          
-
           <el-col :span="8">
             <el-form-item
               label="设备编码:"
@@ -78,8 +73,6 @@
             </el-form-item>
           </el-col>
 
-
-
           <el-col :span="8">
             <el-form-item
               label="设备名称:"
@@ -90,12 +83,10 @@
             </el-form-item>
           </el-col>
 
-
           <el-col :span="8">
             <el-form-item
               label="班组:"
               prop="extInfo.teamId"
-
               v-if="form.extInfo.type == 3"
             >
               <el-select
@@ -123,9 +114,7 @@
               <el-select
                 style="width: 100%"
                 v-model="form.extInfo.userIds"
-           
                 multiple
-              
               >
                 <el-option
                   v-for="item in userList"
@@ -136,7 +125,7 @@
               </el-select>
             </el-form-item>
           </el-col>
-   
+
           <el-col :span="8">
             <el-form-item label="所属区域:" prop="location_city">
               <area-select
@@ -285,7 +274,6 @@
               </el-select>
             </el-form-item>
           </el-col>
-          
 
           <el-col :span="8">
             <el-form-item label="状态:" prop="enabled">
@@ -403,7 +391,7 @@
 
   import { getFactoryarea } from '@/api/factoryModel';
 
-  import { getteampage,listUserByIds } from '@/api/workforceManagement/team';
+  import { getteampage, listUserByIds } from '@/api/workforceManagement/team';
 
   export default {
     components: {
@@ -448,7 +436,7 @@
           remark: '',
           taskIds: [],
           taskNames: [],
-          
+
           workstationSubstanceList: []
         };
       };
@@ -462,7 +450,7 @@
         areaTreeList: [],
 
         teamPagerList: [],
-        userList:[],
+        userList: [],
         // 表单验证规则
         rules: {
           code: [{ required: true, message: '请输入', trigger: 'blur' }],
@@ -562,6 +550,8 @@
         switch (this.type) {
           case 'add':
             return '新增工位';
+          case 'copy':
+            return '新增工位';
           case 'edit':
             return '编辑工位';
           default:
@@ -579,15 +569,15 @@
       chooseAsset() {
         this.$refs.productRefs.open(this.form.extInfo, '选择设备', '4');
       },
-      userListFn(e){
+      userListFn(e) {
         console.log(e);
         let that = this;
-        listUserByIds([e]).then(res => {
-          console.log(res,'5263',that.userList);
+        listUserByIds([e]).then((res) => {
+          console.log(res, '5263', that.userList);
           that.userList = res;
           // this.$set(this, 'userList', res);
         });
-// listUserByIds
+        // listUserByIds
         // userList
         // console.log(this.userList);
       },
@@ -601,14 +591,12 @@
         this.$refs.produceRef.open(param);
       },
       produceConfirm(data) {
-        console.log(data,'555555');
+        console.log(data, '555555');
 
         this.form.taskIds = [data.id];
         this.form.taskNames = [data.name];
 
         this.form.extInfo.workCenterId = data.workCenterId;
-    
-
       },
 
       determineChoose(title, row) {
@@ -632,7 +620,7 @@
       open(type, row) {
         this.type = type;
         this.visible = true;
-        if (type == 'edit') {
+        if (type == 'edit' || type == 'copy') {
           for (const key of Object.keys(this.form)) {
             if (key !== 'extInfo') {
               this.form[key] = row[key];
@@ -648,7 +636,7 @@
           if (this.form.extInfo.factoryId) {
             this.getlistCf();
           }
-          this.userList=[];
+          this.userList = [];
           if (this.form.extInfo.workshopPlanId) {
             this.getListWorkshopByParentId(true);
           }
@@ -659,6 +647,9 @@
             this.getUserPage();
           }
         }
+        if (this.type == 'copy') {
+            this.form.code = '';
+          }
         this.getListWorkCenter();
         this.getListProduce();
       },
@@ -706,7 +697,7 @@
           }
           this.loading = true;
 
-          if (this.type == 'add') {
+          if (this.type != 'edit') {
             delete this.form.id;
           }
           // this.form.workstationSubstanceList =
@@ -871,6 +862,9 @@
           if (res.taskList?.length) {
             this.form.taskNames = res.taskList.map((i) => i.name);
           }
+          if (this.type == 'copy') {
+            this.form.code = '';
+          }
         });
       }
     }

+ 9 - 0
src/views/factoryModel/station/index.vue

@@ -44,6 +44,15 @@
         </template>
         <!-- 操作列 -->
         <template v-slot:action="{ row }">
+          <el-link
+            type="primary"
+            :underline="false"
+            icon="el-icon-edit"
+            @click="openEdit('copy', row)"
+            v-if="$hasPermission('main:factoryworkstation:saveOrUpdate')"
+          >
+            复制
+          </el-link>
           <el-link
             type="primary"
             :underline="false"

+ 7 - 9
src/views/factoryModel/workshop/components/edit.vue

@@ -23,7 +23,6 @@
               v-model="form.code"
               placeholder="请输入车间编码"
               :disabled="type === 'edit'"
-
             />
           </el-form-item>
         </el-col>
@@ -258,10 +257,10 @@
         switch (this.type) {
           case 'add':
             return '新增车间';
-            break;
+          case 'copy':
+            return '新增车间';
           case 'edit':
             return '编辑车间';
-            break;
           default:
             break;
         }
@@ -271,7 +270,7 @@
       open(type, row) {
         this.type = type;
         this.visible = true;
-        if (type == 'edit') {
+        if (type == 'edit' || type == 'copy') {
           for (const key of Object.keys(this.form)) {
             if (key !== 'extInfo') {
               this.form[key] = row[key];
@@ -290,6 +289,9 @@
 
           this.getlistCf();
         }
+        if (type == 'copy') {
+          this.form.code = '';
+        }
       },
 
       async getFactoryList() {
@@ -302,15 +304,12 @@
       },
 
       change_factoryId(e) {
-
         this.form.workshopPlanId = '';
         this.workshopPlanList = [];
         this.form.parentId = '';
         this.getlistCf();
-
       },
 
-      
       getlistCf() {
         let par = {
           type: 2,
@@ -318,7 +317,6 @@
           size: 9999
         };
         getFactoryarea(par).then((res) => {
-          
           this.workshopPlanList = res.list;
         });
       },
@@ -347,7 +345,7 @@
           }
           this.loading = true;
 
-          if (this.type == 'add') {
+          if (this.type != 'edit') {
             delete this.form.id;
           }
 

+ 9 - 0
src/views/factoryModel/workshop/index.vue

@@ -34,6 +34,15 @@
 
         <!-- 操作列 -->
         <template v-slot:action="{ row }">
+          <el-link
+            type="primary"
+            :underline="false"
+            icon="el-icon-edit"
+            @click="openEdit('copy', row)"
+            v-if="$hasPermission('main:factoryarea:saveOrUpdate')"
+          >
+            复制
+          </el-link>
           <el-link
             type="primary"
             :underline="false"

+ 2 - 2
src/views/material/BOMmanage/components/workmanship.vue

@@ -149,14 +149,14 @@
                 >
                   详情
                 </el-link>
-                <el-link
+                <!-- <el-link
                   type="primary"
                   :underline="false"
                   icon="el-icon-setting"
                   @click="openStepConfigure(row)"
                 >
                   配置
-                </el-link>
+                </el-link> -->
                 <el-popconfirm
                   class="ele-action"
                   title="确定要删除当前参数吗?"

+ 43 - 39
src/views/material/product/detail.vue

@@ -497,11 +497,11 @@
         ],
         attributeList: [
           {
-            label: '总装',
+            label: '成品',
             value: 1
           },
           {
-            label: '部件',
+            label: '半成品',
             value: 2
           },
           {
@@ -1201,43 +1201,47 @@
       },
       //生产类型切换
       produceTypeChange(value) {
-        if (value == 1) {
-          this.attributeList = [
-            {
-              label: '成品',
-              value: 1
-            },
-            {
-              label: '半成品',
-              value: 2
-            },
-            {
-              label: '原材料',
-              value: 4
-            }
-          ];
-          this.form.attributeType = 1;
-        } else {
-          this.attributeList = [
-            {
-              label: '总装(成品)',
-              value: 1
-            },
-            {
-              label: '部件(半成品)',
-              value: 2
-            },
-            {
-              label: '零件',
-              value: 3
-            },
-            {
-              label: '原材料',
-              value: 4
-            }
-          ];
-          this.form.attributeType = 1;
-        }
+        // if (value == 1) {
+        //   this.attributeList = [
+        //     {
+        //       label: '成品',
+        //       value: 1
+        //     },
+        //     {
+        //       label: '半成品',
+        //       value: 2
+        //     },
+        //     {
+        //       label: '零件',
+        //       value: 3
+        //     },
+        //     {
+        //       label: '原材料',
+        //       value: 4
+        //     }
+        //   ];
+        //   this.form.attributeType = 1;
+        // } else {
+        //   this.attributeList = [
+        //     {
+        //       label: '总装(成品)',
+        //       value: 1
+        //     },
+        //     {
+        //       label: '部件(半成品)',
+        //       value: 2
+        //     },
+        //     {
+        //       label: '零件',
+        //       value: 3
+        //     },
+        //     {
+        //       label: '原材料',
+        //       value: 4
+        //     }
+        //   ];
+        //   this.form.attributeType = 1;
+        // }
       }
     }
   };

+ 5 - 0
src/views/notifyManage/templateManage/index.vue

@@ -10,6 +10,8 @@
             type="primary"
             icon="el-icon-plus"
             class="ele-btn-icon"
+            v-if="$hasPermission('sys:notifytemplate:save')"
+
             @click="handleAddOrEdit('add','')">
             新建
           </el-button>
@@ -21,12 +23,15 @@
             type="primary"
             :underline="false"
             icon="el-icon-edit"
+            v-if="$hasPermission('sys:notifytemplate:update')"
+
             @click="handleAddOrEdit('update',row)">
             编辑
           </el-link>
           <el-popconfirm
             class="ele-action"
             title="确定要删除此数据吗?"
+            v-if="$hasPermission('sys:notifytemplate:delete')"
             @confirm="deleteCategory(row)">
             <template v-slot:reference>
               <el-link type="danger" :underline="false" icon="el-icon-delete">删除</el-link>

+ 6 - 1
src/views/rulesManagement/barCodeManagement/index.vue

@@ -68,6 +68,7 @@
                 size="mini"
                 type="primary"
                 @click="jumpAdd"
+                v-if="$hasPermission('main:barCode:save')"
                 >新增</el-button
               >
               <el-button size="mini" type="primary" @click="handleExport"
@@ -100,7 +101,10 @@
                   >编辑</el-button
                 > -->
                     <el-button
-                      v-if="scope.row.dictBarName == '包装条码'"
+                      v-if="
+                        scope.row.dictBarName == '包装条码' &&
+                        $hasPermission('main:barCode:print')
+                      "
                       @click="print(scope.row)"
                       type="text"
                       size="mini"
@@ -116,6 +120,7 @@
                       @click="handleDelete(scope.row.id)"
                       type="text"
                       size="mini"
+                      v-if="$hasPermission('main:barCode:delete')"
                       >删除</el-button
                     >
                   </div>

+ 7 - 0
src/views/rulesManagement/earlyWarningRules/index.vue

@@ -20,6 +20,7 @@
             icon="el-icon-plus"
             class="ele-btn-icon"
             @click="openEdit('add')"
+            v-if="$hasPermission('main:warnrule:save')"
           >
             新建
           </el-button>
@@ -45,6 +46,8 @@
             :underline="false"
             icon="el-icon-finished"
             @click="openEdit('clone', row)"
+            v-if="$hasPermission('main:warnrule:update')"
+
           >
             克隆
           </el-link>
@@ -53,6 +56,8 @@
             :underline="false"
             icon="el-icon-edit"
             @click="openEdit('edit', row)"
+            v-if="$hasPermission('main:warnrule:update')"
+
           >
             修改
           </el-link>
@@ -60,6 +65,8 @@
             class="ele-action"
             title="确定要删除此角色吗?"
             @confirm="remove(row)"
+            v-if="$hasPermission('main:warnrule:delete')"
+
           >
             <template v-slot:reference>
               <el-link type="danger" :underline="false" icon="el-icon-delete">

+ 3 - 0
src/views/rulesManagement/inspectionPoint/index.vue

@@ -20,6 +20,7 @@
             icon="el-icon-plus"
             class="ele-btn-icon"
             @click="openEdit()"
+            v-if="$hasPermission('eam:planconfig:save')"
           >
             新建
           </el-button>
@@ -42,6 +43,7 @@
             :underline="false"
             icon="el-icon-edit"
             @click="openEdit(row)"
+            v-if="$hasPermission('eam:planconfig:update')"
           >
             修改
           </el-link>
@@ -49,6 +51,7 @@
             class="ele-action"
             title="确定要删除此巡检点配置吗?"
             @confirm="remove(row)"
+            v-if="$hasPermission('eam:planconfig:delete')"
           >
             <template v-slot:reference>
               <el-link type="danger" :underline="false" icon="el-icon-delete">

+ 5 - 0
src/views/rulesManagement/maintenance/index.vue

@@ -20,6 +20,7 @@
             icon="el-icon-plus"
             class="ele-btn-icon"
             @click="openEdit()"
+            v-if="$hasPermission('eam:planconfig:save')"
           >
             新建
           </el-button>
@@ -36,6 +37,8 @@
             :underline="false"
             icon="el-icon-edit"
             @click="openEdit(row)"
+            v-if="$hasPermission('eam:planconfig:update')"
+
           >
             修改
           </el-link>
@@ -43,6 +46,8 @@
             class="ele-action"
             title="确定要删除此保养配置吗?"
             @confirm="remove(row)"
+            v-if="$hasPermission('eam:planconfig:delete')"
+
           >
             <template v-slot:reference>
               <el-link type="danger" :underline="false" icon="el-icon-delete">

+ 7 - 0
src/views/rulesManagement/matterRules/index.vue

@@ -19,6 +19,7 @@
             icon="el-icon-plus"
             class="ele-btn-icon"
             @click="openEdit('add')"
+            v-if="$hasPermission('main:ruleinfo:saveOrEdit')"
           >
             新建
           </el-button>
@@ -36,6 +37,8 @@
             :underline="false"
             icon="el-icon-finished"
             @click="openEdit('clone', row)"
+            v-if="$hasPermission('main:ruleinfo:saveOrEdit')"
+
           >
             克隆
           </el-link>
@@ -44,6 +47,8 @@
             :underline="false"
             icon="el-icon-edit"
             @click="openEdit('edit', row)"
+            v-if="$hasPermission('main:ruleinfo:saveOrEdit')"
+
           >
             修改
           </el-link>
@@ -51,6 +56,8 @@
             class="ele-action"
             title="确定要删除此条数据吗?"
             @confirm="remove(row)"
+            v-if="$hasPermission('main:ruleinfo:delete')"
+
           >
             <template v-slot:reference>
               <el-link type="danger" :underline="false" icon="el-icon-delete">

+ 4 - 0
src/views/rulesManagement/measuringSubmit/index.vue

@@ -20,6 +20,7 @@
             icon="el-icon-plus"
             class="ele-btn-icon"
             @click="openEdit()"
+            v-if="$hasPermission('eam:planconfig:save')"
           >
             新建
           </el-button>
@@ -36,6 +37,7 @@
             :underline="false"
             icon="el-icon-edit"
             @click="openEdit(row)"
+            v-if="$hasPermission('eam:planconfig:update')"
           >
             修改
           </el-link>
@@ -43,6 +45,8 @@
             class="ele-action"
             title="确定要删除此巡检点配置吗?"
             @confirm="remove(row)"
+            v-if="$hasPermission('eam:planconfig:delete')"
+
           >
             <template v-slot:reference>
               <el-link type="danger" :underline="false" icon="el-icon-delete">

+ 4 - 2
src/views/rulesManagement/meteringManagement/index.vue

@@ -4,10 +4,11 @@
       <div class="tree_box">
         <div class="control">
           <el-button icon="el-icon-plus" type="primary" @click="addType('新增')"
+          v-if="$hasPermission('main:categorymeasure:save')"
             >新增</el-button
           >
           <el-button
-            v-if="currentObj.id"
+            v-if="currentObj.id&&$hasPermission('main:categorymeasure:update')"
             icon="el-icon-edit"
             type="success"
             @click="addType('修改')"
@@ -53,7 +54,7 @@
             <!-- 表头工具栏 -->
             <template v-slot:toolbar>
               <el-button
-                v-if="currentObj.id"
+                v-if="currentObj.id&&$hasPermission('main:categorymeasure:save')"
                 size="small"
                 type="primary"
                 icon="el-icon-plus"
@@ -69,6 +70,7 @@
                 :underline="false"
                 icon="el-icon-edit"
                 @click="openEdit('修改', row)"
+                v-if="$hasPermission('main:categorymeasure:update')"
               >
                 修改
               </el-link>

+ 6 - 0
src/views/rulesManagement/warehouseInventory/index.vue

@@ -20,6 +20,8 @@
             icon="el-icon-plus"
             class="ele-btn-icon"
             @click="openEdit()"
+            v-if="$hasPermission('wms:planconfig:save')"
+
           >
             新建
           </el-button>
@@ -31,6 +33,8 @@
             :underline="false"
             icon="el-icon-edit"
             @click="openEdit(row)"
+            v-if="$hasPermission('wms:planconfig:update')"
+
           >
             修改
           </el-link>
@@ -41,6 +45,8 @@
             class="ele-action"
             title="确定要删除此角色吗?"
             @confirm="remove(row)"
+            v-if="$hasPermission('wms:planconfig:delete')"
+
           >
             <template v-slot:reference>
               <el-link type="danger" :underline="false" icon="el-icon-delete">

+ 2 - 0
src/views/system/dictionary/components/dict-data.vue

@@ -48,12 +48,14 @@
           :underline="false"
           icon="el-icon-edit"
           @click="openEdit(row)"
+          v-if="$hasPermission('main:dictionary:update')"
         >
           修改
         </el-link>
         <el-popconfirm
           class="ele-action"
           title="确定要删除此字典项吗?"
+          v-if="$hasPermission('main:dictionary:delete')"
           @confirm="remove(row)"
         >
           <template v-slot:reference>

+ 4 - 0
src/views/system/dictionary/index.vue

@@ -8,6 +8,8 @@
           type="primary"
           icon="el-icon-plus"
           class="ele-btn-icon"
+          v-if="$hasPermission('main:dictionary:save')"
+
           @click="openEdit()"
         >
           添加
@@ -29,6 +31,8 @@
           class="ele-btn-icon"
           :disabled="!current"
           @click="remove"
+          v-if="$hasPermission('main:dictionary:delete')"
+
         >
           删除
         </el-button>

+ 7 - 1
src/views/system/menu/index.vue

@@ -24,6 +24,8 @@
             icon="el-icon-plus"
             class="ele-btn-icon"
             @click="openEdit()"
+          v-if="$hasPermission('sys:resources:save')"
+
           >
             添加
           </el-button>
@@ -69,6 +71,8 @@
             :underline="false"
             icon="el-icon-plus"
             @click="openEdit(null, row.id)"
+          v-if="$hasPermission('sys:resources:save')"
+
           >
             添加
           </el-link>
@@ -77,6 +81,8 @@
             :underline="false"
             icon="el-icon-edit"
             @click="openEdit(row)"
+          v-if="$hasPermission('sys:resources:save')"
+
           >
             修改
           </el-link>
@@ -84,7 +90,7 @@
             class="ele-action"
             title="确定要删除吗?"
             @confirm="remove(row)"
-            v-if="row.id != 99999"
+            v-if="row.id != 99999&&$hasPermission('sys:resources:delete')"
           >
             <template v-slot:reference>
               <el-link type="danger" :underline="false" icon="el-icon-delete">

Разница между файлами не показана из-за своего большого размера
+ 627 - 208
src/views/system/organization/components/org-user-edit.vue


+ 4 - 0
src/views/system/parmasManage/index.vue

@@ -85,6 +85,8 @@
             :underline="false"
             icon="el-icon-edit"
             @click="openEdit('edit',row.id)"
+            v-if="$hasPermission('sys:parameter:update')"
+
           >
             修改
           </el-link>
@@ -100,6 +102,8 @@
             class="ele-action"
             title="确定要删除吗?"
             @confirm="remove(row)"
+            v-if="$hasPermission('sys:parameter:delete')"
+
           >
             <template v-slot:reference>
               <el-link

+ 2 - 1
src/views/system/role/index.vue

@@ -93,11 +93,12 @@
             class="ele-action"
             title="确定要删除此角色吗?"
             @confirm="remove(row)"
+            v-if="$hasPermission('sys:role:delete')"
           >
             <template v-slot:reference>
               <el-link
                 type="danger"
-                v-if="$hasPermission('sys:role:delete')"
+           
                 :underline="false"
                 icon="el-icon-delete"
               >

+ 15 - 3
src/views/system/unifiedPortal/index.vue

@@ -3,7 +3,11 @@
     <div class="content_box">
       <el-card class="box-card">
         <div class="control_bar">
-          <el-button type="primary" icon="el-icon-plus" @click="add"
+          <el-button
+            type="primary"
+            icon="el-icon-plus"
+            @click="add"
+            v-if="$hasPermission('sys:system:save')"
             >新增</el-button
           >
         </div>
@@ -18,8 +22,16 @@
                 <el-card>
                   <div slot="header" class="clearfix">
                     <span>{{ item.name }}</span>
-                    <i class="el-icon-delete" @click="deleted(item)"></i>
-                    <i class="el-icon-edit" @click="edit(item)"></i>
+                    <i
+                      class="el-icon-delete"
+                      @click="deleted(item)"
+                      v-if="$hasPermission('mian:codeManage:delete')"
+                    ></i>
+                    <i
+                      class="el-icon-edit"
+                      @click="edit(item)"
+                      v-if="$hasPermission('mian:codeManage:update')"
+                    ></i>
                   </div>
                   <div class="card-content">
                     <el-image

+ 330 - 282
src/views/technology/production/index.vue

@@ -4,20 +4,37 @@
       <!-- 搜索表单 -->
       <!-- <user-search @search="reload" /> -->
       <seek-page :seekList="seekList" @search="reload"></seek-page>
- 
 
       <!-- 数据表格 -->
-      <ele-pro-table ref="table" :columns="columns" :datasource="datasource" :selection.sync="selection" row-key="id" :pageSize="this.$store.state.tablePageSize" @columns-change="handleColumnChange"
-      :cache-key="cacheKeyUrl">
+      <ele-pro-table
+        ref="table"
+        :columns="columns"
+        :datasource="datasource"
+        :selection.sync="selection"
+        row-key="id"
+        :pageSize="this.$store.state.tablePageSize"
+        @columns-change="handleColumnChange"
+        :cache-key="cacheKeyUrl"
+      >
         <!-- 表头工具栏 -->
         <template v-slot:toolbar>
-          <el-button size="small" type="primary" icon="el-icon-plus" class="ele-btn-icon" @click="openEdit()"
-          v-if="$hasPermission('main:producetask:save')"
+          <el-button
+            size="small"
+            type="primary"
+            icon="el-icon-plus"
+            class="ele-btn-icon"
+            @click="openEdit()"
+            v-if="$hasPermission('main:producetask:save')"
           >
             新建
           </el-button>
-          <el-button size="small" type="danger" icon="el-icon-delete" class="ele-btn-icon" @click="removeBatch"
-          v-if="$hasPermission('main:producetask:delete')"
+          <el-button
+            size="small"
+            type="danger"
+            icon="el-icon-delete"
+            class="ele-btn-icon"
+            @click="removeBatch"
+            v-if="$hasPermission('main:producetask:delete')"
           >
             删除
           </el-button>
@@ -49,9 +66,12 @@
 
         <!-- 操作列 -->
         <template v-slot:action="{ row }">
-          <el-link type="primary" :underline="false" icon="el-icon-edit" @click="openEdit(row)"
-          v-if="$hasPermission('main:producetask:update')"
-          
+          <el-link
+            type="primary"
+            :underline="false"
+            icon="el-icon-edit"
+            @click="openEdit(row)"
+            v-if="$hasPermission('main:producetask:update')"
           >
             修改
           </el-link>
@@ -59,8 +79,11 @@
             配置工艺参数
           </el-link> -->
 
-          <el-popconfirm class="ele-action" title="确定要删除当前工序吗?" @confirm="remove(row)"
-          v-if="$hasPermission('main:producetask:delete')"
+          <el-popconfirm
+            class="ele-action"
+            title="确定要删除当前工序吗?"
+            @confirm="remove(row)"
+            v-if="$hasPermission('main:producetask:delete')"
           >
             <template v-slot:reference>
               <el-link type="danger" :underline="false" icon="el-icon-delete">
@@ -72,300 +95,325 @@
       </ele-pro-table>
     </el-card>
     <!-- 编辑弹窗 -->
-    <user-edit :visible.sync="showEdit" :data="current" :controlList="controlList" @done="reload" ref="userEdit"
-      :typeList="typeList" />
+    <user-edit
+      :visible.sync="showEdit"
+      :data="current"
+      :controlList="controlList"
+      @done="reload"
+      ref="userEdit"
+      :typeList="typeList"
+    />
     <!-- 配置工艺参数 -->
-    <user-setting :visible.sync="showSetting" :data="current" ref="userSetting" />
+    <user-setting
+      :visible.sync="showSetting"
+      :data="current"
+      ref="userSetting"
+    />
 
-    <SampleParam v-if="sampleShow" :taskId="taskId" @close="close"></SampleParam>
+    <SampleParam
+      v-if="sampleShow"
+      :taskId="taskId"
+      @close="close"
+    ></SampleParam>
 
-    <importDialog :defModule="moudleName" ref="importDialogRef" @success="reload" />
+    <importDialog
+      fileName="工艺_工序导入模板"
+      apiUrl="/main/producetask/importExcel"
+      fileUrl="/main/producetask/downLoadTemplate"
+      ref="importDialogRef"
+      @success="reload"
+    />
   </div>
 </template>
 
 <script>
-import tabMixins from '@/mixins/tableColumnsMixin';
-import UserSearch from './components/user-search.vue';
-import UserEdit from './components/user-edit.vue';
-import UserSetting from './components/user-setting.vue';
-import SampleParam from './components/sampleParam.vue'
-import producetask from '@/api/technology/production';
-import control from '@/api/technology/control';
-import importDialog from "@/components/upload/import-dialog.vue";
-import work from '@/api/technology/work';
-
-export default {
-  name: 'technologyProduction',
-  mixins:[tabMixins],
-  components: {
-    UserSearch,
-    UserEdit,
-    UserSetting,
-    SampleParam,
-    importDialog
-  },
-  data() {
-    return {
-      moudleName : "mainProduceTask",
-      // 表格列配置
-      columns: [
-
-        {
-          columnKey: 'selection',
-          type: 'selection',
-          width: 45,
-          align: 'center',
-          fixed: 'left'
-        },
-        {
-          prop: 'sort',
-          label: '排序',
-          align: 'center',
-        },
-        {
-          prop: 'code',
-          label: '工序编码',
-          // sortable: 'custom',
-          showOverflowTooltip: true,
-          align: 'center',
-          minWidth: 110
-        },
-        {
-          slot: 'name',
-          label: '工序名称',
-          showOverflowTooltip: true,
-          align: 'center',
-          minWidth: 110
-        },
-
-        {
-          slot: 'type',
-          label: '工序类型',
-          showOverflowTooltip: true,
-          align: 'center',
-          minWidth: 110
-        },
-        {
-          align: 'center',
-          prop: 'controlName',
-          label: '工序控制码',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          prop: 'workCenterName',
-          label: '所属工作中心',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
+  import tabMixins from '@/mixins/tableColumnsMixin';
+  import UserSearch from './components/user-search.vue';
+  import UserEdit from './components/user-edit.vue';
+  import UserSetting from './components/user-setting.vue';
+  import SampleParam from './components/sampleParam.vue';
+  import producetask from '@/api/technology/production';
+  import control from '@/api/technology/control';
+  import importDialog from '@/components/upload/comm-dialog.vue';
+  import work from '@/api/technology/work';
 
-        
-
-        {
-          columnKey: 'action',
-          label: '操作',
-          width: 260,
-          align: 'center',
-          resizable: false,
-          slot: 'action',
-          showOverflowTooltip: true
-        }
-      ],
-      // 表格选中数据
-      selection: [],
-      // 当前编辑数据
-      current: null,
-      // 是否显示编辑弹窗
-      showEdit: false,
-      // 是否显示参数弹窗
-      showSetting: false,
-      controlList: [],
+  export default {
+    name: 'technologyProduction',
+    mixins: [tabMixins],
+    components: {
+      UserSearch,
+      UserEdit,
+      UserSetting,
+      SampleParam,
+      importDialog
+    },
+    data() {
+      return {
+        moudleName: 'mainProduceTask',
+        // 表格列配置
+        columns: [
+          {
+            columnKey: 'selection',
+            type: 'selection',
+            width: 45,
+            align: 'center',
+            fixed: 'left'
+          },
+          {
+            prop: 'sort',
+            label: '排序',
+            align: 'center'
+          },
+          {
+            prop: 'code',
+            label: '工序编码',
+            // sortable: 'custom',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 110
+          },
+          {
+            slot: 'name',
+            label: '工序名称',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 110
+          },
 
-      typeList: [
-        {
-          value: 1,
-          label: '普通工序'
-        },
-        // {
-        //   value: 2,
-        //   label: '抽样质检'
-        // },
-        
-        {
-          value: 3,
-          label: '抽样质检'
-        }, 
-        {
-          value: 4,
-          label: '包装工序'
-        },
-        {
-          value: 6,
-          label: '质检工序'
-        },
-        {
-          value: 7,
-          label: '生产准备'
-        },
-      ],
+          {
+            slot: 'type',
+            label: '工序类型',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 110
+          },
+          {
+            align: 'center',
+            prop: 'controlName',
+            label: '工序控制码',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'workCenterName',
+            label: '所属工作中心',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
 
-      sampleShow: false,
-      taskId: null,
-      cacheKeyUrl: 'abfad404-technology-production',
-      controlListNewList: [], //给公共组件使用
-      workCenterList:[], //工作中心列表
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 260,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            showOverflowTooltip: true
+          }
+        ],
+        // 表格选中数据
+        selection: [],
+        // 当前编辑数据
+        current: null,
+        // 是否显示编辑弹窗
+        showEdit: false,
+        // 是否显示参数弹窗
+        showSetting: false,
+        controlList: [],
 
-    };
-  },
-  computed: {
-    seekList() {
-      return [
-        {
-          label: "工序编码:",
-          value: "code",
-          type: "input",
-          placeholder: '',
-        },
-        {
-          label: "工序名称:",
-          value: "name",
-          type: "input",
-          placeholder: '',
-        },
-        {
-          label: "控制码:",
-          value: "controlId",
-          type: "select",
-          placeholder: '',
-          planList: this.controlListNewList
-        },
-        {
-          label: "工序类型:",
-          value: "type",
-          type: "select",
-          placeholder: '',
-          planList: this.typeList
-        },
-        {
-          label: "工作中心:",
-          value: "workCenterId",
-          type: "select",
-          placeholder: '',
-          planList: this.workCenterList
-        },
-      ]
-    }
-  },
-  created() {
-    this.getControlList()
-    this.getListWorkCenter()
-  },
-  methods: {
+        typeList: [
+          {
+            value: 1,
+            label: '普通工序'
+          },
+          // {
+          //   value: 2,
+          //   label: '抽样质检'
+          // },
 
-    typeLabel(type) {
-      return this.typeList.find(m => m.value == type) && this.typeList.find(m => m.value == type).label
-    },
+          {
+            value: 3,
+            label: '抽样质检'
+          },
+          {
+            value: 4,
+            label: '包装工序'
+          },
+          {
+            value: 6,
+            label: '质检工序'
+          },
+          {
+            value: 7,
+            label: '生产准备'
+          }
+        ],
 
-    /*配置工艺参数 */
-    openSetting(row) {
-      this.current = row;
-      this.showSetting = true;
-    },
-    /* 表格数据源 */
-    async datasource({ page, limit, where, order }) {
-      const res = await producetask.list({
-        ...where,
-        ...order,
-        pageNum: page,
-        size: limit
-      });
-      return res;
+        sampleShow: false,
+        taskId: null,
+        cacheKeyUrl: 'abfad404-technology-production',
+        controlListNewList: [], //给公共组件使用
+        workCenterList: [] //工作中心列表
+      };
     },
-
-    /* 刷新表格 */
-    reload(where) {
-      this.$refs.table.reload({ page: 1, where: where });
+    computed: {
+      seekList() {
+        return [
+          {
+            label: '工序编码:',
+            value: 'code',
+            type: 'input',
+            placeholder: ''
+          },
+          {
+            label: '工序名称:',
+            value: 'name',
+            type: 'input',
+            placeholder: ''
+          },
+          {
+            label: '控制码:',
+            value: 'controlId',
+            type: 'select',
+            placeholder: '',
+            planList: this.controlListNewList
+          },
+          {
+            label: '工序类型:',
+            value: 'type',
+            type: 'select',
+            placeholder: '',
+            planList: this.typeList
+          },
+          {
+            label: '工作中心:',
+            value: 'workCenterId',
+            type: 'select',
+            placeholder: '',
+            planList: this.workCenterList
+          }
+        ];
+      }
     },
-    /* 打开编辑弹窗 */
-    openEdit(row) {
-      this.getControlList()
-      this.current = row;
-      this.showEdit = true;
-      this.$refs.userEdit.$refs.form &&
-        this.$refs.userEdit.$refs.form.clearValidate();
+    created() {
+      this.getControlList();
+      this.getListWorkCenter();
     },
+    methods: {
+      typeLabel(type) {
+        return (
+          this.typeList.find((m) => m.value == type) &&
+          this.typeList.find((m) => m.value == type).label
+        );
+      },
 
-    getControlList() {
-      const params = {
-        pageNum: 1, size: -1
-      }
-      control.list().then(res => {
-        this.controlList = res.list;
-        this.controlListNewList = res.list.map(m => ({ label: m.name, value: m.id }));
-      })
-    },
+      /*配置工艺参数 */
+      openSetting(row) {
+        this.current = row;
+        this.showSetting = true;
+      },
+      /* 表格数据源 */
+      async datasource({ page, limit, where, order }) {
+        const res = await producetask.list({
+          ...where,
+          ...order,
+          pageNum: page,
+          size: limit
+        });
+        return res;
+      },
 
-    /* 删除 */
-    remove(row) {
-      const loading = this.$loading({ lock: true });
+      /* 刷新表格 */
+      reload(where) {
+        this.$refs.table.reload({ page: 1, where: where });
+      },
+      /* 打开编辑弹窗 */
+      openEdit(row) {
+        this.getControlList();
+        this.current = row;
+        this.showEdit = true;
+        this.$refs.userEdit.$refs.form &&
+          this.$refs.userEdit.$refs.form.clearValidate();
+      },
 
-      producetask
-        .delete([row.id])
-        .then((msg) => {
-          loading.close();
-          this.$message.success('删除' + msg);
-          this.reload();
-        })
-        .catch((e) => {
-          loading.close();
-          // this.$message.error(e.message);
+      getControlList() {
+        const params = {
+          pageNum: 1,
+          size: -1
+        };
+        control.list().then((res) => {
+          this.controlList = res.list;
+          this.controlListNewList = res.list.map((m) => ({
+            label: m.name,
+            value: m.id
+          }));
         });
-    },
-    /* 批量删除 */
-    removeBatch() {
-      if (!this.selection.length) {
-        this.$message.error('请至少选择一条数据');
-        return;
-      }
-      this.$confirm('确定要删除选中的工序吗?', '提示', {
-        type: 'warning'
-      })
-        .then(() => {
-          const loading = this.$loading({ lock: true });
-          producetask
-            .delete(this.selection.map((d) => d.id))
-            .then((msg) => {
-              loading.close();
-              this.$message.success('删除' + msg);
-              this.reload();
-            })
-            .catch((e) => {
-              loading.close();
-              // this.$message.error(e.message);
-            });
+      },
+
+      /* 删除 */
+      remove(row) {
+        const loading = this.$loading({ lock: true });
+
+        producetask
+          .delete([row.id])
+          .then((msg) => {
+            loading.close();
+            this.$message.success('删除' + msg);
+            this.reload();
+          })
+          .catch((e) => {
+            loading.close();
+            // this.$message.error(e.message);
+          });
+      },
+      /* 批量删除 */
+      removeBatch() {
+        if (!this.selection.length) {
+          this.$message.error('请至少选择一条数据');
+          return;
+        }
+        this.$confirm('确定要删除选中的工序吗?', '提示', {
+          type: 'warning'
         })
-        .catch(() => { });
-    },
+          .then(() => {
+            const loading = this.$loading({ lock: true });
+            producetask
+              .delete(this.selection.map((d) => d.id))
+              .then((msg) => {
+                loading.close();
+                this.$message.success('删除' + msg);
+                this.reload();
+              })
+              .catch((e) => {
+                loading.close();
+                // this.$message.error(e.message);
+              });
+          })
+          .catch(() => {});
+      },
 
-    sampleParam(row) {
-      this.taskId = row.id
-      this.sampleShow = true
-    },
+      sampleParam(row) {
+        this.taskId = row.id;
+        this.sampleShow = true;
+      },
 
-    close(done) {
-        this.sampleShow = false
-    },
-    uploadFile () {
-      this.$refs.importDialogRef.open();
-    },
+      close(done) {
+        this.sampleShow = false;
+      },
+      uploadFile() {
+        this.$refs.importDialogRef.open();
+      },
 
-    // 获取工作中心
-    getListWorkCenter() {
+      // 获取工作中心
+      getListWorkCenter() {
         work.list({ pageNum: 1, size: -1 }).then((res) => {
-          this.workCenterList = res.list.map((m) => ({ label: m.name, value: m.id }));
+          this.workCenterList = res.list.map((m) => ({
+            label: m.name,
+            value: m.id
+          }));
         });
-      },
-  }
-};
+      }
+    }
+  };
 </script>

+ 3 - 7
src/views/technology/stepManagement/index.vue

@@ -33,7 +33,6 @@
             class="ele-btn-icon"
             @click="removeBatch"
             v-if="$hasPermission('main:categoryparam:delete')"
-
             plain
           >
             删除
@@ -56,7 +55,6 @@
             class="ele-btn-icon"
             plain
             v-if="$hasPermission('main:stepManagement:update')"
-
             @click="uploadFile()"
           >
             导入
@@ -90,7 +88,6 @@
             icon="el-icon-edit"
             @click="openEdit(row)"
             v-if="$hasPermission('main:stepManagement:update')"
-
           >
             修改
           </el-link>
@@ -108,7 +105,6 @@
             title="确定要删除当前工步吗?"
             @confirm="remove(row)"
             v-if="$hasPermission('main:stepManagement:delete')"
-
           >
             <template v-slot:reference>
               <el-link type="danger" :underline="false" icon="el-icon-delete">
@@ -136,9 +132,9 @@
     ></SampleParam>
 
     <importDialog
-      :defModule="moduleName"
       ref="importDialogRef"
-      :fileUrl="'/main/producestep/downLoadTemplate'"
+      apiUrl="/main/producestep/importExcel"
+      fileUrl="/main/producestep/downLoadTemplate"
       fileName="工艺_工步导入模板"
       @success="reload"
     />
@@ -153,7 +149,7 @@
   import SampleParam from './components/sampleParam.vue';
   import stepManagement from '@/api/technology/stepManagement';
   import control from '@/api/technology/control';
-  import importDialog from '@/components/upload/import-dialogNew.vue';
+  import importDialog from '@/components/upload/comm-dialog.vue';
 
   export default {
     name: 'technologyProduction',

+ 26 - 13
src/views/technology/work/components/user-edit.vue

@@ -15,11 +15,7 @@
       <el-row>
         <el-col :span="8">
           <el-form-item label="工作中心编码:" prop="code">
-            <el-input
-              clearable
-              v-model="form.code"
-              placeholder="请输入"
-            />
+            <el-input clearable v-model="form.code" placeholder="请输入" />
           </el-form-item>
         </el-col>
 
@@ -31,7 +27,11 @@
 
         <el-col :span="8">
           <el-form-item label="所属工厂:" prop="factoryId">
-            <el-select v-model="form.factoryId" filterable placeholder="所属工厂">
+            <el-select
+              v-model="form.factoryId"
+              filterable
+              placeholder="所属工厂"
+            >
               <el-option
                 v-for="item in flist"
                 :key="item.id"
@@ -44,7 +44,11 @@
         </el-col>
         <el-col :span="8">
           <el-form-item label="工作中心类别:" prop="categoryType">
-            <el-select v-model="form.categoryType" filterable placeholder="工作中心类别">
+            <el-select
+              v-model="form.categoryType"
+              filterable
+              placeholder="工作中心类别"
+            >
               <el-option
                 v-for="item in categoryTypes"
                 :key="item.code"
@@ -57,7 +61,11 @@
         </el-col>
         <el-col :span="8">
           <el-form-item label="负责人:" prop="leaderUserId">
-            <el-select v-model="form.leaderUserId" filterable placeholder="负责人">
+            <el-select
+              v-model="form.leaderUserId"
+              filterable
+              placeholder="负责人"
+            >
               <el-option
                 v-for="item in userList"
                 :key="item.id"
@@ -123,7 +131,9 @@
           name: [
             { required: true, message: '请输入工序名称', trigger: 'blur' }
           ],
-          code: [{ required: true, message: '工作中心编码', trigger: 'change' }],
+          code: [
+            { required: true, message: '工作中心编码', trigger: 'change' }
+          ],
           factoryId: [
             { required: true, message: '请选择所属工厂', trigger: 'blur' }
           ],
@@ -161,7 +171,7 @@
           let title = this.isUpdate ? '修改' : '保存';
           saveOrUpdate(this.form)
             .then((msg) => {
-              console.log(999,msg)
+              console.log(999, msg);
               this.form = {};
               this.loading = false;
               this.$message.success(title + msg);
@@ -184,12 +194,15 @@
       async visible(visible) {
         if (visible) {
           if (this.data) {
-          
-
             // const res = await work.getById(this.data.id);
 
             this.$util.assignObject(this.form, this.data);
-            this.isUpdate = true;
+            if (this.data.type == 'edit') {
+              this.isUpdate = true;
+            } else {
+              this.isUpdate = false;
+              this.form.code=''
+            }
           } else {
             this.isUpdate = false;
           }

+ 29 - 16
src/views/technology/work/index.vue

@@ -39,7 +39,7 @@
         <template v-slot:categoryType="{ row }">
           {{ checkcategoryType(row.categoryType) }}
         </template>
-<!--        <template v-slot:leaderUserId="{ row }">
+        <!--        <template v-slot:leaderUserId="{ row }">
           {{ checkleaderUserId(row.leaderUserId) }}
         </template> -->
         <!-- 状态列 -->
@@ -50,7 +50,16 @@
             type="primary"
             :underline="false"
             icon="el-icon-edit"
-            @click="openEdit(row)"
+            @click="openEdit(row,'copy')"
+            v-if="$hasPermission('main:workcenter:save')"
+          >
+            复制
+          </el-link>
+          <el-link
+            type="primary"
+            :underline="false"
+            icon="el-icon-edit"
+            @click="openEdit(row,'edit')"
             v-if="$hasPermission('main:workcenter:update')"
           >
             修改
@@ -94,12 +103,12 @@
 
   export default {
     name: 'technologyWork',
-    mixins:[tabMixins],
+    mixins: [tabMixins],
     components: {
       UserSearch,
       UserEdit
     },
-    data () {
+    data() {
       return {
         // 表格列配置
         columns: [
@@ -178,33 +187,33 @@
         cacheKeyUrl: '439a8ef9-technology-work'
       };
     },
-    created () {
+    created() {
       this.getfLise();
       this.getUserPage();
     },
     methods: {
       /*回显工厂 */
-      checkfactoryId (id) {
+      checkfactoryId(id) {
         let obj = this.fList.find((f) => f.id == id);
         return obj?.name;
       },
       /*回显类别 */
-      checkcategoryType (value) {
+      checkcategoryType(value) {
         return this.categoryTypes.find((f) => f.value == value).label;
       },
       /*回显负责人 */
-      checkleaderUserId (id) {
+      checkleaderUserId(id) {
         let obj = this.userList.find((f) => f.id == id);
         return obj?.name;
       },
       /*人员列表 */
-      async getUserPage () {
+      async getUserPage() {
         const res = await work.getUserPage();
         this.userList = res.list;
       },
       /*厂房列表 */
 
-      async getfLise () {
+      async getfLise() {
         const res = await route.Flist({
           pageNum: 1,
           size: -1,
@@ -213,7 +222,7 @@
         this.fList = res.list;
       },
       /* 表格数据源 */
-      async datasource ({ page, limit, where, order }) {
+      async datasource({ page, limit, where, order }) {
         const res = await work.list({
           ...where,
           ...order,
@@ -224,22 +233,26 @@
       },
 
       /* 刷新表格 */
-      reload (where) {
+      reload(where) {
         this.$refs.table.reload({ page: 1, where: where });
       },
       /* 打开编辑弹窗 */
-      openEdit (row) {
+      openEdit(row,type) {
         this.current = row;
+        if(this.current){
+          this.current.type=type
+        }
+       
         this.showEdit = true;
         this.$refs.userEdit.$refs.form &&
           this.$refs.userEdit.$refs.form.clearValidate();
       },
       /* 打开导入弹窗 */
-      openImport () {
+      openImport() {
         this.showImport = true;
       },
       /* 删除 */
-      remove (row) {
+      remove(row) {
         // const loading = this.$loading({ lock: true });
         this.loading = true;
 
@@ -257,7 +270,7 @@
           });
       },
       /* 批量删除 */
-      removeBatch () {
+      removeBatch() {
         if (!this.selection.length) {
           this.$message.error('请至少选择一条数据');
           return;

+ 4 - 2
src/views/versionManage/index.vue

@@ -21,6 +21,7 @@
             icon="el-icon-plus"
             class="ele-btn-icon"
             @click="openEdit('','add')"
+            v-if="$hasPermission('main:version:save')"
           >
             新建
           </el-button>
@@ -29,6 +30,7 @@
             type="danger"
             icon="el-icon-delete"
             class="ele-btn-icon"
+            v-if="$hasPermission('main:version:delete')"
             @click="removeBatch"
             plain
           >
@@ -57,7 +59,7 @@
         <!-- 操作列 -->
         <template v-slot:action="{ row }">
           <el-link
-            v-if="row.status!=1"
+            v-if="row.status!=1&&$hasPermission('main:version:update')"
             type="primary"
             :underline="false"
             icon="el-icon-edit"
@@ -74,7 +76,7 @@
             详情
           </el-link>
           <el-popconfirm
-            v-if="row.status!=1"
+            v-if="row.status!=1&&$hasPermission('main:version:delete')"
             class="ele-action"
             title="确定要删除当前资质吗?"
             @confirm="remove(row)"

+ 24 - 24
src/views/workforceManagement/team/components/edit.vue

@@ -23,6 +23,7 @@
                 :maxlength="20"
                 v-model="form.code"
                 placeholder="请输入"
+                :disabled="type=='edit'"
               />
             </el-form-item>
           </el-col>
@@ -123,8 +124,6 @@
                   clearable
                   filterable
                   placeholder="请选择"
-        
-
                 >
                   <el-option
                     v-for="item in options.workCenterList"
@@ -177,7 +176,11 @@
         header="员工配置"
         body-style="padding: 22px 22px 0 22px;"
       >
-        <userTable ref="userTable" @deleteIds="deleteIds"></userTable>
+        <userTable
+          ref="userTable"
+          @deleteIds="deleteIds"
+          :factoryId="form.factoryId"
+        ></userTable>
       </el-card>
     </el-form>
     <template v-slot:footer>
@@ -192,7 +195,6 @@
 <script>
   import {
     listWorkshopByParentId,
-    listFactoryLine,
     saveteam,
     updateteam,
     listFactoryLineByFactoryId
@@ -201,6 +203,7 @@
   import work from '@/api/technology/work';
   import userTable from './userTable.vue';
   import { getFactoryarea } from '@/api/factoryModel';
+  import { getCode } from '@/api/codeManagement/index.js';
   export default {
     components: {
       userTable
@@ -221,6 +224,7 @@
           // workshopId: [],
           factoryId: '',
           produceVersionId: '',
+          produceVersionName: '',
           status: 1
         };
       };
@@ -244,12 +248,7 @@
           factoryId: [
             { required: true, message: '请选择所属工厂', trigger: 'change' }
           ],
-          // workshopPlanId: [
-          //   { required: true, message: '请选择', trigger: 'change' }
-          // ],
-          // workshopId: [
-          //   { required: true, message: '请输入', trigger: 'change' }
-          // ],
+
           productionLineId: [
             { required: true, message: '请输入', trigger: 'change' }
           ],
@@ -294,18 +293,17 @@
         this.visible = true;
         this.deleteUserIds = [];
 
-        if (type == 'edit') {
+        if (type == 'edit' || type == 'copy') {
           for (const key of Object.keys(this.form)) {
             if (row[key]) {
               this.form[key] = row[key];
             }
 
-           this.form.workCenterId =this.form.workCenterIds[0];
+            this.form.workCenterId = this.form.workCenterIds[0];
           }
 
           // 人员反显
           this.$nextTick(() => {
-
             console.log('row', row);
             if (row.userVOList) {
               this.$refs.userTable.confirmStaffSelection(
@@ -322,6 +320,9 @@
           await this.getlistFactoryLineByParentId();
           await this.getlistByProductionLineId();
         }
+        if (type != 'edit') {
+          this.form.code = await getCode('main_team_code');
+        }
         this.getVersionList();
       },
       deleteIds(ids) {
@@ -336,23 +337,22 @@
           this.loading = true;
           let userIds = this.$refs.userTable.datasource.map((n) => n.id);
 
-          if (userIds.length <= 0) {
-            this.$message.error('请选择员工');
-            this.loading = false;
-            return false;
-          }
+          // if (userIds.length <= 0) {
+          //   this.$message.error('请选择员工');
+          //   this.loading = false;
+          //   return false;
+          // }
 
           let par = this.form;
           par.userIds = userIds;
           par.deleteUserIds = this.deleteUserIds;
           par.leaderUserId = this.$refs.userTable.getTwi();
           par.userNumber = par.userIds.length;
-          this.form.workCenterIds =  [ this.form.workCenterId ];
-          if (this.type == 'add') {
+          this.form.workCenterIds = [this.form.workCenterId];
+          if (this.type != 'edit') {
             delete par.id;
-         
           }
-          const saveOrUpdate = this.type == 'add' ? saveteam : updateteam;
+          const saveOrUpdate = this.type != 'edit'? saveteam : updateteam;
           saveOrUpdate(par)
             .then((msg) => {
               this.loading = false;
@@ -401,7 +401,7 @@
 
         // this.getlistCf();
         this.getlistFactoryLineByParentId();
-        this.form.workCenterId = null
+        this.form.workCenterId = null;
         this.form.workCenterIds = [];
         this.options.workCenterList = [];
 
@@ -441,7 +441,7 @@
       //     });
       //   });
       // },
-       // 获取产线
+      // 获取产线
       getlistFactoryLineByParentId() {
         return listFactoryLineByFactoryId([this.form.factoryId]).then((res) => {
           this.options.productionLineId = res.map((n) => {

+ 8 - 1
src/views/workforceManagement/team/components/staffSelection.vue

@@ -193,7 +193,9 @@
       type: {},
       hasAccount:{
         default:0
-      }
+      },
+      factoryId:String,
+   
     },
     created() {},
     methods: {
@@ -241,10 +243,15 @@
           groupId: this.form.groupId,
           name: this.userName
         };
+   
         this.getStaffList(params);
       },
     //获取员工列表
     async getStaffList(params) {
+      console.log(this.factoryId,'factoryId')
+      if(this.factoryId){
+          params['factoryId']=this.factoryId
+        }
       let res = await getUserPage(params);
       let list = res.list;
       if (list.length < res.count) {

+ 8 - 0
src/views/workforceManagement/team/components/userTable.vue

@@ -58,6 +58,7 @@
     <staffSelection
       ref="staffSelection"
       @confirm="confirmStaffSelection"
+      :factoryId="factoryId"
     ></staffSelection>
   </div>
 </template>
@@ -67,6 +68,9 @@
     components: {
       staffSelection
     },
+    props:{
+      factoryId:String
+    },
     data () {
       return {
         columns: [
@@ -143,6 +147,10 @@
       },
 
       handlAdd () {
+        if(!this.factoryId){
+          this.$message.warning('请先选择所属工厂!');  
+          return
+        }
         this.$refs.staffSelection.open(
           JSON.parse(JSON.stringify(this.datasource))
         );

+ 9 - 0
src/views/workforceManagement/team/index.vue

@@ -36,6 +36,15 @@
         </template>
         <!-- 操作列 -->
         <template v-slot:action="{ row }">
+          <el-link
+            type="primary"
+            :underline="false"
+            icon="el-icon-edit"
+            @click="openEdit('copy', row)"
+            v-if="$hasPermission('main:team:save')"
+          >
+            复制
+          </el-link>
           <el-link
             type="primary"
             :underline="false"

Некоторые файлы не были показаны из-за большого количества измененных файлов