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

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

liujt 8 месяцев назад
Родитель
Сommit
cdbe484b08
28 измененных файлов с 2176 добавлено и 1720 удалено
  1. 8 0
      src/api/qmsreporttemplate/index.js
  2. 8 1
      src/api/recordrules/index.js
  3. 18 0
      src/api/ruleManagement/plan.js
  4. 4 1
      src/enum/dict.js
  5. 4 1
      src/views/material/BOMmanage/components/detailedList.vue
  6. 51 26
      src/views/material/BOMmanage/components/routing.vue
  7. 12 2
      src/views/material/BOMmanage/components/workingProcedure.vue
  8. 1 2
      src/views/material/BOMmanage/qualityTesting/term.vue
  9. 1105 917
      src/views/rulesManagement/components/programRulesDialog.vue
  10. 27 6
      src/views/rulesManagement/inspectionPoint/index.vue
  11. 9 4
      src/views/rulesManagement/inspectionReportTemplate/components/edit.vue
  12. 44 74
      src/views/rulesManagement/inspectionReportTemplate/components/preview.vue
  13. 76 9
      src/views/rulesManagement/inspectionReportTemplate/index.vue
  14. 200 182
      src/views/rulesManagement/maintenance/index.vue
  15. 200 181
      src/views/rulesManagement/measuringSubmit/index.vue
  16. 16 1
      src/views/rulesManagement/recordPlan/index.vue
  17. 4 4
      src/views/rulesManagement/releaseRules/components/editTypeModal.vue
  18. 17 1
      src/views/rulesManagement/releaseRules/components/experimentationProcess.vue
  19. 20 34
      src/views/rulesManagement/releaseRules/components/permitAdd.vue
  20. 63 53
      src/views/rulesManagement/releaseRules/components/templateDiv/customTable.vue
  21. 15 7
      src/views/rulesManagement/releaseRules/components/templateDiv/customText.vue
  22. 37 17
      src/views/rulesManagement/releaseRules/index.vue
  23. 179 164
      src/views/rulesManagement/warehouseInventory/index.vue
  24. 18 19
      src/views/system/organization/components/org-user-edit.vue
  25. 16 8
      src/views/system/organization/components/org-user-list.vue
  26. 14 2
      src/views/system/organization/components/org-user-search.vue
  27. 8 2
      src/views/system/role/components/role-edit.vue
  28. 2 2
      vue.config.js

+ 8 - 0
src/api/qmsreporttemplate/index.js

@@ -59,3 +59,11 @@ export async function updateQmsReportTemplate(data) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+// /main/qmsreporttemplate/update 报表模板变更 put
+export async function changeQmsReportTemplate(data) {
+  const res = await request.put(`/main/qmsreporttemplate/change`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 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);

+ 4 - 1
src/enum/dict.js

@@ -83,7 +83,10 @@ export default {
   业务类型: 'business_type',
   行业类别: 'industry_type',
   记录表模板样式: 'record_template_style',
-  放行类型: 'checklist_type'
+  放行类型: 'checklist_type',
+  实验报工类型: 'experiment_rules_report_work_type',
+  实验规则类型: 'experiment_sheet',
+  实验模板样式: 'experiment_template_style'
 };
 
 export const numberList = [

+ 4 - 1
src/views/material/BOMmanage/components/detailedList.vue

@@ -693,8 +693,11 @@
             newVal.slice(firstDotIndex + 1).replace(/\./g, '');
         }
 
+        const match = newVal.match(/^(\d+)(\.\d{0,4})?/);
+        item.dosage = match ? match[0] : '';
+
         // 4. 更新数据
-        item.dosage = newVal;
+        // item.dosage = newVal;
       },
 
       factoriesFn(code) {

+ 51 - 26
src/views/material/BOMmanage/components/routing.vue

@@ -383,34 +383,59 @@
           pageNum: page,
           size: limit
         });
-        if (data?.length > 0) {
-          this.tableData = data[0];
-          const isCreateBom = sessionStorage.getItem('isCreateBom');
-          if (
-            (this.attributeData.approvalStatus == 0 ||
-              this.attributeData.approvalStatus == 3) &&
-            (Object.keys(this.tableData.processRoute).length == 0 ||
-              this.tableData.processRoute.list.length == 0) &&
-            isCreateBom == '2' &&
-            !this.isWt &&
-            this.isCategory
-          ) {
-            if (this.tableData.routingIdList.length != 0) {
-              // this.selected(this.tableData.routingIdList);
-              this.getAllRouteList();
-            }
+        const record = data[0];
+        record.processRoute = record.processRoute || {};
+        record.processRoute.list = Array.isArray(record.processRoute.list)
+          ? record.processRoute.list
+          : [];
+
+        this.tableData = record;
+
+        const isCreateBom = sessionStorage.getItem('isCreateBom');
+
+        if (
+          (this.attributeData.approvalStatus == 0 ||
+            this.attributeData.approvalStatus == 3) &&
+          record.processRoute.list.length === 0 &&
+          isCreateBom == '2' &&
+          !this.isWt &&
+          this.isCategory
+        ) {
+          if (record.routingIdList && record.routingIdList.length) {
+            this.getAllRouteList();
           }
-          // console.log(this.tableData, 'tableData');
-          // console.log(data[0].processRoute.list, 'data[0].processRoute.list');
-          data[0].processRoute.list.forEach((item) => {
-            item.fileParam = item.fileParam ? item.fileParam : [];
-          });
-
-          return data[0].processRoute.list || [];
-        } else {
-          this.tableData = {};
-          return [];
         }
+
+        record.processRoute.list.forEach((item) => {
+          item.fileParam = item.fileParam || [];
+        });
+
+        return record.processRoute.list;
+        // if (data?.length > 0) {
+        //   this.tableData = data[0];
+        //   const isCreateBom = sessionStorage.getItem('isCreateBom');
+        //   if (
+        //     (this.attributeData.approvalStatus == 0 ||
+        //       this.attributeData.approvalStatus == 3) &&
+        //     (Object.keys(this.tableData.processRoute).length == 0 ||
+        //       this.tableData.processRoute.list.length == 0) &&
+        //     isCreateBom == '2' &&
+        //     !this.isWt &&
+        //     this.isCategory
+        //   ) {
+        //     if (this.tableData.routingIdList.length != 0) {
+        //       this.getAllRouteList();
+        //     }
+        //   }
+        //   data[0].processRoute.list.forEach((item) => {
+        //     item.fileParam = item.fileParam ? item.fileParam : [];
+        //   });
+
+        //   return data[0].processRoute.list || [];
+        // } else {
+        //   this.tableData = {};
+        //   return [];
+        // }
       },
 
       fileBtn(item, index) {

+ 12 - 2
src/views/material/BOMmanage/components/workingProcedure.vue

@@ -1186,7 +1186,6 @@
             prop: 'storagePath',
             label: '文件名称',
             align: 'center',
-
             showOverflowTooltip: true,
             minWidth: 200,
             formatter: (_row, _column, cellValue) => {
@@ -1432,8 +1431,11 @@
             newVal.slice(firstDotIndex + 1).replace(/\./g, '');
         }
 
+        const match = newVal.match(/^(\d+)(\.\d{0,4})?/);
+        item.count = match ? match[0] : '';
+
         // 4. 更新数据
-        item.count = newVal;
+        // item.count = newVal;
       },
 
       async detailsList() {
@@ -1577,7 +1579,15 @@
         }
 
         this.tableData.taskParam[this.currentIndex][type].splice(index, 1);
+
+        if (type == 'fileParam') {
+          const data = this.$refs.fileTable.getData();
+          const id = row.id ? row.id : row;
+          const newData = data.filter((item) => item.id != id);
+          this.$refs.fileTable.setData(newData);
+        }
       },
+
       addProductList(list) {
         let subCode = 0;
         let array = [];

+ 1 - 2
src/views/material/BOMmanage/qualityTesting/term.vue

@@ -240,8 +240,7 @@
             fixed: 'right'
           }
         ],
-        tableHeight: 'calc(100vh - 500px)',
-        isQualityInspection: true
+        tableHeight: 'calc(100vh - 500px)'
       };
     },
 

+ 1105 - 917
src/views/rulesManagement/components/programRulesDialog.vue

@@ -1,24 +1,52 @@
 <template>
-  <ele-modal width="80%" :visible="visible" v-if="visible" :append-to-body="true" custom-class="ele-dialog-form"
-    :title="dialogTitle" @update:visible="updateVisible" :maxable="true">
+  <ele-modal
+    width="80%"
+    :visible="visible"
+    v-if="visible"
+    :append-to-body="true"
+    custom-class="ele-dialog-form"
+    :title="dialogTitle"
+    @update:visible="updateVisible"
+    :maxable="true"
+  >
     <header-title title="基本信息"></header-title>
-    <el-form ref="addFormRef" :model="addForm" :rules="addFormRules" label-width="120px">
+    <el-form
+      ref="addFormRef"
+      :model="addForm"
+      :rules="addFormRules"
+      label-width="120px"
+    >
       <el-row>
         <el-col :span="8">
           <el-form-item label="计划配置单号" prop="code">
-            <el-input v-model="addForm.code" size="small" placeholder="自动带出" disabled></el-input>
+            <el-input
+              v-model="addForm.code"
+              size="small"
+              placeholder="自动带出"
+              disabled
+            ></el-input>
           </el-form-item>
         </el-col>
 
         <el-col :span="8">
           <el-form-item label="计划配置名称" prop="name">
-            <el-input v-model="addForm.name" size="small" placeholder="请输入" :disabled="isBindPlan"></el-input>
+            <el-input
+              v-model="addForm.name"
+              size="small"
+              placeholder="请输入"
+              :disabled="isBindPlan"
+            ></el-input>
           </el-form-item>
         </el-col>
 
         <el-col :span="8">
           <el-form-item label="自动派单" prop="autoOrder">
-            <el-select v-model="addForm.autoOrder" size="small" style="width: 100%" :disabled="isBindPlan">
+            <el-select
+              v-model="addForm.autoOrder"
+              size="small"
+              style="width: 100%"
+              :disabled="isBindPlan"
+            >
               <el-option :value="1" label="是"></el-option>
               <el-option :value="0" label="否"></el-option>
             </el-select>
@@ -28,8 +56,14 @@
         <el-col :span="8">
           <el-form-item label="计划完成时长" prop="duration">
             <div style="display: flex">
-              <el-input type="number" v-model="addForm.duration" size="small" placeholder="请输入" :disabled="isBindPlan"
-                @input="formDataDurationTime">
+              <el-input
+                type="number"
+                v-model="addForm.duration"
+                size="small"
+                placeholder="请输入"
+                :disabled="isBindPlan"
+                @input="formDataDurationTime"
+              >
                 <template #suffix>分钟</template>
               </el-input>
             </div>
@@ -37,20 +71,35 @@
         </el-col>
         <el-col :span="8" v-if="!dialogTitle.includes('量具送检')">
           <el-form-item label="类型" prop="type">
-            <el-select v-model="addForm.type" :disabled="isBindPlan" size="small" @change="typeChange" style="width: 100%">
+            <el-select
+              v-model="addForm.type"
+              :disabled="isBindPlan"
+              size="small"
+              @change="typeChange"
+              style="width: 100%"
+            >
               <el-option :value="1" label="班组"></el-option>
               <el-option :value="0" label="个人"></el-option>
             </el-select>
           </el-form-item>
         </el-col>
 
-        <el-col :span="8" v-if="dispatchType && addForm.type == 1 && !dialogTitle.includes('量具送检')">
+        <el-col
+          :span="8"
+          v-if="
+            dispatchType &&
+            addForm.type == 1 &&
+            !dialogTitle.includes('量具送检')
+          "
+        >
           <el-form-item label="班组" prop="teamId">
             <el-select
               v-model="addForm.teamId"
               :disabled="isBindPlan"
               size="small"
               @change="teamChange"
+              :key="'teamId'"
+
               style="width: 100%"
             >
               <el-option
@@ -63,13 +112,30 @@
           </el-form-item>
         </el-col>
 
-        <el-col :span="8" v-if="dispatchType && addForm.type == 0 && !dialogTitle.includes('量具送检')">
+        <el-col
+          :span="8"
+          v-if="
+            dispatchType &&
+            addForm.type == 0 &&
+            !dialogTitle.includes('量具送检')
+          "
+        >
           <el-form-item label="部门" prop="groupId">
-            <deptSelect v-model="addForm.groupId" @changeGroup="searchDeptNodeClick" :disabled="isBindPlan" />
+            <deptSelect
+              v-model="addForm.groupId"
+              @changeGroup="searchDeptNodeClick"
+              :disabled="isBindPlan"
+            />
           </el-form-item>
         </el-col>
-        <el-col :span="8" v-if="dispatchType && addForm.type == 0 && !dialogTitle.includes('量具送检')
-        ">
+        <el-col
+          :span="8"
+          v-if="
+            dispatchType &&
+            addForm.type == 0 &&
+            !dialogTitle.includes('量具送检')
+          "
+        >
           <!-- <el-form-item label="负责人" prop="executeIdList">
             <el-select v-model="addForm.executeIdList" size="small" style="width: 100%" :disabled="isBindPlan" multiple
               filterable>
@@ -81,6 +147,7 @@
               v-model="addForm.executeIdList"
               :disabled="isBindPlan"
               size="small"
+              :key="'executeIdList'"
               style="width: 100%"
               multiple
               filterable
@@ -97,43 +164,94 @@
         </el-col>
         <el-col :span="8" v-if="!dialogTitle.includes('量具送检')">
           <el-form-item label="审核人" prop="approvalUserId">
-            <el-select v-model="addForm.approvalUserId" size="small" clearable style="width: 100%"
-              :disabled="isBindPlan" filterable>
-              <el-option v-for="item in uerList" :key="item.id" :value="item.id" :label="item.name"></el-option>
+            <el-select
+              v-model="addForm.approvalUserId"
+              size="small"
+              clearable
+              style="width: 100%"
+              :disabled="isBindPlan"
+              filterable
+            >
+              <el-option
+                v-for="item in uerList"
+                :key="item.id"
+                :value="item.id"
+                :label="item.name"
+              ></el-option>
             </el-select>
           </el-form-item>
         </el-col>
         <el-col :span="8">
           <el-form-item label="紧急程度" prop="urgent">
-            <DictSelection dictName="紧急程度" clearable v-model="addForm.urgent" :disabled="isBindPlan">
+            <DictSelection
+              dictName="紧急程度"
+              clearable
+              v-model="addForm.urgent"
+              :disabled="isBindPlan"
+            >
             </DictSelection>
           </el-form-item>
         </el-col>
         <el-col :span="8">
           <el-form-item label="状态" prop="status">
