lucw 6 месяцев назад
Родитель
Сommit
3b84a7674a

+ 13 - 0
src/api/firstarticledualinspectionrecord/index.js

@@ -0,0 +1,13 @@
+import request from '@/utils/request';
+
+// /mes/firstarticledualinspectionrecord/page post
+export async function pageFirstArticleDualInspectionRecord(body) {
+  const res = await request.post(
+    `/mes/firstarticledualinspectionrecord/page`,
+    body
+  );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 11 - 11
src/views/batchRecord/components/plan.vue

@@ -41,7 +41,7 @@
             type="primary"
             :underline="false"
             @click="openEdit('edit', row)"
-            v-if="row.status != 2"
+            v-if="row.status != 2 && row.status != 3"
           >
             修改
           </el-link>
@@ -49,7 +49,7 @@
           <el-link
             type="primary"
             :underline="false"
-            v-if="row.status != 2"
+            v-if="row.status != 2 && row.status != 3"
             @click="openEdit('dispatch', row)"
           >
             派单
@@ -70,7 +70,7 @@
             class="ele-action"
             title="确定要删除此条数据吗?"
             @confirm="deleteRow(row.id)"
-            v-if="row.status != 2"
+            v-if="row.status != 2 && row.status != 3"
           >
             <template v-slot:reference>
               <el-link type="danger" :underline="false"> 删除 </el-link>
@@ -248,7 +248,7 @@
       seekList() {
         return [
           {
-            label: '计划编码',
+            label: '计划单号',
             value: 'code',
             type: 'input',
             placeholder: '请输入'
@@ -259,13 +259,13 @@
             type: 'input',
             placeholder: '请输入'
           },
-          {
-            label: '计划配置单号',
-            value: 'configCode',
-            type: 'input',
-            placeholder: '请输入',
-            labelWidth: 110
-          },
+          // {
+          //   label: '计划配置单号',
+          //   value: 'configCode',
+          //   type: 'input',
+          //   placeholder: '请输入',
+          //   labelWidth: 110
+          // },
           {
             label: '状态',
             value: 'status',

+ 14 - 40
src/views/batchRecord/components/redeployOther.vue

@@ -19,8 +19,8 @@
         class="demo-monitor-tabs"
         @tab-click="handleClickTab"
       >
-        <el-tab-pane label="执行人" name="1" />
-        <el-tab-pane label="班组" name="2" />
+        <el-tab-pane label="执行人" name="0" />
+        <el-tab-pane label="班组" name="1" />
       </el-tabs>
       <div class="select-box">
         <el-form label-width="80px">
@@ -30,7 +30,7 @@
                 <el-input v-model="row.code" disabled></el-input>
               </el-form-item>
             </el-col>
-            <el-col :span="12" v-if="tabValue == 2">
+            <el-col :span="12" v-if="tabValue == '1'">
               <el-form-item label="班组">
                 <el-select
                   v-model="teamId"
@@ -47,7 +47,7 @@
                 </el-select>
               </el-form-item>
             </el-col>
-            <template v-if="tabValue == 1">
+            <template v-if="tabValue == '0'">
               <el-col :span="12">
                 <el-form-item label="部门">
                   <deptSelect v-model="groupId" @changeGroup="deptClick" />
@@ -76,7 +76,7 @@
         </el-form>
       </div>
 
-      <div v-if="tabValue == 1" class="data-tab">
+      <div v-if="tabValue == '0'" class="data-tab">
         <ele-pro-table
           ref="tableRef2"
           row-key="id"
@@ -220,9 +220,9 @@
         if (val == 'transfer') {
           if (row.planExecuteType == '1') {
             // 班组
-            this.tabValue = '2';
-          } else {
             this.tabValue = '1';
+          } else {
+            this.tabValue = '0';
           }
         }
         this.row = row;
@@ -235,19 +235,6 @@
           this.$refs.tableRef2?.clearSelection();
         });
       },
-      // handleDone() {
-      //   console.log('handDone');
-      //   this.$nextTick(() => {
-      //     this.arry.forEach((item) => {
-      //       this.tableData.find((item2) => {
-      //         if (item == item2.id) {
-      //           console.log(item2, 'item2');
-      //           this.$refs.tableRef2.toggleRowSelection(item2, true);
-      //         }
-      //       });
-      //     });
-      //   });
-      // },
       //重置
       reset() {
         this.name = '';
@@ -279,21 +266,6 @@
       handleSelectAll(selection) {
         this.$refs.tableRef2.clearSelection();
       },
-      handleSelectionChange(row) {
-        if (this.tabValue == '1') {
-          if (row.length > 1) {
-            this.$refs.tableRef2.clearSelection();
-            this.$refs.tableRef2.toggleRowSelection(row.pop());
-          }
-          this.selectedRow = row[0];
-        } else {
-          this.selectedRowData = row;
-          let arr = row.map((item) => {
-            return item.id;
-          });
-          this.selectedRowDataId = arr.toString();
-        }
-      },
       headerCellClassName({ columnIndex }) {
         // 如果是第一列(通常是全选框),则返回自定义的class名
         if (columnIndex === 0) {
@@ -302,17 +274,17 @@
         return '';
       },
       async submit() {
-        if (this.tabValue == 1 && this.selection.length == 0) {
+        if (this.tabValue == '0' && this.selection.length == 0) {
           return this.$message.warning('请选择转派人员');
         }
 
-        if (this.tabValue == 2 && !this.teamId) {
+        if (this.tabValue == '1' && !this.teamId) {
           return this.$message.warning('请选择班组');
         }
 
         let executeUser = null;
 
-        if (this.tabValue == 1) {
+        if (this.tabValue == '0') {
           executeUser = this.selection.map((i) => {
             return {
               groupId: i.groupId,
@@ -329,7 +301,9 @@
 
         let params = {
           executeUser,
-          id: this.row.planId
+          id: this.row.planId,
+          // 0个人 1班组
+          type: this.tabValue
         };
         recordrulesplanReManualDispatchOrder(params)
           .then(() => {
@@ -347,7 +321,7 @@
         this.$emit('confirm', this.selectedRow);
       },
       cancel() {
-        this.tabValue = '1';
+        this.tabValue = '0';
         this.selectedRow = {};
         this.selectedRowData = [];
         this.selection = [];

+ 1 - 4
src/views/batchRecord/components/workOrder.vue

@@ -151,10 +151,7 @@
             label: '车间名称',
             align: 'center',
             showOverflowTooltip: true,
-            minWidth: 110,
-            formatter: (row) => {
-              return row.itemTypeName;
-            }
+            minWidth: 110
           },
           {
             prop: 'createTime',

+ 118 - 51
src/views/batchRecord/components/workOrderReport.vue

@@ -72,17 +72,61 @@
             </el-date-picker>
           </el-form-item>
         </el-col>
-        <el-col :span="8">
-          <!-- <el-form-item label="执行人" required prop="teamId">
+        <el-col v-if="!addForm.planExecuteType" :span="8">
+          <el-form-item label="部门">
+            <deptSelect
+              v-model="addForm.groupId"
+              @changeGroup="searchDeptNodeClick"
+            />
+          </el-form-item>
+        </el-col>
+
+        <el-col v-if="!addForm.planExecuteType" :span="8">
+          <el-form-item label="指定负责人" prop="executeUsersIds">
+            <el-select
+              v-model="addForm.executeUsersIds"
+              size="small"
+              style="width: 100%"
+              multiple
+              filterable
+              @change="executeIdListChange"
+            >
+              <el-option
+                v-for="item in executorList"
+                :key="item.id"
+                :value="item.id"
+                :label="item.name"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col v-if="addForm.planExecuteType" :span="8">
+          <!-- <el-form-item label="班组" prop="teamId">
+            <el-select
+              v-model="addForm.teamId"
+              size="small"
+              @change="teamChange"
+              style="width: 100%"
+            >
+              <el-option
+                :value="i.id"
+                :label="i.name"
+                v-for="i in allTeamList"
+                :key="i.id"
+              ></el-option>
+            </el-select>
+          </el-form-item> -->
+          <el-form-item label="执行人" required prop="teamId">
             <el-select
               v-model="addForm.teamId"
               placeholder="请选择班组"
               filterable
               style="width: 120px"
               @change="checkTeamList(addForm.teamId)"
+              disabled
             >
               <el-option
-                v-for="item in teamList"
+                v-for="item in allTeamList"
                 :label="item.name"
                 :value="item.id"
                 :key="item.id"
@@ -109,33 +153,6 @@
               >
               </el-option>
             </el-select>
-          </el-form-item> -->
-
-          <el-form-item label="部门">
-            <deptSelect
-              v-model="addForm.groupId"
-              @changeGroup="searchDeptNodeClick"
-            />
-          </el-form-item>
-        </el-col>
-
-        <el-col :span="8">
-          <el-form-item label="报工人" prop="executeUsersIds">
-            <el-select
-              v-model="addForm.executeUsersIds"
-              size="small"
-              style="width: 100%"
-              multiple
-              filterable
-              @change="executeIdListChange"
-            >
-              <el-option
-                v-for="item in executorList"
-                :key="item.id"
-                :value="item.id"
-                :label="item.name"
-              ></el-option>
-            </el-select>
           </el-form-item>
         </el-col>
 
@@ -315,6 +332,7 @@
   import { producetaskrulerecordSaveOrUpdateAndSubmit } from '@/api/recordRules/index.js';
   import deptSelect from '@/components/CommomSelect/dept-select.vue';
   import { getUserPage } from '@/api/system/organization';
+  import { getteampage } from '@/api/workforceManagement/team';
 
   export default {
     mixins: [dictMixins],
@@ -392,7 +410,8 @@
         recordRulesExecuteMethodId: null,
         recordRulesExecuteMethodName: '',
         // 	产出类型 1-原材料,2-在制品,3.BOM标准产出
-        outputType: 1
+        outputType: 1,
+        planExecuteType: 0
       };
 
       return {
@@ -487,7 +506,8 @@
           { label: '物料统计', value: '2' },
           { label: '工序统计', value: '3' }
         ],
-        executorList: []
+        executorList: [],
+        allTeamList: []
       };
     },
     computed: {
@@ -577,6 +597,7 @@
       }
       // 获取审核人列表、巡点检人员
       this.getUserList();
+      this.getAllTeamList();
     },
     methods: {
       // 外部调用,打开弹窗
@@ -602,15 +623,19 @@
             i.checkUsersIds = i.checkUsers.map((j) => j.userId);
             if (i.checkUsersIds.length == 0 && data.executeUsers.length > 0) {
               // 默认执行人作为检查人
-              i.checkUsersIds = data.executeUsers.map((j) => j.userId);
-              i.checkUsers = data.executeUsers.map((j) => {
-                return {
-                  teamId: j.teamId,
-                  teamName: j.teamName,
-                  userId: j.userId,
-                  userName: j.userName
-                };
-              });
+              i.checkUsersIds = data.executeUsers
+                .filter((i) => i.userId)
+                .map((j) => j.userId);
+              i.checkUsers = data.executeUsers
+                .filter((i) => i.userId)
+                .map((j) => {
+                  return {
+                    teamId: j.teamId,
+                    teamName: j.teamName,
+                    userId: j.userId,
+                    userName: j.userName
+                  };
+                });
             }
             return i;
           });
@@ -618,18 +643,35 @@
           console.log('this.addForm', this.addForm);
 
           // 处理数据
-          this.addForm.executeUsersIds = this.addForm.executeUsers.map(
-            (i) => i.userId
-          );
+          this.addForm.executeUsersIds = this.addForm.executeUsers
+            .map((i) => i.userId)
+            .filter((i) => i); // 过滤掉 undefined
 
           this.addForm.teamId =
             this.addForm.executeUsers.length > 0
               ? this.addForm.executeUsers[0].teamId
               : '';
 
-          if (this.addForm.executeUsers.length > 0) {
-            this.addForm.groupId = this.addForm.executeUsers[0]?.groupId || '';
-            this.searchDeptNodeClick(this.addForm.groupId);
+          if (
+            this.addForm.executeUsers.length > 0 &&
+            !this.addForm.planExecuteType
+          ) {
+            let groupIds = this.addForm.executeUsers
+              .map((i) => i.groupId)
+              .filter(
+                (item, index, arr) => arr.indexOf(item) === index && item
+              );
+
+            if (groupIds.includes('1')) {
+              this.addForm.groupId = '1';
+            } else {
+              this.addForm.groupId =
+                this.addForm.executeUsers[0]?.groupId + '' || '1';
+            }
+
+            if (this.addForm.groupId) {
+              this.searchDeptNodeClick(this.addForm.groupId);
+            }
           }
 
           if (!this.addForm.teamId && this.teamList.length > 0) {
@@ -918,23 +960,48 @@
       },
       // 负责人变更 同步执行人列表
       executeIdListChange() {
-        this.addForm.executeUsers = this.addForm.executeUsersIds.map(
-          (userId) => {
+        this.addForm.executeUsers = this.addForm.executeUsersIds
+          .map((userId) => {
             const user = this.executorList.find((u) => u.id === userId);
+            if (!user) return null;
             return {
               userId: user.id,
               userName: user.name,
               groupId: user.groupId,
               groupName: user.groupName
             };
-          }
-        );
+          })
+          .filter((i) => i);
         // 同步详情执行人
         this.addForm.details.forEach((detail) => {
           detail.checkUsersIds = this.addForm.executeUsersIds;
           detail.checkUsers = this.addForm.executeUsers;
         });
         console.log('this.addForm.executeUsers', this.addForm.executeUsers);
+      },
+      async getAllTeamList() {
+        const { list } = await getteampage({
+          pageNum: 1,
+          size: -1
+        });
+        console.log('teamAllList 班组', list);
+        this.allTeamList = list;
+      },
+      teamChange() {
+        console.log('this.addForm.teamId', this.addForm.teamId);
+        // 当前班组
+        const currentTeam = this.allTeamList.find(
+          (item) => item.id === this.addForm.teamId
+        );
+        if (currentTeam) {
+          // 同步执行人
+          this.addForm.executeUser = [
+            {
+              teamId: currentTeam.id,
+              teamName: currentTeam.name
+            }
+          ];
+        }
       }
     }
   };

+ 7 - 1
src/views/produce/components/footBtn.vue

@@ -2,7 +2,7 @@
   <div class="foot_box">
     <template v-for="(item, index) in btnListData">
       <div
-        v-if="$hasPermission(item.isShow)"
+        v-if="!item.isShow || $hasPermission(item.isShow)"
         :key="index"
         class="btn"
         :style="{ background: item.disable ? '#858585' : item.bjColor }"
@@ -35,6 +35,12 @@
     data() {
       return {
         btnList1: [
+          {
+            name: '首件两检',
+            type: 'qualityInspection',
+            bjColor: '#920077',
+            isShow: ''
+          },
           {
             name: '产前准备',
             type: 'prenatalExamination',

+ 17 - 9
src/views/produce/components/qualityInspection/index.vue

@@ -9,16 +9,12 @@
       <!-- <el-button type="primary" plain round @click="openMaintenancePlan">
         设备保养计划
       </el-button> -->
-      <div
-        v-if="loading || ruleRecordsList.length > 0"
-        class="step-list"
-        v-loading="loading"
-      >
+      <div v-if="loading" class="step-list" v-loading="loading">
         <ele-pro-table
           ref="table"
           row-key="id"
           :columns="columns"
-          :datasource="ruleRecordsList"
+          :datasource="list"
           cache-key="mes-ruleRecordsList-2511172018"
           autoAmendPage
           :need-page="false"
@@ -52,6 +48,7 @@
     getLastRuleRecords,
     getProduceTaskInstanceId
   } from '@/api/producetaskrulerecord/index.js';
+  import { pageFirstArticleDualInspectionRecord } from '@/api/firstarticledualinspectionrecord/index.js';
 
   import dictMixins from '@/mixins/dictMixins';
   import tableColumnsMixin from '@/mixins/tableColumnsMixin';
@@ -62,7 +59,11 @@
     data() {
       return {
         dialogVisible: false,
-        loading: true
+        loading: true,
+        produceTaskInfo: null,
+        workOrder: null,
+        butLoad: false,
+        list: []
       };
     },
     computed: {
@@ -134,7 +135,11 @@
       }
     },
     methods: {
-      open() {
+      open(workOrder, produceTaskInfo) {
+        this.workOrder = workOrder;
+        this.produceTaskInfo = produceTaskInfo;
+        console.log('this.workOrder', this.workOrder);
+        console.log('this.produceTaskInfo', this.produceTaskInfo);
         this.dialogVisible = true;
       },
       executeStatusTest(status) {
@@ -148,7 +153,10 @@
         }
       },
       // 获取数据
-      async getData() {},
+      async getData() {
+        const data = await pageFirstArticleDualInspectionRecord({});
+        this.list = data.list || [];
+      },
       handleClose() {
         this.dialogVisible = false;
         this.$emit('close');

+ 20 - 1
src/views/produce/index.vue

@@ -355,6 +355,9 @@
 
     <!-- 新增请托 -->
     <addPlease ref="addPleaseRef" @refresh="refreshPlease"></addPlease>
+
+    <!-- qualityInspection  -->
+    <qualityInspection ref="qualityInspectionRef"></qualityInspection>
   </div>
 </template>
 
@@ -406,6 +409,7 @@
   import prenatalExamination from './components/prenatalExamination/index.vue';
   import { workorderPage2 } from '@/api/produce/workOrder.js';
   import { checkProductionResult } from '@/api/producetaskrulerecord/index.js';
+  import qualityInspection from './components/qualityInspection/index.vue';
 
   export default {
     components: {
@@ -433,7 +437,8 @@
       BomDetailsPop,
       prenatalExamination,
       pleaseEntrust,
-      addPlease
+      addPlease,
+      qualityInspection
     },
     data() {
       return {
@@ -1099,6 +1104,20 @@
             reportWorkType
           );
         }
+
+        // 首件两检
+        if (t == 'qualityInspection') {
+          if (this.workListIds.length < 1) {
+            return this.$message.warning('请选择工单!');
+          }
+          if (this.workListIds.length > 1) {
+            return this.$message.warning('首件两检只能选择一个工单!');
+          }
+          this.$refs.qualityInspectionRef.open(
+            this.workData.list[0],
+            this.produceTaskInfo
+          );
+        }
       },
 
       outsourcingAdd(type, activeName) {

+ 2 - 2
vue.config.js

@@ -32,11 +32,11 @@ module.exports = {
       // 当我们的本地的请求 有/api的时候,就会代理我们的请求地址向另外一个服务器发出请求
       '/api': {
         // target: 'http://124.71.68.31:50001',
-        target: 'http://192.168.1.125:18086',
+        // target: 'http://192.168.1.125:18086',
         // target: 'http://192.168.1.251:18086',
         // target: 'http://192.168.1.251:18086',
         // target: 'http://192.168.1.125:18086',
-        // target: 'http://192.168.1.116:18086', // 赵沙金
+        target: 'http://192.168.1.116:18086', // 赵沙金
         // target: 'http://192.168.1.251:18086', // 开发环境
         // target: 'http://192.168.1.103:18086',192.168.1.116
         // target: 'http://192.168.1.144:18086',