695593266@qq.com пре 6 месеци
родитељ
комит
70f9d9733b

+ 10 - 2
src/views/produce/components/new_produceOrder.vue

@@ -93,6 +93,8 @@
   import routings from './routings.vue';
   import { isFullscreen } from 'ele-admin';
   import tableColumnsMixin from '@/mixins/tableColumnsMixin';
+  import { pageByCurrentUser } from '@/api/workOrderList';
+
   import {
     getList,
     removeItem,
@@ -109,6 +111,10 @@
         default: () => {
           return null;
         }
+      },
+      activeName: {
+        type: String,
+        default: '0'
       }
     },
     data() {
@@ -442,14 +448,16 @@
           return [];
         }
 
-        console.log(this.taskObj?.id);
+        const URL = this.activeName == '1' ? pageByCurrentUser : workorderPage2;
+
+        // console.log(this.taskObj?.id);
         // if (this.taskObj?.id == '1916800744740663298') {
         //   return getList({
         //     pageNum: page,
         //     size: 1000
         //   });
         // } else {
-        return workorderPage2({
+        return URL({
           pageNum: page,
           size: 5000,
           workOrderId: this.$route.query.workOrderId

+ 39 - 3
src/views/produce/components/workPlan/components/addSample.vue

@@ -150,12 +150,27 @@
         </el-col>
         <el-col :span="8">
           <el-form-item label="质检方式:" prop="qualityMode">
-            <DictSelection
+            <el-select
+              v-model="form.qualityMode"
+              filterable
+              placeholder="请选择"
+              @change="handleQualityModeChange"
+              :disabled="form.isFirstSampling != '1'"
+            >
+              <el-option
+                v-for="item in qualityMode"
+                :label="item.label"
+                :value="item.value"
+                :key="item.value"
+              >
+              </el-option>
+            </el-select>
+            <!-- <DictSelection
               dictName="取样类型"
               v-model="form.qualityMode"
               @change="handleQualityModeChange"
               :disabled="form.isFirstSampling != '1'"
-            ></DictSelection>
+            ></DictSelection> -->
           </el-form-item>
         </el-col>
         <el-col :span="8">
@@ -359,6 +374,7 @@
   import bpmDetail from '@/views/bpm/processInstance/detail.vue';
   import inspectionWorkDialog from './inspectionWorkDialog.vue';
   import { getCodeList, getCode } from '@/api/login';
+  import { getByCode } from '@/api/system/dictionary-data';
   export default {
     components: { bpmDetail, inspectionWorkDialog, processSubmitDialog },
     props: {
@@ -612,7 +628,8 @@
         schemeList: [],
         tableList: [],
         type: 'add',
-        title: ''
+        title: '',
+        qualityMode: []
       };
     },
 
@@ -625,6 +642,7 @@
       async open(type, row) {
         this.activeComp = 'main';
         this.visible = true;
+        await this.getQualityMethodCode();
         this.type = type;
         this.title =
           type == 'add' ? '请样' : type == 'edit' ? '修改请样' : '详情';
@@ -651,6 +669,10 @@
         } else {
           row.sourceCode = row.qualityPlanCode || row.workOrderCode;
           this.form = JSON.parse(JSON.stringify(row));
+
+          console.log(this.qualityMode, 'this.qualityMode');
+          console.log(this.form, 'this.form');
+
           this.form.qualityWorkOrderId = row.id;
           this.form.qualityWorkOrderCode = row.code;
           this.form.qualityWorkOrderName = row.name;
@@ -667,6 +689,19 @@
           );
         }
       },
+
+      async getQualityMethodCode() {
+        let res = await getByCode('quality_method_code');
+        if (res?.code == 0) {
+          console.log(res);
+          let list = res.data.map((item) => {
+            let key = Object.keys(item)[0];
+            return { value: Number(key), label: item[key] };
+          });
+          this.qualityMode = list;
+        }
+      },
+
       getById(id) {
         getById(id).then((res) => {
           this.workSampleQuantity =
@@ -1139,6 +1174,7 @@
       },
 
       handleQualityModeChange(val) {
+        console.log(val, '值');
         if (val == 1) {
           this.updatePackingList();
         } else {

+ 49 - 7
src/views/produce/index.vue

@@ -58,7 +58,27 @@
             </div>
           </el-tab-pane>
 
-          <el-tab-pane label="任务" name="second">
+          <el-tab-pane label="任务" name="1">
+            <div class="custom-tree-node">
+              <!-- <el-tree
+                :data="produceTaskList"
+                :props="defaultProps"
+                node-key="id"
+                :highlight-current="true"
+                @node-click="handleNodeClick"
+                ref="taskListRef"
+                :key="treeKey"
+              >
+                <span class="custom-tree-node" slot-scope="{ node, data }">
+                  <span>{{ node.label }}</span>
+                  <span
+                    style="color: red; font-weight: 700"
+                    v-if="data.number != '0' && data.number"
+                    >({{ data.number >= 100 ? '99+' : data.number }})</span
+                  >
+                </span>
+              </el-tree> -->
+            </div>
             <!-- <AssetTree @handleNodeClick="handleNodeClickNew" @setRootId="setRootId" id="0" :paramsType="'type'"
               ref="treeList" eqDevice="sb" /> -->
             <!-- <el-tree
@@ -153,6 +173,7 @@
                 @workSelect="workSelect"
                 @rowClick="rowClick"
                 ref="produceOrder"
+                :activeName="activeName"
                 @getTaskName="getTaskName"
                 :produceTaskInfo="produceTaskInfo"
               >
@@ -410,6 +431,7 @@
   import { workorderPage2 } from '@/api/produce/workOrder.js';
   import { checkProductionResult } from '@/api/producetaskrulerecord/index.js';
   import qualityInspection from './components/qualityInspection/index.vue';
+  import { pageByCurrentUser } from '@/api/workOrderList';
 
   export default {
     components: {
@@ -536,6 +558,11 @@
     },
     methods: {
       tabClickValue() {
+        // if (this.activeName == '0') {
+        this.getTaskList();
+        // } else if (this.activeName == '1') {
+        // }
+
         this.name = '';
         this.seekInput();
       },
@@ -615,12 +642,9 @@
           taskName: this.taskName
         };
         this.$refs.produceOrder.handleSearch(obj);
-        //handleSearch(this.code);
       },
 
       handleNodeClickNew(info) {
-        // this.current = info;
-
         let current = { id: info.id };
 
         this.$store.commit('user/currentObj', current);
@@ -639,8 +663,6 @@
           this.isPreProductionResult = null;
         }
 
-        console.log(data, 'handleNodeClick');
-
         let obj = {
           1: `${data.workCenterName}-${data.name}(普通工序)`,
           3: `${data.workCenterName}-${data.name}(质检工序)`,
@@ -707,7 +729,11 @@
               });
               this.produceTaskInfo = this.produceTaskList[0];
             }
-            this.getTaskWorkNumber();
+            if (this.activeName == '0') {
+              this.getTaskWorkNumber();
+            } else if (this.activeName == '1') {
+              this.getTaskWorkList();
+            }
           });
         }
       },
