ysy 1 tahun lalu
induk
melakukan
77ae30f14f

+ 27 - 9
src/api/classifyManage/index.js

@@ -1,6 +1,6 @@
 import request from '@/utils/request';
 
-export async function getSubPage (data) {
+export async function getSubPage(data) {
   const res = await request.get('/main/categoryLevel/getSubPage', {
     params: data
   });
@@ -9,7 +9,7 @@ export async function getSubPage (data) {
   }
   return Promise.reject(new Error(res.data.message));
 }
-export async function saveOrUpdate (data) {
+export async function saveOrUpdate(data) {
   const res = await request.post('/main/categoryLevel/saveOrUpdate', data);
   if (res.data.code == 0) {
     return res.data;
@@ -18,15 +18,31 @@ export async function saveOrUpdate (data) {
 }
 
 // 根据父级id查分类树
-export async function getTreeByPid (parentId) {
+export async function getTreeByPid(parentId) {
   const res = await request.get(`/main/categoryLevel/getTreeByPid/${parentId}`);
   if (res.data.code == 0) {
     return res.data;
   }
   return Promise.reject(new Error(res.data.message));
 }
+
+
+
+
+// 根据ids查询物品分类
+export async function getTreeByIds(data) {
+  const res = await request.get(`/pda/main/categoryLevel/pdaTreeByPid`, {
+    params: data
+  });
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+
 // 根据类型查分类树
-export async function getTreeByType (type) {
+export async function getTreeByType(type) {
   const res = await request.get(`/main/categoryLevel/getTreeByType/${type}`);
   if (res.data.code == 0) {
     return res.data;
@@ -35,7 +51,7 @@ export async function getTreeByType (type) {
 }
 
 // 删除分类
-export async function deleteCategory (id) {
+export async function deleteCategory(id) {
   const res = await request.get(`/main/categoryLevel/delete/${id}`);
   if (res.data.code == 0) {
     return res.data;
@@ -43,7 +59,7 @@ export async function deleteCategory (id) {
   return Promise.reject(new Error(res.data.message));
 }
 //根据ID查询分类详情系信息
-export async function getInfoById (id) {
+export async function getInfoById(id) {
   const res = await request.get(`/main/categoryLevel/getById/${id}`);
   if (res.data.code == 0) {
     return res.data;
@@ -54,10 +70,12 @@ export async function getInfoById (id) {
 
 
 // 物品信息列表
-export async function getList (params) {
-  const res = await request.get('/main/category/getList', { params });
+export async function getList(params) {
+  const res = await request.get('/main/category/getList', {
+    params
+  });
   if (res.data.code == 0) {
     return res.data.data;
   }
   return Promise.reject(new Error(res.data.message));
-}
+}

+ 5 - 7
src/components/AssetTree/index.vue

@@ -17,7 +17,7 @@
 </template>
 
 <script>
-  import { getTreeByPid } from '@/api/classifyManage';
+  import { getTreeByIds } from '@/api/classifyManage';
 
   export default {
     props: {
@@ -47,15 +47,14 @@
         type: Boolean,
         default: true
       },
-      id: {
-        type: String,
-        default: '0'
+      treeIds: {
+        type: Array,
+        default: () => []
       },
       nodeKey: {
         type: String,
         default: 'id'
       }
-
     },
     data() {
       return {
@@ -80,7 +79,7 @@
         try {
           this.treeLoading = true;
 
-          const res = await getTreeByPid(this.id);
+          const res = await getTreeByIds({ ids: this.treeIds.join(',') });
           this.treeLoading = false;
           if (res?.code === '0') {
             this.treeList = res.data;
@@ -106,7 +105,6 @@
         this.treeLoading = false;
       },
 
-
       handleNodeClick(data, node) {
         this.$emit('handleNodeClick', data, node);
       },

+ 2 - 2
src/views/inspectionPlan/components/edit.vue

@@ -237,7 +237,7 @@
         ref="equipmentRefs"
         @choose="choose"
         :type="1"
-        :id="['9','1']"
+        :treeIds="['9','1']"
       />
       <productionPlan ref="productionPlanRef" @choose="choose" />
       <workOrder ref="workOrderRef" @choose="choose" />
@@ -270,7 +270,7 @@
 <script>
   import { save, update, planIssued } from '@/api/inspectionPlan';
   import { routeList } from '@/api/aps/index';
-  import EquipmentDialog from '../../../views/inspectionWork/components/EquipmentDialog';
+  import EquipmentDialog from '@/views/inspectionWork/components/EquipmentDialog';
   import productionPlan from './productionPlan';
   import workOrder from './workOrder';
   import produceOrder from './produceOrder';

+ 2 - 2
src/views/inspectionWork/components/EquipmentDialog.vue

@@ -33,7 +33,7 @@
         <el-col :span="6" class="tree_col">
           <AssetTree
             @handleNodeClick="handleNodeClick"
-            :id="id"
+            :treeIds="treeIds"
             :paramsType="'type'"
             ref="treeList"
           />
@@ -76,7 +76,7 @@ export default {
     isAll: {
       default: false 
     },
-    id:{
+    treeIds:{
       default: ()=>{
         return ['9']
       }

+ 139 - 155
src/views/inspectionWork/components/term.vue

@@ -1,148 +1,81 @@
 <template>
   <div>
-    <div class="content_box" v-if="list.length > 0">
-      <div class="content_box_list" v-for="(item, idx) in list" :key="idx">
-        <div class="content_ll_case">
-          <div class="content_ll">
-            <div class="name">质检类型</div>
-            <div>
-              {{ item.categoryLevelName }}
-            </div>
-          </div>
-
-          <div class="content_ll">
-            <div class="name">标准类型</div>
-            <div>
-              {{
-                getDictValue(
-                  '质检标准类型',
-                  item.qualityStandard && item.qualityStandard.type
-                )
-              }}
-            </div>
+    <ele-pro-table
+      ref="table"
+      :columns="columns"
+      :datasource="list"
+      max-height="calc(100vh - 605px)"
+      tool-class="ele-toolbar-form"
+      cache-key="inspectionClassify"
+      row-key="qualityLevelId"
+    >
+      <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.qualityStandardType) }}
+      </template>
+
+      <template v-slot:defaultValue="{ row }">
+        <div style="display: flex">
+          <div
+            v-if="row.textType == 3"
+            style="display: flex; align-items: center"
+          >
+           {{ row.minValue }} {{row.unit}}
+            <span>&nbsp;&nbsp;-</span>
+          {{ row.maxValue }}{{row.unit}}
           </div>
 
-          <div class="content_ll">
-            <div class="name">标准编码</div>
-            <div class="">{{
-              item.qualityStandard && item.qualityStandard.code
-            }}</div>
+          <div v-else >
+          {{ row.defaultValue }} {{row.unit}}
           </div>
 
-          <div class="content_ll">
-            <div class="name">标准名称</div>
-            <div class="">{{
-              item.qualityStandard && item.qualityStandard.name
-            }}</div>
-          </div>
         </div>
-        <el-form ref="form" style="width: 100%">
-          <el-table
-            style="margin-bottom: 22px"
-            :data="
-              item.qualityStandard && item.qualityStandard.parameterStandards
-            "
-            border
-          >
-            <el-table-column
-              :label="
-                item.qualityStandard &&
-                item.qualityStandard.singleWeightDivision ==
-                  'undefined undefined'
-                  ? ''
-                  : item.qualityStandard.singleWeightDivision
-              "
-              align="center"
+      </template>
+
+
+      <template v-slot:qualityResultValue="{ row }">
+        <el-input
+              v-model="row.qualityResultValue"
+            ></el-input>
+      </template>
+
+      <template v-slot:qualityResult="{ row }">
+        <el-select
+              v-model="row.qualityResult"
+              placeholder="请选择"
+              style="width: 100%"
+              clearable
+              :disabled="isDetails"
             >
-              <el-table-column
-                label="参数上限"
-                align="center"
-                v-if="
-                  item.qualityStandard &&
-                  item.qualityStandard.parameterType == 3
-                "
-              >
-                <template slot-scope="scope">
-                  <el-form-item label-width="0" prop="finalValue">
-                    <el-input
-                      clearable
-                      disabled
-                      v-model="scope.row.finalValue"
-                      placeholder="请输入"
-                    />
-                  </el-form-item>
-                </template>
-              </el-table-column>
-              <el-table-column
-                label="参数下限"
-                align="center"
-                v-if="
-                  item.qualityStandard &&
-                  item.qualityStandard.parameterType == 3
-                "
-              >
-                <template slot-scope="scope">
-                  <el-form-item label-width="0" prop="initialValue">
-                    <el-input
-                      clearable
-                      disabled
-                      v-model="scope.row.initialValue"
-                      placeholder="请输入"
-                    />
-                  </el-form-item>
-                </template>
-              </el-table-column>
-              <el-table-column
-                label="默认值"
-                align="center"
-                v-if="
-                  item.qualityStandard &&
-                  item.qualityStandard.parameterType != 3
-                "
-              >
-                <template slot-scope="scope">
-                  <el-form-item label-width="0" prop="defaultValue">
-                    {{ scope.row.defaultValue }}
-                  </el-form-item>
-                </template>
-              </el-table-column>
-            </el-table-column>
-
-            <el-table-column
-              :label="
-                item.qualityStandard &&
-                item.qualityStandard.tolerance == 'undefined undefined'
-                  ? ''
-                  : item.qualityStandard.tolerance
-              "
-              align="center"
-            >
-              <el-table-column label="质检标准" align="center">
-                <template slot-scope="scope">
-                  <el-form-item label-width="0" prop="inspectionStandard">
-                    {{ scope.row.symbol }}
-                    {{ scope.row.toleranceValue }}
-                  </el-form-item>
-                </template>
-              </el-table-column>
-            </el-table-column>
-
-            <el-table-column label="质检结果" align="center">
-              <template slot-scope="scope">
-                <el-input
-                  size="mini"
-                  clearable
-                  :disabled="isDetails"
-                  v-model="scope.row.qualityResults"
-                  placeholder="请输入质检结果"
-                >
-                </el-input>
-              </template>
-            </el-table-column>
-          </el-table>
-        </el-form>
-      </div>
-    </div>
+              <el-option
+                v-for="item in qualityList"
+                :label="item.name"
+                :key="item.value"
+                :value="item.value"
+              />
+            </el-select>
+
+      </template>
+
+      
+    </ele-pro-table>
   </div>
 </template>
 
@@ -178,31 +111,83 @@
     data() {
       return {
         list: [],
-        dictList: []
+        dictList: [],
+
+        
+				qualityList: [{
+						name: '合格',
+						value: 1
+					},
+					{
+						name: '不合格',
+						value: 2
+					},
+					{
+						name: '让步接受',
+						value: 3
+					},
+
+				],
+
+        columns: [
+          {
+            prop: 'categoryLevelName',
+            label: '质检类型',
+            align: 'center',
+            minWidth: 110
+          },
+
+          {
+            prop: 'inspectionName',
+            label: '质检名称',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 110
+          },
+
+          {
+            prop: 'defaultValue',
+            slot: 'defaultValue',
+            label: '工艺参数',
+            align: 'center',
+            minWidth: 180
+          },
+
+          {
+            label: '工艺要求',
+            prop: 'inspectionStandard',
+            formatter: (row, column, cellValue) => {
+              return row.symbol + ' ' + cellValue + ' ' + row.unit;
+            },
+            minWidth: 350
+          },
+
+          {
+            prop: 'qualityResultValue',
+            slot: 'qualityResultValue',
+            label: '质检结果参数',
+            align: 'center',
+            minWidth: 160
+          },
+
+          {
+            prop: 'qualityResult',
+            slot: 'qualityResult',
+            label: '质检结果',
+            align: 'center',
+            minWidth: 100
+          },
+
+        ]
       };
     },
 
     created() {
       this.requestDict('质检标准类型');
-      this.getDictList('mathematical_symbol');
+      // this.getDictList('mathematical_symbol');
     },
 
     methods: {
-      updateOrCreateObjectInArray(array, newObj, idKey = 'id') {
-        // 用来检查是否已存在具有特定 id 的对象
-        const exists = array.some((obj) => obj[idKey] === newObj[idKey]);
-
-        if (exists) {
-          // 如果存在,使用 map 来替换找到的对象
-          return array.map((obj) =>
-            obj[idKey] === newObj[idKey] ? newObj : obj
-          );
-        } else {
-          // 如果不存在,将新对象添加到数组中
-          return [...array, newObj];
-        }
-      },
-
       async getDictList(code) {
         let { data: res } = await getByCode(code);
         this.dictList = res.map((item) => {
@@ -229,7 +214,6 @@
     overflow-y: scroll;
   }
 
-
   .content_ll_case {
     display: flex;
     flex-wrap: wrap;