ysy пре 1 година
родитељ
комит
618aac1e0e

+ 0 - 18
src/api/material/inspectionClassify.js

@@ -28,24 +28,6 @@ export async function getList (data) {
 
 
 
-  // 编辑
-  export async function update (data) {
-    const res = await request.put(`/qms/qualitylevel/update`, data);
-    if (res.data.code == 0) {
-      return res.data.message;
-    }
-    return Promise.reject(new Error(res.data.message));
-  }
-  
-// 删除
-export async function removeItem (data) {
-  const res = await request.delete('/qms/qualitylevel/delete', { data });
-  if (res.data.code == 0) {
-    return res.data.message;
-  }
-  return Promise.reject(new Error(res.data.message));
-}
-
 
 // 批量保存
 export async function saveBatch (data) {

+ 3 - 1
src/enum/dict.js

@@ -47,7 +47,9 @@ export default {
   区域类型: 'main_area_type',
   工种类型: 'work_type',
   '客户/供应商资质类型': 'contact_qc_type',
-  生产类型: 'productionType'
+  生产类型: 'productionType',
+  质检标准类型: 'quality_testing_code',
+  质检方式: 'quality_method_code'
 };
 
 export const numberList = [

+ 224 - 0
src/views/material/BOMmanage/qualityTesting/inspectionClassify/components/edit.vue

@@ -0,0 +1,224 @@
+<!-- 用户编辑弹窗 -->
+<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"
+    append-to-body
+  >
+    <el-form ref="form" :model="form" :rules="rules" label-width="100px">
+      <el-row>
+        <el-col :span="24">
+          <el-tabs v-model="activeName" type="card">
+            <el-tab-pane
+              :label="item.name"
+              :name="item.name"
+              v-for="item in activeList"
+              :key="item.name"
+            >
+              <el-table
+                v-show="activeName == '质检项' "
+                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
+                          :disabled="type == 'detail'"
+                          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
+                          :disabled="type == 'detail'"
+                          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
+                          :disabled="type == 'detail'"
+                          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="请输入"
+                          :disabled="type == 'detail'"
+                        >
+                          <DictSelection
+                            style="width: 100px"
+                            slot="prepend"
+                            clearable
+                            :disabled="type == 'detail'"
+                            dictName="数学字符"
+                            v-model="scope.row.symbol"
+                          ></DictSelection>
+                        </el-input>
+                        <!-- </el-form-item> -->
+                      </el-form-item>
+                    </template>
+                  </el-table-column>
+           
+                </el-table-column>
+              </el-table>
+
+            </el-tab-pane></el-tabs
+          >
+
+
+        </el-col>
+      </el-row>
+    </el-form>
+
+    <template v-slot:footer>
+      <el-button @click="handleClose">取消</el-button>
+      <el-button
+        type="primary"
+        :loading="loading"
+        @click="save"
+        v-if="type != 'detail'"
+      >
+        保存
+      </el-button>
+    </template>
+  </el-dialog>
+</template>
+
+<script>
+  export default {
+    components: {},
+
+    data() {
+      const defaultForm = function () {
+        return {
+          parameterStandards: [],
+          linePoints: []
+        };
+      };
+      return {
+        defaultForm,
+        // 表单数据
+        form: { ...defaultForm() },
+        activeName: '质检项',
+        activeList: [{ name: '质检项' }],
+        // 表单验证规则
+        rules: {
+     
+        },
+        visible: false,
+
+        title: null,
+        loading: false
+      };
+    },
+
+    created() {},
+    methods: {
+      open(row) {
+        this.form = JSON.parse(JSON.stringify(row));
+        this.visible = true;
+      },
+ 
+
+      handleDeleteItem(index, list) {
+        this.form[list].splice(index, 1);
+      },
+      /* 保存编辑 */
+      save() {},
+      restForm() {
+        this.form = { ...this.defaultForm() };
+        this.$nextTick(() => {
+          this.$refs.form.clearValidate();
+        });
+      },
+      handleClose() {
+        this.restForm();
+        this.visible = false;
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .location-warp {
+    display: flex;
+
+    .detail {
+      margin-left: 10px;
+    }
+  }
+
+  :deep(
+      .el-dialog:not(.ele-dialog-form)
+        .el-dialog__body
+        .el-form
+        .el-form-item:last-child
+    ) {
+    margin-bottom: 22px;
+  }
+  :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>

+ 14 - 7
src/views/material/BOMmanage/qualityTesting/inspectionClassify/components/user-list.vue

@@ -18,7 +18,11 @@
       </template>
 
       <template v-slot:code="{ row }">
-        <el-link type="primary" :underline="false">
+        <el-link
+          @click="openDetail(row.qualityStandard)"
+          type="primary"
+          :underline="false"
+        >
           {{ row.qualityStandard.code }}
         </el-link>
       </template>
@@ -43,21 +47,20 @@
         {{ row.qualityStandard.version }}
       </template>
     </ele-pro-table>
+
+    <Detail ref="detailRef"></Detail>
   </div>
 </template>
 
 <script>
   import userSearch from './user-search.vue';
-  import {
-    getList,
-    removeItem,
-    saveBatch
-  } from '@/api/material/inspectionClassify';
+  import { getList } from '@/api/material/inspectionClassify';
   import dictMixins from '@/mixins/dictMixins';
+  import Detail from './edit.vue';
 
   export default {
     mixins: [dictMixins],
-    components: { userSearch },
+    components: { userSearch, Detail },
     props: {
       // 类别id
 
@@ -152,6 +155,10 @@
         this.categoryLevelId = info.id;
         this.rootCategoryLevelId = info.rootCategoryLevelId;
         this.reload();
+      },
+
+      openDetail(row) {
+        this.$refs.detailRef.open(row);
       }
     }
   };