ysy 1 year ago
parent
commit
6f8a277101
2 changed files with 347 additions and 339 deletions
  1. 121 110
      src/views/inspectionProject/index.vue
  2. 226 229
      src/views/inspectionWork/index.vue

+ 121 - 110
src/views/inspectionProject/index.vue

@@ -14,8 +14,14 @@
           >
           >
             添加
             添加
           </el-button>
           </el-button>
-          <el-button type="primary" size="mini" icon="el-icon-upload2" plain @click="uploadFile">导入</el-button>
-
+          <el-button
+            type="primary"
+            size="mini"
+            icon="el-icon-upload2"
+            plain
+            @click="uploadFile"
+            >导入</el-button
+          >
         </template>
         </template>
 
 
         <!-- 操作列 -->
         <!-- 操作列 -->
@@ -43,124 +49,129 @@
       </ele-pro-table>
       </ele-pro-table>
     </el-card>
     </el-card>
     <edit ref="edit" @done="done"></edit>
     <edit ref="edit" @done="done"></edit>
-    <importDialog :defModule="moudleName" ref="importDialogRef" @success="reload" />
-
+    <importDialog
+      :defModule="moudleName"
+      ref="importDialogRef"
+      @success="reload"
+    />
   </div>
   </div>
 </template>
 </template>
 <script>
 <script>
-import search from './components/search.vue';
-import edit from './components/edit.vue';
-import { getList, removeItem } from '@/api/inspectionProject';
-import dictMixins from '@/mixins/dictMixins';
-import importDialog from "@/components/upload/import-dialog.vue";
+  import search from './components/search.vue';
+  import edit from './components/edit.vue';
+  import { getList, removeItem } from '@/api/inspectionProject';
+  import dictMixins from '@/mixins/dictMixins';
+  import importDialog from '@/components/upload/import-dialog.vue';
 
 
-export default {
-  mixins: [dictMixins],
-  components: {
-    search,
-    edit,importDialog
-  },
-  data() {
-    return {
-      columns: [
-        {
-          width: 45,
-          type: 'index',
-          columnKey: 'index',
-          align: 'center'
-        },
+  export default {
+    mixins: [dictMixins],
+    components: {
+      search,
+      edit,
+      importDialog
+    },
+    data() {
+      return {
+        columns: [
+          {
+            width: 45,
+            type: 'index',
+            columnKey: 'index',
+            align: 'center'
+          },
 
 
-        {
-          prop: 'inspectionCode',
-          label: '编码'
-        },
-        {
-          label: '名称',
-          prop: 'inspectionName'
-        },
-        {
-          label: '质检标准',
-          prop: 'inspectionStandard',
-          formatter: (row, column, cellValue) => {
-            return row.symbol+' '+cellValue+' '+row.unit
-          }
-        },
-        // {
-        //   label: '是否生成过程',
-        //   prop: 'isCreateCourse',
-        //   formatter: (row, column, cellValue) => {
-        //     return cellValue==1?'是': cellValue===0?'否':''
-        //   }
-        // },
+          {
+            prop: 'inspectionCode',
+            label: '编码'
+          },
+          {
+            label: '名称',
+            prop: 'inspectionName'
+          },
+          {
+            label: '质检标准',
+            prop: 'inspectionStandard',
+            formatter: (row, column, cellValue) => {
+              return row.symbol + ' ' + cellValue + ' ' + row.unit;
+            }
+          },
+          // {
+          //   label: '是否生成过程',
+          //   prop: 'isCreateCourse',
+          //   formatter: (row, column, cellValue) => {
+          //     return cellValue==1?'是': cellValue===0?'否':''
+          //   }
+          // },
+
+          // {
+          //   label: '质检工具',
+          //   prop: 'inspectionTool'
+          // },
+          {
+            label: '状态',
+            prop: 'status',
+            formatter: (row, column, cellValue) => {
+              return cellValue == 1 ? '启用' : cellValue === 0 ? '停用' : '';
+            }
+          },
+          {
+            label: '描述',
+            prop: 'description'
+          },
 
 
-        // {
-        //   label: '质检工具',
-        //   prop: 'inspectionTool'
-        // },
-        {
-          label: '状态',
-          prop: 'status',
-          formatter: (row, column, cellValue) => {
-            return cellValue == 1 ? '启用' : cellValue === 0 ? '停用' : '';
+          {
+            label: '备注',
+            prop: 'inspectionRemark'
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 220,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            showOverflowTooltip: true
           }
           }
-        },
-        {
-          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
-      });
+        moudleName: ''
+      };
     },
     },
-    openEdit(type, row) {
-      this.$refs.edit.open(type, row);
+    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) => {});
-    },
-    uploadFile () {
-      this.$refs.importDialogRef.open();
-    },
-    done() {
-      this.$refs.search.search();
+      remove(row) {
+        removeItem([row.id])
+          .then((message) => {
+            this.$message.success(message);
+            this.done();
+          })
+          .catch((e) => {});
+      },
+      uploadFile() {
+        this.$refs.importDialogRef.open();
+      },
+      done() {
+        this.$refs.search.search();
+      }
     }
     }
-  }
-};
+  };
 </script>
 </script>
