Ver Fonte

放行单模板开发完成

lucw há 8 meses atrás
pai
commit
6d47eded81

+ 12 - 0
src/api/checklistrecord/index.js

@@ -0,0 +1,12 @@
+import request from '@/utils/request';
+
+/**
+ *分页查询放行单记录
+ */
+export async function checklistrecordPage(data) {
+  const res = await request.post('/mes/checklistrecord/page', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 50 - 0
src/api/checklisttemplate/index.js

@@ -0,0 +1,50 @@
+import request from '@/utils/request';
+
+/**
+ *分页查询放行单模板
+ */
+export async function checklisttemplatePage(data) {
+  const res = await request.post('/mes/checklisttemplate/page', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// /mes/checklisttemplate/getById/{id}
+export async function checklisttemplateGetById(id) {
+  const res = await request.get(`/mes/checklisttemplate/getById/${id}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// /mes/checklisttemplate/save 保存放行单模板
+export async function checktemplateSave(data) {
+  const res = await request.post('/mes/checklisttemplate/save', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+//  /mes/checklisttemplate/update 更新放行单模板
+export async function checklisttemplateUpdate(data) {
+  const res = await request.put('/mes/checklisttemplate/update', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+//  /mes/checklisttemplate/logicDeleteByIds
+export async function checklisttemplateLogicDeleteByIds(data) {
+  const res = await request.delete('/mes/checklisttemplate/logicDeleteByIds', {
+    data,
+  });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 11 - 0
src/api/eom/index.js

@@ -0,0 +1,11 @@
+import request from '@/utils/request';
+
+
+// /eom/target_definition/getByTypeAndIndicator
+export async function getByTypeAndIndicator(data) {
+  const res = await request.post(`/eom/target_definition/getByTypeAndIndicator`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 29 - 11
src/api/main/index.js

@@ -1,19 +1,18 @@
 import request from '@/utils/request';
 
-
 // 产品合格率
 
-export async function queryHomePage (data) {
-    const res = await request.post(`/qms/quality_work_order/queryHomePage` , data);
-    if (res.data.code == 0) {
-      return res.data.data;
-    }
-    return Promise.reject(new Error(res.data.message));
+export async function queryHomePage(data) {
+  const res = await request.post(`/qms/quality_work_order/queryHomePage`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
   }
+  return Promise.reject(new Error(res.data.message));
+}
 
 // 工厂查询
 
-export async function queryFactory () {
+export async function queryFactory() {
   const res = await request.get(`/qms/quality_work_order/queryFactory`);
   if (res.data.code == 0) {
     return res.data.data;
@@ -21,10 +20,9 @@ export async function queryFactory () {
   return Promise.reject(new Error(res.data.message));
 }
 
-
 // 班组查询
 
-export async function queryTeam () {
+export async function queryTeam() {
   const res = await request.get(`/qms/quality_work_order/queryTeam`);
   if (res.data.code == 0) {
     return res.data.data;
@@ -33,10 +31,30 @@ export async function queryTeam () {
 }
 // 产线查询
 
-export async function queryProductionLine () {
+export async function queryProductionLine() {
   const res = await request.get(`/qms/quality_work_order/queryProductionLine`);
   if (res.data.code == 0) {
     return res.data.data;
   }
   return Promise.reject(new Error(res.data.message));
 }
+
+// 获取指标类型列表 /main/indicatorManage/getIndicatorTypeList
+export async function getIndicatorTypeList() {
+  const res = await request.get(`/main/indicatorManage/getIndicatorTypeList`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 获取指标根节点列表 /main/indicatorManage/getIndicatorRootNodeList
+export async function getIndicatorRootNodeList() {
+  const res = await request.get(
+    '/main/indicatorManage/getIndicatorRootNodeList'
+  );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 2 - 1
src/enum/dict.js

@@ -40,7 +40,8 @@ export default {
   规则状态: 'rule_status',
   规则周期: 'rule_cycle',
   流程实例的结果: 'bpm_process_instance_result',
-  取样类型: 'quality_method_code'
+  取样类型: 'quality_method_code',
+  放行类型: 'checklist_type'
 };
 export const numberList = ['date_method'];
 

+ 1 - 1
src/views/batchRecord/components/tables/materialTable.vue

@@ -1,5 +1,5 @@
 <template>
-  <div>
+  <div class="ele-body">
     <seek-page :seekList="seekList" @search="search"></seek-page>
     <ele-pro-table
       ref="table"

+ 201 - 0
src/views/checklistManagement/checklist.vue

@@ -0,0 +1,201 @@
+<template>
+  <div class="ele-body">
+    <el-card shadow="never">
+      <seek-page :seekList="seekList" @search="search"></seek-page>
+      <ele-pro-table
+        ref="table"
+        row-key="id"
+        :columns="columns"
+        :datasource="datasource"
+        :cache-key="cacheKeyUrl"
+        autoAmendPage
+      >
+        <template v-slot:toolbar>
+          <el-button type="primary" size="mini">新建</el-button>
+          <el-button type="primary" size="mini">导入</el-button>
+          <el-button size="mini">导出</el-button>
+        </template>
+        <template v-slot:action="{ row }">
+          <el-button type="text" size="mini">编辑</el-button>
+          <el-button type="text" size="mini">提交</el-button>
+          <el-button type="text" size="mini">处理</el-button>
+          <el-button type="text" size="mini">详情</el-button>
+          <el-button type="text" size="mini">删除</el-button>
+        </template>
+      </ele-pro-table>
+    </el-card>
+  </div>
+</template>
+
+<script>
+  import dictMixins from '@/mixins/dictMixins';
+  import tableColumnsMixin from '@/mixins/tableColumnsMixin';
+  import { checklistrecordPage } from '@/api/checklistrecord/index';
+
+  export default {
+    mixins: [dictMixins, tableColumnsMixin],
+    data() {
+      return {
+        columns: [
+          {
+            width: 50,
+            type: 'index',
+            columnKey: 'index',
+            align: 'center',
+            label: '序号'
+          },
+          {
+            prop: 'code',
+            label: '放行单编码',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'code',
+            label: '放行单名称',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'productCode',
+            label: '产品编码',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'productName',
+            label: '产品名称',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'batchNo',
+            label: '批次号',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'code',
+            label: '生产工单号',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'code',
+            label: '数量',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'code',
+            label: '规格',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'productModel',
+            label: '型号',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'status',
+            label: '状态',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 150,
+            formatter: (row) => {
+              switch (row.status) {
+                case 0:
+                  return '未领料';
+                case 1:
+                  return '已领料';
+                case 2:
+                  return '已出库';
+                case 3:
+                  return '部分出库';
+                default:
+                  return '';
+              }
+            }
+          },
+          {
+            prop: 'createTime',
+            label: '创建时间',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 220,
+            align: 'center',
+            resizable: false,
+            fixed: 'right',
+            slot: 'action',
+            showOverflowTooltip: true
+          }
+        ],
+        cacheKeyUrl: 'mes-25925-material-table'
+      };
+    },
+    computed: {
+      seekList() {
+        return [
+          {
+            label: '放行单编码:',
+            value: 'releaseOrderCode',
+            type: 'input',
+            placeholder: '请输入'
+          },
+          {
+            label: '放行单名称:',
+            value: 'releaseOrderName',
+            type: 'input',
+            placeholder: '请输入'
+          },
+          {
+            label: '审核状态:',
+            value: 'releaseOrderStatus',
+            type: 'input',
+            placeholder: '请输入'
+          }
+        ];
+      }
+    },
+    methods: {
+      // 刷新表格
+      reload(where = {}) {
+        this.refs.table.reload({
+          where
+        });
+      },
+      /* 表格数据源 */
+      datasource({ page, limit, where, order }) {
+        // 参数
+        const body = {
+          ...where,
+          ...order,
+          pageNum: page,
+          size: limit
+        };
+        return checklistrecordPage(body);
+      },
+      search(where) {
+        this.reload(where);
+      }
+    }
+  };
+</script>
+
+<style></style>

+ 592 - 0
src/views/checklistManagement/components/templateAdd.vue

@@ -0,0 +1,592 @@
+<template>
+  <ele-modal
+    :title="title"
+    :visible.sync="visible"
+    :close-on-click-modal="false"
+    @close="handleClose"
+    resizable
+    maxable
+    width="80%"
+  >
+    <el-form
+      ref="formRef"
+      :model="form"
+      :rules="rules"
+      label-width="130px"
+      v-loading="loading"
+    >
+      <header-title title="基本信息"></header-title>
+      <el-row style="margin-bottom: 15px" gap="10">
+        <el-col :span="8">
+          <el-form-item label="放行类型" prop="checklistType">
+            <DictSelection
+              dictName="放行类型"
+              clearable
+              v-model="form.checklistType"
+            >
+            </DictSelection>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="放行模板编码">
+            <el-input
+              v-model="form.templateCode"
+              placeholder="系统自动生成"
+              disabled
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="放行模板名称" prop="templateName">
+            <el-input
+              v-model="form.templateName"
+              placeholder="请输入"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-row style="margin-bottom: 15px" gap="10">
+        <el-col :span="8">
+          <el-form-item label="状态" prop="enable">
+            <el-radio-group v-model="form.enable">
+              <el-radio :label="1">启用</el-radio>
+              <el-radio :label="0">停用</el-radio>
+            </el-radio-group>
+          </el-form-item>
+        </el-col>
+        <el-col :span="16">
+          <el-form-item label="备注">
+            <el-input
+              type="textarea"
+              :rows="2"
+              v-model="form.remark"
+              placeholder="放行单业务说明"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+      </el-row>
+
+      <header-title title="生产放行规则">
+        <el-button type="primary" icon="el-icon-plus" @click="addDetails(1)">
+          添加规则指标
+        </el-button>
+      </header-title>
+
+      <ele-pro-table
+        ref="scTable"
+        row-key="id"
+        :columns="columns"
+        :datasource="scCheckTypeDetails"
+      >
+        <template v-slot:businessType="{ row }">
+          <el-select
+            v-model="row.businessType"
+            placeholder="请选择"
+            @change="businessTypeChange(row)"
+          >
+            <el-option
+              v-for="i in indicatorRootNodeList"
+              :key="i.value"
+              :label="i.name"
+              :value="i.value"
+            >
+            </el-option>
+          </el-select>
+        </template>
+        <template v-slot:indicator="{ row }">
+          <el-select
+            v-if="row.businessType !== -1"
+            v-model="row.indicator"
+            placeholder="请选择"
+            :key="row.businessType"
+            @change="businessTypeChagne(row)"
+          >
+            <el-option
+              v-for="i in getIndicatorList(row.businessType)"
+              :key="i.value"
+              :label="i.name"
+              :value="i.value"
+            >
+            </el-option>
+          </el-select>
+          <el-input
+            v-else
+            v-model="row.indicatorName"
+            placeholder="请输入"
+          ></el-input>
+        </template>
+        <template v-slot:indicatorName="{ row }">
+          <el-select
+            v-if="row.businessType !== -1"
+            v-model="row.targetDefinitionId"
+            placeholder="请选择"
+            :key="
+              row.indicator + row.targetDefinitionId + indicatorNameCacheKey
+            "
+            @change="targetDefinitionIdChange(row)"
+          >
+            <el-option
+              v-for="i in getIndicatorCacheList(
+                row.businessType,
+                row.indicator
+              )"
+              :key="i.id"
+              :label="i.name"
+              :value="i.id"
+            >
+            </el-option>
+          </el-select>
+          <el-input
+            v-else
+            v-model="row.targetDefinitionName"
+            placeholder="请输入"
+          ></el-input>
+        </template>
+        <template v-slot:isAutoCheck="{ row }">
+          <el-select v-model="row.isAutoCheck" placeholder="请选择">
+            <el-option label="自动" :value="1"> </el-option>
+            <el-option label="手动" :value="0"> </el-option>
+          </el-select>
+        </template>
+        <template v-slot:action="{ row }">
+          <div>
+            <el-link type="danger" @click="deleteRow(row)">删除</el-link>
+          </div>
+        </template>
+      </ele-pro-table>
+      <header-title title="质检放行规则">
+        <el-button type="primary" icon="el-icon-plus" @click="addDetails(2)">
+          添加规则指标
+        </el-button>
+      </header-title>
+      <ele-pro-table
+        ref="zjTable"
+        row-key="id"
+        :columns="columns"
+        :datasource="zjCheckTypeDetails"
+      >
+        <template v-slot:businessType="{ row }">
+          <el-select
+            v-model="row.businessType"
+            placeholder="请选择"
+            @change="businessTypeChange(row)"
+          >
+            <el-option
+              v-for="i in indicatorRootNodeList"
+              :key="i.value"
+              :label="i.name"
+              :value="i.value"
+            >
+            </el-option>
+          </el-select>
+        </template>
+        <template v-slot:indicator="{ row }">
+          <el-select
+            v-if="row.businessType !== -1"
+            v-model="row.indicator"
+            placeholder="请选择"
+            :key="row.businessType"
+            @change="businessTypeChagne(row)"
+          >
+            <el-option
+              v-for="i in getIndicatorList(row.businessType)"
+              :key="i.value"
+              :label="i.name"
+              :value="i.value"
+            >
+            </el-option>
+          </el-select>
+          <el-input
+            v-else
+            v-model="row.indicatorName"
+            placeholder="请输入"
+          ></el-input>
+        </template>
+        <template v-slot:indicatorName="{ row }">
+          <el-select
+            v-if="row.businessType !== -1"
+            v-model="row.targetDefinitionId"
+            placeholder="请选择"
+            :key="
+              row.indicator + row.targetDefinitionId + indicatorNameCacheKey
+            "
+            @change="targetDefinitionIdChange(row)"
+          >
+            <el-option
+              v-for="i in getIndicatorCacheList(
+                row.businessType,
+                row.indicator
+              )"
+              :key="i.id"
+              :label="i.name"
+              :value="i.id"
+            >
+            </el-option>
+          </el-select>
+          <el-input
+            v-else
+            v-model="row.targetDefinitionName"
+            placeholder="请输入"
+          ></el-input>
+        </template>
+        <template v-slot:isAutoCheck="{ row }">
+          <el-select v-model="row.isAutoCheck" placeholder="请选择">
+            <el-option label="自动" :value="1"> </el-option>
+            <el-option label="手动" :value="0"> </el-option>
+          </el-select>
+        </template>
+        <template v-slot:action="{ row }">
+          <div>
+            <el-link type="danger" @click="deleteRow(row)">删除</el-link>
+          </div>
+        </template>
+      </ele-pro-table>
+    </el-form>
+
+    <template v-slot:footer>
+      <el-button
+        v-if="type == 'edit'"
+        type="primary"
+        @click="submit('edit')"
+        :loading="buttonLoading"
+        >编 辑</el-button
+      >
+
+      <el-button
+        v-if="type == 'add' || type == 'clone'"
+        type="primary"
+        @click="submit('add')"
+        :loading="buttonLoading"
+        >提 交</el-button
+      >
+
+      <el-button @click="handleClose" style="margin-left: 20px"
+        >取 消</el-button
+      >
+    </template>
+  </ele-modal>
+</template>
+
+<script>
+  import dictMixins from '@/mixins/dictMixins';
+  import {
+    checklisttemplateGetById,
+    checktemplateSave,
+    checklisttemplateUpdate
+  } from '@/api/checklisttemplate/index';
+  import { getIndicatorRootNodeList } from '@/api/main/index';
+  import { getByTypeAndIndicator } from '@/api/eom/index';
+
+  export default {
+    mixins: [dictMixins],
+    data() {
+      const formBaseData = {
+        id: null,
+        createUserName: '',
+        details: [],
+        enable: null,
+        remark: '',
+        templateCode: '',
+        templateName: '',
+        checklistType: ''
+      };
+
+      return {
+        visible: false,
+        title: '新增放行单模版',
+        formBaseData,
+        form: JSON.parse(JSON.stringify(formBaseData)),
+        rules: {
+          checklistType: [
+            { required: true, message: '请选择放行类型', trigger: 'blur' },
+            { required: true, message: '请选择放行类型', trigger: 'change' }
+          ],
+          templateName: [
+            { required: true, message: '请输入放行单名称', trigger: 'blur' },
+            { required: true, message: '请输入放行单名称', trigger: 'change' }
+          ],
+          enable: [
+            { required: true, message: '请选择状态', trigger: 'blur' },
+            { required: true, message: '请选择状态', trigger: 'change' }
+          ]
+        },
+        // 业务类型和考核指标
+        indicatorRootNodeList: [],
+        // 指标名称缓存数据
+        indicatorNameCache: {},
+        indicatorNameCacheKey: '',
+        // 操作类型 add-新增 edit-编辑 clone-克隆
+        type: 'add',
+        loading: false,
+        buttonLoading: false
+      };
+    },
+    computed: {
+      // 生产放行规则
+      scCheckTypeDetails() {
+        return this.form.details.filter((item) => item.checkType == 1);
+      },
+      // 质检放行规则
+      zjCheckTypeDetails() {
+        return this.form.details.filter((item) => item.checkType == 2);
+      },
+      columns() {
+        return [
+          {
+            width: 55,
+            type: 'index',
+            columnKey: 'index',
+            label: '序号',
+            align: 'center'
+          },
+          {
+            prop: 'businessType',
+            label: '业务类型',
+            slot: 'businessType',
+            align: 'center',
+            minWidth: 150,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'indicator',
+            label: '考核指标',
+            slot: 'indicator',
+            align: 'center',
+            minWidth: 150,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'indicatorName',
+            label: '指标名称',
+            slot: 'indicatorName',
+            align: 'center',
+            minWidth: 150,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'isAutoCheck',
+            label: '结果输出类型',
+            slot: 'isAutoCheck',
+            align: 'center',
+            minWidth: 150,
+            showOverflowTooltip: true
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 120,
+            align: 'center',
+            resizable: false,
+            fixed: 'right',
+            slot: 'action',
+            showOverflowTooltip: true
+          }
+        ];
+      }
+    },
+    created() {
+      this.getIndicatorRootNodeList();
+    },
+    methods: {
+      // 外部调用,打开弹窗
+      open(type, data) {
+        console.log('type, data', type, data);
+        this.type = type;
+        if (type == 'add') {
+          this.title = '新增放行单模版';
+        } else if (type == 'edit') {
+          this.title = '编辑放行单模版';
+          this.getDetails(data.id);
+        } else {
+          // 克隆
+          this.title = '编辑放行单模版';
+        }
+        this.visible = true;
+      },
+      async getDetails(id) {
+        this.loading = true;
+        try {
+          const res = await checklisttemplateGetById(id);
+          console.log('res', res);
+          this.$util.assignObject(this.form, res);
+          // 获取指标名称列表
+          this.form.details.forEach((item) => {
+            this.getIndicatorNameList(item.businessType, item.indicator);
+          });
+
+          this.loading = false;
+        } catch (error) {
+          this.loading = false;
+        }
+      },
+      // 关闭时清理表单
+      handleClose() {
+        this.visible = false;
+        this.form = JSON.parse(JSON.stringify(this.formBaseData));
+        this.$refs.formRef && this.$refs.formRef.resetFields();
+      },
+      // 提交
+      submit(type) {
+        console.log('this.form', this.form);
+        console.log('this.form.details', this.form.details);
+        this.$refs.formRef.validate(async (valid) => {
+          if (valid) {
+            if (this.form.details.length == 0) {
+              return this.$message.warning('请至少添加一条放行规则!');
+            }
+
+            // 判断details中的 businessType、indicator、indicatorName 是否有空值
+            for (let i = 0; i < this.form.details.length; i++) {
+              const item = this.form.details[i];
+
+              if (item.businessType === null) {
+                return this.$message.warning(
+                  '请填写完整放行规则,业务类型、考核指标、指标名称不能为空!'
+                );
+              }
+
+              if (
+                item.businessType !== -1 &&
+                (item.indicator == null || item.targetDefinitionId == null)
+              ) {
+                return this.$message.warning(
+                  '请填写完整放行规则,业务类型、考核指标、指标名称不能为空!'
+                );
+              }
+
+              if (
+                item.businessType == -1 &&
+                (item.indicatorName == '' || item.targetDefinitionName == '')
+              ) {
+                return this.$message.warning(
+                  '请填写完整放行规则,业务类型、考核指标、指标名称不能为空!'
+                );
+              }
+            }
+            this.buttonLoading = true;
+
+            try {
+              if (type == 'add' || type == 'clone') {
+                this.form.createUserName = this.$store.state.user?.userName;
+                this.form.id = null;
+                // 重置id
+                this.form.details.forEach((item) => {
+                  item.id = null;
+                });
+                await checktemplateSave(this.form);
+              } else {
+                // 过滤临时id
+                this.form.details = this.form.details.map((item) => {
+                  if (
+                    typeof item.id === 'string' &&
+                    item.id.startsWith('tem-')
+                  ) {
+                    return { ...item, id: null };
+                  }
+                  return item;
+                });
+                // 编辑
+                await checklisttemplateUpdate(this.form);
+              }
+            } catch (error) {
+              return (this.buttonLoading = false);
+            }
+
+            this.buttonLoading = false;
+
+            this.$message.success('操作成功');
+            // 触发父组件刷新
+            this.$emit('reload');
+
+            this.handleClose();
+          }
+        });
+      },
+      // 获取获取指标根节点列表
+      async getIndicatorRootNodeList() {
+        const data = await getIndicatorRootNodeList();
+        // 添加其他选项
+        data.push({
+          name: '其他',
+          value: -1,
+          nodes: []
+        });
+        this.indicatorRootNodeList = data;
+        console.log('this.indicatorRootNodeList', this.indicatorRootNodeList);
+      },
+
+      // 添加规则指标 1-生产放行规则,2-质检放行规则
+      addDetails(checkType = 1) {
+        this.form.details.push({
+          businessType: null,
+          checkType: checkType,
+          createUserName: '',
+          indicator: null,
+          indicatorName: '',
+          isAutoCheck: 1,
+          sortNum: 0,
+          targetDefinitionId: null,
+          targetDefinitionName: '',
+          templateId: null,
+          // 临时id
+          id: `tem-${new Date().getTime()}`
+        });
+      },
+      // 业务类型 考核指标
+      getIndicatorList(businessType) {
+        const item = this.indicatorRootNodeList.find(
+          (item) => item.value == businessType
+        );
+        return item ? item.nodes : [];
+      },
+      // 修改
+      businessTypeChagne(row) {
+        row.targetDefinitionId = null;
+        // 重置指标名称
+        this.getIndicatorNameList(row.businessType, row.indicator);
+      },
+      // 指标名称lieb
+      async getIndicatorNameList(businessType, indicator) {
+        // 排除其他
+        if (businessType == -1) return;
+        // 已经存在缓存数据
+        if (this.indicatorNameCache[`${businessType}_${indicator}`]) return;
+        const data = await getByTypeAndIndicator({
+          type: businessType,
+          assessmentIndicators: indicator
+        });
+        console.log('data 指标名称', data);
+        this.indicatorNameCache[`${businessType}_${indicator}`] = data;
+        this.indicatorNameCacheKey = new Date().getTime();
+      },
+      // 获取指标名称缓存列表
+      getIndicatorCacheList(businessType, indicator) {
+        return this.indicatorNameCache[`${businessType}_${indicator}`] || [];
+      },
+      // 业务类型改变 重置指标和指标名称
+      businessTypeChange(row) {
+        row.indicator = null;
+        row.indicatorName = '';
+        row.targetDefinitionId = null;
+        row.targetDefinitionName = '';
+      },
+      // 删除行
+      deleteRow(row) {
+        this.form.details = this.form.details.filter(
+          (item) => item.id !== row.id
+        );
+      },
+      // 选择指标名称
+      targetDefinitionIdChange(row) {
+        const list = this.getIndicatorCacheList(
+          row.businessType,
+          row.indicator
+        );
+        const item = list.find((i) => i.id == row.targetDefinitionId);
+        row.targetDefinitionName = item ? item.name : '';
+      }
+    }
+  };
+</script>
+
+<style scoped lang="scss"></style>

+ 192 - 0
src/views/checklistManagement/templatelist.vue

@@ -0,0 +1,192 @@
+<template>
+  <div class="ele-body">
+    <el-card shadow="never">
+      <seek-page :seekList="seekList" @search="search"></seek-page>
+      <ele-pro-table
+        ref="table"
+        row-key="id"
+        :columns="columns"
+        :datasource="datasource"
+        :cache-key="cacheKeyUrl"
+        autoAmendPage
+      >
+        <template v-slot:toolbar>
+          <el-button type="primary" size="mini" @click="openAddDialog('add')"
+            >新建</el-button
+          >
+          <el-button type="primary" size="mini">导入</el-button>
+          <el-button size="mini">导出</el-button>
+        </template>
+        <template v-slot:action="{ row }">
+          <el-link type="text"  @click="openAddDialog('clone', row)">克隆</el-link>
+          <el-link
+            type="text"
+            @click="openAddDialog('edit', row)"
+            style="margin-right: 10px"
+            >修改</el-link
+          >
+          <el-popconfirm
+            v-if="row.enable == 0"
+            title="这是一段内容确定删除吗?"
+            @confirm="deleteRow(row)"
+          >
+            <el-link slot="reference" type="danger">删除</el-link>
+          </el-popconfirm>
+        </template>
+      </ele-pro-table>
+    </el-card>
+
+    <templateAdd ref="templateAddRef" @reload="reload"></templateAdd>
+  </div>
+</template>
+
+<script>
+  import dictMixins from '@/mixins/dictMixins';
+  import tableColumnsMixin from '@/mixins/tableColumnsMixin';
+  import {
+    checklisttemplatePage,
+    checklisttemplateLogicDeleteByIds
+  } from '@/api/checklisttemplate/index';
+  import templateAdd from './components/templateAdd.vue';
+
+  export default {
+    mixins: [dictMixins, tableColumnsMixin],
+    components: { templateAdd },
+    data() {
+      return {
+        columns: [
+          {
+            width: 50,
+            type: 'index',
+            columnKey: 'index',
+            align: 'center',
+            label: '序号'
+          },
+          {
+            prop: 'checklistType',
+            label: '放行类型',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true,
+            formatter: (row) => {
+              return this.getDictValue('放行类型', row.checklistType);
+            }
+          },
+          {
+            prop: 'templateCode',
+            label: '放行单编码',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'templateName',
+            label: '放行单名称',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'remark',
+            label: '备注',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'enable',
+            label: '状态',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 150,
+            formatter: (row) => {
+              return row.enable ? '启用' : '停用';
+            }
+          },
+          {
+            prop: 'createUserName',
+            label: '创建人',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'updateTime',
+            label: '修改时间',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 220,
+            align: 'center',
+            resizable: false,
+            fixed: 'right',
+            slot: 'action',
+            showOverflowTooltip: true
+          }
+        ],
+        cacheKeyUrl: 'mes-259251647-template-list-table'
+      };
+    },
+    computed: {
+      seekList() {
+        return [
+          {
+            label: '编码:',
+            value: 'releaseOrderCode',
+            type: 'input',
+            placeholder: '请输入'
+          },
+          {
+            label: '名称:',
+            value: 'releaseOrderName',
+            type: 'input',
+            placeholder: '请输入'
+          },
+          {
+            label: '放行类型:',
+            value: 'releaseOrderStatus',
+            type: 'input',
+            placeholder: '请输入'
+          }
+        ];
+      }
+    },
+    methods: {
+      // 刷新表格
+      reload(where = {}) {
+        this.$refs.table.reload({
+          where
+        });
+      },
+      /* 表格数据源 */
+      datasource({ page, limit, where, order }) {
+        // 参数
+        const body = {
+          ...where,
+          ...order,
+          pageNum: page,
+          size: limit
+        };
+        return checklisttemplatePage(body);
+      },
+      search(where) {
+        this.reload(where);
+      },
+      openAddDialog(type, row) {
+        this.$refs.templateAddRef?.open(type, row);
+      },
+      // 删除
+      async deleteRow(row) {
+        await checklisttemplateLogicDeleteByIds([row.id]);
+        this.$message.success('删除成功');
+        this.reload();
+      }
+    }
+  };
+</script>
+
+<style></style>

+ 1 - 1
vue.config.js

@@ -35,7 +35,7 @@ module.exports = {
         // target: 'http://192.168.1.116:18086',
         // target: 'http://192.168.1.251:18086',
         // target: 'http://192.168.1.103:18086',192.168.1.116
-        target: 'http://192.168.1.125:18086',
+        // target: 'http://192.168.1.125:18086',
         // target: 'http://192.168.1.116:18086',
         // target: 'http://192.168.1.144:18086',
         // target: 'http://192.168.1.30:18086',