ezhizao 1 year ago
parent
commit
8aea67f400

+ 5 - 5
src/api/business/consult.js

@@ -2,12 +2,12 @@ import request from '@/utils/request'
 
 const baseUrl = import.meta.env.VITE_APP_PRODUCTION_API
 
-// 查询检查指导项目列表
+// 查询检查指导项目列表get
 export function list(data) {
 	return request({
 		url: baseUrl + '/business/consult/list',
 		method: 'get',
-		params: data,
+		params: data
 	})
 }
 
@@ -15,7 +15,7 @@ export function list(data) {
 export function getInfo(id) {
 	return request({
 		url: baseUrl + '/business/consult/getInfo/' + id,
-		method: 'get',
+		method: 'get'
 	})
 }
 
@@ -24,7 +24,7 @@ export function save(data) {
 	return request({
 		url: baseUrl + '/business/consult/save',
 		method: 'post',
-		data: data,
+		data: data
 	})
 }
 
@@ -32,6 +32,6 @@ export function save(data) {
 export function del(id) {
 	return request({
 		url: baseUrl + '/business/consult/remove/' + id,
-		method: 'delete',
+		method: 'delete'
 	})
 }

+ 7 - 0
src/api/business/lot.js

@@ -34,6 +34,13 @@ export function getLot(id) {
     method: 'get'
   })
 }