-  

+ 226 - 229
src/views/inspectionWork/index.vue

@@ -15,6 +15,17 @@
             添加
             添加
           </el-button>
           </el-button>
         </template>
         </template>
+
+        <template v-slot:code="{ row }">
+          <el-link
+            type="primary"
+            :underline="false"
+            @click="openEdit('detail', row)"
+          >
+            {{ row.code }}
+          </el-link>
+        </template>
+
         <template v-slot:files="scope">
         <template v-slot:files="scope">
           <el-link
           <el-link
             v-for="link in scope.row.files"
             v-for="link in scope.row.files"
@@ -24,8 +35,6 @@
             @click="downloadFile(link)"
             @click="downloadFile(link)"
           >
           >
             {{ link.name }}
             {{ link.name }}
-      
-
           </el-link>
           </el-link>
         </template>
         </template>
 
 
@@ -51,24 +60,16 @@
           <el-link
           <el-link
             type="primary"
             type="primary"
             :underline="false"
             :underline="false"
-            @click="openEdit('detail', row)"
+            v-if="row.status == 0"
+            @click="openEdit('edit', row)"
           >
           >
-            详情
+            报工
           </el-link>
           </el-link>
-          <el-link
-              type="primary"
-              :underline="false"
-              v-if="row.status==0"
-              @click="openEdit('edit', row)"
-            >
-              报工
-            </el-link>
           <el-popconfirm
           <el-popconfirm
             class="ele-action"
             class="ele-action"
             title="确定要删除吗?"
             title="确定要删除吗?"
             @confirm="remove(row)"
             @confirm="remove(row)"
-            v-if="row.status==0"
-
+            v-if="row.status == 0"
           >
           >
             <template v-slot:reference>
             <template v-slot:reference>
               <el-link type="danger" :underline="false" icon="el-icon-delete">
               <el-link type="danger" :underline="false" icon="el-icon-delete">
@@ -82,230 +83,226 @@
     <edit ref="edit" @done="done"></edit>
     <edit ref="edit" @done="done"></edit>
   </div>
   </div>
 </template>
 </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: '序号',
