zss
2023-12-11 c880739ec4cd5ede33b31eb98ad5f7628ea288e5
src/views/product/workbench/feed-pane.vue
@@ -1,7 +1,7 @@
<template>
  <div style="padding:0px 14px;height: 100%;overflow: auto;">
    <div class="need-feed-header">
      <div style="height:28px;line-height:28px;">
      <div>
        <el-divider class="pane-divider" direction="vertical"></el-divider
        ><span style="font-size:14px;font-weight:bold">工单所需物料</span>
      </div>
@@ -137,21 +137,21 @@
      </el-table-column>
    </el-table>
    <el-tabs v-model="activeName">
      <el-tab-pane name="first" label="线边仓合格物料">
      <!-- <el-tab-pane name="first" label="线边仓合格物料"> -->
        <div class="line-side-warehouse-header">
          <div>
            <el-divider class="pane-divider" direction="vertical"></el-divider
            ><span style="font-size:14px;font-weight:bold">线边仓合格物料</span>
          </div>
          <div>
            <el-button
            <!-- <el-button
              v-if="permissions.product_feed_scan"
              class="feeding-btn"
              type="primary"
              icon="feed-btn-feeding"
              @click="scanAddFeed()"
              >扫码投料</el-button
            >
            > -->
            <el-button
              class="feeding-btn"
              type="primary"
@@ -205,7 +205,7 @@
              <span>{{ scope.row.partNo }}</span>
            </template>
          </el-table-column>
          <el-table-column
          <!-- <el-table-column
            label="零件"
            prop="partName"
            align="center"
@@ -227,18 +227,18 @@
            <template slot-scope="scope">
              <span>{{ scope.row.partName }}</span>
            </template>
          </el-table-column>
          </el-table-column> -->
          <el-table-column
            label="零件描述"
            prop="partDescription"
            align="center"
            label="零件"
            prop="partName"
            align="center" show-overflow-tooltip
          >
            <template slot="header">
              <div style="line-height: 14px;">零件描述</div>
              <div style="line-height: 14px;">零件</div>
              <div class="th" @click.stop>
                <el-input
                  type="text"
                  v-model="queryParamTwo.partDescription"
                  v-model="queryParamTwo.partName"
                  @keyup.enter.native="handleStockList"
                  clearable
                  @clear="handleStockList"
@@ -247,12 +247,12 @@
              </div>
            </template>
            <template slot-scope="scope">
              <span>{{ scope.row.partDescription }}</span>
              <span>{{ scope.row.partName }}</span>
            </template>
          </el-table-column>
          <el-table-column label="IFS批次号" prop="ifsBatchNo" align="center">
          <el-table-column label="批次号" prop="ifsBatchNo" align="center">
            <template slot="header">
              <div style="line-height: 14px;">IFS批次号</div>
              <div style="line-height: 14px;">批次号</div>
              <div class="th" @click.stop>
                <el-input
                  type="text"
@@ -268,7 +268,25 @@
              <span>{{ scope.row.ifsBatchNo }}</span>
            </template>
          </el-table-column>
          <el-table-column label="SN号" prop="partBatchNo" align="center">
               <!-- <el-table-column label="WDR号" prop="ifsWdr" align="center">
                 <template slot="header">
                   <div style="line-height: 14px;">WDR号</div>
                   <div class="th" @click.stop>
                     <el-input
                       type="text"
                       v-model="queryParamTwo.ifsWdr"
                       @keyup.enter.native="handleStockList"
                       clearable
                       @clear="handleStockList"
                       size="mini"
                     ></el-input>
                   </div>
                 </template>
                 <template slot-scope="scope">
                   <span>{{ scope.row.ifsWdr }}</span>
                 </template>
               </el-table-column> -->
          <!-- <el-table-column label="SN号" prop="partBatchNo" align="center">
            <template slot="header">
              <div style="line-height: 14px;">SN号</div>
              <div class="th" @click.stop>
@@ -308,8 +326,8 @@
            <template slot-scope="scope">
              <span>{{ scope.row.reelNumber }}</span>
            </template>
          </el-table-column>
          <el-table-column
          </el-table-column> -->
          <!-- <el-table-column
            label="规格型号"
            prop="specs"
            align="center"
@@ -331,7 +349,7 @@
            <template slot-scope="scope">
              <span>{{ scope.row.specs }}</span>
            </template>
          </el-table-column>
          </el-table-column> -->
          <el-table-column label="单位" prop="unit" align="center">
            <template slot="header">
              <div style="line-height: 14px;">单位</div>
