2213980799@qq.com vor 2 Jahren
Ursprung
Commit
7a89b96e0c

+ 17 - 0
src/api/aps/index.js

@@ -0,0 +1,17 @@
+import request from '@/utils/request';
+
+
+// 选择工艺路线
+export async function routeList(params) {
+  const res = await request.get('/main/producerouting/page', { params });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+}
+// 工序
+export async function getProduceTaskList(params) {
+  const res = await request.post('/main/producerouting/taskinstance/page',params);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+}

+ 14 - 7
src/api/inspectionStandard/index.js

@@ -3,14 +3,14 @@ import request from '@/utils/request';
 
 // 列表
 
-export async function getList (data) {
-    let par = new URLSearchParams(data);
-    const res = await request.get(`/qms/qualitystandard/page?` + par, {});
-    if (res.data.code == 0) {
-      return res.data.data;
-    }
-    return Promise.reject(new Error(res.data.message));
+export async function getList(data) {
+  let par = new URLSearchParams(data);
+  const res = await request.get(`/qms/qualitystandard/page?` + par, {});
+  if (res.data.code == 0) {
+    return res.data.data;
   }
+  return Promise.reject(new Error(res.data.message));
+}
 
 // 新增
 export async function save(data) {
@@ -53,3 +53,10 @@ export async function removeItem(data) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+//列表
+export async function parameterList(params) {
+  const res = await request.get('/main/produceparam/page', { params });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+}

+ 61 - 0
src/api/inspectionWork/index.js

@@ -0,0 +1,61 @@
+import request from '@/utils/request';
+
+
+// 列表
+
+export async function getList(data) {
+  const res = await request.post(`/qms/quality_work_order/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/quality_work_order/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/quality_work_order/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/quality_work_order/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/quality_work_order/delete', {
+    data
+  });
+  if (res.data.code == 0) {
+    return res.data.message;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+//列表
+export async function parameterList(params) {
+  const res = await request.get('/main/produceparam/page', { params });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+}

+ 4 - 4
src/components/CreatePlan/ChooseMaterial.vue

@@ -1,6 +1,6 @@
 <template>
   <el-dialog
-    title="选择物料"
+    title="选择产品"
     :visible.sync="materialdialog"
     :before-close="handleClose"
     :close-on-click-modal="false"
@@ -16,7 +16,7 @@
               <el-col :span="6">
                 <el-input
                   v-model.trim="searchKey"
-                  placeholder="输入设备编码或名称"
+                  placeholder="输入产品编码或名称"
                   size="small"
                 ></el-input>
               </el-col>
@@ -93,7 +93,7 @@
 
 <script>
   import AssetTree from '@/components/AssetTree';
-  import { getList } from '@/api/classifyManage/itemInformation';
+  import { getList } from '@/api/classifyManage';
   export default {
     components: {
       AssetTree
@@ -180,7 +180,7 @@
       },
       selected () {
         if (!this.selectedRow.id) {
-          return this.$message.error('请选择物料!');
+          return this.$message.error('请选择产品!');
         }
 
         this.$emit('success', this.selectedRow);

+ 8 - 3
src/enum/dict.js

@@ -6,7 +6,11 @@ export default {
   流程分类: 'processCategory',
   角度: 'angle',
   质检标准类型: 'quality_testing_code',
-  质检方式: 'quality_method_code'
+  质检方式: 'quality_method_code',
+  质检项标准单位:'quality_inspection_standard_unit',
+  数学字符:'mathematical_symbol',
+  质检类型:'inspection_type',
+  不良品处理类型:'unqualified_products_type',
 
 };
 
@@ -15,6 +19,7 @@ export const numberList = [
   'patrol_cycle',
   'order_library',
   'order_type',
-   'quality_testing_code',
-   'quality_method_code'
+  'quality_testing_code',
+  'quality_method_code',
+  'inspection_type'
 ];

+ 14 - 13
src/views/inspectionPoint/components/EquipmentDialog.vue

@@ -56,7 +56,7 @@ export default {
           columnKey: 'selection',
           align: 'center',
           reserveSelection: true,
-
+          show:this.type==1
         },
         {
           prop: 'inspectionCode',
@@ -67,22 +67,22 @@ export default {
           prop: 'inspectionName'
         },
 
-        {
-          label: '是否生成过程',
-          prop: 'isCreateCourse',
-          formatter: (row, column, cellValue) => {
-            return cellValue == 1 ? '是' : cellValue === 0 ? '否' : '';
-          }
-        },
+        // {
+        //   label: '是否生成过程',
+        //   prop: 'isCreateCourse',
+        //   formatter: (row, column, cellValue) => {
+        //     return cellValue == 1 ? '是' : cellValue === 0 ? '否' : '';
+        //   }
+        // },
         {
           label: '质检标准',
           prop: 'inspectionStandard'
         },
 
-        {
-          label: '质检工具',
-          prop: 'inspectionTool'
-        },
+        // {
+        //   label: '质检工具',
+        //   prop: 'inspectionTool'
+        // },
         {
           label: '状态',
           prop: 'status',
@@ -117,6 +117,7 @@ export default {
       });
     },
     open(ids) {
+    
       this.equipmentdialog = true;
       this.ids=ids
     
@@ -132,7 +133,7 @@ export default {
     },
     // 选择
     selected() {
-      this.$emit('choose', JSON.parse(JSON.stringify(this.selection)));
+      this.$emit('choose', this.type==1?JSON.parse(JSON.stringify(this.selection)):JSON.parse(JSON.stringify(this.current)));
       this.handleClose();
     }
   }

+ 92 - 14
src/views/inspectionPoint/components/edit.vue

@@ -16,6 +16,29 @@
             <el-input clearable v-model="form.pointName" placeholder="请输入" />
           </el-form-item>
         </el-col>
+        <el-col :span="12">
+          <el-form-item label="区域:" prop="areaName">
+            <el-input clearable v-model="form.areaName" placeholder="请输入" />
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="质检分类:" prop="typeValue">
+            <ele-tree-select
+              multiple
+              clearable
+              :data="typeList"
+              v-model="form.typeValue"
+              placeholder="请选择"
+              default-expand-all
+              valueKey="id"
+              labelKey="name"
+              :checkStrictly="true"
+              @change="changeList"
+              ref="treeSelect"
+            />
+          </el-form-item>
+        </el-col>
+
         <el-col :span="12">
           <el-form-item label="附件:" prop="files">
             <fileUpload
@@ -28,8 +51,23 @@
         </el-col>
       </el-row>
       <el-row>
-        <inspectionProjectList v-if="visible" :list="form.inspectionItems" ref="inspectionProjectRef" />
-       
+        <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
+          <el-tab-pane
+            :label="item.categoryLevelName"
+            :name="item.id"
+            v-for="item in form.qualityLevelList"
+            :key="item.id"
+          >
+            <el-row>
+              <inspectionProjectList
+                v-if="visible"
+                :list="item.itemVOList"
+                ref="inspectionProjectRef"
+                @changeDate="changeDate"
+              />
+            </el-row>
+          </el-tab-pane>
+        </el-tabs>
       </el-row>
     </el-form>
     <template v-slot:footer>
@@ -46,6 +84,8 @@ import { save, update } from '@/api/inspectionPoint';
 import fileUpload from '@/components/upload/fileUpload';
 import EquipmentDialog from './EquipmentDialog';
 import inspectionProjectList from './inspectionProjectList';
+import { getTreeByPid } from '@/api/classifyManage';
+
 export default {
   components: {
     fileUpload,
@@ -58,9 +98,11 @@ export default {
       return {
         id: '',
         pointName: '',
-        files: '',
+        files: [],
         inspectionId: '',
-        inspectionItems: []
+        itemVOList: [],
+        qualityLevelList: [],
+        typeValue: []
       };
     };
     return {
@@ -69,37 +111,76 @@ export default {
       form: { ...defaultForm() },
       // 表单验证规则
       rules: {
-        pointName: [{ required: true, message: '请输入', trigger: 'blur' }]
+        pointName: [{ required: true, message: '请输入', trigger: 'blur' }],
+        typeValue: [{ required: true, message: '请选择', trigger: 'blur' }]
       },
       visible: false,
       type: null,
       title: null,
-      loading: false
+      loading: false,
+      typeList: [],
+      activeName: ''
     };
   },
 
-  created() {},
+  created() {
+    getTreeByPid(12).then((res) => {
+      this.typeList = res.data;
+      // console.log(res,'dsds')
+    });
+  },
   methods: {
+    changeList(data) {
+      console.log(data);
+      let list = [];
+      data.forEach((item) => {
+        let val = this.$refs.treeSelect.getNodeByValue(item);
+        list.push({
+          id: val.id,
+          categoryLevelName: val.name,
+          itemVOList:this.form.qualityLevelList.find(item=>item.id==val.id)?.itemVOList||[]
+        });
+      });
+      this.form.qualityLevelList = JSON.parse(JSON.stringify(list));
+      if (this.form.qualityLevelList.length == 1) {
+        this.activeName = this.form.qualityLevelList[0].id;
+      }
+    },
+    changeDate(data) {
+      this.form.qualityLevelList.forEach((item) => {
+        if (item.id == this.activeName) {
+          item.itemVOList = data;
+        }
+      });
+      // console.log(data);
+    },
     open(type, row) {
       this.title = type == 'add' ? '新增' : '编辑';
       this.type = type;
       if (this.type == 'edit') {
         this.form = row;
+        if(row.qualityLevelList.length>0){
+          this.form.typeValue=row.qualityLevelList.map(item=>item.id)
+          this.activeName = row.qualityLevelList[0].id;
+
+        }
       }
       this.visible = true;
     },
-  
+
     /* 保存编辑 */
     save() {
       this.$refs.form.validate((valid) => {
         if (!valid) {
           return false;
         }
-        this.loading = true;
+        // this.loading = true;
         if (this.type == 'add') {
           delete this.form.id;
+         
         }
-        this.form.inspectionId = this.$refs.inspectionProjectRef.getValue();
+        delete this.form.createTime
+        // this.form.inspectionId = this.$refs.inspectionProjectRef.getValue();
         console.log(this.form);
         // return;
         let URL = this.type == 'add' ? save : update;
@@ -121,6 +202,7 @@ export default {
         this.$refs.form.clearValidate();
       });
     },
+    handleClick() {},
     handleClose() {
       this.restForm();
       this.visible = false;
@@ -130,10 +212,6 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-
-
-
-
 :deep(
     .el-dialog:not(.ele-dialog-form)
       .el-dialog__body

+ 26 - 5
src/views/inspectionPoint/components/inspectionProjectList.vue

@@ -2,7 +2,7 @@
   <div>
     <div class="title">质检项</div>
 
-    <el-table :data="listPage" border height="20vh">
+    <el-table :data="listPage" border height="30vh">
       <el-table-column label="编码" align="center" prop="inspectionCode">
       </el-table-column>
       <el-table-column label="质检项名称" align="center" prop="inspectionName">
@@ -12,9 +12,24 @@
         align="center"
         prop="inspectionStandard"
       >
+      <template slot-scope="scope">
+        <el-form-item label-width="0" prop="inspectionStandard">
+          <el-input
+            clearable
+            v-model="scope.row.inspectionStandard"
+            placeholder="请输入"
+            @change="changeValue"
+          >
+          <span slot="suffix">  {{ scope.row.unit }}</span>
+          </el-input>
+         
+        </el-form-item>
+     
+      </template>
+
       </el-table-column>
-      <el-table-column label="质检工具" align="center" prop="inspectionTool">
-      </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">
@@ -57,22 +72,28 @@ export default {
   },
 
   created() {
+    console.log(this.list,'this.list')
     this.listPage = JSON.parse(JSON.stringify(this.list));
   },
   methods: {
     choose(data) {
       this.listPage = data;
+      this.$emit('changeDate',data)
     },
     handleDeleteItem(index, id) {
       this.listPage.splice(index, 1);
+      this.$emit('changeDate',this.listPage)
+
+    },
+    changeValue(){
+      this.$emit('changeDate',this.listPage)
     },
     addEquipment() {
       this.$refs.equipmentDialog.open(this.listPage.map((item) => item.id));
     },
     getValue() {
       return this.listPage.map((item) => item.id).toString();
-    },
-   
+    }
   }
 };
 </script>

+ 6 - 2
src/views/inspectionPoint/index.vue

@@ -91,7 +91,11 @@ export default {
           label: '名称',
           prop: 'pointName'
         },
-
+        {
+          label: '区域',
+          prop: 'areaName'
+        },
+        
         {
           label: '附件',
           slot: 'files'
@@ -122,7 +126,7 @@ export default {
     };
   },
   created() {
-    this.requestDict('质检标准类型');
+    // this.requestDict('质检标准类型');
   },
   methods: {
     datasource({ page, where, limit }) {

+ 73 - 64
src/views/inspectionProject/components/edit.vue

@@ -1,43 +1,70 @@
 <!-- 用户编辑弹窗 -->
 <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-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-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 label="质检标准:" prop="inspectionStandard">
+            <el-input  v-model="form.inspectionStandard">
+              <!-- <DictSelection style="width:100px" slot="prepend"  clearable dictName="数学字符" v-model="form.unit"></DictSelection> -->
+            </el-input>
           </el-form-item>
+
+
         </el-col>
         <el-col :span="12">
+          <el-form-item label="单位:" prop="unit">
+            <DictSelection dictName="质检项标准单位" v-model="form.unit"></DictSelection>
+
+          </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-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> -->
 
-        <el-col :span="12">
+        <!-- <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="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="description">
@@ -46,36 +73,25 @@
         </el-col>
         <el-col :span="12">
           <el-form-item label="备注:" prop="inspectionRemark">
-            <el-input  type="textarea" v-model="form.inspectionRemark"></el-input>
+            <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() {
@@ -90,6 +106,7 @@ export default {
         inspectionTool: '',
         isCreateCourse: '',
         description: '',
+        unit:""
       };
     };
     return {
@@ -98,40 +115,34 @@ export default {
       form: { ...defaultForm() },
       // 表单验证规则
       rules: {
+        inspectionName: [
+          { required: true, message: '请输入', trigger: 'blur' }
+        ],
 
-        inspectionName: [{ required: true, message: '请输入', trigger: 'blur' }],
-
-        status: {
+        inspectionStandard: {
           required: true,
-          message: '请选择',
-          trigger: 'change'
-        },
-
+          message: '请输入',
+          trigger: 'blur'
+        }
       },
       visible: false,
       type: null,
       title: null,
-      loading: false,
-
+      loading: false
     };
   },
 
-  created() {
-
-  },
+  created() {},
   methods: {
     open(type, row) {
-      this.title = type == 'add' ? '新增' : '编辑'
+      this.title = type == 'add' ? '新增' : '编辑';
       this.type = type;
       if (this.type == 'edit') {
-        this.form=row
+        this.form = row;
       }
       this.visible = true;
-
     },
 
-
-
     /* 保存编辑 */
     save() {
       this.$refs.form.validate((valid) => {
@@ -142,7 +153,7 @@ export default {
         if (this.type == 'add') {
           delete this.form.id;
         }
-        let URL = this.type == 'add' ? save : update
+        let URL = this.type == 'add' ? save : update;
         URL(this.form)
           .then((msg) => {
             this.loading = false;
@@ -164,16 +175,7 @@ export default {
     handleClose() {
       this.restForm();
       this.visible = false;
-    },
-
-
-
-
-
-
-
-
-
+    }
   }
 };
 </script>
@@ -186,8 +188,15 @@ export default {
     margin-left: 10px;
   }
 }
-
-:deep(.el-dialog:not(.ele-dialog-form) .el-dialog__body .el-form .el-form-item:last-child) {
+:deep(.el-form-item__content .el-input-group__prepend) {
+    background-color: #fff;
+  }
+:deep(
+    .el-dialog:not(.ele-dialog-form)
+      .el-dialog__body
+      .el-form
+      .el-form-item:last-child
+  ) {
   margin-bottom: 22px;
 }
 </style>

+ 16 - 18
src/views/inspectionProject/index.vue

@@ -2,11 +2,7 @@
   <div class="ele-body">
     <el-card shadow="never">
       <search ref="search" @search="search"></search>
-      <ele-pro-table
-        ref="table"
-        :columns="columns"
-        :datasource="datasource"
-      >
+      <ele-pro-table ref="table" :columns="columns" :datasource="datasource">
         <!-- 表头工具栏 -->
         <template v-slot:toolbar>
           <el-button
@@ -76,28 +72,30 @@ export default {
           label: '名称',
           prop: 'inspectionName'
         },
-
         {
-          label: '是否生成过程',
-          prop: 'isCreateCourse',
+          label: '质检标准',
+          prop: 'inspectionStandard',
           formatter: (row, column, cellValue) => {
-            return cellValue==1?'是': cellValue===0?'否':''
+            return cellValue+' '+row.unit
           }
         },
-        {
-          label: '质检标准',
-          prop: 'inspectionStandard'
-        },
+        // {
+        //   label: '是否生成过程',
+        //   prop: 'isCreateCourse',
+        //   formatter: (row, column, cellValue) => {
+        //     return cellValue==1?'是': cellValue===0?'否':''
+        //   }
+        // },
 
-        {
-          label: '质检工具',
-          prop: 'inspectionTool'
-        },
+        // {
+        //   label: '质检工具',
+        //   prop: 'inspectionTool'
+        // },
         {
           label: '状态',
           prop: 'status',
           formatter: (row, column, cellValue) => {
-            return cellValue==1?'启用': cellValue===0?'停用':''
+            return cellValue == 1 ? '启用' : cellValue === 0 ? '停用' : '';
           }
         },
         {

+ 188 - 69
src/views/inspectionStandard/components/edit.vue

@@ -1,18 +1,25 @@
 <!-- 用户编辑弹窗 -->
 <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-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="100px">
       <el-row>
-
-
         <el-col :span="12">
           <el-form-item label="标准类型:" prop="type">
-            <DictSelection dictName="质检标准类型" v-model="form.type"></DictSelection>
+            <DictSelection
+              dictName="质检标准类型"
+              v-model="form.type"
+            ></DictSelection>
           </el-form-item>
         </el-col>
 
-
         <el-col :span="12">
           <el-form-item label="标准名称:" prop="name">
             <el-input clearable v-model="form.name" placeholder="请输入" />
@@ -31,65 +38,133 @@
         </el-col>
         <el-col :span="12">
           <el-form-item label="状态:" prop="status">
-            <el-select v-model="form.status" placeholder="请选择" style="width: 100%">
+            <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="8">
           <el-form-item prop="imgUrl" label="附件">
-            <fileUpload v-model="form.imgUrl" module="main" :showLib="false" :limit="1" />
+            <fileUpload
+              v-model="form.imgUrl"
+              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-col :span="24">
+          <!-- <el-button
+            style="margin-left: 100px"
+            type="primary"
+            @click="addParameter"
+            >选择工艺参数标准</el-button
+          > -->
+          <el-table
+            style="margin-top: 15px"
+            :data="form.parameterStandards"
+            border
+            height="40vh"
+          >
+            <el-table-column :label="form.singleWeightDivision" align="center">
+              <el-table-column label="参数上限" align="center" v-if='form.parameterType==3'>
+                <template slot-scope="scope">
+                  <el-form-item label-width="0" prop="finalValue">
+                    <el-input
+                      clearable
+                      v-model="scope.row.finalValue"
+                      placeholder="请输入"
+                    />
+                  </el-form-item>
+                </template>
+              </el-table-column>
+              <el-table-column label="参数下限" align="center" v-if='form.parameterType==3'>
+                <template slot-scope="scope">
+                  <el-form-item label-width="0" prop="initialValue">
+                    <el-input
+                      clearable
+                      v-model="scope.row.initialValue"
+                      placeholder="请输入"
+                    />
+                  </el-form-item>
+                </template>
+              </el-table-column>
+              <el-table-column label="默认值" align="center" v-if='form.parameterType!=3'>
+                <template slot-scope="scope">
+                  <el-form-item label-width="0" prop="defaultValue">
+                    <el-input
+                      clearable
+                      v-model="scope.row.defaultValue"
+                      placeholder="请输入"
+                    />
+                  </el-form-item>
+                </template>
+              </el-table-column>
+            </el-table-column>
+            <el-table-column :label="form.tolerance" align="center">
+              <el-table-column label="质检标准" align="center">
+                <template slot-scope="scope">
+                  <el-form-item label-width="0" prop="inspectionStandard">
+                    <el-input
+                      clearable
+                      v-model="scope.row.toleranceValue"
+                      placeholder="请输入"
+                    />
+                  </el-form-item>
+                </template>
+              </el-table-column>
+              <el-table-column label="操作" align="center" width="80">
+                <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-column>
+          </el-table>
+          <div class="add-product" @click="add">
+            <i class="el-icon-circle-plus-outline"></i>
+          </div>
+        </el-col>
+
+        <!-- <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>
-
-
-
-
+    <standardDialog ref="standardDialogRef" @choose="choose" />
   </el-dialog>
 </template>
 
 <script>
-
 import { save, update, getById } from '@/api/inspectionStandard';
 import fileUpload from '@/components/upload/fileUpload';
-import inspectionProjectList from '../../../views/inspectionPoint/components/inspectionProjectList';
+import standardDialog from './standardDialog';
+// import EquipmentDialog from '../../../views/inspectionPoint/components/EquipmentDialog';
 
 export default {
   components: {
-    fileUpload,inspectionProjectList
+    fileUpload,
+    standardDialog
   },
 
-
-
   data() {
     const defaultForm = function () {
       return {
@@ -99,17 +174,20 @@ export default {
         type: '',
         version: '1.0',
         standardCode: '',
-        inspectionId:"",
-        inspectionItems: []
+        inspectionId: '',
+        singleWeightDivision: '',
+        tolerance: '',
+        parameterStandards: [],
+        parameterType:''
       };
     };
     return {
       defaultForm,
       // 表单数据
       form: { ...defaultForm() },
+
       // 表单验证规则
       rules: {
-
         name: [{ required: true, message: '请输入', trigger: 'blur' }],
         version: [{ required: true, message: '请输入', trigger: 'blur' }],
         type: {
@@ -122,41 +200,65 @@ export default {
           required: true,
           message: '请选择',
           trigger: 'change'
-        },
-
+        }
       },
       visible: false,
       type: null,
       title: null,
-      loading: false,
-
+      loading: false
     };
   },
 
-  created() {
-
-  },
+  created() {},
   methods: {
     open(type, row) {
-      this.title = type == 'add' ? '新增' : '编辑'
+      this.title = type == 'add' ? '新增' : '编辑';
       this.type = type;
       if (this.type == 'edit') {
-        this.form=row
-
-        // this.getDetail(row.id)
+        if (!row.parameterStandards) {
+          row.parameterStandards = [];
+        }else{
+          row.singleWeightDivision=row.parameterStandards[0]?.singleWeightDivision
+          row.tolerance=row.parameterStandards[0]?.tolerance
+          row.parameterType=row.parameterStandards[0]?.parameterType
+        }
+        this.form = JSON.parse(JSON.stringify(row)) ;
       }
       this.visible = true;
-
-
     },
 
-    // getDetail(id) {
-    //   getById(id).then(res => {
-    //     this.form = res.data
-
-    //   })
-    // },
-
+    choose(data) {
+      let obj = {
+        finalValue: data.parameter?.maxValue,
+        initialValue: data.parameter?.minValue,
+        toleranceValue: data.project?.inspectionStandard,
+        singleWeightDivision: data.parameter?.name +' '+ data.parameter?.unitName,
+        tolerance: data.project?.inspectionName+' '+data.project?.unit,
+        parameterType:data.parameter?.textType,
+        defaultValue:data.parameter?.defaultValue,
+      };
+      this.form.singleWeightDivision =obj.singleWeightDivision
+      this.form.tolerance = obj.tolerance
+      this.form.parameterType = obj.parameterType
+      this.form.parameterStandards.push(obj);
+    },
+    add() {
+      if (!this.form.parameterStandards.length) {
+        this.$refs.standardDialogRef.open();
+        return;
+      }
+      let obj = {
+        finalValue: '',
+        initialValue: '',
+        toleranceValue: '',
+        singleWeightDivision: '',
+        tolerance: ''
+      };
+      this.form.parameterStandards.push(obj);
+    },
+    handleDeleteItem(index) {
+      this.form.parameterStandards.splice(index, 1);
+    },
     /* 保存编辑 */
     save() {
       this.$refs.form.validate((valid) => {
@@ -167,9 +269,9 @@ export default {
         if (this.type == 'add') {
           delete this.form.id;
         }
-        this.form.inspectionId = this.$refs.inspectionProjectRef.getValue();
+        // this.form.inspectionId = this.$refs.inspectionProjectRef.getValue();
 
-        let URL = this.type == 'add' ? save : update
+        let URL = this.type == 'add' ? save : update;
         URL(this.form)
           .then((msg) => {
             this.loading = false;
@@ -184,6 +286,7 @@ export default {
     },
     restForm() {
       this.form = { ...this.defaultForm() };
+      this.list = [];
       this.$nextTick(() => {
         this.$refs.form.clearValidate();
       });
@@ -191,16 +294,7 @@ export default {
     handleClose() {
       this.restForm();
       this.visible = false;
-    },
-
-
-
-
-
-
-
-
-
+    }
   }
 };
 </script>
@@ -214,7 +308,32 @@ export default {
   }
 }
 
-:deep(.el-dialog:not(.ele-dialog-form) .el-dialog__body .el-form .el-form-item:last-child) {
+:deep(
+    .el-dialog:not(.ele-dialog-form)
+      .el-dialog__body
+      .el-form
+      .el-form-item:last-child
+  ) {
   margin-bottom: 22px;
 }
+:deep(
+    .el-dialog:not(.ele-dialog-form)
+      .el-dialog__body
+      .el-form
+      .el-table__body
+      .el-table__row
+      .el-form-item:last-child
+  ) {
+  margin-bottom: 0 !important;
+}
+.add-product {
+  width: 100%;
+  display: flex;
+  align-items: center;
+  justify-content: flex-end;
+  font-size: 30px;
+  color: #1890ff;
+  margin: 10px 0;
+  cursor: pointer;
+}
 </style>

+ 223 - 0
src/views/inspectionStandard/components/standardDialog.vue

@@ -0,0 +1,223 @@
+<template>
+  <el-dialog
+    :visible.sync="equipmentdialog"
+    :before-close="handleClose"
+    :close-on-click-modal="true"
+    :close-on-press-escape="false"
+    append-to-body
+    width="70%"
+  >
+    <div>
+      <el-row>
+        <el-col :span="12" class="table_col" v-if="equipmentdialog">
+          <div class="title">工艺参数</div>
+
+          <ele-pro-table
+            ref="equiTable"
+            :columns="columns"
+            :datasource="datasource"
+            :current.sync="current"
+            highlight-current-row
+            row-key="id"
+            height="50vh"
+          >
+          <template v-slot:textType="{ row }">
+          {{ row.textType == 1 ? '数值' : row.textType == 2 ? '选择' : row.textType == 3 ? '产品参数' : row.textType == 4 ? '规格' :
+             row.textType == 5 ? '时间' : '' }}
+        </template>
+
+          </ele-pro-table>
+        </el-col>
+        <el-col :span="12" class="table_col" v-if="equipmentdialog">
+          <div class="title">质检项</div>
+
+          <ele-pro-table
+            ref="equiTable"
+            :columns="columns1"
+            :datasource="datasource1"
+            :current.sync="current1"
+            highlight-current-row
+            row-key="id"
+            height="50vh"
+          >
+          </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 { parameterList } from '@/api/inspectionStandard';
+import { getList } from '@/api/inspectionProject';
+
+export default {
+  components: {},
+  props: {
+    selectList: Array,
+    type: {
+      default: 1 //1多选 2单选
+    }
+  },
+  data() {
+    return {
+      equipmentdialog: false,
+      current: null,
+      current1: null,
+      columns: [
+        {
+          prop: 'code',
+          label: '参数编码',
+          // sortable: 'custom',
+          showOverflowTooltip: true,
+          align: 'center',
+          minWidth: 110
+        },
+        {
+          prop: 'name',
+          label: '参数名称',
+          showOverflowTooltip: true,
+          align: 'center',
+          minWidth: 110
+        },
+
+        {
+          prop: 'textType',
+          label: '参数类型',
+          showOverflowTooltip: true,
+          align: 'center',
+          slot: 'textType',
+          minWidth: 110
+        },
+        {
+          align: 'center',
+          prop: 'description',
+          label: '文本描述',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          prop: 'maxValue',
+          label: '参数上限',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'minValue',
+          label: '参数下限',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'defaultValue',
+          label: '默认值',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'categoryType',
+          label: '参数分类',
+          align: 'center',
+          slot: 'status',
+          showOverflowTooltip: true
+        }
+      ],
+      columns1: [
+        {
+          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 parameterList({
+        ...where,
+        pageNum: page,
+        size: limit
+      });
+    },
+    datasource1({ page, where, limit }) {
+      return getList({
+        ...where,
+        pageNum: page,
+        size: limit
+      });
+    },
+    open() {
+      this.equipmentdialog = true;
+    },
+
+    handleClose() {
+      this.equipmentdialog = false;
+    },
+    // 选择
+    selected() {
+      this.$emit('choose', {
+        parameter: JSON.parse(JSON.stringify(this.current)),
+        project: JSON.parse(JSON.stringify(this.current1))
+      });
+      this.handleClose();
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.title {
+  font-size: 16px;
+  margin-bottom: 20px;
+}
+.btns {
+  text-align: center;
+  padding: 10px 0;
+}
+</style>

+ 239 - 0
src/views/inspectionWork/components/EquipmentDialog.vue

@@ -0,0 +1,239 @@
+<template>
+  <el-dialog
+    title="选择产品"
+    :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="topsearch">
+          <el-form>
+            <el-row>
+              <el-col :span="6">
+                <el-input
+                  v-model="code"
+                  placeholder="请输入产品编码"
+                  size="small"
+                ></el-input>
+              </el-col>
+              <el-col :span="6" style="margin-left: 10px">
+                <el-button type="primary" size="small" @click="reload"
+                  >搜索</el-button
+                >
+                <el-button size="small" @click="reset">重置</el-button>
+              </el-col>
+            </el-row>
+          </el-form>
+        </el-col>
+        <el-col :span="6" class="tree_col">
+          <AssetTree
+            @handleNodeClick="handleNodeClick"
+            id="9"
+            :paramsType="'type'"
+            ref="treeList"
+          />
+        </el-col>
+        <el-col :span="18" class="table_col" v-if="equipmentdialog">
+          <ele-pro-table
+            ref="equiTable"
+            :columns="columns"
+            :datasource="datasource"
+            :selection.sync="selection"
+            :current.sync="current"
+            highlight-current-row
+            @select="handleSelect"
+            cache-key="systemRoleTable3"
+            aaaaaa
+            row-key="id"
+            height="50vh"
+            @done="setSelect"
+          >
+          </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 AssetTree from '@/components/AssetTree/index.vue';
+  import { getList } from '@/api/classifyManage';
+  export default {
+    components: {
+      AssetTree
+    },
+    props: {
+      selectList: Array,
+      type:{
+        default:2 //1多选 2单选
+      }
+    },
+    data () {
+      return {
+        equipmentdialog: false,
+        current:null,
+        columns: [
+          {
+            width: 45,
+            type: 'selection',
+            columnKey: 'selection',
+            align: 'center',
+            reserveSelection: true,
+            show:this.type==1
+          },
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'code',
+            label: '物品编码',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            slot: 'code'
+          },
+          {
+            prop: 'name',
+            label: '物品名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'brandNum',
+            label: '牌号',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'specification',
+            label: '规格',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'modelType',
+            label: '型号',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          }
+        ],
+        tableList: [],
+        categoryLevelId: null,
+        code: null,
+        selection: []
+      };
+    },
+
+    watch: {},
+    methods: {
+      async datasource ({ page, limit }) {
+        const params = {
+          code: this.code,
+          pageNum: page,
+          size: limit,
+          categoryLevelId: this.categoryLevelId,
+          isProduct: true
+        };
+        const data = await getList(params);
+        this.tableList = data.list;
+        return data;
+      },
+      open () {
+        this.equipmentdialog = true;
+        this.setSelect();
+      },
+      handleNodeClick (data) {
+        this.categoryLevelId = data.id;
+        this.reload();
+      },
+      reload () {
+        this.$refs.equiTable.reload();
+      },
+      handleClose () {
+        this.equipmentdialog = false;
+        this.code = '';
+        this.$refs.equiTable.clearSelection();
+      },
+      reset () {
+        this.code = null;
+        this.reload();
+      },
+      // 设置选中
+      setSelect () {
+        // this.$nextTick(() => {
+        //   this.tableList.forEach((row) => {
+        //     this.selectList?.forEach((selected, index) => {
+        //       if (selected.productCode === row.code) {
+        //         this.$refs.equiTable.toggleRowSelection(row, true);
+        //       }
+        //     });
+        //   });
+        // });
+      },
+      // 取消选中
+      handleSelect (selection, row) {
+        // if (!selection.find((i) => i.id === row.id)) {
+        //   const index = this.selectList.findIndex(
+        //     (itm) => row.code == itm.productCode
+        //   );
+        //   console.log(index);
+        //   if (index > -1) {
+        //     this.selectList.splice(index, 1);
+        //   }
+        // }
+      },
+      // 选择
+      selected () {
+        
+    
+        let list=this.type==1?this.selection:[this.current]
+        this.$emit('choose', JSON.parse(JSON.stringify(list)));
+        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>

+ 186 - 0
src/views/inspectionWork/components/ProductionVersion.vue

@@ -0,0 +1,186 @@
+<template>
+  <el-dialog title="选择工艺路线" :visible.sync="visible" :before-close="handleClose" :close-on-click-modal="true"
+    :close-on-press-escape="false" append-to-body width="80%">
+    <el-card shadow="never">
+
+      <ele-pro-table ref="table" :columns="columns" :datasource="datasource" height="calc(100vh - 350px)"
+        class="dict-table" @cell-click="cellClick">
+        <!-- 表头工具栏 -->
+
+        
+
+        <template v-slot:status="{ row }">
+          {{ checkStatus(row) }}
+        </template>
+
+        <template v-slot:action="{ row }">
+          <el-radio class="radio" v-model="radio" :label="row.id"><i></i></el-radio>
+        </template>
+      </ele-pro-table>
+
+    </el-card>
+    <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 { routeList } from '@/api/aps';
+// import productionSearch from './production-search.vue'
+export default {
+  components: { 
+    // productionSearch
+    },
+  data() {
+    return {
+      visible: false,
+      // 表格列配置
+      columns: [
+        {
+          prop: 'code',
+          label: '工艺路线组编码',
+          // sortable: 'custom',
+          showOverflowTooltip: true,
+          align: 'center',
+
+          minWidth: 110
+        },
+        {
+          prop: 'name',
+          label: '工艺路线名称',
+          showOverflowTooltip: true,
+          align: 'center',
+          minWidth: 110
+        },
+
+
+        {
+          prop: 'version',
+          label: '工艺路线版本',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+
+        {
+          prop: 'produceVersionName',
+          label: '生产版本',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+
+        {
+          prop: 'status',
+          label: '状态',
+          align: 'center',
+          slot: 'status',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+
+        {
+          action: 'action',
+          slot: 'action',
+          align: 'center',
+          label: '选择'
+        }
+      ],
+      statusList: [
+        { label: '草稿', value: -1 },
+        { label: '失效', value: 0 },
+        { label: '生效', value: 1 }
+      ],
+      categoryLevelId: '9',
+      radio: null
+    }
+  },
+
+  watch: {
+
+  },
+  methods: {
+
+    checkStatus(row) {
+      let obj = this.statusList.find((it) => it.value == row.status);
+      return obj.label;
+    },
+    /* 表格数据源 */
+    datasource({ page, where, limit }) {
+      return routeList({
+        ...where,
+        pageNum: page,
+        size: limit,
+  
+      });
+    },
+
+    /* 刷新表格 */
+    reload(where) {
+      this.$refs.table.reload({ page: 1, where: where });
+    },
+    open(item) {
+      if (item) {
+        this.current = {
+          id: item.id,
+          name: item.name,
+        }
+        this.radio = item.id
+      }
+      this.visible = true
+    },
+    // 单击获取id
+    cellClick (row) {
+        this.current = row
+        this.radio = row.id
+    },
+
+    handleClose() {
+      this.visible = false
+ 
+    },
+    selected() {
+      if (!this.current) {
+        return this.$message.warning('请选择工艺路线')
+      }
+      this.$emit('changeProduct', this.current)
+      this.handleClose()
+    },
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.tree_col {
+  border: 1px solid #eee;
+  padding: 10px 0;
+  box-sizing: border-box;
+  height: 500px;
+  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>

+ 384 - 0
src/views/inspectionWork/components/edit.vue

@@ -0,0 +1,384 @@
+<!-- 用户编辑弹窗 -->
+<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="1200px"
+  >
+    <el-form ref="form" :model="form" :rules="rules" label-width="100px">
+      <el-row>
+        <el-col :span="8" v-if="title!='新增'">
+          <el-form-item label="编码:">
+            <el-input :maxlength="20" v-model="form.code" disabled  />
+          </el-form-item>
+        </el-col>
+        <el-col :span="8" v-if="title!='新增'">
+          <el-form-item label="工单号:">
+            <el-input :maxlength="20" v-model="form.workOrderCode" disabled   />
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="质检类型:" prop="qualityType">
+            <DictSelection
+              dictName="质检类型"
+              v-if="title=='新增'"
+              v-model="form.qualityType"
+            ></DictSelection>
+            <el-input
+              :value="getDictValue('质检类型', form.qualityType)"
+              disabled
+              v-if="title!='新增'"
+            />
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="工艺路线:">
+            <el-input
+              @click.native="openVersion"
+              clearable
+              v-model="form.produceRoutingName"
+              v-if="title=='新增'"
+            />
+            <el-input
+              v-model="form.produceRoutingName"
+              disabled
+              v-if="title!='新增'"
+            />
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="工序:">
+            <el-select
+              style="width: 100%"
+              v-model="form.produceTaskId"
+              placeholder="请选择"
+              clearable
+              @change="produceTaskChange"
+              v-if="title=='新增'"
+            >
+              <el-option
+                v-for="item in produceTaskList"
+                :key="item.id"
+                :label="item.name"
+                :value="item.id"
+              >
+              </el-option>
+            </el-select>
+            <el-input
+              v-model="form.produceTaskName"
+              disabled
+              v-if="title!='新增'"
+            />
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="产品名称:" prop="productName">
+            <el-input
+              v-model="form.productName"
+              @click.native="addProduct"
+              readonly
+              v-if="title=='新增'"
+            />
+            <el-input
+              v-model="form.productName"
+              disabled
+              v-if="title!='新增'"
+            />
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="总数量:">
+            <el-input v-model="form.total" disabled></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="合格数:" prop="qualifiedNumber">
+            <el-input
+              v-model="form.qualifiedNumber"
+              @input="inputValue"
+              :disabled="title!='新增'"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="不合格数:">
+            <el-input
+              v-model="form.noQualifiedNumber"
+              @input="inputValue"
+              :disabled="title!='新增'"
+
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="工时(h):" prop="hours">
+            <el-input v-model="form.hours"
+            :disabled="title!='新增'"
+            
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="质检时间:" prop="qualityTime">
+            <el-date-picker
+              class="w100"
+              v-model="form.qualityTime"
+              type="date"
+              value-format="yyyy-MM-dd"
+              :disabled="title!='新增'"
+
+            ></el-date-picker>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="质检人:" prop="qualityName">
+            <el-input disabled v-model="form.qualityName"></el-input>
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
+
+    <div class="title"  v-if="title != '新增'">质检内容</div>
+    <el-table border v-if="title != '新增'">  </el-table>
+    <div class="title"   v-if="title != '新增'">不合格品内容</div>
+    <el-table :data="form.voList" border   v-if="title != '新增'">
+      <el-table-column label="序号" align="center" width="60">
+        <template slot-scope="scope">
+          <span>{{ scope.$index + 1 }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="不良品编码" align="center" prop="code">
+      </el-table-column>
+      <el-table-column label="数量" align="center" prop="unqualifiedQuantity">
+      </el-table-column>
+      <el-table-column label="原因" align="center" prop="unqualifiedReason">
+      </el-table-column>
+      <el-table-column label="创建时间" align="center" prop="createTime">
+      </el-table-column>
+      <el-table-column label="创建人" align="center" prop="reviewerName">
+      </el-table-column>
+      <el-table-column label="处置类型" align="center" prop="type">
+        <template slot-scope="scope">
+          {{ getDictValue('不良品处理类型', scope.row.type + '') }}
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <template v-slot:footer>
+      <el-button @click="handleClose">返回</el-button>
+      <el-button
+        type="primary"
+        :loading="loading"
+        @click="update"
+        v-if="title == '报工'"
+      >
+        报工
+      </el-button>
+      <el-button type="primary" :loading="loading" @click="save"  v-if="title == '新增'">
+        保存
+      </el-button>
+    </template>
+    <ProductionVersion ref="versionRefs" @changeProduct="changeProduct" />
+    <EquipmentDialog ref="equipmentRefs" @choose="choose" />
+  </el-dialog>
+</template>
+
+<script>
+import { save, update } from '@/api/inspectionWork';
+import { getProduceTaskList } from '@/api/aps';
+import EquipmentDialog from './EquipmentDialog.vue';
+import ProductionVersion from './ProductionVersion.vue';
+import dictMixins from '@/mixins/dictMixins';
+
+export default {
+  components: { ProductionVersion, EquipmentDialog },
+  mixins: [dictMixins],
+
+  data() {
+    const defaultForm = function () {
+      return {
+        produceRoutingName: '',
+        produceRoutingId: '',
+        produceTaskId: '',
+        produceTaskName: '',
+        code: '',
+        workOrderCode: '',
+        batchNo: '',
+        productName: '',
+        productCode: '',
+        specification: '',
+        brandNo: '',
+        qualityType: '',
+        total: '',
+        qualifiedNumber: '',
+        noQualifiedNumber: '',
+        hours: '',
+        qualityTime: '',
+        qualityName: '',
+        voList: []
+      };
+    };
+    return {
+      defaultForm,
+      // 表单数据
+      form: { ...defaultForm() },
+
+      // 表单验证规则
+      rules: {
+        productName: [{ required: true, message: '请输入', trigger: 'change' }],
+        qualifiedNumber: [
+          { required: true, message: '请输入', trigger: 'blur' }
+        ],
+        qualityTime: [{ required: true, message: '请输入', trigger: 'blur' }]
+      },
+      visible: false,
+      type: null,
+      title: null,
+      loading: false,
+      produceTaskList: []
+    };
+  },
+
+  created() {},
+  methods: {
+    open(type, row) {
+      this.title = type == 'add' ? '新增' : type == 'edit' ? '报工' : '详情';
+      this.type = type;
+      if (this.type != 'add') {
+        this.form = row;
+      }
+      this.visible = true;
+    },
+    inputValue() {
+      this.form.total =
+        Number(this.form.qualifiedNumber) + Number(this.form.noQualifiedNumber);
+    },
+    addProduct() {
+      this.$refs.equipmentRefs.open();
+    },
+    openVersion() {
+      this.$refs.versionRefs.open();
+    },
+    //工艺路线回调
+    changeProduct(data) {
+      this.form.produceRoutingId = data.id;
+      this.form.produceRoutingName = data.name;
+      this.form.produceTaskId = '';
+      this.form.produceTaskName = '';
+      this.getProduceTaskList();
+    },
+    async getProduceTaskList() {
+      const res = await getProduceTaskList({
+        isDetail: true,
+        pageNum: 1,
+        routingId: this.form.produceRoutingId,
+        size: -1
+      });
+      this.produceTaskList = res.list;
+    },
+    produceTaskChange() {
+      if (!this.form.produceTaskId) {
+        return;
+      }
+      this.form.produceTaskName = this.produceTaskList.find(
+        (item) => item.id == this.form.produceTaskId
+      ).name;
+    },
+    choose(data) {
+      this.form.productName = data[0].name;
+      this.form.productCode = data[0].code;
+      this.form.specification = data[0].specification;
+      this.form.brandNo = data[0].brandNum;
+    },
+    /* 保存编辑 */
+    save() {
+      this.$refs.form.validate((valid) => {
+        if (!valid) {
+          return false;
+        }
+        this.loading = true;
+        save(this.form)
+          .then((msg) => {
+            this.loading = false;
+            this.$message.success(msg);
+            this.handleClose();
+            this.$emit('done');
+          })
+          .catch((e) => {
+            this.loading = false;
+          });
+      });
+    },
+    update() {
+        this.loading = true;
+        update({ id: this.form.id, status: 1 })
+          .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>
+.title {
+  font-size: 16px;
+  line-height: 45px;
+}
+.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;
+}
+:deep(
+    .el-dialog:not(.ele-dialog-form)
+      .el-dialog__body
+      .el-form
+      .el-table__body
+      .el-table__row
+      .el-form-item:last-child
+  ) {
+  margin-bottom: 0 !important;
+}
+.add-product {
+  width: 100%;
+  display: flex;
+  align-items: center;
+  justify-content: flex-end;
+  font-size: 30px;
+  color: #1890ff;
+  margin: 10px 0;
+  cursor: pointer;
+}
+</style>

+ 77 - 0
src/views/inspectionWork/components/search.vue

@@ -0,0 +1,77 @@
+<!-- 搜索表单 --> 6
+<template>
+  <el-form label-width="77px" class="ele-form-search" @keyup.enter.native="search" @submit.native.prevent>
+    <el-row :gutter="15">
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 10 } : { span: 6}">
+        <el-form-item label="编码:">
+          <el-input clearable v-model="where.code" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 10 } : { span: 6}">
+        <el-form-item label="工序:">
+          <el-input clearable v-model="where.produceTaskName" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+<!-- 
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 10 } : { span: 6}">
+        <el-form-item label="状态:" >
+          <el-select v-model="where.status" class="m-2" placeholder="请选择" size="large" style="width: 100%">
+            <el-option label="停用" :value="0" />
+            <el-option label="启用" :value="1" />
+          </el-select>
+        </el-form-item>
+      </el-col> -->
+      <el-col v-bind="styleResponsive ?{ lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="组织机构:">
+          <auth-selection data-type="Array" v-model="where.deptIds" style="width: 100%"></auth-selection>
+        </el-form-item>
+      </el-col>
+      <el-col style="display: flex;justify-content: flex-end" v-bind="styleResponsive ? { lg: 6, md: 6 } : { span: 6}">
+        <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 = {
+      code: '',
+      qualityName: '',
+      deptIds: ''
+    };
+    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>

+ 265 - 0
src/views/inspectionWork/index.vue

@@ -0,0 +1,265 @@
+<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:qualityType="{ row }">
+          {{ getDictValue('质检类型', row.qualityType) }}
+        </template>
+        <!-- 操作列 -->
+        <template v-slot:action="{ row }">
+          <el-link
+            type="primary"
+            :underline="false"
+            icon="el-icon-edit"
+            @click="openEdit('detail', row)"
+          >
+            详情
+          </el-link>
+          <el-link
+              type="primary"
+              :underline="false"
+              icon="el-icon-edit"
+              v-if="row.status==0"
+              @click="openEdit('edit', row)"
+            >
+              报工
+            </el-link>
+          <el-popconfirm
+            class="ele-action"
+            title="确定要删除吗?"
+            @confirm="remove(row)"
+            v-if="row.status==0"
+
+          >
+            <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/inspectionWork';
+import dictMixins from '@/mixins/dictMixins';
+//   import {getFile} from "@/api/system/file";
+
+export default {
+  mixins: [dictMixins],
+  components: {
+    search,
+    edit
+  },
+  data() {
+    return {
+      columns: [
+        {
+          width: 50,
+          type: 'index',
+          columnKey: 'index',
+          align: 'center',
+          label: '序号',
+
+        },
+
+        {
+          prop: 'code',
+          label: '编码',
+          align: 'center'
+        },
+        {
+          label: '工单号',
+          prop: 'workOrderCode',
+          align: 'center'
+        },
+        {
+          prop: 'batchNo',
+          label: '批次号',
+          align: 'center'
+        },
+        {
+          prop: 'productName',
+          label: '产品名称',
+          align: 'center'
+        },
+        {
+          prop: 'productCode',
+          label: '产品编码',
+          align: 'center'
+        },
+        {
+          prop: 'specification',
+          label: '规格',
+          align: 'center'
+        },
+        {
+          prop: 'brandNo',
+          label: '牌号',
+          align: 'center'
+        },
+
+        {
+          label: '质检类型',
+          prop: 'qualityType',
+          align: 'center',
+          slot:'qualityType'
+       
+        },
+
+        {
+          prop: 'produceTaskName',
+          label: '工序',
+          align: 'center'
+        },
+        {
+          prop: 'total',
+          label: '总数量',
+          align: 'center',
+          width:80
+
+        },
+        {
+          prop: 'qualifiedNumber',
+          label: '合格数',
+          align: 'center',
+          width:80
+        },
+        {
+          prop: 'qualificationRate',
+          label: '合格率',
+          align: 'center',
+          width:80
+
+        },
+        {
+          prop: 'noQualifiedNumber',
+          label: '不合格数',
+          align: 'center',
+          width:80
+
+        },
+        {
+          prop: 'noQualificationRate',
+          label: '不合格率',
+          align: 'center',
+          width:80
+
+        },
+        {
+          prop: 'hours',
+          label: '工时',
+          align: 'center',
+          width:60
+
+        },
+        {
+          prop: 'qualityTime',
+          label: '质检时间',
+          align: 'center',
+          width:120
+
+        },
+        {
+          prop: 'qualityName',
+          label: '质检人',
+          align: 'center',
+          width:80
+
+        },
+        {
+          prop: 'status',
+          label: '状态',
+          align: 'center',
+          width:80,
+          formatter: (row, column, cellValue) => {
+            return cellValue==0?'未报工':cellValue==1?'已报工':''
+          }
+
+        },
+        {
+          columnKey: 'action',
+          label: '操作',
+          width: 220,
+          align: 'center',
+          resizable: false,
+          slot: 'action',
+          showOverflowTooltip: true
+        }
+      ]
+    };
+  },
+  created() {
+    this.requestDict('质检类型');
+    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>
+