-
-        },
+<script>
+  import search from './components/search.vue';
+  import edit from './components/edit.vue';
 
 
-        {
-          prop: 'code',
-          label: '编码',
-          align: 'center',
-          showOverflowTooltip: true,
-          width: 180,
+  import { getList, removeItem } from '@/api/inspectionWork';
+  import dictMixins from '@/mixins/dictMixins';
+  import { getFile } from '@/api/system/file';
 
 
-        },
-        {
-          label: '来源生产工单号',
-          width: 180,
-          showOverflowTooltip: true,
-          prop: 'workOrderCode',
-          align: 'center'
-        },
-        {
-          prop: 'batchNo',
-          label: '批次号',
-          showOverflowTooltip: true,
-          align: 'center'
-        },
-        {
-          prop: 'productName',
-          showOverflowTooltip: true,
-          label: '产品名称',
-          align: 'center'
-        },
-        {
-          prop: 'productCode',
-          showOverflowTooltip: true,
-          label: '产品编码',
-          align: 'center'
-        },
-        {
-          prop: 'specification',
-          showOverflowTooltip: true,
-          label: '规格',
-          align: 'center'
-        },
-        {
-          prop: 'brandNo',
-          label: '牌号',
-          showOverflowTooltip: true,
-          align: 'center'
-        },
-        {
-          label: '类型',
-          showOverflowTooltip: true,
-          prop: 'qualityType',
-          slot: 'qualityType',
-          width: 120
-
-        },
-        {
-          label: '质检方式',
-          showOverflowTooltip: true,
-          prop: 'qualityMode',
-          slot: 'qualityMode',
-          width: 120
-
-        },
-        {
-          prop: 'produceTaskName',
-          showOverflowTooltip: true,
-          label: '工序',
-          align: 'center'
-        },
-        {
-          prop: 'total',
-          showOverflowTooltip: true,
-          label: '总数量',
-          align: 'center',
-          width:80
-
-        },
-        {
-          prop: 'qualifiedNumber',
-          label: '合格数',
-          showOverflowTooltip: true,
-          align: 'center',
-          width:80
-        },
-        {
-          showOverflowTooltip: true,
-          prop: 'qualificationRate',
-          label: '合格率',
-          align: 'center',
-          width:80
-
-        },
-        {
-          prop: 'noQualifiedNumber',
-          showOverflowTooltip: true,
-          label: '不合格数',
-          align: 'center',
-          width:80
-
-        },
-        {
-          prop: 'noQualificationRate',
-          showOverflowTooltip: true,
-          label: '不合格率',
-          align: 'center',
-          width:80
-
-        },
-        {
-          showOverflowTooltip: true,
-          prop: 'hours',
-          label: '工时',
-          align: 'center',
-          width:60
+  export default {
+    mixins: [dictMixins],
+    components: {
+      search,
+      edit
+    },
+    data() {
+      return {
+        columns: [
+          {
+            width: 50,
+            type: 'index',
+            columnKey: 'index',
+            align: 'center',
+            label: '序号'
+          },
 
 
-        },
-        {
-          prop: 'qualityTime',
-          showOverflowTooltip: true,
-          label: '质检时间',
-          align: 'center',
-          width:120
+          {
+            prop: 'code',
+            label: '编码',
+            slot: 'code',
+            align: 'center',
+            showOverflowTooltip: true,
+            width: 180
+          },
+          {
+            label: '来源生产工单号',
+            width: 180,
+            showOverflowTooltip: true,
+            prop: 'workOrderCode',
+            align: 'center'
+          },
+          {
+            prop: 'batchNo',
+            width: 180,
+            label: '批次号',
+            showOverflowTooltip: true,
+            align: 'center'
+          },
+          {
+            prop: 'productName',
+            width: 120,
+            showOverflowTooltip: true,
+            label: '产品名称',
+            align: 'center'
+          },
+          {
+            prop: 'productCode',
+            width: 120,
+            showOverflowTooltip: true,
+            label: '产品编码',
+            align: 'center'
+          },
+          {
+            prop: 'specification',
+            showOverflowTooltip: true,
+            label: '规格',
+            align: 'center'
+          },
+          {
+            prop: 'brandNo',
+            label: '牌号',
+            showOverflowTooltip: true,
+            align: 'center'
+          },
+          {
+            label: '类型',
+            showOverflowTooltip: true,
+            prop: 'qualityType',
+            slot: 'qualityType',
+            width: 120
+          },
+          {
+            label: '质检方式',
+            showOverflowTooltip: true,
+            prop: 'qualityMode',
+            slot: 'qualityMode',
+            width: 120
+          },
+          {
+            prop: 'produceTaskName',
+            showOverflowTooltip: true,
+            label: '工序',
+            align: 'center'
+          },
+          {
+            prop: 'total',
+            showOverflowTooltip: true,
+            label: '总数量',
+            align: 'center',
+            width: 80
+          },
+          {
+            prop: 'qualifiedNumber',
+            label: '合格数',
+            showOverflowTooltip: true,
+            align: 'center',
+            width: 80
+          },
+          {
+            showOverflowTooltip: true,
+            prop: 'qualificationRate',
+            label: '合格率',
+            align: 'center',
+            width: 80
+          },
+          {
+            prop: 'noQualifiedNumber',
+            showOverflowTooltip: true,
+            label: '不合格数',
+            align: 'center',
+            width: 80
+          },
+          {
+            prop: 'noQualificationRate',
+            showOverflowTooltip: true,
+            label: '不合格率',
+            align: 'center',
+            width: 80
+          },
+          {
+            showOverflowTooltip: true,
+            prop: 'hours',
+            label: '工时',
+            align: 'center',
+            width: 60
+          },
+          {
+            prop: 'qualityTime',
+            showOverflowTooltip: true,
+            label: '质检时间',
+            align: 'center',
+            width: 120
+          },
+          {
+            prop: 'qualityName',
+            label: '质检人',
+            showOverflowTooltip: true,
+            align: 'center',
+            width: 80
+          },
+          {
+            label: '附件',
+            prop: 'accessory',
+            showOverflowTooltip: true,
+            slot: 'accessory'
+          },
+          {
+            prop: 'status',
+            label: '状态',
+            align: 'center',
+            width: 80,
+            formatter: (row, column, cellValue) => {
+              return cellValue == 0 ? '未报工' : cellValue == 1 ? '已报工' : '';
+            }
+          },
 
 
-        },
-        {
-          prop: 'qualityName',
-          label: '质检人',
-          showOverflowTooltip: true,
-          align: 'center',
-          width:80
 
 
-        },
-        {
-          label: '附件',
-          prop: 'accessory',
-          showOverflowTooltip: true,
-          slot: 'accessory'
-        },
-        {
-          prop: 'status',
-          label: '状态',
-          align: 'center',
-          width:80,
-          formatter: (row, column, cellValue) => {
-            return cellValue==0?'未报工':cellValue==1?'已报工':''
+          {
+            label: '创建时间',
+            prop: 'createTime',
+            width: 95,
+            align: 'center'
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 120,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            fixed: 'right'
           }
           }
-
-        },
-        {
-          columnKey: 'action',
-          label: '操作',
-          width: 220,
-          align: 'center',
-          resizable: false,
-          slot: 'action',
-          fixed: 'right'
-        }
-      ]
-    };
-  },
-  created() {
-    this.requestDict('质检计划类型');
-    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);
-
+    created() {
+      this.requestDict('质检计划类型');
+      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) {
       downloadFile(file) {
-        getFile({objectName: file.storePath}, file.name);
+        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();
+      remove(row) {
+        removeItem([row.id])
+          .then((message) => {
+            this.$message.success(message);
+            this.done();
+          })
+          .catch((e) => {});
+      },
+      done() {
+        this.$refs.search.search();
+      }
     }
     }
-  }
-};
+  };
 </script>
 </script>
-