2213980799@qq.com 1 jaar geleden
bovenliggende
commit
c57f8d6e41

+ 2 - 1
src/components/upload/fileUpload.vue

@@ -14,7 +14,8 @@
       :disabled="disabled"
     >
       <slot>
-        <el-button type="primary" icon="el-icon-plus">点击上传</el-button>
+      
+        <el-button :disabled="disabled"  type="primary" icon="el-icon-plus">点击上传</el-button>
       </slot>
     </el-upload>
     <el-button type="primary" class="lib" @click="handleOpenLib" v-if="showLib"

+ 71 - 69
src/views/inspectionClassify/components/user-list.vue

@@ -1,13 +1,25 @@
 <template>
   <div>
-    <user-search @search="reload" ref="searchRef">
-    </user-search>
+    <user-search @search="reload" ref="searchRef"> </user-search>
     <!-- 数据表格 -->
-    <ele-pro-table ref="table" :columns="columns" :datasource="datasource" height="calc(100vh - 265px)"
-      full-height="calc(100vh - 116px)" tool-class="ele-toolbar-form" cache-key="systemOrgUserTable">
+    <ele-pro-table
+      ref="table"
+      :columns="columns"
+      :datasource="datasource"
+      height="calc(100vh - 265px)"
+      full-height="calc(100vh - 116px)"
+      tool-class="ele-toolbar-form"
+      cache-key="systemOrgUserTable"
+    >
       <!-- 表头工具栏 -->
       <template v-slot:toolbar>
-        <el-button size="small" type="primary" icon="el-icon-plus" class="ele-btn-icon" @click="openAdd()">
+        <el-button
+          size="small"
+          type="primary"
+          icon="el-icon-plus"
+          class="ele-btn-icon"
+          @click="openAdd()"
+        >
           新增
         </el-button>
       </template>
@@ -17,48 +29,50 @@
         {{ row.qualityStandard.name }}
       </template>
 
-
       <template v-slot:code="{ row }">
-        {{ row.qualityStandard.code }}
+        <el-link
+          type="primary"
+          :underline="false"
+          @click="openDetail(row.qualityStandard)"
+        >
+          {{ row.qualityStandard.code }}
+        </el-link>
       </template>
 
-
-      
       <template v-slot:type="{ row }">
-
-        {{getDictValue('质检标准类型', row.qualityStandard.type)}}
-
+        {{ getDictValue('质检标准类型', row.qualityStandard.type) }}
       </template>
 
       <template v-slot:standardCode="{ row }">
         {{ row.qualityStandard.standardCode }}
       </template>
 
-
-
       <template v-slot:status="{ row }">
         {{ row.qualityStandard.status == 1 ? '启用' : '停用' }}
       </template>
 
-
       <template v-slot:mode="{ row }">
         {{ getDictValue('质检方式', row.mode) }}
-
       </template>
 
-
-
       <template v-slot:version="{ row }">
         {{ row.qualityStandard.version }}
       </template>
 
-
-
       <template v-slot:action="{ row }">
-        <el-link type="primary" :underline="false" icon="el-icon-edit" @click="openEdit(row)">
+        <el-link
+          type="primary"
+          :underline="false"
+          icon="el-icon-edit"
+          @click="openEdit(row)"
+        >
           添加
         </el-link>
-        <el-popconfirm class="ele-action" title="确定要删除此干燥区吗?" @confirm="remove(row)">
+        <el-popconfirm
+          class="ele-action"
+          title="确定要删除此干燥区吗?"
+          @confirm="remove(row)"
+        >
           <template v-slot:reference>
             <el-link type="danger" :underline="false" icon="el-icon-delete">
               删除
@@ -66,13 +80,13 @@
           </template>
         </el-popconfirm>
       </template>
-
-
     </ele-pro-table>
 
     <Add @chooseProcess="chooseProcess" ref="addRef" />
 
     <edit ref="edit" @done="done"></edit>
+    <Detail ref="detailRef"></Detail>
+    
 
   </div>
 </template>
