2213980799@qq.com пре 1 година
родитељ
комит
127db1c11c

+ 54 - 0
src/api/inspectionPoint/index.js

@@ -0,0 +1,54 @@
+import request from '@/utils/request';
+
+
+// 列表
+
+export async function getList (data) {
+    const res = await request.post(`/qms/line_point/page` , data);
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  }
+
+// 新增
+export async function save(data) {
+  const res = await request.post(`/qms/line_point/save`, data);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 编辑
+export async function update(data) {
+  const res = await request.post(`/qms/line_point/update`, data);
+  if (res.data.code == 0) {
+    return res.data.message;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+
+export async function getById(id) {
+  const res = await request.get(`/qms/qualitystandard/getById/${id}`);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+
+
+
+
+// 删除
+export async function removeItem(data) {
+  const res = await request.delete('/qms/line_point/delete', {
+    data
+  });
+  if (res.data.code == 0) {
+    return res.data.message;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 47 - 0
src/api/inspectionProject/index.js

@@ -0,0 +1,47 @@
+import request from '@/utils/request';
+
+
+// 列表
+
+export async function getList (data) {
+    const res = await request.post(`/qms/inspection_item/page` , data);
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  }
+
+// 新增
+export async function save(data) {
+  const res = await request.post(`/qms/inspection_item/save`, data);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 编辑
+export async function update(data) {
+  const res = await request.post(`/qms/inspection_item/update`, data);
+  if (res.data.code == 0) {
+    return res.data.message;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+
+
+
+
+
+
+// 删除
+export async function removeItem(data) {
+  const res = await request.delete('/qms/inspection_item/delete', {
+    data
+  });
+  if (res.data.code == 0) {
+    return res.data.message;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 2 - 2
src/api/inspectionStandard/index.js

@@ -31,6 +31,8 @@ export async function update(data) {
 }
 
 
+
+
 export async function getById(id) {
   const res = await request.get(`/qms/qualitystandard/getById/${id}`);
   if (res.data.code == 0) {
@@ -41,8 +43,6 @@ export async function getById(id) {
 
 
 
-
-
 // 删除
 export async function removeItem(data) {
   const res = await request.delete('/qms/qualitystandard/delete', {

+ 167 - 0
src/views/inspectionPoint/components/EquipmentDialog.vue

@@ -0,0 +1,167 @@
+<template>
+  <el-dialog
+    :visible.sync="equipmentdialog"
+    :before-close="handleClose"
+    :close-on-click-modal="true"
+    :close-on-press-escape="false"
+    append-to-body
+    width="60%"
+  >
+    <div>
+      <el-row>
+        <el-col :span="24" class="table_col" v-if="equipmentdialog">
+          <ele-pro-table
+            ref="equiTable"
+            :columns="columns"
+            :datasource="datasource"
+            :selection.sync="selection"
+            :current.sync="current"
+            highlight-current-row
+            cache-key="systemRoleTable3"
+            
+            row-key="id"
+            height="50vh"
+            @done="onDone"
+          >
+          </ele-pro-table>
+        </el-col>
+      </el-row>
+    </div>
+    <div class="btns">
+      <el-button type="primary" size="small" @click="selected">选择</el-button>
+      <el-button size="small" @click="handleClose">关闭</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+import { getList } from '@/api/inspectionProject';
+
+export default {
+  components: {},
+  props: {
+    selectList: Array,
+    type: {
+      default: 1 //1多选 2单选
+    }
+  },
+  data() {
+    return {
+      equipmentdialog: false,
+      current: null,
+      columns: [
+        {
+          width: 45,
+          type: 'selection',
+          columnKey: 'selection',
+          align: 'center',
+          reserveSelection: true,
+
+        },
+        {
+          prop: 'inspectionCode',
+          label: '编码'
+        },
+        {
+          label: '质检项名称',
+          prop: 'inspectionName'
+        },
+
+        {
+          label: '是否生成过程',
+          prop: 'isCreateCourse',
+          formatter: (row, column, cellValue) => {
+            return cellValue == 1 ? '是' : cellValue === 0 ? '否' : '';
+          }
+        },
+        {
+          label: '质检标准',
+          prop: 'inspectionStandard'
+        },
+
+        {
+          label: '质检工具',
+          prop: 'inspectionTool'
+        },
+        {
+          label: '状态',
+          prop: 'status',
+          formatter: (row, column, cellValue) => {
+            return cellValue == 1 ? '启用' : cellValue === 0 ? '停用' : '';
+          }
+        },
+        {
+          label: '描述',
+          prop: 'description'
+        },
+
+        {
+          label: '备注',
+          prop: 'inspectionRemark'
+        }
+      ],
+      categoryLevelId: null,
+      code: null,
+      selection: [],
+      ids:[]
+    };
+  },
+
+  watch: {},
+  methods: {
+    datasource({ page, where, limit }) {
+      return getList({
+        ...where,
+        pageNum: page,
+        size: limit
+      });
+    },
+    open(ids) {
+      this.equipmentdialog = true;
+      this.ids=ids
+    
+    },
+    onDone(){
+      this.$nextTick(() => {
+        this.$refs.equiTable.setSelectedRowKeys(this.ids);
+      });
+    },
+    handleClose() {
+      this.equipmentdialog = false;
+      this.$refs.equiTable.clearSelection();
+    },
+    // 选择
+    selected() {
+      this.$emit('choose', JSON.parse(JSON.stringify(this.selection)));
+      this.handleClose();
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.tree_col {
+  border: 1px solid #eee;
+  padding: 10px 0;
+  box-sizing: border-box;
+  max-height: 530px;
+  overflow: auto;
+}
+.table_col {
+  padding-left: 10px;
+  ::v-deep .el-table th.el-table__cell {
+    background: #f2f2f2;
+  }
+}
+.pagination {
+  text-align: right;
+  padding: 10px 0;
+}
+.btns {
+  text-align: center;
+  padding: 10px 0;
+}
+.topsearch {
+  margin-bottom: 15px;
+}
+</style>

+ 145 - 0
src/views/inspectionPoint/components/edit.vue

@@ -0,0 +1,145 @@
+<!-- 用户编辑弹窗 -->
+<template>
+  <el-dialog
+    class="ele-dialog-form"
+    :title="title"
+    :visible.sync="visible"
+    :before-close="handleClose"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    width="1000px"
+  >
+    <el-form ref="form" :model="form" :rules="rules" label-width="120px">
+      <el-row>
+        <el-col :span="12">
+          <el-form-item label="名称:" prop="pointName">
+            <el-input clearable v-model="form.pointName" placeholder="请输入" />
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="附件:" prop="files">
+            <fileUpload
+              v-model="form.files"
+              module="main"
+              :showLib="false"
+              :limit="1"
+            />
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-row>
+        <inspectionProjectList v-if="visible" :list="form.inspectionItems" ref="inspectionProjectRef" />
+       
+      </el-row>
+    </el-form>
+    <template v-slot:footer>
+      <el-button @click="handleClose">取消</el-button>
+      <el-button type="primary" :loading="loading" @click="save">
+        保存
+      </el-button>
+    </template>
+  </el-dialog>
+</template>
+
+<script>
+import { save, update } from '@/api/inspectionPoint';
+import fileUpload from '@/components/upload/fileUpload';
+import EquipmentDialog from './EquipmentDialog';
+import inspectionProjectList from './inspectionProjectList';
+export default {
+  components: {
+    fileUpload,
+    EquipmentDialog,
+    inspectionProjectList
+  },
+
+  data() {
+    const defaultForm = function () {
+      return {
+        id: '',
+        pointName: '',
+        files: '',
+        inspectionId: '',
+        inspectionItems: []
+      };
+    };
+    return {
+      defaultForm,
+      // 表单数据
+      form: { ...defaultForm() },
+      // 表单验证规则
+      rules: {
+        pointName: [{ required: true, message: '请输入', trigger: 'blur' }]
+      },
+      visible: false,
+      type: null,
+      title: null,
+      loading: false
+    };
+  },
+
+  created() {},
+  methods: {
+    open(type, row) {
+      this.title = type == 'add' ? '新增' : '编辑';
+      this.type = type;
+      if (this.type == 'edit') {
+        this.form = row;
+      }
+      this.visible = true;
+    },
+  
+    /* 保存编辑 */
+    save() {
+      this.$refs.form.validate((valid) => {
+        if (!valid) {
+          return false;
+        }
+        this.loading = true;
+        if (this.type == 'add') {
+          delete this.form.id;
+        }
+        this.form.inspectionId = this.$refs.inspectionProjectRef.getValue();
+        console.log(this.form);
+        // return;
+        let URL = this.type == 'add' ? save : update;
+        URL(this.form)
+          .then((msg) => {
+            this.loading = false;
+            this.$message.success(msg);
+            this.handleClose();
+            this.$emit('done');
+          })
+          .catch((e) => {
+            this.loading = false;
+          });
+      });
+    },
+    restForm() {
+      this.form = { ...this.defaultForm() };
+      this.$nextTick(() => {
+        this.$refs.form.clearValidate();
+      });
+    },
+    handleClose() {
+      this.restForm();
+      this.visible = false;
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+
+
+
+
+:deep(
+    .el-dialog:not(.ele-dialog-form)
+      .el-dialog__body
+      .el-form
+      .el-form-item:last-child
+  ) {
+  margin-bottom: 22px;
+}
+</style>

+ 95 - 0
src/views/inspectionPoint/components/inspectionProjectList.vue

@@ -0,0 +1,95 @@
+<template>
+  <div>
+    <div class="title">质检项</div>
+
+    <el-table :data="listPage" border height="20vh">
+      <el-table-column label="编码" align="center" prop="inspectionCode">
+      </el-table-column>
+      <el-table-column label="质检项名称" align="center" prop="inspectionName">
+      </el-table-column>
+      <el-table-column
+        label="质检标准"
+        align="center"
+        prop="inspectionStandard"
+      >
+      </el-table-column>
+      <el-table-column label="质检工具" align="center" prop="inspectionTool">
+      </el-table-column>
+      <el-table-column label="描述" align="center" prop="description">
+      </el-table-column>
+      <el-table-column label="操作" align="center" width="70">
+        <template slot-scope="scope">
+          <el-link
+            type="danger"
+            :underline="false"
+            @click="handleDeleteItem(scope.$index, scope.row.id)"
+          >
+            删除
+          </el-link>
+        </template>
+      </el-table-column>
+    </el-table>
+    <div class="add-product" @click="addEquipment">
+      <i class="el-icon-circle-plus-outline"></i>
+    </div>
+    <EquipmentDialog ref="equipmentDialog" @choose="choose" />
+  </div>
+</template>
+
+<script>
+import EquipmentDialog from './EquipmentDialog';
+export default {
+  components: { EquipmentDialog },
+  props: {
+    list: {
+      type: Array,
+      default() {
+        return [];
+      }
+    },
+    type: {}
+  },
+
+  data() {
+    return {
+      listPage: []
+    };
+  },
+
+  created() {
+    this.listPage = JSON.parse(JSON.stringify(this.list));
+  },
+  methods: {
+    choose(data) {
+      this.listPage = data;
+    },
+    handleDeleteItem(index, id) {
+      this.listPage.splice(index, 1);
+    },
+    addEquipment() {
+      this.$refs.equipmentDialog.open(this.listPage.map((item) => item.id));
+    },
+    getValue() {
+      return this.listPage.map((item) => item.id).toString();
+    },
+   
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.title {
+  font-size: 16px;
+  margin-bottom: 20px;
+}
+.add-product {
+  width: 100%;
+  display: flex;
+  align-items: center;
+  justify-content: flex-end;
+  font-size: 30px;
+  color: #1890ff;
+  margin: 10px 0;
+  cursor: pointer;
+}
+</style>

+ 70 - 0
src/views/inspectionPoint/components/search.vue

@@ -0,0 +1,70 @@
+<!-- 搜索表单 --> 6
+<template>
+  <el-form label-width="90px" class="ele-form-search" @keyup.enter.native="search" @submit.native.prevent>
+    <el-row :gutter="15">
+      <el-col v-bind="styleResponsive ? { lg: 5, md: 10 } : { span: 4}">
+        <el-form-item label="名称:">
+          <el-input clearable v-model="where.pointName" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+
+      <el-col v-bind="styleResponsive ? { lg: 5, md: 10 } : { span: 4}">
+        <el-form-item label="编码:">
+          <el-input clearable v-model="where.code" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+
+
+
+
+     
+
+ 
+      <el-col v-bind="styleResponsive ? { lg: 4, md: 10 } : { span: 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">重置</el-button>
+        </div>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+
+<script>
+export default {
+  data() {
+    // 默认表单数据
+    const defaultWhere = {
+      name: '',
+      standardCode: '',
+      status: ''
+    };
+    return {
+      defaultWhere,
+      // 表单数据
+      where: { ...defaultWhere },
+
+    };
+  },
+  computed: {
+    // 是否开启响应式布局
+    styleResponsive() {
+      return this.$store.state.theme.styleResponsive;
+    }
+  },
+  methods: {
+    /* 搜索 */
+    search() {
+      this.$emit('search', this.where);
+    },
+    /*  重置 */
+    reset() {
+
+      this.where = { ...this.defaultWhere };
+      this.search();
+    }
+  }
+};
+</script>

+ 161 - 0
src/views/inspectionPoint/index.vue

@@ -0,0 +1,161 @@
+<template>
+  <div class="ele-body">
+    <el-card shadow="never">
+      <search ref="search" @search="search"></search>
+      <ele-pro-table
+        ref="table"
+        :columns="columns"
+        :datasource="datasource"
+      >
+        <!-- 表头工具栏 -->
+        <template v-slot:toolbar>
+          <el-button
+            size="small"
+            type="primary"
+            icon="el-icon-plus"
+            class="ele-btn-icon"
+            @click="openEdit('add')"
+          >
+            添加
+          </el-button>
+        </template>
+        <template v-slot:files="scope">
+          <el-link
+            v-for="link in scope.row.files"
+            :key="link.id"
+            type="primary"
+            :underline="false"
+            @click="downloadFile(link)"
+          >
+            {{ link.name }}
+          </el-link
+          >
+     
+      </template>
+
+        <!-- 操作列 -->
+        <template v-slot:action="{ row }">
+          <el-link
+            type="primary"
+            :underline="false"
+            icon="el-icon-edit"
+            @click="openEdit('edit', row)"
+          >
+            修改
+          </el-link>
+          <el-popconfirm
+            class="ele-action"
+            title="确定要删除吗?"
+            @confirm="remove(row)"
+          >
+            <template v-slot:reference>
+              <el-link type="danger" :underline="false" icon="el-icon-delete">
+                删除
+              </el-link>
+            </template>
+          </el-popconfirm>
+        </template>
+      </ele-pro-table>
+    </el-card>
+    <edit ref="edit" @done="done"></edit>
+  </div>
+</template>
+<script>
+import search from './components/search.vue';
+import edit from './components/edit.vue';
+import { getList, removeItem } from '@/api/inspectionPoint';
+import dictMixins from '@/mixins/dictMixins';
+import {getFile} from "@/api/system/file";
+
+export default {
+  mixins: [dictMixins],
+  components: {
+    search,
+    edit
+  },
+  data() {
+    return {
+      columns: [
+        {
+          width: 45,
+          type: 'index',
+          columnKey: 'index',
+          align: 'center'
+        },
+
+        {
+          prop: 'pointCode',
+          label: '编码'
+        },
+        {
+          label: '名称',
+          prop: 'pointName'
+        },
+
+        {
+          label: '附件',
+          slot: 'files'
+        },
+        {
+          prop: 'createUserName',
+          label: '创建人',
+          align: 'center'
+        },
+
+        {
+          prop: 'createTime',
+          label: '创建时间',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          columnKey: 'action',
+          label: '操作',
+          width: 220,
+          align: 'center',
+          resizable: false,
+          slot: 'action',
+          showOverflowTooltip: true
+        }
+      ]
+    };
+  },
+  created() {
+    this.requestDict('质检标准类型');
+  },
+  methods: {
+    datasource({ page, where, limit }) {
+      return getList({
+        ...where,
+        pageNum: page,
+        size: limit
+      });
+    },
+    search(where) {
+      this.$refs.table.reload({
+        where: where,
+        page: 1
+      });
+    },
+    openEdit(type, row) {
+      this.$refs.edit.open(type, row);
+    },
+    downloadFile(file) {
+      getFile({objectName: file.storePath}, file.name);
+    },
+    remove(row) {
+      removeItem([row.id])
+        .then((message) => {
+          this.$message.success(message);
+          this.done();
+        })
+        .catch((e) => {});
+    },
+    done() {
+      this.$refs.search.search();
+    }
+  }
+};
+</script>
+  

+ 193 - 0
src/views/inspectionProject/components/edit.vue

@@ -0,0 +1,193 @@
+<!-- 用户编辑弹窗 -->
+<template>
+  <el-dialog class="ele-dialog-form" :title="title" :visible.sync="visible" :before-close="handleClose"
+    :close-on-click-modal="false" :close-on-press-escape="false" width="1000px">
+    <el-form ref="form" :model="form" :rules="rules" label-width="120px">
+      <el-row>
+
+
+
+        <el-col :span="12">
+          <el-form-item label="名称:" prop="inspectionName">
+            <el-input clearable v-model="form.inspectionName" placeholder="请输入" />
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="状态:" prop="status">
+            <el-select v-model="form.status" placeholder="请选择" style="width: 100%">
+              <el-option label="停用" :value="0" />
+              <el-option label="启用" :value="1" />
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="是否生成过程:" prop="isCreateCourse">
+            <el-select v-model="form.isCreateCourse" placeholder="请选择" style="width: 100%">
+              <el-option label="是" :value="1" />
+              <el-option label="否" :value="0" />
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="质检标准:" prop="inspectionStandard">
+            <el-input v-model="form.inspectionStandard"></el-input>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="12">
+          <el-form-item label="质检工具:" prop="inspectionTool">
+            <el-input v-model="form.inspectionTool"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="描述:" prop="description">
+            <el-input v-model="form.description"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="备注:" prop="inspectionRemark">
+            <el-input  type="textarea" v-model="form.inspectionRemark"></el-input>
+          </el-form-item>
+        </el-col>
+    
+
+      </el-row>
+    </el-form>
+
+
+
+
+
+
+
+
+    <template v-slot:footer>
+      <el-button @click="handleClose">取消</el-button>
+      <el-button type="primary" :loading="loading" @click="save">
+        保存
+      </el-button>
+    </template>
+
+
+
+
+  </el-dialog>
+</template>
+
+<script>
+
+import { save, update, getById } from '@/api/inspectionProject';
+export default {
+  data() {
+    const defaultForm = function () {
+      return {
+        id: '',
+        inspectionCode: '',
+        status: 1,
+        inspectionName: '',
+        inspectionRemark: '',
+        inspectionStandard: '',
+        inspectionTool: '',
+        isCreateCourse: '',
+        description: '',
+      };
+    };
+    return {
+      defaultForm,
+      // 表单数据
+      form: { ...defaultForm() },
+      // 表单验证规则
+      rules: {
+
+        inspectionName: [{ required: true, message: '请输入', trigger: 'blur' }],
+
+        status: {
+          required: true,
+          message: '请选择',
+          trigger: 'change'
+        },
+
+      },
+      visible: false,
+      type: null,
+      title: null,
+      loading: false,
+
+    };
+  },
+
+  created() {
+
+  },
+  methods: {
+    open(type, row) {
+      this.title = type == 'add' ? '新增' : '编辑'
+      this.type = type;
+      if (this.type == 'edit') {
+        this.form=row
+      }
+      this.visible = true;
+
+    },
+
+
+
+    /* 保存编辑 */
+    save() {
+      this.$refs.form.validate((valid) => {
+        if (!valid) {
+          return false;
+        }
+        this.loading = true;
+        if (this.type == 'add') {
+          delete this.form.id;
+        }
+        let URL = this.type == 'add' ? save : update
+        URL(this.form)
+          .then((msg) => {
+            this.loading = false;
+            this.$message.success(msg);
+            this.handleClose();
+            this.$emit('done');
+          })
+          .catch((e) => {
+            this.loading = false;
+          });
+      });
+    },
+    restForm() {
+      this.form = { ...this.defaultForm() };
+      this.$nextTick(() => {
+        this.$refs.form.clearValidate();
+      });
+    },
+    handleClose() {
+      this.restForm();
+      this.visible = false;
+    },
+
+
+
+
+
+
+
+
+
+  }
+};
+</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>

+ 71 - 0
src/views/inspectionProject/components/search.vue

@@ -0,0 +1,71 @@
+<!-- 搜索表单 --> 6
+<template>
+  <el-form label-width="90px" class="ele-form-search" @keyup.enter.native="search" @submit.native.prevent>
+    <el-row :gutter="15">
+      <el-col v-bind="styleResponsive ? { lg: 5, md: 10 } : { span: 4}">
+        <el-form-item label="名称:">
+          <el-input clearable v-model="where.name" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+
+      <el-col v-bind="styleResponsive ? { lg: 5, md: 10 } : { span: 4}">
+        <el-form-item label="编码:">
+          <el-input clearable v-model="where.standardCode" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 5, md: 10 } : { span: 4}">
+        <el-form-item label="状态:">
+          <el-select v-model="where.status" class="m-2" placeholder="请选择" size="large">
+            <el-option label="停用" :value="0" />
+            <el-option label="启用" :value="1" />
+          </el-select>
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 4, md: 10 } : { span: 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">重置</el-button>
+        </div>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+
+<script>
+export default {
+  data() {
+    // 默认表单数据
+    const defaultWhere = {
+      name: '',
+      standardCode: '',
+      status: ''
+    };
+    return {
+      defaultWhere,
+      // 表单数据
+      where: { ...defaultWhere },
+
+    };
+  },
+  computed: {
+    // 是否开启响应式布局
+    styleResponsive() {
+      return this.$store.state.theme.styleResponsive;
+    }
+  },
+  methods: {
+    /* 搜索 */
+    search() {
+      this.$emit('search', this.where);
+    },
+    /*  重置 */
+    reset() {
+
+      this.where = { ...this.defaultWhere };
+      this.search();
+    }
+  }
+};
+</script>

+ 159 - 0
src/views/inspectionProject/index.vue

@@ -0,0 +1,159 @@
+<template>
+  <div class="ele-body">
+    <el-card shadow="never">
+      <search ref="search" @search="search"></search>
+      <ele-pro-table
+        ref="table"
+        :columns="columns"
+        :datasource="datasource"
+      >
+        <!-- 表头工具栏 -->
+        <template v-slot:toolbar>
+          <el-button
+            size="small"
+            type="primary"
+            icon="el-icon-plus"
+            class="ele-btn-icon"
+            @click="openEdit('add')"
+          >
+            添加
+          </el-button>
+        </template>
+
+        <!-- 操作列 -->
+        <template v-slot:action="{ row }">
+          <el-link
+            type="primary"
+            :underline="false"
+            icon="el-icon-edit"
+            @click="openEdit('edit', row)"
+          >
+            修改
+          </el-link>
+          <el-popconfirm
+            class="ele-action"
+            title="确定要删除吗?"
+            @confirm="remove(row)"
+          >
+            <template v-slot:reference>
+              <el-link type="danger" :underline="false" icon="el-icon-delete">
+                删除
+              </el-link>
+            </template>
+          </el-popconfirm>
+        </template>
+      </ele-pro-table>
+    </el-card>
+    <edit ref="edit" @done="done"></edit>
+  </div>
+</template>
+<script>
+import search from './components/search.vue';
+import edit from './components/edit.vue';
+import { getList, removeItem } from '@/api/inspectionProject';
+import dictMixins from '@/mixins/dictMixins';
+export default {
+  mixins: [dictMixins],
+  components: {
+    search,
+    edit
+  },
+  data() {
+    return {
+      columns: [
+        {
+          width: 45,
+          type: 'index',
+          columnKey: 'index',
+          align: 'center'
+        },
+
+        {
+          prop: 'inspectionCode',
+          label: '编码'
+        },
+        {
+          label: '名称',
+          prop: 'inspectionName'
+        },
+
+        {
+          label: '是否生成过程',
+          prop: 'isCreateCourse',
+          formatter: (row, column, cellValue) => {
+            return cellValue==1?'是': cellValue===0?'否':''
+          }
+        },
+        {
+          label: '质检标准',
+          prop: 'inspectionStandard'
+        },
+
+        {
+          label: '质检工具',
+          prop: 'inspectionTool'
+        },
+        {
+          label: '状态',
+          prop: 'status',
+          formatter: (row, column, cellValue) => {
+            return cellValue==1?'启用': cellValue===0?'停用':''
+          }
+        },
+        {
+          label: '描述',
+          prop: 'description'
+        },
+
+        {
+          label: '备注',
+          prop: 'inspectionRemark'
+        },
+        {
+          columnKey: 'action',
+          label: '操作',
+          width: 220,
+          align: 'center',
+          resizable: false,
+          slot: 'action',
+          showOverflowTooltip: true
+        }
+      ]
+    };
+  },
+  created() {
+    this.requestDict('质检标准类型');
+  },
+  methods: {
+    datasource({ page, where, limit }) {
+      return getList({
+        ...where,
+        pageNum: page,
+        size: limit
+      });
+    },
+    search(where) {
+      this.$refs.table.reload({
+        where: where,
+        page: 1
+      });
+    },
+    openEdit(type, row) {
+      this.$refs.edit.open(type, row);
+    },
+
+    remove(row) {
+      removeItem([row.id])
+        .then((message) => {
+          this.$message.success(message);
+          this.done();
+        })
+        .catch((e) => {});
+    },
+    done() {
+      this.$refs.search.search();
+    }
+  }
+};
+</script>
+  

+ 18 - 8
src/views/inspectionStandard/components/edit.vue

@@ -50,6 +50,10 @@
 
 
 
+      </el-row>
+      <el-row>
+        <inspectionProjectList v-if="visible" :list="form.inspectionItems" ref="inspectionProjectRef" />
+       
       </el-row>
     </el-form>
 
@@ -77,9 +81,11 @@
 
 import { save, update, getById } from '@/api/inspectionStandard';
 import fileUpload from '@/components/upload/fileUpload';
+import inspectionProjectList from '../../../views/inspectionPoint/components/inspectionProjectList';
+
 export default {
   components: {
-    fileUpload
+    fileUpload,inspectionProjectList
   },
 
 
@@ -93,7 +99,8 @@ export default {
         type: '',
         version: '1.0',
         standardCode: '',
-
+        inspectionId:"",
+        inspectionItems: []
       };
     };
     return {
@@ -134,20 +141,21 @@ export default {
       this.title = type == 'add' ? '新增' : '编辑'
       this.type = type;
       if (this.type == 'edit') {
+        this.form=row
 
-        this.getDetail(row.id)
+        // this.getDetail(row.id)
       }
       this.visible = true;
 
 
     },
 
-    getDetail(id) {
-      getById(id).then(res => {
-        this.form = res.data
+    // getDetail(id) {
+    //   getById(id).then(res => {
+    //     this.form = res.data
 
-      })
-    },
+    //   })
+    // },
 
     /* 保存编辑 */
     save() {
@@ -159,6 +167,8 @@ export default {
         if (this.type == 'add') {
           delete this.form.id;
         }
+        this.form.inspectionId = this.$refs.inspectionProjectRef.getValue();
+
         let URL = this.type == 'add' ? save : update
         URL(this.form)
           .then((msg) => {

+ 1 - 1
vue.config.js

@@ -32,7 +32,7 @@ module.exports = {
       // 当我们的本地的请求 有/api的时候,就会代理我们的请求地址向另外一个服务器发出请求
       '/api': {
         // target: 'http://124.71.68.31:50001',
-        target: 'http://192.168.1.139:18086',
+        target: 'http://192.168.1.107:18086',
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域
         pathRewrite: {
           '^/api': ''