@@ -390,14 +408,14 @@
              <span>{{ scope.row.stockQuantity }}</span>
            </template>
          </el-table-column>
          <el-table-column
          <!-- <el-table-column
            label="预留数量"
            prop="reserveQuantity"
            align="center"
          >
            <template slot="header">
              <div style="line-height: 14px;">预留数量</div>
              <div class="th" @click.stop>
              <div style="line-height: 14px;">预留数量</div> -->
              <!-- <div class="th" @click.stop>
                <el-input
                  type="text"
                  v-model="queryParamTwo.reserveQuantity"
@@ -406,10 +424,34 @@
                  @clear="handleStockList"
                  size="mini"
                ></el-input>
              </div> -->
            <!-- </template>
            <template slot-scope="scope">
              <span>{{ scope.row.reserveQuantity }}</span>
            </template>
          </el-table-column> -->
          <el-table-column label="是否工序库存" prop="operationStockStatus" align="center">
            <template slot-scope="scope">
              <span v-if="scope.row.operationStockStatus">是</span>
              <span v-else>否</span>
            </template>
          </el-table-column>
          <el-table-column label="所属工序" prop="name" align="center">
            <template slot="header">
              <div style="line-height: 14px;">所属工序</div>
              <div class="th" @click.stop>
                <el-input
                  type="text"
                  v-model="queryParamTwo.name"
                  @keyup.enter.native="handleStockList"
                  clearable
                  @clear="handleStockList"
                  size="mini"
                ></el-input>
              </div>
            </template>
            <template slot-scope="scope">
              <span>{{ scope.row.reserveQuantity }}</span>
              <span>{{ scope.row.name }}</span>
            </template>
          </el-table-column>
          <el-table-column label="库位号" prop="locationNo" align="center">
@@ -431,7 +473,7 @@
            </template>
          </el-table-column>
        </el-table>
        <div class="pagin-page" style="margin-top: 0;margin-bottom: 0;">
        <!-- <div class="pagin-page" style="margin-top: 0;margin-bottom: 0;">
          <el-pagination
            :current-page="queryReport.current"
            :page-sizes="[10, 15, 20, 50, 100]"
@@ -442,11 +484,9 @@
            :total="queryReport.total"
          >
          </el-pagination>
        </div>
      </el-tab-pane>
      <!--        -->
      <el-tab-pane name="second" label="线边仓待处理物料">
        </div> -->
      <!-- </el-tab-pane> -->
      <!-- <el-tab-pane name="second" label="线边仓待处理物料">
        <div class="line-side-warehouse-header">
          <div>
            <el-divider class="pane-divider" direction="vertical"></el-divider
@@ -464,7 +504,7 @@
              >扫码投料</el-button
            >
            <el-button
              class="feeding-btn"
              class="feeding-btn"locationNo
              type="primary"
              icon="feed-btn-feeding"
              @click="addFeed()"
@@ -568,9 +608,9 @@
            align="center"
            show-overflow-tooltip
          >
            <template slot="header">
            <template slot="header"> -->
              <!-- <div style="line-height: 14px;">IFS批次号</div> -->
              <div class="th" @click.stop>
              <!-- <div class="th" @click.stop>
                <el-input
                  type="text"
                  v-model="queryTodoParam.ifsBatchNo"
@@ -765,10 +805,10 @@
          >
          </el-pagination>
        </div>
      </el-tab-pane>
      </el-tab-pane> -->
      <!--        -->
      <el-tab-pane name="third" label="配盘物料">
      <!-- <el-tab-pane name="third" label="配盘物料">
        <div class="task-reserve-warehouse-header">
          <div>
            <el-divider class="pane-divider" direction="vertical"></el-divider
@@ -859,7 +899,7 @@
              <span>{{ scope.row.partName }}</span>
            </template>
          </el-table-column>
          <!--          <el-table-column label="IFS批次号" prop="ifsBatchNo" align="center">-->
                   <el-table-column label="IFS批次号" prop="ifsBatchNo" align="center">-->
          <!--            <template slot="header" slot-scope="scope">-->
          <!--              <div style="line-height: 14px;">IFS批次号</div>-->
          <!--              <div class="th" @click.stop>-->
@@ -876,7 +916,7 @@
          <!--            <template slot-scope="scope">-->
          <!--              <span>{{ scope.row.ifsBatchNo }}</span>-->
          <!--            </template>-->
          <!--          </el-table-column>-->
          <!--          </el-table-column>
          <el-table-column label="SN号" prop="partBatchNo" align="center">
            <template slot="header" slot-scope="scope">
              <div style="line-height: 14px;">SN号</div>
