ezhizao_zx 3 ヶ月 前
コミット
5c16e3aa9f

+ 10 - 3
src/views/business/firstOutsource/form.vue

@@ -148,7 +148,7 @@
             </el-table-column>
             <el-table-column label="炉号" align="center" prop="" width="150">
               <template #default="scope">
-                <el-button link type="primary" icon="Refresh" v-if="editStatus"
+                <el-button link type="primary" icon="Refresh" v-if="editStatus && scope.row.planType != 'HY'"
                   @click="handleChoiceFurnaceNoInfo(scope.row)">
                   {{
                     scope.row.furnaceNoInfo != null
@@ -201,7 +201,6 @@
     <!-- 投产单选择 -->
     <dialog-products ref="dialogProductsRef" :supplier-id="form.supplierId"
       :multiple-selected="handleMultipleSelectedProducts" />
-
     <!-- 工序选择 -->
     <dialog-processes ref="dialogProcessesRef" :multiple-selected="handleMultipleSelectedProcesses" />
     <!-- 批量工序选择 -->
@@ -708,7 +707,10 @@ const handleMultipleSelectedProducts = (selection) => {
           .filter(
             (e) => form.value.details.findIndex((t) => t.lotId === e.lotId) < 0
           )
-          .map((e) => ({ ...e, hasReturnReceiptDetailFlag: true }))
+          .map((e) => ({
+            ...e, hasReturnReceiptDetailFlag: true,
+            furnaceNoInfo: e.planType == 'HY' ? { furnaceNumber: '废品回用', firstTechnicalRequirement: '废品回用' } : null
+          }))
       );
     }
   });
