Bladeren bron

修改质检可以查看工艺文件

695593266@qq.com 4 maanden geleden
bovenliggende
commit
e3d73de895

+ 157 - 0
src/components/workList/newWokePopupList.vue

@@ -0,0 +1,157 @@
+<template>
+  <div class="right-page">
+    <ele-pro-table
+      height="calc(80vh - 160px)"
+      ref="fileTable"
+      :columns="jobColumns1"
+      :datasource="workList"
+      v-show="rightMode == 'list'"
+    >
+      <!-- 表头工具栏 -->
+
+      <template v-slot:action="{ row }">
+        <el-link type="primary" @click="fileDetails(row)">详情</el-link>
+      </template>
+    </ele-pro-table>
+
+    <fileBrowse
+      ref="browseRef"
+      v-if="rightMode == 'detail'"
+      @close="closeDetail"
+    />
+  </div>
+</template>
+
+<script>
+  import { newFilePageAPI, fileReleaseAPI } from '@/api/inspectionProjectTask';
+  import { setFileUrl } from '@/components/addDoc/util.js';
+  import fileBrowse from '@/views/produce/components/picking/newFileBrowse.vue';
+  export default {
+    components: { fileBrowse },
+    props: {},
+    data() {
+      return {
+        workList: [],
+        rightMode: 'list',
+        jobColumns1: [
+          {
+            label: '编码',
+            prop: 'code',
+            width: 180,
+            align: 'center',
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'name',
+            label: '文档名称',
+            align: 'center',
+            slot: 'name',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
+
+          {
+            prop: 'storagePath',
+            label: '文件名称',
+            align: 'center',
+
+            showOverflowTooltip: true,
+            minWidth: 200,
+            formatter: (_row, _column, cellValue) => {
+              return cellValue[0]?.name;
+            }
+          },
+
+          {
+            prop: 'version',
+            label: '版本',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 100
+          },
+
+          {
+            prop: 'createTime',
+            label: '创建时间',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 110
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 100,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            fixed: 'right',
+            showOverflowTooltip: true
+          }
+        ],
+        itemData: null,
+        type: ''
+      };
+    },
+
+    watch: {},
+    methods: {
+      open(ids, type) {
+        this.type = type;
+        this.getFilepProcess(ids);
+      },
+
+      openTwo(req, type) {
+        this.type = type;
+        this.itemData = req;
+        fileReleaseAPI({
+          fileType: 0,
+          isQueryAll: 1,
+          jobNumber: '',
+          lcyStatus: '3',
+          loginName: '',
+          name: req.productCode,
+          pageNum: 1,
+          size: 10
+        }).then((res) => {
+          this.workList = res.list;
+        });
+      },
+      browseOpen(row) {
+        window.open(setFileUrl(row));
+      },
+
+      fileDetails(row) {
+        this.currentRow = row;
+        this.rightMode = 'detail';
+
+        this.$nextTick(() => {
+          this.$refs.browseRef.setFileUrl(row);
+        });
+      },
+
+      closeDetail() {
+        this.rightMode = 'list';
+        if (this.type == 1) {
+          this.getFilepProcess(this.itemData);
+        } else if (this.type == 2) {
+          this.openTwo(this.itemData);
+        }
+      },
+
+      async getFilepProcess(ids) {
+        if (!ids.length) {
+          return;
+        }
+        this.itemData = ids;
+        await newFilePageAPI({
+          ids: "'" + ids + "'"
+        }).then((res) => {
+          this.workList = res;
+        });
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped></style>

+ 2 - 1
src/views/produce/components/picking/newWokePopup.vue

@@ -117,10 +117,11 @@
           {
             columnKey: 'action',
             label: '操作',
-            width: 260,
+            width: 100,
             align: 'center',
             resizable: false,
             slot: 'action',
+            fixed: 'right',
             showOverflowTooltip: true
           }
         ],

+ 315 - 43
src/views/produce/components/workPlan/components/sampleListDialog.vue

@@ -10,7 +10,237 @@
     :close-on-click-modal="false"
     :close-on-press-escape="false"
   >
-    <el-table :data="tableData" :default-expand-all="true">
+    <div class="two-layout">
+      <el-row :gutter="10" class="full-row">
+        <el-col :span="12" class="full-col">
+          <div class="pane">
+            <div class="pane-title">质检</div>
+            <div class="table-wrapper">
+              <el-table
+                :data="tableData"
+                :default-expand-all="true"
+                height="calc(80vh - 120px)"
+              >
+                <el-table-column type="expand">
+                  <template slot-scope="props">
+                    <div style="padding: 10px">
+                      <el-table
+                        :data="props.row.qualitySampleTemplateList"
+                        border
+                      >
+                        <el-table-column
+                          label="质检方案编码"
+                          prop="qualitySchemeTemplateCode"
+                          align="center"
+                          show-overflow-tooltip
+                        >
+                          <template slot-scope="scope">
+                            <span
+                              :class="
+                                scope.row.qualityResults == 2 ? 'warn' : ''
+                              "
+                            >
+                              {{ scope.row.qualitySchemeTemplateCode }}
+                            </span>
+                          </template>
+                        </el-table-column>
+                        <el-table-column
+                          label="质检方案名称"
+                          prop="qualitySchemeTemplateName"
+                          align="center"
+                          show-overflow-tooltip
+                        >
+                          <template slot-scope="scope">
+                            <span
+                              :class="
+                                scope.row.qualityResults === 2 ? 'warn' : ''
+                              "
+                            >
+                              {{ scope.row.qualitySchemeTemplateName }}
+                            </span>
+                          </template>
+                        </el-table-column>
+                        <el-table-column
+                          label="质检类型"
+                          prop="categoryLevelClassName"
+                          align="center"
+                          show-overflow-tooltip
+                        >
+                          <template slot-scope="scope">
+                            <span
+                              :class="
+                                scope.row.qualityResults === 2 ? 'warn' : ''
+                              "
+                            >
+                              {{ scope.row.categoryLevelClassName }}
+                            </span>
+                          </template>
+                        </el-table-column>
+                        <el-table-column
+                          label="质检项编码"
+                          prop="inspectionCode"
+                          align="center"
+                          show-overflow-tooltip
+                        >
+                          <template slot-scope="scope">
+                            <span
+                              :class="
+                                scope.row.qualityResults === 2 ? 'warn' : ''
+                              "
+                            >
+                              {{ scope.row.inspectionCode }}
+                            </span>
+                          </template>
+                        </el-table-column>
+                        <el-table-column
+                          label="质检项名称"
+                          prop="inspectionName"
+                          align="center"
+                          show-overflow-tooltip
+                        >
+                          <template slot-scope="scope">
+                            <span
+                              :class="
+                                scope.row.qualityResults === 2 ? 'warn' : ''
+                              "
+                            >
+                              {{ scope.row.inspectionName }}
+                            </span>
+                          </template>
+                        </el-table-column>
+                        <el-table-column
+                          label="工艺参数"
+                          prop="defaultValue"
+                          align="center"
+                          show-overflow-tooltip
+                        >
+                          <template slot-scope="scope">
+                            <div
+                              style="display: flex; justify-content: center"
+                              :class="
+                                scope.row.qualityResults === 2 ? 'warn' : ''
+                              "
+                            >
+                              <span>{{ scope.row.symbol }}</span>
+                              <span v-if="scope.row.textType == 3">
+                                {{ scope.row.minValue }}-{{
+                                  scope.row.maxValue
+                                }}
+                              </span>
+
+                              <span v-else>
+                                <span>{{ scope.row.defaultValue }}</span>
+                              </span>
+
+                              {{ scope.row.unitName }}
+                            </div>
+                          </template>
+                        </el-table-column>
+                        <el-table-column
+                          label="质检工具"
+                          prop=""
+                          align="center"
+                        >
+                          <template slot-scope="scope">
+                            <toolButtom
+                              v-model="scope.row.useTools"
+                              :type="type"
+                              :sList="scope.row.toolList"
+                            />
+                          </template>
+                        </el-table-column>
+
+                        <el-table-column
+                          label="质检内容"
+                          prop="qualityResultContent"
+                          align="center"
+                          fixed="right"
+                          width="360"
+                        >
+                          <template slot-scope="scope">
+                            <el-input
+                              :class="
+                                scope.row.qualityResults === 2 ? 'warn' : ''
+                              "
+                              v-model="scope.row.qualityResultContent"
+                              placeholder="请输入内容"
+                              :disabled="type == 'detail'"
+                              @input="
+                                handleInput(
+                                  scope.row,
+                                  scope.row.qualityResultContent
+                                )
+                              "
+                            >
+                              <template slot="append" v-if="scope.row.unitName">
+                                {{ scope.row.unitName }}
+                              </template>
+                            </el-input>
+                          </template>
+                        </el-table-column>
+                        <el-table-column
+                          label="质检结果"
+                          prop="qualityResults"
+                          align="center"
+                          fixed="right"
+                        >
+                          <template slot-scope="scope">
+                            <el-select
+                              v-model="scope.row.qualityResults"
+                              placeholder="请选择"
+                              style="width: 100%"
+                              @change="qualityResultsListChange"
+                              :disabled="type == 'detail'"
+                            >
+                              <el-option
+                                v-for="item in qualityResultsList"
+                                :key="item.value"
+                                :label="item.label"
+                                :value="item.value"
+                              >
+                              </el-option>
+                            </el-select>
+                          </template>
+                        </el-table-column>
+                      </el-table>
+                    </div>
+                  </template>
+                </el-table-column>
+                <template v-for="column in tableColumns">
+                  <el-table-column
+                    :label="column.label"
+                    :prop="column.prop"
+                    :fixed="column.fixed"
+                    :show-overflow-tooltip="true"
+                    :width="column.width"
+                    :align="column.align"
+                    :formatter="column.formatter"
+                  >
+                  </el-table-column>
+                </template>
+              </el-table>
+
+              <div class="dialog-footer">
+                <el-button @click="handleClose">取消</el-button>
+                <el-button type="primary" @click="handleConfirm">
+                  确认
+                </el-button>
+              </div>
+            </div>
+          </div>
+        </el-col>
+
+        <el-col :span="12" class="full-col">
+          <div class="pane">
+            <div class="pane-title">工艺文件</div>
+
+            <wokePopupList ref="wokePopupListRef"></wokePopupList>
+          </div>
+        </el-col>
+      </el-row>
+    </div>
+
+    <!-- <el-table :data="tableData" :default-expand-all="true">
       <el-table-column type="expand">
         <template slot-scope="props">
           <div style="padding: 10px">
@@ -22,7 +252,7 @@
                 show-overflow-tooltip
               >
                 <template slot-scope="scope">
-                  <span :class="scope.row.qualityResults === 2 ? 'warn' : ''">
+                  <span :class="scope.row.qualityResults == 2 ? 'warn' : ''">
                     {{ scope.row.qualitySchemeTemplateCode }}
                   </span>
                 </template>
@@ -82,9 +312,6 @@
                 show-overflow-tooltip
               >
                 <template slot-scope="scope">
-                  <!-- <span :class="scope.row.qualityResults === 2 ? 'warn' : ''">
-                    {{ scope.row.defaultValue }}
-                  </span> -->
                   <div
                     style="display: flex; justify-content: center"
                     :class="scope.row.qualityResults === 2 ? 'warn' : ''"
@@ -112,7 +339,6 @@
                 </template>
               </el-table-column>
 
-              <!-- @blur="(e) => inputResultContent(e, scope.row)" -->
               <el-table-column
                 label="质检内容"
                 prop="qualityResultContent"
@@ -174,49 +400,25 @@
           :align="column.align"
           :formatter="column.formatter"
         >
-          <!-- <template slot-scope="scope" v-if="column.slot=='qualityResults'">
-            <el-select
-              v-model="scope.row.qualityResults"
-              placeholder="请选择"
-              style="width: 100%"
-              :disabled="type == 'detail'"
-            >
-              <el-option
-                v-for="item in qualityResultsList"
-                :key="item.value"
-                :label="item.label"
-                :value="item.value"
-              >
-              </el-option>
-            </el-select>
-          </template> -->
         </el-table-column>
       </template>
-      <!-- <el-table-column label="操作" align="center" width="80">
-        <template slot-scope="scope">
-          <el-link
-            :underline="false"
-            type="primary"
-            @click="handleDispose(scope.$index, scope.row, 'dispose')"
-          >
-            处置
-          </el-link>
-        </template>
-      </el-table-column> -->
-    </el-table>
-    <template v-slot:footer v-if="type == 'report'">
+    </el-table> -->
+    <!-- <template v-slot:footer v-if="type == 'report'">
       <el-button @click="handleClose">取消</el-button>
       <el-button type="primary" @click="handleConfirm"> 确认 </el-button>
-    </template>
+    </template> -->
   </ele-modal>
 </template>
 
 <script>
   import index from 'ele-admin/lib/ele-avatar-list';
   import toolButtom from './toolButtom.vue';
+  import wokePopupList from '@/components/workList/newWokePopupList.vue';
+  import { parameterGetByCode } from '@/api/system/dictionary-data';
   export default {
     components: {
-      toolButtom
+      toolButtom,
+      wokePopupList
     },
     data() {
       return {
@@ -315,12 +517,10 @@
 
     created() {},
     methods: {
-      async openDia(index, row, type, list, isStatus, sList) {
+      async openDia(index, row, type, list, isStatus, sList, formData) {
         this.tableData = [];
         this.rowIndex = index;
         this.type = type;
-        // console.log(list, 'lklllllllllllllllllkkkkkkkkkkkkkkkkkkkkk', list[0].qualityResults);
-        //如果质检项qualitySampleTemplateList只有一条数据且质检结果是让步接收
         if (list[0].qualitySampleTemplateList.length == 1) {
           for (let i = 0; i < list[0].qualitySampleTemplateList.length; i++) {
             list[0].qualitySampleTemplateList[i].qualityResults = list[0]
@@ -337,10 +537,26 @@
             });
         });
         this.tableData = JSON.parse(JSON.stringify(list));
-        console.log(this.tableData, '33333333333333333');
-
+        this.getFileParam(formData);
         this.visible = true;
       },
+
+      async getFileParam(form) {
+        const res = await parameterGetByCode({
+          code: 'mes_craft_file_by_category_code'
+        });
+        const byCategory = res?.value === '1';
+
+        if (byCategory) {
+          this.$refs.wokePopupListRef.openTwo(form, 2);
+        } else {
+          this.$refs.wokePopupListRef.open(
+            form.fileParam.map((item) => item.id),
+            1
+          );
+        }
+      },
+
       qualityResultsListChange() {
         this.tableData.forEach((item, index) => {
           this.$set(
@@ -360,7 +576,6 @@
         return getQualityValue;
       },
       inputResultContent(e, row) {
-        console.log(row, 'row row row');
         if (row.textType == '1') {
           if (!row.symbol) {
             if (row.qualityResultContent != row.defaultValue) {
@@ -529,4 +744,61 @@
       color: red;
     }
   }
+
+  .two-layout {
+    height: 80vh;
+    display: flex;
+    flex-direction: column;
+    overflow: hidden;
+  }
+
+  .full-row {
+    flex: 1;
+    height: 100%;
+    min-height: 0;
+  }
+
+  .full-col {
+    height: 100%;
+    min-height: 0;
+  }
+
+  .pane {
+    height: 100%;
+    background: #fff;
+    border-radius: 4px;
+    padding: 10px;
+
+    display: flex;
+    flex-direction: column;
+    min-height: 0;
+  }
+
+  /* 表格父级 */
+  .table-wrapper {
+    flex: 1;
+    min-height: 0;
+    overflow: auto; //
+  }
+
+  .pane-title {
+    font-size: 16px;
+    font-weight: 600;
+    color: #03541c;
+    padding-bottom: 10px;
+    margin-bottom: 10px;
+    border-bottom: 1px solid #ebeef5;
+    flex-shrink: 0;
+  }
+
+  ::v-deep .el-table__body-wrapper {
+    overflow-y: auto !important;
+  }
+
+  .dialog-footer {
+    padding: 10px 0;
+    border-top: 1px solid #eee;
+    text-align: right;
+    background: #fff;
+  }
 </style>

+ 4 - 2
src/views/produce/components/workPlan/edit.vue

@@ -1654,7 +1654,8 @@
           type,
           selectedData,
           null,
-          this.schemeList.toolList
+          this.schemeList.toolList,
+          this.form
         );
       },
       sampleListChange(sampleList) {
@@ -1923,7 +1924,8 @@
           'report',
           this.sampleList,
           null,
-          this.schemeList.toolList
+          this.schemeList.toolList,
+          this.form
         );
       },
       // 批量处置