@@ -1000,9 +1040,9 @@
            </template>
          </el-table-column>
        </el-table>
      </el-tab-pane>
      </el-tab-pane> -->
      <el-tab-pane name="four" label="ERP物料">
      <!-- <el-tab-pane name="four" label="ERP物料">
        <div class="task-reserve-warehouse-header">
          <div>
            <el-divider class="pane-divider" direction="vertical"></el-divider
@@ -1106,7 +1146,7 @@
            </template>
          </el-table-column>
        </el-table>
      </el-tab-pane>
      </el-tab-pane> -->
    </el-tabs>
    <div class="workstation-house-header">
      <div>
@@ -1114,6 +1154,18 @@
        ><span style="font-size:14px;font-weight:bold">已投入未消耗物料</span>
      </div>
      <div>
            <!-- <el-button
              class="return-btn"
              type="primary"
              @click="submitIns()"
              >报检</el-button
            >
            <el-button
              class="return-btn"
              type="primary"
              @click="inputHandle()"
              >尾料处理</el-button
            > -->
        <el-button
          class="return-btn"
          type="primary"
@@ -1190,9 +1242,9 @@
          <span>{{ scope.row.partName }}</span>
        </template>
      </el-table-column>
      <el-table-column label="IFS批次号" prop="ifsBatchNo" align="center">
      <el-table-column label="批次号" prop="ifsBatchNo" align="center">
        <template slot="header" slot-scope="scope">
          <div style="line-height: 14px;">IFS批次号</div>
          <div style="line-height: 14px;">批次号</div>
          <div class="th" @click.stop>
            <el-input
              type="text"
@@ -1208,7 +1260,25 @@
          <span>{{ scope.row.ifsBatchNo }}</span>
        </template>
      </el-table-column>
      <el-table-column label="SN号" prop="partBatchNo" align="center">
         <!-- <el-table-column label="WDR号" prop="ifsWdr" align="center">
           <template slot="header" slot-scope="scope">
             <div style="line-height: 14px;">WDR号</div>
             <div class="th" @click.stop>
               <el-input
                 type="text"
                 v-model="queryParamThree.ifsWdr"
                 @keyup.enter.native="handleFeedList"
                 clearable
                 @clear="handleFeedList"
                 size="mini"
               ></el-input>
             </div>
           </template>
           <template slot-scope="scope">
             <span>{{ scope.row.ifsWdr }}</span>
           </template>
         </el-table-column> -->
      <!-- <el-table-column label="SN号" prop="partBatchNo" align="center">
        <template slot="header" slot-scope="scope">
          <div style="line-height: 14px;">SN号</div>
          <div class="th" @click.stop>
@@ -1271,7 +1341,7 @@
        <template slot-scope="scope">
          <span>{{ scope.row.specs }}</span>
        </template>
      </el-table-column>
      </el-table-column> -->
      <el-table-column
        label="可用数量"
        prop="availableStockQuantity"
@@ -1312,13 +1382,37 @@
          <span>{{ scope.row.stockQuantity }}</span>
        </template>
      </el-table-column>
      <el-table-column label="库位号" prop="locNo" align="center">
      <el-table-column label="是否工序库存" prop="operationStockStatus" align="center">
        <template slot-scope="scope">
          <span v-if="scope.row.operationStockStatus">是</span>
          <span v-else>否</span>
        </template>
      </el-table-column>
      <el-table-column label="所属工序" prop="name" align="center">
        <template slot="header">
          <div style="line-height: 14px;">所属工序</div>
          <div class="th" @click.stop>
            <el-input
                  type="text"
                  v-model="queryParamTwo.name"
                  @keyup.enter.native="handleStockList"
                  clearable
                  @clear="handleStockList"
                  size="mini"
            ></el-input>
          </div>
        </template>
        <template slot-scope="scope">
          <span>{{ scope.row.name }}</span>
        </template>
      </el-table-column>
      <el-table-column label="库位号" prop="ifsLocation" align="center">
        <template slot="header" slot-scope="scope">
          <div style="line-height: 14px;">库位号</div>
          <div class="th" @click.stop>
            <el-input
              type="text"
              v-model="queryParamThree.locNo"
              v-model="queryParamThree.ifsLocation"
              @keyup.enter.native="handleFeedList"
              clearable
              @clear="handleFeedList"
@@ -1348,7 +1442,7 @@
          <span>{{ scope.row.unit }}</span>
        </template>
      </el-table-column>
      <el-table-column label="投料人" prop="createUser" align="center">
     <!-- <el-table-column label="投料人" prop="createUser" align="center">
        <template slot="header" slot-scope="scope">
          <div style="line-height: 14px;">投料人</div>
          <div class="th" @click.stop>
