Sfoglia il codice sorgente

Merge branch 'master' of http://120.46.159.163:7400/ezhizao/ezhizao_dms_vue

ezhizao 1 anno fa
parent
commit
c395903e77

+ 192 - 181
src/views/business/daywork/index.vue

@@ -4,141 +4,146 @@
     <section class="list-part-container" style="flex: 3">
       <!-- 搜索区 -->
       <el-form
-          class="list-search-container"
-          :model="queryDayworkParams"
-          ref="queryRef"
-          :inline="true"
-          style="margin-right: 0px"
+        class="list-search-container"
+        :model="queryDayworkParams"
+        ref="queryRef"
+        :inline="true"
+        style="margin-right: 0px"
       >
-        <el-form-item class="section-title" label="生产批次"/>
+        <el-form-item class="section-title" label="生产批次" />
         <el-form-item label="生产计划单号:">
           <el-input
-              placeholder="请输入生产计划单号/批次号"
-              v-model.trim="queryDayworkParams.productionPlanNo"
-              @keydown.enter.prevent
-              clearable
-              style="width: 200px"
+            placeholder="请输入生产计划单号/批次号"
+            v-model.trim="queryDayworkParams.productionPlanNo"
+            @keydown.enter.prevent
+            clearable
+            style="width: 200px"
           />
         </el-form-item>
         <el-form-item label="产品描述:">
           <el-input
-              placeholder="请输入产品描述"
-              v-model.trim="queryDayworkParams.productDescription"
-              @keydown.enter.prevent
-              clearable
-              style="width: 130px"
+            placeholder="请输入产品描述"
+            v-model.trim="queryDayworkParams.productDescription"
+            @keydown.enter.prevent
+            clearable
+            style="width: 130px"
           />
         </el-form-item>
         <el-form-item class="section-title" label="请选择当前工段:">
           <el-select-v2
-              v-model="queryDayworkParams.deptId"
-              :options="deptList"
-              placeholder="请选择工段"
-              style="width: 140px"
-              @change="handleDeptChange"
+            v-model="queryDayworkParams.deptId"
+            :options="deptList"
+            placeholder="请选择工段"
+            style="width: 140px"
+            @change="handleDeptChange"
           />
         </el-form-item>
         <el-form-item style="margin-left: 0">
           <el-button
-              type="info"
-              icon="Search"
-              :disabled="deptList.length === 0"
-              @click="handleQuery"
-          >搜索
+            type="info"
+            icon="Search"
+            :disabled="deptList.length === 0"
+            @click="handleQuery"
+            >搜索
           </el-button>
         </el-form-item>
       </el-form>
       <div class="el-table-container">
         <div class="el-table-inner-container">
           <el-table
-              ref="dayworkTable"
-              :data="dayworkList"
-              v-loading="dayworkLoading"
-              highlight-current-row
-              height="100%"
-              @current-change="handleDayworkCurrentChange"
+            ref="dayworkTable"
+            :data="dayworkList"
+            v-loading="dayworkLoading"
+            highlight-current-row
+            height="100%"
+            @current-change="handleDayworkCurrentChange"
           >
             <el-table-column
-                label="客户简称"
-                prop="companyAlias"
-                width="120"
-                align="center"
+              label="客户简称"
+              prop="companyAlias"
+              width="120"
+              align="center"
             />
             <el-table-column
-                label="生产计划单号"
-                prop="productionPlanNo"
-                width="100"
-                align="center"
-            />
-            <el-table-column
-                label="批次号"
-                prop="lotCode"
-                width="120"
-                align="center"
+              label="生产计划单号"
+              prop="productionPlanNo"
+              width="100"
+              align="center"
             />
+            <el-table-column label="批次号" prop="lotCode" align="center">
+              <template #default="scope">
+                <el-button
+                  link
+                  type="primary"
+                  v-hasPermi="['business:productionPlan:query']"
+                  @click="handleColumnClick(scope.row)"
+                  ><span>{{ scope.row.lotCode }}</span></el-button
+                >
+              </template>
+            </el-table-column>
             <el-table-column
-                label="产品描述"
-                prop="productDescription"
-                align="center"
+              label="产品描述"
+              prop="productDescription"
+              align="center"
             />
             <el-table-column
-                label="图纸版本"
-                prop="technologyVersion"
-                width="60"
-                align="center"
+              label="图纸版本"
+              prop="technologyVersion"
+              width="60"
+              align="center"
             />
             <el-table-column
-                label="投产量"
-                prop="productionQuantity"
-                width="60"
-                align="center"
+              label="投产量"
+              prop="productionQuantity"
+              width="60"
+              align="center"
             />
             <el-table-column
