695593266@qq.com 1 год назад
Родитель
Сommit
a57fb6883e

+ 1 - 1
src/views/outsourcing/components/details.vue

@@ -243,7 +243,7 @@
           },
           {
             label: '重量',
-            prop: 'extInfo.newWeight',
+            prop: 'totalWeight',
             align: 'center'
           },
 

+ 26 - 7
src/views/outsourcing/index.vue

@@ -52,6 +52,17 @@
           }}</el-tag>
         </template>
 
+        <template v-slot:approvalStatus="{ row }">
+          <el-tag v-if="row.approvalStatus == 0">未提交</el-tag>
+          <el-tag v-if="row.approvalStatus == 1" type="warning">审核中</el-tag>
+          <el-tag v-if="row.approvalStatus == 2" type="success"
+            >审核通过</el-tag
+          >
+          <el-tag v-if="row.approvalStatus == 3" type="danger"
+            >审核不通过</el-tag
+          >
+        </template>
+
         <template v-slot:outsourceScene="{ row }">
           <span>{{ row.outsourceScene | outsourceSceneText }}</span>
         </template>
@@ -85,13 +96,13 @@
         </template>
 
         <template v-slot:action="{ row }">
-          <el-link
+          <!-- <el-link
             type="primary"
             :underline="false"
             @click="handleDetails(row)"
           >
             详情
-          </el-link>
+          </el-link> -->
 
           <el-link
             type="primary"
@@ -246,11 +257,6 @@
             align: 'center',
             showOverflowTooltip: true
           },
-          {
-            prop: 'remark',
-            label: '备注',
-            align: 'center'
-          },
 
           {
             slot: 'requireDeliveryTime',
@@ -284,6 +290,13 @@
             label: '状态',
             align: 'center'
           },
+          {
+            slot: 'approvalStatus',
+            label: '审核状态',
+            align: 'center',
+            showOverflowTooltip: true,
+            width: 120
+          },
 
           {
             label: '图片附件',
@@ -299,6 +312,12 @@
             minWidth: 100
           },
 
+          {
+            prop: 'remark',
+            label: '备注',
+            align: 'center'
+          },
+
           {
             columnKey: 'action',
             label: '操作',

+ 1 - 1
src/views/produce/components/feeding/details.vue

@@ -23,7 +23,7 @@
               class="time"
               v-if="item.executorList && item.executorList.length != 0"
               >执行人:<span v-for="it in item.executorList"
-                >【{{ item.name }}】</span
+                >【{{ it.name }}】</span
               >
             </div>
           </div>

+ 48 - 14
src/views/produce/components/feeding/index.vue

@@ -50,7 +50,7 @@
                 type="text"
                 size="mini"
                 @click="openPicking(item.workOrderId, item)"
-                >手动添加</el-button
+                >添加设备</el-button
               >
               <el-button
                 type="text"
@@ -104,7 +104,13 @@
               placeholder="请选择执行人"
               filterable
               multiple
+              @change="changeId"
             >
+              <div class="checkboxWrapper">
+                <el-checkbox v-model="checked" @change="checkChange">
+                  全选
+                </el-checkbox>
+              </div>
               <el-option
                 v-for="item in teamUserList"
                 :label="item.name"
@@ -174,7 +180,7 @@
             :equipmentList="item.equipmentList"
             :currentTaskDiagram="item.currentTaskDiagram"
             :workInfo="item"
-            :title="物料清单"
+            title="物料清单"
           >
           </instanceBom>
 
@@ -185,7 +191,7 @@
             :equipmentList="item.equipmentList"
             :currentTaskDiagram="item.currentTaskDiagram"
             :workInfo="item"
-            :title="备料清单"
+            title="备料清单"
           >
           </instanceBom>
 
@@ -348,7 +354,8 @@
         teamUserList: [],
         executorIdList: [],
         teamId: '',
-        isDefaultExecutor: false
+        isDefaultExecutor: false,
+        checked: false
       };
     },
     mounted() {
@@ -504,7 +511,7 @@
           this.isDefaultExecutor = res.value == '1' ? true : false;
 
           if (this.isDefaultExecutor) {
-            // this.setDefaultIdList();
+            this.setDefaultIdList();
           }
         });
       },
@@ -524,6 +531,14 @@
         }
       },
 
+      changeId() {
+        if (this.executorIdList.length == this.teamUserList.length) {
+          this.checked = true;
+        } else {
+          this.checked = false;
+        }
+      },
+
       checkTeamList(id) {
         this.executorIdList = [];
         const index = this.teamList.findIndex((item) => item.id == id);
@@ -616,6 +631,15 @@
         });
       },
 