-            <el-switch v-model="addForm.status" active-text="开" inactive-text="关" :active-value="1"
-              :inactive-value="0" />
+            <el-switch
+              v-model="addForm.status"
+              active-text="开"
+              inactive-text="关"
+              :active-value="1"
+              :inactive-value="0"
+            />
           </el-form-item>
         </el-col>
         <el-col :span="16">
           <el-form-item label="备注" prop="remark">
-            <el-input type="textarea" resize="none" v-model="addForm.remark" :rows="2" placeholder="请详细说明" size="small"
-              :disabled="isBindPlan"></el-input>
+            <el-input
+              type="textarea"
+              resize="none"
+              v-model="addForm.remark"
+              :rows="2"
+              placeholder="请详细说明"
+              size="small"
+              :disabled="isBindPlan"
+            ></el-input>
           </el-form-item>
         </el-col>
       </el-row>
 
-      <el-button type="primary" size="small" style="margin-bottom: 10px" @click="handleAddTab">添加规则</el-button>
-
-      <el-tabs v-model="tabsValue" type="card" closable @tab-click="handleTab" @tab-remove="removeTab">
-        <el-tab-pane v-for="(item, ruleIdListIndex) in ruleIdList" :key="item.ruleId" :label="item.name"
-          :name="item.ruleId">
+      <el-button
+        type="primary"
+        size="small"
+        style="margin-bottom: 10px"
+        @click="handleAddTab"
+        >添加规则</el-button
+      >
+
+      <el-tabs
+        v-model="tabsValue"
+        type="card"
+        closable
+        @tab-click="handleTab"
+        @tab-remove="removeTab"
+      >
+        <el-tab-pane
+          v-for="(item, ruleIdListIndex) in ruleIdList"
+          :key="item.ruleId"
+          :label="item.name"
+          :name="item.ruleId"
+        >
           <div class="el-tab_box">
             <div class="equipmentList_box">
               <header-title title="设备列表">
                 <div>
-                  <el-button size="small" icon="el-icon-plus" class="ele-btn-icon" type="primary" :disables="hasCategoryId"
-                    @click="handleAdd(ruleIdList, ruleIdListIndex)">新增</el-button>
+                  <el-button
+                    size="small"
+                    icon="el-icon-plus"
+                    class="ele-btn-icon"
+                    type="primary"
+                    :disables="hasCategoryId"
+                    @click="handleAdd(ruleIdList, ruleIdListIndex)"
+                    >新增</el-button
+                  >
                 </div>
               </header-title>
               <el-table :data="item.equipmentList" border>
@@ -162,7 +280,11 @@
                 </el-table-column>
                 <el-table-column label="操作" width="100">
                   <template slot-scope="scope">
-                    <el-button type="text" @click="deleteEquipment(scope.$index)">删除</el-button>
+                    <el-button
+                      type="text"
+                      @click="deleteEquipment(scope.$index)"
+                      >删除</el-button
+                    >
                   </template>
                 </el-table-column>
               </el-table>
@@ -170,8 +292,14 @@
             <div class="ruleMatters_box">
               <header-title title="规则事项">
                 <div>
-                  <el-button size="small" icon="el-icon-plus" class="ele-btn-icon" type="primary"
-                    @click="addPostscript">新增</el-button>
+                  <el-button
+                    size="small"
+                    icon="el-icon-plus"
+                    class="ele-btn-icon"
+                    type="primary"
+                    @click="addPostscript"
+                    >新增</el-button
+                  >
                 </div>
               </header-title>
               <el-table :data="item.ruleItems" border>
@@ -180,20 +308,34 @@
                     <span>{{ scope.$index + 1 }}</span>
                   </template>
                 </el-table-column>
-                <el-table-column label="零部件编码" prop="categoryCode" width="100">
+                <el-table-column
+                  label="零部件编码"
+                  prop="categoryCode"
+                  width="100"
+                >
                   <template slot-scope="scope">
                     <div v-if="scope.row.isNew">
-                      <el-input v-model="scope.row.categoryCode" placeholder="请输入零部件编码"></el-input>
+                      <el-input
+                        v-model="scope.row.categoryCode"
+                        placeholder="请输入零部件编码"
+                      ></el-input>
                     </div>
                     <div v-else>
                       <span>{{ scope.row.categoryCode }}</span>
                     </div>
                   </template>
                 </el-table-column>
-                <el-table-column label="零部件名称" prop="categoryName" width="100">
+                <el-table-column
+                  label="零部件名称"
+                  prop="categoryName"
+                  width="100"
+                >
                   <template slot-scope="scope">
                     <div v-if="scope.row.isNew">
-                      <el-input v-model="scope.row.categoryName" placeholder="请输入零部件名称"></el-input>
+                      <el-input
+                        v-model="scope.row.categoryName"
+                        placeholder="请输入零部件名称"
+                      ></el-input>
                     </div>
                     <div v-else>
                       <span>{{ scope.row.categoryName }}</span>
@@ -203,7 +345,10 @@
                 <el-table-column label="事项" prop="name" width="100">
                   <template slot-scope="scope">
                     <div v-if="scope.row.isNew">
-                      <el-input v-model="scope.row.name" placeholder="请输入内容"></el-input>
+                      <el-input
+                        v-model="scope.row.name"
+                        placeholder="请输入内容"
+                      ></el-input>
                     </div>
                     <div v-else>
                       <span>{{ scope.row.name }}</span>
@@ -213,7 +358,10 @@
                 <el-table-column label="内容" prop="content" width="200">
                   <template slot-scope="scope">
                     <div v-if="scope.row.isNew">
-                      <el-input v-model="scope.row.content" placeholder="请输入内容"></el-input>
+                      <el-input
+                        v-model="scope.row.content"
+                        placeholder="请输入内容"
+                      ></el-input>
                     </div>
                     <div v-else>
                       <span>{{ scope.row.content }}</span>
@@ -222,23 +370,34 @@
                 </el-table-column>
                 <el-table-column label="操作指导" prop="operationGuide">
                   <template slot-scope="scope">
-                    <div class="operationGuide_box" @click="
-                      openOperationGuideDialogDialog(
-                        scope.row.operationGuide,
-                        scope.$index,
-                        scope.row.isNew
-                      )
-                      ">
+                    <div
+                      class="operationGuide_box"
+                      @click="
+                        openOperationGuideDialogDialog(
+                          scope.row.operationGuide,
+                          scope.$index,
+                          scope.row.isNew
+                        )
+                      "
+                    >
                       <div class="left_content">
                         <template v-if="scope.row.operationGuide">
-                          <div v-for="(item, index) in scope.row.operationGuide
-                            .toolList" :key="item.id">{{ index + 1 }}.{{ item.name }}</div>
+                          <div
+                            v-for="(item, index) in scope.row.operationGuide
+                              .toolList"
+                            :key="item.id"
+                            >{{ index + 1 }}.{{ item.name }}</div
+                          >
                         </template>
                       </div>
                       <div class="right_content">
                         <template v-if="scope.row.operationGuide">
-                          <div v-for="(item, index) in scope.row.operationGuide
-                            .procedureList" :key="item.id">{{ index + 1 }}.{{ item.content }}</div>
+                          <div
+                            v-for="(item, index) in scope.row.operationGuide
+                              .procedureList"
+                            :key="item.id"
+                            >{{ index + 1 }}.{{ item.content }}</div
+                          >
                         </template>
                       </div>
                     </div>
@@ -247,7 +406,10 @@
                 <el-table-column label="标准" prop="norm" width="100">
                   <template slot-scope="scope">
                     <div v-if="scope.row.isNew">
-                      <el-input v-model="scope.row.norm" placeholder="请输入内容"></el-input>
+                      <el-input
+                        v-model="scope.row.norm"
+                        placeholder="请输入内容"
+                      ></el-input>
                     </div>
                     <div v-else>
                       <span>{{ scope.row.norm }}</span>
@@ -256,7 +418,12 @@
                 </el-table-column>
                 <el-table-column label="操作" width="100">
                   <template slot-scope="scope">
-                    <el-button v-if="scope.row.isNew" type="text" @click="deleteItem(scope.$index)">删除</el-button>
+                    <el-button
+                      v-if="scope.row.isNew"
+                      type="text"
+                      @click="deleteItem(scope.$index)"
+                      >删除</el-button
+                    >
                   </template>
                 </el-table-column>
               </el-table>
@@ -266,7 +433,7 @@
       </el-tabs>
     </el-form>
     <template v-slot:footer>
-      <el-button @click="visible = false">取消</el-button>
+      <el-button @click="updateVisible(false)">取消</el-button>
       <el-button type="primary" @click="save"> 保存 </el-button>
     </template>
     <!-- 新增设备 -->
@@ -275,15 +442,33 @@
     <!--  -->
     <operation-guideDialog ref="operationGuideDialog" @save="saveEdit" />
     <!-- 添加规则 -->
-    <ele-modal width="800px" :visible="addDialog" :append-to-body="true" title="规则配置" :close-on-click-modal="false"
-      @update:visible="closeAdd" :maxable="true">
-      <el-select v-model="ruleObj.ruleId" size="small" style="width: 100%" @change="handleRuleNameChange"
-        :disabled="isBindPlan" filterable>
-        <el-option v-for="item in ruleNameList" :key="item.id" :value="item.id" :label="item.code + '-' + item.name"
-          @click.native="ruleChange(item)"></el-option>
+    <ele-modal
+      width="800px"
+      :visible="addDialog"
+      :append-to-body="true"
+      title="规则配置"
+      :close-on-click-modal="false"
+      @update:visible="closeAdd"
+      :maxable="true"
+    >
+      <el-select
+        v-model="ruleObj.ruleId"
+        size="small"
+        style="width: 100%"
+        @change="handleRuleNameChange"
+        :disabled="isBindPlan"
+        filterable
+      >
+        <el-option
+          v-for="item in ruleNameList"
+          :key="item.id"
+          :value="item.id"
+          :label="item.code + '-' + item.name"
+          @click.native="ruleChange(item)"
+        ></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>
@@ -291,961 +476,964 @@
 </template>
 
 <script>