-                label="下达日期"
-                prop="createTime"
-                width="100"
-                align="center"
+              label="下达日期"
+              prop="createTime"
+              width="100"
+              align="center"
             >
               <template #default="scope">
                 <span>{{
-                    proxy.moment(scope.row.createTime).format("YYYY-MM-DD")
-                  }}</span>
+                  proxy.moment(scope.row.createTime).format("YYYY-MM-DD")
+                }}</span>
               </template>
             </el-table-column>
             <el-table-column
-                label="报工总时长"
-                prop="totalWorkingHours"
-                width="150"
-                align="center"
+              label="报工总时长"
+              prop="totalWorkingHours"
+              width="150"
+              align="center"
             />
           </el-table>
         </div>
       </div>
       <!-- 分页 -->
       <pagination
-          v-show="total > 0"
-          :total="total"
-          v-model:page="queryDayworkParams.pageNum"
-          v-model:limit="queryDayworkParams.pageSize"
-          @pagination="getDayworks"
+        v-show="total > 0"
+        :total="total"
+        v-model:page="queryDayworkParams.pageNum"
+        v-model:limit="queryDayworkParams.pageSize"
+        @pagination="getDayworks"
       />
     </section>
     <!-- 右侧区域 -->
     <section class="list-part-container" style="flex: 2">
       <el-form class="list-search-container" :inline="true">
-        <el-form-item class="section-title" label="报工信息"/>
+        <el-form-item class="section-title" label="报工信息" />
         <el-form-item
-            class="section-title"
-            label="请选择工序:"
-            prop="processId"
+          class="section-title"
+          label="请选择工序:"
+          prop="processId"
         >
           <el-select-v2
-              v-model="queryItemParams.processId"
-              clearable
-              :options="processList"
-              placeholder="请选择工序"
-              style="width: 100%"
-              @change="handleProcessChange"
+            v-model="queryItemParams.processId"
+            clearable
+            :options="processList"
+            placeholder="请选择工序"
+            style="width: 100%"
+            @change="handleProcessChange"
           />
         </el-form-item>
       </el-form>
@@ -146,96 +151,94 @@
       <div class="el-table-container">
         <div class="el-table-inner-container">
           <el-table
-              :data="dayworkItemList"
-              v-loading="dayworkItemLoading"
-              height="100%"
+            :data="dayworkItemList"
+            v-loading="dayworkItemLoading"
+            height="100%"
           >
             <el-table-column
-                label="操作者"
-                prop="nickName"
-                width="60"
-                align="center"
+              label="操作者"
+              prop="nickName"
+              width="60"
+              align="center"
             />
             <el-table-column
-                label="工序名称"
-                prop="processAlias"
-                align="center"
+              label="工序名称"
+              prop="processAlias"
+              align="center"
             />
             <el-table-column
-                label="投产量"
-                prop="prodNum"
-                width="60"
-                align="center"
+              label="投产量"
+              prop="prodNum"
+              width="60"
+              align="center"
             />
             <el-table-column
-                label="合格数"
-                prop="qualifiedNum"
-                width="60"
-                align="center"
+              label="合格数"
+              prop="qualifiedNum"
+              width="60"
+              align="center"
             />
             <el-table-column
-                label="废品数"
-                prop="rejectNum"
-                width="60"
-                align="center"
+              label="废品数"
+              prop="rejectNum"
+              width="60"
+              align="center"
             />
             <el-table-column
-                label="开始时间"
-                prop="startTime"
-                width="160"
-                align="center"
+              label="开始时间"
+              prop="startTime"
+              width="160"
+              align="center"
             />
             <el-table-column
-                label="结束时间"
-                prop="endTime"
-                width="160"
-                align="center"
+              label="结束时间"
+              prop="endTime"
+              width="160"
+              align="center"
             />
             <el-table-column
-                label="总工时"
-                prop="workingHours"
-                width="160"
-                align="center"
+              label="总工时"
+              prop="workingHours"
+              width="160"
+              align="center"
             />
             <el-table-column
-                label="生产状态"
-                prop="status"
-                width="100"
-                align="center"
+              label="生产状态"
+              prop="status"
+              width="100"
+              align="center"
             >
               <template #default="scope">
-                <dict-tag :options="daywork_status" :value="scope.row.status"/>
+                <dict-tag :options="daywork_status" :value="scope.row.status" />
               </template>
             </el-table-column>
             <el-table-column
-                fixed="right"
-                label="操作"
-                align="center"
-                width="70px"
+              fixed="right"
+              label="操作"
+              align="center"
+              width="70px"
             >
               <template #default="scope">
                 <el-button