+      checkChange() {
+        if (this.checked) {
+          this.executorIdList = [];
+          this.executorIdList = this.teamUserList.map((item) => item.id);
+        } else {
+          this.executorIdList = [];
+        }
+      },
+
       getCacheFn() {
         let parma = {
           workOrderIds: this.idsList,
@@ -664,15 +688,14 @@
         const executorList = [];
 
         this.executorIdList.forEach((item) => {
-          this.teamUserList.forEach((it) => {
-            if (item == it.id) {
-              executorList.push({
-                userId: it.id,
-                jobNumber: it.jobNumber,
-                name: it.name
-              });
-            }
-          });
+          const data = this.teamUserList.find((it) => it.id == item);
+          if (data) {
+            executorList.push({
+              userId: data.id,
+              jobNumber: data.jobNumber,
+              name: data.name
+            });
+          }
         });
 
         this.List = this.List.map((item) => {
@@ -680,6 +703,11 @@
           return item;
         });
 
+        // this.List = this.List.map((item) => {
+        //   item.executorList = executorList;
+        //   return item;
+        // });
+
         let deviceIs = false;
         this.List.forEach((f) => {
           f.instanceList.forEach((e) => {
@@ -723,6 +751,7 @@
             this.$message.success('投料成功');
             this.getList(this.idsList);
             this.executorIdList = [];
+            this.checked = false;
             this.teamId = '';
             this.$emit('feedSuccess', 'success');
           })
@@ -787,6 +816,11 @@
     border-radius: 2px;
   }
 
+  .checkboxWrapper {
+    padding: 8px 20px;
+    border-bottom: 1px solid #ccc;
+  }
+
   ::v-deep .el-select__tags {
     flex-wrap: nowrap;
     overflow: auto;

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

@@ -87,7 +87,7 @@
           //   name: 'BOM',
           //   type: 'bom',
           //   bjColor: '#BB5500'
-          // },
+          // }
           // {
           //   name: '设备',
           //   type: 'device',
@@ -246,6 +246,7 @@
         //   this.btnList[1].name = '投料';
         //   this.btnList[1].type = 'feed';
         // }
+        console.log(val);
         if (
           this.clientEnvironmentId == 3 &&
           (this.taskObj.type == 3 || this.taskObj.type == 6)

+ 8 - 4
src/views/produce/components/jobBooking/components/batchSemiProductJobBom.vue

@@ -683,9 +683,9 @@
       }
     },
     computed: {
-      clientEnvironmentId() {
-        return this.$store.state.user.info.clientEnvironmentId;
-      },
+      // clientEnvironmentId() {
+      //   return this.$store.state.user.info.clientEnvironmentId;
+      // },
       taskObj() {
         return this.$store.state.user.taskObj;
       },
@@ -812,7 +812,7 @@
                 ? '半成品'
                 : row.rootCategoryLevelId == 9
                 ? '产品'
-                : item.rootCategoryLevelId == 28
+                : row.rootCategoryLevelId == 28
                 ? '废品'
                 : '';
             }
@@ -970,6 +970,9 @@
       if (this.list.length > 0) {
         this.oldList = this.list;
       }
+
+      this.clientEnvironmentId =
+        this.$store.state.user.info.clientEnvironmentId;
       console.log(this.list, 'this.list ');
     },
 
@@ -985,6 +988,7 @@
         reportWeight: 0,
         columnsVersion: 0,
         paramList: [],
+        clientEnvironmentId: '',
 
         resultObj: {},
         resultIdx: 0,

+ 1 - 1
src/views/produce/components/jobBooking/components/detailPackagingGrouping.vue

@@ -513,7 +513,7 @@
         this.objData.semiProductList &&
         this.objData.semiProductList.length != 0
       ) {
-        this.totalNumber = this.objData.product.reduce((acc, pro) => {
+        this.totalNumber = this.objData.semiProductList.reduce((acc, pro) => {
           return pro.feedQuantity ? acc + Number(pro.feedQuantity) : acc;
         }, 0);
       }

+ 40 - 17
src/views/produce/components/jobBooking/components/oneJobQualityBomPL.vue

@@ -181,7 +181,11 @@
           <div
             class="material"
             :key="$index"
-            v-if="row.extInfo.batchReportInfo?row.extInfo.batchReportInfo.length > 0:false"
+            v-if="
+              row.extInfo.batchReportInfo
+                ? row.extInfo.batchReportInfo.length > 0
+                : false
+            "
           >
             <div class="btn_end">
               <div class="content_table2">
@@ -206,7 +210,7 @@
                         class="content_num"
                         size="mini"
                         v-model="it.allFeedQuantity"
-                        @input="blurNum(it, $index, yyIdx)"
+                        @input="blurNum2(it, $index, yyIdx)"
                         type="number"
                       ></el-input>
                     </div>
@@ -251,7 +255,11 @@
           <div
             class="material"
             :key="$index"
-            v-if="row.extInfo.batchReportInfo?row.extInfo.batchReportInfo.length == 0:false"
+            v-if="
+              row.extInfo.batchReportInfo
+                ? row.extInfo.batchReportInfo.length == 0
+                : false
+            "
           >
             <div style="display: flex; align-items: center">
               质检结果: &nbsp;&nbsp;&nbsp;
@@ -296,7 +304,12 @@
               </el-select>
             </div>
 
-            <div class="btn_start" v-if="row.extInfo.qualityParam && row.extInfo.qualityParam.length > 0">
+            <div
+              class="btn_start"
+              v-if="
+                row.extInfo.qualityParam && row.extInfo.qualityParam.length > 0
+              "
+            >
               <div class="content_table2" style="margin-top: 6px">
                 <div class="head row rx-sc">
                   <div class="item ww15"> 质检类型</div>
@@ -310,7 +323,7 @@
                 <div class="table">
                   <div
                     class="tr row rx-sc"
-                    v-for="(quaItem, quaItemIdx) in  row.extInfo.qualityParam"
+                    v-for="(quaItem, quaItemIdx) in row.extInfo.qualityParam"
                     :key="quaItemIdx"
                   >
                     <div class="item ww15">
@@ -339,7 +352,9 @@
                     >
 
                     <div class="item ww20 rx-cc">
-                      <div v-if="isDetails">{{ quaItem.qualityResultValue }}</div>
+                      <div v-if="isDetails">{{
+                        quaItem.qualityResultValue
+                      }}</div>
                       <el-input
                         v-else
                         class="content_num"
@@ -488,15 +503,25 @@
       },
 
       blurNum2(it, idx, yyIdx) {
+        // console.log(it.sample, 'it.sample');
         let value = it.sample;
-        value = value.replace(/\./g, '');
-
-        if (
-          Number(value) >
-          Number(this.list[idx].extInfo.batchReportInfo[yyIdx].allFeedQuantity)
-        ) {
-          this.$set(this.list[idx].extInfo.batchReportInfo[yyIdx], 'sample', 0);
-          this.$forceUpdate();
+        if (value) {
+          let value = it.sample;
+          value = value.replace(/\./g, '');
+
+          if (
+            Number(value) >
+            Number(
+              this.list[idx].extInfo.batchReportInfo[yyIdx].allFeedQuantity
+            )
+          ) {
+            this.$set(
+              this.list[idx].extInfo.batchReportInfo[yyIdx],
+              'sample',
+              0
+            );
+            this.$forceUpdate();
+          }
         }
       },
 
@@ -533,9 +558,7 @@
           taskObj.taskTypeName
         );
         this.$forceUpdate();
-      },
-
-
+      }
     },
 
     created() {

+ 12 - 11
src/views/produce/components/jobBooking/components/semiProductJobBom.vue

@@ -636,7 +636,8 @@
         },
         dialogVisible: false,
         dialogEngrave: false,
-        columnsVersion: 0
+        columnsVersion: 0,
+        clientEnvironmentId: ''
       };
     },
 
@@ -655,7 +656,7 @@
         immediate: true,
         deep: true,
         handler(newVal) {
-          console.log('aaaaaa2', newVal);
+          console.log('7878979797', newVal);
 
           if (newVal.length) {
             console.log(newVal);
@@ -760,7 +761,7 @@
                 ? '半成品'
                 : row.rootCategoryLevelId == 9
                 ? '产品'
-                : item.rootCategoryLevelId == 28
+                : row.rootCategoryLevelId == 28
                 ? '废品'
                 : '';
             }
@@ -907,10 +908,10 @@
             showOverflowTooltip: true
           }
         ];
-      },
-      clientEnvironmentId() {
-        return this.$store.state.user.info.clientEnvironmentId;
       }
+      // clientEnvironmentId() {
+      //   return this.$store.state.user.info.clientEnvironmentId;
+      // }
     },
     created() {
       this.getTaskFn();
@@ -923,11 +924,11 @@
       if (this.list.length > 0) {
         this.oldList = this.list;
       }
-      // this.list.forEach((item, index) => {
-      //   if (!item.extInfo.engrave) {
-      //     item.extInfo.engrave = index + 1;
-      //   }
-      // });
+
+      this.clientEnvironmentId =
+        this.$store.state.user.info.clientEnvironmentId;
+
+      console.log(this.clientEnvironmentId);
       console.log(this.item, 'this.itemitemitems');
     },
 

+ 0 - 893
src/views/produce/components/jobBooking/components/semiProductJobBomCopy.vue

