Browse Source

Merge branch 'master_hella' of http://dev.ccwin-in.com:3000/sfms3.0/sfms3.0-ui into master_hella

hella_online_20240829
wangyufei 4 months ago
parent
commit
f0ed35ae65
  1. 12
      README.md
  2. 171
      src/components/BasicForm/src/BasicForm.vue
  3. 22
      src/views/wms/basicDataManage/itemManage/bom/bom.data.ts
  4. 20
      src/views/wms/basicDataManage/itemManage/itempackage/itempackage.data.ts
  5. 13
      src/views/wms/basicDataManage/itemManage/packageunit/index.vue
  6. 10
      src/views/wms/basicDataManage/itemManage/stdcostprice/stdcostprice.data.ts
  7. 4
      src/views/wms/deliversettlementManage/deliver/deliverRecordMain/deliverRecordMain.data.ts
  8. 105
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue
  9. 40
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/labelForm.vue

12
README.md

@ -31,6 +31,7 @@ form: {
isFormModel:true, // filters中添加筛选的数据--取于formModel
required:true, // 前置添加必有,和isFormModel结合使用
message: '请选择客户代码!', // 前置添加没填的提示语
},
{
key: 'itemCode',
@ -44,7 +45,16 @@ form: {
value:'TRUE', // 指查询具体值
isMainValue: false // 表示查询条件不是主表的字段的值
}
]
],
// 失去焦点校验参数
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: 'true',
isFormModel: true
}]
}
}
**tableForm明细列表查询弹窗配置**

171
src/components/BasicForm/src/BasicForm.vue

