ysy hai 1 ano
pai
achega
22f32c5975

+ 5 - 0
src/enum/dict.js

@@ -51,6 +51,11 @@ export default {
   生产类型: 'productionType',
   质检标准类型: 'quality_testing_code',
   质检方式: 'quality_method_code',
+  质检项标准单位: 'quality_inspection_standard_unit',
+  数学字符: 'mathematical_symbol',
+  质检类型: 'inspection_type',
+  不良品处理类型: 'unqualified_products_type',
+  质检计划类型: 'inspection_plan_type',
   预警类型: 'warning_type'
 
 };

+ 98 - 111
src/views/material/BOMmanage/qualityTesting/inspectionClassify/components/edit.vue

@@ -2,7 +2,7 @@
 <template>
   <el-dialog
     class="ele-dialog-form"
-    :title="title"
+    title="质检项"
     :visible.sync="visible"
     :before-close="handleClose"
     :close-on-click-modal="false"
@@ -11,108 +11,87 @@
     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-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"
           >
-
-
-        </el-col>
-      </el-row>
+            <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-form>
 
     <template v-slot:footer>
@@ -144,26 +123,34 @@
         defaultForm,
         // 表单数据
         form: { ...defaultForm() },
-        activeName: '质检项',
-        activeList: [{ name: '质检项' }],
+
         // 表单验证规则
-        rules: {
-     
-        },
+        rules: {},
         visible: false,
 
-        title: null,
+        type: '',
         loading: false
       };
     },
 
     created() {},
     methods: {
-      open(row) {
-        this.form = JSON.parse(JSON.stringify(row));
+      open(type, row) {
+        this.type = type;
+        if (this.type != 'add') {
+          row.linePoints = row.linePoints || [];
+          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;
       },
- 
 
       handleDeleteItem(index, list) {
         this.form[list].splice(index, 1);

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

@@ -2,6 +2,7 @@
   <div>
     <user-search @search="reload" ref="searchRef"> </user-search>
     <!-- 数据表格 -->
+
     <ele-pro-table
       ref="table"
       :columns="columns"
@@ -14,7 +15,7 @@
       <!-- 编码列 -->
 
       <template v-slot:name="{ row }">
-        {{ row.qualityStandard.name }}
+        {{  row.qualityStandard && row.qualityStandard.name }}
       </template>
 
       <template v-slot:code="{ row }">
@@ -23,20 +24,20 @@
           type="primary"
           :underline="false"
         >
-          {{ row.qualityStandard.code }}
+          {{  row.qualityStandard && row.qualityStandard.code }}
         </el-link>
       </template>
 
       <template v-slot:type="{ row }">
-        {{ getDictValue('质检标准类型', row.qualityStandard.type) }}
+        {{ getDictValue('质检标准类型',  row.qualityStandard && row.qualityStandard.type) }}
       </template>
 
       <template v-slot:standardCode="{ row }">
-        {{ row.qualityStandard.standardCode }}
+        {{  row.qualityStandard && row.qualityStandard.standardCode }}
       </template>
 
       <template v-slot:status="{ row }">
-        {{ row.qualityStandard.status == 1 ? '启用' : '停用' }}
+        {{  row.qualityStandard && row.qualityStandard.status == 1 ? '启用' : '停用' }}
       </template>
 
       <template v-slot:mode="{ row }">
@@ -44,7 +45,7 @@
       </template>
 
       <template v-slot:version="{ row }">
-        {{ row.qualityStandard.version }}
+        {{  row.qualityStandard && row.qualityStandard.version }}
       </template>
     </ele-pro-table>
 
@@ -133,13 +134,18 @@
     methods: {
       /* 表格数据源 */
       datasource({ page, limit, where }) {
-        return getList({
+      let _data = null;
+      _data = getList({
           ...where,
           pageNum: page,
           size: limit,
           categoryLevelId: this.categoryLevelId || 12,
           rootCategoryLevelId: this.rootId
         });
+
+    
+        console.log(_data,555);
+        return _data
       },
       /* 刷新表格 */
       reload(where) {
@@ -158,7 +164,7 @@
       },
 
       openDetail(row) {
-        this.$refs.detailRef.open(row);
+        this.$refs.detailRef.open('detail',row);
       }
     }
   };

+ 2 - 2
vue.config.js

@@ -33,8 +33,8 @@ module.exports = {
       '/api': {
         // target: 'http://192.168.1.124:50001',
         // target: 'http://192.168.1.147:18086',
-        target: 'http://192.168.1.125:18086',
-        // target: 'http://192.168.1.116:18086',
+        // target: 'http://192.168.1.125:18086',
+        target: 'http://192.168.1.116:18086',
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域
         pathRewrite: {
           '^/api': ''