Procházet zdrojové kódy

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

ezhizao_zx před 9 měsíci
rodič
revize
cedc4397f2

+ 6 - 0
src/api/business/takeStockPeriod.js

@@ -17,6 +17,12 @@ export function getTakeStockPeriod(id) {
     method: 'get'
   })
 }
+export function isTakeStock() {
+  return request({
+    url:baseUrl + '/business/takeStockPeriod/isTakeStock',
+    method: 'get'
+  })
+}
 
 // 新增盘点时间
 export function addTakeStockPeriod(data) {

+ 1 - 1
src/views/business/inventoryCheck/index.vue

@@ -80,7 +80,7 @@
                                       >
                                         编辑
                                     </el-button>
-                                    <el-button v-show="!scope.row.editStatus" v-hasPermi="['business:inventoryCheck:view']"
+                                    <el-button v-show="!scope.row.editStatus && scope.row.status !=0" v-hasPermi="['business:inventoryCheck:view']"
                                      link type="primary" icon="View" @click="handleView(scope.row)"
                                       >
                                         查看

+ 22 - 9
src/views/business/productionBatch/index.vue

@@ -36,6 +36,7 @@
             <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" />
@@ -43,7 +44,7 @@
             </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="storageLocation" width="80" align="center" /> -->
             <el-table-column label="领料部门" prop="requisitionDepartmentName" width="100" align="center">
               <template #default="scope">
                 <span>{{ scope.row.requisitionDepartmentName }}</span>
@@ -138,10 +139,11 @@
 <script setup name="ProductionBatch">
 import { ref } from "vue";
 import { listProductionPlanDetail } from "@/api/business/productionPlanDetail.js";
+import {isTakeStock} from "@/api/business/takeStockPeriod.js"
 import {
   listPlanDetailSubDetail,
   delPlanDetailSubDetail,
-  getDept,
+  getDeptList,
   getLastLotStatus,
 } from "@/api/business/planDetailSubDetail.js";
 import { updateLotCodeStatus } from "@/api/business/productionPlanDetail.js";
@@ -163,6 +165,7 @@ const deptList = ref([]);
 /** 生产子计划 */
 const subList = ref([]);
 const flag = ref(false);
+const isDispatch = ref(false);
 const subDetailsLoading = ref(false);
 /** 查询对象 */
 const queryParams = ref({
@@ -180,13 +183,16 @@ const queryParams = ref({
  */
 function getList() {
   loading.value = true;
-  getDept().then((response) => {
-    deptList.value = response.data;
-    if (deptList.value.length > 0) {
-      queryParams.value.deptId = deptList.value[0].value;
-      getProductionPlanDetail();
-    }
-  });
+  getDeptList().then((response) => {
+        deptList.value = response.data.rows;
+        isDispatch.value = response.data.others.isDispatch;
+        loading.value = false;
+        if (isDispatch.value) {
+            deptList.value.unshift({ label: "全部", value: "0" });
+        } 
+        queryParams.value.deptId = deptList.value[0].value;
+        getProductionPlanDetail();
+    });
   loading.value = false;
 }
 /**工段下拉框change事件 */
@@ -268,6 +274,10 @@ function handlePlanDetailCurrentChange(row) {
 /***********************  生产子计划  ****************************/
 /**新增按钮生产子计划 */
 function handleAddSubDetail(row) {
+  isTakeStock().then(res =>{
+    if(res.data) {
+      proxy.$modal.msgError('正在盘点,不能投产')
+    }else{
   /**创建一个空的对象,将生产计划中的数据赋值给子计划数据 */
   const newDetail = {};
   newDetail.productionPlanId = row.productionPlanId;
@@ -303,6 +313,9 @@ function handleAddSubDetail(row) {
       proxy.$refs.productionRef.open(newDetail);
     }
   });
+    }
+  })
+
 }
 
 /** 修改 生产子计划 事件 */

+ 11 - 3
src/views/business/productionBatch/lotInfoForm.vue

@@ -62,18 +62,22 @@
               <span class="middleInfo">尾批量</span>
               <span class="rightInfo">{{ detailInfo.lastLotQuantity }}</span>
             </el-col>
-            <el-col :span="4">
+            <el-col :span="3">
               <span class="middleInfo">领料部门</span>
               <span class="rightInfo" style="padding-left: 15px">{{
                 detailInfo.requisitionDepartmentName
               }}</span>
             </el-col>
+            <el-col :span="4">
+              <span class="middleInfo">追增批数</span>
+              <span class="rightInfo">{{ detailInfo.superadditionTotalNumber }}</span>
+            </el-col>
           </el-row>
 
           <el-row :gutter="20" style="margin-top: 15px; margin-bottom: 15px">
             <el-col :span="6">
               <el-button type="primary"  v-hasPermi="['business:productionBatch:addLot']" @click="handleAdd()">
-                追批次
+                追批次
               </el-button>
               <el-button type="danger"  v-hasPermi="['business:productionBatch:removeLot']" @click="handleMultiplyDelete()">
                 删除
@@ -180,7 +184,8 @@
                 >修改</el-button
               >
               <el-button
-                v-if="scope.row.isSuperaddition == 1"
+                v-if="scope.row.isSuperaddition == 1 &&
+                  !scope.row.hasDaywork"
                 link
                 type="danger"
                 v-hasPermi="['business:productionBatch:removeLot']"
@@ -258,6 +263,7 @@ function handleMultiplyDelete() {
       getLastLotCode()
       //判断列表的追加批次是不是都删完了,如果曾经有,但是删完了,则添加追加批次时的批次号做判断
       lotList.value.findIndex(item => item.isSuperaddition == 1) == -1 ? hadSuperaddition.value = true : hadSuperaddition.value = false
+      detailInfo.value.superadditionTotalNumber =  detailInfo.value.superadditionTotalNumber - selections.value.length
    }
 }
 function getLastLotCode() {
@@ -286,6 +292,7 @@ function handleDelete(row) {
       lotList.value.splice(lotList.value.indexOf(row), 1);
       getLastLotCode()
       lotList.value.findIndex(item => item.isSuperaddition == 1) == -1 ? hadSuperaddition.value = true : hadSuperaddition.value = false
+      detailInfo.value.superadditionTotalNumber =  detailInfo.value.superadditionTotalNumber - 1
     }
   }
 }
@@ -347,6 +354,7 @@ function handleAdd() {
 //批次带回
 function handleAddLotNum(data) {
   lastLot.value = data[data.length - 1]
+  detailInfo.value.superadditionTotalNumber =  detailInfo.value.superadditionTotalNumber + data.length
   console.log(data)
   data.forEach(item =>{
     lotList.value.unshift({lotCode:item,productionQuantity:detailInfo.value.oneLotQuantity,isSuperaddition:1, editStatus: true,

+ 24 - 2
src/views/business/returnTurnover/index.vue

@@ -103,6 +103,7 @@ import { getFinishedReturnList, getProcessInspectionList, checkCarriers, getProc
 import { getP2NeedCheckProcess } from '@/api/business/p2'
 import dialogReturnTurnover from './DialogReturnTurnover.vue';
 import DialogReturnTurnoverBatch from './DialogReturnTurnoverBatch.vue';
+import {isTakeStock} from "@/api/business/takeStockPeriod.js"
 const { proxy } = getCurrentInstance()
 const dataList = ref([])
 const loading = ref(false)
@@ -193,7 +194,14 @@ function handleShowTurnoverDialog(row) {
 				getProcessInspectionList(process[process.length - 1]).then(res => {
 					if (res.code == 200) {
 						if (res.data) {
+							//判断盘点
+							isTakeStock().then(response =>{
+								if(response.data) {
+								proxy.$modal.msgError('正在盘点,不能周转')
+								}else{
 							proxy.$refs.dialogReturnTurnoverRef.open(row)
+								}
+							})
 						}
 						else {
 							proxy.$modal.msgError('当前批次检查未处于合格状态,暂时无法周转')
@@ -287,7 +295,14 @@ async function handleBatchTurnover() {
 				getProcessInspectionLists(process).then(res => {
 					if (res.code == 200) {
 						if (res.data) {
-							proxy.$refs.dialogReturnTurnoverBatchRef.openBatch(selections.value)
+								//判断盘点
+								isTakeStock().then(response =>{
+								if(response.data) {
+								proxy.$modal.msgError('正在盘点,不能周转')
+								}else{
+									proxy.$refs.dialogReturnTurnoverBatchRef.openBatch(selections.value)
+								}
+							})
 						}
 						else {
 							proxy.$modal.msgError('当前批次检查未处于合格状态,暂时无法周转')
@@ -295,7 +310,14 @@ async function handleBatchTurnover() {
 					}
 				})
 			} else {
-				proxy.$refs.dialogReturnTurnoverBatchRef.openBatch(selections.value)
+					//判断盘点
+					isTakeStock().then(response =>{
+								if(response.data) {
+								proxy.$modal.msgError('正在盘点,不能周转')
+								}else{
+									proxy.$refs.dialogReturnTurnoverBatchRef.openBatch(selections.value)
+								}
+							})
 			}
 		}
 	})

+ 13 - 0
src/views/business/specialDaywork/index.vue

@@ -341,6 +341,7 @@ import {
   carrierFinishedCheck,
 } from "@/api/business/specialDaywork";
 import { specialGetDeptList } from "@/api/business/planDetailSubDetail.js";
+import {isTakeStock} from "@/api/business/takeStockPeriod.js"
 import turnoverInfoDialog from "./turnoverInfoDialog";
 import specialForm from "./form";
 const { proxy } = getCurrentInstance();
@@ -422,6 +423,10 @@ function handleNoTurnoverInfo(row) {
   if (cancelRows.some((row) => row.itemStatus != 4)) {
     proxy.$modal.msgError("存在未周转的批次,无法取消!");
   } else {
+    isTakeStock().then(res =>{
+    if(res.data) {
+      proxy.$modal.msgError('正在盘点,不能取消周转')
+    }else{
     proxy.$modal
       .confirm("是否确认取消周转?")
       .then(() => {
@@ -435,6 +440,8 @@ function handleNoTurnoverInfo(row) {
       .catch((err) => {
         console.log("err", err);
       });
+    }
+  })
   }
 }
 
@@ -486,6 +493,10 @@ function handleShowTurnoverInfoDialog(row) {
     proxy.$modal.msgError("请选择工序已完成的批次进行周转!");
     return;
   } else {
+    isTakeStock().then(res =>{
+    if(res.data) {
+      proxy.$modal.msgError('正在盘点,不能周转')
+    }else{
     loading.value = true;
     //查询是否序检完成,或一箱多批是否全部完成
     carrierFinishedCheck(rows)
@@ -499,6 +510,8 @@ function handleShowTurnoverInfoDialog(row) {
         loading.value = false;
       });
   }
+})
+}
 }
 
 /** 删除按钮操作 */