@@ -1,893 +0,0 @@
-<template>
-  <div>
-    <div class="title_box rx-bc mt6">
-
-      <div class="name">报工信息({{ list.length || 0 }})个 </div>
-
-      <div class="rx-bc"><el-button type="text" size="mini" @click="batchDelete()">批量删除</el-button> </div>
-    </div>
-    <el-table ref="oneJobQualityBom" class="table_content" :max-height="600" :data="list" tooltip-effect="dark"
-      style="width: 100%" stripe border  @selection-change="tableDataSelectChange">
-      <el-table-column
-          type="selection"
-          align="center"
-          width="55">
-      </el-table-column>
-      <el-table-column label="序号" type="index" width="55">
-        <template slot-scope="{ row, $index }">
-          {{ $index + 1 }}
-        </template>
-      </el-table-column>
-
-
-
-      <el-table-column label="编码" prop="code" minWidth="110">
-        <template slot-scope="{ row, $index }">
-          {{ row.code }}
-        </template>
-      </el-table-column>
-
-      <el-table-column label="名称" prop="name" minWidth="140">
-        <template slot-scope="{ row, $index }">
-          {{ row.name }}
-        </template>
-      </el-table-column>
-      <el-table-column label="物品分类" type="rootCategoryLevelId" minWidth="90">
-        <template slot-scope="{ row, $index }">
-            {{
-              row.rootCategoryLevelId == 2
-                ? '在制品'
-                : row.rootCategoryLevelId == 23
-                ? '半成品'
-                : row.rootCategoryLevelId == 9
-                ? '产品'
-                : item.rootCategoryLevelId == 28
-                ? '废品'
-                : ''
-            }}
-        </template>
-      </el-table-column>
-
-
-
-
-      <el-table-column v-if="singleReport == 1" label="刻码" prop="engrave">
-        <template slot-scope="{ row, $index }">
-          <span v-if="isDetails">{{ row.extInfo.engrave }}</span>
-          <el-input v-else size="mini" class="content_num" v-model="row.extInfo.engrave" placeholder="刻码" />
-        </template>
-      </el-table-column>
-      <el-table-column label="序列号" prop="productSequence">
-        <template slot-scope="{ row, $index }">
-          {{ row.extInfo?.productSequence }}
-        </template>
-      </el-table-column>
-      <el-table-column label="发货条码" prop="sendCode">
-        <template slot-scope="{ row, $index }">
-          <el-input size="mini" class="content_num" v-model="row.extInfo.sendCode" placeholder="发货条码"
-            :disabled="isDetails" />
-        </template>
-      </el-table-column>
-      <el-table-column v-if="singleReport == 1" label="物料代号" prop="materielCode">
-        <template slot-scope="{ row, $index }">
-          <span v-if="isDetails">{{ row.extInfo.materielCode }}</span>
-          <el-input v-else size="mini" class="content_num" v-model="row.extInfo.materielCode" placeholder="物料代号" />
-        </template>
-      </el-table-column>
-      <el-table-column label="客户代号" prop="clientCode"  v-if="item.singleReport == 1">
-        <template slot-scope="{ row, $index }">
-          <span v-if="isDetails"> {{ row.extInfo.clientCode }}</span>
-          <el-input
-            v-else
-            size="mini"
-            class="content_num"
-            v-model="row.extInfo.clientCode"
-            placeholder="请输入客户代号"
-          />
-        </template>
-      </el-table-column>
-
-
-      <el-table-column v-if="singleReport == 1 && deviceList.length > 0" width="140" label="设备" prop="deviceId">
-        <template slot-scope="{ row, $index }">
-          <el-select
-            class="content_num"
-            v-model="row.deviceId"
-            filterable
-            placeholder="请选择"
-            @change="(e) => selectVal(e, row, $index)"
-            size="mini"
-            :disabled="isDetails"
-          >
-            <el-option
-              v-for="item in deviceList"
-              :label="item.name + '-' + item.codeNumber"
-              :value="item.id || item.instanceId"
-              :key="item.id || item.instanceId"
-            >
-            </el-option>
-          </el-select>
-          <!-- {{ row.deviceName || row.extInfo.deviceName }} -->
-        </template>
-      </el-table-column>
-
-      <el-table-column v-if="singleReport == 1 && deviceList.length > 0" label="炉次号" width="90" prop="heatNumber">
-        <template slot-scope="{ row, $index }">
-          <el-input size="mini" class="content_num" v-model="row.extInfo.heatNumber" placeholder="请输入炉次号" :disabled="isDetails"/>
-        </template>
-      </el-table-column>
-
-      <el-table-column v-if="singleReport == 1" label="数量" width="90" prop="feedQuantity">
-        <template slot-scope="{ row, $index }">
-          <el-input size="mini" class="content_num" v-model="row.feedQuantity" :disabled="isDetails" placeholder="数量" />
-        </template>
-      </el-table-column>
-
-      <el-table-column v-if="singleReport == 1" label="位置" width="110" prop="position">
-        <template slot-scope="{ row, $index }">
-          <span v-if="isDetails">{{ row.extInfo.position }}</span>
-          <el-input v-else size="mini" class="content_num" v-model="row.extInfo.position" placeholder="位置" />
-        </template>
-      </el-table-column>
-
-      <el-table-column v-if="singleReport == 1" label="上道工序重量" width="180" prop="weight">
-        <template slot-scope="{ row, $index }">
-          <div style="display: flex;align-items: center">
-            <div class="tag_box">{{ row.extInfo.newWeight ? '上' : '原' }}</div>
-            <span v-if="Object.prototype.hasOwnProperty.call(row.extInfo, 'newWeight')">{{
-              row.extInfo.newWeight
-            }}</span>
-
-            <el-input v-if="!Object.prototype.hasOwnProperty.call(row.extInfo, 'newWeight')" size="mini"
-              class="content_num2" style="width: 100px;" v-model="row.extInfo.weight" :disabled="isDetails"
-              prop="digit" />
-              <div style="width: 55px;">{{ row.weightUnit }}</div>
-          </div>
-        </template>
-      </el-table-column>
-
-      <el-table-column v-if="singleReport == 1" label="报工重量" width="150" prop="reportWeight">
-        <template slot-scope="{ row, $index }">
-          <div style="display: flex;align-items: center">
-            <span v-if="isDetails">{{ row.extInfo.reportWeight }}</span>
-            <el-input v-else size="mini" class="content_num" type="number" v-model="row.extInfo.reportWeight"
-              placeholder="报工重量" prop="digit" @input="handleInput" />
-            <div style="width: 55px;">{{ row.weightUnit }}</div>
-          </div>
-
-        </template>
-      </el-table-column>
-
-      <el-table-column v-if="singleReport == 1" label="是否合格" width="110" prop="isQualified">
-        <template slot-scope="{ row, $index }">
-          <el-select size="mini" class="content_num" v-model="row.extInfo.isQualified" @change="handlerSelect"
-            filterable placeholder="请选择" :disabled="isDetails">
-            <el-option v-for="item in isQualifiedList" :label="item.name" :value="item.code" :key="item.code">
-            </el-option>
-          </el-select>
-
-        </template>
-      </el-table-column>
-
-
-      <el-table-column v-if="singleReport == 1" label="不合格品处置类型" width="160" prop="notType">
-        <template slot-scope="{ row, $index }">
-          <el-select v-if="row.extInfo.isQualified && row.extInfo.isQualified == 2" size="mini" class="content_num"
-            v-model="row.extInfo.notType" filterable placeholder="请选择" :disabled="isDetails">
-            <el-option v-for="item in notTypeList" :label="item.name" :value="item.code" :key="item.code">
-            </el-option>
-          </el-select>
-
-        </template>
-      </el-table-column>
-
-
-      <!-- <el-table-column
-        label="质检结果"
-        width="80"
-        prop=""
-        v-if="item.currentTaskDiagram.isFirstTask == 1"
-      >
-        <template slot-scope="{ row, $index }">
-          <div @click="openNumerate(row, $index)" v-if="![1,2,3,4].includes(Number(row.extInfo.notType))">
-            <div class="numerate">点击计算</div>
-          </div>
-        </template>
-      </el-table-column> -->
-      <!-- label="/" -->
-      <el-table-column width="130" prop="taskName">
-        <template slot="header" slot-scope="scope">
-          <div>
-            不良原因<span style="color: #f00;padding: 0 2px;">/</span>处置
-          </div>
-        </template>
-        <template slot-scope="{ row, $index }">
-          <div v-if="row.extInfo.isQualified != 1 && row.extInfo.notType && row.extInfo.notType != 5">
-            <span v-if="isDetails">{{ row.extInfo.notReason }}</span>
-            <el-input v-else size="mini" class="content_num" v-model="row.extInfo.notReason" placeholder="原因" />
-          </div>
-          <div v-if="![1, 2, 3, 4].includes(Number(row.extInfo.notType))">
-            <span v-if="isDetails">{{ row.extInfo.taskName }}</span>
-            <el-select v-else size="mini" class="content_num" v-model="row.extInfo.taskId" filterable placeholder="请选择"
-              @change="(e) => selectName(e, $index)">
-              <el-option v-for="item in stepsList" :label="item.taskTypeName" :value="item.taskId" :key="item.taskId">
-              </el-option>
-            </el-select>
-          </div>
-        </template>
-      </el-table-column>
-
-      <el-table-column label="次数" prop="index" width="80">
-        <template slot-scope="{ row, $index }">
-          <div class="tag_box" v-if="
-            Object.prototype.hasOwnProperty.call(row, 'extInfo') &&
-            Object.prototype.hasOwnProperty.call(
-              row.extInfo,
-              'productionTimes'
-            ) &&
-            Object.prototype.hasOwnProperty.call(
-              row.extInfo.productionTimes,
-              item.currentTaskDiagram.taskId
-            )
-          ">
-            {{ row.extInfo.productionTimes[item.currentTaskDiagram.taskId] }}
-          </div>
-
-          <div class="tag_box" v-if="row.isCache">缓</div>
-        </template>
-      </el-table-column>
-
-      <el-table-column label="型号" prop="modelType">
-        <template slot-scope="{ row, $index }">
-          {{ row.modelType }}
-        </template>
-      </el-table-column>
-
-      <el-table-column label="规格" prop="specification">
-        <template slot-scope="{ row, $index }">
-          {{ row.specification }}
-        </template>
-      </el-table-column>
-
-      <el-table-column label="牌号" prop="brandNum">
-        <template slot-scope="{ row, $index }">
-          {{ row.brandNum }}
-        </template>
-      </el-table-column>
-      <el-table-column label="数量" prop="feedQuantity">
-        <template slot-scope="{ row, $index }">
-          {{ row.feedQuantity }}
-        </template>
-      </el-table-column>
-
-      <!-- <el-table-column label="包装库存" prop="brandNum">
-        <template slot-scope="{ row, $index }">
-          {{ row.packingCountBase }}/ {{ row.minUnit }}
-        </template>
-      </el-table-column> -->
-
-
-      <el-table-column label="操作" fixed="right" width="60px" v-if="!isDetails">
-        <template slot-scope="{ $index, row }">
-          <el-link type="danger" @click="getDelete($index)">删除</el-link>
-        </template>
-      </el-table-column>
-    </el-table>
-
-    <el-dialog title="工序计算列表" :visible.sync="show" :before-close="cancel" :close-on-click-modal="false"
-      :close-on-press-escape="false" append-to-body width="800px">
-      <div class="material">
-        <div class="btn_end">
-          <el-button type="primary" size="mini" @click="handAddParam">添加</el-button>
-        </div>
-        <div class="content_table2">
-          <div class="head row rx-sc">
-            <div class="item ww30">工序名称</div>
-            <div class="item ww20">坯体密度</div>
-            <div class="item ww20">密度系数</div>
-            <div class="item ww20">重量</div>
-            <div class="item ww20">操作</div>
-          </div>
-
-          <div class="table">
-            <div class="tr row rx-sc" v-for="(it, idx) in paramList" :key="idx">
-              <div class="item ww30">
-                <el-select size="mini" class="content_num" filterable v-model="it.taskId" placeholder="请选择">
-                  <el-option v-for="item in stepsList" :label="item.taskTypeName" :value="item.taskId"
-                    :key="item.taskId">
-                  </el-option>
-                </el-select>
-              </div>
-
-              <div class="item ww20">
-                <el-input class="content_num" size="mini" v-model="it.billet" type="digit"
-                  @input="changeInp(it, idx)"></el-input>
-              </div>
-
-              <div class="item ww20">
-                <el-input class="content_num" size="mini" v-model="it.density" type="digit"
-                  @input="changeInp(it, idx)"></el-input>
-              </div>
-
-              <div class="item ww20" v-if="idx == 0 || idx != paramList.length - 1">
-                < {{ it.CVIWeight }} </div>
-
-                  <div class="item ww20" v-if="paramList.length > 1 && idx == paramList.length - 1">
-                    ≥ {{ it.CVIWeight }}
-                  </div>
-
-                  <div class="item ww20 rx-cc" @click="getDelete2(idx)">
-                    <el-link type="danger">删除</el-link>
-                  </div>
-              </div>
-            </div>
-          </div>
-
-          <div class="formula_box">计算公式: 物料重量/坯体密度*密度系数 </div>
-
-          <div class="reportWeight rx-sc">
-            物料重量: {{ weight }} ; 报工重量: {{ reportWeight }}
-          </div>
-        </div>
-
-        <template slot="footer">
-          <el-button size="mini" type="primary" @click="paramSave">保存并计算</el-button>
-          <el-button size="mini" type="primary" @click="save">计算</el-button>
-          <el-button size="mini" @click="cancel">取消</el-button>
-        </template>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-import {
-  getTaskInstanceList,
-  getComputeParam,
-  saveParam
-} from '@/api/produce/job';
-export default {
-  name: 'semiProductJobBom',
-  props: {
-    list: {
-      type: Array,
-      default: () => []
-    },
-    equipmentList: {
-      type: Array,
-      default: () => []
-    },
-
-    item: {
-      type: Object,
-      default: () => { }
-    },
-    isDetails: {
-      type: Boolean,
-      default: false
-    },
-    singleReport: {
-      default: null
-    }
-  },
-
-  watch: {
-    equipmentList: {
-      immediate: true,
-      deep: true,
-      handler(newVal) {
-        this.deviceList = newVal;
-        console.log(newVal,'1111121547646549896498')
-        this.changeHeatNumber();
-      }
-    },
-    list: {
-      immediate: true,
-      deep: true,
-      handler(newVal) {
-        console.log('aaaaaa',newVal)
-        if (newVal.length) {
-          console.log(newVal);
-          this.newList = newVal;
-          // if(this.taskObj.type != 4){
-             this.sumweight(newVal);
-             this.sunTj();
-          // }
-          
-
-        }
-      }
-    },
-  },
-  computed: {
-    taskObj() {
-      return this.$store.state.user.taskObj;
-    },
-    clientEnvironmentId() {
-      return this.$store.state.user.info.clientEnvironmentId;
-    }
-  },
-  created() {
-    this.getTaskFn();
-  },
-
-  // item
-  data() {
-    return {
-      deviceList: [],
-      newList: [],
-      stepsList: [],
-      cacheKeyUrl:'mes_produce_jobBooking_semiProductJobBom',
-      weight: 0,
-      reportWeight: 0,
-
-      paramList: [],
-
-      resultObj: {},
-      resultIdx: 0,
-
-      show: false,
-
-
-
-      isQualifiedList: [{
-        code: 1,
-        name: '合格'
-      },
-      {
-        code: 2,
-        name: '不合格'
-      }
-      ],
-
-      notTypeList: [{
-        code: 1,
-        name: '返工'
-      },
-      {
-        code: 2,
-        name: '返修'
-      },
-      {
-        code: 3,
-        name: '报废'
-      },
-      {
-        code: 4,
-        name: '降级使用'
-      },
-      {
-        code: 5,
-        name: '让步接收'
-      }
-      ],
-      selectArr:[],
-    };
-  },
-
-  methods: {
-    sunTj() {
-      this.item.workReportInfo.formedNum = this.newList.filter(v => v.extInfo.isQualified == 1).length;
-      this.item.workReportInfo.notFormedNum = this.newList.filter(v => v.extInfo.isQualified !== 1).length;
-    },
-    sumweight(arr) {
-      console.log(arr, 6666667777);
-      let formedWeight = 0;
-      let noFormedWeight = 0;
-      arr.map((s,i) => {
-        if (s.extInfo.reportWeight) {
-          if (s.extInfo.isQualified == 1) {
-            formedWeight += s.extInfo.reportWeight * 1;
-          } else {
-            noFormedWeight += s.extInfo.reportWeight * 1;
-          }
-        } else {
-          s.extInfo.reportWeight = null;
-        }
-        this.$set(this.list[i].extInfo,'reportWeight',s.extInfo.reportWeight)
-      })
-      
-      this.item.workReportInfo.formedWeight = parseFloat((formedWeight).toFixed(2));
-      this.item.workReportInfo.notFormedWeight = parseFloat((noFormedWeight).toFixed(2));
-    },
-
-
-    handlerSelect() {
-      this.sunTj();
-      this.sumweight(this.list);
-    },
-
-    handleInput() {
-      console.log(12354987498498)
-      let arr = JSON.parse(JSON.stringify(this.list));
-      this.sumweight(arr);
-      this.sunTj();
-      // console.log('arr11111112222',arr)
-      // console.log('this.list33333',this.list)
-    },
-
-    // changeHeatNumber() {
-    //   if (this.deviceList.length > 0) {
-    //     const device = this.deviceList[0];
-    //     this.$emit('update:heatNumber', device.heatNumber);
-    //   }
-    // },
-
-    getTaskFn() {
-      getTaskInstanceList(this.item.workOrderId).then((res) => {
-        // this.stepsList = res;
-        this.stepsList=res.filter(item=>{return item.taskId != -2})
-      });
-    },
-    selectVal(e, item, idx) {
-        let obj = this.deviceList.find((f) => f.id == e);
-
-        this.$set(
-          this.list[idx],
-          'deviceName',
-          obj.name + '-' + obj.codeNumber
-        );
-        this.$set(
-          this.list[idx]['extInfo'],
-          'heatNumber',
-          obj.extInfo.heatNumber
-        );
-      },
-
-    changeHeatNumber() {
-      this.deviceList.forEach((f) => {
-        this.list.forEach((o,index) => {
-          if (
-            o.deviceId &&
-            f.instanceId == o.deviceId &&
-            this.deviceList.length > 1
-          ) {
-            // o.extInfo.heatNumber = f.extInfo.heatNumber;
-            this.$set(this.list[index].extInfo,'heatNumber',f.extInfo.heatNumber)
-            this.$forceUpdate();
-          } else if (this.deviceList.length == 1) {
-            o['deviceId'] = this.deviceList[0].id || f.instanceId;
-            console.log('111111',this.deviceList[0].id)
-            // o.extInfo.heatNumber = this.deviceList[0].extInfo.heatNumber;
-            // this.$set(this.list[index],'heatNumber',this.deviceList[0].extInfo.heatNumber)
-            this.$set(this.list[index].extInfo,'heatNumber',this.deviceList[0].extInfo.heatNumber)
-            this.$forceUpdate();
-          }
-        });
-      });
-    },
-
-    selectName(value, idx) {
-      const taskObj = this.stepsList.find((item) => item.taskId === value);
-      this.$set(this.list[idx].extInfo, 'taskName', taskObj.taskTypeName);
-      this.$forceUpdate();
-    },
-
-    openNumerate(row, idx) {
-      if (!row.extInfo.reportWeight) {
-        this.$message({ message: '请先输入报工重量', type: 'warning' });
-        return false;
-      }
-      this.weight = row.extInfo.weight;
-      this.reportWeight = row.extInfo.reportWeight;
-      this.resultIdx = idx;
-
-      this.show = true;
-    },
-
-    getCompute() {
-      getComputeParam(
-        this.item.workOrderId,
-        this.item.currentTaskDiagram.taskId
-      ).then((res) => {
-        this.paramList = [];
-        this.paramList = (res && res.paramList) || [];
-        this.paramObj = res || {};
-      });
-    },
-
-    handAddParam() {
-      this.paramList.push({
-        taskId: null,
-        taskName: null
-      });
-    },
-    getDelete(idx) {
-      this.list.splice(idx, 1);
-    },
-
-    getDelete2(idx) {
-      this.paramList.splice(idx, 1);
-    },
-
-    changeInp(item, index) {
-      if (Number(item.billet) && Number(item.density)) {
-        this.paramList[index].CVIWeight = (
-          (Number(this.weight) / item.billet) *
-          item.density
-        ).toFixed(2);
-      }
-    },
-
-    cancel() {
-      this.show = false;
-      this.reportWeight = 0;
-      this.weight = 0;
-    },
-
-    paramSave() {
-      if (this.paramList.length > 0) {
-        let bol;
-        let _i;
-        bol = this.paramList.every((e, i) => {
-          _i = i + 1;
-          return e.taskId && e.billet && e.density;
-        });
-
-        if (!bol) {
-          this.$message({ message: `第${_i}行数据不全`, type: 'warning' });
-
-          return false;
-        }
-
-        if (this.paramList.length < 1) {
-          this.$message({
-            message: '请输入二个以上计算数据',
-            type: 'warning'
-          });
-
-          return false;
-        }
-      }
-      let param = {};
-
-      if (!Object.prototype.hasOwnProperty.call(this.paramObj, 'id')) {
-        param = {
-          paramList: this.paramList,
-          workOrderId: this.item.workOrderId,
-          taskId: this.item.currentTaskDiagram.taskId
-        };
-      } else {
-        this.paramObj.paramList = this.paramList;
-        param = this.paramObj;
-      }
-
-      saveParam(param).then((res) => {
-        this.$message({ message: '保存成功', type: 'success' });
-        this.getCompute();
-
-        this.save();
-      });
-    },
-
-    save() {
-      if (this.item.currentTaskDiagram.isFirstTask == 1) {
-        this.resultObj = {};
-
-        if (Number(this.reportWeight) < Number(this.paramList[0].CVIWeight)) {
-          this.resultObj = this.paramList[0];
-          this.setDataSave();
-          return false;
-        }
-
-        if (
-          Number(this.reportWeight) >=
-          this.paramList[this.paramList.length - 1].CVIWeight
-        ) {
-          this.resultObj = this.paramList[this.paramList.length - 1];
-          this.setDataSave();
-          return false;
-        }
-
-        for (let i = 1; i < this.paramList.length; i++) {
-          console.log(
-            11,
-            Number(this.paramList[i - 1].CVIWeight),
-            Number(this.reportWeight)
-          );
-          if (
-            Number(this.paramList[i - 1].CVIWeight) <
-            Number(this.reportWeight) &&
-            Number(this.reportWeight) < Number(this.paramList[i].CVIWeight)
-          ) {
-            this.resultObj = this.paramList[i];
-            break;
-          }
-        }
-        this.setDataSave();
-      }
-    },
-
-    setDataSave() {
-      this.$set(
-        this.list[this.resultIdx].extInfo,
-        'taskId',
-        this.resultObj.taskId
-      );
-      this.$set(
-        this.list[this.resultIdx].extInfo,
-        'density',
-        this.resultObj.density
-      );
-      this.$set(
-        this.list[this.resultIdx].extInfo,
-        'billet',
-        this.resultObj.billet
-      );
-      this.$set(
-        this.list[this.resultIdx].extInfo,
-        'taskName',
-        this.resultObj.taskName
-      );
-
-      this.cancel();
-    },
-    // 多选
-    tableDataSelectChange(val) {
-      let arr=[];
-      this.selectArr=[]
-      if(val.length>0){
-        val.map(item=>{
-          arr.push(item.id || item.instanceId)
-        })
-        this.selectArr=arr
-      }
-      console.log(arr);
-
-    },
-    //批量删除
-    batchDelete(){
-      if (!this.selectArr.length) {
-        this.$message.warning('请至少选择一条数据');
-        return;
-      }
-      this.$confirm('确定要删除选中的报工信息吗?', '提示', {
-          type: 'warning'
-        })
-          .then(() => {
-            this.selectArr.forEach((sitem, sindex) => {
-              this.list.forEach((item, index) => {
-                let id=item.id || item.instanceId
-                  if (id==sitem) {
-                    this.list.splice(index, 1);
-                  }
-                })
-            });
-        })
-        .catch(() => {});
-
-    }
-  },
-
-  created() {
-    this.getTaskFn();
-    this.getCompute();
-  }
-};
-</script>
-
-<style lang="scss" scoped>
-.tag_box {
-  display: inline-block;
-  padding: 1px 6px;
-  margin-right: 6px;
-  background: #e6a23c;
-  font-size: 11px;
-  color: #fff;
-  border-radius: 2px;
-}
-
-.content_num2 {
-  --input-background-color: #f0f8f2;
-}
-
-.numerate {
-  font-size: 22rpx;
-  color: #157a2c;
-  cursor: pointer;
-}
-
-.material {
-  width: 100%;
-}
-
-.btn_end {
-  text-align: right;
-  margin-bottom: 10px;
-}
-
-.content_table2 {
-  width: 100%;
-
-  .row {
-    width: 100%;
-
-    .item {
-      color: #404446;
-      font-size: 14px;
-      padding-left: 6px;
-    }
-
-    .color157 {
-      color: #157a2c;
-    }
-
-    .ww20 {
-      width: 20%;
-    }
-
-    .ww30 {
-      width: 30%;
-    }
-
-    .ww25 {
-      width: 25%;
-    }
-
-    .ww35 {
-      width: 35%;
-    }
-
-    .ww10 {
-      width: 10%;
-    }
-  }
-
-  .head {
-    height: 32px;
-    background: #f7f9fa;
-    border-top: 1px solid #e3e5e5;
-    border-left: 1px solid #e3e5e5;
-
-    .item {
-      height: 32px;
-      line-height: 32px;
-      border-right: 1px solid #e3e5e5;
-      box-sizing: border-box;
-    }
-  }
-
-  .tr {
-    border-top: 1px solid #e3e5e5;
-    border-left: 1px solid #e3e5e5;
-
-    .item {
-      font-size: 12px;
-      min-height: 32px;
-      display: flex;
-      align-items: center;
-      border-right: 1px solid #e3e5e5;
-      box-sizing: border-box;
-      white-space: normal;
-      word-break: break-all;
-    }
-
-    &:last-child {
-      border-bottom: 1px solid #e3e5e5;
-    }
-  }
-}
-
-.formula_box {
-  font-size: 12px;
-  font-style: normal;
-  font-weight: 400;
-  margin-top: 15px;
-  color: #157a2c;
-}
-
-.reportWeight {
-  font-size: 12px;
-  font-style: normal;
-  font-weight: 400;
-  margin-top: 15px;
-  color: #157a2c;
-}
-
-.content_num {
-  display: flex;
-  align-items: center;
-  padding: 2px;
-  --input-background-color: #f0f8f2;
-
-}
-</style>