@@ -865,11 +867,16 @@ const handleChoiceFurnaceNoInfo = (row) => {
   changeFurnaceNoInfo.forEach((l) => {
     checkSame = checkSame && l.productId == changeFurnaceNoInfo[0].productId;
   });
+  let isHy = changeFurnaceNoInfo.some(e => e.planType == 'HY')
   console.log(checkSame);
   if (!checkSame) {
     proxy.$modal.msgError("请选择相同计划单批量选择炉号");
     return;
   }
+  if (isHy) {
+    proxy.$modal.msgError("请选择非废品回用计划单批量选择炉号");
+    return;
+  }
   if (changeFurnaceNoInfo.length === 0) {
     proxy.$modal.msgError("请选择需要变更炉号的计划单");
     return;

+ 64 - 265
src/views/business/productionBatch/index.vue

@@ -2,202 +2,74 @@
   <div class="page-container column-container">
     <section class="list-part-container column-container" style="flex: 1">
       <!-- 搜索区 -->
-      <el-form
-        class="list-search-container"
-        :model="queryParams"
-        ref="queryRef"
-        :inline="true"
-      >
+      <el-form class="list-search-container" :model="queryParams" ref="queryRef" :inline="true">
         <el-form-item class="section-title" label="生产计划" />
         <el-form-item label="生产计划单号:">
-          <el-input
-            placeholder="请输入生产计划单号"
-            v-model.trim="queryParams.productionPlanNo"
-            @keyup.enter="handleQueryProductionPlanDetail"
-            @keydown.enter.prevent
-            clearable
-            style="width: 200px"
-          />
+          <el-input placeholder="请输入生产计划单号" v-model.trim="queryParams.productionPlanNo"
+            @keyup.enter="handleQueryProductionPlanDetail" @keydown.enter.prevent clearable style="width: 200px" />
         </el-form-item>
         <el-form-item label="产品描述:">
-          <el-input
-            placeholder="请输入产品描述"
-            v-model.trim="queryParams.keywords"
-            @keyup.enter="handleQueryProductionPlanDetail"
-            @keydown.enter.prevent
-            clearable
-            style="width: 200px"
-          />
+          <el-input placeholder="请输入产品描述" v-model.trim="queryParams.keywords"
+            @keyup.enter="handleQueryProductionPlanDetail" @keydown.enter.prevent clearable style="width: 200px" />
         </el-form-item>
 
         <el-form-item>
-          <el-button
-            type="info"
-            icon="Search"
-            @click="handleQueryProductionPlanDetail"
-          >
+          <el-button type="info" icon="Search" @click="handleQueryProductionPlanDetail">
             搜索
           </el-button>
         </el-form-item>
         <el-form-item class="section-title" label="请选择当前工段:">
-          <el-select-v2
-            v-model="queryParams.deptId"
-            filterable
-            :options="deptList"
-            placeholder="请选择工段"
-            style="width: 100%"
-            @change="handleDeptChange"
-          />
+          <el-select-v2 v-model="queryParams.deptId" filterable :options="deptList" placeholder="请选择工段"
+            style="width: 100%" @change="handleDeptChange" />
         </el-form-item>
       </el-form>
       <div class="el-table-container">
         <div class="el-table-inner-container">
-          <el-table
-            ref="planDetailTable"
-            :data="detailPlanList"
-            v-loading="detailLoading"
-            highlight-current-row
-            height="100%"
-            @current-change="handlePlanDetailCurrentChange"
-          >
-            <el-table-column
-              label="客户简称"
-              prop="companyAlias"
-              width="120"
-              align="center"
-            />
-            <el-table-column
-              label="生产计划单号"
-              prop="productionPlanNo"
-              width="110"
-              align="center"
-            />
-            <el-table-column
-              label="序号"
-              width="60"
-              prop="lineNumber"
-              align="center"
-            />
-            <el-table-column
-              label="产品描述"
-              prop="productDescription"
-              align="center"
-            />
-            <el-table-column
-              label="图纸版本"
-              prop="technologyVersion"
-              width="70"
-              align="center"
-            />
-            <el-table-column
-              label="总投产量"
-              prop="productionQuantity"
-              width="80"
-              align="center"
-            />
-            <el-table-column
-              label="总批数"
-              prop="totalLotNumber"
-              width="70"
-              align="center"
-            />
-            <el-table-column
-              label="单批量"
-              prop="oneLotQuantity"
-              width="80"
-              align="center"
-            />
-            <el-table-column
-              label="尾批量"
-              prop="lastLotQuantity"
-              width="80"
-              align="center"
-            />
-            <el-table-column
-              label="追增批数"
-              prop="superadditionTotalNumber"
-              width="80"
-              align="center"
-            />
-            <el-table-column
-              label="批号状态"
-              prop="lotCodeStatusCode"
-              width="100"
-              align="center"
-            >
+          <el-table ref="planDetailTable" :data="detailPlanList" v-loading="detailLoading" highlight-current-row
+            height="100%" @current-change="handlePlanDetailCurrentChange">
+            <el-table-column label="客户简称" prop="companyAlias" width="120" align="center" />
+            <el-table-column label="生产计划单号" prop="productionPlanNo" width="110" align="center" />
+            <el-table-column label="序号" width="60" prop="lineNumber" align="center" />
+            <el-table-column label="产品描述" prop="productDescription" align="center" />
+            <el-table-column label="图纸版本" prop="technologyVersion" width="70" align="center" />
+            <el-table-column label="总投产量" prop="productionQuantity" width="80" align="center" />
+            <el-table-column label="总批数" prop="totalLotNumber" width="70" align="center" />
+            <el-table-column label="单批量" prop="oneLotQuantity" width="80" align="center" />
+            <el-table-column label="尾批量" prop="lastLotQuantity" width="80" align="center" />
+            <el-table-column label="追增批数" prop="superadditionTotalNumber" width="80" align="center" />
+            <el-table-column label="批号状态" prop="lotCodeStatusCode" width="100" align="center">
               <template #default="scope">
-                <dict-tag
-                  :options="lot_code_status_code"
-                  :value="scope.row.lotCodeStatusCode"
-                />
+                <dict-tag :options="lot_code_status_code" :value="scope.row.lotCodeStatusCode" />
               </template>
             </el-table-column>
-            <el-table-column
-              label="累计投产量"
-              prop="pickUpQuantity"
-              width="80"
-              align="center"
-            />
-            <el-table-column
-              label="累计投产批数"
-              prop="lotTotalNumber"
-              width="90"
-              align="center"
-            />
+            <el-table-column label="累计投产量" prop="pickUpQuantity" width="80" align="center" />
+            <el-table-column label="累计投产批数" prop="lotTotalNumber" width="90" align="center" />
             <!-- <el-table-column label="库位" prop="storageLocation" width="80" align="center" /> -->
-            <el-table-column
-              label="领料部门"
-              prop="requisitionDepartmentName"
-              width="100"
-              align="center"
-            >
+            <el-table-column label="领料部门" prop="requisitionDepartmentName" width="100" align="center">
               <template #default="scope">
                 <span>{{ scope.row.requisitionDepartmentName }}</span>
               </template>
             </el-table-column>
-            <el-table-column
-              label="下达日期"
-              prop="issueDate"
-              width="100"
-              align="center"
-            />
-            <el-table-column
-              label="操作"
-              width="240"
-              align="center"
-              fixed="right"
-            >
+            <el-table-column label="下达日期" prop="issueDate" width="100" align="center" />
+            <el-table-column label="是否废品回用" prop="planType" width="90" align="center">
               <template #default="scope">
-                <el-button
-                  link
-                  type="success"
-                  icon="View"
-                  @click="handleCheckMarterialInfo(scope.row)"
-                  >领料信息
+                {{ scope.row.planType == 'HY' ? '是' : '否' }}
+              </template>
+            </el-table-column>
+            <el-table-column label="操作" width="240" align="center" fixed="right">
+              <template #default="scope">
+                <el-button link type="success" icon="View" @click="handleCheckMarterialInfo(scope.row)">领料信息
                 </el-button>
-                <el-button
-                  :disabled="
-                    !(
-                      queryParams.deptId == scope.row.requisitionDepartmentId
-                    ) || scope.row.totalLotNumber == scope.row.lotTotalNumber
-                  "
-                  link
-                  type="primary"
-                  icon="Postcard"
-                  @click="handleAddSubDetail(scope.row)"
-                  v-hasPermi="['business:productionBatch:add']"
-                  >投产
+                <el-button :disabled="!(
+                  queryParams.deptId == scope.row.requisitionDepartmentId
+                ) || scope.row.totalLotNumber == scope.row.lotTotalNumber
+                  " link type="primary" icon="Postcard" @click="handleAddSubDetail(scope.row)"
+                  v-hasPermi="['business:productionBatch:add']">投产
                 </el-button>
-                <el-button
-                  v-if="
-                    scope.row.lotTotalNumber && scope.row.lotTotalNumber > 0
-                  "
-                  v-hasPermi="['business:productionBatch:check']"
-                  link
-                  type="warning"
-                  icon="Search"
-                  @click="handleCheckLotInfo(scope.row)"
-                  >批次信息
+                <el-button v-if="
+                  scope.row.lotTotalNumber && scope.row.lotTotalNumber > 0
+                " v-hasPermi="['business:productionBatch:check']" link type="warning" icon="Search"
+                  @click="handleCheckLotInfo(scope.row)">批次信息
                 </el-button>
                 <!-- <el-button
                   icon="edit"
@@ -213,13 +85,8 @@
       </div>
     </section>
     <!-- 分页 -->
-    <pagination
-      v-show="total > 0"
-      :total="total"
-      v-model:page="queryParams.pageNum"
-      v-model:limit="queryParams.pageSize"
-      @pagination="getProductionPlanDetail"
-    />
+    <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
+      v-model:limit="queryParams.pageSize" @pagination="getProductionPlanDetail" />
 
     <section class="list-part-container row-container" style="flex: 1">
       <section class="list-part-container" style="flex: 4">
@@ -230,98 +97,33 @@
         </el-form>
         <div class="el-table-container">
           <div class="el-table-inner-container">
-            <el-table
-              ref="subDetailsTable"
-              v-loading="subDetailsLoading"
-              :data="subList"
-              highlight-current-row
-              height="100%"
-            >
-              <el-table-column
-                type="index"
-                label="行号"
-                width="50"
-                align="center"
-              />
-              <el-table-column
-                label="生产计划单号"
-                prop="productionPlanNo"
-                width="110"
-                align="center"
-              />
-              <el-table-column
-                label="产品描述"
-                prop="productDescription"
-                align="center"
-              />
-              <el-table-column
-                label="首序投产量"
-                prop="productionQuantity"
-                width="80"
-                align="center"
-              />
-              <el-table-column
-                label="首序投产批数"
-                prop="lotNumber"
-                width="100"
-                align="center"
-              >
+            <el-table ref="subDetailsTable" v-loading="subDetailsLoading" :data="subList" highlight-current-row
+              height="100%">
+              <el-table-column type="index" label="行号" width="50" align="center" />
+              <el-table-column label="生产计划单号" prop="productionPlanNo" width="110" align="center" />
+              <el-table-column label="产品描述" prop="productDescription" align="center" />
+              <el-table-column label="首序投产量" prop="productionQuantity" width="80" align="center" />
+              <el-table-column label="首序投产批数" prop="lotNumber" width="100" align="center">
                 <template #default="scope">
-                  <el-input-number
-                    v-if="scope.row.editStatus"
-                    v-model="scope.row.lotNumber"
-                    placeholder="当前投产批数"
-                    :controls="false"
-                    :precision="0"
-                    :min="0"
-                    :max="scope.row.totalLotNumber"
-                    align="center"
-                  />
+                  <el-input-number v-if="scope.row.editStatus" v-model="scope.row.lotNumber" placeholder="当前投产批数"
+                    :controls="false" :precision="0" :min="0" :max="scope.row.totalLotNumber" align="center" />
                   <span v-else>{{ scope.row.lotNumber }}</span>
                 </template>
               </el-table-column>
-              <el-table-column
-                label="下达日期"
-                prop="issuanceDate"
-                width="120"
-                align="center"
-              >
+              <el-table-column label="下达日期" prop="issuanceDate" width="120" align="center">
                 <template #default="scope">
-                  <el-date-picker
-                    v-if="scope.row.editStatus"
-                    clearable
-                    v-model="scope.row.issuanceDate"
-                    type="date"
-                    value-format="YYYY-MM-DD"
-                    placeholder="请选择实际开始 时间"
-                  />
+                  <el-date-picker v-if="scope.row.editStatus" clearable v-model="scope.row.issuanceDate" type="date"
+                    value-format="YYYY-MM-DD" placeholder="请选择实际开始 时间" />
                   <span v-else>{{ scope.row.issuanceDate }}</span>
                 </template>
               </el-table-column>
-              <el-table-column
-                label="操作"
-                width="150"
-                align="center"
-                v-if="flag"
-              >
+              <el-table-column label="操作" width="150" align="center" v-if="flag">
                 <template #default="scope">
-                  <el-button
-                    v-if="!scope.row.editStatus"
-                    icon="edit"
-                    link
-                    type="warning"
-                    @click="handleShowSubDetailDialog(scope.row)"
-                    v-hasPermi="['business:productionBatch:edit']"
-                    >编辑
+                  <el-button v-if="!scope.row.editStatus" icon="edit" link type="warning"
+                    @click="handleShowSubDetailDialog(scope.row)" v-hasPermi="['business:productionBatch:edit']">编辑
                   </el-button>
-                  <el-button
-                    v-if="!scope.row.editStatus"
-                    icon="delete"
-                    link
-                    type="danger"
-                    @click="handleDelSubDetail(scope.row)"
-                    v-hasPermi="['business:productionBatch:remove']"
-                    >删除
+                  <el-button v-if="!scope.row.editStatus" icon="delete" link type="danger"
+                    @click="handleDelSubDetail(scope.row)" v-hasPermi="['business:productionBatch:remove']">删除
                   </el-button>
                 </template>
               </el-table-column>
@@ -331,10 +133,7 @@
       </section>
     </section>
     <!-- 投产表单 -->
-    <production-lot-form
-      ref="productionRef"
-      @handleSaveSuccess="handleFresh()"
-    />
+    <production-lot-form ref="productionRef" @handleSaveSuccess="handleFresh()" />
     <!-- 领料信息弹窗 -->
     <check-material ref="checkMaterialRef" />
     <lot-info ref="lotInfoRef" @handleSaveSuccess="handleFresh()" />
@@ -597,12 +396,12 @@ function handleDelSubDetail(row) {
         updateLotCodeStatus({
           id: currentPlanDetail.value.id,
           lotCodeStatusCode: "NA",
-        }).then((res) => {});
+        }).then((res) => { });
       }
       handleFresh();
       proxy.$modal.msgSuccess("删除成功!");
     })