-import { getDetail, getCode } from '@/api/ruleManagement/matter';
-import {
-  getRule,
-  getCategory,
-  getAssetList,
-  saveOrUpdate,
-  getInfoById
-} from '@/api/ruleManagement/plan';
-import { getUserPage } from '@/api/system/organization';
-import { getTreeByType } from '@/api/classifyManage';
-import MaterialAdd from './MaterialAdd.vue';
-import OperationGuideDialog from '@/views/rulesManagement/matterRules/components/operationGuideDialog.vue';
-import deptSelect from '@/components/CommomSelect/dept-select.vue';
-import { pageList } from '@/api/technology/version/version.js';
-import {
-  bomDelete,
-  saveBatch,
-  bomTaskList,
-  bomTaskDelete,
-  getByTaskId
-} from '@/api/material/BOM';
-import { getteampage } from '@/api/workforceManagement/team';
-
-import { getFile } from '@/api/system/file';
-import { deepClone } from 'ele-admin/lib/utils/core';
-
-export default {
-  components: {
-    MaterialAdd,
-    deptSelect,
-    OperationGuideDialog
-  },
-  props: {
-    dialogTitle: {
-      type: String,
-      default: () => {
-        return '新增巡检点计划配置';
+  import { getDetail, getCode } from '@/api/ruleManagement/matter';
+  import {
+    getRule,
+    getCategory,
+    getAssetList,
+    saveOrUpdate,
+    getInfoById
+  } from '@/api/ruleManagement/plan';
+  import { getUserPage } from '@/api/system/organization';
+  import { getTreeByType } from '@/api/classifyManage';
+  import MaterialAdd from './MaterialAdd.vue';
+  import OperationGuideDialog from '@/views/rulesManagement/matterRules/components/operationGuideDialog.vue';
+  import deptSelect from '@/components/CommomSelect/dept-select.vue';
+  import { pageList } from '@/api/technology/version/version.js';
+  import {
+    bomDelete,
+    saveBatch,
+    bomTaskList,
+    bomTaskDelete,
+    getByTaskId
+  } from '@/api/material/BOM';
+  import { getteampage } from '@/api/workforceManagement/team';
+
+  import { getFile } from '@/api/system/file';
+  import { deepClone } from 'ele-admin/lib/utils/core';
+
+  export default {
+    components: {
+      MaterialAdd,
+      deptSelect,
+      OperationGuideDialog
+    },
+    props: {
+      dialogTitle: {
+        type: String,
+        default: () => {
+          return '新增巡检点计划配置';
+        }
+      },
+      visible: {
+        type: Boolean,
+        default: false
       }
     },
-    visible: {
-      type: Boolean,
-      default: false
-    }
-  },
-  data() {
-    const defaultForm = {
-      id: null,
-      code: '',
-      name: '',
-      modelType: '',
-      brandNum: '',
-      specification: '',
-      measuringUnit: '',
-      bomList: []
-    };
-    return {
-      ruleIndex: 0, // 规则index
-      ruleId: '',
-      formLabel: '',
-      isBindPlan: false,
-      ruleObj: {
-        ruleId: '',
-        name: '',
+    data() {
+      const defaultForm = {
+        id: null,
         code: '',
-        equipmentList: []
-      },
-      ruleIdList: [],
-      addForm: {
-        code: '', // 计划配置单号
-        name: '', // 计划配置名称
-        type: 0, // 默认个人
-        autoOrder: 1, // 自动派单
-        ruleId: '', // 规则id
-        ruleName: '', // 规则名称
-        duration: null, // 计划完成时长
-        categoryId: '', // 设备类别id
-        approvalUserId: '', // 审核人id
-        groupId: '', // 巡点检部门code
-        executeIdList: [], // 巡点检人员id
-        executorPhone: '',
-        status: 1, // 状态
-        remark: '', // 备注
-        urgent: '1',
-        teamId: '', // 班组id
-        executeUsers: [], // 执行人
-      },
-      ruleNameList: [], // 规则列表
-      uerList: [], // 审核人列表
-      executorList: [], // 业务人员列表
-      defaultForm,
-      // 表单数据
-      form: {
-        ...defaultForm
-      },
-
-      versionList: [],
-
-      // 表单验证规则
-      addFormRules: {
-        name: [
-          { required: true, message: '请输入计划配置名称', trigger: 'blur' }
-        ],
-        autoOrder: [
-          { required: true, message: '请选择是否自动派单', trigger: 'change' }
-        ],
-        ruleId: [
-          { required: true, message: '请选择规则名称', trigger: 'change' }
-        ],
-        duration: [
-          { required: true, message: '请输入计划完成时长', trigger: 'blur' }
-        ],
-        categoryLevelId: [
-          { required: true, message: '请选择设备分类', trigger: 'change' }
-        ],
-        categoryId: [
-          { required: true, message: '请选择设备类别', trigger: 'change' }
-        ],
-        groupId: [
-          { required: true, message: '请选择部门', trigger: 'change' }
-        ],
-        executeIdList: [
-          { required: true, message: '请选择人员', trigger: 'change' }
-        ],
-        teamId: [
-          { required: true, message: '请选择班组', trigger: 'change' }
-        ],
-        urgent: [
-          { required: true, message: '请选择紧急程度', trigger: 'change' }
-        ],
-        type: [
-          { required: true, message: '请选择', trigger: 'change' }
-        ],
-      },
-
-      columns: [
-        {
-          type: 'index',
-          width: 55,
-          align: 'center'
+        name: '',
+        modelType: '',
+        brandNum: '',
+        specification: '',
+        measuringUnit: '',
+        bomList: []
+      };
+      return {
+        ruleIndex: 0, // 规则index
+        ruleId: '',
+        formLabel: '',
+        isBindPlan: false,
+        ruleObj: {
+          ruleId: '',
+          name: '',
+          code: '',
+          equipmentList: []
         },
-        {
-          label: '子项编号',
-          prop: 'subCode',
-          action: 'subCode'
+        ruleIdList: [],
+        addForm: {
+          code: '', // 计划配置单号
+          name: '', // 计划配置名称
+          type: 0, // 默认个人
+          autoOrder: 1, // 自动派单
+          ruleId: '', // 规则id
+          ruleName: '', // 规则名称
+          duration: null, // 计划完成时长
+          categoryId: '', // 设备类别id
+          approvalUserId: '', // 审核人id
+          groupId: '', // 巡点检部门code
+          executeIdList: [], // 巡点检人员id
+          executorPhone: '',
+          status: 1, // 状态
+          remark: '', // 备注
+          urgent: '1',
+          teamId: '', // 班组id
+          executeUsers: [] // 执行人
         },
-        {
-          label: '物料名称',
-          prop: 'categoryName',
-          action: 'categoryName'
+        ruleNameList: [], // 规则列表
+        uerList: [], // 审核人列表
+        executorList: [], // 业务人员列表
+        defaultForm,
+        // 表单数据
+        form: {
+          ...defaultForm
         },
 
-        {
-          label: '是否回收料',
-          prop: 'isReworkBom',
-          action: 'isReworkBom',
-          slot: 'isReworkBom',
-          width: 95
+        versionList: [],
+
+        // 表单验证规则
+        addFormRules: {
+          name: [
+            { required: true, message: '请输入计划配置名称', trigger: 'blur' }
+          ],
+          autoOrder: [
+            { required: true, message: '请选择是否自动派单', trigger: 'change' }
+          ],
+          ruleId: [
+            { required: true, message: '请选择规则名称', trigger: 'change' }
+          ],
+          duration: [
+            { required: true, message: '请输入计划完成时长', trigger: 'blur' }
+          ],
+          categoryLevelId: [
+            { required: true, message: '请选择设备分类', trigger: 'change' }
+          ],
+          categoryId: [
+            { required: true, message: '请选择设备类别', trigger: 'change' }
+          ],
+          groupId: [
+            { required: true, message: '请选择部门', trigger: 'change' }
+          ],
+          executeIdList: [
+            { required: true, message: '请选择人员', trigger: 'change' }
+          ],
+          teamId: [
+            { required: true, message: '请选择班组', trigger: 'change' }
+          ],
+          urgent: [
+            { required: true, message: '请选择紧急程度', trigger: 'change' }
+          ],
+          type: [{ required: true, message: '请选择', trigger: 'change' }]
         },
 
-        {
-          label: '物料编码',
-          prop: 'categoryCode'
-        },
-        {
-          label: '牌号',
-          prop: 'brandNum'
-        },
-        {
-          label: '型号',
-          prop: 'modelType'
-        },
-        {
-          label: '数量',
-          prop: 'count'
-        },
-        {
-          label: '计量单位',
-          prop: 'unit'
-        },
+        columns: [
+          {
+            type: 'index',
+            width: 55,
+            align: 'center'
+          },
+          {
+            label: '子项编号',
+            prop: 'subCode',
+            action: 'subCode'
+          },
+          {
+            label: '物料名称',
+            prop: 'categoryName',
+            action: 'categoryName'
+          },
 
-        {
-          label: '附件',
-          slot: 'bomArtFiles',
-          action: 'bomArtFiles',
-          minWidth: 100
-        },
+          {
+            label: '是否回收料',
+            prop: 'isReworkBom',
+            action: 'isReworkBom',
+            slot: 'isReworkBom',
+            width: 95
+          },
 
-        {
-          label: '单位',
-          prop: 'weightUnit'
-        },
+          {
+            label: '物料编码',
+            prop: 'categoryCode'
+          },
+          {
+            label: '牌号',
+            prop: 'brandNum'
+          },
+          {
+            label: '型号',
+            prop: 'modelType'
+          },
+          {
+            label: '数量',
+            prop: 'count'
+          },
+          {
+            label: '计量单位',
+            prop: 'unit'
+          },
 
-        {
-          label: '备注',
-          prop: 'remark'
-        }
-      ],
+          {
+            label: '附件',
+            slot: 'bomArtFiles',
+            action: 'bomArtFiles',
+            minWidth: 100
+          },
 
-      statusList: [
-        { label: '草稿', value: -1 },
-        { label: '失效', value: 0 },
-        { label: '生效', value: 1 }
-      ],
+          {
+            label: '单位',
+            prop: 'weightUnit'
+          },
 
-      // 提交状态
-      loading: false,
+          {
+            label: '备注',
+            prop: 'remark'
+          }
+        ],
+
+        statusList: [
+          { label: '草稿', value: -1 },
+          { label: '失效', value: 0 },
+          { label: '生效', value: 1 }
+        ],
 
-      categoryId: null,
+        // 提交状态
+        loading: false,
 
-      current: null,
+        categoryId: null,
 
-      materialShow: false,
+        current: null,
 
-      tabsList: [],
-      tableData: [],
+        materialShow: false,
 
-      taskId: null,
+        tabsList: [],
+        tableData: [],
 
-      addDialog: false,
-      tabsValue: null,
+        taskId: null,
 
-      hasCategoryId:false,
-      getByIdData:{},
-      modelType: '',
-      teamAllList: [],
-    };
-  },
-  computed: {
-    // 是否开启响应式布局
-    styleResponsive() {
-      return this.$store.state.theme.styleResponsive;
+        addDialog: false,
+        tabsValue: null,
+
+        hasCategoryId: false,
+        getByIdData: {},
+        modelType: '',
+        teamAllList: []
+      };
     },
-    dispatchType() {
-      return ((this.addForm.autoOrder && (this.modelType == 'add' || this.modelType == 'edit')) || (!this.addForm.autoOrder && this.modelType == 'dispatch'))
-    }
-  },
-  watch: {
-    visible(val) {
-      if (val) {
-        this.formLabel = this.dialogTitle.includes('巡点检')
-          ? '巡点检'
-          : this.dialogTitle.includes('运行记录')
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive() {
+        return this.$store.state.theme.styleResponsive;
+      },
+      dispatchType() {
+        return (
+          (this.addForm.autoOrder &&
+            (this.modelType == 'add' || this.modelType == 'edit')) ||
+          (!this.addForm.autoOrder && this.modelType == 'dispatch')
+        );
+      }
+    },
+    watch: {
+      visible(val) {
+        if (val) {
+          this.formLabel = this.dialogTitle.includes('巡点检')
+            ? '巡点检'
+            : this.dialogTitle.includes('运行记录')
             ? '运行记录'
             : this.dialogTitle.includes('保养')
-              ? '保养'
-              :  this.dialogTitle.includes('检修')
-              ? '检修':'盘点';
-        // 获取审核人列表数据
-        this.getUserList();
-        // 获取规则名称
-        this._getRuleNameList();
-      }
-    }
-  },
-  mounted() {
-    this.getAllTeamList();
-    this.getUserList({groupId: "1"});
-  },
-  methods: {
-    // 初始化
-    async init(type, row, tips) {
-      console.log(row);
-      console.log(tips);
-      this.modelType = type;
-      if (row) {
-        this.getInfo(row.id);
-      } else {
-        //  获取计划配置单号
-        this.getOrderCode(tips);
-        this.addForm = {
-          code: '', // 计划配置单号
-          name: '', // 计划配置名称
-          autoOrder: 1, // 自动派单
-          type: 0, // 默认个人
-          ruleId: '', // 规则id
-          ruleName: '', // 规则名称
-          duration: null, // 计划完成时长
-          categoryId: '', // 设备类别id
-          approvalUserId: '', // 审核人id
-          groupId: '', // 巡点检部门code
-          executeIdList: [], // 巡点检人员id
-          executorPhone: '',
-          status: 1, // 状态
-          remark: '', // 备注
-          urgent: '1',
-          teamId: '', // 班组id
-          executeUsers: [], // 执行人
-        };
-        this.ruleIdList = [];
-        this.isBindPlan = false;
-        this.planRuleEquiList = [];
-        //   this.matterRulesList = [];
+            ? '保养'
+            : this.dialogTitle.includes('检修')
+            ? '检修'
+            : '盘点';
+          // 获取审核人列表数据
+          this.getUserList();
+          // 获取规则名称
+          this._getRuleNameList();
+        }
       }
     },
-    async getAllTeamList() {
-      const { list } = await getteampage({
-        pageNum: 1,
-        size: -1
-      });
-      console.log('teamAllList 班组', list);
-      this.teamAllList = list;
-    },
-    teamChange() {
-      console.log('this.addForm.teamId', this.addForm.teamId);
-      // 当前班组
-      const currentTeam = this.teamAllList.find(
-        (item) => item.id === this.addForm.teamId
-      );
-      if (currentTeam) {
-        // 同步执行人
-        this.addForm.executeUsers = [
-          {
-            teamId: currentTeam.id,
-            teamName: currentTeam.name
-          }
-        ];
-      }
+    mounted() {
+      this.getAllTeamList();
+      this.getUserList({ groupId: '1' });
     },
-    typeChange(v) {
-      console.log('typeChange', v, this.addForm.executeIdList);
-      // this.addForm.groupId = '';
-      // this.addForm.executeIdList = [];
-      // this.addForm.teamId = '';
-      // this.addForm.executeUsers = [];
-      this.$set(this.addForm, 'executeUsers', []);
-      if(v == 0) {
+    methods: {
+      // 初始化
+      async init(type, row, tips) {
+        console.log(row);
+        console.log(tips);
+        this.modelType = type;
+        if (row) {
+          this.getInfo(row.id);
+        } else {
+          //  获取计划配置单号
+          this.getOrderCode(tips);
+          this.addForm = {
+            code: '', // 计划配置单号
+            name: '', // 计划配置名称
+            autoOrder: 1, // 自动派单
+            type: 0, // 默认个人
+            ruleId: '', // 规则id
+            ruleName: '', // 规则名称
+            duration: null, // 计划完成时长
+            categoryId: '', // 设备类别id
+            approvalUserId: '', // 审核人id
+            groupId: '', // 巡点检部门code
+            executeIdList: [], // 巡点检人员id
+            executorPhone: '',
+            status: 1, // 状态
+            remark: '', // 备注
+            urgent: '1',
+            teamId: '', // 班组id
+            executeUsers: [] // 执行人
+          };
+          this.ruleIdList = [];
+          this.isBindPlan = false;
+          this.planRuleEquiList = [];
+          //   this.matterRulesList = [];
+        }
+      },
+      async getAllTeamList() {
+        const { list } = await getteampage({
+          pageNum: 1,
+          size: -1
+        });
+        console.log('teamAllList 班组', list);
+        this.teamAllList = list;
+      },
+      teamChange() {
+        console.log('this.addForm.teamId', this.addForm.teamId);
+        // 当前班组
+        const currentTeam = this.teamAllList.find(
+          (item) => item.id === this.addForm.teamId
+        );
+        if (currentTeam) {
+          // 同步执行人
+          this.addForm.executeUsers = [
+            {
+              teamId: currentTeam.id,
+              teamName: currentTeam.name
+            }
+          ];
+        }
+      },
+      typeChange(v) {
+        console.log('typeChange', v, this.addForm.executeIdList);
+        // this.addForm.groupId = '';
+        // this.addForm.executeIdList = [];
+        // this.addForm.teamId = '';
+        // this.addForm.executeUsers = [];
+        this.$set(this.addForm, 'executeUsers', []);
         this.$set(this.addForm, 'groupId', '');
         this.$set(this.addForm, 'executeIdList', []);
-      } else {
         this.$set(this.addForm, 'teamId', '');
-      }
-      this.$forceUpdate();
-    },
-    ruleChange(item) {
-      this.ruleObj.name = item.name;
-      this.ruleObj.code = item.code;
-    },
-    save() {
-      console.log(this.addForm);
-      console.log(this.ruleIdList);
-      if (this.ruleIdList && this.ruleIdList.length > 0) {
-        this.$refs.addFormRef.validate(async (valid) => {
-          console.log(valid);
-          if (valid) {
-            //   this.addForm.deviceInfo = selectList.map((item) => {
-            //     return {
-            //       substanceId: item.id,
-            //       sparePart: item.sparePart ? item.sparePart : [],
-            //       totalCost: item.totalCost
-            //     };
-            //   });
-            this.addForm.executeId = this.addForm.executeIdList.join(',');
-            this.addForm.ruleType = this.dialogTitle.includes('巡点检')
-              ? 1
-              : this.dialogTitle.includes('保养')
+
+        this.$forceUpdate();
+      },
+      ruleChange(item) {
+        this.ruleObj.name = item.name;
+        this.ruleObj.code = item.code;
+      },
+      save() {
+        console.log(this.addForm);
+        console.log(this.ruleIdList);
+        if (this.ruleIdList && this.ruleIdList.length > 0) {
+          this.$refs.addFormRef.validate(async (valid) => {
+            console.log(valid);
+            if (valid) {
+              //   this.addForm.deviceInfo = selectList.map((item) => {
+              //     return {
+              //       substanceId: item.id,
+              //       sparePart: item.sparePart ? item.sparePart : [],
+              //       totalCost: item.totalCost
+              //     };
+              //   });
+              this.addForm.executeId =
+                this.addForm.executeIdList &&
+                this.addForm.executeIdList.toString();
+
+              this.addForm.ruleType = this.dialogTitle.includes('巡点检')
+                ? 1
+                : this.dialogTitle.includes('保养')
                 ? 2
                 : this.dialogTitle.includes('运行记录')
-                  ? 5
-                  :this.dialogTitle.includes('检修')
-                  ?7:4;
-            console.log(this.ruleIdList);
-            this.addForm.isBindPlan = this.isBindPlan;
-            let planConfigAddOrUpdatePOList = this.ruleIdList.map((item) => {
-              return {
-                id: item.id,
-                ruleId: item.ruleId,
-                ruleName: item.name,
-                ruleCode: item.code,
-                categoryId: item.categoryId,
-                deviceInfo: item.equipmentList.map((item) => {
-                  return {
-                    // substanceId: this.dialogTitle.includes('新增')
-                    //   ? item.position[0]?.substanceId
-                    //   : item.id,
-                    substanceId: item.id,
-                    // 前端回显字段
-                    id: item.id,
-                    codeNumber: item.codeNumber,
-                    name: item.name,
-                    fixCode: item.fixCode,
-                    categoryId: item.category.categoryLevelId,
-                    categoryName: item.category.categoryLevelName
-                  };
-                }),
-                ruleMatters: item.ruleItems
-              };
-            });
-            const planConfigAddOrUpdatePOListIds = planConfigAddOrUpdatePOList.map(i=> i.id)
-            console.log(planConfigAddOrUpdatePOList);
-            let boolen = planConfigAddOrUpdatePOList.every(
-              (item) => item.deviceInfo.length > 0
-            );
-            if (!boolen) {
-              this.$message.error('请添加设备!');
-              return false;
-            }
-            this.addForm.ruleName = this.ruleIdList
-              .map((item) => item.name)
-              .join(',');
-            this.addForm.ruleCode = this.ruleIdList
-              .map((item) => item.code)
-              .join(',');
-            this.addForm.planConfigAddOrUpdatePOList =
-              planConfigAddOrUpdatePOList;
-            this.addForm.ruleId = '0'; // 无效后台验证
-            let sendMsg = deepClone(this.addForm);
-            const type = this.dialogTitle.includes('新增') ? '新增' : '编辑';
-            try {
-              let res = await saveOrUpdate(sendMsg);
-              if (res) {
-                this.$message.success(type + '成功!');
-                this.$emit('done');
+                ? 5
+                : this.dialogTitle.includes('检修')
+                ? 7
+                : 4;
+              console.log(this.ruleIdList);
+              this.addForm.isBindPlan = this.isBindPlan;
+              let planConfigAddOrUpdatePOList = this.ruleIdList.map((item) => {
+                return {
+                  id: item.id,
+                  ruleId: item.ruleId,
+                  ruleName: item.name,
+                  ruleCode: item.code,
+                  categoryId: item.categoryId,
+                  deviceInfo: item.equipmentList.map((item) => {
+                    return {
+                      // substanceId: this.dialogTitle.includes('新增')
+                      //   ? item.position[0]?.substanceId
+                      //   : item.id,
+                      substanceId: item.id,
+                      // 前端回显字段
+                      id: item.id,
+                      codeNumber: item.codeNumber,
+                      name: item.name,
+                      fixCode: item.fixCode,
+                      categoryId: item.category.categoryLevelId,
+                      categoryName: item.category.categoryLevelName
+                    };
+                  }),
+                  ruleMatters: item.ruleItems
+                };
+              });
+              const planConfigAddOrUpdatePOListIds =
+                planConfigAddOrUpdatePOList.map((i) => i.id);
+              console.log(planConfigAddOrUpdatePOList);
+              let boolen = planConfigAddOrUpdatePOList.every(
+                (item) => item.deviceInfo.length > 0
+              );
+              if (!boolen) {
+                this.$message.error('请添加设备!');
+                return false;
+              }
+              this.addForm.ruleName = this.ruleIdList
+                .map((item) => item.name)
+                .join(',');
+              this.addForm.ruleCode = this.ruleIdList
+                .map((item) => item.code)
+                .join(',');
+              this.addForm.planConfigAddOrUpdatePOList =
+                planConfigAddOrUpdatePOList;
+              this.addForm.ruleId = '0'; // 无效后台验证
+              let sendMsg = deepClone(this.addForm);
+              const type = this.dialogTitle.includes('新增') ? '新增' : '编辑';
+              try {
+                let res = await saveOrUpdate(sendMsg);
+                if (res) {
+                  this.$message.success(type + '成功!');
+                  this.$emit('done');
+                }
+              } catch (error) {
+                console.log(error);
+                this.$message.error(type + '失败!');
               }
-            } catch (error) {
-              console.log(error);
-              this.$message.error(type + '失败!');
             }
-          }
-        });
-      } else {
-        this.$message.error('请添加规则!');
-      }
-    },
-    // 保存操作指导数据
-    saveEdit(data, index) {
-      console.log(this.matterRulesList);
-      console.log(data);
-      console.log(index);
-      this.$set(
-        this.ruleIdList[this.ruleIndex].ruleItems[index],
-        'operationGuide',
-        data
-      );
-    },
-    /* 打开操作手册编辑款 */
-    openOperationGuideDialogDialog(row, index, isNew) {
-      console.log(isNew,'isNew');
+          });
+        } else {
+          this.$message.error('请添加规则!');
+        }
+      },
+      // 保存操作指导数据
+      saveEdit(data, index) {
+        console.log(this.matterRulesList);
+        console.log(data);
+        console.log(index);
+        this.$set(
+          this.ruleIdList[this.ruleIndex].ruleItems[index],
+          'operationGuide',
+          data
+        );
+      },
+      /* 打开操作手册编辑款 */
+      openOperationGuideDialogDialog(row, index, isNew) {
+        console.log(isNew, 'isNew');
 
-      if (isNew) {
-        this.$refs.operationGuideDialog.open(row, index);
-      }
-    },
-    deleteEquipment(index) {
-      this.ruleIdList[this.ruleIndex].equipmentList.splice(index, 1);
-    },
-    deleteItem(index) {
-      this.ruleIdList[this.ruleIndex].ruleItems.splice(index, 1);
-    },
-    addPostscript() {
-      // console.log(
-      //   'this.matterRulesList---------------',
-      //   this.matterRulesList
-      // );
-      this.ruleIdList[this.ruleIndex].ruleItems.push({
-        sort: null,
-        name: '',
-        content: '',
-        norm: '',
-        isNew: true,
-        operationGuide: {
-          procedureList: [],
-          toolList: []
+        if (isNew) {
+          this.$refs.operationGuideDialog.open(row, index);
         }
-      });
-      console.log(this.ruleIdList,'225')
-    },
-    async getInfo(id) {
-      console.log(id);
-      try {
-        const res = await getInfoById(id);
-        console.log('res----------', res);
-        // this.addForm = res;
-        
-        this.isBindPlan = res.isBindPlan;
-        this.categoryEquipment(res.categoryLevelId);
-        this.ruleIdList = res.planConfigVOList.map((item) => {
-          return {
-            id: item.id,
-            ruleId: item.ruleId,
-            name: item.ruleName,
-            code: item.ruleCode,
-            categoryId: item.categoryId,
-            equipmentList: item.deviceInfo.map((item) => {
-              return {
-                name: item.name,
-                id: item.id,
-                fixCode: item.fixCode,
-                codeNumber: item.codeNumber,
-                category: {
-                  categoryLevelId: item.categoryId,
-                  categoryLevelName: item.categoryName
-                }
-              };
-            }),
-            ruleItems: item.ruleMatters
-          };
+      },
+      deleteEquipment(index) {
+        this.ruleIdList[this.ruleIndex].equipmentList.splice(index, 1);
+      },
+      deleteItem(index) {
+        this.ruleIdList[this.ruleIndex].ruleItems.splice(index, 1);
+      },
+      addPostscript() {
+        // console.log(
+        //   'this.matterRulesList---------------',
+        //   this.matterRulesList
+        // );
+        this.ruleIdList[this.ruleIndex].ruleItems.push({
+          sort: null,
+          name: '',
+          content: '',
+          norm: '',
+          isNew: true,
+          operationGuide: {
+            procedureList: [],
+            toolList: []
+          }
         });
+        console.log(this.ruleIdList, '225');
+      },
+      async getInfo(id) {
+        console.log(id);
+        try {
+          const res = await getInfoById(id);
+          console.log('res----------', res);
+          // this.addForm = res;
+
+          this.isBindPlan = res.isBindPlan;
+          this.categoryEquipment(res.categoryLevelId);
+          this.ruleIdList = res.planConfigVOList.map((item) => {
+            return {
+              id: item.id,
+              ruleId: item.ruleId,
+              name: item.ruleName,
+              code: item.ruleCode,
+              categoryId: item.categoryId,
+              equipmentList: item.deviceInfo.map((item) => {
+                return {
+                  name: item.name,
+                  id: item.id,
+                  fixCode: item.fixCode,
+                  codeNumber: item.codeNumber,
+                  category: {
+                    categoryLevelId: item.categoryId,
+                    categoryLevelName: item.categoryName
+                  }
+                };
+              }),
+              ruleItems: item.ruleMatters
+            };
+          });
 
-        // 处理回显数据
-        if (res.type === 0) {
-          // 个人
-          res.executeIdList = res.executeUsers.map(
-            (item) => item.userId
-          );
+          // 处理回显数据
+          if (res.type === 0) {
+            // 个人
+            res.executeIdList = res.executeUsers.map((item) => item.userId);
+
+            let groupIds = res.executeUsers
+              .map((i) => i.groupId)
+              .filter((i) => i);
+            groupIds = Array.from(new Set(groupIds));
+
+            if (groupIds.includes('1')) {
+              // 包含全部部门,置空
+              res.groupId = '1';
+            } else {
+              res.groupId = res.executeUsers?.[0]?.groupId || '1';
+            }
 
-          let groupIds = res.executeUsers
-            .map((i) => i.groupId)
-            .filter((i) => i);
-          groupIds = Array.from(new Set(groupIds));
+            // this.addForm.teamId = ''
+            // this.$set(this.addForm, 'teamId', '');
 
-          if (groupIds.includes('1')) {
-            // 包含全部部门,置空
-            res.groupId = '1';
+            groupIds.map((item) => {
+              this.searchDeptNodeClick(item);
+            });
           } else {
-            res.groupId = res.executeUsers?.[0]?.groupId || '1';
+            // 班组
+            res.teamId = res.executeUsers?.[0]?.teamId || '';
+            // this.$set(this.addForm, 'groupId', '');
+            // this.$set(this.addForm, 'executeIdList', []);
+            // this.addForm.groupId = ''
+            // this.addForm.executeIdList = []
           }
-
-          // this.addForm.teamId = ''
-          // this.$set(this.addForm, 'teamId', '');
-
-          groupIds.map((item) => {
-            this.searchDeptNodeClick(item);
+          this.tabsValue = this.ruleIdList[0].ruleId;
+          if (res.groupId) {
+            const params = { groupId: res.groupId };
+            this.getUserList(params);
+          }
+          this.$set(this, 'addForm', res);
+          // this._getMatterRulesDetails(res.ruleId);
+          this.$set(this.addForm, 'code', res.code);
+          this.$set(this.addForm, 'urgent', JSON.stringify(res.urgent));
+          // this.$set(this.addForm, 'executeIdList', res.executeId.split(','));
+          this.$set(this.addForm, 'imageUrl', {});
+          // console.log(this.rootData);
+          const rep = await getTreeByType(0);
+          console.log('sasas', res);
+          const ids = this.findTopLevelAncestorId(
+            rep.data,
+            res.categoryLevelId
+          );
+          this.rootId = ids;
+          //   await this._getEquipmentList(res.categoryLevelId, this.isBindPlan);
+          let keys = [];
+          res.deviceInfo.map((item) => {
+            keys.push(item.substanceId);
           });
-        } else {
-          // 班组
-          res.teamId = res.executeUsers?.[0]?.teamId || '';
-          // this.$set(this.addForm, 'groupId', '');
-          // this.$set(this.addForm, 'executeIdList', []);
-          // this.addForm.groupId = ''
-          // this.addForm.executeIdList = []
+          this.$nextTick(() => {
+            this.$refs.equiListTree.setCheckedKeys(keys);
+          });
+          this.clickedTreeNode = true;
+        } catch (error) {}
+      },
+      // 获取设备分类数据
+      async categoryEquipment(id) {
+        const params = { categoryLevelId: id, pageNum: 1, size: -1 };
+        console.log('params==', params);
+        const data = await getCategory(params);
+        console.log(data);
+        this.equipmentList = data.list;
+      },
+      // 选择设备
+      chooseEquipment(data, index, categoryId) {
+        this.$set(
+          this.ruleIdList[index],
+          'equipmentList',
+          this.ruleIdList[index].equipmentList.concat(data)
+        );
+        this.$set(this.ruleIdList[index], 'categoryId', categoryId);
+        console.log(this.ruleIdList);
+      },
+      // 获取计划配置单号
+      async getOrderCode(tips) {
+        if (tips.includes('巡点检')) {
+          const data = await getCode('patrolconfig_code');
+          this.$set(this.addForm, 'code', data);
         }
-        this.tabsValue = this.ruleIdList[0].ruleId;
-        if (res.groupId) {
-          const params = { groupId: res.groupId };
-          this.getUserList(params);
+        if (tips.includes('保养')) {
+          const code = await getCode('maintainconfig_code');
+          this.$set(this.addForm, 'code', code);
         }
-        this.$set(this, 'addForm', res)
-        // this._getMatterRulesDetails(res.ruleId);
-        this.$set(this.addForm, 'code', res.code);
-        this.$set(this.addForm, 'urgent', JSON.stringify(res.urgent));
-        // this.$set(this.addForm, 'executeIdList', res.executeId.split(','));
-        this.$set(this.addForm, 'imageUrl', {});
-        // console.log(this.rootData);
-        const rep = await getTreeByType(0);
-        console.log('sasas', res);
-        const ids = this.findTopLevelAncestorId(
-          rep.data,
-          res.categoryLevelId
-        );
-        this.rootId = ids;
-        //   await this._getEquipmentList(res.categoryLevelId, this.isBindPlan);
-        let keys = [];
-        res.deviceInfo.map((item) => {
-          keys.push(item.substanceId);
-        });
-        this.$nextTick(() => {
-          this.$refs.equiListTree.setCheckedKeys(keys);
-        });
-        this.clickedTreeNode = true;
-      } catch (error) { }
-    },
-    // 获取设备分类数据
-    async categoryEquipment(id) {
-      const params = { categoryLevelId: id, pageNum: 1, size: -1 };
-      console.log('params==', params);
-      const data = await getCategory(params);
-      console.log(data);
-      this.equipmentList = data.list;
-    },
-    // 选择设备
-    chooseEquipment(data, index, categoryId) {
-      this.$set(
-        this.ruleIdList[index],
-        'equipmentList',
-        this.ruleIdList[index].equipmentList.concat(data)
-      );
-      this.$set(this.ruleIdList[index], 'categoryId', categoryId);
-      console.log(this.ruleIdList);
-    },
-    // 获取计划配置单号
-    async getOrderCode(tips) {
-      if (tips.includes('巡点检')) {
-        const data = await getCode('patrolconfig_code');
-        this.$set(this.addForm, 'code', data);
-      }
-      if (tips.includes('保养')) {
-        const code = await getCode('maintainconfig_code');
-        this.$set(this.addForm, 'code', code);
-      }
-      if (tips.includes('量具送检')) {
-        const code = await getCode('quantity_code');
-        this.$set(this.addForm, 'code', code);
-      }
-      if (tips.includes('运行记录')) {
-        const code = await getCode('runRecord_code');
-        this.$set(this.addForm, 'code', code);
-      }
-      if (tips.includes('检修')) {
-        const code = await getCode('service_code');
-        this.$set(this.addForm, 'code', code);
-      }
-    },
-    //选择部门(搜索)
-    async searchDeptNodeClick(info, data) {
-      console.log('searchDeptNodeClick', info, data);
-      if (info) {
-        // 根据部门获取人员
-        // this.addForm.groupName = data.name;
-        const params = { groupId: info };
-        await this.getUserList(params);
-        // if (this.addForm.type == 1) {
-        //   this.addForm.executeIdList = this.executorList.map(
-        //     (item) => item.id
-        //   );
-        // }
-      } else {
-        this.addForm.groupId = null;
-      }
-    },
-    // 负责人变更 同步执行人列表
-    executeIdListChange(v) {
-      console.log('executeIdListChange', v);
-      this.addForm.executeUsers = this.addForm.executeIdList.map((userId) => {
-        const user = this.executorList.find((u) => u.id === userId);
-        return {
-          userId: user.id,
-          userName: user.name,
-
-          groupId: user.groupId,
-          groupName: user.groupName
-        };
-      });
-      console.log('this.addForm.executeUsers', this.addForm.executeUsers);
-    },
-    // 过滤计划完成时长
-    formDataDurationTime(value) {
-      if (value > 0) {
-        this.addForm.duration = value.replace(/^[0]+/, '');
-      } else {
-        this.addForm.duration = 0;
-      }
-    },
-    // 获取审核人列表、巡点检人员
-    async getUserList(params) {
-      try {
-        let data = { pageNum: 1, size: -1 };
-        // 如果传了参数就是获取巡点检人员数据
-        if (params) {
-          data = Object.assign(data, params);
+        if (tips.includes('量具送检')) {
+          const code = await getCode('quantity_code');
+          this.$set(this.addForm, 'code', code);
+        }
+        if (tips.includes('运行记录')) {
+          const code = await getCode('runRecord_code');
+          this.$set(this.addForm, 'code', code);
         }
-        const res = await getUserPage(data);
-        console.log('res------------', res);
-        if (params) {
-          this.executorList = res.list;
+        if (tips.includes('检修')) {
+          const code = await getCode('service_code');
+          this.$set(this.addForm, 'code', code);
+        }
+      },
+      //选择部门(搜索)
+      async searchDeptNodeClick(info, data) {
+        console.log('searchDeptNodeClick', info, data);
+        if (info) {
+          // 根据部门获取人员
+          // this.addForm.groupName = data.name;
+          const params = { groupId: info };
+          await this.getUserList(params);
+          // if (this.addForm.type == 1) {
+          //   this.addForm.executeIdList = this.executorList.map(
+          //     (item) => item.id
+          //   );
+          // }
         } else {
-          this.uerList = res.list;
+          this.addForm.groupId = null;
         }
-      } catch (error) { }
-    },
-    // 获取规则名列表
-    async _getRuleNameList() {
-      const typeMap = {
-        '新增巡点检计划配置': 1,
-        '编辑巡点检计划配置': 1,
-        '新增保养计划配置': 2,
-        '编辑保养计划配置': 2,
-        '新增量具送检计划配置': 5,
-        '编辑量具送检计划配置': 5,
-        '新增运行记录配置': 6,
-        '编辑运行记录配置': 6,
-        '新增检修配置': 7,
-        '编辑检修配置': 7
-      };
+      },
+      // 负责人变更 同步执行人列表
+      executeIdListChange(v) {
+        console.log('executeIdListChange', v);
+        this.addForm.executeUsers = this.addForm.executeIdList.map((userId) => {
+          const user = this.executorList.find((u) => u.id === userId);
+          return {
+            userId: user.id,
+            userName: user.name,
 
-      const ruleType = typeMap[this.dialogTitle];
-      if (ruleType) {
-        const res = await getRule({
-          status: 1,
-          type: ruleType,
-          pageNum: 1,
-          size: -1
+            groupId: user.groupId,
+            groupName: user.groupName
+          };
         });
-        console.log(res, 'resresresresres')
-        this.ruleNameList = res?.list || [];
-      }
-    },
-    downloadFile(file) {
-      getFile({ objectName: file.storePath }, file.name);
-    },
+        console.log('this.addForm.executeUsers', this.addForm.executeUsers);
+      },
+      // 过滤计划完成时长
+      formDataDurationTime(value) {
+        if (value > 0) {
+          this.addForm.duration = value.replace(/^[0]+/, '');
+        } else {
+          this.addForm.duration = 0;
+        }
+      },
+      // 获取审核人列表、巡点检人员
+      async getUserList(params) {
+        try {
+          let data = { pageNum: 1, size: -1 };
+          // 如果传了参数就是获取巡点检人员数据
+          if (params) {
+            data = Object.assign(data, params);
+          }
+          const res = await getUserPage(data);
+          console.log('res------------', res);
+          if (params) {
+            this.executorList = res.list;
+          } else {
+            this.uerList = res.list;
+          }
+        } catch (error) {}
+      },
+      // 获取规则名列表
+      async _getRuleNameList() {
+        const typeMap = {
+          新增巡点检计划配置: 1,
+          编辑巡点检计划配置: 1,
+          新增保养计划配置: 2,
+          编辑保养计划配置: 2,
+          新增量具送检计划配置: 5,
+          编辑量具送检计划配置: 5,
+          新增运行记录配置: 6,
+          编辑运行记录配置: 6,
+          新增检修配置: 7,
+          编辑检修配置: 7
+        };
 
-    openEdit(index) {
-      this.current = this.form.bomList[index];
-      console.log(this.current);
-      this.materialShow = true;
-    },
+        const ruleType = typeMap[this.dialogTitle];
+        if (ruleType) {
+          const res = await getRule({
+            status: 1,
+            type: ruleType,
+            pageNum: 1,
+            size: -1
+          });
+          console.log(res, 'resresresresres');
+          this.ruleNameList = res?.list || [];
+        }
+      },
+      downloadFile(file) {
+        getFile({ objectName: file.storePath }, file.name);
+      },
 
-    /* 表格数据源 */
-    datasource({ page, limit, where }) {
-      return [];
-    },
+      openEdit(index) {
+        this.current = this.form.bomList[index];
+        console.log(this.current);
+        this.materialShow = true;
+      },
 
-    async getVersionList() {
-      const res = await pageList({
-        pageNum: 1,
-        size: 100
-      });
+      /* 表格数据源 */
+      datasource({ page, limit, where }) {
+        return [];
+      },
 
-      this.versionList = res.list;
-    },
+      async getVersionList() {
+        const res = await pageList({
+          pageNum: 1,
+          size: 100
+        });
 
-    handleAdd(ruleIdList, ruleIdListIndex) {
-      this.$refs.productRefs.open(ruleIdList, ruleIdListIndex);
-    },
+        this.versionList = res.list;
+      },
 
-    /* 更新visible */
-    updateVisible(value) {
-      this.$emit('update:visible', value);
-    },
+      handleAdd(ruleIdList, ruleIdListIndex) {
+        this.$refs.productRefs.open(ruleIdList, ruleIdListIndex);
+      },
 
-    async getCategoryBomFn(taskId) {
-      const res = await getByTaskId(this.categoryId, taskId);
-      this.form.bomList = res;
-    },
+      /* 更新visible */
+      updateVisible(value) {
+        this.$emit('update:visible', value);
+      },
 
-    remove(row) {
-      bomDelete([row.id])
-        .then((message) => {
-          this.$message.success(message);
-          this.getCategoryBomFn();
-        })
-        .catch((e) => {
-          this.$message.error(e.message);
-        });
-    },
+      async getCategoryBomFn(taskId) {
+        const res = await getByTaskId(this.categoryId, taskId);
+        this.form.bomList = res;
+      },
 
-    done(taskId) {
-      this.materialShow = false;
-      this.getCategoryBomFn(taskId);
-    },
+      remove(row) {
+        bomDelete([row.id])
+          .then((message) => {
+            this.$message.success(message);
+            this.getCategoryBomFn();
+          })
+          .catch((e) => {
+            this.$message.error(e.message);
+          });
+      },
 
-    handleAddTab() {
-      this.tableData = this.tabsList;
-      this.addDialog = true;
-    },
+      done(taskId) {
+        this.materialShow = false;
+        this.getCategoryBomFn(taskId);
+      },
 
-    handleTab(e) {
-      this.ruleIndex = e.index;
-      // this.ruleIdList[e.index].ruleItems = this._getMatterRulesDetails(this.ruleId)
-    },
+      handleAddTab() {
+        this.tableData = this.tabsList;
+        this.addDialog = true;
+      },
 
-    removeTab(targetRuleId) {
-      this.$confirm('是否删除当前规则?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      })
-        .then(() => {
-          console.log('targetName', targetRuleId);
-          console.log('this.ruleIdList', this.ruleIdList)
-
-          this.ruleIdList = this.ruleIdList.filter(
-            (item) => item.ruleId != targetRuleId
-          );
+      handleTab(e) {
+        this.ruleIndex = e.index;
+        // this.ruleIdList[e.index].ruleItems = this._getMatterRulesDetails(this.ruleId)
+      },
 
-          console.log('this.ruleIdList', this.ruleIdList)
+      removeTab(targetRuleId) {
+        this.$confirm('是否删除当前规则?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        })
+          .then(() => {
+            console.log('targetName', targetRuleId);
+            console.log('this.ruleIdList', this.ruleIdList);
 
-          this.$nextTick(() => {
-            if (this.ruleIdList.length == 1) {
-              this.tabsValue = this.ruleIdList[0].ruleId;
-            }
-          });
+            this.ruleIdList = this.ruleIdList.filter(
+              (item) => item.ruleId != targetRuleId
+            );
 
-        })
-        .catch(() => { });
-    },
+            console.log('this.ruleIdList', this.ruleIdList);
 
-    /*关闭选择参数*/
-    closeAdd() {
-      this.addDialog = false;
-    },
-    // 规则名称下拉触发
-    handleRuleNameChange(val) {
-      this.ruleId = val;
-      console.log('val----', val);
-      this.getRulesDetails(val);
-    },
-    async getRulesDetails(val) {
-      const res = await getDetail(val);
-      console.log('res------', res);
-      this.getByIdData=res;
-      this.hasCategoryId = res?.categoryId;
-    },
-    // 封装 - 获取规则下面的详情数据及事项
-    async _getMatterRulesDetails(val) {
-      const res = await getDetail(val);
-      return res.ruleItems;
-      // console.log('res------', res);
-      // this.matterRulesList = res.ruleItems;
-    },
+            this.$nextTick(() => {
+              if (this.ruleIdList.length == 1) {
+                this.tabsValue = this.ruleIdList[0].ruleId;
+              }
+            });
+          })
+          .catch(() => {});
+      },
 
-    async addRule() {
-      console.log(this.ruleIdList);
-      console.log(this.ruleId);
-      let boolen = this.ruleIdList.every((item) => {
-        return this.ruleId != item.ruleId;
-      });
-      if (boolen) {
-        console.log(this.ruleNameList);
-        this.ruleObj.ruleItems = await this._getMatterRulesDetails(
-          this.ruleId
-        );
+      /*关闭选择参数*/
+      closeAdd() {
+        this.addDialog = false;
+      },
+      // 规则名称下拉触发
+      handleRuleNameChange(val) {
+        this.ruleId = val;
+        console.log('val----', val);
+        this.getRulesDetails(val);
+      },
+      async getRulesDetails(val) {
+        const res = await getDetail(val);
+        console.log('res------', res);
+        this.getByIdData = res;
+        this.hasCategoryId = res?.categoryId;
+      },
+      // 封装 - 获取规则下面的详情数据及事项
+      async _getMatterRulesDetails(val) {
+        const res = await getDetail(val);
+        return res.ruleItems;
+        // console.log('res------', res);
+        // this.matterRulesList = res.ruleItems;
+      },
 
-        for (let i = 0; i < this.ruleObj.ruleItems.length; i++) {
-          const id = this.getByIdData?.categoryId;
-          const name = this.getByIdData?.categoryName;
+      async addRule() {
+        console.log(this.ruleIdList);
+        console.log(this.ruleId);
+        let boolen = this.ruleIdList.every((item) => {
+          return this.ruleId != item.ruleId;
+        });
+        if (boolen) {
+          console.log(this.ruleNameList);
+          this.ruleObj.ruleItems = await this._getMatterRulesDetails(
+            this.ruleId
+          );
 
-          this.ruleObj.ruleItems[i].categoryId = id;
-          this.ruleObj.ruleItems[i].categoryName = name;
+          for (let i = 0; i < this.ruleObj.ruleItems.length; i++) {
+            const id = this.getByIdData?.categoryId;
+            const name = this.getByIdData?.categoryName;
 
-          this.ruleObj.ruleItems[i].isNew=true;
-        }
+            this.ruleObj.ruleItems[i].categoryId = id;
+            this.ruleObj.ruleItems[i].categoryName = name;
 
-        this.ruleIdList.push(deepClone(this.ruleObj));
-        console.log('this.ruleIdList--------', this.ruleIdList);
-        this.addDialog = false;
-        this.$nextTick(() => {
-          if (this.ruleIdList.length == 1) {
-            this.tabsValue = this.ruleIdList[0].ruleId;
+            this.ruleObj.ruleItems[i].isNew = true;
           }
-        });
-      } else {
-        this.$message.error('请误重复添加规则');
-      }
-    },
-
-    // 保存
-    saveBatchFn() {
-      let arr = [];
-      arr = this.tabsList.map((m) => {
-        return {
-          taskId: m.id,
-          sort: m.sort,
-          categoryId: this.categoryId
-        };
-      });
 
-      saveBatch(arr).then((res) => {
-        this.taskListHead();
-      });
-    },
+          this.ruleIdList.push(deepClone(this.ruleObj));
+          console.log('this.ruleIdList--------', this.ruleIdList);
+          this.addDialog = false;
+          this.$nextTick(() => {
+            if (this.ruleIdList.length == 1) {
+              this.tabsValue = this.ruleIdList[0].ruleId;
+            }
+          });
+        } else {
+          this.$message.error('请误重复添加规则');
+        }
+      },
 
-    taskListHead(isFirst) {
-      console.log(isFirst);
-      bomTaskList(this.categoryId).then((res) => {
+      // 保存
+      saveBatchFn() {
         let arr = [];
-        arr = res.map((m) => {
+        arr = this.tabsList.map((m) => {
           return {
-            oldId: m.id,
-            sourceTaskId: m.id,
-            id: m.taskId,
-            name: m.taskName
+            taskId: m.id,
+            sort: m.sort,
+            categoryId: this.categoryId
           };
         });
-        this.tabsList = arr;
 
-        if (isFirst && this.tabsList.length > 0) {
-          this.tabsValue = this.tabsList[0].id;
-          this.getCategoryBomFn(this.tabsList[0].id);
-        }
-      });
+        saveBatch(arr).then((res) => {
+          this.taskListHead();
+        });
+      },
+
+      taskListHead(isFirst) {
+        console.log(isFirst);
+        bomTaskList(this.categoryId).then((res) => {
+          let arr = [];
+          arr = res.map((m) => {
+            return {
+              oldId: m.id,
+              sourceTaskId: m.id,
+              id: m.taskId,
+              name: m.taskName
+            };
+          });
+          this.tabsList = arr;
+
+          if (isFirst && this.tabsList.length > 0) {
+            this.tabsValue = this.tabsList[0].id;
+            this.getCategoryBomFn(this.tabsList[0].id);
+          }
+        });
+      }
     }
-  }
-};
+  };
 </script>
 
 <style lang="scss" scoped>
-::v-deep .el-row {
-  display: flex;
-  flex-wrap: wrap;
-}
-
-::v-deep .el-tab_box {
-  display: flex;
-  margin-top: 10px;
-  height: 300px;
-  width: 100%;
-
-  .equipmentList_box {
-    flex: 1;
-    height: 100%;
-    margin-right: 10px;
+  ::v-deep .el-row {
     display: flex;
-    flex-direction: column;
-
-    .divider {
-      flex: 0 0 50px;
+    flex-wrap: wrap;
+  }
 
-      .title {
-        height: 35px;
+  ::v-deep .el-tab_box {
+    display: flex;
+    margin-top: 10px;
+    height: 300px;
+    width: 100%;
+
+    .equipmentList_box {
+      flex: 1;
+      height: 100%;
+      margin-right: 10px;
+      display: flex;
+      flex-direction: column;
+
+      .divider {
+        flex: 0 0 50px;
+
+        .title {
+          height: 35px;
+        }
       }
-    }
 
-    .el-table {
-      overflow: auto;
+      .el-table {
+        overflow: auto;
+      }
     }
-  }
 
-  .ruleMatters_box {
-    flex: 3;
-    height: 100%;
-    display: flex;
-    flex-direction: column;
+    .ruleMatters_box {
+      flex: 3;
+      height: 100%;
+      display: flex;
+      flex-direction: column;
 
-    .divider {
-      flex: 0 0 50px;
+      .divider {
+        flex: 0 0 50px;
 
-      .title {
-        height: 35px;
+        .title {
+          height: 35px;
+        }
       }
-    }
 
-    .el-table {
-      overflow: auto;
-
-      .operationGuide_box {
-        width: 100%;
-        height: 50px;
-        display: flex;
-        overflow: hidden;
-        cursor: pointer;
-
-        .left_content {
-          flex: 0 0 200px;
-          padding: 10px;
-          box-sizing: border-box;
-          border: 1px solid #c0c4cc;
-          border-radius: 10px;
-          margin-right: 10px;
-          overflow-y: auto;
-        }
+      .el-table {
+        overflow: auto;
+
+        .operationGuide_box {
+          width: 100%;
+          height: 50px;
+          display: flex;
+          overflow: hidden;
+          cursor: pointer;
+
+          .left_content {
+            flex: 0 0 200px;
+            padding: 10px;
+            box-sizing: border-box;
+            border: 1px solid #c0c4cc;
+            border-radius: 10px;
+            margin-right: 10px;
+            overflow-y: auto;
+          }
 
-        .right_content {
-          flex: 1;
-          padding: 10px;
-          box-sizing: border-box;
-          border: 1px solid #c0c4cc;
-          border-radius: 10px;
-          overflow-y: auto;
+          .right_content {
+            flex: 1;
+            padding: 10px;
+            box-sizing: border-box;
+            border: 1px solid #c0c4cc;
+            border-radius: 10px;
+            overflow-y: auto;
+          }
         }
       }
-    }
 
-    .el-table::before {
-      display: none;
+      .el-table::before {
+        display: none;
+      }
     }
   }
-}
 </style>

+ 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='

+ 9 - 4
src/views/rulesManagement/inspectionReportTemplate/components/edit.vue

@@ -13,7 +13,7 @@
         :model="addForm"
         :rules="rules"
         label-width="100px"
-        :disabled="type === 'details'"
+        :disabled="type === 'view'"
       >
         <el-form-item label="模板名称" prop="name">
           <el-input v-model.trim="addForm.name" placeholder="请输入模板名称" />
@@ -62,6 +62,7 @@
         :loading="saving"
         :disabled="saving"
         @click="submit"
+        v-if="type !== 'view'"
         >提 交</el-button
       >
       <el-button :disabled="saving" @click="handleClose">取 消</el-button>
@@ -74,7 +75,7 @@
   import {
     getQmsReportTemplateById,
     updateQmsReportTemplate,
-    saveQmsReportTemplate
+    saveQmsReportTemplate,changeQmsReportTemplate
   } from '@/api/qmsreporttemplate/index';
 
   export default {
@@ -101,6 +102,7 @@
         loading: false,
         saving: false,
         template: '',
+        isChange:false,
         rules: {
           name: [
             { required: true, message: '请输入模板名称', trigger: 'blur' }
@@ -122,14 +124,15 @@
     },
     methods: {
       // 打开弹窗
-      open(type = 'add', data) {
+      open(type = 'add', data,isChange) {
         this.type = type;
         this.visible = true;
+        this.isChange=isChange
 
         if (type === 'add') {
           this.title = '新建模板';
         } else {
-          this.title = '编辑模板';
+          this.title = type === 'view' ? '模板详情' : '编辑模板';
           this.getDetail(data.id);
         }
       },
@@ -172,6 +175,8 @@
             let res;
             if (this.type === 'add') {
               res = await saveQmsReportTemplate(payload);
+            } else if(this.isChange){
+              res = await changeQmsReportTemplate(payload);
             } else {
               res = await updateQmsReportTemplate(payload);
             }

+ 44 - 74
src/views/rulesManagement/inspectionReportTemplate/components/preview.vue

@@ -7,84 +7,77 @@
     resizable
     maxable
   >
-    <div v-loading="loading || saving">
+    <div class="switch" v-if="type == 'view'">
+      <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>
+    <div v-show="activeComp == 'main'">
       <div v-html="addForm.valueJson?.template"></div>
     </div>
-
+    <bpmDetail
+      v-if="activeComp == 'bpm' && addForm.processInstanceId"
+      :id="addForm.processInstanceId"
+    ></bpmDetail>
     <template v-slot:footer>
-      <!-- <el-button
-        type="primary"
-        :loading="saving"
-        :disabled="saving"
-        @click="submit"
-        >提 交</el-button
-      > -->
-      <el-button :disabled="saving" @click="handleClose">取 消</el-button>
+      <el-button @click="handleClose">取 消</el-button>
     </template>
   </ele-modal>
 </template>
 
 <script>
+  import bpmDetail from '@/views/bpm/processInstance/businessDetail.vue';
+
   import dictMixins from '@/mixins/dictMixins';
   import {
     getQmsReportTemplateById,
     updateQmsReportTemplate,
     saveQmsReportTemplate
   } from '@/api/qmsreporttemplate/index';
-
+  const formBaseData = {
+    code: '',
+    id: null,
+    isEnabled: 0,
+    name: '',
+    remark: '',
+    type: 0,
+    isDefault: 0, // 是否启用(1:默认;0:否)
+    valueJson: '' // 模板内容
+  };
   export default {
     mixins: [dictMixins],
     data() {
-      const formBaseData = {
-        code: '',
-        id: null,
-        isEnabled: 0,
-        name: '',
-        remark: '',
-        type: 0,
-        isDefault: 0,  // 是否启用(1:默认;0:否)
-        valueJson: ''  // 模板内容
-      };
-
       return {
+        activeComp: 'main',
+        tabOptions: [
+          { key: 'main', name: '模板详情' },
+          { key: 'bpm', name: '流程详情' }
+        ],
         visible: false,
         type: 'add',
-        title: '表单弹窗',
-        formBaseData,
         addForm: JSON.parse(JSON.stringify(formBaseData)),
-        loading: false,
-        saving: false,
-        rules: {
-          name: [
-            { required: true, message: '请输入模板名称', trigger: 'blur' }
-          ],
-          code: [
-            { required: true, message: '请输入模板编码', trigger: 'blur' },
-            {
-              min: 1,
-              max: 50,
-              message: '长度在 1 到 50 个字符',
-              trigger: 'blur'
-            }
-          ],
-          remark: [
-            { max: 200, message: '备注最多 200 个字符', trigger: 'blur' }
-          ]
-        }
+        loading: false
       };
     },
+    components: { bpmDetail },
     methods: {
       // 打开弹窗
       open(type, data) {
         this.type = type;
         this.visible = true;
+        this.activeComp = 'main';
 
-        if (type === 'add') {
-          this.title = '新建模板';
-        } else {
-          this.title = '预览模板';
-          this.getDetail(data.id);
-        }
+        this.title = '预览模板';
+        this.getDetail(data.id);
       },
       // 获取详情
       async getDetail(id) {
@@ -92,7 +85,7 @@
         try {
           const data = await getQmsReportTemplateById(id);
           console.log('data', data);
-          this.addForm = Object.assign({}, this.formBaseData, data || {});
+          this.addForm = Object.assign({}, formBaseData, data || {});
         } catch (e) {
           this.$message.error('获取模板详情失败');
         } finally {
@@ -100,7 +93,7 @@
         }
       },
       resetForm() {
-        this.addForm = JSON.parse(JSON.stringify(this.formBaseData));
+        this.addForm = JSON.parse(JSON.stringify(formBaseData));
         this.$nextTick(() => {
           this.$refs.formRef && this.$refs.formRef.clearValidate();
         });
@@ -109,29 +102,6 @@
       handleClose() {
         this.visible = false;
         this.resetForm();
-      },
-      // 提交
-      submit() {
-        this.$refs.formRef.validate(async (valid) => {
-          if (!valid) return;
-          this.saving = true;
-          try {
-            const payload = { ...this.addForm };
-            let res;
-            if (this.type === 'add') {
-              res = await saveQmsReportTemplate(payload);
-            } else {
-              res = await updateQmsReportTemplate(payload);
-            }
-            this.$message.success('保存成功');
-            this.$emit('reload');
-            this.handleClose();
-          } catch (e) {
-            this.$message.error(e?.message || '保存失败');
-          } finally {
-            this.saving = false;
-          }
-        });
       }
     }
   };

+ 76 - 9
src/views/rulesManagement/inspectionReportTemplate/index.vue

@@ -19,23 +19,42 @@
             >新建</el-button
           >
         </template>
+        <template v-slot:code="{ row }">
+          <el-link
+            type="primary"
+            :underline="false"
+            @click="preview(row, 'view')"
+            >{{ row.code }}</el-link
+          >
+        </template>
         <template v-slot:action="{ row }">
           <el-link
             type="primary"
             :underline="false"
             icon="el-icon-edit"
             @click="openEdit('edit', row)"
+            v-if="row.isUpdate != 1 && [0, 3].includes(row.approvalStatus)"
           >
             编辑
           </el-link>
-          <!-- <el-link
+          <el-link
             type="primary"
             :underline="false"
             icon="el-icon-edit"
-            @click="openEdit('edit', row)"
+            @click="approvalSubmit(row)"
+            v-if="row.isUpdate != 1 && [0, 3].includes(row.approvalStatus)"
           >
-            发布模板
-          </el-link> -->
+            发布
+          </el-link>
+          <el-link
+            type="primary"
+            :underline="false"
+            icon="el-icon-edit"
+            @click="openEdit('edit', row, true)"
+            v-if="row.isUpdate != 1 && [2].includes(row.approvalStatus)"
+          >
+            变更
+          </el-link>
           <el-link
             type="primary"
             :underline="false"
@@ -48,6 +67,7 @@
             class="ele-action"
             title="确定要删除此条数据吗?"
             @confirm="remove(row.id)"
+            v-if="row.isUpdate != 1 && [0, 3].includes(row.approvalStatus)"
           >
             <template v-slot:reference>
               <el-link type="danger" :underline="false" icon="el-icon-delete">
@@ -61,6 +81,12 @@
 
     <edit ref="editRef" @reload="reload"></edit>
     <preview ref="previewRef" @reload="reload"></preview>
+    <processSubmitDialog
+      :processSubmitDialogFlag.sync="processSubmitDialogFlag"
+      v-if="processSubmitDialogFlag"
+      ref="processSubmitDialogRef"
+      @reload="search"
+    ></processSubmitDialog>
   </div>
 </template>
 
@@ -73,10 +99,11 @@
   } from '@/api/qmsreporttemplate/index';
   import edit from './components/edit.vue';
   import preview from './components/preview.vue';
+  import processSubmitDialog from '@/components/processSubmitDialog/processSubmitDialog.vue';
 
   export default {
     mixins: [dictMixins, tableColumnsMixin],
-    components: { edit, preview },
+    components: { edit, preview, processSubmitDialog },
     data() {
       return {
         columns: [
@@ -91,6 +118,7 @@
             prop: 'code',
             label: '模板编码',
             align: 'center',
+            slot: 'code',
             minWidth: 110,
             showOverflowTooltip: true
           },
@@ -118,6 +146,14 @@
               }
             }
           },
+          {
+            label: '版本号',
+            prop: 'version',
+            align: 'center',
+            formatter: (row) => {
+              return `${row.versionSymbol}${row.bigVersion}${row.versionMark}${row.smallVersion}`;
+            }
+          },
           {
             prop: 'remark',
             label: '备注',
@@ -125,6 +161,20 @@
             minWidth: 110,
             showOverflowTooltip: true
           },
+          {
+            label: '状态',
+            prop: 'approvalStatus',
+            formatter: (row) => {
+              return row.approvalStatus == 0
+                ? '待发布'
+                : row.approvalStatus == 1
+                ? '审批中'
+                : row.approvalStatus == 2
+                ? '已发布'
+                : '审核不通过';
+            },
+            align: 'center'
+          },
           {
             columnKey: 'action',
             label: '操作',
@@ -136,6 +186,7 @@
             showOverflowTooltip: true
           }
         ],
+        processSubmitDialogFlag: false,
         cacheKeyUrl: 'mes-259231040-material-table'
       };
     },
@@ -184,11 +235,27 @@
           this.reload();
         });
       },
-      openEdit(type, data) {
-        this.$refs.editRef.open(type, data);
+      openEdit(type, data, isChange) {
+        this.$refs.editRef.open(type, data, isChange);
       },
-      preview(row) {
-        this.$refs.previewRef.open('edit', row);
+      preview(row,type) {
+        this.$refs.previewRef.open(type, row);
+      },
+      async approvalSubmit(res) {
+        this.processSubmitDialogFlag = true;
+        this.$nextTick(() => {
+          let params = {
+            businessId: res.id,
+            businessKey: 'qms_quality_report_template_release',
+            formCreateUserId: res.createUserId,
+            variables: {
+              businessCode: res.code,
+              businessName: res.name,
+              businessType: '模板变更'
+            }
+          };
+          this.$refs.processSubmitDialogRef.init(params);
+        });
       }
     }
   };

+ 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({

+ 4 - 4
src/views/rulesManagement/releaseRules/components/editTypeModal.vue

@@ -30,7 +30,7 @@
       <el-form-item label="模块划分" prop="reportWorkType">
         <dict-selection
           v-model="form.reportWorkType"
-          dictName="记录规则报工类型"
+          :dictName="businessType==3?'实验报工类型':'记录规则报工类型'"
           placeholder="请选择模块划分"
           @itemChange="(data) => (form.reportWorkName = data.dictValue)"
         />
@@ -38,7 +38,7 @@
       <el-form-item label="应用场景" prop="sceneType">
         <dict-selection
           v-model="form.sceneType"
-          dictName="记录规则类型"
+          :dictName="businessType==3?'实验规则类型':'记录规则类型'"
           placeholder="请选择应用场景"
           @itemChange="(data) => (form.sceneName = data.dictValue)"
         />
@@ -47,7 +47,7 @@
       <el-form-item label="模板样式" prop="templateStyleType">
         <dict-selection
           v-model="form.templateStyleType"
-          dictName="记录表模板样式"
+          :dictName="businessType==3?'实验模板样式':'记录表模板样式'"
           placeholder="请选择模板样式"
           @itemChange="(data) => (form.templateStyleName = data.dictValue)"
         />
@@ -141,7 +141,7 @@
         if (type == 'add') {
           if (this.businessType) {
             this.form.businessType = this.businessType + '';
-            this.form.businessName = this.businessType == '1' ? '生产' : '质检';
+            this.form.businessName = this.businessType == '1' ? '生产' :this.businessType == '2' ? '质检':'实验';
           }
           this.title = '新增类型';
           if (data) {

+ 17 - 1
src/views/rulesManagement/releaseRules/components/experimentationProcess.vue

@@ -21,7 +21,7 @@
         group="project1"
         :animation="300"
         handle=".sort-handle"
-        style="flex: 1"
+        style="flex: 1;max-height:calc(100vh - 500px);overflow: auto;"
       >
         <div
           class="demo-drag-list-item ele-cell"
@@ -62,6 +62,7 @@
               @calculation="calculation"
               @editShow="editShowFn"
               :readonly="readonly"
+              @copy="copy"
               :edit="edit"
             ></customTable>
           </div>
@@ -504,6 +505,21 @@
           valueObj: {}
         });
       },
+      copy(data) {
+        console.log(data, 'asdasd');
+        let id = generateRandomString(6);
+        this.list.push({
+          id,
+          type: 'customTable',
+          ...data
+        });
+        this.$nextTick(() => {
+          this.$refs['customTextRef' + id][0].init({
+            form: null,
+            ...data
+          });
+        });
+      },
       getValue() {
         this.list.forEach((item, index) => {
           let { form, valueObj, equation, units } =

+ 20 - 34
src/views/rulesManagement/releaseRules/components/permitAdd.vue

@@ -137,7 +137,7 @@
             label="启用日期"
             prop="startDate"
             :rules="
-              !qmsReportWorkType.includes(formData.reportWorkType)
+              businessType != 3
                 ? [
                     {
                       required: true,
@@ -173,7 +173,7 @@
             label="停用日期"
             prop="stopDate"
             :rules="
-              !qmsReportWorkType.includes(formData.reportWorkType)
+              businessType != 3
                 ? [
                     {
                       required: true,
@@ -194,7 +194,7 @@
             />
           </el-form-item>
         </el-col>
-        <el-col v-if="formData.recordTemplateStyle == '2'" :span="8">
+        <el-col v-if="formData.recordTemplateStyle == '2'&&this.businessType != 3" :span="8">
           <el-form-item label="关联设备" prop="deviceName" required>
             <el-input
               v-model="formData.deviceName"
@@ -207,7 +207,7 @@
             </el-input>
           </el-form-item>
         </el-col>
-        <el-col v-if="formData.reportWorkType == 2" :span="8">
+        <el-col v-if="formData.reportWorkType == 2&&this.businessType != 3" :span="8">
           <el-form-item label="关联工序">
             <el-input
               v-model="formData.produceTaskName"
@@ -227,7 +227,7 @@
             </el-input>
           </el-form-item>
         </el-col>
-        <el-col v-if="formData.reportWorkType == 2" :span="8">
+        <el-col v-if="formData.reportWorkType == 2&&this.businessType != 3" :span="8">
           <el-form-item label="是否有执行方式" label-width="130px">
             <el-radio-group
               v-model="formData.isExecuteMethod"
@@ -239,7 +239,7 @@
           </el-form-item>
         </el-col>
         <el-col
-          v-if="formData.isExecuteMethod == 1 && formData.reportWorkType == 2"
+          v-if="formData.isExecuteMethod == 1 && formData.reportWorkType == 2&&this.businessType != 3"
           :span="8"
         >
           <el-form-item label="执行方式" required prop="executeMethodId">
@@ -261,7 +261,7 @@
           </el-form-item>
         </el-col>
       </el-row>
-      <el-row v-if="!qmsReportWorkType.includes(formData.reportWorkType)">
+      <el-row v-if="businessType != 3">
         <el-col :span="24">
           <el-form-item label="周期" prop="frequencyValue" required>
             <rule-cycle
@@ -274,17 +274,10 @@
         </el-col>
       </el-row>
 
-      <header-title
-        title="规则明细"
-        v-if="!qmsReportWorkType.includes(formData.reportWorkType)"
-      >
-      </header-title>
+      <header-title title="规则明细" v-if="businessType != 3"> </header-title>
 
       <el-tabs
-        v-if="
-          formData.recordTemplateStyle == '4' &&
-          !qmsReportWorkType.includes(formData.reportWorkType)
-        "
+        v-if="formData.recordTemplateStyle == '4' && businessType != 3"
         v-model="statisticsType"
         type="card"
       >
@@ -298,7 +291,7 @@
       </el-tabs>
 
       <ele-pro-table
-        v-if="!qmsReportWorkType.includes(formData.reportWorkType)"
+        v-if="businessType != 3"
         ref="table"
         :columns="bankColumns"
         :datasource="detialsDatasource"
@@ -584,22 +577,19 @@
 
       <header-title
         :title="
-          formData.reportWorkType == 5
+          formData.reportWorkType == 1
             ? '实验过程'
-            : formData.reportWorkType == 6
-            ? '工艺要求'
-            : formData.reportWorkType == 7
+            : formData.reportWorkType == 2
             ? '实验记录'
             : ''
         "
-        v-if="qmsReportWorkType.includes(formData.reportWorkType)"
+        v-if="businessType == 3"
       >
       </header-title>
       <experimentationProcess
         :edit="type != 'detail'"
         :readonly="type == 'detail'"
-
-        v-if="qmsReportWorkType.includes(formData.reportWorkType)"
+        v-if="businessType == 3"
         ref="experimentationProcess"
       ></experimentationProcess>
     </el-form>
@@ -704,7 +694,7 @@
         type: Object,
         default: () => null
       },
-      businessType:''
+      businessType: ''
     },
     computed: {
       bankColumns() {
@@ -1039,7 +1029,6 @@
       };
 
       return {
-        qmsReportWorkType: ['5', '6', '7'],
         dialogTitle: '',
         visible: false,
         formDateBase,
@@ -1277,7 +1266,7 @@
             this.$refs.cycleMultipleRef?.setRecordRulesCycleList(
               this.formData.recordRulesCycleList
             );
-            if (this.qmsReportWorkType.includes(this.formData.reportWorkType)) {
+            if (this.businessType == 3) {
               this.$refs.experimentationProcess.init(data.tempJson.tempJson);
             }
           });
@@ -1378,10 +1367,7 @@
           if (!valid) {
             return false;
           }
-          if (
-            this.formData.details.length == 0 &&
-            !this.qmsReportWorkType.includes(this.formData.reportWorkType)
-          ) {
+          if (this.formData.details.length == 0 && this.businessType != 3) {
             return this.$message.warning('至少选择一条规则项');
           }
 
@@ -1424,7 +1410,7 @@
           if (!valid) {
             return false;
           }
-          if (!this.qmsReportWorkType.includes(this.formData.reportWorkType)) {
+          if (this.businessType != 3) {
             if (this.formData.details.length == 0) {
               return this.$message.warning('至少选择一条规则项');
             }
@@ -1638,7 +1624,7 @@
           body.stopDate,
           'yyyy-MM-dd HH:mm:ss'
         );
-        if (this.qmsReportWorkType.includes(body.reportWorkType)) {
+        if (this.businessType == 3) {
           let tempJson = this.$refs.experimentationProcess.getValue();
           if (tempJson) {
             body.tempJson = {
@@ -1862,7 +1848,7 @@
       // 过程控制修改 保存
       processEditSave() {
         // 只验证详情内容
-        if (!this.qmsReportWorkType.includes(this.formData.reportWorkType)) {
+        if (this.businessType != 3) {
           if (this.formData.details.length == 0) {
             return this.$message.warning('至少选择一条规则项');
           }

+ 63 - 53
src/views/rulesManagement/releaseRules/components/templateDiv/customTable.vue

@@ -8,6 +8,7 @@
     <el-button type="primary" @click="addRow(columns[0].length)" v-if="edit"
       >新增行</el-button
     >
+    <el-button type="primary" @click="copy()" v-if="edit">复制表格</el-button>
     <el-checkbox v-model="isMerge" style="margin-left: 10px" v-if="edit"
       >合并单元格</el-checkbox
     >
@@ -320,14 +321,14 @@
           rowspan: 1,
           colspan: 1,
           colspanKey: [],
-          width: width||100,
-          style: { width: width||100 },
+          width: width || 100,
+          style: { width: width || 100 },
           id: generateRandomString(5)
         };
       },
       getIndex(id) {
         let columnIndex, rowIndex;
-        console.log(id);
+
         this.columns.forEach((cell, _columnIndex) => {
           let cellIndex = cell.findIndex((data) => data.id == id);
           if (cellIndex != '-1') {
@@ -360,11 +361,13 @@
         if (item?.colspanKey.length) {
           item.colspanKey.forEach((id) => {
             let { columnIndex } = this.getIndex(id);
-            console.log(columnIndex, 'columnIndex');
 
             this.columns[columnIndex].forEach((cell, rowIndex) => {
               if (cell.colspanKey.length) {
                 //当前删除的列其他行有合并过单元格的处理
+                if (!this.columns[columnIndex + 1]) {
+                  return;
+                }
                 let data = this.columns[columnIndex + 1][rowIndex];
 
                 data.colspan = cell.colspan - 1;
@@ -402,8 +405,11 @@
         }
 
         this.columns.forEach((item, index) => {
-
-          this.columns[index].splice(_rowIndex + 1, 0, this.getInput(this.columns[index][_rowIndex-1]?.style.width));
+          this.columns[index].splice(
+            _rowIndex + 1,
+            0,
+            this.getInput(this.columns[index][_rowIndex - 1]?.style.width)
+          );
         });
 
         // }
@@ -437,7 +443,7 @@
               );
             }
           } else if (item[rowIndex].rowspan > 1) {
-            //rowspan大于1,代表合并过单元格,需要吧值继承给下一行
+            //rowspan大于1,代表合并过单元格,需要把值继承给下一行
             let data = item[rowIndex];
             data.rowspan--;
             this.$set(this.columns[columnIndex], [rowIndex + 1], data);
@@ -451,6 +457,7 @@
         if (item.colspanKey.length) {
           this.columns.forEach((cell) => {
             cell.forEach((row) => {
+          
               if (item.colspanKey.includes(row.id)) {
                 width += Number(row.style.width);
               }
@@ -488,28 +495,31 @@
         this.units = units || {};
       },
       editInputChange(domObj) {
-        console.log(domObj, 'domObj');
         let data = JSON.parse(JSON.stringify(domObj));
         if (data.equation) {
-          this.equation[this.domId] = data.equation;
+          this.equation[data.id] = data.equation;
         }
         if (data.units) {
-          this.units[this.domId] = data.units;
+          this.units[data.id] = data.units;
         }
-        let dom = document.getElementById(data.id);
+        let parentDom = document.getElementById(this.id);
+        let dom = parentDom.querySelector('#' + data.id);
 
         this.columns.forEach((item, index) => {
           let rowsIndex = item.findIndex((cells) => cells.id == this.domId);
+          this.$set(this.columns[index], rowsIndex, data);
+          rowsIndex = item.findIndex((cells) => cells.id == data.id);
 
-          if (rowsIndex >= 0) {
-            let width = data.width - dom.parentElement.offsetWidth;
-            let newWidth = this.columns[index][rowsIndex].style.width + width;
-            this.columns[index][0].width = newWidth;
-            this.$set(this.columns[index], rowsIndex, data);
-            item.forEach((cell, _index) => {
-              this.$set(this.columns[index][_index].style, 'width', newWidth);
-              this.$set(this.columns[index][_index], 'width', newWidth);
-            });
+          if (dom) {
+            if (rowsIndex >= 0) {
+              let width = data.width - dom.parentElement.offsetWidth;
+              let newWidth = this.columns[index][rowsIndex].style.width + width;
+              this.columns[index][0].width = newWidth;
+              item.forEach((cell, _index) => {
+                this.$set(this.columns[index][_index].style, 'width', newWidth);
+                this.$set(this.columns[index][_index], 'width', newWidth);
+              });
+            }
           }
         });
       },
@@ -529,12 +539,40 @@
           });
         }
       },
-
+      copy() {
+        let columns = JSON.parse(JSON.stringify(this.columns));
+        columns.forEach((item, index) => {
+          item.forEach((cell) => {
+            if (cell.colspanKey.length&&!cell.copyId) {
+              cell.colspanKey.forEach((key, _index) => {
+                let id = generateRandomString(5);
+                let { columnIndex, rowIndex } = this.getIndex(key);
+                columns[columnIndex][rowIndex]['copyId'] = id;
+                cell.colspanKey[_index] = id;
+              });
+            }
+            if (cell.copyId) {
+              cell.id = cell.copyId;
+            } else {
+              cell.id = generateRandomString(5);
+            }
+          });
+        });
+        this.$emit('copy', {
+          value: null,
+          equation: {},
+          units: {},
+          valueObj: {
+            columns
+          }
+        });
+      },
       inputClick(item, type) {
         if (!this.edit) {
           return;
         }
-        let dom = document.getElementById(item.id);
+        let parentDom = document.getElementById(this.id);
+        let dom = parentDom.querySelector('#' + item.id);
 
         this.domId = item.id;
         this.$emit('editShow', {
@@ -561,19 +599,6 @@
     background-color: #fff;
   }
 
-  .table-header {
-    span {
-      display: inline-block;
-      height: 30px;
-      border: 1px solid #ddd;
-      width: 100px;
-      background-color: #f2f2f2 !important;
-    }
-
-    input {
-      background-color: #f2f2f2 !important;
-    }
-  }
   .table-body {
     white-space: nowrap;
     .column {
@@ -584,29 +609,14 @@
         width: 100%;
       }
       > div:nth-of-type(1) {
-        background-color: #f2f2f2 !important;
+        // background-color: #f2f2f2 !important;
         > input {
-          background-color: #f2f2f2 !important;
+          // background-color: #f2f2f2 !important;
         }
       }
     }
   }
-  // th,
-  // td {
-  //   border: 1px solid #ddd;
-  //   padding: 2px;
-  //   text-align: center;
-  //   height: 30px;
-  // }
-  // th {
-  //   background-color: #f2f2f2;
-  //   > input {
-  //     background-color: #f2f2f2 !important;
-  //   }
-  // }
-  tr:nth-child(even) {
-    background-color: #f9f9f9;
-  }
+
   input:focus {
     border-color: #66afe9; /* 改变边框颜色 */
     outline: none; /* 移除默认的轮廓线 */

+ 15 - 7
src/views/rulesManagement/releaseRules/components/templateDiv/customText.vue

@@ -3,14 +3,16 @@
   <div>
     <el-popover
       style="position: fixed; z-index: 2000"
-      
       ref="popoverRef"
       v-model="rightClickShow"
       @click.native="rightClickShow = false"
     >
-      <div style="display: flex;">
+      <div style="display: flex">
         <el-button type="primary" @click="addHtml">插入输入框</el-button>
-        <el-button style="margin-left: 10px;"type="primary" @click="addHtml('checkbox')"
+        <el-button
+          style="margin-left: 10px"
+          type="primary"
+          @click="addHtml('checkbox')"
           >插入勾选框</el-button
         >
       </div>
@@ -63,7 +65,8 @@
         if (Object.keys(this.valueObj).length) {
           for (let key in this.valueObj) {
             this.$nextTick(() => {
-              let dom = document.getElementById(key);
+              let parentDom = document.getElementById(this.id);
+              let dom = parentDom.querySelector('#' + key);
               dom.value = this.valueObj[key];
               if (dom.type == 'checkbox') {
                 console.log(this.valueObj[key]);
@@ -137,7 +140,8 @@
       },
       equationValue({ domId, value }) {
         if (domId) {
-          let dom = document.getElementById(domId);
+          let parentDom = document.getElementById(this.id);
+          let dom = parentDom.querySelector('#' + domId);
           if (dom) {
             this.valueObj[domId] = value;
             dom.value = value;
@@ -160,7 +164,8 @@
         this.objInit();
       },
       editInputChange(domObj) {
-        let dom = document.getElementById(this.domId);
+        let parentDom = document.getElementById(this.id);
+        let dom = parentDom.querySelector('#' + this.domId);
         dom.style.width = domObj.width + 'px';
         if (domObj.readonly == 2) {
           dom.setAttribute('readonly', 'readonly');
@@ -176,6 +181,7 @@
           this.units[domObj.id] = domObj.units;
         }
         dom.id = domObj.id;
+        this.domId = domObj.id;
       },
       onRightClick(PointerEvent) {
         this.rightClickShow = true;
@@ -192,7 +198,7 @@
       inputChange(event) {
         if (event.target && event.target.className == 'templateInput') {
           if (event.target.type == 'checkbox') {
-            this.valueObj[event.target.id] = event.target.checked
+            this.valueObj[event.target.id] = event.target.checked;
           } else {
             this.valueObj[event.target.id] = event.target.value;
           }
@@ -221,6 +227,8 @@
     },
 
     mounted() {
+      // let parentDom = document.getElementById(this.id);
+      // let dom = parentDom.querySelector('#' + this.domId);
       this.$nextTick(() => {
         document
           .getElementById(this.id)

+ 37 - 17
src/views/rulesManagement/releaseRules/index.vue

@@ -190,9 +190,9 @@
       :businessType="
         $route.path == '/releaseRules/productionReleaseRules'
           ? 1
-          : '/releaseRules/qualityReleaseRules'
+          : $route.path == '/releaseRules/qualityReleaseRules'
           ? 2
-          : ''
+          : 3
       "
     />
     <historyModal ref="historyModalRef" />
@@ -202,9 +202,9 @@
       :businessType="
         $route.path == '/releaseRules/productionReleaseRules'
           ? 1
-          : '/releaseRules/qualityReleaseRules'
+          : $route.path == '/releaseRules/qualityReleaseRules'
           ? 2
-          : ''
+          : 3
       "
     ></editTypeModal>
   </div>
@@ -283,7 +283,12 @@
             showOverflowTooltip: true,
             minWidth: 110,
             formatter: (row) => {
-              return this.getDictValue('记录规则报工类型', row.reportWorkType);
+              return this.getDictValue(
+                this.$route.path == '/releaseRules/experimentReleaseRules'
+                  ? '实验报工类型'
+                  : '记录规则报工类型',
+                row.reportWorkType
+              );
             }
           },
           {
@@ -293,7 +298,12 @@
             showOverflowTooltip: true,
             minWidth: 110,
             formatter: (row) => {
-              return this.getDictValue('记录规则类型', row.classify);
+              return this.getDictValue(
+                this.$route.path == '/releaseRules/experimentReleaseRules'
+                  ? '实验规则类型'
+                  : '记录规则类型',
+                row.classify
+              );
             }
           },
           {
@@ -304,7 +314,9 @@
             minWidth: 110,
             formatter: (row) => {
               return this.getDictValue(
-                '记录表模板样式',
+                this.$route.path == '/releaseRules/experimentReleaseRules'
+                  ? '实验模板样式'
+                  : '记录表模板样式',
                 row.recordTemplateStyle
               );
             }
@@ -502,7 +514,11 @@
           ...where,
           ...typeWhere,
           businessType:
-            this.$route.path == '/releaseRules/productionReleaseRules' ? 1 : 2
+            this.$route.path == '/releaseRules/productionReleaseRules'
+              ? 1
+              : this.$route.path == '/releaseRules/qualityReleaseRules'
+              ? 2
+              : 3
         });
       },
       /* 刷新表格 */
@@ -592,7 +608,11 @@
           pageNum: 1,
           size: 99999,
           businessType:
-            this.$route.path == '/releaseRules/productionReleaseRules' ? 1 : 2
+            this.$route.path == '/releaseRules/productionReleaseRules'
+              ? 1
+              : this.$route.path == '/releaseRules/qualityReleaseRules'
+              ? 2
+              : 3
         });
 
         console.log('type list', list);
@@ -701,13 +721,14 @@
           // 默认选中第一个节点
           this.treeNode = this.typeTree.length > 0 ? this.typeTree[0] : null;
           // console.log('this.treeNode`1111111111111111111111`', this.treeNode);
-          if (this.treeNode) {
-            // 默认选中节点
-            this.$nextTick(() => {
+
+          // 默认选中节点
+          this.$nextTick(() => {
+            if (this.treeNode) {
               this.$refs.treeRef.setCurrentKey(this.treeNode.id);
-              this.reload();
-            });
-          }
+            }
+            this.reload();
+          });
         }
 
         console.log('typeTree', this.typeTree);
@@ -771,8 +792,7 @@
     //   display: flex;
     // }
   }
-  :deep(.el-tree-node__children){
+  :deep(.el-tree-node__children) {
     overflow: inherit;
-   
   }
 </style>

+ 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>

+ 18 - 19
src/views/system/organization/components/org-user-edit.vue

@@ -19,6 +19,23 @@
     >
       <el-row :gutter="15">
         <el-col v-bind="styleResponsive ? { sm: 12 } : { span: 12 }">
+          <el-form-item label="所属工厂:">
+            <el-select
+              style="width: 100%"
+              clearable
+              v-model="form.factoryId"
+              filterable
+              :disabled="!!form.loginName"
+              placeholder="请选择所属工厂"
+            >
+              <el-option
+                v-for="item in factoryList"
+                :label="item.name"
+                :value="item.id"
+                :key="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item>
           <el-form-item label="所属机构:" prop="groupId">
             <org-select
               :data="institutionList"
@@ -44,24 +61,6 @@
             ></el-cascader>
           </el-form-item>
 
-          <el-form-item label="所属工厂:">
-            <el-select
-              style="width: 100%"
-              clearable
-              v-model="form.factoryId"
-              filterable
-              :disabled="!!form.loginName"
-              placeholder="请选择所属工厂"
-            >
-              <el-option
-                v-for="item in factoryList"
-                :label="item.name"
-                :value="item.id"
-                :key="item.id"
-              ></el-option>
-            </el-select>
-          </el-form-item>
-
           <el-form-item label="性别:" prop="sex">
             <el-select
               clearable
@@ -135,7 +134,7 @@
               placeholder="请选择省市区"
             />
           </el-form-item>
-          <el-form-item label="生日:" prop="age">
+          <el-form-item label="出生日期:" prop="age">
             <el-date-picker
               style="width: 100%"
               clearable

+ 16 - 8
src/views/system/organization/components/org-user-list.vue

@@ -296,7 +296,13 @@
             showOverflowTooltip: true,
             minWidth: 110
           },
-
+          {
+            prop: 'phone',
+            label: '手机号',
+            sortable: 'custom',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
           {
             prop: 'postName',
             label: '岗位',
@@ -351,7 +357,7 @@
             showOverflowTooltip: true,
             minWidth: 120,
             formatter: (_row, _column, cellValue) => {
-              return _row.code? '已推送' : '未推送';
+              return _row.code ? '已推送' : '未推送';
             }
           },
           {
@@ -483,12 +489,14 @@
     methods: {
       allPushBtn() {
         const dataId = this.selection.map((v) => v.id);
-        employeePush(dataId).then((res) => {
-          this.$message.success('推送成功!');
-          this.reload();
-        }).catch(() => {
-          console.log('推送失败!');
-        });
+        employeePush(dataId)
+          .then((res) => {
+            this.$message.success('推送成功!');
+            this.reload();
+          })
+          .catch(() => {
+            console.log('推送失败!');
+          });
       },
       async addUsers(row) {
         // this.userRow = null;

+ 14 - 2
src/views/system/organization/components/org-user-search.vue

@@ -38,9 +38,20 @@
           />
         </el-form-item>
       </el-col>
+      <el-col v-bind="styleResponsive ? { md: 3 } : { span: 3 }">
+        <el-form-item>
+          <el-input
+            clearable
+            size="small"
+            v-model.trim="where.phone"
+            placeholder="手机号"
+          />
+        </el-form-item>
+      </el-col>
       <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
         <DictSelection
-          dictName="岗位"   placeholder="请选择岗位"
+          dictName="岗位"
+          placeholder="请选择岗位"
           clearable
           filterable
           v-model="where.postId"
@@ -82,7 +93,8 @@
         jobNumber: '',
         loginName: '',
         name: '',
-        postId:[],
+        phone:'',
+        postId: []
       };
       return {
         // 表单数据

+ 8 - 2
src/views/system/role/components/role-edit.vue

@@ -18,7 +18,7 @@
         />
       </el-form-item>
       <el-form-item label="编码:" prop="code">
-        <el-input placeholder=" " v-model="form.code" />
+        <el-input placeholder=" " v-model="form.code" :disabled="true" />
       </el-form-item>
       <el-form-item label="启用状态:" prop="enable">
         <el-switch
@@ -83,6 +83,8 @@
   import { addRole, putRoles } from '@/api/system/role';
   import { listOrganizations } from '@/api/system/organization';
   import { secretLevelList } from '@/enum/dict';
+  import { getCode } from '@/api/codeManagement/index.js';
+
   export default {
     props: {
       // 弹窗是否打开
@@ -100,7 +102,8 @@
         enable: 1,
         dataScope: '',
         dataScopeDeptIds: '',
-        secretLevel: 1,code:''
+        secretLevel: 1,
+        code: ''
       };
       return {
         defaultForm,
@@ -220,6 +223,9 @@
             this.isUpdate = true;
           } else {
             this.isUpdate = false;
+            getCode('role_code').then((res) => {
+              this.$set(this.form, 'code', res);
+            });
           }
         } else {
           this.$refs.form.clearValidate();

+ 2 - 2
vue.config.js

@@ -35,9 +35,9 @@ module.exports = {
         // target: 'http://192.168.1.3:18086',
         // target: 'http://192.168.1.158:18086',
         // target: 'http://192.168.1.176:18086',
-        // target: 'http://192.168.1.125:18086',
+        target: 'http://192.168.1.125:18086',
         // target: 'http://192.168.1.251:18186',
-        target: 'http://192.168.1.251:18086',
+        // target: 'http://192.168.1.251:18086',
         // target: 'http://192.168.1.251:18186',
         // target: 'http://192.168.1.125:18086',
         // target: 'http://192.168.1.251:18186', // 测试环境