-                    v-if="
+                  v-if="
                     scope.row.deptProcessStatus &&
                     (scope.row.status == 2 || scope.row.status == 3) &&
                     scope.row.processId == latestProcessId
                   "
-                    link
-                    type="warning"
-                    icon="Edit"
-                    @click="handleUpdateDayworkItem(scope.row)"
-                >编辑
-                </el-button
-                >
+                  link
+                  type="warning"
+                  icon="Edit"
+                  @click="handleUpdateDayworkItem(scope.row)"
+                  >编辑
+                </el-button>
                 <el-button
-                    v-else
-                    link
-                    type="primary"
-                    icon="View"
-                    @click="handleCheckDayworkItem(scope.row)"
-                >查看
-                </el-button
-                >
+                  v-else
+                  link
+                  type="primary"
+                  icon="View"
+                  @click="handleCheckDayworkItem(scope.row)"
+                  >查看
+                </el-button>
               </template>
             </el-table-column>
           </el-table>
@@ -243,17 +246,17 @@
       </div>
       <!-- 分页 -->
       <pagination
-          v-show="itemTotal > 0"
-          :total="itemTotal"
-          v-model:page="queryItemParams.pageNum"
-          v-model:limit="queryItemParams.pageSize"
-          @pagination="getDayworkItems"
+        v-show="itemTotal > 0"
+        :total="itemTotal"
+        v-model:page="queryItemParams.pageNum"
+        v-model:limit="queryItemParams.pageSize"
+        @pagination="getDayworkItems"
       />
     </section>
     <!-- 报工信息表单 -->
     <daywork-item-form
-        ref="dayworkItemRef"
-        @handleSaveSuccess="handleGetDayworkItems"
+      ref="dayworkItemRef"
+      @handleSaveSuccess="handleGetDayworkItems"
     />
   </div>
 </template>
@@ -264,14 +267,15 @@ import {
   listDayworkItem,
   getProcessList,
 } from "@/api/business/daywork.js";
-import {listDeptProcess} from "@/api/business/deptProcess";
-import {getDept} from "@/api/business/planDetailSubDetail.js";
+import { listDeptProcess } from "@/api/business/deptProcess";
+import { getDept } from "@/api/business/planDetailSubDetail.js";
+import router from "@/router";
 import dayworkItemForm from "./form";
 
-const {proxy} = getCurrentInstance();
+const { proxy } = getCurrentInstance();
 
 /** 字典 */
-const {daywork_status} = proxy.useDict("daywork_status");
+const { daywork_status } = proxy.useDict("daywork_status");
 
 /** 生产批次 */
 const dayworkList = ref([]);
@@ -345,27 +349,31 @@ function getDayworks() {
     // 批次
     if (dayworkList.value.length > 0) {
       proxy.$refs.dayworkTable.setCurrentRow(dayworkList.value[0]);
-    }
-    else {
+    } else {
       dayworkItemList.value = [];
-      itemTotal.value = 0
+      itemTotal.value = 0;
     }
   });
 }
 
+/** 打开批次详情页 */
+function handleColumnClick(row) {
+  router.push({ path: "/reviseBath/lotFormParticulars/" + row.lotCode });
+}
+
 /** 生产计划明细 current-change 事件 */
 function handleDayworkCurrentChange(row) {
   if (row) {
-    queryItemParams.value.processId = null
+    queryItemParams.value.processId = null;
     currentDaywork.value = row;
     queryItemParams.value.dayworkId = currentDaywork.value.id;
     queryItemParams.value.technologicalProcessDetailId = null;
     queryItemParams.value.technologicalProcessId = row.technologicalProcessId;
     getDayworkItems();
-    getProcess()
+    getProcess();
   } else {
     dayworkItemList.value = [];
-    itemTotal.value = 0
+    itemTotal.value = 0;
   }
 }
 
