Bladeren bron

feat(规则管理): 新增计划配置复制功能,支持巡检点、保养、量具送检和仓库盘点等模块

yusheng 7 maanden geleden
bovenliggende
commit
832818ee74

+ 8 - 1
src/api/recordrules/index.js

@@ -196,7 +196,6 @@ export async function recordrulesPlanConfigSaveOrUpdate(data) {
   return Promise.reject(new Error(res.data.message));
 }
 
-
 // /main/recordrulesplanconfig/getById/{id}
 export async function recordrulesPlanConfigGetById(id) {
   const res = await request.get(`/main/recordrulesplanconfig/getById/${id}`);
@@ -216,3 +215,11 @@ export async function recordrulesPlanConfigDelete(ids) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+// 复制
+export async function mainPlanconfigCopy(id) {
+  const res = await request.get(`/main/recordrulesplanconfig/copy/${id}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 18 - 0
src/api/ruleManagement/plan.js

@@ -157,6 +157,24 @@ export async function getCategoryLevelIdByWarehouseId(params) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+
+// 复制
+export async function planconfigCopy(id) {
+  const res = await request.get(`/eam/planconfig/copy/${id}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+// 仓储复制
+export async function wmsPlanconfigCopy(id) {
+  const res = await request.get(`/wms/planconfig/copy/${id}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
 // // 更新或保存
 // export async function saveOrUpdate (data) {
 //   const res = await request.post('/main/ruleinfo/saveOrEdit', data);

+ 1 - 1
src/views/rulesManagement/components/programRulesDialog.vue

@@ -465,7 +465,7 @@
         ></el-option>
       </el-select>
       <template v-slot:footer>
-        <el-button @click="addDialog = false">取消</el-button>
+        <el-button @click="closeAdd">取消</el-button>
         <el-button type="primary" @click="addRule"> 添加 </el-button>
       </template>
     </ele-modal>

+ 27 - 6
src/views/rulesManagement/inspectionPoint/index.vue

@@ -47,6 +47,15 @@
           >
             修改
           </el-link>
+          <el-link
+            type="primary"
+            :underline="false"
+            icon="el-icon-edit"
+            @click="copy(row)"
+            v-if="$hasPermission('eam:planconfig:update')"
+          >
+            复制
+          </el-link>
           <el-popconfirm
             class="ele-action"
             title="确定要删除此巡检点配置吗?"
@@ -86,7 +95,11 @@
   // import AddPatrolConfigDialog from '@/components/addPatrolConfigDialog';
   import ProgramRulesDialog from '../components/programRulesDialog';
   import PatrolSearch from './components/patrol-search.vue';
-  import { planConfigPage, removeRule } from '@/api/ruleManagement/plan';
+  import {
+    planConfigPage,
+    removeRule,
+    planconfigCopy
+  } from '@/api/ruleManagement/plan';
   import dictMixins from '@/mixins/dictMixins';
   export default {
     props: {
@@ -212,7 +225,7 @@
           {
             columnKey: 'action',
             label: '操作',
-            width: 150,
+            width: 200,
             align: 'center',
             resizable: false,
             slot: 'action',
@@ -248,6 +261,12 @@
         }
         this.reload(where);
       },
+      copy(row) {
+        planconfigCopy(row.id).then((res) => {
+          this.$message.success('复制成功');
+          this.reload();
+        });
+      },
       /* 表格数据源 */
       datasource({ page, limit, where, order }) {
         return planConfigPage({
@@ -272,7 +291,7 @@
         });
       },
 
-      openEdit(type, row) {
+      openEdit(type, row, isCopy) {
         this.isBindPlan = false;
         this.addProgramRulesDialog = true;
         if (row) {
@@ -291,13 +310,15 @@
               : '新增检修配置';
         }
         this.$nextTick(() => {
-          this.$refs.programRulesDialog.init(type, 
+          this.$refs.programRulesDialog.init(
+            type,
             row,
             this.ruleType == 1
               ? '巡点检'
               : this.ruleType == 5
               ? '运行记录'
-              : '检修'
+              : '检修',
+            isCopy
           );
         });
       },
@@ -310,7 +331,7 @@
       },
 
       goDetail({ id }) {
-        console.log(this.ruleType,'this.ruleType')
+        console.log(this.ruleType, 'this.ruleType');
         let url =
           this.ruleType == 7
             ? '/rulesManagement/serviceList/detail?date='

+ 200 - 182
src/views/rulesManagement/maintenance/index.vue

@@ -38,16 +38,23 @@
             icon="el-icon-edit"
             @click="openEdit('edit', row)"
             v-if="$hasPermission('eam:planconfig:update')"
-
           >
             修改
           </el-link>
+          <el-link
+            type="primary"
+            :underline="false"
+            icon="el-icon-edit"
+            @click="copy(row)"
+            v-if="$hasPermission('eam:planconfig:update')"
+          >
+            复制
+          </el-link>
           <el-popconfirm
             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">
@@ -77,196 +84,207 @@
 </template>
 
 <script>
-import tabMixins from '@/mixins/tableColumnsMixin';
+  import tabMixins from '@/mixins/tableColumnsMixin';
 
-// import AddPatrolConfigDialog from '@/components/addPatrolConfigDialog';
-import ProgramRulesDialog from '../components/programRulesDialog';
-import MaintainSearch from './components/maintain-search.vue';
-import { planConfigPage, removeRule } from '@/api/ruleManagement/plan';
-import dictMixins from '@/mixins/dictMixins';
-export default {
-  mixins: [dictMixins, tabMixins],
-  components: {
-    MaintainSearch,
-    // AddPatrolConfigDialog,
-    ProgramRulesDialog
-  },
-  data() {
-    return {
-      addProgramRulesDialog: false,
-      // 表格列配置
-      columns: [
-        {
-          columnKey: 'index',
-          label: '序号',
-          type: 'index',
-          width: 55,
-          align: 'center',
-          showOverflowTooltip: true,
-          fixed: 'left'
-        },
-        {
-          prop: 'code',
-          label: '计划配置单号',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110,
-          slot: 'code'
-        },
-        {
-          prop: 'name',
-          label: '计划配置名称',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          prop: 'groupName',
-          label: '执行部门',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          prop: 'categoryName',
-          label: '设备分类',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          prop: 'ruleName',
-          label: '规则名称',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          prop: 'autoOrder',
-          label: '自动派单',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110,
-          formatter: (_row, _column, cellValue) => {
-            let autoOrder =
-              _row.autoOrder == 1 ? '是' : _row.autoOrder == 0 ? '否' : '-';
-            return autoOrder;
-          }
-        },
-        {//修改此prop名称时,请同步修改columnKey属性和下方selectType方法
-          prop: 'status',
-          label: '状态',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110,
-          formatter: (_row, _column, cellValue) => {
-            return this.getDictValue('规则状态', _row.status);
+  // import AddPatrolConfigDialog from '@/components/addPatrolConfigDialog';
+  import ProgramRulesDialog from '../components/programRulesDialog';
+  import MaintainSearch from './components/maintain-search.vue';
+  import {
+    planConfigPage,
+    removeRule,
+    planconfigCopy
+  } from '@/api/ruleManagement/plan';
+  import dictMixins from '@/mixins/dictMixins';
+  export default {
+    mixins: [dictMixins, tabMixins],
+    components: {
+      MaintainSearch,
+      // AddPatrolConfigDialog,
+      ProgramRulesDialog
+    },
+    data() {
+      return {
+        addProgramRulesDialog: false,
+        // 表格列配置
+        columns: [
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'code',
+            label: '计划配置单号',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            slot: 'code'
+          },
+          {
+            prop: 'name',
+            label: '计划配置名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'groupName',
+            label: '执行部门',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'categoryName',
+            label: '设备分类',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'ruleName',
+            label: '规则名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
           },
-          filters: [
-            { value: 1, text: '生效'},
-            { value: 0, text: '失效'}
-          ],
-          filterMultiple: false,
-          columnKey: 'status'
-        },
-        {
-          prop: 'createUserName',
-          label: '创建人',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          prop: 'createTime',
-          label: '创建时间',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110,
-          formatter: (_row, _column, cellValue) => {
-            return this.$util.toDateString(cellValue);
+          {
+            prop: 'autoOrder',
+            label: '自动派单',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (_row, _column, cellValue) => {
+              let autoOrder =
+                _row.autoOrder == 1 ? '是' : _row.autoOrder == 0 ? '否' : '-';
+              return autoOrder;
+            }
+          },
+          {
+            //修改此prop名称时,请同步修改columnKey属性和下方selectType方法
+            prop: 'status',
+            label: '状态',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (_row, _column, cellValue) => {
+              return this.getDictValue('规则状态', _row.status);
+            },
+            filters: [
+              { value: 1, text: '生效' },
+              { value: 0, text: '失效' }
+            ],
+            filterMultiple: false,
+            columnKey: 'status'
+          },
+          {
+            prop: 'createUserName',
+            label: '创建人',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'createTime',
+            label: '创建时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (_row, _column, cellValue) => {
+              return this.$util.toDateString(cellValue);
+            }
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 200,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            showOverflowTooltip: true
           }
-        },
-        {
-          columnKey: 'action',
-          label: '操作',
-          width: 150,
-          align: 'center',
-          resizable: false,
-          slot: 'action',
-          showOverflowTooltip: true
-        }
-      ],
-      // 加载状态
-      loading: false,
-      pageType: 'add',
-      dialogTitle: '',
-      isBindPlan: false,
-      pageSize: this.$store.state.tablePageSize,
-      cacheKeyUrl: 'c5e8e922-rulesManagement-planRules-anmac'
-    };
-  },
-  computed: {},
-  created() {
-    this.requestDict('规则状态');
-  },
-  methods: {
-    selectType(value) {
-      let where = {}
-      if (value.status.length > 0) {
-        where['status'] = value.status[0]
-      }
-      this.reload(where)
+        ],
+        // 加载状态
+        loading: false,
+        pageType: 'add',
+        dialogTitle: '',
+        isBindPlan: false,
+        pageSize: this.$store.state.tablePageSize,
+        cacheKeyUrl: 'c5e8e922-rulesManagement-planRules-anmac'
+      };
     },
-    /* 表格数据源 */
-    datasource({ page, limit, where, order }) {
-      return planConfigPage({
-        pageNum: page,
-        size: limit,
-        ...where,
-        groupId: where.groupId == null ? '' : where.groupId,
-        categoryLevelId:
-          where.categoryLevelId == null ? '' : where.categoryLevelId,
-        ruleType: 2
-      });
-    },
-
-    /* 刷新表格 */
-    reload(where) {
-      this.addProgramRulesDialog = false;
-      this.$refs.table.reload({ page: 1, where, ruleType: 2 });
+    computed: {},
+    created() {
+      this.requestDict('规则状态');
     },
+    methods: {
+      copy(row) {
+        planconfigCopy(row.id).then((res) => {
+          this.$message.success('复制成功');
+          this.reload();
+        });
+      },
+      selectType(value) {
+        let where = {};
+        if (value.status.length > 0) {
+          where['status'] = value.status[0];
+        }
+        this.reload(where);
+      },
+      /* 表格数据源 */
+      datasource({ page, limit, where, order }) {
+        return planConfigPage({
+          pageNum: page,
+          size: limit,
+          ...where,
+          groupId: where.groupId == null ? '' : where.groupId,
+          categoryLevelId:
+            where.categoryLevelId == null ? '' : where.categoryLevelId,
+          ruleType: 2
+        });
+      },
 
-    openEdit(type,row) {
-      this.isBindPlan = false;
-      this.addProgramRulesDialog = true;
-      if (row) {
-        this.dialogTitle = '编辑保养计划配置';
-      } else {
-        this.dialogTitle = '新增保养计划配置';
-      }
-      this.$nextTick(() => {
-        this.$refs.programRulesDialog.init(type, row, '保养');
-      });
-    },
+      /* 刷新表格 */
+      reload(where) {
+        this.addProgramRulesDialog = false;
+        this.$refs.table.reload({ page: 1, where, ruleType: 2 });
+      },
 
-    goDetail({ id }) {
-      this.$router.push({
-        path: '/rulesManagement/maintenance/detail',
-        query: {
-          id,
-          date: new Date().valueOf()
+      openEdit(type, row) {
+        this.isBindPlan = false;
+        this.addProgramRulesDialog = true;
+        if (row) {
+          this.dialogTitle = '编辑保养计划配置';
+        } else {
+          this.dialogTitle = '新增保养计划配置';
         }
-      });
-    },
+        this.$nextTick(() => {
+          this.$refs.programRulesDialog.init(type, row, '保养');
+        });
+      },
 
-    remove(row) {
-      removeRule([row.id]).then((res) => {
-        this.$message.success('删除成功!');
-        this.reload();
-      });
+      goDetail({ id }) {
+        this.$router.push({
+          path: '/rulesManagement/maintenance/detail',
+          query: {
+            id,
+            date: new Date().valueOf()
+          }
+        });
+      },
+
+      remove(row) {
+        removeRule([row.id]).then((res) => {
+          this.$message.success('删除成功!');
+          this.reload();
+        });
+      }
     }
-  }
-};
+  };
 </script>
 
 <style lang="scss" scoped></style>

+ 200 - 181
src/views/rulesManagement/measuringSubmit/index.vue

@@ -41,12 +41,20 @@
           >
             修改
           </el-link>
+          <el-link
+            type="primary"
+            :underline="false"
+            icon="el-icon-edit"
+            @click="copy(row)"
+            v-if="$hasPermission('eam:planconfig:update')"
+          >
+            复制
+          </el-link>
           <el-popconfirm
             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">
@@ -77,197 +85,208 @@
 </template>
 
 <script>
-import tabMixins from '@/mixins/tableColumnsMixin';
-// import AddPatrolConfigDialog from '@/components/addPatrolConfigDialog';
-import ProgramRulesDialog from '../components/programRulesDialog';
-import PatrolSearch from './components/patrol-search.vue';
-import { planConfigPage, removeRule } from '@/api/ruleManagement/plan';
-import dictMixins from '@/mixins/dictMixins';
-export default {
-  mixins: [dictMixins, tabMixins],
-  components: {
-    PatrolSearch,
-    // AddPatrolConfigDialog,
-    ProgramRulesDialog
-  },
-  data() {
-    return {
-      addProgramRulesDialog: false,
-      // 表格列配置
-      columns: [
-        {
-          columnKey: 'index',
-          label: '序号',
-          type: 'index',
-          width: 55,
-          align: 'center',
-          showOverflowTooltip: true,
-          fixed: 'left'
-        },
-        {
-          prop: 'code',
-          label: '计划配置单号',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110,
-          slot: 'code'
-        },
-        {
-          prop: 'name',
-          label: '计划配置名称',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          prop: 'groupName',
-          label: '量具送检部门',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          prop: 'categoryName',
-          label: '设备分类',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          prop: 'ruleName',
-          label: '规则名称',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          prop: 'autoOrder',
-          label: '自动派单',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110,
-          formatter: (_row, _column, cellValue) => {
-            let autoOrder =
-              _row.autoOrder == 1 ? '是' : _row.autoOrder == 0 ? '否' : '-';
-            return autoOrder;
-          }
-        },
-        {//修改此prop名称时,请同步修改columnKey属性和下方selectType方法
-          prop: 'status',
-          label: '状态',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110,
-          formatter: (_row, _column, cellValue) => {
-            return this.getDictValue('规则状态', _row.status);
+  import tabMixins from '@/mixins/tableColumnsMixin';
+  // import AddPatrolConfigDialog from '@/components/addPatrolConfigDialog';
+  import ProgramRulesDialog from '../components/programRulesDialog';
+  import PatrolSearch from './components/patrol-search.vue';
+  import {
+    planConfigPage,
+    removeRule,
+    planconfigCopy
+  } from '@/api/ruleManagement/plan';
+  import dictMixins from '@/mixins/dictMixins';
+  export default {
+    mixins: [dictMixins, tabMixins],
+    components: {
+      PatrolSearch,
+      // AddPatrolConfigDialog,
+      ProgramRulesDialog
+    },
+    data() {
+      return {
+        addProgramRulesDialog: false,
+        // 表格列配置
+        columns: [
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'code',
+            label: '计划配置单号',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            slot: 'code'
+          },
+          {
+            prop: 'name',
+            label: '计划配置名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'groupName',
+            label: '量具送检部门',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'categoryName',
+            label: '设备分类',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'ruleName',
+            label: '规则名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
           },
-          filters: [
+          {
+            prop: 'autoOrder',
+            label: '自动派单',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (_row, _column, cellValue) => {
+              let autoOrder =
+                _row.autoOrder == 1 ? '是' : _row.autoOrder == 0 ? '否' : '-';
+              return autoOrder;
+            }
+          },
+          {
+            //修改此prop名称时,请同步修改columnKey属性和下方selectType方法
+            prop: 'status',
+            label: '状态',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (_row, _column, cellValue) => {
+              return this.getDictValue('规则状态', _row.status);
+            },
+            filters: [
               { value: 1, text: '生效' },
-              { value: 0, text: '失效' },
+              { value: 0, text: '失效' }
             ],
-          filterMultiple: false,
-          columnKey: 'status'
-        },
-        {
-          prop: 'createUserName',
-          label: '创建人',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          prop: 'createTime',
-          label: '创建时间',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110,
-          formatter: (_row, _column, cellValue) => {
-            return this.$util.toDateString(cellValue);
+            filterMultiple: false,
+            columnKey: 'status'
+          },
+          {
+            prop: 'createUserName',
+            label: '创建人',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'createTime',
+            label: '创建时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (_row, _column, cellValue) => {
+              return this.$util.toDateString(cellValue);
+            }
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 200,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            showOverflowTooltip: true
           }
-        },
-        {
-          columnKey: 'action',
-          label: '操作',
-          width: 150,
-          align: 'center',
-          resizable: false,
-          slot: 'action',
-          showOverflowTooltip: true
-        }
-      ],
-      // 加载状态
-      loading: false,
-      pageType: 'add',
-      dialogTitle: '',
-      isBindPlan: false,
-      pageSize: this.$store.state.tablePageSize,
-      cacheKeyUrl: '4af14a44-rulesManagement-planRules-measuringSubmit'
-    };
-  },
-  computed: {},
-  created() {
-    this.requestDict('规则状态');
-  },
-  methods: {
-    selectType(value) {
-      let where = {}
-      if (value.status.length > 0) {
-        where['status'] = value.status[0]
-      }
-      this.reload(where)
+        ],
+        // 加载状态
+        loading: false,
+        pageType: 'add',
+        dialogTitle: '',
+        isBindPlan: false,
+        pageSize: this.$store.state.tablePageSize,
+        cacheKeyUrl: '4af14a44-rulesManagement-planRules-measuringSubmit'
+      };
     },
-    /* 表格数据源 */
-    datasource({ page, limit, where, order }) {
-      return planConfigPage({
-        pageNum: page,
-        size: limit,
-        ...where,
-        groupId: where.groupId == null ? '' : where.groupId,
-        categoryLevelId:
-          where.categoryLevelId == null ? '' : where.categoryLevelId,
-        ruleType: 4
-      });
+    computed: {},
+    created() {
+      this.requestDict('规则状态');
     },
+    methods: {
+      copy(row) {
+        planconfigCopy(row.id).then((res) => {
+          this.$message.success('复制成功');
+          this.reload();
+        });
+      },
+      selectType(value) {
+        let where = {};
+        if (value.status.length > 0) {
+          where['status'] = value.status[0];
+        }
+        this.reload(where);
+      },
+      /* 表格数据源 */
+      datasource({ page, limit, where, order }) {
+        return planConfigPage({
+          pageNum: page,
+          size: limit,
+          ...where,
+          groupId: where.groupId == null ? '' : where.groupId,
+          categoryLevelId:
+            where.categoryLevelId == null ? '' : where.categoryLevelId,
+          ruleType: 4
+        });
+      },
 
-    /* 刷新表格 */
-    reload(where) {
-      console.log('刷新表格');
-      this.addProgramRulesDialog = false;
-      this.$refs.table.reload({ page: 1, where, ruleType: 1 });
-    },
+      /* 刷新表格 */
+      reload(where) {
+        console.log('刷新表格');
+        this.addProgramRulesDialog = false;
+        this.$refs.table.reload({ page: 1, where, ruleType: 1 });
+      },
 
-    openEdit(type, row) {
-      this.isBindPlan = false;
-      this.addProgramRulesDialog = true;
-      if (row) {
-        this.dialogTitle = '编辑量具送检计划配置';
-      } else {
-        this.dialogTitle = '新增量具送检计划配置';
-      }
-      this.$nextTick(() => {
-        this.$refs.programRulesDialog.init(type, row, '量具送检');
-      });
-    },
+      openEdit(type, row) {
+        this.isBindPlan = false;
+        this.addProgramRulesDialog = true;
+        if (row) {
+          this.dialogTitle = '编辑量具送检计划配置';
+        } else {
+          this.dialogTitle = '新增量具送检计划配置';
+        }
+        this.$nextTick(() => {
+          this.$refs.programRulesDialog.init(type, row, '量具送检');
+        });
+      },
 
-    remove(row) {
-      removeRule([row.id]).then((res) => {
-        this.$message.success('删除成功!');
-        this.reload();
-      });
-    },
+      remove(row) {
+        removeRule([row.id]).then((res) => {
+          this.$message.success('删除成功!');
+          this.reload();
+        });
+      },
 
-    goDetail({ id }) {
-      this.$router.push({
-        path:
-          '/rulesManagement/measuringSubmit/detail?date=' +
-          new Date().valueOf(),
-        query: {
-          id
-        }
-      });
+      goDetail({ id }) {
+        this.$router.push({
+          path:
+            '/rulesManagement/measuringSubmit/detail?date=' +
+            new Date().valueOf(),
+          query: {
+            id
+          }
+        });
+      }
     }
-  }
-};
+  };
 </script>
 
 <style lang="scss" scoped></style>

+ 16 - 1
src/views/rulesManagement/recordPlan/index.vue

@@ -36,6 +36,14 @@
           >
             修改
           </el-link>
+          <el-link
+            type="primary"
+            :underline="false"
+            icon="el-icon-edit"
+            @click="copy(row)"
+          >
+            复制
+          </el-link>
           <el-popconfirm
             class="ele-action"
             title="确定要删除此条数据吗?"
@@ -63,7 +71,8 @@
   import tableColumnsMixin from '@/mixins/tableColumnsMixin';
   import {
     recordrulesPlanConfigPage,
-    recordrulesPlanConfigDelete
+    recordrulesPlanConfigDelete,
+    mainPlanconfigCopy
   } from '@/api/recordrules/index';
   import PatrolSearch from './components/patrol-search.vue';
   import programRulesDialog from './components/programRulesDialog.vue';
@@ -212,6 +221,12 @@
     },
     computed: {},
     methods: {
+      copy(row) {
+        mainPlanconfigCopy(row.id).then((res) => {
+          this.$message.success('复制成功');
+          this.reload();
+        });
+      },
       // 刷新表格
       reload(where = {}) {
         this.$refs.tableRef.reload({

+ 179 - 164
src/views/rulesManagement/warehouseInventory/index.vue

@@ -21,7 +21,6 @@
             class="ele-btn-icon"
             @click="openEdit()"
             v-if="$hasPermission('wms:planconfig:save')"
-
           >
             新建
           </el-button>
@@ -34,10 +33,18 @@
             icon="el-icon-edit"
             @click="openEdit(row)"
             v-if="$hasPermission('wms:planconfig:update')"
-
           >
             修改
           </el-link>
+          <el-link
+            type="primary"
+            :underline="false"
+            icon="el-icon-edit"
+            @click="copy(row)"
+            v-if="$hasPermission('wms:planconfig:update')"
+          >
+            复制
+          </el-link>
           <el-link type="primary" class="ele-btn-icon" @click="goDetail(row)">
             详情
           </el-link>
@@ -46,7 +53,6 @@
             title="确定要删除此角色吗?"
             @confirm="remove(row)"
             v-if="$hasPermission('wms:planconfig:delete')"
-
           >
             <template v-slot:reference>
               <el-link type="danger" :underline="false" icon="el-icon-delete">
@@ -69,172 +75,181 @@
 </template>
 
 <script>
-import tabMixins from '@/mixins/tableColumnsMixin';
+  import tabMixins from '@/mixins/tableColumnsMixin';
 
-import { deleteStocktakingPlan } from '@/api/ruleManagement/plan';
-import { getInventoryList } from '@/api/ruleManagement/plan';
-import InventorySearch from './components/inventory-search.vue';
-import AddInventoryDialog from './components/addInventoryDialog.vue';
-export default {
-  mixins: [tabMixins],
-  components: {
-    InventorySearch,
-    AddInventoryDialog
-  },
-  data() {
-    return {
-      inventoryId: '',
-      // 表格列配置
-      columns: [
-        {
-          columnKey: 'index',
-          label: '序号',
-          type: 'index',
-          width: 55,
-          align: 'center',
-          showOverflowTooltip: true,
-          fixed: 'left'
-        },
-        {
-          prop: 'planCode',
-          label: '计划单号',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          prop: 'planName',
-          label: '盘点名称',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          prop: 'warehouseName',
-          label: '盘点仓库',
-          align: 'center',
-          showOverflowTooltip: true,
-          slot: 'enable',
-          minWidth: 110
-        },
-        {
-          prop: 'executeGroupName',
-          label: '盘点部门',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          prop: 'categoryLevelName',
-          label: '资产分类',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          prop: 'ruleName',
-          label: '规则名称',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          prop: 'autoOrder',
-          label: '自动派单',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110,
-          formatter: (row) => {
-            return { 0: '否', 1: '是' }[row.autoOrder];
-          }
-        },
-        {
-          prop: 'enable',
-          label: '状态',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110,
-          formatter: (row) => {
-            return { 0: '失效', 1: '生效' }[row.enable];
-          }
-        },
-        {
-          prop: 'createUserName',
-          label: '创建人',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          prop: 'createTime',
-          label: '创建时间',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110,
-          formatter: (_row, _column, cellValue) => {
-            return this.$util.toDateString(cellValue);
-          }
-        },
-        {
-          columnKey: 'action',
-          label: '操作',
-          width: 200,
-          align: 'center',
-          resizable: false,
-          slot: 'action',
-          showOverflowTooltip: true
-        }
-      ],
-      // 加载状态
-      loading: false,
-      dialogTitle: '',
-      isBindPlan: false,
-      pageSize: this.$store.state.tablePageSize,
-      cacheKeyUrl: '9971d0ba-rulesManagement-planRules-warehouseInventory'
-    };
-  },
-  methods: {
-    // 重置
-    resetForm() {
-      this.$refs.inventorySearch.reset();
-      // this.$refs.configFormRef.resetFields();
-      // this.searchForm()
-    },
-    /* 表格数据源 */
-    datasource({ page, limit, where, order }) {
-      return getInventoryList({ pageNum: page, size: limit, ...where });
+  import { deleteStocktakingPlan } from '@/api/ruleManagement/plan';
+  import {
+    getInventoryList,
+    wmsPlanconfigCopy
+  } from '@/api/ruleManagement/plan';
+  import InventorySearch from './components/inventory-search.vue';
+  import AddInventoryDialog from './components/addInventoryDialog.vue';
+  export default {
+    mixins: [tabMixins],
+    components: {
+      InventorySearch,
+      AddInventoryDialog
     },
-    /* 刷新表格 */
-    reload(where) {
-      this.$refs.table.reload({ page: 1, where });
+    data() {
+      return {
+        inventoryId: '',
+        // 表格列配置
+        columns: [
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'planCode',
+            label: '计划单号',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'planName',
+            label: '盘点名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'warehouseName',
+            label: '盘点仓库',
+            align: 'center',
+            showOverflowTooltip: true,
+            slot: 'enable',
+            minWidth: 110
+          },
+          {
+            prop: 'executeGroupName',
+            label: '盘点部门',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'categoryLevelName',
+            label: '资产分类',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'ruleName',
+            label: '规则名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'autoOrder',
+            label: '自动派单',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (row) => {
+              return { 0: '否', 1: '是' }[row.autoOrder];
+            }
+          },
+          {
+            prop: 'enable',
+            label: '状态',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (row) => {
+              return { 0: '失效', 1: '生效' }[row.enable];
+            }
+          },
+          {
+            prop: 'createUserName',
+            label: '创建人',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'createTime',
+            label: '创建时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (_row, _column, cellValue) => {
+              return this.$util.toDateString(cellValue);
+            }
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 260,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            showOverflowTooltip: true
+          }
+        ],
+        // 加载状态
+        loading: false,
+        dialogTitle: '',
+        isBindPlan: false,
+        pageSize: this.$store.state.tablePageSize,
+        cacheKeyUrl: '9971d0ba-rulesManagement-planRules-warehouseInventory'
+      };
     },
-    remove(row) {
-      deleteStocktakingPlan([row.id]).then((res) => {
-        console.log(res);
-        if (res.code == 0) {
-          this.$message.success('删除成功');
-          this.$refs.inventorySearch.reset();
+    methods: {
+      copy(row) {
+        wmsPlanconfigCopy(row.id).then((res) => {
+          this.$message.success('复制成功');
+          this.reload();
+        });
+      },
+      // 重置
+      resetForm() {
+        this.$refs.inventorySearch.reset();
+        // this.$refs.configFormRef.resetFields();
+        // this.searchForm()
+      },
+      /* 表格数据源 */
+      datasource({ page, limit, where, order }) {
+        return getInventoryList({ pageNum: page, size: limit, ...where });
+      },
+      /* 刷新表格 */
+      reload(where) {
+        this.$refs.table.reload({ page: 1, where });
+      },
+      remove(row) {
+        deleteStocktakingPlan([row.id]).then((res) => {
+          console.log(res);
+          if (res.code == 0) {
+            this.$message.success('删除成功');
+            this.$refs.inventorySearch.reset();
+          }
+        });
+      },
+      openEdit(row) {
+        if (row) {
+          this.dialogTitle = '修改盘点计划配置';
+          this.inventoryId = row.id;
+        } else {
+          this.dialogTitle = '新增盘点计划配置';
+          this.inventoryId = '';
         }
-      });
-    },
-    openEdit(row) {
-      if (row) {
-        this.dialogTitle = '修改盘点计划配置';
+        this.isBindPlan = false;
+        this.$refs.addInventoryDialogRef.dialogVisible = true;
+        // this.$store.dispatch('planRules/setAddOrUpdate', 'add')
+      },
+      goDetail(row) {
+        this.dialogTitle = '盘点计划配置详情';
         this.inventoryId = row.id;
-      } else {
-        this.dialogTitle = '新增盘点计划配置';
-        this.inventoryId = '';
+        this.isBindPlan = true;
+        this.$refs.addInventoryDialogRef.dialogVisible = true;
       }
-      this.isBindPlan = false;
-      this.$refs.addInventoryDialogRef.dialogVisible = true;
-      // this.$store.dispatch('planRules/setAddOrUpdate', 'add')
-    },
-    goDetail(row) {
-      this.dialogTitle = '盘点计划配置详情';
-      this.inventoryId = row.id;
-      this.isBindPlan = true;
-      this.$refs.addInventoryDialogRef.dialogVisible = true;
     }
-  }
-};
+  };
 </script>