@@ -728,6 +754,22 @@
         this.treeKey = Date.now();
       },
 
+      //获取工序下所有的任务集合
+      async getTaskWorkList() {
+        for (const [index, item] of this.taskDataList.entries()) {
+          await pageByCurrentUser({
+            pageNum: 1,
+            size: 5000,
+            taskId: item.id
+          }).then((res) => {
+            this.taskDataList[index].number = res.count;
+          });
+        }
+
+        this.produceTaskList = this.taskDataList;
+        this.treeKey = Date.now();
+      },
+
       // 获取工位
       getFactoryworkstationPageList() {
         factoryworkstationPage({ pageNum: 1, size: 99999999 }).then((res) => {

+ 24 - 21
src/views/produceOrder/workReport.vue

@@ -139,6 +139,7 @@
                     <div v-if="operationType == 'feed'">
                       <!-- 投料 -->
                       <feeding
+                        v-if="isFinalCheckProduction"
                         :workListIds="workListIds"
                         :feedNeedEquipment="feedNeedEquipment"
                         @feedSuccess="feedSuccess"
@@ -804,34 +805,36 @@
             data: [this.workOrderInfo]
           };
 
-          // const result = await this.checkQualityResult();
-
-          // if (result) {
-          //   this.isFinalCheckProduction =
-          //     typeof result.firstArticleDualInspectionResult === 'boolean'
-          //       ? result.firstArticleDualInspectionResult
-          //       : true;
-
-          //   if (!result.firstArticleDualInspectionResult) {
-          //     return this.$message.warning('请完成首件两检再报工!');
-          //   }
-          // }
+          let resultValue = '0';
+          await parameterGetByCode({
+            code: 'first_article_dual_inspection_for_report'
+          }).then((res) => {
+            resultValue = res.value;
+          });
 
-          const result = await this.checkQualityResult();
-          if (!result) return;
+          if (resultValue == '1') {
+            const result = await this.checkQualityResult();
+            if (!result) return;
 
-          const firstArticleResult =
-            result.firstArticleDualInspectionResult ?? true;
+            const firstArticleResult =
+              result.firstArticleDualInspectionResult ?? true;
 
-          this.isFinalCheckProduction = firstArticleResult;
+            this.isFinalCheckProduction = firstArticleResult;
 
-          if (!firstArticleResult) {
-            return this.$message.warning('请完成首件两检再报工!');
+            if (!firstArticleResult) {
+              return this.$message.warning('请完成首件两检再报工!');
+            }
           }
 
-          // console.log(this.workData.list, 'this.workListIds');
-          // console.log(this.taskObj.type, 'this.taskObj');
+          // const isWorkCenter =
+          //   this.$store.state.user.info.workCenterIds.includes(
+          //     this.taskObj.workCenterId
+          //   );
 
+          // if (!isWorkCenter) {
+          //   this.isFinalCheckProduction = false;
+          //   return this.$message.warning('该用户没有权限报工');
+          // }
           if (
             this.taskObj.type == 2 ||
             this.taskObj.type == 3 ||