From 64724de8c8c13511c5b6e78d46385f0c3cafc734 Mon Sep 17 00:00:00 2001
From: 18110972313 <780768673@qq.com>
Date: Tue, 22 Apr 2025 13:39:51 +0800
Subject: [PATCH] =?UTF-8?q?update=20=E5=88=9B=E5=BB=BA=E7=9B=98=E7=82=B9?=
=?UTF-8?q?=E5=8D=95=E9=A1=B5=E9=9D=A2=EF=BC=8C=E8=A7=A3=E5=86=B3=E7=82=B9?=
=?UTF-8?q?=E5=87=BB=E5=88=9B=E5=BB=BA=E7=9B=98=E7=82=B9=E5=8D=95=E6=8C=89?=
=?UTF-8?q?=E9=92=AE=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/check/index.ts | 12 +++
src/views/check/buildSheet/index.vue | 112 ++++++++++++++++++++++++++-
2 files changed, 120 insertions(+), 4 deletions(-)
diff --git a/src/api/check/index.ts b/src/api/check/index.ts
index 139fd63..a2036aa 100644
--- a/src/api/check/index.ts
+++ b/src/api/check/index.ts
@@ -31,4 +31,16 @@ export function checkmarkAudit(data: any) {
method: 'post',
data: data,
});
+}
+
+/**
+ * 创建盘点单
+ * @param ChangeParams
+ */
+export function createCheckPlan(data: any) {
+ return request({
+ url: '/api/api/checkmark/createCheckPlan',
+ method: 'post',
+ data: data
+ })
}
\ No newline at end of file
diff --git a/src/views/check/buildSheet/index.vue b/src/views/check/buildSheet/index.vue
index 0712d1a..c9941a3 100644
--- a/src/views/check/buildSheet/index.vue
+++ b/src/views/check/buildSheet/index.vue
@@ -33,7 +33,7 @@
- 创建盘点单
@@ -155,6 +155,7 @@ import exportDataToExcel from '@/utils/export-excel';
import { IFTRUE, areAllNotEmpty, msToDate } from "@/utils/CommonUtil"
import { bTableHeight } from "../../../composables/calcTableHeight";
import { getORG } from '@/api/auth';
+import { createCheckPlan } from '@/api/check'
const { tableContainer, tableHeight, updateTableHeight, handleResize } = bTableHeight(120);
const { proxy }: any = getCurrentInstance();
@@ -171,6 +172,7 @@ const state = reactive({
pageNum: 1,
pageSize: 10
},
+ commitDate:'',
filList: [],
filListhw: [],
allfilterListhw: [] as any,
@@ -187,6 +189,7 @@ const state = reactive({
ReservoirAreaList: [] as any,//库区下拉选项
erpLocationList: [] as any,//erp库位下拉选项
ERPLocationList: [] as any,
+ MATERIALRECEIVEACT: [] as any,
checkTypeOption: [
{
label: "全盘",
@@ -220,7 +223,7 @@ const state = reactive({
list: [] as any,
loading: false,
column: [] as any,
-
+ button_loading: false,
});
const { queryParamsERPLocation, allfilterListhw,filList, ERPLocationList, formData, column, list, loading, rules, queryParams,checkAll,indeterminate,checkAllhw,indeterminatehw } = toRefs(state);
@@ -310,7 +313,7 @@ onMounted(() => {
hide: false,
}]
- let pwd: any = localStorage.getItem('remeberPwd');
+ //let pwd: any = localStorage.getItem('remeberPwd');
// state.queryParams.ERPFACTORY = JSON.parse(pwd).orgNo;
getFactoryList()
@@ -807,7 +810,108 @@ function formatDate(dateString: any) {
// 拼接结果
return `${year}${month}${day}`;
-}
+}
+
+async function stocktakingCreate() {
+ // CreateNumber() //写入到DOM元素
+ if (!areAllNotEmpty(state.queryParams.checkType)) {
+ ElMessageBox.alert("盘点方式不能为空", "提示框", {
+ confirmButtonText: 'OK',
+ })
+ return
+ }
+ if (state.list.length === 0) {
+ proxy.$ElMessage.warning("批次信息为空")
+ return
+ }
+
+ if (state.formData.PLANDATE == null || state.formData.PLANDATE == undefined || state.formData.PLANDATE == '') {
+ ElMessageBox.alert("请选择日期", "提示框", {
+ confirmButtonText: 'OK',
+ })
+ return
+ }
+ if (!areAllNotEmpty(state.formData.MOVEFLAG)) {
+ ElMessageBox.alert("请选择盘点方式", "提示框", {
+ confirmButtonText: 'OK',
+ })
+ return
+ }
+ let time = formatDate(msToDate(formData.value.PLANDATE).withoutTime)
+ await getQueryList({
+ queryId: "GeCheckPlanNumber",
+ version: "00002",
+ params: {
+ SITENAME: 'SDK',
+ PLANTYPE: state.queryParams.checkType, //盘点类型
+ PLANDATE: time
+ }
+ }).then(async (res: any) => {
+ if (res.data.length == 0) {
+ state.formData.CHECKPLANNAME = time + '0001'
+ } else {
+ let WaterNumber = parseInt(res.data[0].CHECKPLANNAME.substring(8))//后四位流水号
+ WaterNumber += 1; // 将数字加1
+ let formattedNum = ''
+ formattedNum = WaterNumber.toString().padStart(4, '0'); // 将数字转换为4位字符串,不足的部分用0填充
+ state.formData.CHECKPLANNAME = time + formattedNum
+
+ }
+ })
+ state.loading2 = true
+ state.button_state = true
+ formDataRef.value.validate(async (isValid: boolean) => {
+
+ let PLANCONDITION = `ERPFACTORY:${state.queryParams.ERPFACTORY || '空'},MATERIALSPECNAME:${state.queryParams.MATERIALSPECNAME || '空'},AREANAME:${state.queryParams.AREANAME || '空'},erpLocation:${state.queryParams.erpLocation || '空'}`
+
+ let list = state.list.map((item: any) => {
+ return {
+ CHECKMATERIALTYPE: '1',
+ CHECKPACKINGTYPE: '1',
+ CHECKPLANSTATE: 'Created',
+ PLANTYPE: state.queryParams.checkType,
+ PLANTYPENAME: state.queryParams.checkType,
+ SYSLOCATION: item.LOCATIONNAME,
+ BOXSTATE: item.STOCKSTATE,
+ LASTACTION: item.LASTEVENTNAME,
+ PLANCONDITION,
+ ...item
+ }
+ })
+ if (isValid) {
+ createCheckPlan({
+ commitDate : state.commitDate,
+ USER : localStorage.getItem('userId'),
+ SITENAME: localStorage.getItem("siteName") == null ? "SDK" : localStorage.getItem("siteName"),
+ PLANDATE: dayjs(state.formData.PLANDATE).format('YYYYMMDD'),
+ CHECKPLANNAME: state.formData.CHECKPLANNAME,
+ MOVEFLAG: state.formData.MOVEFLAG,
+ BOXLIST: list
+ }).then((res: any) => {
+ if (res.errorCode=='0' || res.errorCode=='200') {
+ ElMessageBox.alert('盘点计划创建完成', '提醒框', {
+ confirmButtonText: 'OK',
+ })
+ state.button_loading = false
+ state.loading = false
+ } else {
+ ElMessageBox.alert('盘点计划创建失败:' + res.message, '提醒框', {
+ confirmButtonText: 'OK',
+ })
+ state.button_loading = false
+ state.loading = false
+ }
+ }).catch((err: any) => {
+ ElMessageBox.alert('盘点计划创建失败' + err.message, '提醒框', {
+ confirmButtonText: 'OK',
+ })
+ state.loading = false
+ })
+ }
+ });
+ state.loading2 = false
+ state.button_state = false
+}