+ 18 - 16
src/views/produce/components/jobBooking/components/semiProductJobBomPL.vue

@@ -702,21 +702,23 @@
               'deviceId',
               obj.instanceId
             );
-            this.$set(
-              this.list[index].extInfo.notBatchReportInfo[0],
-              'deviceName',
-              obj.name
-            );
-            this.$set(
-              this.list[index].extInfo.notBatchReportInfo[0],
-              'heatNumber',
-              obj.extInfo.heatNumber
-            );
-            this.$set(
-              this.list[index].extInfo.notBatchReportInfo[0],
-              'deviceId',
-              obj.instanceId
-            );
+            if (this.list[index].extInfo.notBatchReportInfo.length != 0) {
+              this.$set(
+                this.list[index].extInfo.notBatchReportInfo[0],
+                'deviceName',
+                obj.name
+              );
+              this.$set(
+                this.list[index].extInfo.notBatchReportInfo[0],
+                'heatNumber',
+                obj.extInfo.heatNumber
+              );
+              this.$set(
+                this.list[index].extInfo.notBatchReportInfo[0],
+                'deviceId',
+                obj.instanceId
+              );
+            }
           });
         }
       },
@@ -793,7 +795,7 @@
 
         this.deviceList = data;
         console.log('1111', this.deviceList);