@ -841,82 +841,173 @@ const onChange = (field, cur) => {
*/
const onBlur = async (field, e) => {
isExecute.value = false
let formSchemaObj = formSchema.value.find((item) => item.field == field)?.componentProps
if (formSchemaObj?.enterSearch) {
if (formSchemaObj.verificationPage) {
let searchCondition1 = formSchema.value.find((item) => item.field == field).componentProps
.searchCondition //data.ts
let verificationParams = formSchema.value.find((item) => item.field == field).componentProps
.verificationParams //
if (formSchemaObj.searchPage && formSchemaObj.verificationParams) {
//data.ts
let searchCondition =
formSchema.value.find((item) => item.field == field)?.componentProps?.searchCondition || []
//
let verificationParams =
formSchema.value.find((item) => item.field == field)?.componentProps?.verificationParams ||
[]
console.log('走新方法啦')
searchCondition = [...searchCondition, ...verificationParams]
if (e && isString(e)) {
let setV = {}
setV[field] = ''
let params = {}
// keyvalue
if (searchCondition1 && searchCondition1.length > 0) {
for (let i = 0; i < searchCondition1.length; i++) {
if (searchCondition1[i].isMainValue) {
params[searchCondition1[i].key] = formRef.value.formModel[searchCondition1[i].value]
? formRef.value.formModel[searchCondition1[i].value]
// if (searchCondition1 && searchCondition1.length > 0) {
// for (let i = 0; i < searchCondition1.length; i++) {
// searchCondition1[i].isSearch = true
// if (searchCondition1[i].isMainValue) {
// params[searchCondition1[i].key] = formRef.value.formModel[searchCondition1[i].value]
// ? formRef.value.formModel[searchCondition1[i].value]
// : props.detailData
// ? props.detailData[searchCondition1[i].value]
// : ''
// //
// let isNull = false
// if (params[searchCondition1[i].key] == '' || params[searchCondition1[i].key] == undefined) {
// isNull = true
// }
// if (isNull) {
// message.warning(
// searchCondition1[i].message ? searchCondition1[i].message : ''
// )
// return
// }
// } else {
// //
// if (searchCondition1[i].isSearch) {
// if (searchCondition1[i].isFormModel) {
// //formModel
// if (searchCondition1[i].required) {
// if (
// formRef.value.formModel[searchCondition1[i].value] == '' ||
// formRef.value.formModel[searchCondition1[i].value] == undefined
// ) {
// message.warning(
// searchCondition1[i].message
// ? searchCondition1[i].message
// : ''
// )
// return
// }
// }
// }
// params[searchCondition1[i].key] = searchCondition1[i].value
// } else {
// params[searchCondition1[i].key] = searchCondition1[i].value
// }
// }
// }
// }
//
const _searchCondition = {}
if (searchCondition && searchCondition.length > 0) {
//
let filters: any[] = []
for (var i = 0; i < searchCondition.length; i++) {
// searchCondition.forEach((item) => {
// row
if (searchCondition[i].isMainValue) {
_searchCondition[searchCondition[i].key] = formRef.value.formModel[
searchCondition[i].value
]
? formRef.value.formModel[searchCondition[i].value]
: props.detailData
? props.detailData[searchCondition1[i].value]
? props.detailData[searchCondition[i].value]
: // : row
// ? row[searchCondition[i].value]
e
? e.trim()
: ''
//
let isNull = false
if (params[searchCondition1[i].key] == '' || params[searchCondition1[i].key] == undefined) {
if (
_searchCondition[searchCondition[i].key] == '' ||
_searchCondition[searchCondition[i].key] == undefined
) {
isNull = true
}
if (isNull) {
message.warning(
searchCondition1[i].message ? searchCondition1[i].message : '前置条件未选择!'
searchCondition[i].message ? searchCondition[i].message : '前置条件未选择!'
)
return
}
} else {
}
// else if (searchCondition[i].isTableRowValue) {
// if (searchCondition[i].required) {
// if (row[searchCondition[i].value] == '' || row[searchCondition[i].value] == undefined) {
// message.warning(
// searchCondition[i].message ? searchCondition[i].message : ''
// )
// return
// }
// }
// row[searchCondition[i].value]
// //table
// _searchCondition[searchCondition[i].key] = row[searchCondition[i].value]
// }
else {
//
if (searchCondition1[i].isSearch) {
if (searchCondition1[i].isFormModel) {
if (searchCondition[i].isSearch) {
if (searchCondition[i].isFormModel) {
//formModel
if (searchCondition1[i].required) {
if (searchCondition[i].required) {
if (
formRef.value.formModel[searchCondition1[i].value] == '' ||
formRef.value.formModel[searchCondition1[i].value] == undefined
formRef.value.formModel[searchCondition[i].value] == '' ||
formRef.value.formModel[searchCondition[i].value] == undefined
) {
message.warning(
searchCondition1[i].message
? searchCondition1[i].message
: '前置条件未选择!'
searchCondition[i].message ? searchCondition[i].message : '前置条件未选择!'
)
return
}
}
filters.push({
action: searchCondition[i].action,
column: searchCondition[i].key,
value: formRef.value.formModel[searchCondition[i].value]
? formRef.value.formModel[searchCondition[i].value]
: e.trim()
})
} else {
filters.push({
action: searchCondition[i].action,
column: searchCondition[i].key,
value: searchCondition[i].value
})
}
params[searchCondition1[i].key] = searchCondition1[i].value
} else {
params[searchCondition1[i].key] = searchCondition1[i].value
_searchCondition[searchCondition[i].key] = searchCondition[i].value
}
}
}
}
// keyvalue
if (verificationParams && verificationParams.length > 0) {
for (let i = 0; i < verificationParams.length; i++) {
params[verificationParams[i].key] = e?.trim()
if (filters.length > 0) {
_searchCondition.isSearch = true
_searchCondition.filters = filters
}
}
console.log(333,params)
let obj = {
by: 'ASC',
pageNo: 1,
pageSize: 20
}
params = { ..._searchCondition, ...obj }
// console.log(333,params)
if (!formSchemaObj?.multiple && e.indexOf(',') > -1) {
message.alert('该输入框只能输入一条数据')
formRef.value.setValues(setV)
return
}
await formSchemaObj.verificationPage(params).then((res) => {
await formSchemaObj.searchPage(params).then((res) => {
let arr1 = e.split(',')
let list = ref([])
list.value = res
console.log(222, list.value)
list.value = res.list
if (list.value?.length == 0) {
message.alert('暂无数据')
formRef.value.setValues(setV)
@ -932,19 +1023,7 @@ const onBlur = async (field, e) => {
formRef.value.setValues(setV)
return
}
// emit('searchTableSuccess', formField, searchField, list.value, formRef.value, 'form')
// callback(list.value)
})
// emit(
// 'onBlur',
// field,
// e,
// formSchemaObj.componentProps.searchField,
// formSchemaObj,
// formRef.value,
// 'form',
// obj
// )
}
} else {
if (

22
src/views/wms/basicDataManage/itemManage/bom/bom.data.ts

@ -32,10 +32,13 @@ export const Bom = useCrudSchemas(reactive<CrudSchema[]>([
searchTitle: '物料基础信息', // 查询弹窗标题
searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类
searchPage: ItembasicApi.selectItembasicPageToFgAndSemibasicPage, // 查询弹窗所需分页方法
verificationPage: ItembasicApi.getItemListByCodes, // 失去焦点校验输入框的数据内容存在
verificationParams: [{
key: 'codes',
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: 'true',
isFormModel: true
}], // 失去焦点校验参数
}
}
@ -58,10 +61,13 @@ export const Bom = useCrudSchemas(reactive<CrudSchema[]>([
searchTitle: '物料基础信息', // 查询弹窗标题
searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类
searchPage: ItembasicApi.selectTypeToItembasic, // 查询弹窗所需分页方法
verificationPage: ItembasicApi.getItemListByCodes, // 失去焦点校验输入框的数据内容存在
verificationParams: [{
key: 'codes',
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: 'true',
isFormModel: true
}], // 失去焦点校验参数
}
}
@ -114,12 +120,16 @@ export const Bom = useCrudSchemas(reactive<CrudSchema[]>([
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
isMainValue: false,
}],
verificationPage: ProcessApi.getProcessByCodes, // 失去焦点校验输入框的数据内容存在
verificationParams: [{
key: 'codes',
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: 'true',
isFormModel:true
}], // 失去焦点校验参数
}
}

20
src/views/wms/basicDataManage/itemManage/itempackage/itempackage.data.ts

@ -34,7 +34,15 @@ export const Itempackaging = useCrudSchemas(reactive<CrudSchema[]>([
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}],
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: 'true',
isFormModel: true
}], // 失去焦点校验参数
}
}
},
@ -78,7 +86,15 @@ export const Itempackaging = useCrudSchemas(reactive<CrudSchema[]>([
action: '==',
isSearch: true,
isMainValue: false
}]
}],
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: 'true',
isFormModel: true
}], // 失去焦点校验参数
}
}
},

13
src/views/wms/basicDataManage/itemManage/packageunit/index.vue

@ -80,11 +80,10 @@ const tableColumns = ref(Packageunit.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
// if(val[0].parentCode){
// message.error('')
// return
// }
const setV = {}
if(formField == 'parentCode'){
setV['type'] = val[0]['type']
}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
@ -178,6 +177,9 @@ const openForm = (type: string, row?: any) => {
if (item.field == 'manageBalance') {
item.componentProps.disabled = true
}
if (item.field == 'type') {
item.componentProps.disabled = false
}
})
}else {
Packageunit.allSchemas.formSchema.forEach((item) => {
@ -190,6 +192,9 @@ const openForm = (type: string, row?: any) => {
if (item.field == 'manageBalance') {
item.componentProps.disabled = false
}
if (item.field == 'type') {
item.componentProps.disabled = true
}
})
}
basicFormRef.value.open(type, row)

10
src/views/wms/basicDataManage/itemManage/stdcostprice/stdcostprice.data.ts

@ -70,7 +70,15 @@ export const Stdcostprice = useCrudSchemas(reactive<CrudSchema[]>([
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}],
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: 'true',
isFormModel: true
}], // 失去焦点校验参数
}
}
},

4
src/views/wms/deliversettlementManage/deliver/deliverRecordMain/deliverRecordMain.data.ts

@ -530,6 +530,10 @@ export const DeliverRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '包装规格',
field: 'packUnit',
isSearch: false,
isTable: false,
isForm:false,
isDetail:false,
sort: 'custom',
table: {
width: 150

105
src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue

@ -154,7 +154,6 @@
:footButttondata="footButttondata"
@footButtonClick="footButtonClick"
@formSelectChange="formSelectChangeLabel"
@visibleChange='visibleChange'
/>
<!-- 上传质量报告 -->
<BasicForm
@ -607,7 +606,7 @@ const buttonTableClick = async (val, row) => {
}
genLabelId.value = row.masterId
// await getDetailList()
await getGenerateLabelList(row)
await getGenerateLabelList(row)
formLabelRef.value.open('create', row, null, 'createLabel') // createLabel
}
})
@ -628,27 +627,33 @@ const footButttondata = ref([
defaultButtons.formCloseBtn(null) // BOM
])
//
const getGenerateLabelList=async(row)=>{
const getGenerateLabelList = async (row) => {
const params1 = {
masterId: row.masterId,
pageSize: '500',
pageNo: '1',
sort: '',
by: 'ASC'
}
await SupplierdeliverRequestDetailApi.getGenerateLabelList(params1).then((res) => {
detatableData1.value = res
detatableData1.value.forEach((item) => {
item.packUnitInitOptions = item.boxPackaging
let obj = item?.boxPackaging[0]
if (obj) {
item.packUnit= obj.packUnit
item.packQty = obj.packQty
}
item.secondPackUnit= ''
item.secondPackQty = ''
})
masterId: row.masterId,
pageSize: '500',
pageNo: '1',
sort: '',
by: 'ASC'
}
await SupplierdeliverRequestDetailApi.getGenerateLabelList(params1).then((res) => {
detatableData1.value = res
detatableData1.value.forEach((item) => {
item.packUnitInitOptions = item.boxPackaging
item.secondPackUnitInitOptions = item.palletPackaging || []
let obj = item?.boxPackaging[0]
if (obj) {
item.packUnit = obj.packUnit
item.packQty = obj.packQty
}
//
item.secondPackUnit = obj.parentPackUnit
? obj.parentPackUnit
: item?.secondPackUnitInitOptions[0]?.packUnit
item.secondPackQty = obj.parentPackUnit
? obj.parentPackQty
: item?.secondPackUnitInitOptions[0]?.packQty
})
})
}
//
const labelFormRef = ref()
@ -658,12 +663,19 @@ const footButtonClick = async (val) => {
if (!validateForm) {
return
}
let isNext = detatableData1.value.some((item)=>{
return !item.packUnit || !item.packQty
let isNext = detatableData1.value.some((item) => {
return !item.packUnit || !item.packQty
})
if(isNext){
if (isNext) {
message.warning('有数据没有选择箱规格')
return;
return
}
let isNext1 = detatableData1.value.some((item) => {
return item.secondPackQty && item.packQty && parseFloat(item.packQty) > parseFloat(item.secondPackQty)
})
if (isNext1) {
message.warning('托的包装数量要大于箱的包装数量,请修改')
return
}
const data = JSON.parse(JSON.stringify(detatableData1.value))
labelFormRef.value.openLabel(data)
@ -677,12 +689,25 @@ const formSelectChangeLabel = (field, val, row) => {
let obj = row.boxPackaging.find((item) => item.packUnit == val)
if (obj) {
row.packQty = obj.packQty
//
const params1 = {
itemCode: row.itemCode,
packUnit: row.packUnit
}
SupplierdeliverRequestDetailApi.getGenerateLabelParentList(params1).then((res) => {
if (res?.length > 0) {
row.secondPackUnit = res[0].packUnit
row.secondPackQty = res[0].packQty
} else {
row.secondPackUnit = row?.secondPackUnitInitOptions[0]?.packUnit
row.secondPackQty = row?.secondPackUnitInitOptions[0]?.packQty
}
})
} else {
row.packQty = ''
row.secondPackUnit = ''
row.secondPackQty = ''
}
row.secondPackUnit = ''
row.secondPackQty = ''
}
//
if (field == 'secondPackUnit') {
@ -694,23 +719,7 @@ const formSelectChangeLabel = (field, val, row) => {
}
}
}
// tableForm
const visibleChange=(field, val, row, index)=>{
row.secondPackUnitInitOptions=[]
if(field=='secondPackUnit'){
if(val){
//
const params1 = {
itemCode: row.itemCode,
packUnit: row.packUnit
}
SupplierdeliverRequestDetailApi.getGenerateLabelParentList(params1).then((res) => {
row.secondPackUnitInitOptions = res
})
}
}
}
//
const { wsCache } = useCache()
@ -1000,10 +1009,9 @@ const { getList: getDetailList } = detatableMethods
//
const submitFormLabel = async (list) => {
try {
let data = {
subList:list
}
let data = {
subList: list
}
await message.confirm(t('ts.是否为此数据生成标签?'))
labelFormRef.value.isLoading = true
await SupplierdeliverRequestMainApi.genLabel(data)
@ -1016,7 +1024,6 @@ const submitFormLabel = async (list) => {
labelFormRef.value.formLoading = false
labelFormRef.value.dialogTableVisible = false
labelFormRef.value.isLoading = false
}
}
const clearInput = async (field, row, index) => {

40
src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/labelForm.vue

@ -438,24 +438,24 @@ const blurOne = (oneRow, twoRow) => {
//
//
if (oneRow.packUnit && oneRow.packQty) {
oneRow.packageList.forEach((cur, key) => {
cur.children = []
// oneRow.packageList.forEach((cur, key) => {
twoRow.children = []
//
cur.xLastNumber = parseFloat(cur.xNumber) % parseFloat(oneRow.packQty)
for (let j = 0; j < cur.xNumber; j++) {
twoRow.xLastNumber = parseFloat(twoRow.xNumber) % parseFloat(oneRow.packQty)
for (let j = 0; j < twoRow.xNumber; j++) {
twoId.value++
//
if (cur.xLastNumber) {
if (twoRow.xLastNumber) {
//
if (j == cur.xNumbery - 1) {
cur.children.push({
if (j == twoRow.xNumbery - 1) {
twoRow.children.push({
id: twoId.value,
xPoNumber: j + 1,
qtyTwo: cur.xLastNumber
qtyTwo: twoRow.xLastNumber
})
} else {
//
cur.children.push({
twoRow.children.push({
id: twoId.value,
xPoNumber: j + 1,
qtyTwo: oneRow.packQty
@ -463,23 +463,23 @@ const blurOne = (oneRow, twoRow) => {
}
} else {
// ,
cur.children.push({
twoRow.children.push({
id: twoId.value,
xPoNumber: j + 1,
qtyTwo: oneRow.packQty
})
}
}
})
// })
}
}
//
const blurTwo = (oneRow, twoRow, threeRow) => {
if (parseFloat(threeRow.qtyTwo) > parseFloat(oneRow.packQty)) {
message.warning('数量最多为' + oneRow.packQty)
threeRow.qtyTwo = oneRow.packQty
return
}
// if (parseFloat(threeRow.qtyTwo) > parseFloat(oneRow.packQty)) {
// message.warning('' + oneRow.packQty)
// threeRow.qtyTwo = oneRow.packQty
// return
// }
let num = 0
twoRow.children.forEach((item) => {
num += parseFloat(item.qtyTwo) || 0
@ -488,10 +488,10 @@ const blurTwo = (oneRow, twoRow, threeRow) => {
}
//
const blurThree = (oneRow, twoRow, thereeRow) => {
if (parseFloat(thereeRow.qtyTwo) > parseFloat(oneRow.packQty)) {
message.warning('每箱个数最多' + oneRow.packQty)
thereeRow.qtyTwo = oneRow.packQty
}
// if (parseFloat(thereeRow.qtyTwo) > parseFloat(oneRow.packQty)) {
// message.warning('' + oneRow.packQty)
// thereeRow.qtyTwo = oneRow.packQty
// }
let num = 0
twoRow.children.forEach((item) => {
num += parseFloat(item.qtyTwo) || 0

Loading…
Cancel
Save