@@ -82,23 +96,22 @@ import userSearch from './user-search.vue';
 import { getList, removeItem, saveBatch } from '@/api/inspectionClassify/index';
 import dictMixins from '@/mixins/dictMixins';
 import Add from './add.vue';
-import Edit from './edit.vue'
+import Edit from './edit.vue';
+import Detail from '@/views/inspectionStandard/components/edit.vue';
 
 export default {
   mixins: [dictMixins],
-  components: { userSearch, Add, Edit },
+  components: { userSearch, Add, Edit ,Detail},
   props: {
     // 类别id
 
-    rootId: [Number, String],
+    rootId: [Number, String]
   },
   data() {
     return {
       // 当前编辑数据
       current: null,
 
-
-
       // 表格列配置
       columns: [
         {
@@ -106,7 +119,7 @@ export default {
           type: 'index',
           label: '序号',
           width: 55,
-          align: 'center',
+          align: 'center'
         },
 
         {
@@ -114,39 +127,34 @@ export default {
           label: '标准编码',
           showOverflowTooltip: true,
           minWidth: 110,
-          slot: 'code',
+          slot: 'code'
         },
 
-
-
         {
           prop: 'name',
           label: '标准名称',
           showOverflowTooltip: true,
           minWidth: 110,
-          slot: 'name',
+          slot: 'name'
         },
 
         {
           label: '标准类型',
           prop: 'type',
-          slot: 'type',
+          slot: 'type'
         },
 
         {
           label: '标准代码',
-          prop: 'standardCode',
-
+          prop: 'standardCode'
         },
 
-
-
         {
           prop: 'status',
           label: '状态',
           align: 'center',
           minWidth: 110,
-          slot: 'status',
+          slot: 'status'
         },
 
         {
@@ -154,29 +162,21 @@ export default {
           label: '版本号',
           align: 'center',
           minWidth: 110,
-          slot: 'version',
+          slot: 'version'
         },
 
-
-
-
-
         {
           label: '操作',
           prop: 'action',
           slot: 'action',
           action: 'action'
         }
-
-
-
-
       ]
     };
   },
   created() {
     this.requestDict('质检方式');
-    this.requestDict('质检标准类型')
+    this.requestDict('质检标准类型');
   },
   methods: {
     /* 表格数据源 */
@@ -191,7 +191,12 @@ export default {
     },
     /* 刷新表格 */
     reload(where) {
-      this.$refs.table.reload({ pageNum: 1, where: where, categoryLevelId: this.categoryLevelId, rootCategoryLevelId: this.rootId });
+      this.$refs.table.reload({
+        pageNum: 1,
+        where: where,
+        categoryLevelId: this.categoryLevelId,
+        rootCategoryLevelId: this.rootId
+      });
     },
 
     /* 打开编辑弹窗 */
@@ -202,19 +207,21 @@ export default {
     openEdit(row) {
       this.$refs.edit.open(row);
     },
-
+    openDetail(row) {
+      console.log(row)
+      this.$refs.detailRef.open('detail',row);
+    },
+    
     chooseProcess(data) {
-      saveBatch(data).then(res => {
-        console.log(res)
+      saveBatch(data).then((res) => {
+        console.log(res);
         if (res.code == 0) {
-          this.$message.success(res.message)
-          this.reload()
+          this.$message.success(res.message);
+          this.reload();
         }
-      })
-
+      });
     },
 
-
     /* 删除 */
     remove(row) {
       const loading = this.$loading({ lock: true });
@@ -233,15 +240,10 @@ export default {
     },
 
     clickSearch(info) {
-      this.categoryLevelId = info.id
-      this.rootCategoryLevelId = info.rootCategoryLevelId
-      this.reload()
-
-    },
-
-
-
-  },
-
+      this.categoryLevelId = info.id;
+      this.rootCategoryLevelId = info.rootCategoryLevelId;
+      this.reload();
+    }
+  }
 };
 </script>

+ 9 - 4
src/views/inspectionPlan/components/edit.vue

@@ -207,6 +207,8 @@
               module="main"
               :showLib="false"
               :limit="1"
+              :disabled="type=='detail'"
+
             />
           </el-form-item>
         </el-col>
@@ -246,7 +248,7 @@
           </template>
         </el-table-column>
       </el-table>
-      <div class="add-product" @click="addProduct">
+      <div class="add-product" @click="addProduct"   v-if="type!='detail'">
         <i class="el-icon-circle-plus-outline"></i>
       </div>
       <EquipmentDialog ref="equipmentRefs" @choose="choose" :type="1" />
@@ -352,11 +354,11 @@ export default {
       this.sourceList =
         val == 1
           ? [{ label: '入库申请单', value: '1' }]
-          : [
+          :val == 2? [
               { label: '生产计划', value: '2' },
               { label: '生产订单', value: '3' },
               { label: '生产工单', value: '4' }
-            ];
+            ]:[]
     }
   },
   created() {},
@@ -372,7 +374,7 @@ export default {
           : '详情';
       this.type = type;
       if (this.type != 'add') {
-        row.accessory=row.accessory||[]
+        row.accessory = row.accessory || [];
         this.form = JSON.parse(JSON.stringify(row));
         if (this.form.groupId) {
           this.getUserList({ groupId: this.form.groupId });
@@ -387,6 +389,9 @@ export default {
 
     planSourceChange() {
       this.choose({});
+      if (this.form.planSource) {
+        this.addProduct();
+      }
     },
     handleDeleteItem(index) {
       this.form.productList.splice(index, 1);

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

@@ -50,6 +50,8 @@
               module="main"
               :showLib="false"
               :limit="1"
+              :disabled="type=='detail'"
+
             />
           </el-form-item>
         </el-col>

+ 40 - 39
src/views/inspectionStandard/components/EquipmentDialog.vue

@@ -20,26 +20,21 @@
             cache-key="systemRoleTable3"
             @selection-change="selectionChange"
             @select="select"
-
-
             row-key="id"
             height="50vh"
             @done="onDone"
           >
-          <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: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>
           </ele-pro-table>
         </el-col>
       </el-row>
@@ -52,8 +47,8 @@
 </template>
 
 <script>
-import { getList,  } from '@/api/inspectionPoint';
-import {getFile} from "@/api/system/file";
+import { getList } from '@/api/inspectionPoint';
+import { getFile } from '@/api/system/file';
 
 export default {
   components: {},
@@ -74,7 +69,7 @@ export default {
           columnKey: 'selection',
           align: 'center',
           reserveSelection: true,
-          show:this.type==1
+          show: this.type == 1
         },
         {
           width: 45,
@@ -95,7 +90,7 @@ export default {
           label: '区域',
           prop: 'areaName'
         },
-        
+
         {
           label: '附件',
           slot: 'files'
@@ -112,14 +107,14 @@ export default {
           align: 'center',
           showOverflowTooltip: true,
           minWidth: 110
-        },
+        }
       ],
       categoryLevelId: null,
       code: null,
       selection: [],
-      ids:[],
-      oldSelection:[],//存储selection
-    }
+      ids: [],
+      oldSelection: [] //存储selection
+    };
   },
 
   watch: {},
@@ -132,23 +127,23 @@ export default {
       });
     },
     downloadFile(file) {
-      getFile({objectName: file.storePath}, file.name);
+      getFile({ objectName: file.storePath }, file.name);
     },
     open(ids) {
       this.equipmentdialog = true;
-      this.ids=ids||[]
+      this.ids = ids || [];
     },
-    selectionChange(selection){
-      this.oldSelection.push(...selection)
+    selectionChange(selection) {
+      this.oldSelection.push(...selection);
     },
-    select(selection, row){
-      if(!selection.find(item=>item.id==row.id)){
-        this.ids= this.ids.filter(item=>item!=row.id) 
-      }else{
-        this.ids.push(row.id)
+    select(selection, row) {
+      if (!selection.find((item) => item.id == row.id)) {
+        this.ids = this.ids.filter((item) => item != row.id);
+      } else {
+        this.ids.push(row.id);
       }
     },
-    onDone(){
+    onDone() {
       this.$nextTick(() => {
         this.$refs.equiTable.setSelectedRowKeys(this.ids);
       });
@@ -159,12 +154,18 @@ export default {
     },
     // 选择
     selected() {
-      
-      if(this.type==1){
-        let ids= [...new Set(this.ids)]
-        this.selection=ids.map(item=>this.oldSelection.find(val=>val.id==item))
+      if (this.type == 1) {
+        let ids = [...new Set(this.ids)];
+        this.selection = ids.map((item) =>
+          this.oldSelection.find((val) => val.id == item)
+        );
       }
-      this.$emit('choose', this.type==1?JSON.parse(JSON.stringify(this.selection)):JSON.parse(JSON.stringify(this.current)));
+      this.$emit(
+        'choose',
+        this.type == 1
+          ? JSON.parse(JSON.stringify(this.selection))
+          : JSON.parse(JSON.stringify(this.current))
+      );
       this.handleClose();
     }
   }

+ 21 - 10
src/views/inspectionStandard/components/edit.vue

@@ -8,6 +8,8 @@
     :close-on-click-modal="false"
     :close-on-press-escape="false"
     width="1000px"
+    append-to-body
+
   >
     <el-form ref="form" :model="form" :rules="rules" label-width="100px">
       <el-row>
@@ -16,24 +18,25 @@
             <DictSelection
               dictName="质检标准类型"
               v-model="form.type"
+              :disabled="type=='detail'"
             ></DictSelection>
           </el-form-item>
         </el-col>
 
         <el-col :span="12">
           <el-form-item label="标准名称:" prop="name">
-            <el-input clearable v-model="form.name" placeholder="请输入" />
+            <el-input clearable v-model="form.name" placeholder="请输入"  :disabled="type=='detail'" />
           </el-form-item>
         </el-col>
         <el-col :span="12">
           <el-form-item label="标准代码:" prop="standardCode">
-            <el-input v-model="form.standardCode"></el-input>
+            <el-input v-model="form.standardCode"  :disabled="type=='detail'"></el-input>
           </el-form-item>
         </el-col>
 
         <el-col :span="12">
           <el-form-item label="版本号:" prop="version">
-            <el-input v-model="form.version"></el-input>
+            <el-input v-model="form.version"  :disabled="type=='detail'"></el-input>
           </el-form-item>
         </el-col>
         <el-col :span="12">
@@ -42,6 +45,7 @@
               v-model="form.status"
               placeholder="请选择"
               style="width: 100%"
+              :disabled="type=='detail'"
             >
               <el-option label="停用" :value="0" />
               <el-option label="启用" :value="1" />
@@ -56,6 +60,8 @@
               module="main"
               :showLib="false"
               :limit="1"
+              :disabled="type=='detail'"
+
             />
           </el-form-item>
         </el-col>
@@ -95,6 +101,7 @@
                       <el-form-item label-width="0" prop="finalValue">
                         <el-input
                           clearable
+                          :disabled="type=='detail'"
                           v-model="scope.row.finalValue"
                           placeholder="请输入"
                         />
@@ -109,6 +116,7 @@
                     <template slot-scope="scope">
                       <el-form-item label-width="0" prop="initialValue">
                         <el-input
+                        :disabled="type=='detail'"
                           clearable
                           v-model="scope.row.initialValue"
                           placeholder="请输入"
@@ -125,6 +133,7 @@
                       <el-form-item label-width="0" prop="defaultValue">
                         <el-input
                           clearable
+                          :disabled="type=='detail'"
                           v-model="scope.row.defaultValue"
                           placeholder="请输入"
                         />
@@ -140,11 +149,13 @@
                           clearable
                           v-model="scope.row.toleranceValue"
                           placeholder="请输入"
+                          :disabled="type=='detail'"
                         >
                           <DictSelection
                             style="width: 100px"
                             slot="prepend"
                             clearable
+                            :disabled="type=='detail'"
                             dictName="数学字符"
                             v-model="scope.row.symbol"
                           ></DictSelection>
@@ -153,7 +164,7 @@
                       </el-form-item>
                     </template>
                   </el-table-column>
-                  <el-table-column label="操作" align="center" width="80">
+                  <el-table-column label="操作" align="center" width="80" v-if="type!='detail'">
                     <template slot-scope="scope">
                       <el-link
                         type="danger"
@@ -200,6 +211,7 @@
                     <el-link
                       type="danger"
                       :underline="false"
+                      v-if="type!='detail'"
                       @click="handleDeleteItem(scope.$index, scope.row.id)"
                     >
                       删除
@@ -210,7 +222,7 @@
             </el-tab-pane></el-tabs
           >
 
-          <div class="add-product" @click="add">
+          <div class="add-product" @click="add"  v-if="type!='detail'">
             <i class="el-icon-circle-plus-outline"></i>
           </div>
         </el-col>
@@ -221,7 +233,7 @@
 
     <template v-slot:footer>
       <el-button @click="handleClose">取消</el-button>
-      <el-button type="primary" :loading="loading" @click="save">
+      <el-button type="primary" :loading="loading" @click="save" v-if="type!='detail'">
         保存
       </el-button>
     </template>
@@ -297,9 +309,9 @@ export default {
   created() {},
   methods: {
     open(type, row) {
-      this.title = type == 'add' ? '新增' : '编辑';
+      this.title = type == 'add' ? '新增' :'edit' ?  '编辑':'详情';
       this.type = type;
-      if (this.type == 'edit') {
+      if (this.type != 'add') {
         row.linePoints=row.linePoints||[]
         if (!row.parameterStandards) {
           row.parameterStandards = [];
@@ -314,7 +326,6 @@ export default {
       this.visible = true;
     },
     openEdit(type, row) {
-      console.log(row)
       this.$refs.edit.open(type, row);
     },
     choose(data) {
@@ -340,7 +351,7 @@ export default {
     },
     add() {
       if (this.activeName == '质检点') {
-        this.$refs.equipmentDialogRef.open();
+        this.$refs.equipmentDialogRef.open(this.form.linePoints.map(item=>item.id));
         return;
       }
       if (!this.form.parameterStandards.length) {

+ 12 - 3
src/views/inspectionStandard/index.vue

@@ -18,8 +18,16 @@
                 <template v-slot:type="{ row }">
                      {{getDictValue('质检标准类型', row.type)}}
                 </template>
-
-
+                <template v-slot:code="{ row }">
+                    <el-link
+                      type="primary"
+                      :underline="false"
+                      @click="openEdit('detail',row)"
+                    >
+                      {{ row.code }}
+                    </el-link>
+                </template>
+         
 
                 <!-- 操作列 -->
                 <template v-slot:action="{ row }">
@@ -63,7 +71,8 @@ export default {
 
                 {
                     prop: 'code',
-                    label: '标准编码'
+                    label: '标准编码',
+                    slot:'code'
                 },
                 {
                     label: '标准名称',

+ 3 - 1
src/views/inspectionWork/components/edit.vue

@@ -182,6 +182,8 @@
               module="main"
               :showLib="false"
               :limit="1"
+              :disabled="title == '详情'"
+
             />
           </el-form-item>
         </el-col>
@@ -190,7 +192,7 @@
 
     <div class="title" v-if="title != '新增'">质检内容</div>
     <el-table border v-if="title != '新增'"> </el-table>
-    <div class="title" v-if="title != '新增'">不合格品内容</div>
+    <div class="title" v-if="title != '新增'">不良品列表</div>
     <el-table :data="form.voList" border v-if="title != '新增'" height="25vh">
       <el-table-column label="序号" align="center" width="60">
         <template slot-scope="scope">