Parcourir la source

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

ysy il y a 2 ans
Parent
commit
5ea8e299b0

+ 9 - 12
src/api/ruleManagement/matter.js

@@ -1,7 +1,7 @@
 import request from '@/utils/request';
 
 // 更新或保存
-export async function saveOrUpdate (data) {
+export async function saveOrUpdate(data) {
   const res = await request.post('/main/ruleinfo/saveOrEdit', data);
   if (res.data.code == 0) {
     return res.data;
@@ -10,7 +10,7 @@ export async function saveOrUpdate (data) {
 }
 
 // 生成编码
-export async function getCode (code) {
+export async function getCode(code) {
   const res = await request.get(`/main/codemanage/getCode/` + code, {});
   if (res.data.code == 0) {
     return res.data.data;
@@ -19,8 +19,8 @@ export async function getCode (code) {
 }
 
 // 获取规则列表页
-export async function getList (data) {
-	let par = new URLSearchParams(data);
+export async function getList(data) {
+  let par = new URLSearchParams(data);
   const res = await request.get(`/main/ruleinfo/page?` + par, {});
   if (res.data.code == 0) {
     return res.data.data;
@@ -29,7 +29,7 @@ export async function getList (data) {
 }
 
 // 获取规则详情
-export async function getDetail (id) {
+export async function getDetail(id) {
   const res = await request.get(`/main/ruleinfo/getById/` + id, {});
   if (res.data.code == 0) {
     return res.data.data;
@@ -37,25 +37,22 @@ export async function getDetail (id) {
   return Promise.reject(new Error(res.data.message));
 }
 
-
 /**
  * 删除事项
  */
 export async function removeRule(data) {
-  const res = await request.delete('/main/ruleinfo/delete', { data } );
+  const res = await request.delete('/main/ruleinfo/delete', { data });
   if (res.data.code == 0) {
     return res.data.data;
   }
   return Promise.reject(new Error(res.data.message));
 }
 
-
-// 获取仓库列表 
-export async function getWarehouseList (params) {
-  const res = await request.get('/wms/warehouse/page',  params );
+// 获取仓库列表
+export async function getWarehouseList(params) {
+  const res = await request.get('/wms/warehouse/page', params);
   if (res.data.code == 0) {
     return res.data.data;
   }
   return Promise.reject(new Error(res.data.message));
 }
-

+ 267 - 0
src/views/rulesManagement/inspectionPoint/components/MaterialAdd.vue

@@ -0,0 +1,267 @@
+<template>
+  <el-dialog
+    :title="title"
+    :visible.sync="visible"
+    :before-close="handleClose"
+    class="productModal_dialog"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    append-to-body
+    width="70%"
+  >
+    <el-card shadow="never">
+      <ele-split-layout
+        width="244px"
+        allow-collapse
+        :right-style="{ overflow: 'hidden' }"
+      >
+        <div class="ele-border-lighter split-layout-right-content">
+          <el-tree
+            :data="treeList"
+            :props="defaultProps"
+            ref="treeRef"
+            :expand-on-click-node="false"
+            :default-expanded-keys="categoryId ? [categoryId] : []"
+            :highlight-current="true"
+            node-key="id"
+            @node-click="handleNodeClick"
+          ></el-tree>
+        </div>
+
+        <!-- 数据表格 -->
+        <template v-slot:content>
+          <ProductSearch @search="reload" ref="searchRef" />
+          <ele-pro-table
+            style="min-height: 400px"
+            ref="table"
+            :columns="columns"
+            :datasource="datasource"
+            :selection.sync="selection"
+            row-key="id"
+            :initLoad="false"
+          >
+            <template v-slot:modelType="{ row }">
+              <span>{{ row.category.modelType }}</span>
+            </template>
+            <template v-slot:specification="{ row }">
+              <span>{{ row.category.specification }}</span>
+            </template>
+            <template v-slot:pathName="{ row }">
+              <span>{{ row.position[0].pathName }}</span>
+            </template>
+          </ele-pro-table>
+        </template>
+      </ele-split-layout>
+    </el-card>
+
+    <div class="rx-sc">
+      <el-button type="primary" size="small" @click="selected">选择</el-button>
+      <el-button size="small" @click="handleClose">关闭</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+  import ProductSearch from './product-search.vue';
+  import { getAssetList } from '@/api/ruleManagement/plan';
+  import { getTreeByPid } from '@/api/classifyManage';
+  export default {
+    data() {
+      return {
+        ruleIdListIndex: 0,
+        visible: false,
+        title: '选择设备',
+        categoryLevelId: null,
+        categoryId: 1,
+        treeList: [],
+        treeLoading: false,
+        defaultProps: {
+          children: 'children',
+          label: 'name'
+        },
+        type: null,
+        // 表格列配置
+        columns: [
+          {
+            columnKey: 'selection',
+            type: 'selection',
+            width: 45,
+            align: 'center',
+            selectable: (row, index) => {
+              return !this.processData.some((it) => row.id == it.categoryId);
+            },
+            reserveSelection: true,
+            fixed: 'left'
+          },
+          {
+            label: '设备名称',
+            prop: 'name'
+          },
+          {
+            label: '编号',
+            prop: 'codeNumber'
+          },
+          {
+            label: '固资编码',
+            prop: 'fixCode'
+          },
+          {
+            label: '型号',
+            prop: 'modelType',
+            slot: 'modelType'
+          },
+          {
+            label: '规格',
+            prop: 'specification',
+            slot: 'specification'
+          },
+          {
+            label: '设备位置',
+            prop: 'pathName',
+            slot: 'pathName'
+          }
+        ],
+
+        // 表格选中数据
+        selection: [],
+        processData: []
+      };
+    },
+    components: {
+      ProductSearch
+    },
+    methods: {
+      /* 表格数据源 */
+      async datasource({ page, limit, where }) {
+        const res = await getAssetList({
+          ...where,
+          pageNum: page,
+          size: limit,
+          categoryLevelId: this.categoryLevelId,
+          rootCategoryLevelId: this.rootId
+        });
+        console.log('res---------', res);
+        this.categoryId = res.list[0]?.categoryId;
+        return res;
+      },
+      open(equipmentList, ruleIdListIndex) {
+        this.processData = equipmentList || [];
+        this.ruleIdListIndex = ruleIdListIndex;
+        this.visible = true;
+        this.getTreeData();
+      },
+
+      async getTreeData() {
+        try {
+          this.treeLoading = true;
+
+          const res = await getTreeByPid(4);
+          this.treeLoading = false;
+          if (res?.code === '0') {
+            this.treeList = res.data;
+            return this.treeList;
+          }
+        } catch (error) {}
+        this.treeLoading = false;
+      },
+
+      handleNodeClick(data) {
+        this.rootId = data.rootCategoryLevelId;
+        this.categoryLevelId = data.id;
+        this.$refs.table.reload({ pageNum: 1, where: {} });
+      },
+
+      /* 刷新表格 */
+      reload(where) {
+        if (this.rootId && this.categoryLevelId) {
+          this.$refs.table.reload({ page: 1, where: where });
+        } else {
+          this.$message.error('请选择设备');
+        }
+      },
+
+      handleClose() {
+        this.visible = false;
+        this.$refs.table.setSelectedRows([]);
+        this.selection = [];
+      },
+      selected() {
+        if (!this.selection.length) {
+          this.$message.error('请至少选择一条数据');
+          return;
+        }
+        const selectList = this.$refs.treeRef.getCheckedNodes();
+        console.log('selectList-----------', selectList);
+        this.$emit(
+          'chooseEquipment',
+          this.selection,
+          this.ruleIdListIndex,
+          this.categoryId
+        );
+        this.handleClose();
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .productModal_dialog {
+    overflow: hidden;
+    ::v-deep .el-dialog {
+      margin: 50px auto !important;
+      height: 90%;
+      overflow: hidden;
+
+      .el-dialog__body {
+        position: absolute;
+        left: 0;
+        top: 54px;
+        bottom: 0;
+        right: 0;
+        padding: 0;
+        z-index: 1;
+        overflow: hidden;
+        overflow-y: auto;
+        // 下边设置字体,我的需求是黑底白字
+        color: #ffffff;
+        line-height: 30px;
+        padding: 0 15px;
+        display: flex;
+        flex-direction: column;
+        > div {
+          flex: 1;
+          .el-card__body {
+            height: 100%;
+            display: flex;
+            flex-direction: column;
+            > div {
+              flex: 1;
+              .ele-split-panel-body {
+                > div {
+                  height: 100%;
+                  display: flex;
+                  flex-direction: column;
+                  .el-table {
+                    flex: 1 0 auto;
+                    height: 0;
+                    overflow: auto;
+                  }
+                }
+              }
+            }
+          }
+        }
+        .rx-sc {
+          flex: 0 0 50px;
+          display: flex;
+          align-items: center;
+          justify-content: center;
+        }
+      }
+    }
+  }
+
+  .ml60 {
+    margin-left: 60px;
+  }
+</style>

+ 1056 - 0
src/views/rulesManagement/inspectionPoint/components/MaterialModal.vue

@@ -0,0 +1,1056 @@
+<template>
+  <ele-modal
+    width="80%"
+    :visible="visible"
+    v-if="visible"
+    :append-to-body="true"
+    custom-class="ele-dialog-form"
+    :title="title"
+    @update:visible="updateVisible"
+  >
+    <header-title title="基本信息"></header-title>
+    <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-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-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-option :value="1" label="是"></el-option>
+              <el-option :value="0" label="否"></el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+
+        <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"
+              >
+                <template #suffix>分钟</template>
+              </el-input>
+            </div>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="8">
+          <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>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8" v-if="addForm.autoOrder">
+          <el-form-item :label="formLabel + '部门'" prop="groupId">
+            <deptSelect
+              v-model="addForm.groupId"
+              @changeGroup="searchDeptNodeClick"
+              :disabled="isBindPlan"
+            />
+          </el-form-item>
+        </el-col>
+        <el-col :span="8" v-if="addForm.autoOrder">
+          <el-form-item :label="formLabel + '人员'" prop="executeIdList">
+            <el-select
+              v-model="addForm.executeIdList"
+              size="small"
+              style="width: 100%"
+              :disabled="isBindPlan"
+              multiple
+              filterable
+            >
+              <el-option
+                v-for="item in executorList"
+                :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>
+          </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-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-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.ruleName"
+          :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"
+                    @click="handleAdd(item.equipmentList, ruleIdListIndex)"
+                    >新增</el-button
+                  >
+                </div>
+              </header-title>
+              <el-table :data="item.equipmentList" border>
+                <el-table-column label="序号" type="index" width="50">
+                </el-table-column>
+                <el-table-column label="设备名称" align="center" prop="name">
+                  <template slot-scope="{ row, $index }">
+                    <template>
+                      {{ row.category.name }}
+                    </template>
+                  </template>
+                </el-table-column>
+                <el-table-column label="编号" align="center" prop="codeNumber">
+                  <template slot-scope="{ row, $index }">
+                    <template>
+                      {{ row.codeNumber }}
+                    </template>
+                  </template>
+                </el-table-column>
+                <el-table-column label="固资编码" align="center" prop="fixCode">
+                  <template slot-scope="{ row, $index }">
+                    <template>
+                      {{ row.category.fixCode }}
+                    </template>
+                  </template>
+                </el-table-column>
+              </el-table>
+            </div>
+            <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
+                  >
+                </div>
+              </header-title>
+              <el-table :data="item.ruleItems" border>
+                <el-table-column label="序号" width="50">
+                  <template slot-scope="scope">
+                    <span>{{ scope.$index + 1 }}</span>
+                  </template>
+                </el-table-column>
+                <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>
+                    </div>
+                    <div v-else>
+                      <span>{{ scope.row.name }}</span>
+                    </div>
+                  </template>
+                </el-table-column>
+                <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>
+                    </div>
+                    <div v-else>
+                      <span>{{ scope.row.content }}</span>
+                    </div>
+                  </template>
+                </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="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
+                          >
+                        </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
+                          >
+                        </template>
+                      </div>
+                    </div>
+                  </template>
+                </el-table-column>
+                <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>
+                    </div>
+                    <div v-else>
+                      <span>{{ scope.row.norm }}</span>
+                    </div>
+                  </template>
+                </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
+                    >
+                  </template>
+                </el-table-column>
+              </el-table>
+            </div>
+          </div>
+        </el-tab-pane>
+      </el-tabs>
+    </el-form>
+    <template v-slot:footer>
+      <el-button @click="visible = false">取消</el-button>
+      <el-button type="primary" @click="save"> 保存 </el-button>
+    </template>
+    <!-- 新增设备 -->
+    <MaterialAdd ref="productRefs" @chooseEquipment="chooseEquipment">
+    </MaterialAdd>
+    <!--  -->
+    <operation-guideDialog ref="operationGuideDialog" @save="saveEdit" />
+    <!-- 添加规则 -->
+    <ele-modal
+      width="800px"
+      :visible="addDialog"
+      :append-to-body="true"
+      title="规则配置"
+      :close-on-click-modal="true"
+      @update:visible="closeAdd"
+    >
+      <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.name"
+          @click.native="ruleObj.ruleName = item.name"
+        ></el-option>
+      </el-select>
+      <template v-slot:footer>
+        <el-button @click="addDialog = false">取消</el-button>
+        <el-button type="primary" @click="addRule"> 添加 </el-button>
+      </template>
+    </ele-modal>
+  </ele-modal>
+</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 { 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 '新增巡检点计划配置';
+        }
+      },
+      title: {
+        type: String,
+        default: ''
+      },
+      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: '',
+          ruleName: '',
+          equipmentList: []
+        },
+        ruleIdList: [],
+        addForm: {
+          code: '', // 计划配置单号
+          name: '', // 计划配置名称
+          autoOrder: 1, // 自动派单
+          ruleId: '', // 规则id
+          ruleName: '', // 规则名称
+          duration: null, // 计划完成时长
+          categoryId: '', // 设备类别id
+          approvalUserId: '', // 审核人id
+          groupId: '', // 巡点检部门code
+          executeIdList: [], // 巡点检人员id
+          executorPhone: '',
+          status: 1, // 状态
+          remark: '', // 备注
+          urgent: ''
+        },
+        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' }
+          ],
+          urgent: [
+            { required: true, message: '请选择紧急程度', trigger: 'change' }
+          ]
+        },
+
+        columns: [
+          {
+            type: 'index',
+            width: 55,
+            align: 'center'
+          },
+          {
+            label: '子项编号',
+            prop: 'subCode',
+            action: 'subCode'
+          },
+          {
+            label: '物料名称',
+            prop: 'categoryName',
+            action: 'categoryName'
+          },
+
+          {
+            label: '是否回收料',
+            prop: 'isReworkBom',
+            action: 'isReworkBom',
+            slot: 'isReworkBom',
+            width: 95
+          },
+
+          {
+            label: '物料编码',
+            prop: 'categoryCode'
+          },
+          {
+            label: '牌号',
+            prop: 'brandNum'
+          },
+          {
+            label: '型号',
+            prop: 'modelType'
+          },
+          {
+            label: '数量',
+            prop: 'count'
+          },
+          {
+            label: '计量单位',
+            prop: 'unit'
+          },
+
+          {
+            label: '附件',
+            slot: 'bomArtFiles',
+            action: 'bomArtFiles',
+            minWidth: 100
+          },
+
+          {
+            label: '单位',
+            prop: 'weightUnit'
+          },
+
+          {
+            label: '备注',
+            prop: 'remark'
+          }
+        ],
+
+        statusList: [
+          { label: '草稿', value: -1 },
+          { label: '失效', value: 0 },
+          { label: '生效', value: 1 }
+        ],
+
+        // 提交状态
+        loading: false,
+
+        categoryId: null,
+
+        current: null,
+
+        materialShow: false,
+
+        tabsList: [],
+        tableData: [],
+
+        taskId: null,
+
+        addDialog: false,
+        tabsValue: null
+      };
+    },
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive() {
+        return this.$store.state.theme.styleResponsive;
+      }
+    },
+    watch: {
+      visible(val) {
+        if (val) {
+          this.formLabel = this.dialogTitle.includes('巡点检')
+            ? '巡点检'
+            : this.dialogTitle.includes('保养')
+            ? '保养'
+            : '盘点';
+          // 获取审核人列表数据
+          this.getUserList();
+          // 获取规则名称
+          this._getRuleNameList();
+        }
+      }
+    },
+    methods: {
+      // 初始化
+      async init(row, tips) {
+        console.log(row);
+        console.log(tips);
+        if (row) {
+          this.getInfo(row.id);
+        } else {
+          //  获取计划配置单号
+          this.getOrderCode(tips);
+          this.isBindPlan = false;
+          this.planRuleEquiList = [];
+          //   this.matterRulesList = [];
+        }
+      },
+      save() {
+        console.log(this.addForm);
+        console.log(this.ruleIdList);
+        this.$refs.addFormRef.validate(async (valid) => {
+          if (valid) {
+            try {
+              //   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('保养')
+                ? 2
+                : 3;
+              this.addForm.isBindPlan = this.isBindPlan;
+              let sendMsg = [];
+              this.ruleIdList.forEach((ruleItem) => {
+                let obj = { ...this.addForm };
+                obj.ruleId = ruleItem.ruleId;
+                obj.ruleName = ruleItem.ruleName;
+                obj.deviceInfo = ruleItem.equipmentList.map((item) => {
+                  return {
+                    substanceId: item.position[0].substanceId
+                  };
+                });
+                obj.categoryId = ruleItem.categoryId;
+                obj.ruleItems = ruleItem.ruleItems;
+                sendMsg.push(obj);
+              });
+              const type = this.dialogTitle.includes('新增') ? '新增' : '编辑';
+              let res = await saveOrUpdate(sendMsg);
+              if (res) {
+                this.visible = false;
+                this.$message.success(type + '成功!');
+                this.$emit('done');
+              }
+            } catch (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) {
+        if (isNew) {
+          this.$refs.operationGuideDialog.open(row, index);
+        }
+      },
+      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: []
+          }
+        });
+      },
+      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);
+          const params = { groupId: res.groupId };
+          this.getUserList(params);
+          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', 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);
+        }
+      },
+      //选择部门(搜索)
+      searchDeptNodeClick(info) {
+        if (info) {
+          // 根据部门获取人员
+          const params = { groupId: info };
+          this.getUserList(params);
+        } else {
+          this.addForm.groupId = null;
+        }
+      },
+      // 过滤计划完成时长
+      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() {
+        if (
+          this.dialogTitle === '新增保养计划配置' ||
+          this.dialogTitle === '编辑保养计划配置'
+        ) {
+          const res = await getRule({
+            status: 1,
+            type: 2,
+            pageNum: 1,
+            size: -1
+          });
+          if (res.list) {
+            this.ruleNameList = res.list || [];
+          }
+        }
+        if (
+          this.dialogTitle === '新增巡点检计划配置' ||
+          this.dialogTitle === '编辑巡点检计划配置'
+        ) {
+          const res = await getRule({
+            status: 1,
+            type: 1,
+            pageNum: 1,
+            size: -1
+          });
+          if (res.list) {
+            this.ruleNameList = res.list || [];
+          }
+        }
+      },
+      downloadFile(file) {
+        getFile({ objectName: file.storePath }, file.name);
+      },
+
+      openEdit(index) {
+        this.current = this.form.bomList[index];
+        console.log(this.current);
+        this.materialShow = true;
+      },
+
+      /* 表格数据源 */
+      datasource({ page, limit, where }) {
+        return [];
+      },
+
+      async getVersionList() {
+        const res = await pageList({
+          pageNum: 1,
+          size: 100
+        });
+
+        this.versionList = res.list;
+      },
+
+      handleAdd(equipmentList, ruleIdListIndex) {
+        this.$refs.productRefs.open(equipmentList, ruleIdListIndex);
+      },
+
+      /* 更新visible */
+      updateVisible(value) {
+        this.$emit('update:visible', value);
+      },
+
+      async getCategoryBomFn(taskId) {
+        const res = await getByTaskId(this.categoryId, taskId);
+        this.form.bomList = res;
+      },
+
+      remove(row) {
+        bomDelete([row.id])
+          .then((message) => {
+            this.$message.success(message);
+            this.getCategoryBomFn();
+          })
+          .catch((e) => {
+            this.$message.error(e.message);
+          });
+      },
+
+      done(taskId) {
+        this.materialShow = false;
+        this.getCategoryBomFn(taskId);
+      },
+
+      handleAddTab() {
+        this.tableData = this.tabsList;
+        this.addDialog = true;
+      },
+
+      handleTab(e) {
+        this.ruleIndex = e.index;
+        // this.ruleIdList[e.index].ruleItems = this._getMatterRulesDetails(this.ruleId)
+      },
+
+      removeTab(targetName) {
+        this.$confirm('是否删除当前工序?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        })
+          .then(() => {
+            this.ruleIdList.forEach((e, index) => {
+              if (e.ruleId == targetName) {
+                this.ruleIdList.splice(index, 1);
+                this.$nextTick(() => {
+                  if (this.ruleIdList.length == 1) {
+                    this.tabsValue = this.ruleIdList[0].ruleId;
+                  }
+                });
+              }
+            });
+          })
+          .catch(() => {});
+      },
+
+      /*关闭选择参数*/
+      closeAdd() {
+        this.addDialog = false;
+      },
+      // 规则名称下拉触发
+      handleRuleNameChange(val) {
+        this.ruleId = val;
+        console.log('val----', val);
+        // this._getMatterRulesDetails(val);
+      },
+      // 封装 - 获取规则下面的详情数据及事项
+      async _getMatterRulesDetails(val) {
+        const res = await getDetail(val);
+        return res.ruleItems;
+        // console.log('res------', res);
+        // this.matterRulesList = res.ruleItems;
+      },
+      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.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('请误重复添加规则');
+        }
+      },
+
+      // 保存
+      saveBatchFn() {
+        let arr = [];
+        arr = this.tabsList.map((m) => {
+          return {
+            taskId: m.id,
+            sort: m.sort,
+            categoryId: this.categoryId
+          };
+        });
+
+        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-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;
+      }
+    }
+    .ruleMatters_box {
+      flex: 3;
+      height: 100%;
+      display: flex;
+      flex-direction: column;
+      .divider {
+        flex: 0 0 50px;
+        .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;
+          }
+          .right_content {
+            flex: 1;
+            padding: 10px;
+            box-sizing: border-box;
+            border: 1px solid #c0c4cc;
+            border-radius: 10px;
+            overflow-y: auto;
+          }
+        }
+      }
+    }
+  }
+</style>

+ 99 - 0
src/views/rulesManagement/inspectionPoint/components/product-search.vue

@@ -0,0 +1,99 @@
+<!-- 搜索表单 -->
+<template>
+  <el-form
+    label-width="77px"
+    class="ele-form-search"
+    @keyup.enter.native="search"
+    @submit.native.prevent
+  >
+    <el-row :gutter="10">
+      <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
+        <el-form-item label="设备名称">
+          <el-input clearable v-model="where.name" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
+        <el-form-item label="编号">
+          <el-input clearable v-model="where.codeNumber" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+
+      <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
+        <el-form-item label="固资编码">
+          <el-input clearable v-model="where.fixCode" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { md: 4 } : { md: 4 }">
+        <div class="ele-form-actions">
+          <el-button
+            type="primary"
+            icon="el-icon-search"
+            class="ele-btn-icon"
+            @click="search"
+          >
+            查询
+          </el-button>
+
+          <el-button
+            @click="reset"
+            icon="el-icon-refresh"
+            class="ele-btn-icon"
+            size="medium"
+            >重置</el-button
+          >
+        </div>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+
+<script>
+  export default {
+    data() {
+      // 默认表单数据
+      const defaultWhere = {
+        name: '',
+        codeNumber: '',
+        fixCode: ''
+      };
+      return {
+        defaultWhere,
+        // 表单数据
+        where: { ...defaultWhere },
+        treeData: []
+      };
+    },
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive() {
+        return this.$store.state.theme.styleResponsive;
+      }
+    },
+    created() {},
+    methods: {
+      /* 搜索 */
+      search() {
+        if (this.where.appType === 0) {
+          this.where.appType = '';
+        }
+        this.$emit('search', this.where);
+      },
+      /*  重置 */
+      reset() {
+        this.where = { ...this.defaultWhere };
+        this.search();
+      },
+      reset2() {
+        this.where = { ...this.defaultWhere };
+      }
+    }
+  };
+</script>
+
+<style>
+  .ele-form-actions {
+    display: inline-block;
+    transform: translate(0);
+    transition: all;
+  }
+</style>

+ 16 - 4
src/views/rulesManagement/inspectionPoint/index.vue

@@ -52,17 +52,27 @@
     </el-card>
 
     <!-- 新建或编辑弹窗 -->
-    <AddPatrolConfigDialog
+    <!-- <AddPatrolConfigDialog
       ref="addPatrolConfigDialogRef"
       :dialogTitle="dialogTitle"
       :isBindPlan="isBindPlan"
       @done="reload"
+    /> -->
+    <!-- 新建或编辑弹窗 -->
+    <MaterialModal
+      ref="addPatrolConfigDialogRef"
+      :visible.sync="addPatrolConfigDialog"
+      :dialogTitle="dialogTitle"
+      :isBindPlan="isBindPlan"
+      title="巡检点配置"
+      @done="reload"
     />
   </div>
 </template>
 
 <script>
-  import AddPatrolConfigDialog from '@/components/addPatrolConfigDialog';
+  // import AddPatrolConfigDialog from '@/components/addPatrolConfigDialog';
+  import MaterialModal from './components/MaterialModal';
   import PatrolSearch from './components/patrol-search.vue';
   import { planConfigPage, removeRule } from '@/api/ruleManagement/plan';
   import dictMixins from '@/mixins/dictMixins';
@@ -70,10 +80,12 @@
     mixins: [dictMixins],
     components: {
       PatrolSearch,
-      AddPatrolConfigDialog
+      // AddPatrolConfigDialog,
+      MaterialModal
     },
     data() {
       return {
+        addPatrolConfigDialog: false,
         // 表格列配置
         columns: [
           {
@@ -202,7 +214,7 @@
 
       openEdit(row) {
         this.isBindPlan = false;
-        this.$refs.addPatrolConfigDialogRef.addPatrolConfigDialog = true;
+        this.addPatrolConfigDialog = true;
         if (row) {
           this.dialogTitle = '编辑巡点检计划配置';
         } else {

+ 286 - 0
src/views/rulesManagement/matterRules/components/ProductModal.vue

@@ -0,0 +1,286 @@
+<template>
+  <el-dialog
+    :title="title"
+    :visible.sync="visible"
+    :before-close="handleClose"
+    class="productModal_dialog"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    append-to-body
+    width="70%"
+  >
+    <el-card shadow="never">
+      <ProductSearch @search="reload" ref="searchRef" />
+
+      <ele-split-layout
+        width="244px"
+        allow-collapse
+        :right-style="{ overflow: 'hidden' }"
+      >
+        <div class="ele-border-lighter split-layout-right-content">
+          <el-tree
+            :data="treeList"
+            :props="defaultProps"
+            ref="treeRef"
+            :default-expanded-keys="categoryId ? [categoryId] : []"
+            :highlight-current="true"
+            node-key="id"
+            @node-click="handleNodeClick"
+          ></el-tree>
+        </div>
+
+        <!-- 数据表格 -->
+        <template v-slot:content>
+          <ele-pro-table
+            style="min-height: 400px"
+            ref="table"
+            :columns="columns"
+            :datasource="datasource"
+            :selection.sync="selection"
+            row-key="id"
+          >
+          </ele-pro-table>
+        </template>
+      </ele-split-layout>
+    </el-card>
+
+    <div class="rx-sc">
+      <el-button type="primary" size="small" @click="selected">选择</el-button>
+      <el-button size="small" @click="handleClose">关闭</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+  import ProductSearch from './product-search.vue';
+  import { getTreeByPid } from '@/api/classifyManage';
+  import { getList } from '@/api/classifyManage/itemInformation.js';
+  export default {
+    components: {
+      ProductSearch
+    },
+    data() {
+      return {
+        visible: false,
+        title: '选择工具',
+
+        categoryLevelId: null,
+        categoryId: 1,
+        treeList: [],
+        treeLoading: false,
+
+        defaultProps: {
+          children: 'children',
+          label: 'name'
+        },
+        type: null,
+
+        // 表格列配置
+        columns: [
+          {
+            columnKey: 'selection',
+            type: 'selection',
+            width: 45,
+            align: 'center',
+            selectable: (row, index) => {
+              return !this.processData.some((it) => row.id == it.categoryId);
+            },
+            reserveSelection: true,
+            fixed: 'left'
+          },
+
+          {
+            label: '物料名称',
+            prop: 'name'
+          },
+
+          {
+            label: '物料编码',
+            prop: 'code'
+          },
+          {
+            label: '牌号',
+            prop: 'brandNum'
+          },
+          {
+            label: '型号',
+            prop: 'modelType'
+          },
+
+          {
+            prop: 'availableCountBase',
+            label: '包装库存',
+            sortable: 'custom'
+          },
+          {
+            label: '单位',
+            prop: 'weightUnit'
+          },
+
+          {
+            prop: 'packingCountBase',
+            label: '计量库存',
+            sortable: 'custom'
+          },
+
+          {
+            label: '计量单位',
+            prop: 'unit'
+          },
+
+          {
+            label: '数量',
+            prop: 'count'
+          }
+        ],
+
+        // 表格选中数据
+        selection: [],
+
+        processData: [],
+        current: null
+      };
+    },
+
+    watch: {},
+    methods: {
+      /* 表格数据源 */
+      async datasource({ page, limit, where }) {
+        const res = await getList({
+          ...where,
+          pageNum: page,
+          size: limit,
+          categoryLevelId: this.categoryLevelId
+        });
+        return res;
+      },
+
+      open(item) {
+        this.processData = item || [];
+        this.visible = true;
+
+        this.getTreeData();
+      },
+
+      async getTreeData() {
+        try {
+          this.treeLoading = true;
+
+          const res = await getTreeByPid(0);
+          this.treeLoading = false;
+          if (res?.code === '0') {
+            this.treeList = res.data;
+
+            this.$nextTick(() => {
+              // 默认高亮第一级树节点
+              if (this.treeList[0]) {
+                this.rootTreeId = this.treeList[0].id;
+                this.$nextTick(() => {
+                  this.$refs.treeRef.setCurrentKey(this.treeList[0].id);
+                });
+              }
+            });
+            return this.treeList;
+          }
+        } catch (error) {}
+        this.treeLoading = false;
+      },
+
+      handleNodeClick(data) {
+        this.categoryLevelId = data.id;
+        this.$refs.table.reload({ pageNum: 1, where: {} });
+      },
+
+      /* 刷新表格 */
+      reload(where) {
+        this.$refs.table.reload({ page: 1, where: where });
+      },
+
+      handleClose() {
+        this.visible = false;
+        this.$refs.table.setSelectedRows([]);
+        this.selection = [];
+      },
+      selected() {
+        let _arr = [];
+        if (!this.selection.length) {
+          this.$message.error('请至少选择一条数据');
+          return;
+        }
+
+        _arr = this.selection.map((m) => {
+          m.categoryId = m.id;
+          delete m.id;
+          return {
+            ...m
+          };
+        });
+
+        this.$emit('chooseModal', _arr);
+        this.handleClose();
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .productModal_dialog {
+    overflow: hidden;
+    ::v-deep .el-dialog {
+      margin: 50px auto !important;
+      height: 90%;
+      overflow: hidden;
+
+      .el-dialog__body {
+        position: absolute;
+        left: 0;
+        top: 54px;
+        bottom: 0;
+        right: 0;
+        padding: 0;
+        z-index: 1;
+        overflow: hidden;
+        overflow-y: auto;
+        // 下边设置字体,我的需求是黑底白字
+        color: #ffffff;
+        line-height: 30px;
+        padding: 0 15px;
+        display: flex;
+        flex-direction: column;
+        > div {
+          flex: 1;
+          .el-card__body {
+            height: 100%;
+            display: flex;
+            flex-direction: column;
+            > div {
+              flex: 1;
+              .ele-split-panel-body {
+                > div {
+                  height: 100%;
+                  display: flex;
+                  flex-direction: column;
+                  .el-table {
+                    flex: 1 0 auto;
+                    height: 0;
+                    overflow: auto;
+                  }
+                }
+              }
+            }
+          }
+        }
+        .rx-sc {
+          flex: 0 0 50px;
+          display: flex;
+          align-items: center;
+          justify-content: center;
+        }
+      }
+    }
+  }
+
+  .ml60 {
+    margin-left: 60px;
+  }
+</style>

+ 516 - 404
src/views/rulesManagement/matterRules/components/matter-add.vue

@@ -1,453 +1,565 @@
 <template>
-  <ele-modal
-    :title="dialogTitle"
-    :visible.sync="addMatterDialog"
-    :before-close="handleClose"
-    :close-on-click-modal="false"
-    :close-on-press-escape="false"
-    width="80%"
-  >
-    <el-form
-      :model="formData"
-      v-loading="dialogLoading"
-      ref="contentConfigForm"
-      label-width="100px"
-      :show-message="false"
-      :rules="contentConfigFormRules"
+  <div class="matter-add">
+    <ele-modal
+      :title="dialogTitle"
+      :visible.sync="addMatterDialog"
+      :before-close="handleClose"
+      :close-on-click-modal="false"
+      :close-on-press-escape="false"
+      width="80%"
     >
-      <el-row>
-		<el-col :span="7">
-		  <el-form-item label="规则编码" prop="name">
-		    <el-input
-		      v-model="formData.code"
-		      size="small"
-		      :disabled="true"
-		    ></el-input>
-		  </el-form-item>
-		</el-col>
-        <el-col :span="6">
-          <el-form-item label="规则名称" prop="name">
-            <el-input
-              v-model="formData.name"
-              placeholder="请输入"
-              size="small"
-              :disabled="isBindPlan"
-            ></el-input>
-          </el-form-item>
-        </el-col>
-        <el-col :span="6">
-          <el-form-item label="规则类型" prop="ruleType">
-			  <DictSelection dictName="规则类型" clearable v-model="formData.ruleType">
-			  </DictSelection>
-          </el-form-item>
-        </el-col>
-        <el-col :span="5">
-          <el-form-item label="状态" prop="status" label-width="70px">
-            <el-switch
-              v-model="formData.status"
-              active-text="生效"
-              inactive-text="失效"
-              :active-value="1"
-              :inactive-value="0"
-            >
-            </el-switch>
-          </el-form-item>
-        </el-col>
-        <el-col :span="24">
-          <el-form-item label="周期" prop="cycleValue">
-            <rule-cycle
-              ref="cycleMultipleRef"
-              :formData="formData"
-              :pageType="pageType"
-              :isBindPlan="isBindPlan"
-            />
-          </el-form-item>
-        </el-col>
-      </el-row>
-
-      <el-table
-        ref="multipleTable"
-        v-if="formData.ruleType !== 4"
-        :data="formData.ruleItems"
-        tooltip-effect="dark"
-        style="width: 95%; margin: auto"
-        border
-        :header-cell-style="{ background: '#F0F3F3' }"
+      <el-form
+        :model="formData"
+        v-loading="dialogLoading"
+        ref="contentConfigForm"
+        label-width="100px"
+        :show-message="false"
+        :rules="contentConfigFormRules"
       >
-        <el-table-column type="index" width="100" align="center">
-          <template slot="header">
-            <el-button type="text" @click="addItem" icon="el-icon-plus" :disabled="isBindPlan"
-              >新增</el-button
-            >
-          </template>
-        </el-table-column>
-        <el-table-column prop="name" label="事项">
-          <template slot-scope="scope">
-            <el-form-item
-              :prop="'ruleItems.' + scope.$index + '.name'"
-              label-width="0"
-              :rules="contentConfigFormRules.name"
-            >
-              <span v-if="scope.row.readonly">{{ scope.row.name }}</span>
+        <el-row>
+          <el-col :span="7">
+            <el-form-item label="规则编码" prop="name">
               <el-input
-                v-if="!scope.row.readonly"
+                v-model="formData.code"
                 size="small"
-                placeholder="请输入"
-                v-model="scope.row.name"
-                :disabled="isBindPlan"
+                :disabled="true"
               ></el-input>
             </el-form-item>
-          </template>
-        </el-table-column>
-        <el-table-column prop="content" label="内容">
-          <template slot-scope="scope">
-            <el-form-item
-              :prop="'ruleItems.' + scope.$index + '.content'"
-              label-width="0"
-              :rules="contentConfigFormRules.content"
-            >
-              <span v-if="scope.row.readonly">{{ scope.row.content }}</span>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="规则名称" prop="name">
               <el-input
-                v-if="!scope.row.readonly"
-                size="small"
+                v-model="formData.name"
                 placeholder="请输入"
-                v-model="scope.row.content"
+                size="small"
                 :disabled="isBindPlan"
               ></el-input>
             </el-form-item>
-          </template>
-        </el-table-column>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="规则类型" prop="ruleType">
+              <DictSelection
+                dictName="规则类型"
+                clearable
+                v-model="formData.ruleType"
+              >
+              </DictSelection>
+            </el-form-item>
+          </el-col>
+          <el-col :span="5">
+            <el-form-item label="状态" prop="status" label-width="70px">
+              <el-switch
+                v-model="formData.status"
+                active-text="生效"
+                inactive-text="失效"
+                :active-value="1"
+                :inactive-value="0"
+              >
+              </el-switch>
+            </el-form-item>
+          </el-col>
+          <el-col :span="24">
+            <el-form-item label="周期" prop="cycleValue">
+              <rule-cycle
+                ref="cycleMultipleRef"
+                :formData="formData"
+                :pageType="pageType"
+                :isBindPlan="isBindPlan"
+              />
+            </el-form-item>
+          </el-col>
+        </el-row>
 
-        <el-table-column prop="norm" label="标准">
-          <template slot-scope="scope">
-            <el-form-item
-              :prop="'ruleItems.' + scope.$index + '.norm'"
-              label-width="0"
-              :rules="contentConfigFormRules.norm"
-            >
-              <span v-if="scope.row.readonly">{{ scope.row.norm }}</span>
-              <el-input
-                v-if="!scope.row.readonly"
-                size="small"
-                placeholder="请输入"
-                v-model="scope.row.norm"
+        <el-table
+          ref="multipleTable"
+          v-if="formData.ruleType !== 4"
+          :data="formData.ruleItems"
+          tooltip-effect="dark"
+          style="width: 95%; margin: auto"
+          border
+          :header-cell-style="{ background: '#F0F3F3' }"
+        >
+          <el-table-column type="index" width="100" align="center">
+            <template slot="header">
+              <el-button
+                type="text"
+                @click="addItem"
+                icon="el-icon-plus"
                 :disabled="isBindPlan"
-              ></el-input>
-            </el-form-item>
-          </template>
-        </el-table-column>
+                >新增</el-button
+              >
+            </template>
+          </el-table-column>
+          <el-table-column prop="name" label="事项" width="200">
+            <template slot-scope="scope">
+              <el-form-item
+                :prop="'ruleItems.' + scope.$index + '.name'"
+                label-width="0"
+                :rules="contentConfigFormRules.name"
+              >
+                <span v-if="scope.row.readonly">{{ scope.row.name }}</span>
+                <el-input
+                  v-if="!scope.row.readonly"
+                  size="small"
+                  placeholder="请输入"
+                  v-model="scope.row.name"
+                  :disabled="isBindPlan"
+                ></el-input>
+              </el-form-item>
+            </template>
+          </el-table-column>
+          <el-table-column prop="content" label="内容" width="400">
+            <template slot-scope="scope">
+              <el-form-item
+                :prop="'ruleItems.' + scope.$index + '.content'"
+                label-width="0"
+                :rules="contentConfigFormRules.content"
+              >
+                <span v-if="scope.row.readonly">{{ scope.row.content }}</span>
+                <el-input
+                  v-if="!scope.row.readonly"
+                  size="small"
+                  placeholder="请输入"
+                  v-model="scope.row.content"
+                  :disabled="isBindPlan"
+                ></el-input>
+              </el-form-item>
+            </template>
+          </el-table-column>
+          <el-table-column prop="operationGuide" label="操作指导">
+            <template slot-scope="scope">
+              <div
+                class="operationGuide_box"
+                @click="
+                  openOperationGuideDialogDialog(
+                    scope.row.operationGuide,
+                    scope.$index
+                  )
+                "
+              >
+                <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
+                    >
+                  </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
+                    >
+                  </template>
+                </div>
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column prop="norm" label="标准" width="100">
+            <template slot-scope="scope">
+              <el-form-item
+                :prop="'ruleItems.' + scope.$index + '.norm'"
+                label-width="0"
+                :rules="contentConfigFormRules.norm"
+              >
+                <span v-if="scope.row.readonly">{{ scope.row.norm }}</span>
+                <el-input
+                  v-if="!scope.row.readonly"
+                  size="small"
+                  placeholder="请输入"
+                  v-model="scope.row.norm"
+                  :disabled="isBindPlan"
+                ></el-input>
+              </el-form-item>
+            </template>
+          </el-table-column>
 
-        <el-table-column width="200" label="操作">
-          <template slot-scope="scope">
-            <el-button type="text" @click="delItem(scope.$index)" size="small" :disabled="isBindPlan"
-              >删除</el-button
-            >
-          </template>
-        </el-table-column>
-      </el-table>
-    </el-form>
-	 <template v-slot:footer>
-	   <el-button @click="handleClose">取消</el-button>
-	   <el-button type="primary" @click="dataKeep">
-	     保存
-	   </el-button>
-	 </template>
-  </ele-modal>
+          <el-table-column width="100" label="操作">
+            <template slot-scope="scope">
+              <el-button
+                type="text"
+                @click="delItem(scope.$index)"
+                size="small"
+                :disabled="isBindPlan"
+                >删除</el-button
+              >
+            </template>
+          </el-table-column>
+        </el-table>
+      </el-form>
+      <template v-slot:footer>
+        <el-button @click="handleClose">取消</el-button>
+        <el-button type="primary" @click="dataKeep"> 保存 </el-button>
+      </template>
+    </ele-modal>
+    <operation-guideDialog ref="operationGuideDialog" @save="saveEdit" />
+  </div>
 </template>
 <script>
-import RuleCycle from './rule-cycle'
-import { deepClone } from '@/utils/index'
-import { saveOrUpdate , getCode , getDetail  } from '@/api/ruleManagement/matter'
+  import OperationGuideDialog from './operationGuideDialog.vue';
+  import RuleCycle from './rule-cycle';
+  import { deepClone } from '@/utils/index';
+  import {
+    saveOrUpdate,
+    getCode,
+    getDetail
+  } from '@/api/ruleManagement/matter';
 
-export default {
-  components: {  RuleCycle },
-  props: {
-    pageType: {
-      type: String,
-      default: ''
-    },
-    infoData: {
-      type: Object,
-      default: () => {
-        return {}
+  export default {
+    components: { RuleCycle, OperationGuideDialog },
+    props: {
+      pageType: {
+        type: String,
+        default: ''
+      },
+      infoData: {
+        type: Object,
+        default: () => {
+          return {};
+        }
+      },
+      dialogTitle: {
+        type: String,
+        default: '新建规则'
+      },
+      dialogLoading: {
+        type: Boolean,
+        default: () => {
+          return false;
+        }
       }
     },
-    dialogTitle: {
-      type: String,
-      default: '新建规则'
+    data() {
+      // 默认表单数据
+      const defaultForm = {
+        code: '',
+        name: '',
+        ruleType: '1',
+        status: 1,
+        cycleValue: undefined,
+        cycleType: 1,
+        contentImage: {},
+        ruleCycleList: [], // 规则周期日期值
+        ruleItems: [
+          {
+            name: '', // 巡点检事项
+            content: '', // 巡点检内容
+            norm: '', // 巡点检标准
+            // 操作指导
+            operationGuide: {
+              toolList: [],
+              procedureList: []
+            }
+          }
+        ]
+      };
+      return {
+        addMatterDialog: false,
+        cycleValue: '',
+        uploadList: [],
+        formData: {},
+        contentConfigFormRules: {
+          name: [
+            { required: true, message: '请输入规则名称', trigger: 'blur' }
+          ],
+          ruleType: [
+            { required: true, message: '请选择规则类型', trigger: 'change' }
+          ],
+          cycleValue: [
+            { required: true, message: '请输入巡点检周期', trigger: 'blur' }
+          ],
+          // contentImage: [
+          //   { required: false, message: '请上传图片', trigger: 'blur' }
+          // ],
+          status: [{ required: true }],
+          name: [
+            { required: true, message: '请输入巡点检事项', trigger: 'blur' }
+          ],
+          content: [
+            { required: true, message: '请输入巡点检内容', trigger: 'blur' }
+          ],
+          norm: [
+            { required: true, message: '请输入巡点检标准', trigger: 'blur' }
+          ]
+        },
+        isBindPlan: false
+      };
     },
-    dialogLoading: {
-      type: Boolean,
-      default: () => {
-        return false
-      }
-    }
-  },
-  data () {
-		// 默认表单数据
-		const defaultForm = {
-		  code:'',
-		  name: '',
-		  ruleType: '1',
-		  status: 1,
-		  cycleValue: undefined,
-		  cycleType: 1,
-		  contentImage: {},
-		  ruleCycleList: [], // 规则周期日期值
-		  ruleItems: [
-		    {
-		      name: '', // 巡点检事项
-		      content: '', // 巡点检内容
-		      norm: '', // 巡点检标准
-		    }
-		  ]
-		};
-    return {
-      addMatterDialog: false,
-      cycleValue: '',
-      uploadList: [],
-      formData: {},
-      contentConfigFormRules: {
-        name: [{ required: true, message: '请输入规则名称', trigger: 'blur' }],
-        ruleType: [
-          { required: true, message: '请选择规则类型', trigger: 'change' }
-        ],
-        cycleValue: [
-          { required: true, message: '请输入巡点检周期', trigger: 'blur' }
-        ],
-        // contentImage: [
-        //   { required: false, message: '请上传图片', trigger: 'blur' }
-        // ],
-        status: [{ required: true }],
-        name: [
-          { required: true, message: '请输入巡点检事项', trigger: 'blur' }
-        ],
-        content: [
-          { required: true, message: '请输入巡点检内容', trigger: 'blur' }
-        ],
-        norm: [{ required: true, message: '请输入巡点检标准', trigger: 'blur' }]
+    watch: {},
+    methods: {
+      saveEdit(data, index) {
+        console.log(data);
+        console.log(index);
+        this.$set(this.formData.ruleItems[index], 'operationGuide', data);
+      },
+      /* 打开操作手册编辑款 */
+      openOperationGuideDialogDialog(row, index) {
+        this.$refs.operationGuideDialog.open(row, index);
+      },
+      openDialog(row, type) {
+        this.addMatterDialog = true;
+        if (type != 'add') {
+          this.getRuleInfo(row.id, type);
+        } else {
+          this.formData = { ...this.defaultForm };
+          this.$set(this.formData, 'status', 1);
+          this.$set(this.formData, 'ruleType', '1');
+          console.log('this.formData---------', this.formData);
+          this.$refs.contentConfigForm &&
+            this.$refs.contentConfigForm.resetFields();
+        }
+        if (type != 'edit') {
+          this.getOrderCode();
+        }
       },
-      isBindPlan:false
-    }
-  },
-	watch: {
-
-	},
-  methods: {
-		openDialog(row,type){
-			this.addMatterDialog = true
-			if(type !='add'){
-				this.getRuleInfo(row.id,type)
-			}else{
-				this.formData = {...this.defaultForm}
-				this.$set(this.formData,'status',1)
-				this.$set(this.formData,'ruleType','1')
-				this.$refs.contentConfigForm && this.$refs.contentConfigForm.resetFields()
-			}
-			if(type!='edit'){
-				this.getOrderCode()
-			}
-		},
 
-	async getRuleInfo(id,type){
-		const data = await getDetail(id)
-		this.formData = data
-		this.formData.ruleType = JSON.stringify(this.formData.ruleType)
-		if(type=='clone'){
-			delete this.formData.id
-		}
-	},
+      async getRuleInfo(id, type) {
+        const data = await getDetail(id);
+        this.formData = data;
+        this.formData.ruleType = JSON.stringify(this.formData.ruleType);
+        if (type == 'clone') {
+          delete this.formData.id;
+        }
+      },
 
-	async getOrderCode () {
-	  const data = await getCode('rule_code');
-	  this.$set(this.formData, 'code', data);
-	},
+      async getOrderCode() {
+        const data = await getCode('rule_code');
+        this.$set(this.formData, 'code', data);
+      },
 
-    handleClose () {
-      this.addMatterDialog = false
-      this.$emit('handleClose')
-    },
-    addItem () {
-      if (this.formData.ruleItems) {
-        this.formData.ruleItems.push({
-          name: '', // 巡点检事项
-          content: '', // 巡点检内容
-          norm: '', // 巡点检标准
-          readonly: false
-        })
-      } else {
-        let arr = [
-          {
+      handleClose() {
+        this.addMatterDialog = false;
+        this.$emit('handleClose');
+      },
+      addItem() {
+        if (this.formData.ruleItems) {
+          this.formData.ruleItems.push({
             name: '', // 巡点检事项
             content: '', // 巡点检内容
             norm: '', // 巡点检标准
-          }
-        ]
-        this.$set(this.formData,'ruleItems',arr)
-        // this.formData.ruleItems =
-      }
-    },
-    saveItem (index, row) {
-      this.$nextTick(() => {
-        let flag = false
-        let name = row.name
-        let content = row.content
-        let norm = row.norm
-        flag = name && content && norm
-        this.$refs.contentConfigForm.validate(valid => {
-          if (valid || flag) {
-            this.$set(this.formData.ruleItems[index], 'readonly', true)
-          }
-        })
-      })
-    },
-    upload (data) {
-      if (data && data[0]?.accessUrl) {
-        this.formData.contentImage = data
-      } else {
-        this.formData.contentImage = {}
-      }
-      this.$nextTick(() => {
-        this.$refs.contentConfigForm.validateField('contentImage')
-      })
-      console.log(this.formData.contentImage)
-    },
-    editItem (index) {
-      this.$nextTick(() => {
-        this.$set(this.formData.ruleItems[index], 'readonly', false)
-      })
-    },
-    delItem (index) {
-      this.formData.ruleItems.splice(index, 1)
-    },
+            // 操作指导
+            operationGuide: {
+              toolList: [],
+              procedureList: []
+            },
+            readonly: false
+          });
+        } else {
+          let arr = [
+            {
+              name: '', // 巡点检事项
+              content: '', // 巡点检内容
+              norm: '', // 巡点检标准
+              // 操作指导
+              operationGuide: {
+                toolList: [],
+                procedureList: []
+              }
+            }
+          ];
+          this.$set(this.formData, 'ruleItems', arr);
+          // this.formData.ruleItems =
+        }
+      },
+      saveItem(index, row) {
+        this.$nextTick(() => {
+          let flag = false;
+          let name = row.name;
+          let content = row.content;
+          let norm = row.norm;
+          flag = name && content && norm;
+          this.$refs.contentConfigForm.validate((valid) => {
+            if (valid || flag) {
+              this.$set(this.formData.ruleItems[index], 'readonly', true);
+            }
+          });
+        });
+      },
+      upload(data) {
+        if (data && data[0]?.accessUrl) {
+          this.formData.contentImage = data;
+        } else {
+          this.formData.contentImage = {};
+        }
+        this.$nextTick(() => {
+          this.$refs.contentConfigForm.validateField('contentImage');
+        });
+        console.log(this.formData.contentImage);
+      },
+      editItem(index) {
+        this.$nextTick(() => {
+          this.$set(this.formData.ruleItems[index], 'readonly', false);
+        });
+      },
+      delItem(index) {
+        this.formData.ruleItems.splice(index, 1);
+      },
 
-    // 保存
-    dataKeep () {
-      let form = deepClone(this.formData)
-      form.cycle = this.$refs.cycleMultipleRef.ruleCycleList
-      switch(form.cycleType){
+      // 保存
+      dataKeep() {
+        let form = deepClone(this.formData);
+        console.log(form);
+        form.cycle = this.$refs.cycleMultipleRef.ruleCycleList;
+        switch (form.cycleType) {
           case 1:
-              if(form.cycle[0].minute===''){
-                 this.$message.warning('周期信息需补充完整!')
-                 return;
-              }
-              break;
+            if (form.cycle[0].minute === '') {
+              this.$message.warning('周期信息需补充完整!');
+              return;
+            }
+            break;
           case 2:
-              if(form.cycle[0].hour===''||form.cycle[0].minute===''){
-                 this.$message.warning('周期信息需补充完整!')
-                 return;
-              }
-              break;
+            if (form.cycle[0].hour === '' || form.cycle[0].minute === '') {
+              this.$message.warning('周期信息需补充完整!');
+              return;
+            }
+            break;
           case 4:
-              if(form.cycle[0].day===''||form.cycle[0].hour===''||form.cycle[0].minute===''){
-                 this.$message.warning('周期信息需补充完整!')
-                 return;
-              }
-              break;
+            if (
+              form.cycle[0].day === '' ||
+              form.cycle[0].hour === '' ||
+              form.cycle[0].minute === ''
+            ) {
+              this.$message.warning('周期信息需补充完整!');
+              return;
+            }
+            break;
           case 5:
-              if(form.cycle[0].month===''||form.cycle[0].day===''||form.cycle[0].hour===''||form.cycle[0].minute===''){
-                 this.$message.warning('周期信息需补充完整!')
-                 return;
-              }
-              break;
+            if (
+              form.cycle[0].month === '' ||
+              form.cycle[0].day === '' ||
+              form.cycle[0].hour === '' ||
+              form.cycle[0].minute === ''
+            ) {
+              this.$message.warning('周期信息需补充完整!');
+              return;
+            }
+            break;
           case 11:
-               let flg = false
-              form.cycle.map((item,index)=>{
-                  if(item.hour===''||item.minute===''){
-                     flg = true
-                  }
-              })
-              if(flg){
-                this.$message.warning('周期信息需补充完整!')
-                return;
+            let flg = false;
+            form.cycle.map((item, index) => {
+              if (item.hour === '' || item.minute === '') {
+                flg = true;
               }
-              break;
+            });
+            if (flg) {
+              this.$message.warning('周期信息需补充完整!');
+              return;
+            }
+            break;
           case 13:
-               let flag = false
-              form.cycle.map((item,index)=>{
-                  if(item.day===''||item.hour===''){
-                     flag = true
-                  }
-              })
-              if(flag){
-                this.$message.warning('周期信息需补充完整!')
-                return;
+            let flag = false;
+            form.cycle.map((item, index) => {
+              if (item.day === '' || item.hour === '') {
+                flag = true;
               }
-              break;
+            });
+            if (flag) {
+              this.$message.warning('周期信息需补充完整!');
+              return;
+            }
+            break;
           case 14:
-               let fla = false
-              form.cycle.map((item,index)=>{
-                  if(item.month===''||item.day===''||item.hour===''){
-                     fla = true
-                  }
-              })
-              if(fla){
-                this.$message.warning('周期信息需补充完整!')
-                return;
+            let fla = false;
+            form.cycle.map((item, index) => {
+              if (item.month === '' || item.day === '' || item.hour === '') {
+                fla = true;
               }
-              break;
-      }
-      this.$refs.contentConfigForm.validate(async valid => {
-        if (valid) {
-          // let form = deepClone(this.formData)
-          // form.ruleCycleList = this.$refs.cycleMultipleRef.ruleCycleList
-          // form.ruleItems.forEach(item => {
-          //   if (item.ruleType) {
-          //     item.ruleType = this.ruleTypeObj[item.ruleType.code]
-          //   }
-          // })
-          let res = await saveOrUpdate(form)
-          if (res) {
-            this.$message.success('操作成功!')
-            this.handleClose()
-            this.$emit('done')
-          }
-        } else {
-          this.$message.warning('请将信息补充完整!')
+            });
+            if (fla) {
+              this.$message.warning('周期信息需补充完整!');
+              return;
+            }
+            break;
         }
-      })
-    },
-  }
-}
+        this.$refs.contentConfigForm.validate(async (valid) => {
+          if (valid) {
+            // let form = deepClone(this.formData)
+            // form.ruleCycleList = this.$refs.cycleMultipleRef.ruleCycleList
+            // form.ruleItems.forEach(item => {
+            //   if (item.ruleType) {
+            //     item.ruleType = this.ruleTypeObj[item.ruleType.code]
+            //   }
+            // })
+            let res = await saveOrUpdate(form);
+            if (res) {
+              this.$message.success('操作成功!');
+              this.handleClose();
+              this.$emit('done');
+            }
+          } else {
+            this.$message.warning('请将信息补充完整!');
+          }
+        });
+      }
+    }
+  };
 </script>
 <style scoped lang="scss">
-.form-ipt {
-  width: 310px;
-}
-.details-div {
-  font-size: 14px;
-  padding-left: 40px;
-  .details-div-title {
+  .operationGuide_box {
+    width: 100%;
+    height: 50px;
     display: flex;
-    justify-content: space-between;
-    span {
-      padding-top: 8px;
+    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;
     }
   }
-}
-.zw-container {
-  height: 450px;
-}
-.page-footer-btn {
-  margin: 20px 0;
-  text-align: center;
-}
-// .app-container {
-::v-deep .el-form-item {
-  margin-bottom: 14px;
-}
-::v-deep .el-table__body-wrapper {
-  .el-form-item {
-    margin-bottom: 0;
+  .form-ipt {
+    width: 310px;
   }
-}
-::v-deep .el-form-item__error {
-  padding-top: 0;
-}
-.cycle_value {
-  ::v-deep .el-input__inner {
+  .details-div {
+    font-size: 14px;
+    padding-left: 40px;
+    .details-div-title {
+      display: flex;
+      justify-content: space-between;
+      span {
+        padding-top: 8px;
+      }
+    }
+  }
+  .zw-container {
+    height: 450px;
+  }
+  .page-footer-btn {
+    margin: 20px 0;
     text-align: center;
   }
-}
-// }
+  // .app-container {
+  ::v-deep .el-form-item {
+    margin-bottom: 14px;
+  }
+  ::v-deep .el-table__body-wrapper {
+    .el-form-item {
+      margin-bottom: 0;
+    }
+  }
+  ::v-deep .el-form-item__error {
+    padding-top: 0;
+  }
+  .cycle_value {
+    ::v-deep .el-input__inner {
+      text-align: center;
+    }
+  }
+  // }
 </style>

+ 230 - 0
src/views/rulesManagement/matterRules/components/operationGuideDialog.vue

@@ -0,0 +1,230 @@
+<!-- 操作手册弹窗 -->
+<template>
+  <el-dialog
+    class="ele-dialog-form"
+    title="编辑"
+    v-if="visible"
+    :append-to-body="true"
+    :visible.sync="visible"
+    :before-close="handleClose"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    width="1000px"
+  >
+    <headerTitle title="操作工具">
+      <el-button type="primary" size="small" @click="handleAdd">新增</el-button>
+    </headerTitle>
+
+    <el-table
+      ref="multipleTable"
+      :data="form.toolList"
+      tooltip-effect="dark"
+      style="width: 100%"
+      stripe
+      :header-cell-style="{ background: '#EEEEEE', border: 'none' }"
+    >
+      <el-table-column label="工具名称" prop="code" min-width="120">
+        <template slot-scope="{ row }">
+          {{ row.name }}
+        </template></el-table-column
+      >
+
+      <el-table-column label="工具编码" prop="code" min-width="120">
+        <template slot-scope="{ row }">
+          {{ row.code }}
+        </template></el-table-column
+      >
+
+      <el-table-column label="牌号" prop="brandNum" min-width="120">
+        <template slot-scope="{ row }">
+          {{ row.brandNum }}
+        </template></el-table-column
+      >
+
+      <el-table-column label="型号" prop="modelType" min-width="120">
+        <template slot-scope="{ row }">
+          {{ row.modelType }}
+        </template></el-table-column
+      >
+
+      <el-table-column label="操作" fixed="right">
+        <template slot-scope="{ $index, row }">
+          <el-button type="text" @click="removeItem($index, row)"
+            >删除设备</el-button
+          >
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <headerTitle title="操作指导">
+      <el-button type="primary" size="small" @click="addPostscript"
+        >新增</el-button
+      >
+    </headerTitle>
+
+    <el-table
+      ref="multipleTable"
+      :data="form.procedureList"
+      tooltip-effect="dark"
+      style="width: 100%"
+      stripe
+      :header-cell-style="{ background: '#EEEEEE', border: 'none' }"
+    >
+      <el-table-column type="index" width="50"> </el-table-column>
+      <!-- <el-table-column label="排序" prop="" width="100">
+        <template slot-scope="{ row }">
+          <el-input
+            placeholder="请输入"
+            type="number"
+            v-model.number="row.sort"
+            clearable
+          ></el-input> </template
+      ></el-table-column> -->
+
+      <el-table-column label="操作步骤" prop="" min-width="120">
+        <template slot-scope="{ row }">
+          <el-input
+            placeholder="请输入"
+            type="textarea"
+            :rows="1"
+            v-model="row.content"
+            clearable
+          ></el-input> </template
+      ></el-table-column>
+
+      <el-table-column label="操作" fixed="right" width="100">
+        <template slot-scope="{ $index, row }">
+          <el-button type="text" @click="removePostscript($index, row)"
+            >删除</el-button
+          >
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <template v-slot:footer>
+      <el-button @click="handleClose">取消</el-button>
+      <el-button type="primary" :loading="loading" @click="save">
+        保存
+      </el-button>
+    </template>
+
+    <ProductModal ref="productRefs" @chooseModal="chooseModal" />
+  </el-dialog>
+</template>
+
+<script>
+  // import { update, getById } from '@/api/inspectionClassify';
+  import ProductModal from './ProductModal.vue';
+  export default {
+    components: {
+      ProductModal
+    },
+
+    data() {
+      const defaultForm = function () {
+        return {
+          toolList: [],
+          procedureList: []
+        };
+      };
+      return {
+        defaultForm,
+        // 表单数据
+        form: { ...defaultForm() },
+        currentIndex: 0,
+        // 表单验证规则
+        rules: {
+          name: [{ required: true, message: '请输入', trigger: 'blur' }],
+
+          type: {
+            required: true,
+            message: '请选择',
+            trigger: 'change'
+          }
+        },
+        visible: false,
+
+        title: null,
+        loading: false
+      };
+    },
+
+    created() {},
+    methods: {
+      open(row, index) {
+        console.log(row);
+        console.log(index);
+        if (row) {
+          this.form = row;
+        }
+        this.currentIndex = index;
+        this.visible = true;
+      },
+      /* 保存编辑 */
+      save() {
+        this.$emit('save', this.form, this.currentIndex);
+        this.visible = false;
+      },
+      restForm() {
+        this.form = { ...this.defaultForm() };
+      },
+      handleClose() {
+        this.restForm();
+        this.visible = false;
+      },
+
+      handleAdd() {
+        this.$refs.productRefs.open(this.form.toolList);
+      },
+
+      chooseModal(data) {
+        this.form.toolList = [...this.form.toolList, ...data];
+      },
+
+      removeItem(idx, row) {
+        if (this.form.toolList.length == 1) {
+          return this.$message.error('至少保留一个设备!');
+        }
+
+        this.$confirm(`是否删除这个设备?`).then(async () => {
+          this.form.toolList.splice(idx, 1);
+
+          if (row.id) {
+            this.form.toolRemoveIds.push(row.id);
+          }
+        });
+      },
+
+      addPostscript() {
+        this.form.procedureList.push({ sort: null, content: '' });
+      },
+      removePostscript(idx, row) {
+        if (this.form.procedureList.length == 1) {
+          return this.$message.error('至少保留一个事项!');
+        }
+
+        this.$confirm(`是否删除这个事项?`).then(async () => {
+          this.form.procedureList.splice(idx, 1);
+        });
+      }
+    }
+  };
+</script>
+<style lang="scss" scoped>
+  .location-warp {
+    display: flex;
+
+    .detail {
+      margin-left: 10px;
+    }
+  }
+
+  :deep(
+      .el-dialog:not(.ele-dialog-form)
+        .el-dialog__body
+        .el-form
+        .el-form-item:last-child
+    ) {
+    margin-bottom: 22px;
+  }
+</style>

+ 99 - 0
src/views/rulesManagement/matterRules/components/product-search.vue

@@ -0,0 +1,99 @@
+<!-- 搜索表单 -->
+<template>
+  <el-form
+    label-width="77px"
+    class="ele-form-search"
+    @keyup.enter.native="search"
+    @submit.native.prevent
+  >
+    <el-row :gutter="10">
+      <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
+        <el-form-item label="编码">
+          <el-input clearable v-model="where.code" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
+        <el-form-item label="名称">
+          <el-input clearable v-model="where.name" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+
+      <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
+        <el-form-item label="型号">
+          <el-input clearable v-model="where.modelType" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { md: 4 } : { md: 4 }">
+        <div class="ele-form-actions">
+          <el-button
+            type="primary"
+            icon="el-icon-search"
+            class="ele-btn-icon"
+            @click="search"
+          >
+            查询
+          </el-button>
+
+          <el-button
+            @click="reset"
+            icon="el-icon-refresh"
+            class="ele-btn-icon"
+            size="medium"
+            >重置</el-button
+          >
+        </div>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+
+<script>
+  export default {
+    data() {
+      // 默认表单数据
+      const defaultWhere = {
+        name: '',
+        code: '',
+        modelType: ''
+      };
+      return {
+        defaultWhere,
+        // 表单数据
+        where: { ...defaultWhere },
+        treeData: []
+      };
+    },
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive() {
+        return this.$store.state.theme.styleResponsive;
+      }
+    },
+    created() {},
+    methods: {
+      /* 搜索 */
+      search() {
+        if (this.where.appType === 0) {
+          this.where.appType = '';
+        }
+        this.$emit('search', this.where);
+      },
+      /*  重置 */
+      reset() {
+        this.where = { ...this.defaultWhere };
+        this.search();
+      },
+      reset2() {
+        this.where = { ...this.defaultWhere };
+      }
+    }
+  };
+</script>
+
+<style>
+  .ele-form-actions {
+    display: inline-block;
+    transform: translate(0);
+    transition: all;
+  }
+</style>

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

@@ -81,7 +81,7 @@
       MatterSearch,
       MatterAdd
     },
-    data () {
+    data() {
       return {
         // 表格列配置
         columns: [
@@ -174,36 +174,36 @@
       };
     },
     computed: {},
-    created () {
+    created() {
       this.requestDict('规则周期');
       this.requestDict('规则类型');
       this.requestDict('规则状态');
     },
     methods: {
       /* 表格数据源 */
-      datasource ({ page, limit, where, order }) {
+      datasource({ page, limit, where, order }) {
         return getList({ pageNum: page, size: limit, ...where });
       },
       /* 刷新表格 */
-      reload (where) {
+      reload(where) {
         this.$refs.table.reload({ page: 1, where });
       },
 
-      remove (row) {
+      remove(row) {
         removeRule([row.id]).then((res) => {
           this.$message.success('删除成功!');
           this.reload();
         });
       },
 
-      openEdit (type, row) {
+      openEdit(type, row) {
         this.pageType = type;
         this.dialogTitle =
           type == 'add' ? '新建规则' : type == 'edit' ? '编辑规则' : '克隆规则';
         this.$refs.addMatterRulesRef.openDialog(row, type);
       },
 
-      goDetail ({ id }) {
+      goDetail({ id }) {
         this.$router.push({
           path: '/rulesManagement/matterRules/details',
           query: { id }

+ 5 - 1
src/views/rulesManagement/planRules/index.vue

@@ -82,6 +82,9 @@
             </template>
           </ele-pro-table>
         </div>
+        <div v-if="activeComp == 'measuringSubmit'">
+          <InspectionPoint />
+        </div>
       </div>
     </el-card>
 
@@ -114,7 +117,8 @@
         tabOptions: [
           { key: 'point', name: '巡点检配置' },
           { key: 'anmac', name: '保养配置' },
-          { key: 'plan', name: '盘点配置' }
+          { key: 'plan', name: '盘点配置' },
+          { key: 'measuringSubmit', name: '量具送检配置' }
         ],
         // 表格列配置
         columns: [

+ 3 - 4
vue.config.js

@@ -3,7 +3,7 @@ const { transformElementScss } = require('ele-admin/lib/utils/dynamic-theme');
 const path = require('path');
 const { name } = require('./package.json');
 
-function resolve (dir) {
+function resolve(dir) {
   return path.join(__dirname, dir);
 }
 
@@ -27,14 +27,13 @@ module.exports = {
     }
   },
   devServer: {
-
     // 代理跨域的配置
     proxy: {
       // 当我们的本地的请求 有/api的时候,就会代理我们的请求地址向另外一个服务器发出请求
       '/api': {
         // target: 'http://124.71.68.31:50001',
         // target: 'http://192.168.1.147:18086',
-        target: 'http://192.168.1.125:18086',
+        target: 'http://192.168.1.110:18086',
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域
         pathRewrite: {
           '^/api': ''
@@ -45,7 +44,7 @@ module.exports = {
       'Access-Control-Allow-Origin': '*'
     }
   },
-  chainWebpack (config) {
+  chainWebpack(config) {
     config.plugins.delete('prefetch');
     // set svg-sprite-loader
     // config.module.rule('svg').exclude.add(resolve('./src/icons')).end();