ysy il y a 1 an
Parent
commit
129089e1c0

+ 1 - 1
src/api/inspectionProject/index.js

@@ -32,7 +32,7 @@ export async function update(data) {
 
 // 获取详情
 export async function getById(id) {
-  const res = await request.get(`/qms/qms/inspection_item//getById/${id}`);
+  const res = await request.get(`/qms/inspection_item/getById/${id}`);
   if (res.data.code == 0) {
     return res.data;
   }

+ 118 - 26
src/views/inspectionClassify/components/qualityItem.vue

@@ -10,9 +10,9 @@
     width="85%"
   >
     <el-card shadow="never">
+      <!-- 数据表格 -->
 
 
-      <!-- 数据表格 -->
       <ele-pro-table
         ref="table"
         :columns="columns"
@@ -20,7 +20,57 @@
         :selection.sync="selection"
         row-key="id"
       >
+
+
+        <template v-slot:status="{ row }"> </template>
+
+        <template v-slot:textType="{ row }">
+          {{
+            row.textType == 1
+              ? '数值'
+              : row.textType == 2
+              ? '选择'
+              : row.textType == 3
+              ? '上下限'
+              : row.textType == 4
+              ? '规格'
+              : row.textType == 5
+              ? '时间'
+              : row.textType == 6
+              ? '范围'
+              : ''
+          }}
+        </template>
+
+        <template v-slot:type="{ row }">
+          {{ getDictValue('质检标准类型', row.type) }}
+        </template>
+
+        <!-- 操作列 -->
+        <template v-slot:action="{ 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)"
+          >
+            <template v-slot:reference>
+              <el-link type="danger" :underline="false" icon="el-icon-delete">
+                删除
+              </el-link>
+            </template>
+          </el-popconfirm>
+        </template>
       </ele-pro-table>
+
     </el-card>
 
     <div class="btns">
@@ -31,13 +81,11 @@
 </template>
 
 <script>
-  import { getList } from '@/api/inspectionStandard';
 
+  import { getList } from '@/api/inspectionProject';
 
   export default {
-    components: {
-
-    },
+    components: {},
     mixins: [],
 
     data() {
@@ -45,37 +93,56 @@
         visible: false,
         title: '选择质检项',
 
-        // 表格列配置
         columns: [
           {
-            columnKey: 'selection',
-            type: 'selection',
-            width: 45,
+            prop: 'inspectionCode',
+            label: '参数编码',
+            showOverflowTooltip: true,
             align: 'center',
-            selectable: (row, index) => {
-              return !this.processData.some((it) => it.id == row.id);
-            },
-            reserveSelection: true,
-            fixed: 'left'
+            minWidth: 110
           },
           {
-            prop: 'code',
-            label: '质检编码'
+            prop: 'inspectionName',
+            label: '参数名称',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 110
           },
+
           {
-            label: '质检名称',
-            prop: 'name'
+            prop: 'textType',
+            label: '参数类型',
+            showOverflowTooltip: true,
+            align: 'center',
+            slot: 'textType',
+            minWidth: 110
           },
 
           {
-            label: '状态',
-            prop: 'status',
-            slot: 'status'
+            prop: 'maxValue',
+            label: '参数上限',
+            align: 'center',
+            showOverflowTooltip: true
           },
-
           {
-            label: '版本号',
-            prop: 'version'
+            prop: 'minValue',
+            label: '参数下限',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'defaultValue',
+            label: '默认值',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            label: '工艺要求',
+            prop: 'inspectionStandard',
+            formatter: (row, column, cellValue) => {
+              return row.symbol + ' ' + cellValue + ' ' + row.unit;
+            },
+            minWidth: 150
           },
 
           {
@@ -85,8 +152,33 @@
           },
 
           {
-            label: '标准代码',
-            prop: 'standardCode'
+            prop: 'qualityStandardName',
+            label: '标准名称',
+            align: 'center',
+            minWidth: 110
+          },
+
+          {
+            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
           }
         ],
 

+ 5 - 23
src/views/inspectionClassify/components/user-list.vue

@@ -29,12 +29,11 @@
         {{ row.qualityStandard && row.qualityStandard.name }}
       </template>
 
-
       <template v-slot:code="{ row }">
         <el-link
           type="primary"
           :underline="false"
-           @click="openDetail(row.qualityStandard)"
+          @click="openDetail(row.qualityStandard)"
         >
           {{ row.qualityStandard && row.qualityStandard.code }}
         </el-link>
@@ -70,17 +69,9 @@
       </template>
 
       <template v-slot:action="{ row }">
-        <el-link
-          type="primary"
-          :underline="false"
-          icon="el-icon-edit"
-          @click="openEdit(row)"
-        >
-          添加
-        </el-link>
         <el-popconfirm
           class="ele-action"
-          title="确定要删除此干燥区吗?"
+          title="确定要删除此质检项吗?"
           @confirm="remove(row)"
         >
           <template v-slot:reference>
@@ -92,10 +83,6 @@
       </template>
     </ele-pro-table>
 
-
-
-
-
     <qualityItem ref="qualityItemRef"></qualityItem>
   </div>
 </template>
@@ -109,11 +96,11 @@
   } from '@/api/inspectionClassify/index';
   import dictMixins from '@/mixins/dictMixins';
 
-  import qualityItem from './qualityItem.vue'
+  import qualityItem from './qualityItem.vue';
 
   export default {
     mixins: [dictMixins],
-    components: { userSearch , qualityItem},
+    components: { userSearch, qualityItem },
     props: {
       // 类别id
 
@@ -213,16 +200,11 @@
 
       /* 打开编辑弹窗 */
       openAdd() {
-        this.$refs.addRef.open(this.categoryLevelId || 12);
-        // this.$refs.qualityItemRef.open()
+        this.$refs.qualityItemRef.open();
       },
 
-      openEdit(row) {
-        this.$refs.edit.open(row);
-      },
       openDetail(row) {
         console.log(row);
-
       },
 
       chooseProcess(data) {

+ 14 - 26
src/views/inspectionProject/components/user-edit.vue

@@ -17,8 +17,8 @@
             <el-select
               v-model="form.qualityStandardId"
               placeholder="请选择"
-              class="ele-block"
               filterable
+              style="width: 100%"
             >
               <el-option
                 :label="item.name"
@@ -40,7 +40,9 @@
             />
           </el-form-item>
         </el-col>
+      </el-row>
 
+      <el-row>
         <el-col :span="12">
           <el-form-item label="参数名称:" prop="inspectionName">
             <el-input
@@ -288,6 +290,7 @@
 
 <script>
   import { save, update, getById } from '@/api/inspectionProject';
+  import { getCode } from '@/api/login';
 
   import { getList } from '@/api/inspectionStandard';
   import ProductModal from './ProductModal.vue';
@@ -332,22 +335,9 @@
         defaultForm,
         // 表单数据
         form: { ...defaultForm },
-        timeType: [
-          { value: 1, label: '是' },
-          { value: 0, label: '否' }
-        ],
-        statusList: [
-          { label: '工艺', value: 0 },
-          { label: '质检', value: 1 },
-          { label: '产品', value: 2 },
-          { label: '原料', value: 3 },
-          { label: '设备', value: 4 },
-          { label: '其他', value: 5 }
-        ],
-        tacticsType: [
-          { code: 1, label: '标准时间' },
-          { code: 2, label: '最短时间' }
-        ],
+
+
+
 
         qualityStandardList: [],
         // 表单验证规则
@@ -378,13 +368,7 @@
           ]
         },
 
-        tableFormRules: {
-          formula: {
-            required: true,
-            message: '请输入公式',
-            trigger: 'blur'
-          }
-        },
+
 
         // 提交状态
         loading: false,
@@ -491,7 +475,7 @@
         this.form.postscriptList.push({ sort: null, content: '' });
       },
       removePostscript(idx, row) {
-        this.$confirm(`是否删除这个事项?`).then(async () => {
+        this.$confirm(`是否删除这个注意事项?`).then(async () => {
           this.form.postscriptList.splice(idx, 1);
           if (row.id) {
             this.form.postscriptRemoveIds.push(row.id);
@@ -505,12 +489,16 @@
         if (visible) {
           if (this.data) {
             const res = await getById(this.data.id);
+    
 
             this.$util.assignObject(this.form, {
-              ...res
+              ...res.data
             });
             this.isUpdate = true;
           } else {
+            const code = await getCode('inspection_code');
+            this.form.inspectionCode = code;
+
             this.isUpdate = false;
           }
         } else {