From 36096bdee19391a7b6fb5e719c92d7a1f1c60794 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=91=A3=E5=93=B2=E5=A5=87?= <13840175730@139.com>
Date: Wed, 9 Jul 2025 15:58:17 +0800
Subject: [PATCH] =?UTF-8?q?1.=E5=BA=93=E5=AD=98=E7=AE=A1=E7=90=86,?=
=?UTF-8?q?=E5=87=BA=E5=85=A5=E5=BA=93=E6=B5=81=E6=B0=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/jhzxgl/ylgl/gd.js | 16 +-
src/views/jhzxgl/ylgl/index.js | 16 +-
src/views/jhzxgl/ylgl/ylgl.js | 10 +-
src/views/ylgl/comp/ylmodal.vue | 12 +-
src/views/ylgl/dwgl.vue | 74 ++++++--
src/views/ylgl/{lib => js}/dw.js | 0
src/views/ylgl/{lib/ylmodal.js => js/kc.js} | 188 +++++++-------------
src/views/ylgl/{lib/kc.js => js/ylmodal.js} | 83 +++++----
src/views/ylgl/kc.vue | 76 ++++++--
9 files changed, 272 insertions(+), 203 deletions(-)
rename src/views/ylgl/{lib => js}/dw.js (100%)
rename src/views/ylgl/{lib/ylmodal.js => js/kc.js} (60%)
rename src/views/ylgl/{lib/kc.js => js/ylmodal.js} (86%)
diff --git a/src/views/jhzxgl/ylgl/gd.js b/src/views/jhzxgl/ylgl/gd.js
index 8e8c4fa..c247151 100644
--- a/src/views/jhzxgl/ylgl/gd.js
+++ b/src/views/jhzxgl/ylgl/gd.js
@@ -91,10 +91,10 @@ const init=function (that){
const useStatus=[
- {label:'未使用',value:'0'},
- {label:'未打印',value:'1'},
- {label:'已打印',value:'2'},
- {label:'已切割',value:'3'},
+ {label:'未使用',value:'1'},
+ {label:'未打印',value:'2'},
+ {label:'已打印',value:'3'},
+ {label:'已切割',value:'4'},
]
const formatUseStatus=({cellValue})=>{
@@ -123,7 +123,7 @@ const init=function (that){
dcCh:'',
dcPl:'',
tzbh:'',
- status:'0',
+ status:'1',
xqch:'',
xqpl:'',
},
@@ -136,12 +136,12 @@ const init=function (that){
},
{span: 12,
children:[
- { span: 15,align:'right',itemRender: {
+ { span: 16,align:'right',itemRender: {
name: '$button', props: {content:'查询',status:'primary'},events:{click:butClick}
}
},
{ align:'right',itemRender: {
- name: '$button', props: {content:'核对',status:'primary'},events:{click:核对}
+ name: '$button', props: {content:'核对',status:'success'},events:{click:核对}
}
},
{ align:'right',itemRender: {
@@ -149,7 +149,7 @@ const init=function (that){
}
},
{ align:'right',itemRender: {
- name: '$button', props: {content:'打印',status:'primary'},events:{click:打印}
+ name: '$button', props: {content:'打印',status:'success'},events:{click:打印}
}
},
{ align:'right',itemRender: {
diff --git a/src/views/jhzxgl/ylgl/index.js b/src/views/jhzxgl/ylgl/index.js
index 6012601..5cab752 100644
--- a/src/views/jhzxgl/ylgl/index.js
+++ b/src/views/jhzxgl/ylgl/index.js
@@ -91,10 +91,10 @@ const init=function (that){
const useStatus=[
- {label:'未使用',value:'0'},
- {label:'未打印',value:'1'},
- {label:'已打印',value:'2'},
- {label:'已切割',value:'3'},
+ {label:'未使用',value:'1'},
+ {label:'未打印',value:'2'},
+ {label:'已打印',value:'3'},
+ {label:'已切割',value:'4'},
]
const formatUseStatus=({cellValue})=>{
@@ -123,7 +123,7 @@ const init=function (that){
dcCh:'',
dcPl:'',
tzbh:'',
- status:'0',
+ status:'1',
xqch:'',
xqpl:'',
},
@@ -136,12 +136,12 @@ const init=function (that){
},
{span: 12,
children:[
- { span: 15,align:'right',itemRender: {
+ { span: 16,align:'right',itemRender: {
name: '$button', props: {content:'查询',status:'primary'},events:{click:butClick}
}
},
{ align:'right',itemRender: {
- name: '$button', props: {content:'核对',status:'primary'},events:{click:核对}
+ name: '$button', props: {content:'核对',status:'success'},events:{click:核对}
}
},
{ align:'right',itemRender: {
@@ -149,7 +149,7 @@ const init=function (that){
}
},
{ align:'right',itemRender: {
- name: '$button', props: {content:'打印',status:'primary'},events:{click:打印}
+ name: '$button', props: {content:'打印',status:'success'},events:{click:打印}
}
},
{ align:'right',itemRender: {
diff --git a/src/views/jhzxgl/ylgl/ylgl.js b/src/views/jhzxgl/ylgl/ylgl.js
index a81eb46..35f8fb2 100644
--- a/src/views/jhzxgl/ylgl/ylgl.js
+++ b/src/views/jhzxgl/ylgl/ylgl.js
@@ -26,10 +26,10 @@ const init=function (that){
}
const useStatus=[
- {label:'未使用',value:'0'},
- {label:'未打印',value:'1'},
- {label:'已打印',value:'2'},
- {label:'已切割',value:'3'},
+ {label:'未使用',value:'1'},
+ {label:'未打印',value:'2'},
+ {label:'已打印',value:'3'},
+ {label:'已切割',value:'4'},
]
const formatUseStatus=({cellValue})=>{
@@ -58,7 +58,7 @@ const init=function (that){
dcCh:'',
dcPl:'',
tzbh:'',
- status:'0',
+ status:'1',
},
items:[
{ field: 'dcCh', title: '来源船只', span: 3,slots: { default: 'name_czbh' } },
diff --git a/src/views/ylgl/comp/ylmodal.vue b/src/views/ylgl/comp/ylmodal.vue
index 3d9dd53..d12d65b 100644
--- a/src/views/ylgl/comp/ylmodal.vue
+++ b/src/views/ylgl/comp/ylmodal.vue
@@ -1,14 +1,20 @@
-
-
+
+
+
+
+
+
+
+
diff --git a/src/views/ylgl/lib/dw.js b/src/views/ylgl/js/dw.js
similarity index 100%
rename from src/views/ylgl/lib/dw.js
rename to src/views/ylgl/js/dw.js
diff --git a/src/views/ylgl/lib/ylmodal.js b/src/views/ylgl/js/kc.js
similarity index 60%
rename from src/views/ylgl/lib/ylmodal.js
rename to src/views/ylgl/js/kc.js
index 8e8c4fa..af6f608 100644
--- a/src/views/ylgl/lib/ylmodal.js
+++ b/src/views/ylgl/js/kc.js
@@ -1,6 +1,6 @@
import request from '@/utils/request'
import { VXETable } from 'vxe-table'
-import XLSX from 'xlsx'
+import {EventBus} from "@/event-bus";
const init=function (that){
const butClick=function (){
@@ -14,42 +14,39 @@ const init=function (that){
})
}
- const 核对=function (){
- const dcCh=that.$refs.xqProjectSelectRef.getDcch();
- const dcPl=data.options.formConfig.data.xqpl
- if (!dcCh||!dcPl){
- VXETable.modal.message({ content: '请选择需求船号和批量', status: 'warning' })
- return
- }
- const table=that.$refs.vGrid
- const list=table.getCheckboxRecords()
- if (list.length===0){
- VXETable.modal.message({ content: '请选择数据', status: 'warning' })
- return
+ const 入库=()=>{
+ const {insertRecords,updateRecords}=that.$refs.vGrid.getRecordset()
+ const data=[]
+ if (insertRecords.length>=0){
+ data.push(...insertRecords)
}
-
- const _data={
- dcCh:dcCh,
- dcPl:dcPl,
- ylList:list
+ if (updateRecords.length>=0){
+ data.push(...updateRecords)
}
- 核对数据(_data).then(res=>{
- const data=res.data
- VXETable.modal.message({ content: `核对结束,匹配${data.length}张套料图`, status: 'warning' })
- for (const item of data) {
- for (let it of list) {
- if (it.id===item.id){
- it=Object.assign(it,item)
- break;
- }
- }
+ for (const item of data) {
+ if (!item.垛位){
+ that.$refs.vGrid.setCurrentRow(item)
+ VXETable.modal.message({ content: `${item.余料编号}请选择摆放位置`, status: 'warning' })
+ return
}
+ if (!item.入库日期){
+ that.$refs.vGrid.setCurrentRow(item)
+ VXETable.modal.message({ content: `${item.余料编号}请选择入库日期`, status: 'warning' })
+ return
+ }
+ }
+ rk(data).then(res=>{
+ VXETable.modal.message({ content: '成功', status: 'success' })
+ butClick()
})
}
- const 保存=()=>{
- const list=that.$refs.vGrid.getCheckboxRecords()
- if (list.length>0){
+ const 移垛=()=>{
+ const data=that.$refs.vGrid.getCheckboxRecords()
+ if (data.length>0){
+ const list=data.map(item=>{
+ return {id:item.id,垛位:item.垛位,层数:item.层数}
+ })
edit(list).then(res=>{
VXETable.modal.message({ content: '成功', status: 'success' })
butClick()
@@ -57,49 +54,18 @@ const init=function (that){
}
}
- const 打印=()=>{
- const list=that.$refs.vGrid.getCheckboxRecords()
- if (list.length>0){
- print(list).then(res=>{
- const workBook = XLSX.utils.book_new();
- const _data=list.map(item=>{
- return {
- 船号:item.使用船号,
- 批量:item.使用批量,
- 图纸编号:item.使用图纸,
- 余料编号:item.余料编号,
- 垛位:item.垛位
- }
- })
- const sheet=XLSX.utils.json_to_sheet(_data)
- XLSX.utils.book_append_sheet(workBook, sheet, "sheet");
- XLSX.writeFile(workBook, `${data.options.formConfig.dcCh}-${data.options.formConfig.dcPl}余料上料计划.xlsx`)
- butClick()
- })
- }
+ const 提取=()=>{
+ that.$refs.ylModal.show()
}
- const 退回=()=>{
- const list=that.$refs.vGrid.getCheckboxRecords()
- if(list.length>0){
- rollback(list).then(()=>{
- VXETable.modal.message({ content: '成功', status: 'success' })
- butClick()
- })
- }
- }
-
-
const useStatus=[
- {label:'未使用',value:'0'},
- {label:'未打印',value:'1'},
- {label:'已打印',value:'2'},
- {label:'已切割',value:'3'},
+ {label:'未使用',value:'1'},
+ {label:'未出库',value:'2'},
]
const formatUseStatus=({cellValue})=>{
for (const item of useStatus) {
- if(item.value===cellValue){
+ if(item.value===cellValue+''){
return item.label
}
}
@@ -116,6 +82,7 @@ const init=function (that){
size:'mini',
showOverflow: true,
showHeaderOverflow:true,
+ scrollY:{enable:true},
editConfig:{trigger: 'click', mode: 'cell', showStatus: true},
highlightCurrentRow:true,
formConfig:{
@@ -123,49 +90,40 @@ const init=function (that){
dcCh:'',
dcPl:'',
tzbh:'',
- status:'0',
- xqch:'',
- xqpl:'',
+ status:'1',
},
items:[
- { field: 'dcCh', title: '来源船只', span: 3,slots: { default: 'name_czbh' } },
- { field: 'dcPl', title: '来源批量', span: 3 ,itemRender: {name: '$input'}},
- { field: 'tzbh', title: '来源图号', span: 3 ,itemRender: {name: '$input'}},
+ { field: 'dcCh', title: '来源船只', span: 4,slots: { default: 'name_czbh' } },
+ { field: 'dcPl', title: '来源批量', span: 4 ,itemRender: {name: '$input'}},
+ { field: 'tzbh', title: '来源图号', span: 4 ,itemRender: {name: '$input'}},
{ field: 'status', title: '使用状态', span: 3 ,
itemRender: {name: '$select',props:{options:useStatus}}
},
- {span: 12,
+ {span: 9,
children:[
{ span: 15,align:'right',itemRender: {
name: '$button', props: {content:'查询',status:'primary'},events:{click:butClick}
}
},
{ align:'right',itemRender: {
- name: '$button', props: {content:'核对',status:'primary'},events:{click:核对}
- }
- },
- { align:'right',itemRender: {
- name: '$button', props: {content:'保存',status:'primary'},events:{click:保存}
+ name: '$button', props: {content:'提取',status:'success'},events:{click:提取}
}
},
{ align:'right',itemRender: {
- name: '$button', props: {content:'打印',status:'primary'},events:{click:打印}
+ name: '$button', props: {content:'入库',status:'primary'},events:{click:入库}
}
},
{ align:'right',itemRender: {
- name: '$button', props: {content:'退回',status:'primary'},events:{click:退回}
+ name: '$button', props: {content:'移垛',status:'warning'},events:{click:移垛}
}
},
]
},
- { field: 'xqch', title: '需求船只', span: 3,slots: { default: 'name_xqch' } },
- { field: 'xqpl', title: '需求批量', span: 3 ,itemRender: {name: '$input'}},
],
},
columns:[
{type:'checkbox',title:'序号'},
{type:'seq',title:''},
- // { field: 'id', title: 'ID', width: 150 },
{ field: '余料编号', title: '余料编号', width: 150,
filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
filterRender: { name: 'FilterCombination' }
@@ -198,38 +156,21 @@ const init=function (that){
filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
filterRender: { name: 'FilterCombination' }
},
- { field: '垛位', title: '垛位', width: 100,
- filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
- filterRender: { name: 'FilterCombination' }
- },
- { field: '层数', title: '层数', width: 80,
- filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
- filterRender: { name: 'FilterCombination' }
- },
- { field: '使用船号', title: '使用船号', width: 120,
- editRender:{name:'$input'},
+ { field: '入库日期', title: '入库日期', width: 150,
+ editRender:{name:'$input',props: {type:'date', labelFormat:'yyyy/MM/dd',valueFormat:'yyyy/MM/dd',placeholder: '请选择日期' }},
filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
filterRender: { name: 'FilterCombination' }
},
- { field: '使用批量', title: '使用批量', width: 120,
- editRender:{name:'$input'},
- filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
- filterRender: { name: 'FilterCombination' }
- },
- { field: '使用分段', title: '使用分段', width: 120,
- editRender:{name:'$input'},
+ { field: '垛位', title: '垛位', width: 100,
+ editRender:{name:'$select',options:[]},
filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
filterRender: { name: 'FilterCombination' }
},
- { field: '使用图纸', title: '使用图纸', width: 150,
+ { field: '层数', title: '层数', width: 80,
editRender:{name:'$input'},
filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
filterRender: { name: 'FilterCombination' }
},
- { field: '使用日期', title: '使用日期', width: 150,
- filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
- filterRender: { name: 'FilterCombination' }
- },
{ field: '来源船号', title: '来源船号', width: 120,
filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
filterRender: { name: 'FilterCombination' }
@@ -260,6 +201,23 @@ const init=function (that){
},
}
+ getDw().then(res=>{
+ const 垛位=that.$refs.vGrid.getColumnByField('垛位')
+ 垛位.editRender.options=res.data.map(item=>{
+ return {label:item.bmsm,value:item.bm}
+ })
+ })
+
+ const tmpSelectId=[]
+ EventBus.$on('ylrkSelect', _data=>{
+ _data.forEach(item=>{
+ if (tmpSelectId.includes(item.id)){
+ return
+ }
+ tmpSelectId.push(item.id)
+ that.$refs.vGrid.insert(item)
+ })
+ })
return data
}
@@ -271,9 +229,9 @@ const getData=(data)=>{
});
}
-const 核对数据=(data)=>{
+const rk=(data)=>{
return request({
- url: "/yl/gdsl",
+ url: "/yl/rk",
method: "post",
data,
});
@@ -287,19 +245,11 @@ const edit=(data)=>{
});
}
-const print=(data)=>{
- return request({
- url: "/yl/print",
- method: "post",
- data,
- });
-}
-
-const rollback=(data)=>{
+const getDw=()=>{
return request({
- url: "/yl/rollback",
+ url: "/api/sy/getZhbmList",
method: "post",
- data,
+ data:{bmlb:'yldw'}
});
}
diff --git a/src/views/ylgl/lib/kc.js b/src/views/ylgl/js/ylmodal.js
similarity index 86%
rename from src/views/ylgl/lib/kc.js
rename to src/views/ylgl/js/ylmodal.js
index 6b3c78d..66104e8 100644
--- a/src/views/ylgl/lib/kc.js
+++ b/src/views/ylgl/js/ylmodal.js
@@ -1,5 +1,7 @@
import request from '@/utils/request'
import { VXETable } from 'vxe-table'
+import {EventBus} from "@/event-bus";
+
const init=function (that){
const butClick=function (){
@@ -13,32 +15,10 @@ const init=function (that){
})
}
- const 保存=()=>{
- const list=that.$refs.vGrid.getCheckboxRecords()
- if (list.length>0){
- edit(list).then(res=>{
- VXETable.modal.message({ content: '成功', status: 'success' })
- butClick()
- })
- }
- }
-
- const 退回=()=>{
- const list=that.$refs.vGrid.getCheckboxRecords()
- if(list.length>0){
- rollback(list).then(()=>{
- VXETable.modal.message({ content: '成功', status: 'success' })
- butClick()
- })
- }
- }
-
-
const useStatus=[
- {label:'未使用',value:'0'},
- {label:'未打印',value:'1'},
- {label:'已打印',value:'2'},
- {label:'已切割',value:'3'},
+ {label:'未入库',value:'0'},
+ {label:'未使用',value:'1'},
+ {label:'未出库',value:'2'},
]
const formatUseStatus=({cellValue})=>{
@@ -50,9 +30,19 @@ const init=function (that){
return cellValue
}
+ const 提取=()=>{
+ const data=that.$refs.vGrid.getCheckboxRecords()
+ if (data.length===0){
+ VXETable.modal.message({ content: '请选择入库余料', status: 'warning' })
+ return
+ }
+ EventBus.$emit('ylrkSelect', data)
+ that.showFlag=false
+ }
+
const data={
options:{
- height:830,
+ height:730,
align:'center',
border: true,
resizable: true,
@@ -60,6 +50,7 @@ const init=function (that){
size:'mini',
showOverflow: true,
showHeaderOverflow:true,
+ scrollY:{enable:true},
editConfig:{trigger: 'click', mode: 'cell', showStatus: true},
highlightCurrentRow:true,
formConfig:{
@@ -67,26 +58,25 @@ const init=function (that){
dcCh:'',
dcPl:'',
tzbh:'',
+ status:'0',
+ xqch:'',
+ xqpl:'',
},
items:[
- { field: 'dcCh', title: '来源船只', span: 3,slots: { default: 'name_czbh' } },
- { field: 'dcPl', title: '来源批量', span: 3 ,itemRender: {name: '$input'}},
- { field: 'tzbh', title: '来源图号', span: 3 ,itemRender: {name: '$input'}},
- { field: 'status', title: '使用状态', span: 3 ,
- itemRender: {name: '$select',props:{options:useStatus}}
+ { field: 'dcCh', title: '来源船只', span: 5,slots: { default: 'name_czbh' } },
+ { field: 'dcPl', title: '来源批量', span: 4 ,itemRender: {name: '$input'}},
+ { field: 'tzbh', title: '来源图号', span: 5 ,itemRender: {name: '$input'}},
+ { field: 'status', span: 3 ,
+ itemRender: {name: '$select',props:{options:useStatus,disabled:true}}
},
- {span: 12,
+ {span: 7,
children:[
- { span: 18,align:'right',itemRender: {
+ { span: 19,align:'right',itemRender: {
name: '$button', props: {content:'查询',status:'primary'},events:{click:butClick}
}
},
{ align:'right',itemRender: {
- name: '$button', props: {content:'保存',status:'primary'},events:{click:保存}
- }
- },
- { align:'right',itemRender: {
- name: '$button', props: {content:'退回',status:'primary'},events:{click:退回}
+ name: '$button', props: {content:'提取',status:'success'},events:{click:提取}
}
},
]
@@ -96,6 +86,7 @@ const init=function (that){
columns:[
{type:'checkbox',title:'序号'},
{type:'seq',title:''},
+ // { field: 'id', title: 'ID', width: 150 },
{ field: '余料编号', title: '余料编号', width: 150,
filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
filterRender: { name: 'FilterCombination' }
@@ -201,6 +192,14 @@ const getData=(data)=>{
});
}
+const 核对数据=(data)=>{
+ return request({
+ url: "/yl/gdsl",
+ method: "post",
+ data,
+ });
+}
+
const edit=(data)=>{
return request({
url: "/yl/edit",
@@ -209,6 +208,14 @@ const edit=(data)=>{
});
}
+const print=(data)=>{
+ return request({
+ url: "/yl/print",
+ method: "post",
+ data,
+ });
+}
+
const rollback=(data)=>{
return request({
url: "/yl/rollback",
diff --git a/src/views/ylgl/kc.vue b/src/views/ylgl/kc.vue
index c8b6df3..cee8c94 100644
--- a/src/views/ylgl/kc.vue
+++ b/src/views/ylgl/kc.vue
@@ -1,15 +1,13 @@
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
@@ -18,7 +16,7 @@
+
+