+export function getProcessList(query) {
+  return request({
+    url: baseUrl + '/business/lot/getProcessList',
+    method: 'get',
+    params:query
+  })
+}
 
 // 查询批次查询详细
 export function getLotList(query) {

+ 12 - 3
src/views/business/lot/InBatchesDialog.vue

@@ -1,6 +1,6 @@
 <template>
   <el-dialog :title="'批次号:' + baseLot.lotCode" v-model="visible" width="1200px" append-to-body draggable @close="close">
-    <div class="form-container">
+    <div class="form-container in-batches-dialog">
 
       <el-form ref="lotFormRef" v-loading="loading" class="master-container" :model="baseLot" label-width="130px"
         @submit.native.prevent>
@@ -67,8 +67,11 @@
           <el-col :span="24">
             <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" :max="10" />
+              <el-form-item label="分批数量">
+                <el-input-number v-model="baseLot.sparateNum" :controls="false" :max="10" />
+              </el-form-item>
+              <el-form-item label-width="20px">
+                <el-button type="primary" @click="handleNumBlur">计算</el-button>
               </el-form-item>
             </div>
             <el-divider />
@@ -322,3 +325,9 @@ defineExpose({
   open,
 });
 </script>
+<style>
+.in-batches-dialog .el-form-item--default .el-form-item__content {
+  line-height: 32px;
+  display: inline-block;
+}
+</style>

+ 144 - 53
src/views/business/lot/index.vue

@@ -10,31 +10,66 @@
         <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-form-item label="序号:">
         <el-input placeholder="请输入序号" v-model.trim="queryParams.lineNumber" style="width: 130px" clearable
           @keyup.enter="handleQuerydaywork" @keydown.enter.prevent />
-      </el-form-item>
+      </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-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-autocomplete v-model.trim="deptName" clearable :fetch-suggestions="queryDeptSearchAsync" placeholder="请选择工段"
+          @select="handleDeptSelect" style="width: 140px;" @clear="handleClearDept">
+          <template #default="{ item }">
+            <div style="
+                  display: flex;
+                  flex-direction: row;
+                  justify-content: space-between;
+                ">
+              <div class="name" style="font-size: 12px">
+                {{ item.deptName }}
+              </div>
+            </div>
+          </template>
+        </el-autocomplete>
       </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-form-item label="标识:">
+        <el-select style="width: 120px" v-model="queryParams.flag" clearable placeholder="请选择标识">
+          <el-option v-for="item in is_identification" :key="item.value" :label="item.label"
+            :value="item.value"></el-option>
         </el-select>
       </el-form-item>
+      <el-form-item label="时间:">
+        <el-date-picker v-model="queryParams.startTime" type="date" value-format="YYYY-MM-DD" :editable="false"
+          :clearable="false" placeholder="请选择开始时间" style="width: 150px" @change="handleDateChange" />
+        <span>To</span>
+        <el-date-picker v-model="queryParams.endTime" type="date" value-format="YYYY-MM-DD" :editable="false"
+          :clearable="false" placeholder="请选择结束时间" style="width: 150px" @change="handleDateChange" />
+      </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-autocomplete v-model.trim="processAlias" clearable :fetch-suggestions="queryProcessSearchAsync"
+          placeholder="请选择工序" @select="handleProcessSelect" style="width: 140px;" @clear="handleClearProcess">
+          <template #default="{ item }">
+            <div style="
+                  display: flex;
+                  flex-direction: row;
+                  justify-content: space-between;
+                ">
+              <div class="name" style="font-size: 12px">
+                {{ item.label }}
+              </div>
+            </div>
+          </template>
+        </el-autocomplete>
       </el-form-item>
       <el-form-item>
         <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>
@@ -71,19 +106,11 @@
           </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">
-            <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">
-            <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="300" align="center">
             <template #default="scope">
-              <dict-tag :options="yes_no" :value="scope.row.isAmend" />
+              <el-tag v-if="scope.row.isWaste == 1" class="spacing" type="danger">{{ "批废" }}</el-tag>
+              <el-tag v-if="scope.row.isAmend == 1" class="spacing" type="danger">{{ "工艺修改" }}</el-tag>
+              <el-tag v-if="scope.row.isWasteRecycling == 1" class="spacing" type="primary">{{ "废品回用" }}</el-tag>
             </template>
           </el-table-column>
           <el-table-column label="母批号" prop="fromCode" align="center" />
@@ -100,18 +127,21 @@
   </div>
 </template>
 <script setup name="ProductionPlan">
+import { listDept } from '@/api/system/dept'
 import { getDeptList } from "@/api/system/dept.js";
-import { getLotList } from "@/api/business/lot.js";
+import { getLotList, getProcessList } from "@/api/business/lot.js";
 import wasteRecyclingDialog from "./DialogWasteRecycling.vue";
 import router from "@/router";
 import multiChange from "@/views/business/reviseBath/multiSingleChangeDialog.vue";
 import onceChange from "@/views/business/reviseBath/onceSingleChangeDialog.vue";
 import InBatchesDialog from "@/views/business/lot/InBatchesDialog.vue";
+import { listProcess } from '@/api/business/process'
 import { ref } from "vue";
 const route = useRoute();
 const { proxy } = getCurrentInstance();
 /** 字典数组区 */
 const { yes_no } = proxy.useDict("yes_no");
+const { is_identification } = proxy.useDict("is_identification");
 /** 表单抽屉 页变量 */
 const inBatchesDialogRef = ref(null);
 const loading = ref(false);
@@ -119,8 +149,10 @@ const lotInfo = ref([]);
 const once = ref(true); //单批单改按钮是否可点击
 const multi = ref(true); //多批单改按钮是否可点击
 const lotList = ref([]);
+const value1 = ref(null);
 const total = ref(0);
-const processAlias = ref(null);
+const processAlias = ref('');
+const deptName = ref('')
 const visible = ref(false);
 const selections = ref([]);
 const processList = ref([]);
@@ -131,8 +163,7 @@ const queryParams = ref({
   pageSize: 10,
   lotCode: "",
   deptId: null,
-  isFallback: "",
-  isWasteRecycling: "",
+  flag: null,
   productionPlanNo: "",
   lineNumber: null,
 });
@@ -144,6 +175,8 @@ const queryDeptParams = ref({
 /***********************  方法区  ****************************/
 /** 打开抽屉 */
 function getDept() {
+  getNowDate()
+  getPassDate()
   //获取工段信息
   queryParams.value.productionPlanNo = "";
   queryParams.value.lineNumber = null;
@@ -152,17 +185,27 @@ function getDept() {
       deptList.value = res.data;
     }
   });
+  getProcess()
   if (route.params.productionPlanNo != ":productionPlanNo") {
     queryParams.value.productionPlanNo = route.params.productionPlanNo;
     queryParams.value.lineNumber = route.params.lineNumber;
   }
+
   getLot();
   visible.value = true;
 }
+function handleDateChange() {
+  console.log(queryParams.value.startTime);
+  console.log(queryParams.value.endTime);
+}
+function getProcess() {
+  getProcessList(queryParams.value).then((response) => {
+    processList.value = response.data;
+  });
+}
 
 /** 多批单改操作 */
 function handleMultiSingleChange() {
-  console.log("selections", selections.value);
   //判断是否同一计划单且当前工序相同的数据
   let isConsistent =
     selections.value.every(
@@ -207,42 +250,49 @@ function getLot() {
     if (res.code == 200) {
       lotList.value = res.rows;
       total.value = res.total;
-      lotInfo.value = res.rows;
-      res.rows.forEach((item) => {
-        // 如果 processList 中不存在当前 processAlias,则添加到 processList 中
-        if (
-          !processList.value.find(
-            (process) => process.label === item.processAlias
-          )
-        ) {
-          // 计算当前 processAlias 的唯一递增值
-          const count = processList.value.length;
-          processList.value.push({
-            label: item.processAlias,
-            value: count,
-          });
-        }
-      });
-      console.log(processList.value);
       loading.value = false;
     }
   });
 }
 
-/**工序切换 */
-function handleProcessChange() {
-  console.log(processList.value[processAlias.value].label);
-
-  // 使用 some 方法检查是否存在于 processList 中
-  lotList.value = lotInfo.value.filter((item) => {
-    // 检查当前对象的 processAlias 是否等于目标值
-    return item.processAlias == processList.value[processAlias.value].label;
-  });
+function getNowDate() {
+  var nowDate = new Date();
+  var date = {
+    year: nowDate.getFullYear(),
+    month: nowDate.getMonth() + 1,
+    day: nowDate.getDate()
+  };
+  const dayDate = date.year + "-" + (date.month >= 10 ? date.month : "0" + date.month) + "-" + (date.day >= 10 ? date.day : "0" + date.day);
+  console.log(dayDate)
+  queryParams.value.endTime = dayDate;
+}
+function getPassDate() {
+  var myDate = new Date();
+  myDate.setDate(myDate.getDate() - 29);
+  var dateTemp;
+  var day;
+  for (var i = 0; i < 30; i++) {
+    if (myDate.getDate() < 10) {
+      day = '0' + myDate.getDate().toString()
+    } else {
+      day = myDate.getDate().toString()
+    }
+  }
+  var month = myDate.getMonth() + 1;
+  dateTemp = myDate.getFullYear() + "-" + (month < 10 ? '0' + month : '' + month) + "-" + day;
+  queryParams.value.startTime = dateTemp
 }
 
+
 /**搜索 */
 function handleQuerydaywork() {
-  getLot();
+  queryParams.value.lineNumber = null
+  if (queryParams.value.endTime < queryParams.value.startTime && queryParams.value.endTime != '' && queryParams.value.startTime != '') {
+    proxy.$modal.msgError('结束时间不能小于开始时间');
+  } else {
+    getLot();
+  }
+
 }
 /**打开废品回用弹窗 */
 function handleWasteRecycling() {
@@ -282,7 +332,48 @@ const showInBatch = () => {
   inBatchesDialogRef.value.open(selections.value[0]);
 };
 
+/** 获取工序列表 */
+const queryProcessSearchAsync = (arg, cb) => {
+  const params = arg != null ? { processAlias: arg, ...queryParams.value } : { ...queryParams.value }
+  // listProcess(params).then(res => {
+  //   const processes = res.rows
+  //   cb(processes)
+  // })
+  getProcessList(params).then((response) => {
+    const processes = response.data;
+    cb(processes)
+  });
+}
+
+const handleProcessSelect = (item) => {
+  console.log(item)
+  processAlias.value = item.label.trim()
+  queryParams.value.processId = item.value
+}
+
+const queryDeptSearchAsync = (arg, cb) => {
+  const params = arg != null ? { pageSize: 200, deptName: arg, isWorkSection: 1 } : { pageSize: 200 }
+  listDept(params).then(res => {
+    const depts = res.rows
+    cb(depts)
+  })
+}
+
+const handleDeptSelect = (item) => {
+  console.log(item)
+  deptName.value = item.deptName.trim()
+  queryParams.value.deptId = item.deptId
+}
+const handleClearProcess = () => {
+  processAlias.value = ''
+  queryParams.value.processId = null
+}
+const handleClearDept = () => {
+  deptName.value = ''
+  queryParams.value.deptId = null
+}
 onMounted(() => {
   getDept();
+
 });
 </script>

+ 59 - 170
src/views/business/reviseBath/index.vue

@@ -1,190 +1,71 @@
 <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="请输入计划单号"
-          @keydown.enter.prevent
-          @keyup.enter="handleQuery"
-          clearable
-          v-model.trim="queryParams.productionPlanNo"
-          style="width: 160px"
-        />
+        <el-input placeholder="请输入计划单号" @keydown.enter.prevent @keyup.enter="handleQuery" clearable
+          v-model.trim="queryParams.productionPlanNo" style="width: 160px" />
+      </el-form-item>
+      <el-form-item label="批号状态:" label-width="100px">
+        <el-select v-model="queryParams.lotCodeStatusCode" clearable placeholder="请选择批号状态" style="width: 150px">
+          <el-option v-for="dict in lot_code_status_code" :key="dict.value" :label="dict.label"
+            :value="dict.value"></el-option>
+        </el-select>
       </el-form-item>
       <el-form-item>
-        <el-button type="info" icon="Search" @click="handleQuery"
-          >搜索</el-button
-        >
+        <el-button type="info" icon="Search" @click="handleQuery">搜索</el-button>
       </el-form-item>
     </el-form>
     <!-- 列表区 -->
     <div class="el-table-container">
       <div class="el-table-inner-container">
         <el-table v-loading="loading" :data="productionPlanList" height="100%">
-          <el-table-column
-            type="index"
-            label="行号"
-            width="50"
-            align="center"
-          ></el-table-column>
-          <el-table-column
-            label="客户简称"
-            prop="companyAlias"
-            width="150"
-            align="center"
-          />
-          <el-table-column
-            label="生产计划单号"
-            prop="productionPlanNo"
-            width="110"
-            align="center"
-          >
+          <el-table-column type="index" label="行号" width="50" align="center"></el-table-column>
+          <el-table-column label="客户简称" prop="companyAlias" width="150" align="center" />
+          <el-table-column label="生产计划单号" prop="productionPlanNo" width="110" align="center">
             <template #default="scope">
-              <el-button
-                link
-                type="primary"
-                @click="handleColumnClick(scope.row)"
-                ><span>{{ scope.row.productionPlanNo }}</span></el-button
-              >
-            </template></el-table-column
-          >
-          <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="80"
-            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="lotCodeStatusCode"
-            width="100"
-            align="center"
-          >
+              <el-button link type="primary" @click="handleColumnClick(scope.row)"><span>{{ scope.row.productionPlanNo
+                  }}</span></el-button>
+            </template></el-table-column>
+          <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="80" 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="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="storageLocation"
-            width="80"
-            align="center"
-          />
-          <el-table-column
-            label="领料部门"
-            prop="requisitionDepartmentName"
-            align="center"
-            fixed="right"
-          >
+          <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" align="center" fixed="right">
             <template #default="scope">
               <span>{{ scope.row.requisitionDepartmentName }}</span>
             </template>
           </el-table-column>
-          <el-table-column
-            label="下达日期"
-            prop="issueDate"
-            width="120"
-            align="center"
-          />
+          <el-table-column label="下达日期" prop="issueDate" width="120" align="center" />
 
-          <el-table-column
-            label="操作"
-            width="200"
-            fixed="right"
-            align="center"
-          >
+          <el-table-column label="操作" width="200" fixed="right" align="center">
             <template #default="scope">
-              <el-button
-                link
-                type="primary"
-                icon="View"
-                v-hasPermi="['business:productionPlan:query']"
-                @click="handleView(scope.row)"
-                >查看</el-button
-              >
-              <el-button
-                icon="edit"
-                link
-                type="warning"
-                v-hasPermi="['business:productionPlan:edit']"
-                @click="handleUpdateProduction(scope.row)"
-                >编辑</el-button
-              >
+              <el-button link type="primary" icon="View" v-hasPermi="['business:productionPlan:query']"
+                @click="handleView(scope.row)">查看</el-button>
+              <el-button icon="edit" link type="warning" v-hasPermi="['business:productionPlan:edit']"
+                @click="handleUpdateProduction(scope.row)">编辑</el-button>
             </template>
           </el-table-column>
         </el-table>
       </div>
     </div>
-    <pagination
-      v-show="total > 0"
-      :total="total"
-      v-model:page="queryParams.pageNum"
-      v-model:limit="queryParams.pageSize"
-      @pagination="getList"
-    />
+    <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
+      v-model:limit="queryParams.pageSize" @pagination="getList" />
     <!-- 已经生产的批次 -->
     <produced-lot ref="producedLotFormRef"></produced-lot>
     <!-- 工艺版本变更弹窗 -->
-    <production-dialog
-      ref="productionDetailRef"
-      @handleUpdateSuccess="handleFresh()"
-    />
+    <production-dialog ref="productionDetailRef" @handleUpdateSuccess="handleFresh" />
   </div>
 </template>
 
@@ -210,6 +91,8 @@ const queryParams = ref({
   pullP2PlanDetails: false,
   pageNum: 1,
   pageSize: 10,
+  startTime: "",
+  endTime: "",
 });
 
 onMounted(() => {
@@ -226,6 +109,7 @@ function getList() {
     total.value = res.total;
     loading.value = false;
     queryParams.value.pullP2PlanDetails = false;
+    // console.log(productionPlanList.value[0])
   });
 }
 /** 打开计划查询页 */
@@ -243,6 +127,10 @@ function handleColumnClick(row) {
 function handleView(row) {
   proxy.$refs.producedLotFormRef.open(row);
 }
+function handleFresh() {
+  console.log(queryParams.value)
+  getList();
+}
 
 /** 搜索按钮操作 */
 function handleQuery() {
@@ -269,6 +157,7 @@ const handleSyncP2Plan = () => {
   text-decoration: underline;
   cursor: pointer;
 }
+
 .dashboard-total-item {
   display: flex;
   align-items: center;
@@ -277,19 +166,20 @@ const handleSyncP2Plan = () => {
   background-color: #f2f2f2;
   border-radius: 10px;
 
-  > div:first-child {
+  >div:first-child {
     display: flex;
     flex: 2;
     justify-content: center;
     align-items: center;
   }
-  > div.dashboard-total-item-label {
+
+  >div.dashboard-total-item-label {
     display: flex;
     flex: 3;
     flex-direction: column;
     justify-content: center;
 
-    > span {
+    >span {
       display: block;
       width: 60%;
       text-align: center;
@@ -299,6 +189,7 @@ const handleSyncP2Plan = () => {
         margin-bottom: 4px;
         letter-spacing: 2px;
       }
+
       &:last-child {
         font-weight: bold;
         font-size: 24px;
@@ -306,22 +197,20 @@ const handleSyncP2Plan = () => {
     }
   }
 }
-.dashboard-total-item > .dashboard-total-item-label > span:last-child {
+
+.dashboard-total-item>.dashboard-total-item-label>span:last-child {
   color: #444444;
 }
-.dashboard-total-item
-  > .dashboard-total-item-label
-  > span:last-child
-  > span:first-child {
+
+.dashboard-total-item>.dashboard-total-item-label>span:last-child>span:first-child {
   margin-right: 8px;
 }
-.dashboard-total-item
-  > .dashboard-total-item-label
-  > span:last-child
-  > span:last-child {
+
+.dashboard-total-item>.dashboard-total-item-label>span:last-child>span:last-child {
   color: #4367df;
 }
-.dashboard-total-item > .number-label {
+
+.dashboard-total-item>.number-label {
   font-size: 40px;
   margin-left: 16px;
   font-weight: bold;

+ 63 - 155
src/views/business/reviseBath/lotFormParticulars.vue

@@ -1,33 +1,16 @@
 <template>
   <div v-if="!loading" class="page-container column-container">
-    <el-form
-      class="list-search"
-      style=""
-      :model="lot"
-      ref="queryRef"
-      :inline="true"
-    >
+    <el-form class="list-search" style="" :model="lot" ref="queryRef" :inline="true">
       <el-row style="margin-top: 10px">
         <el-form-item class="bold-large">
           <span>{{ "批次号:" }}</span>
           <span>{{ lot.lotCode }}</span>
         </el-form-item>
         <el-form-item>
-          <el-tag class="spacing" :type="status(lot)">{{
-            statusText(lot)
-          }}</el-tag>
-          <el-tag v-if="lot.isWaste == 1" class="spacing" type="danger">{{
-            "报废"
-          }}</el-tag>
-          <el-tag v-if="lot.isAmend == 1" class="spacing" type="danger">{{
-            "工艺修改"
-          }}</el-tag>
-          <el-tag
-            v-if="lot.isWasteRecycling == 1"
-            class="spacing"
-            type="primary"
-            >{{ "废品回用" }}</el-tag
-          >
+          <el-tag class="spacing" :type="status(lot)">{{ statusText(lot) }}</el-tag>
+          <el-tag v-if="lot.isWaste == 1" class="spacing" type="danger">{{ "报废" }}</el-tag>
+          <el-tag v-if="lot.isAmend == 1" class="spacing" type="danger">{{ "工艺修改" }}</el-tag>
+          <el-tag v-if="lot.isWasteRecycling == 1" class="spacing" type="primary">{{ "废品回用" }}</el-tag>
         </el-form-item>
       </el-row>
 
@@ -46,9 +29,9 @@
 
         <el-col :span="6">
           <el-form-item label="序号" class="custom-label">
-            <span style="margin-left: 28px">{{
-              lot.productionPlanDetail.lineNumber
-            }}</span>
+            <span style="margin-left: 28px">
+              {{ lot.productionPlanDetail.lineNumber }}
+            </span>
           </el-form-item>
         </el-col>
         <el-col :span="6">
@@ -66,17 +49,14 @@
 
         <el-col :span="6">
           <el-form-item label="单批量" class="custom-label">
-            <span style="margin-left: 28px">{{
-              lot.productionPlanDetail.oneLotQuantity
-            }}</span>
+            <span style="margin-left: 28px">
+              {{ lot.productionPlanDetail.oneLotQuantity }}</span>
           </el-form-item>
         </el-col>
 
         <el-col :span="6">
           <el-form-item label="领料部门" class="custom-label">
-            <span>{{
-              lot.productionPlanDetail.requisitionDepartmentName
-            }}</span>
+            <span>{{ lot.productionPlanDetail.requisitionDepartmentName }}</span>
           </el-form-item>
         </el-col>
         <el-col :span="6">
@@ -105,201 +85,114 @@
       <el-row :gutter="30" style="margin-top: 10px">
         <el-col :span="4">
           <el-form-item label="炉号" class="custom-label">
-            <span>{{
-              lot.furnaceNoInfo.furnaceNumber
-                ? lot.furnaceNoInfo.furnaceNumber
-                : "-"
-            }}</span>
+            <span>{{ lot.furnaceNoInfo.furnaceNumber ? lot.furnaceNoInfo.furnaceNumber : "-" }}</span>
           </el-form-item>
         </el-col>
 
         <el-col :span="4">
           <el-form-item label="厂家" class="custom-label">
-            <span>{{
-              lot.furnaceNoInfo.factory ? lot.furnaceNoInfo.factory : "-"
-            }}</span>
+            <span>{{ lot.furnaceNoInfo.factory ? lot.furnaceNoInfo.factory : "-" }}</span>
           </el-form-item>
         </el-col>
 
         <el-col :span="4">
           <el-form-item label="牌号" class="custom-label">
-            <span style="margin-left: 28px">{{
-              lot.furnaceNoInfo.brandNumber
-                ? lot.furnaceNoInfo.brandNumber
-                : "-"
-            }}</span>
+            <span style="margin-left: 28px">{{ lot.furnaceNoInfo.brandNumber ? lot.furnaceNoInfo.brandNumber : "-"
+              }}</span>
           </el-form-item>
         </el-col>
         <el-col :span="4">
           <el-form-item label="规格" class="custom-label">
-            <span>{{
-              lot.furnaceNoInfo.spec ? lot.furnaceNoInfo.spec : "-"
-            }}</span>
+            <span>{{ lot.furnaceNoInfo.spec ? lot.furnaceNoInfo.spec : "-" }}</span>
           </el-form-item>
         </el-col>
         <el-col :span="4">
           <el-form-item label="形状" class="custom-label">
-            <span>{{
-              lot.furnaceNoInfo.shape ? lot.furnaceNoInfo.shape : "-"
-            }}</span>
+            <span>{{ lot.furnaceNoInfo.shape ? lot.furnaceNoInfo.shape : "-" }}</span>
           </el-form-item>
         </el-col>
         <el-col :span="4">
           <el-form-item label="材料直径" class="custom-label">
-            <span>{{
-              lot.furnaceNoInfo.diameter ? lot.furnaceNoInfo.diameter : "-"
-            }}</span>
+            <span>{{ lot.furnaceNoInfo.diameter ? lot.furnaceNoInfo.diameter : "-" }}</span>
           </el-form-item>
         </el-col>
       </el-row>
       <el-row :gutter="30" style="margin-top: 10px">
         <el-col :span="4">
           <el-form-item label="原料编码" class="custom-label">
-            <span>{{
-              lot.furnaceNoInfo.rawMaterialCode
-                ? lot.furnaceNoInfo.rawMaterialCode
-                : "-"
-            }}</span>
+            <span>{{ lot.furnaceNoInfo.rawMaterialCode ? lot.furnaceNoInfo.rawMaterialCode : "-" }}</span>
           </el-form-item>
         </el-col>
 
         <el-col :span="4">
           <el-form-item label="来料日期" class="custom-label">
-            <span>{{
-              lot.furnaceNoInfo.incomingDate
-                ? lot.furnaceNoInfo.incomingDate
-                : "-"
-            }}</span>
+            <span>{{ lot.furnaceNoInfo.incomingDate ? lot.furnaceNoInfo.incomingDate : "-" }}</span>
           </el-form-item>
         </el-col>
 
         <el-col :span="4">
           <el-form-item label="材质1" class="custom-label">
-            <span style="margin-left: 28px">{{
-              lot.furnaceNoInfo.firstTechnicalRequirement
-                ? lot.furnaceNoInfo.firstTechnicalRequirement
-                : "-"
-            }}</span>
+            <span style="margin-left: 28px">
+              {{ lot.furnaceNoInfo.firstTechnicalRequirement ? lot.furnaceNoInfo.firstTechnicalRequirement : "-" }}
+            </span>
           </el-form-item>
         </el-col>
         <el-col :span="4">
           <el-form-item label="材质2" class="custom-label">
-            <span>{{
-              lot.furnaceNoInfo.secondTechnicalRequirement
-                ? lot.furnaceNoInfo.secondTechnicalRequirement
-                : "-"
-            }}</span>
+            <span>
+              {{ lot.furnaceNoInfo.secondTechnicalRequirement ? lot.furnaceNoInfo.secondTechnicalRequirement : "-" }}
+            </span>
           </el-form-item>
         </el-col>
       </el-row>
     </el-form>
     <div style="padding: 16px">
       <span style="font-weight: bold; font-size: 18px">工艺路线</span>
-      <el-button
-        type="primary"
-        style="float: right; margin-left: 10px"
-        @click="handleOnceSingleChange"
-      >
+      <el-button type="primary" style="float: right; margin-left: 10px" @click="handleOnceSingleChange">
         单批单改
       </el-button>
-      <el-button type="primary" style="float: right; margin-left: 10px">
+      <el-button type="primary" style="float: right; margin-left: 10px" @click="handleSplit()">
         分批
       </el-button>
-      <el-button
-        :disabled="lot.isWaste == 1"
-        type="danger"
-        style="float: right; margin-left: 10px"
-        @click="handlelotWaste(route.params.lotCode)"
-      >
+      <el-button :disabled="lot.isWaste == 1" type="danger" style="float: right; margin-left: 10px"
+        @click="handlelotWaste(route.params.lotCode)">
         批废
       </el-button>
-      <el-button
-        v-if="lot.isAmend == 1"
-        type="primary"
-        style="float: right; margin-left: 10px"
-        @click="handleStandardProcess(lot.technologicalProcessId)"
-      >
+      <el-button v-if="lot.isAmend == 1" type="primary" style="float: right; margin-left: 10px"
+        @click="handleStandardProcess(lot.technologicalProcessId)">
         查看标准工艺
       </el-button>
     </div>
     <div class="el-table-container">
       <div class="el-table-inner-container">
         <el-table height="95%" :data="processDetails">
-          <el-table-column
-            type="index"
-            label="行号"
-            align="center"
-          ></el-table-column>
-          <el-table-column
-            label="工序名称"
-            prop="processAlias"
-            align="center"
-          ></el-table-column>
+          <el-table-column type="index" label="行号" align="center"></el-table-column>
+          <el-table-column label="工序名称" prop="processAlias" align="center"></el-table-column>
           <el-table-column label="状态" prop="status" align="center">
             <template #default="scope">
               <span>{{ getStatusText(scope.row.status) }}</span>
             </template>
           </el-table-column>
-          <el-table-column
-            label="投产量"
-            prop="investNum"
-            align="center"
-          ></el-table-column>
-          <el-table-column
-            label="合格量"
-            prop="qualifiedNum"
-            align="center"
-          ></el-table-column>
-          <el-table-column
-            label="废品量"
-            prop="abandonNum"
-            align="center"
-          ></el-table-column>
+          <el-table-column label="投产量" prop="investNum" align="center"></el-table-column>
+          <el-table-column label="合格量" prop="qualifiedNum" align="center"></el-table-column>
+          <el-table-column label="废品量" prop="abandonNum" align="center"></el-table-column>
         </el-table>
       </div>
     </div>
     <once-change ref="onceChangeRef" @handleSaveSuccess="init" />
     <lot-waste-dialog ref="lotWasteDialogRef" @handleSaveSuccess="init" />
-    <el-dialog
-      title="标准工序"
-      v-model="visible"
-      width="680px"
-      append-to-body
-      draggable
-    >
+    <el-dialog title="标准工序" v-model="visible" width="680px" append-to-body draggable>
       <div class="el-table-inner-container">
-        <el-table
-          style="height: 600px"
-          @selection-change="handleSelectionChange"
-          :data="processList"
-        >
-          <el-table-column
-            type="selection"
-            :selectable="checkSelectable"
-            width="50"
-            align="center"
-          />
-          <el-table-column
-            type="index"
-            label="序号"
-            width="50"
-            align="center"
-          ></el-table-column>
-          <el-table-column
-            label="工序名称"
-            prop="processAlias"
-            align="center"
-          />
+        <el-table style="height: 600px" @selection-change="handleSelectionChange" :data="processList">
+          <el-table-column type="selection" :selectable="checkSelectable" width="50" align="center" />
+          <el-table-column type="index" label="序号" width="50" align="center"></el-table-column>
+          <el-table-column label="工序名称" prop="processAlias" align="center" />
 
-          <el-table-column
-            label="工序编号"
-            prop="processStepNumber"
-            width="200"
-            align="center"
-          />
+          <el-table-column label="工序编号" prop="processStepNumber" width="200" align="center" />
         </el-table>
       </div>
     </el-dialog>
+    <InBatchesDialog ref="inBatchesDialogRef" :getList="init" />
   </div>
   <div v-else v-loading="loading" class="page-container column-container"></div>
 </template>
@@ -307,6 +200,7 @@
 <script setup name="LotProductionPlan">
 import { ref } from "vue";
 import onceChange from "./onceSingleChangeDialog";
+import InBatchesDialog from "@/views/business/lot/InBatchesDialog.vue";
 import {
   lotParticulars,
   selectStandardProcess,
@@ -320,7 +214,7 @@ const loading = ref(true);
 const visible = ref(false);
 const processList = ref([]); //工序列表
 const route = useRoute();
-
+const inBatchesDialogRef = ref(null)
 const statusMap = {
   0: { type: "info", text: "未开始" },
   1: { type: "primary", text: "进行中" },
@@ -399,7 +293,8 @@ function handleStandardProcess(processId) {
 
 //批废
 function handlelotWaste(lotCode) {
-  let row = {};
+  if(lot.value.daywork) {
+     let row = {};
   row.lotCode = lotCode;
   row.lotId = lot.value.id;
   row.companyAlias = lot.value.productionPlanDetail.companyAlias;
@@ -414,6 +309,14 @@ function handlelotWaste(lotCode) {
   row.temporaryProcessQualifiedNum =
     lot.value.daywork.temporaryProcessQualifiedNum;
   proxy.$refs.lotWasteDialogRef.open(row);
+  }else {
+    proxy.$modal.msgError("该批未投产,不能进行批废");
+  }
+ 
+}
+
+function handleSplit() {
+  inBatchesDialogRef.value.open({ ...lot.value, companyAlias: lot.value.productionPlanDetail.companyAlias, productionPlanNo: lot.value.productionPlanDetail.productionPlanNo, productDescription: lot.value.productionPlanDetail.productDescription });
 }
 
 init();
@@ -421,9 +324,12 @@ init();
 
 <style lang="scss" scoped>
 .bold-large span {
-  font-weight: bold; /* 设置内容加粗 */
-  font-size: 22px; /* 设置内容字体大小 */
+  font-weight: bold;
+  /* 设置内容加粗 */
+  font-size: 22px;
+  /* 设置内容字体大小 */
 }
+
 .spacing {
   margin-left: 10px;
 }
@@ -432,12 +338,14 @@ init();
   padding: 16px;
   border-bottom: 8px solid #eef0f5;
 }
+
 .list-search .el-form-item {
   margin-top: 0px;
   margin-right: 15px;
   margin-bottom: 0px;
   margin-left: 0;
 }
+
 .list-search .el-form-item .el-form-item__label {
   font-size: 16px;
   padding-right: 0;

+ 1 - 1
src/views/business/reviseBath/multiSingleChangeDialog.vue

@@ -251,7 +251,7 @@ function handleAdd() {
     proxy.$modal.msgError("只能修改一次工序数据");
     return;
   }
-
+  handleSelect();
   addProcess.value = true;
 }
 

+ 1 - 1
src/views/business/reviseBath/onceSingleChangeDialog.vue

@@ -248,7 +248,7 @@ function handleAdd() {
     proxy.$modal.msgError("只能修改一次工序数据");
     return;
   }
-
+  handleSelect();
   addProcess.value = true;
 }