@@ -405,22 +413,25 @@ function handleUpdateDayworkItem(row) {
   let totalQuailifiedNum = 0;
   for (let i = 0; i < dayworkItemList.value.length; i++) {
     if (
-        row.processId == dayworkItemList.value[i].processId &&
-        (dayworkItemList.value[i].status == 2 ||
-            dayworkItemList.value[i].status == 3) &&
-        row.id != dayworkItemList.value[i].id
+      row.processId == dayworkItemList.value[i].processId &&
+      (dayworkItemList.value[i].status == 2 ||
+        dayworkItemList.value[i].status == 3) &&
+      row.id != dayworkItemList.value[i].id
     ) {
       totalQuailifiedNum += dayworkItemList.value[i].qualifiedNum;
     }
     if (
-        row.processId == dayworkItemList.value[i].processId &&
-        dayworkItemList.value[i].status == 3 &&
-        row.id != dayworkItemList.value[i].id
+      row.processId == dayworkItemList.value[i].processId &&
+      dayworkItemList.value[i].status == 3 &&
+      row.id != dayworkItemList.value[i].id
     ) {
       processFinish = true;
     }
   }
-  let maxQuailifiedNum = (Math.floor(row.prodNum * 1.03 - totalQuailifiedNum))>0?Math.floor(row.prodNum * 1.03 - totalQuailifiedNum):0;
+  let maxQuailifiedNum =
+    Math.floor(row.prodNum * 1.03 - totalQuailifiedNum) > 0
+      ? Math.floor(row.prodNum * 1.03 - totalQuailifiedNum)
+      : 0;
   //该daywork合格数总数不能超过投产数的103%
   row.technologicalProcessId = queryItemParams.value.technologicalProcessId;
   row.deptId = queryDayworkParams.value.deptId;
@@ -474,20 +485,20 @@ function handleProcessChange() {
 function getDayworkItems() {
   dayworkItemLoading.value = true;
   //查询该工段在工段资源分配时绑定的工序,传一个flag,如果flag有值则后端查询不分页
-  listDeptProcess({deptId: queryDayworkParams.value.deptId, flag: 1}).then(
-      (res) => {
-        deptProcessList.value = res.rows;
-      }
+  listDeptProcess({ deptId: queryDayworkParams.value.deptId, flag: 1 }).then(
+    (res) => {
+      deptProcessList.value = res.rows;
+    }
   );
   listDayworkItem(queryItemParams.value).then((res) => {
-    console.log(currentDaywork.value)
+    console.log(currentDaywork.value);
     for (let i = 0; i < res.rows.length; i++) {
       //如果时首序,投产数是单批数
       if (res.rows[i].prodNum == 0) {
-        if(currentDaywork.value.isLast == 1) {
+        if (currentDaywork.value.isLast == 1) {
           res.rows[i].prodNum = currentDaywork.value.lastLotQuantity;
-        }else {
-        res.rows[i].prodNum = currentDaywork.value.oneLotQuantity;
+        } else {
+          res.rows[i].prodNum = currentDaywork.value.oneLotQuantity;
         }
       }
       //拿到最新一条报工信息的工序id,只能编辑当前序
@@ -511,19 +522,19 @@ function getDayworkItems() {
       }
     }
     dayworkItemList.value = res.rows;
-    getProcess()
+    getProcess();
     itemTotal.value = res.total;
     dayworkItemLoading.value = false;
   });
 }
 //工序信息
 function getProcess() {
- //工序下拉框
- getProcessList({
-      technologicalProcessId: queryItemParams.value.technologicalProcessId,
-    }).then((res) => {
-      processList.value = res.data;
-    });
+  //工序下拉框
+  getProcessList({
+    technologicalProcessId: queryItemParams.value.technologicalProcessId,
+  }).then((res) => {
+    processList.value = res.data;
+  });
 }
 
 /** 搜索按钮操作 */

+ 53 - 18
src/views/business/lot/InBatchesDialog.vue

@@ -68,7 +68,7 @@
             <div style="display: flex; flex-direction: row;">
               <div style="line-height: 32px;">分批信息</div>
               <el-form-item label="分批数量" style="margin-bottom: 0px;">
-                <el-input-number v-model="baseLot.sparateNum" :controls="false" @blur="handleNumBlur" />
+                <el-input-number v-model="baseLot.sparateNum" :controls="false" @blur="handleNumBlur" :max="10" />
               </el-form-item>
             </div>
             <el-divider />
@@ -90,10 +90,16 @@
               </el-col>
               <el-col :span="8">
                 <el-form-item label="分批载具:">
-                  <el-select-v2 v-model="e.carrierSelection"
+                  <!-- <el-select-v2 v-model="e.carrierSelection"
                     :disabled="e.id === baseLot.id || baseLot.currentDept == null" multiple filterable
                     collapse-tags-tooltip collapse-tags clearable :options="carriers" placeholder="请选择载具"
-                    style="width: 100%" />
+                    style="width: 100%" /> -->
+                  <el-select v-model="e.carrierSelection" :disabled="e.id === baseLot.id || baseLot.currentDept == null"
+                    multiple filterable remote reserve-keyword placeholder="请选择载具" collapse-tags-tooltip collapse-tags
+                    :remote-method="(arg) => remoteCarriers(arg, e.carriers)" :loading="loadingCarrier"
+                    @change="(arg) => handleCarrierChange(arg, e)">
+                    <el-option v-for="item in carriers" :key="item.value" :label="item.label" :value="item.value" />
+                  </el-select>
                 </el-form-item>
               </el-col>
             </el-row>
@@ -109,8 +115,16 @@
 </template>
 <script setup>
 import { getLotInfoForInBatches, listCarriers, saveInBatches } from '@/api/business/lot'
+import { toRefs } from 'vue';
 // import {}
 const { proxy } = getCurrentInstance();
+const props = defineProps({
+  getList: {
+    type: Function,
+    default: () => { }
+  }
+})
+const { getList } = toRefs(props);
 /**工段弹窗变量 */
 const total = ref(0);
 const baseLot = ref({
@@ -144,24 +158,32 @@ function open(data) {
 }
 
 function getCarriers() {
-  listCarriers({ isAbandoned: 0 }).then(res => {
+  listCarriers({ isAbandoned: 0, pageSize: 200 }).then(res => {
+    if (res.code === 200) {
+      carriers.value.push(...res.rows.map(v => ({ value: v.id, label: v.code })))
+    }
+  })
+}
+
+function remoteCarriers(queryString, choiced) {
+  loadingCarrier.value = true
+  listCarriers({ isAbandoned: 0, pageSize: 200, code: queryString != '' ? queryString : null }).then(res => {
     if (res.code === 200) {
       carriers.value = res.rows.map(v => ({ value: v.id, label: v.code }))
+      carriers.value.push(...choiced.filter(v => !carriers.value.map(e => e.value).includes(v.id)).map(v => ({ value: v.id, label: v.code })))
+    } else {
+      carriers.value = []
+      carriers.value.push(...choiced)
     }
+    console.log(carriers.value)
+    loadingCarrier.value = false
   })
 }
 
-// function remoteCarriers(queryString) {
-//   loadingCarrier.value = true
-//   listCarriers({ isAbandoned: 0, pageSize: 200, code: queryString != '' ? queryString : null }).then(res => {
-//     if (res.code === 200) {
-//       carriers.value = res.rows.map(v => ({ value: v.id, label: v.code }))
-//     } else {
-//       carriers.value = []
-//     }
-//     loadingCarrier.value = false
-//   })
-// }
+function handleCarrierChange(arg, item) {
+  item.carriers = carriers.value.filter(v => arg.includes(v.value)).map(v => ({ id: v.value, code: v.label }))
+}
+
 
 function loadLot() {
   getLotInfoForInBatches({ id: baseLot.value.id }).then(res => {
@@ -174,6 +196,8 @@ function loadLot() {
       baseLot.value.carriers = res.data.carriers
       baseLot.value.sparateNum = 0
       baseLot.value.latestLotCode = res.data.latestLotCode
+      baseLot.value.productId = res.data.productId
+      carriers.value.push(...res.data.carriers.map(v => ({ value: v.id, label: v.code })))
     }
   })
 }
@@ -207,7 +231,7 @@ function handleSave() {
   let num = 0
   let qualified = 0
   baseLot.value.sparateList.forEach(e => {
-    num += e.prodNum
+    num += e.lotNumber
     qualified += e.qualifiedNum
   })
   const prodNum = !!baseLot.value.prodNum ? baseLot.value.prodNum : baseLot.value.productionQuantity
@@ -226,7 +250,10 @@ function handleSave() {
     })
     return
   }
-  const saveDate = { ...baseLot.value, sparateList: baseLot.value.sparateList.map(v => ({ ...v, carriers: v.id === baseLot.id ? v.carriers : carrierSelection.map(e => ({ id: e })) })) }
+  // const saveDate = { ...baseLot.value, sparateList: baseLot.value.sparateList.map(v => ({ ...v, carriers: v.id === baseLot.id ? v.carriers : v.carrierSelection.map(e => ({ id: e })) })) }
+  // const saveDate = { ...baseLot.value }
+  const saveDate = { id: baseLot.value.id, lotCode: baseLot.value.lotCode, sparateList: baseLot.value.sparateList.map(v => ({ id: v.id, fromId: v.fromId, lotNumber: v.lotNumber, qualifiedNum: v.qualifiedNum, productionPlanDetailId: v.productionPlanDetailId, technologicalProcessId: v.technologicalProcessId, technologyVersion: v.technologyVersion, productId: v.productId, productionQuantity: v.lotNumber, lotCode: v.lotCode, carriers: v.id === baseLot.id ? v.carriers : v.carrierSelection.map(e => ({ id: e })) })) }
+
   // 提交分批结果
   saveInBatches(saveDate).then(res => {
     if (res.code === 200) {
@@ -235,6 +262,7 @@ function handleSave() {
         message: '分批成功'
       })
       close()
+      getList.value()
     } else {
       proxy.$message({
         type: 'error',
@@ -248,9 +276,11 @@ function handleNumBlur() {
   // 分批数量修改
   baseLot.value.sparateList = []
   const prodNum = !!baseLot.value.prodNum ? baseLot.value.prodNum : baseLot.value.productionQuantity
+  const qualifiedNum = !!baseLot.value.qualifiedNum ? baseLot.value.qualifiedNum : 0
   const arg = baseLot.value.sparateNum
   const latestLotCode = baseLot.value.latestLotCode
-  if ((latestLotCode.charAt(latestLotCode.length - 1) + arg - 1) > 9) {
+  // debugger
+  if ((Number(latestLotCode.charAt(latestLotCode.length - 1)) + arg - 1) > 9) {
     proxy.$message({
       type: 'warning',
       message: '总分批书里不能大于9'
@@ -262,10 +292,13 @@ function handleNumBlur() {
     if (i === 0) {
       // 第一条
       item.lotNumber = Math.ceil(prodNum / arg)
+      item.qualifiedNum = Math.ceil(qualifiedNum / arg)
       item.carrierSelection = baseLot.value.carriers.map(v => v.id)
     } else if ((i + 1) === arg) {
       item.lotNumber = prodNum - (Math.ceil(prodNum / arg) * (arg - 1))
       item.lotCode = baseLot.value.latestLotCode.slice(0, -1) + (Number(latestLotCode.charAt(latestLotCode.length - 1)) + i)
+      item.qualifiedNum = qualifiedNum - (Math.ceil(qualifiedNum / arg) * (arg - 1))
+      item.fromId = baseLot.value.id
       item.id = null
       item.lotId = null
       item.last = 0
@@ -273,8 +306,10 @@ function handleNumBlur() {
     } else {
       item.id = null
       item.lotId = null
+      item.fromId = baseLot.value.id
       item.lotCode = baseLot.value.latestLotCode.slice(0, -1) + (Number(latestLotCode.charAt(latestLotCode.length - 1)) + i)
       item.lotNumber = Math.ceil(prodNum / arg)
+      item.qualifiedNum = Math.ceil(qualifiedNum / arg)
       item.fromId = baseLot.value.id
       item.last = 0
       item.carrierSelection = []

+ 43 - 189
src/views/business/lot/index.vue

@@ -1,225 +1,87 @@
 <template>
   <div class="page-container column-container">
     <!-- 搜索区 -->
-    <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 label="产品描述:">
-        <el-input
-          placeholder="请输入产品描述"
-          v-model.trim="queryParams.productDescription"
-          style="width: 150px"
-          clearable
-          @keyup.enter="handleQuerydaywork"
-          @keydown.enter.prevent
-        />
+        <el-input placeholder="请输入产品描述" v-model.trim="queryParams.productDescription" style="width: 150px" clearable
+          @keyup.enter="handleQuerydaywork" @keydown.enter.prevent />
       </el-form-item>
       <el-form-item label="生产计划单号:">
-        <el-input
-          placeholder="请输入生产计划单号"
-          v-model.trim="queryParams.productionPlanNo"
-          style="width: 150px"
-          clearable
-          @keyup.enter="handleQuerydaywork"
-          @keydown.enter.prevent
-        />
+        <el-input placeholder="请输入生产计划单号" v-model.trim="queryParams.productionPlanNo" style="width: 150px" clearable
+          @keyup.enter="handleQuerydaywork" @keydown.enter.prevent />
       </el-form-item>
       <el-form-item label="序号:">
-        <el-input
-          placeholder="请输入序号"
-          v-model.trim="queryParams.lineNumber"
-          style="width: 130px"
-          clearable
-          @keyup.enter="handleQuerydaywork"
-          @keydown.enter.prevent
-        />
+        <el-input placeholder="请输入序号" v-model.trim="queryParams.lineNumber" style="width: 130px" clearable
+          @keyup.enter="handleQuerydaywork" @keydown.enter.prevent />
       </el-form-item>
       <el-form-item label="批次号:">
-        <el-input
-          placeholder="请输入批次号"
-          v-model.trim="queryParams.lotCode"
-          style="width: 130px"
-          clearable
-          @keyup.enter="handleQuerydaywork"
-          @keydown.enter.prevent
-        />
+        <el-input placeholder="请输入批次号" v-model.trim="queryParams.lotCode" style="width: 130px" clearable
+          @keyup.enter="handleQuerydaywork" @keydown.enter.prevent />
       </el-form-item>
       <el-form-item label="工段:">
-        <el-select-v2
-          v-model="queryParams.deptId"
-          :options="deptList"
-          placeholder="请选择工段"
-          style="width: 140px"
-        />
+        <el-select-v2 v-model="queryParams.deptId" :options="deptList" placeholder="请选择工段" style="width: 140px" />
       </el-form-item>
       <el-form-item label="是否废品回用:">
-        <el-select
-          style="width: 100px"
-          v-model="queryParams.isWasteRecycling"
-          placeholder="请选择"
-        >
-          <el-option
-            v-for="item in yes_no"
-            :key="item.value"
-            :label="item.label"
-            :value="item.value"
-          ></el-option>
+        <el-select style="width: 100px" v-model="queryParams.isWasteRecycling" placeholder="请选择">
+          <el-option v-for="item in yes_no" :key="item.value" :label="item.label" :value="item.value"></el-option>
         </el-select>
       </el-form-item>
       <el-form-item label="工序:">
-        <el-select-v2
-          v-model="processAlias"
-          :options="processList"
-          placeholder="请选择工序"
-          style="width: 140px"
-          @change="handleProcessChange"
-        />
+        <el-select-v2 v-model="processAlias" :options="processList" placeholder="请选择工序" style="width: 140px"
+          @change="handleProcessChange" />
       </el-form-item>
       <el-form-item>
-        <el-button type="info" icon="Search" @click="handleQuerydaywork"
-          >搜索</el-button
-        >
+        <el-button type="info" icon="Search" @click="handleQuerydaywork">搜索</el-button>
       </el-form-item>
       <div style="margin-top: 20px">
         <el-button type="primary" @click="handleFallback">回退</el-button>
-        <el-button
-          type="primary"
-          @click="handleWasteRecycling"
-          :disabled="selections.length == 0 || selections.length > 1"
-          >添加废品回用</el-button
-        >
-        <el-button
-          :disabled="selections.length !== 1"
-          type="primary"
-          @click="showInBatch"
-          >分批</el-button
-        >
-        <el-button
-          type="primary"
-          :disabled="once"
-          @click="handleOnceSingleChange"
-          >单批单改</el-button
-        >
-        <el-button
-          type="primary"
-          :disabled="multi"
-          @click="handleMultiSingleChange"
-          >多批单改</el-button
-        >
+        <el-button type="primary" @click="handleWasteRecycling"
+          :disabled="selections.length == 0 || selections.length > 1">添加废品回用</el-button>
+        <el-button :disabled="selections.length !== 1" type="primary" @click="showInBatch">分批</el-button>
+        <el-button type="primary" :disabled="once" @click="handleOnceSingleChange">单批单改</el-button>
+        <el-button type="primary" :disabled="multi" @click="handleMultiSingleChange">多批单改</el-button>
       </div>
     </el-form>
 
     <!-- 列表区 -->
     <div class="el-table-container">
       <div class="el-table-inner-container">
-        <el-table
-          ref="dayworkTable"
-          v-loading="loading"
-          row-key="id"
-          @selection-change="handleSelectionChange"
-          height="100%"
-          :data="lotList"
-        >
+        <el-table ref="dayworkTable" v-loading="loading" row-key="id" @selection-change="handleSelectionChange"
+          height="100%" :data="lotList">
           <el-table-column type="selection" width="40" align="center" />
-          <el-table-column
-            label="客户简称"
-            prop="companyAlias"
-            width="120"
-            align="center"
-          />
-          <el-table-column
-            label="生产计划单号"
-            width="100"
-            prop="productionPlanNo"
-            align="center"
-          />
-          <el-table-column
-            label="序号"
-            width="60"
-            prop="lineNumber"
-            align="center"
-          />
+          <el-table-column label="客户简称" prop="companyAlias" width="120" align="center" />
+          <el-table-column label="生产计划单号" width="100" prop="productionPlanNo" align="center" />
+          <el-table-column label="序号" width="60" prop="lineNumber" align="center" />
 
           <el-table-column label="批次号" prop="lotCode" align="center">
             <template #default="scope">
-              <el-button
-                link
-                type="primary"
-                @click="handleColumnClick(scope.row)"
-                ><span>{{ scope.row.lotCode }}</span></el-button
-              >
+              <el-button link type="primary" @click="handleColumnClick(scope.row)"><span>{{ scope.row.lotCode
+                  }}</span></el-button>
             </template>
           </el-table-column>
-          <el-table-column
-            label="产品描述"
-            prop="productDescription"
-            align="center"
-          />
-          <el-table-column
-            label="图纸版本"
-            width="80"
-            prop="technologyVersion"
-            align="center"
-          />
-          <el-table-column
-            label="投产量"
-            width="100"
-            prop="productionQuantity"
-            align="center"
-          />
-          <el-table-column
-            label="下达日期"
-            prop="createTime"
-            width="100"
-            align="center"
-          >
+          <el-table-column label="产品描述" prop="productDescription" align="center" />
+          <el-table-column label="图纸版本" width="80" prop="technologyVersion" align="center" />
+          <el-table-column label="投产量" width="100" prop="productionQuantity" align="center" />
+          <el-table-column label="下达日期" prop="createTime" width="100" align="center">
             <template #default="scope">
               <span>{{
-                proxy.moment(scope.row.createTime).format("YYYY-MM-DD")
-              }}</span>
+      proxy.moment(scope.row.createTime).format("YYYY-MM-DD")
+    }}</span>
             </template>
           </el-table-column>
-          <el-table-column
-            label="当前工段"
-            width="100"
-            prop="deptName"
-            align="center"
-          />
-          <el-table-column
-            label="当前工序"
-            width="120"
-            prop="processAlias"
-            align="center"
-          />
-          <el-table-column
-            label="废品回用"
-            width="70"
-            prop="isWasteRecycling"
-            align="center"
-          >
+          <el-table-column label="当前工段" width="100" prop="deptName" align="center" />
+          <el-table-column label="当前工序" width="120" prop="processAlias" align="center" />
+          <el-table-column label="废品回用" width="70" prop="isWasteRecycling" align="center">
             <template #default="scope">
               <dict-tag :options="yes_no" :value="scope.row.isWasteRecycling" />
             </template>
           </el-table-column>
-          <el-table-column
-            label="批废"
-            width="70"
-            prop="isWaste"
-            align="center"
-          >
+          <el-table-column label="批废" width="70" prop="isWaste" align="center">
             <template #default="scope">
               <dict-tag :options="yes_no" :value="scope.row.isWaste" />
             </template>
           </el-table-column>
-          <el-table-column
-            label="单批单改"
-            width="70"
-            prop="isAmend"
-            align="center"
-          >
+          <el-table-column label="单批单改" width="70" prop="isAmend" align="center">
             <template #default="scope">
               <dict-tag :options="yes_no" :value="scope.row.isAmend" />
             </template>
@@ -229,17 +91,10 @@
       </div>
     </div>
     <!-- 分页 -->
-    <pagination
-      v-show="total > 0"
-      :total="total"
-      v-model:page="queryParams.pageNum"
-      v-model:limit="queryParams.pageSize"
-      @pagination="getLot"
-    />
-    <waste-recycling-dialog
-      ref="wasteRecyclingDialogRef"
-    ></waste-recycling-dialog>
-    <InBatchesDialog ref="inBatchesDialogRef"></InBatchesDialog>
+    <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
+      v-model:limit="queryParams.pageSize" @pagination="getLot" />
+    <waste-recycling-dialog ref="wasteRecyclingDialogRef"></waste-recycling-dialog>
+    <InBatchesDialog ref="inBatchesDialogRef" :getList="handleQuerydaywork" />
     <once-change ref="onceChangeRef" @handleSaveSuccess="getLot()" />
     <multi-change ref="multiChangeRef" @handleSaveSuccess="getLot()" />
   </div>
@@ -430,5 +285,4 @@ const showInBatch = () => {
 onMounted(() => {
   getDept();
 });
-</script>
-  
+</script>

+ 1 - 9
src/views/business/reviseBath/lotFormParticulars.vue

@@ -16,15 +16,6 @@
           <el-tag class="spacing" :type="status(lot)">{{
             statusText(lot)
           }}</el-tag>
-          <!-- <el-tag
-            v-if="lot.daywork.status == 2"
-            class="spacing"
-            type="primary"
-            >{{ "已完成" }}</el-tag
-          > -->
-          <!-- <el-tag v-if="lot.daywork.status == 0" class="spacing" type="info">{{
-            "未开始"
-          }}</el-tag> -->
           <el-tag v-if="lot.isWaste == 1" class="spacing" type="danger">{{
             "报废"
           }}</el-tag>
@@ -383,6 +374,7 @@ function status(lot) {
 
 /** 初始化数据 */
 function init(data) {
+  loading.value = true;
   const lotCode = (route.params && route.params.lotCode) || data;
   if (lotCode) {
     lotParticulars(lotCode).then((res) => {