-        if (this.deviceList.length == 0) {
+        if (this.deviceList.length != 0) {
           this.list.forEach((o, index) => {
             //碳谷合格分批设备炉次号
             o.extInfo.batchReportInfo.map((report, ridx) => {

+ 26 - 4
src/views/produce/components/jobBooking/details.vue

@@ -147,7 +147,8 @@
               objData.semiProductList &&
               objData.semiProductList.length != 0 &&
               objData.singleReport == 0 &&
-              !(taskType == 6 && clientEnvironmentId == 3)
+              taskType != 6 &&
+              clientEnvironmentId == 3
             "
             :list="objData.semiProductList"
             :item="objData"
@@ -199,6 +200,24 @@
             :isType="true"
           ></aridRegion>
 
+          <div
+            v-if="
+              objData &&
+              objData.currentTaskDiagram.type == 4 &&
+              clientEnvironmentId == 3 &&
+              objData.singleReport == 0
+            "
+          >
+            <detailPackagingGrouping
+              ref="packagingGroupingRef"
+              :objData="objData"
+              :workOrderId="objData.workOrderId"
+              :taskId="objData.currentTaskDiagram.taskId"
+              :isDetails="true"
+            >
+            </detailPackagingGrouping>
+          </div>
+
           <div
             v-if="
               objData &&
@@ -241,7 +260,7 @@
             v-if="
               objData.packInfo &&
               objData.packInfo.pickOutInList &&
-              objData.packInfo.pickOutInList != 0 &&
+              objData.packInfo.z == 1 &&
               taskType == 4 &&
               clientEnvironmentId == 3
             "
@@ -410,8 +429,11 @@
       curTaskObj: {
         handler(obj) {
           if (obj && obj.taskId != -2) {
-            console.log(obj, '55555555555');
-            this.taskType = obj.type;
+            if (obj.taskId == '-1') {
+              this.taskType = 5;
+            } else {
+              this.taskType = obj.type;
+            }
             this.getList();
           }
         },

+ 74 - 18
src/views/produce/components/jobBooking/index.vue

@@ -52,7 +52,7 @@
               type="text"
               size="mini"
               @click="openPicking(item.workOrderId, item)"
-              >手动添加</el-button
+              >添加设备</el-button
             >
             <el-button
               type="text"
@@ -112,7 +112,13 @@
             placeholder="请选择执行人"
             filterable
             multiple
+            @change="changeId"
           >
+            <div class="checkboxWrapper">
+              <el-checkbox v-model="checked" @change="checkChange">
+                全选
+              </el-checkbox>
+            </div>
             <el-option
               v-for="item in teamUserList"
               :label="item.name"
@@ -548,7 +554,8 @@
         teamAllList: [],
         teamUserList: [],
         executorIdList: [],
-        teamId: ''
+        teamId: '',
+        checked: false
       };
     },
 
@@ -607,15 +614,17 @@
         const ids = id.split(',');
         this.teamList = [];
         this.teamUserList = [];
-        await ids.forEach((item) => {
-          getTeam(item).then((res) => {
-            this.teamList.push({
-              name: res.name,
-              id: res.id
-            });
+        const list = ids.map((item) => getTeam(item));
+
+        const dataList = await Promise.all(list);
 
-            this.teamAllList.push(res.userVOList);
+        dataList.forEach((item) => {
+          this.teamList.push({
+            name: item.name,
+            id: item.id
           });
+
+          this.teamAllList.push(item.userVOList);
         });
       },
 
@@ -637,6 +646,48 @@
         }).then((res) => {
           this.isDisposal = res.value == '1' ? true : false;
         });
+
+        await parameterGetByCode({
+          code: 'default_executor'
+        }).then((res) => {
+          this.isDefaultExecutor = res.value == '1' ? true : false;
+
+          if (this.isDefaultExecutor) {
+            this.setDefaultIdList();
+          }
+        });
+      },
+
+      setDefaultIdList() {
+        if (this.teamList.length != 0) {
+          this.teamId = this.teamList[0].id;
+          const index = this.teamList.findIndex(
+            (item) => item.id == this.teamId
+          );
+          this.teamUserList = this.teamAllList[index];
+          const res = this.teamUserList.find(
+            (it) => it.id == this.$store.state.user.info.userId
+          );
+
+          this.executorIdList.push(res.id);
+        }
+      },
+
+      changeId() {
+        if (this.executorIdList.length == this.teamUserList.length) {
+          this.checked = true;
+        } else {
+          this.checked = false;
+        }
+      },
+
+      checkChange() {
+        if (this.checked) {
+          this.executorIdList = [];
+          this.executorIdList = this.teamUserList.map((item) => item.id);
+        } else {
+          this.executorIdList = [];
+        }
       },
 
       getList(ids) {
@@ -1035,15 +1086,14 @@
         const executorList = [];
 
         this.executorIdList.forEach((item) => {
-          this.teamUserList.forEach((it) => {
-            if (item == it.id) {
-              executorList.push({
-                userId: it.id,
-                jobNumber: it.jobNumber,
-                name: it.name
-              });
-            }
-          });
+          const data = this.teamUserList.find((it) => it.id == item);
+          if (data) {
+            executorList.push({
+              userId: data.id,
+              jobNumber: data.jobNumber,
+              name: data.name
+            });
+          }
         });
 
         this.List = this.List.map((item) => {
@@ -1343,6 +1393,7 @@
             this.loadingBtn = false;
             this.loading.close();
             this.$message.success('报工成功');
+            this.checked = false;
             this.executorIdList = [];
             this.teamId = '';
             this.getList(this.idsList);
@@ -1541,6 +1592,11 @@
     border-radius: 2px;
   }
 
+  .checkboxWrapper {
+    padding: 8px 20px;
+    border-bottom: 1px solid #ccc;
+  }
+
   ::v-deep .el-select__tags {
     flex-wrap: nowrap;
     overflow: auto;

+ 28 - 7
src/views/produce/components/outsourcing/details.vue

@@ -66,6 +66,19 @@
         }}</el-tag>
       </template>
 
+      <template v-slot:approvalStatus="{ row }">
+        <el-tag v-if="row.approvalStatus == 0">未提交</el-tag>
+        <el-tag v-if="row.approvalStatus == 1" type="warning">审核中</el-tag>
+        <el-tag v-if="row.approvalStatus == 2" type="success">审核通过</el-tag>
+        <el-tag v-if="row.approvalStatus == 3" type="danger">审核不通过</el-tag>
+      </template>
+
+      <!-- <template v-slot:status="{ row }">
+        <el-tag>{{
+          row.status == 0 ? '未提交' : row.status == 1 ? '已提交' : '已发布'
+        }}</el-tag>
+      </template> -->
+
       <template v-slot:outsourceScene="{ row }">
         <span>{{ row.outsourceScene | outsourceSceneText }}</span>
       </template>
@@ -262,12 +275,6 @@
             align: 'center',
             showOverflowTooltip: true
           },
-          {
-            prop: 'remark',
-            label: '备注',
-            align: 'center',
-            showOverflowTooltip: true
-          },
 
           {
             slot: 'requireDeliveryTime',
@@ -300,7 +307,14 @@
 
           {
             slot: 'status',
-            label: '状态',
+            label: '单据状态',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+
+          {
+            slot: 'approvalStatus',
+            label: '审核状态',
             align: 'center',
             showOverflowTooltip: true
           },
@@ -321,6 +335,13 @@
             showOverflowTooltip: true
           },
 
+          {
+            prop: 'remark',
+            label: '备注',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+
           {
             columnKey: 'action',
             label: '操作',

+ 66 - 30
src/views/produce/components/outsourcing/index.vue

@@ -47,12 +47,13 @@
             style="width: 260px"
           ></el-input>
         </el-form-item>
-        <el-form-item label="委外到:" prop="taskIds">
+        <el-form-item label="委外工序:" prop="taskIdes">
           <el-select
-            v-model="attributeData.taskIds"
+            v-model="attributeData.taskIdes"
             placeholder="请选择"
             style="width: 260px"
             @change="changeTaskId"
+            multiple
           >
             <el-option
               v-for="item in newStepsList"
@@ -214,7 +215,7 @@
         </el-form-item>
         <el-form-item label="请托到:" prop="taskIds">
           <el-select
-            v-model="attributeData.taskIds"
+            v-model="taskIds"
             placeholder="请选择"
             style="width: 260px"
             @change="changeTaskId"
@@ -361,12 +362,14 @@
           warehouseId: '', //仓库id
           produceRoutingId: '', //工艺路线id
           supplierId: '', //供应商id
-          supplierName: ''
+          supplierName: '',
+          taskIdes: []
         },
         isInWarehouse: true,
         produceList: [],
         warehouseList: [],
         newStepsList: [],
+        taskIds: '',
         typeList: [
           {
             id: 4,
@@ -397,7 +400,9 @@
           formedNumLast: [
             { required: true, message: '请输入委外数量', trigger: 'blur' }
           ],
-          taskIds: [{ required: true, message: '请选择', trigger: 'blur' }],
+          taskIdes: [
+            { required: true, message: '请选择委外工序', trigger: 'blur' }
+          ],
           sceneText: [
             { required: true, message: '请选择委外场景', trigger: 'blur' }
           ],
@@ -519,8 +524,17 @@
       // 仓库
       getWarehouseFn() {
         getWarehouseList().then((res) => {
-          console.log(res, '仓库数据');
-          this.warehouseList = res.data;
+          // console.log(
+          //   this.$store.state.user.info.factoryId,
+          //   'this.$store.state.user.info'
+          // );
+          // console.log(res, '仓库数据');
+          this.warehouseList = res.data.filter(
+            (item) => item.factoryId == this.$store.state.user.info.factoryId
+          );
+          // console.log(this.warehouseList, '数据');
+          // console.log(res, '仓库数据');
+          // this.warehouseList = res.data;
         });
       },
 
@@ -528,32 +542,38 @@
         console.log(e);
         const arr = this.newStepsList.find((item) => item.taskId === e);
 
-        if (this.newStepsList.length) {
-          const id = this.newStepsList[0].sourceTaskId;
-          //isFirstTask 1是首工序 0不是
-          if (this.attributeData.isFirstTask) {
-            this.attributeData.sceneText = '首工序';
-            this.attributeData.outsourceScene = 1;
-            if (arr.sourceTaskId !== id) {
-              this.attributeData.sceneText = '首工序及多工序';
-              this.attributeData.outsourceScene = 4;
-            }
+        if (this.attributeData.taskIdes.length) {
+          if (this.attributeData.taskIdes.length == 1) {
+            this.attributeData.sceneText = '单工序';
+            this.attributeData.outsourceScene = 2;
           } else {
-            if (arr.sourceTaskId === id) {
-              // 单工序
-              this.attributeData.sceneText = '单工序';
-              this.attributeData.outsourceScene = 2;
-            } else {
-              //多工序
-              this.attributeData.sceneText = '多工序';
-              this.attributeData.outsourceScene = 3;
-            }
+            this.attributeData.sceneText = '多工序';
+            this.attributeData.outsourceScene = 3;
           }
+          // const id = this.newStepsList[0].sourceTaskId;
+          // if (this.attributeData.isFirstTask) {
+          //   this.attributeData.sceneText = '首工序';
+          //   this.attributeData.outsourceScene = 1;
+          //   if (arr.sourceTaskId !== id) {
+          //     this.attributeData.sceneText = '首工序及多工序';
+          //     this.attributeData.outsourceScene = 4;
+          //   }
+          // } else {
+          //   if (arr.sourceTaskId === id) {
+          //     // 单工序
+          //     this.attributeData.sceneText = '单工序';
+          //     this.attributeData.outsourceScene = 2;
+          //   } else {
+          //     //多工序
+          //     this.attributeData.sceneText = '多工序';
+          //     this.attributeData.outsourceScene = 3;
+          //   }
+          // }
         } else {
-          uni.showToast({
-            title: '委外到工序为空',
-            icon: 'none'
-          });
+          // uni.showToast({
+          //   title: '委外到工序为空',
+          //   icon: 'none'
+          // });
         }
       },
 
@@ -569,6 +589,7 @@
               );
               this.attributeData.supplierName = obj ? obj.name : '';
             }
+            this.attributeData.taskIds = this.attributeData.taskIdes.join(',');
             this.$emit('changePlugIn', this.attributeData);
           } else {
             console.log('error submit!!');
@@ -614,4 +635,19 @@
   .btn-box {
     margin-left: 50px;
   }
+
+  ::v-deep .el-select__tags {
+    flex-wrap: nowrap;
+    overflow: auto;
+  }
+
+  /* 输入框最大宽度*/
+  ::v-deep .el-select__tags-text {
+    max-width: 90px;
+  }
+
+  /* 底部滚动条的高度*/
+  ::v-deep .el-select__tags::-webkit-scrollbar {
+    height: 2px !important;
+  }
 </style>

+ 11 - 1
src/views/produce/components/outsourcing/outsourceList.vue

@@ -185,6 +185,16 @@
                 {{ row.brandNum }}
               </template>
             </el-table-column>
+
+            <el-table-column
+              label="数量"
+              type="feedQuantity"
+              show-overflow-tooltip
+            >
+              <template slot-scope="{ row, $index }">
+                {{ row.feedQuantity }}
+              </template>
+            </el-table-column>
             <el-table-column
               label="重量"
               type="weightUnit"
@@ -192,7 +202,7 @@
               show-overflow-tooltip
             >
               <template slot-scope="{ row, $index }">
-                {{ row.weight || 0 }} {{ row.weightUnit }}
+                {{ row.newWeight || 0 }} {{ row.weightUnit }}
               </template>
             </el-table-column>
             <el-table-column label="刻码" type="engrave" show-overflow-tooltip>

+ 28 - 9
src/views/produce/components/picking/outsourceIndex.vue

@@ -149,9 +149,9 @@
                         : row.demandQuantity
                     "
                     size="mini"
-                    style="width: 150px"
+                    style="width: 130px"
                   >
-                    <template slot="append">{{ row.measuringUnit }}</template>
+                    <template slot="append">{{ row.unit }}</template>
                   </el-input>
                 </el-form-item>
               </template>
@@ -159,7 +159,7 @@
 
             <el-table-column label="计量库存数量" prop="availableCountBase">
               <template slot-scope="{ row, $index }">
-                {{ row.availableCountBase }} {{ row.measuringUnit }}
+                {{ row.availableCountBase }} {{ row.unit }}
               </template>
             </el-table-column>
 
@@ -306,7 +306,8 @@
 
         tableRules: {},
         loadingBtn: false,
-        outsourcingPickingShow: false
+        outsourcingPickingShow: false,
+        isFullscreen: false
       };
     },
     computed: {
@@ -394,7 +395,7 @@
         let ids = [];
         this.workList.map((item) => {
           item.pickList.map((pitem) => {
-            ids.push(pitem.categoryCode);
+            ids.push(pitem.code);
           });
         });
 
@@ -405,14 +406,21 @@
         const res = await getInventoryTotal(ids);
         res.map((ritem) => {
           this.workList.map((item) => {
-            item.pickList.map((pitem) => {
-              if (pitem.categoryCode == ritem.code) {
-                pitem.availableCountBase = ritem.availableCountBase;
+            item.pickList.map((pitem, index) => {
+              if (pitem.warehouseId == ritem.warehouseId) {
+                // pitem.availableCountBase = ritem.availableCountBase;
+                this.$set(
+                  this.workList[0].pickList[index],
+                  'availableCountBase',
+                  ritem.availableCountBase
+                );
               }
             });
           });
         });
-        console.log('cashasisasa', res);
+
+        console.log(this.workList, 'this.workList');
+        // console.log('cashasisasa', res);
       },
 
       async getOrderCode() {
@@ -459,6 +467,17 @@
             this.$set(this.workList[0], 'pickList', _arr);
             this.$forceUpdate();
             console.log(this.workList[0], 'this.workList[0]');
+            // this.getInventoryTotalFn(this.workList[0])
+            // let ids = [];
+            // console.log(list, 'list111');
+            // this.workList[0].pickList.forEach((item) => {
+            //   ids.push(item.code);
+            // });
+            // console.log(ids, 'ids');
+
+            // if (ids.length != 0) {
+            this.getInventoryTotalFn();
+            // }
           });
         }
         this.closeOutsourcingPicking();

+ 3 - 2
src/views/produce/components/picking/pickingList.vue

@@ -827,8 +827,9 @@
     created() {
       if (this.isType == 'pick') {
         // this.treeIds = '1, 5, 7, 8, 10, 13, 14, 23, 26, 9, 28';
-        // this.treeIds = '9, 23, 2, 1, 4, 14, 5, 8, 16, 13, 15, 6, 10, 22';
-        this.treeIds = '9, 1, 14, 5, 8, 13, 15, 6, 10, 22';
+        this.treeIds =
+          '9, 23, 2, 1, 4, 14, 5, 8, 16, 13, 15, 6, 10, 22, 1777158952502956034';
+        // this.treeIds = '9, 1, 14, 5, 8, 13, 15, 6, 10, 22';
       } else if (this.isType == 'feed') {
         this.treeIds = '1, 2, 4, 5, 7, 8, 10, 11, 13, 14, 26, 9, 23,28';
       } else if (this.isType == 'job') {

+ 6 - 6
src/views/produce/components/routings.vue

@@ -11,7 +11,7 @@
       :maxable="true"
     >
       <div class="routing_box">
-   
+
         工艺路线: <span>{{ routeObj.produceRoutingName }}</span></div
       >
       <div>
@@ -87,11 +87,11 @@
     },
     methods: {
       getTaskFn() {
-        
+
 
         getTaskInstanceList(this.routeObj.id).then((res) => {
           this.routeList = res;
-         
+
           // 使用findIndex方法查找
           const index = this.routeList.findIndex(
             (item) => Number(item.taskId) == Number(this.routeObj.taskId)
@@ -106,9 +106,9 @@
 
           if (this.routeObj.taskId != -2) {
             this.curTaskObj = JSON.parse(JSON.stringify( this.routeObj));
-           
+
           } else {
-            this.curTaskObj  =  JSON.parse(JSON.stringify( this.routeList[0])); 
+            this.curTaskObj  =  JSON.parse(JSON.stringify( this.routeList[0]));
             this.desIndex = 0;
           }
 
@@ -135,7 +135,7 @@
     },
 
     created() {
-   
+
       this.getTaskFn();
     }
   };

+ 79 - 18
src/views/produce/components/warehousing/index.vue

@@ -65,7 +65,13 @@
             placeholder="请选择执行人"
             filterable
             multiple
+            @change="changeId"
           >
+            <div class="checkboxWrapper">
+              <el-checkbox v-model="checked" @change="checkChange">
+                全选
+              </el-checkbox>
+            </div>
             <el-option
               v-for="item in teamUserList"
               :label="item.name"
@@ -565,7 +571,8 @@
         teamAllList: [],
         teamUserList: [],
         executorIdList: [],
-        teamId: ''
+        teamId: '',
+        checked: false
       };
     },
 
@@ -724,30 +731,74 @@
         }).then((res) => {
           this.isDisposal = res.value == '1' ? true : false;
         });
+
+        await parameterGetByCode({
+          code: 'default_executor'
+        }).then((res) => {
+          this.isDefaultExecutor = res.value == '1' ? true : false;
+
+          if (this.isDefaultExecutor) {
+            this.setDefaultIdList();
+          }
+        });
+      },
+
+      setDefaultIdList() {
+        if (this.teamList.length != 0) {
+          this.teamId = this.teamList[0].id;
+          const index = this.teamList.findIndex(
+            (item) => item.id == this.teamId
+          );
+          this.teamUserList = this.teamAllList[index];
+          const res = this.teamUserList.find(
+            (it) => it.id == this.$store.state.user.info.userId
+          );
+
+          this.executorIdList.push(res.id);
+        }
       },
 
       async getTeamList(id) {
         const ids = id.split(',');
         this.teamList = [];
         this.teamUserList = [];
-        await ids.forEach((item) => {
-          getTeam(item).then((res) => {
-            this.teamList.push({
-              name: res.name,
-              id: res.id
-            });
+        const list = ids.map((item) => getTeam(item));
 
-            this.teamAllList.push(res.userVOList);
+        const dataList = await Promise.all(list);
+
+        dataList.forEach((item) => {
+          this.teamList.push({
+            name: item.name,
+            id: item.id
           });
+
+          this.teamAllList.push(item.userVOList);
         });
       },
 
+      changeId() {
+        if (this.executorIdList.length == this.teamUserList.length) {
+          this.checked = true;
+        } else {
+          this.checked = false;
+        }
+      },
+
       checkTeamList(id) {
         this.executorIdList = [];
         const index = this.teamList.findIndex((item) => item.id == id);
         this.teamUserList = this.teamAllList[index];
       },
 
+      checkChange() {
+        if (this.checked) {
+          this.executorIdList = [];
+          this.executorIdList = this.teamUserList.map((item) => item.id);
+        } else {
+          this.executorIdList = [];
+        }
+      },
+
       getTgWarehouse() {
         const param = {
           workOrderIds: this.idsList,
@@ -829,7 +880,10 @@
 
       getWarehouseListFn() {
         getWarehouseList().then((res) => {
-          this.warehouseList = res.data;
+          // this.warehouseList = res.data;
+          this.warehouseList = res.data.filter(
+            (item) => item.factoryId == this.$store.state.user.info.factoryId
+          );
         });
       },
 
@@ -859,15 +913,14 @@
         const executorList = [];
 
         this.executorIdList.forEach((item) => {
-          this.teamUserList.forEach((it) => {
-            if (item == it.id) {
-              executorList.push({
-                userId: it.id,
-                jobNumber: it.jobNumber,
-                name: it.name
-              });
-            }
-          });
+          const data = this.teamUserList.find((it) => it.id == item);
+          if (data) {
+            executorList.push({
+              userId: data.id,
+              jobNumber: data.jobNumber,
+              name: data.name
+            });
+          }
         });
 
         this.List = this.List.map((item) => {
@@ -896,6 +949,7 @@
             .then((res) => {
               console.log(res);
               this.$message.success('入库成功');
+              this.checked = false;
               this.executorIdList = [];
               this.teamId = '';
               this.loading.close();
@@ -1029,6 +1083,7 @@
             .then((res) => {
               console.log(res);
               this.$message.success('入库成功');
+              this.checked = false;
               this.executorIdList = [];
               this.teamId = '';
               this.loading.close();
@@ -1083,6 +1138,7 @@
             .then((res) => {
               console.log(res);
               this.$message.success('入库成功');
+              this.checked = false;
               this.executorIdList = [];
               this.teamId = '';
               this.loading.close();
@@ -1178,6 +1234,11 @@
     }
   }
 
+  .checkboxWrapper {
+    padding: 8px 20px;
+    border-bottom: 1px solid #ccc;
+  }
+
   ::v-deep .el-select__tags {
     flex-wrap: nowrap;
     overflow: auto;

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

@@ -722,6 +722,24 @@
           this.$refs.turnoverRef.open();
         }
 
+        if (t == 'bom') {
+          if (this.workListIds.length > 1) {
+            return this.$message.warning('查看BOM详情只能选择一个工单!');
+          } else if (this.workListIds.length < 1)
+            return this.$message.warning('请选择工单!');
+          else {
+            // /
+            console.log(this.workData.list, 'this.workData.list');
+          }
+          //    let rowData = {
+          //   categoryId: row.id,
+          //   categoryName: row.name,
+          //   code: row.code,
+          //   rootPathIdParent: row.categoryLevelPathIdParent,
+          //   isProduct: row.isProduct == 1
+          // };
+        }
+
         // 委外
         if (t == 'Outsourcing') {
           if (this.workListIds.length > 1) {
@@ -782,7 +800,7 @@
               (item) => item.sourceTaskId == this.taskObj.id
             );
             if (arr != -1) {
-              data.splice(0, arr + 1);
+              data.splice(0, arr);
             }
 
             console.log(this.outsourceForm, 'this.outsourceForm');