-    .catch(() => {});
+    .catch(() => { });
 }
 onMounted(() => {
   // getProductionPlanDetail();

+ 27 - 20
src/views/business/specialDaywork/form.vue

@@ -116,7 +116,7 @@
               <el-col :span="6">
                 <span class="middleInfo">炉号:</span>
                 <el-select style="width: 200px" v-model="furnaceNoInfo" placeholder="请选择炉号" value-key="index"
-                  :clearable="false" @change="handleMiddleInfoChange" v-if="!isEdit">
+                  :clearable="false" @change="handleMiddleInfoChange" v-if="!isEdit && daywork.planType != 'HY'">
                   <el-option v-for="info in furnaceNumberInfoList" :key="info.index" :label="info.text"
                     :value="info.value">
                     <span style="float: left">{{ info.text }}</span>
@@ -252,15 +252,12 @@
             </el-table-column>
             <el-table-column label="序号" align="center" width="60" prop="lineNumber">
             </el-table-column>
-
             <el-table-column label="产品描述" align="center" prop="productDescription">
             </el-table-column>
-
             <el-table-column label="批次号" align="center" prop="lotCode">
             </el-table-column>
             <el-table-column label="箱号" align="center" prop="carrierName">
             </el-table-column>
-
             <el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width" width="80">
               <template #default="scope">
                 <el-button link :disabled="lotClick" type="primary" icon="Finished"
@@ -687,6 +684,8 @@ function handleFirstSelectProduction(row) {
       daywork.value.productDescription = row.productDescription;
       daywork.value.productionPlanNo = row.productionPlanNo;
       daywork.value.lineNumber = row.lineNumber;
+      daywork.value.planType = row.planType;
+      batchNo.value.planType = row.planType
 
       getFurnaceInfo(batchNo.value);
     } else {
@@ -827,22 +826,30 @@ function handleFirstLotClick() {
 function getFurnaceInfo(data) {
   furnaceNumberInfoList.value = [];
   furnaceNoInfo.value = {};
-  getFurnaceNoInfo({
-    productionPlanNo: daywork.value.productionPlanNo,
-    lineNumber: daywork.value.lineNumber,
-  }).then((res) => {
-    if (res.code === 200 && res.data.length > 0) {
-      res.data.forEach((item, index) => {
-        furnaceNumberInfoList.value[index] = {
-          text: item.furnaceNumber,
-          value: { ...item, index: index },
-          index: index,
-        };
-      });
-      furnaceNoInfo.value = furnaceNumberInfoList.value[0].value;
-      daywork.value.furnaceNoInfo = furnaceNumberInfoList.value[0].value;
+  if (daywork.value.planType == 'HY') {
+    furnaceNoInfo.value = {
+      furnaceNumber: '废品回用',
+      firstTechnicalRequirement: '废品回用'
     }
-  });
+    daywork.value.furnaceNoInfo = furnaceNoInfo.value;
+  } else {
+    getFurnaceNoInfo({
+      productionPlanNo: daywork.value.productionPlanNo,
+      lineNumber: daywork.value.lineNumber,
+    }).then((res) => {
+      if (res.code === 200 && res.data.length > 0) {
+        res.data.forEach((item, index) => {
+          furnaceNumberInfoList.value[index] = {
+            text: item.furnaceNumber,
+            value: { ...item, index: index },
+            index: index,
+          };
+        });
+        furnaceNoInfo.value = furnaceNumberInfoList.value[0].value;
+        daywork.value.furnaceNoInfo = furnaceNumberInfoList.value[0].value;
+      }
+    });
+  }
 }
 
 const debouncedRemoteCarriers = debounce(remoteCarriers, 500);
@@ -1034,7 +1041,7 @@ function handleQueryProuct() {
 
 /** 提交按钮 */
 function handleSave() {
-  const upLimitForReport = Number(report_up_limit[0].dictValue) / 100
+  const upLimitForReport = Number(report_up_limit.value[0].dictValue) / 100
   if (dayworkItemList.value.length == 0) {
     proxy.$modal.msgError("请添加报工信息");
     return;