@@ -1365,8 +1459,8 @@
        <template slot-scope="scope">
          <span>{{ scope.row.createUser }}</span>
        </template>
      </el-table-column>
      <el-table-column
      </el-table-column> -->
      <!-- <el-table-column
        label="投料时间"
        prop="createTime"
        align="center"
@@ -1394,7 +1488,7 @@
        <template slot-scope="scope">
          <span>{{ scope.row.createTime }}</span>
        </template>
      </el-table-column>
      </el-table-column> -->
    </el-table>
    <feedFormDialog
      :currshowlist.sync="showFeedForm"
@@ -1441,11 +1535,11 @@
</template>
<script>
import { getStock, getFeed, getTodoStock } from '@/api/product/personboard'
import { getStock, getFeed,getFeed2, getTodoStock, submitInsPart, inputHandle } from '@/api/product/personboard'
import { getMaterial } from '@/api/plan/operationtask'
import {
  getERPStockListByPart,
  fetchList
  fetchList,
} from '@/api/warehouse/joinstockorder'
import feedFormDialog from './feed-form'
import returnMaterialFormDialog from './returnmaterial-form'
@@ -1556,9 +1650,9 @@
          .then((response) => {
            var data = response.data
            if (data.code === 0) {
              // const list = data.data.records
              this.stockList = data.data.records
              this.queryReport.total = data.data.total
              /* this.stockList = data.data.records
              this.queryReport.total = data.data.total */
                     this.stockList = data.data
              // this.getReportData()
            } else {
              this.$message.error('获取线边仓信息失败')
@@ -1768,7 +1862,7 @@
          this.paramObject,
          this.queryParamThree
        )
        getFeed(query, stationId)
        getFeed2(query, stationId)
          .then((response) => {
            var data = response.data
            if (data.code === 0) {
@@ -1850,6 +1944,56 @@
        this.$message.warning('请选择投料零件')
      }
    },
      // 报检
      submitIns(){
         if (this.selectFeeds.length > 0) {
            var list = []
            this.selectFeeds.forEach(a=>{
               list.push({
                  partNo: a.partNo,
                  partDesc: a.partName,
                  qtyToInspect: a.availableStockQuantity,
                  partId: a.partId,
                  waivDevRejNo: a.ifsWdr,
                  targetQualifiedLocationId: a.locationId,
                  workstationId: a.workstationId,
                  taskId: this.currOperateTask.id,
                  locationNo: a.ifsLocation,
                  lotBatchNo: a.ifsBatchNo,
                  qtyArrived: a.stockQuantity,
                  waivDevRejNo: a.ifsWdr,
                  serialNo: a.serialNo,
                  operationId: this.currOperateTask.operationId,
                  stockId: a.id,
                  engChgLevel: a.engChgLevel,
                  activitySeq: a.activitySeq
               })
            })
            submitInsPart(list).then(res=>{
               this.$message.success('报检完成')
            })
         }else{
            this.$message.warning('请选择报检零件')
         }
      },
      inputHandle(){
         if (this.selectFeeds.length > 0) {
            var list = []
            this.selectFeeds.forEach(a=>{
               list.push({
                  taskId: this.currOperateTask.id,
                  stockId: a.id,
               })
            })
            this.$confirm("此操作将会把所选物料平均计算到所有报工单的投入里").then(()=>{
               inputHandle(list).then(res=>{
                  this.$message.success('处理完成')
               })
            }).catch(e=>{})
         } else {
           this.$message.warning('请选择尾料处理的物料')
         }
      },
    // 初始化页面变量
    initFeed() {
      this.selectStocks = []
@@ -1938,8 +2082,7 @@
      getERPStockListByPart({
        partNo: part.partNo,
        partBatchNo: part.partBatchNo
      })
        .then((resp) => {
      }).then((resp) => {
          const respCode = resp.data.code
          const respData = resp.data.data
          if (respCode === 0) {
@@ -1948,8 +2091,7 @@
            this.isSubmit = false
            this.$message.error('库存列表查询失败')
          }
        })
        .catch(() => {
        }).catch(() => {
          this.isSubmit = false
          console.log('查询零件对应的库存列表时,发生错误')
        })
@@ -2081,6 +2223,14 @@
    }
  },
  watch: {
    showFeedForm:{
      handler(newVal,oldVal){
        if(!newVal){
          this.$refs.stockTable.toggleAllSelection(false)
        }
      },
      deep: true
    },
    workstationId() {
      this.$nextTick(() => {
        if (this.currItem != null && this.currItem === 'feed') {