Browse Source

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

hella_online_20240829
陈薪名 5 months ago
parent
commit
2d671f22c4
  1. 4
      src/api/wms/demandforecastingDetail/index.ts
  2. 16
      src/views/wms/issueManage/productionreturn/productionreturnJobMain/productionreturnJobMain.data.ts
  3. 56
      src/views/wms/issueManage/productionreturn/productionreturnRecordMain/productionreturnRecordMain.data.ts
  4. 5
      src/views/wms/productionManage/productdismantle/productdismantleRequestMain/index.vue
  5. 2
      src/views/wms/productionManage/productreceipt/productreceiptJobMain/productreceiptJobMain.data.ts
  6. 3
      src/views/wms/productionManage/productreceiptAssemble/productreceiptAssembleJobMain/productreceiptAssembleJobMain.data.ts
  7. 2
      src/views/wms/productionManage/productreceiptAssemble/productreceiptAssembleRecordMain/productreceiptAssembleRecordMain.data.ts
  8. 2
      src/views/wms/productionManage/productreceiptscrap/productreceiptscrapJobMain/productreceiptscrapJobMain.data.ts
  9. 5
      src/views/wms/productionManage/productreceiptscrap/productreceiptscrapRequestMain/index.vue
  10. 3
      src/views/wms/productionManage/productreceiptscrap/productreceiptscrapRequestMain/productreceiptscrapRequestMain.data.ts
  11. 208
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/labelForm.vue
  12. 325
      src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRecordMainDifference/index.vue
  13. 1557
      src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRecordMainDifference/supplierinvoiceRecordMain.data.ts

4
src/api/wms/demandforecastingDetail/index.ts

@ -115,6 +115,6 @@ export const getPageTableHead = async (params) => {
// 查询版本号 // 查询版本号
export const queryVersion = async (data) => { export const queryVersion = async (params) => {
return await request.post({ url: `/wms/demandforecasting-detail/queryVersion`, data }) return await request.get({ url: `/wms/demandforecasting-detail/queryVersion`, params })
} }

16
src/views/wms/issueManage/productionreturn/productionreturnJobMain/productionreturnJobMain.data.ts

@ -672,14 +672,14 @@ export const ProductionreturnJobDetail = useCrudSchemas(reactive<CrudSchema[]>([
width: 150 width: 150
}, },
}, },
{ // {
label: '包装规格', // label: '包装规格',
field: 'packUnit', // field: 'packUnit',
sort: 'custom', // sort: 'custom',
table: { // table: {
width: 120 // width: 120
}, // },
}, // },
{ {
label: '数量', label: '数量',
field: 'qty', field: 'qty',

56
src/views/wms/issueManage/productionreturn/productionreturnRecordMain/productionreturnRecordMain.data.ts

@ -15,18 +15,18 @@ export const ProductionreturnRecordMain = useCrudSchemas(reactive<CrudSchema[]>(
}, },
isSearch: true isSearch: true
}, },
{ // {
label: '状态', // label: '状态',
field: 'status', // field: 'status',
dictType: DICT_TYPE.REQUEST_STATUS, // dictType: DICT_TYPE.REQUEST_STATUS,
dictClass: 'string', // dictClass: 'string',
isForm: false, // isForm: false,
isTable: true, // isTable: true,
sort: 'custom', // sort: 'custom',
table: { // table: {
width: 150 // width: 150
}, // },
}, // },
{ {
label: '车间代码', label: '车间代码',
field: 'workshopCode', field: 'workshopCode',
@ -504,23 +504,23 @@ export const ProductionreturnRecordDetail = useCrudSchemas(reactive<CrudSchema[]
}, },
hiddenInMain: true, hiddenInMain: true,
}, },
{ // {
label: '包装规格', // label: '包装规格',
field: 'packUnit', // field: 'packUnit',
sort: 'custom', // sort: 'custom',
table: { // table: {
width: 150 // width: 150
}, // },
}, // },
{ // {
label: '包装数量', // label: '包装数量',
field: 'packQty', // field: 'packQty',
sort: 'custom', // sort: 'custom',
table: { // table: {
width: 150 // width: 150
}, // },
}, // },
{ {
label: '计量单位', label: '计量单位',
field: 'uom', field: 'uom',

5
src/views/wms/productionManage/productdismantle/productdismantleRequestMain/index.vue

@ -286,12 +286,15 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
row['bomVersion'] = res.list[0].version row['bomVersion'] = res.list[0].version
} }
}) })
} else { } else if(formField == 'productionLineCode'){
val.forEach(item=>{ val.forEach(item=>{
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item})) const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item}))
newRow[formField] = item[searchField] newRow[formField] = item[searchField]
tableData.value.push(newRow) tableData.value.push(newRow)
}) })
}else{
row[formField] = val[0][searchField]
} }
} else { } else {
const setV = {} const setV = {}

2
src/views/wms/productionManage/productreceipt/productreceiptJobMain/productreceiptJobMain.data.ts

@ -38,7 +38,7 @@ export const ProductreceiptJobMain = useCrudSchemas(reactive<CrudSchema[]>([
}, },
{ {
label: '车间代码', label: '车间代码',
field: 'workshopCode', field: 'workShopCode',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150

3
src/views/wms/productionManage/productreceiptAssemble/productreceiptAssembleJobMain/productreceiptAssembleJobMain.data.ts

@ -47,7 +47,7 @@ export const ProductreceiptJobMain = useCrudSchemas(reactive<CrudSchema[]>([
}, },
{ {
label: '生产线代码', label: '生产线代码',
field: 'productionPlanNumber', field: 'productionLineCode',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
@ -626,6 +626,7 @@ export const ProductreceiptJobDetail = useCrudSchemas(reactive<CrudSchema[]>([
table: { table: {
width: 150 width: 150
}, },
hiddenInMain:true
}, },
{ {
label: '工位代码', label: '工位代码',

2
src/views/wms/productionManage/productreceiptAssemble/productreceiptAssembleRecordMain/productreceiptAssembleRecordMain.data.ts

@ -728,7 +728,7 @@ export const ProductreceiptRecordDetail = useCrudSchemas(reactive<CrudSchema[]>(
isDetail: false, isDetail: false,
isForm: false , isForm: false ,
table: { table: {
width: 150, width: 220,
fixed: 'right' fixed: 'right'
}, },
hiddenInMain: false, hiddenInMain: false,

2
src/views/wms/productionManage/productreceiptscrap/productreceiptscrapJobMain/productreceiptscrapJobMain.data.ts

@ -38,7 +38,7 @@ export const ProductreceiptJobMain = useCrudSchemas(reactive<CrudSchema[]>([
}, },
{ {
label: '车间代码', label: '车间代码',
field: 'workshopCode', field: 'workShopCode',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150

5
src/views/wms/productionManage/productreceiptscrap/productreceiptscrapRequestMain/index.vue

@ -220,7 +220,7 @@ const searchTableSuccess = async (formField, searchField, val, formRef, type, ro
row['bomVersion'] = res.list[0].version row['bomVersion'] = res.list[0].version
} }
}) })
}else{ }else if(formField == 'productionLineCode'){
// //
val.forEach(item=>{ val.forEach(item=>{
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item})) const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item}))
@ -228,6 +228,9 @@ const searchTableSuccess = async (formField, searchField, val, formRef, type, ro
newRow[formField] = item[searchField] newRow[formField] = item[searchField]
tableData.value.push(newRow) tableData.value.push(newRow)
}) })
}else{
row[formField] = val[0][searchField]
} }
} else { } else {
const setV = {} const setV = {}

3
src/views/wms/productionManage/productreceiptscrap/productreceiptscrapRequestMain/productreceiptscrapRequestMain.data.ts

@ -523,8 +523,9 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
width: 150 width: 150
}, },
tableForm:{ tableForm:{
disabled:true,
multiple: true, multiple: true,
isInpuFocusShow: true, // isInpuFocusShow: true,
searchListPlaceholder: '请选择生产线代码', searchListPlaceholder: '请选择生产线代码',
searchField: 'code', searchField: 'code',
searchTitle: '生产线信息', searchTitle: '生产线信息',

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

@ -12,7 +12,7 @@
<template #default="scope"> <template #default="scope">
<div <div
style="margin-left: 400px; margin-top: -8px; margin-bottom: -8px" style="margin-left: 400px; margin-top: -8px; margin-bottom: -8px"
v-if="scope.row.secondPackUnit && scope.row.secondPackQty" v-if="scope.row.packUnit && scope.row.packQty && scope.row.secondPackUnit && scope.row.secondPackQty"
> >
<el-table <el-table
:data="scope.row.packageList" :data="scope.row.packageList"
@ -25,7 +25,11 @@
<template #default="scope1"> <template #default="scope1">
<div style="margin-left: 150px; margin-top: -8px; margin-bottom: -8px"> <div style="margin-left: 150px; margin-top: -8px; margin-bottom: -8px">
<el-table :data="scope1.row.children" border style="width: 300px" row-key="id"> <el-table :data="scope1.row.children" border style="width: 300px" row-key="id">
<el-table-column label="箱行号" width="100" prop="xPoNumber" align="center" /> <el-table-column label="箱行号" width="100" prop="xPoNumber" align="center">
<template #default="scope2">
{{ scope2.$index + 1 }}
</template>
</el-table-column>
<el-table-column label="数量" width="100" prop="qtyTwo" align="center"> <el-table-column label="数量" width="100" prop="qtyTwo" align="center">
<template #default="scope2"> <template #default="scope2">
<el-input <el-input
@ -66,10 +70,18 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="托行号" width="100" prop="tPoNumber" align="center" /> <el-table-column label="托行号" width="100" prop="tPoNumber" align="center">
<template #default="scope">
{{ scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column label="箱个数" width="100" prop="xNumber" align="center"> <el-table-column label="箱个数" width="100" prop="xNumber" align="center">
<template #default="scope1"> <template #default="scope1">
<el-input v-model="scope1.row.xNumber" @blur="blurOne(scope.row, scope1.row)" /> <el-input
v-model="scope1.row.xNumber"
@blur="blurOne(scope.row, scope1.row)"
onkeyup="value=value.replace(/\D/g,'')"
/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="数量" width="100" prop="qtyOne" align="center" /> <el-table-column label="数量" width="100" prop="qtyOne" align="center" />
@ -90,10 +102,13 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
<div style="margin-left: 550px; margin-top: -8px; margin-bottom: -8px" v-else> <div style="margin-left: 550px; margin-top: -8px; margin-bottom: -8px" v-if="scope.row.packUnit && scope.row.packQty && !scope.row.secondPackUnit">
<div v-for="(item, index) in scope.row.packageList" :key="index"> <div v-for="(item, index) in scope.row.packageList" :key="index">
<el-table :data="item.children" border style="width: 300px" row-key="id"> <el-table :data="item.children" border style="width: 300px" row-key="id">
<el-table-column label="箱行号" width="100" prop="xPoNumber" align="center" /> <el-table-column label="箱行号" width="100" prop="xPoNumber" align="center" > <template #default="scope1">
{{ scope1.$index + 1 }}
</template>
</el-table-column>
<el-table-column label="数量" width="100" prop="qtyOne" align="center"> <el-table-column label="数量" width="100" prop="qtyOne" align="center">
<template #default="scope1"> <template #default="scope1">
<el-input <el-input
@ -188,41 +203,47 @@ const showTableData = () => {
} else { } else {
return tableData.value return tableData.value
} }
} }
const intData = async () => { const intData = async () => {
tableData.value.forEach((row) => { tableData.value.forEach((row) => {
if (row.secondPackUnit && row.secondPackQty) {
// %
row.allTuoQty = Math.ceil(parseFloat(row.qty) / parseFloat(row.secondPackQty))
} else {
// %
row.allTuoQty = Math.ceil(parseFloat(row.qty) / parseFloat(row.packQty))
}
expandChange(row) expandChange(row)
}) })
} }
const expandChange = (row: any, expandedRows: any[]) => { const expandChange = (row: any, expandedRows: any[]) => {
//
if (row.secondPackUnit && row.secondPackQty) { //
// if (row.secondPackUnit && row.secondPackQty&&row.packUnit && row.packQty) {
row.lastNumber = parseFloat(row.qty) % parseFloat(row.secondPackQty) //
row.allXiangQty = Math.ceil(parseFloat(row.qty) / parseFloat(row.packQty))
//
row.manXiangQty = Math.floor(parseFloat(row.qty) / parseFloat(row.packQty))
// / // /
row.otherNumber = parseFloat(row.secondPackQty) / parseFloat(row.packQty) row.otherNumber = Math.floor(parseFloat(row.secondPackQty) / parseFloat(row.packQty))
// % // %
row.allTuoQty = Math.ceil(parseFloat(row.qty) / parseFloat(row.secondPackQty)) row.allTuoQty = Math.ceil(parseFloat(row.allXiangQty) / parseFloat(row.otherNumber))
row.packageList = [] //
row.manTuoQty = Math.floor(parseFloat(row.manXiangQty) / parseFloat(row.otherNumber))
// **
row.tuoInManNumber =
parseFloat(row.manTuoQty) * parseFloat(row.otherNumber) * parseFloat(row.packQty)
//
row.lastNumber =
parseFloat(row.qty) > parseFloat(row.tuoInManNumber)
? parseFloat(row.qty) - parseFloat(row.tuoInManNumber)
: parseFloat(row.qty)
// //
row.packageList =[]
for (let i = 0; i < row.allTuoQty; i++) { for (let i = 0; i < row.allTuoQty; i++) {
oneId.value++ oneId.value++
// //
row.packageList[i] = { row.packageList[i] = {
id: oneId.value, id: oneId.value,
tPoNumber: i + 1, // tPoNumber: i + 1,
xNumber: '', xNumber: '',
qtyOne: '', qtyOne: '',
isTuo: 1 // isTuo: 1 //
} }
// //
if (row.lastNumber) { if (row.lastNumber) {
// //
@ -232,12 +253,12 @@ const expandChange = (row: any, expandedRows: any[]) => {
} else { } else {
// //
row.packageList[i].xNumber = row.otherNumber row.packageList[i].xNumber = row.otherNumber
row.packageList[i].qtyOne = row.secondPackQty row.packageList[i].qtyOne = parseFloat(row.otherNumber) * parseFloat(row.packQty)
} }
} else { } else {
// , // ,
row.packageList[i].xNumber = row.otherNumber row.packageList[i].xNumber = row.otherNumber
row.packageList[i].qtyOne = row.secondPackQty row.packageList[i].qtyOne = parseFloat(row.otherNumber) * parseFloat(row.packQty)
} }
} }
// //
@ -251,7 +272,7 @@ const expandChange = (row: any, expandedRows: any[]) => {
twoId.value++ twoId.value++
cur.children[j] = { cur.children[j] = {
id: twoId.value, id: twoId.value,
xPoNumber: j + 1 // xPoNumber: j + 1
} }
// //
if (cur.xLastNumber) { if (cur.xLastNumber) {
@ -269,18 +290,21 @@ const expandChange = (row: any, expandedRows: any[]) => {
} }
}) })
} }
} else { }
//
if(!row.secondPackUnit && row.packUnit && row.packQty){
// % // %
row.allXiangQty = Math.ceil(parseFloat(row.qty) / parseFloat(row.packQty)) row.allXiangQty = Math.ceil(parseFloat(row.qty) / parseFloat(row.packQty))
row.packageList = [] row.packageList = []
row.allTuoQty = 1 row.allTuoQty = ''
row.allTuoQty1 = 1
// //
for (let i = 0; i < row.allTuoQty; i++) { for (let i = 0; i < row.allTuoQty1; i++) {
oneId.value++ oneId.value++
// //
row.packageList[i] = { row.packageList[i] = {
id: oneId.value, id: oneId.value,
xPoNumber: i + 1, // xPoNumber: i + 1,
qtyOne: row.qty, qtyOne: row.qty,
isTuo: 0 // isTuo: 0 //
} }
@ -291,7 +315,7 @@ const expandChange = (row: any, expandedRows: any[]) => {
twoId.value++ twoId.value++
cur.children[j] = { cur.children[j] = {
id: twoId.value, id: twoId.value,
xPoNumber: j + 1 // xPoNumber: j + 1
} }
// //
cur.lastNumber = parseFloat(row.qty) % parseFloat(row.packQty) cur.lastNumber = parseFloat(row.qty) % parseFloat(row.packQty)
@ -333,33 +357,59 @@ const buttonBaseClick = (val) => {
} }
// //
const submitForm = () => { const submitForm = () => {
let arr = tableData.value.map((item) => { let isZ = false
console.log(tableData.value)
setTimeout(() => {
tableData.value.forEach((item) => {
item.packageList.forEach((cur, key) => {
cur.tPoNumber = key + 1
if (cur.qtyOne == '' || cur.qtyOne == 0) {
isZ = true
}
cur?.children?.forEach((ele,i) => {
ele.xPoNumber = i+1
if (ele.qtyTwo == '' || ele.qtyTwo == 0) {
isZ = true
}
})
})
})
if (isZ) {
message.warning('有数量为0或空,请重新填写')
return
}
let obj = tableData.value.find((item) => {
item.allNumber = 0 item.allNumber = 0
//
item.packageList.forEach((cur) => { item.packageList.forEach((cur) => {
item.allNumber += parseFloat(cur.qtyOne) || 0 item.allNumber += parseFloat(cur.qtyOne) || 0
}) })
if (item.allNumber == parseFloat(item.qty)) { return item.allNumber != parseFloat(item.qty)
return true
} else {
return false
}
}) })
const isBol = arr.some((item) => item == false) console.log(222, obj)
if (isBol) { // return
message.warning('当前添加的数量与总数量不一致') // const isBol = arr.some((item) => item == false)
if (obj) {
message.warning(
`物料[${obj.itemCode}],批次[${obj.batch}],${obj.packageList.length}的总和数量${obj.allNumber}不等于发货总数量${obj.qty}`
)
return return
} }
emit('submitForm', tableData.value) emit('submitForm', tableData.value)
}, 300)
} }
// //
const addT = (oneRow) => { const addT = (oneRow) => {
oneId.value++ oneId.value++
oneRow.packageList.push({ oneRow.packageList.push({
id: oneId.value, id: oneId.value,
tPoNumber: oneRow?.packageList?.length>0?oneRow.packageList[oneRow.packageList.length - 1]?.tPoNumber + 1 :1, //1 // tPoNumber:oneRow.packageList.length+1 || 1,
// tPoNumber:
// oneRow?.packageList?.length > 0
// ? oneRow.packageList[oneRow.packageList.length - 1]?.tPoNumber + 1
// : 1, //1
xNumber: '', xNumber: '',
qtyOne: '' qtyOne: '',
isTuo: 1 //
}) })
oneRow.allTuoQty = oneRow.packageList.length oneRow.allTuoQty = oneRow.packageList.length
} }
@ -376,16 +426,26 @@ const addX = (oneRow, oneIndex, twoRow, twoIndex, type) => {
// //
twoRow.children.push({ twoRow.children.push({
id: twoId.value, id: twoId.value,
xPoNumber: twoRow?.children?.length>0? twoRow?.children[twoRow.children.length - 1]?.xPoNumber + 1 :1, // xPoNumber:
qtyOne: '' // twoRow?.children?.length > 0
// ? twoRow?.children[twoRow.children.length - 1]?.xPoNumber + 1
// : 1,
qtyTwo: oneRow.packQty
}) })
twoRow.xNumber = twoRow.children.length twoRow.xNumber = twoRow.children.length
let num = 0
twoRow.children.forEach((item) => {
num += parseFloat(item.qtyTwo) || 0
})
twoRow.qtyOne = num
} else { } else {
// //
oneRow.isTuo= 1 //
twoRow.children.push({ twoRow.children.push({
id: twoId.value, id: twoId.value,
xPoNumber:twoRow.children.length>0? twoRow.children[twoRow.children.length - 1].xPoNumber + 1:1, // xPoNumber:
qtyTwo: '' // twoRow.children.length > 0 ? twoRow.children[twoRow.children.length - 1].xPoNumber + 1 : 1,
// qtyTwo: oneRow.packQty
}) })
oneRow.allTuoQty = twoRow.children.length oneRow.allTuoQty = twoRow.children.length
} }
@ -418,23 +478,23 @@ const blurOne = (oneRow, twoRow) => {
if (!twoRow.xNumber) { if (!twoRow.xNumber) {
twoRow.qtyOne = '' twoRow.qtyOne = ''
} }
if (parseFloat(twoRow.xNumber) > parseFloat(oneRow.otherNumber)) { // if (parseFloat(twoRow.xNumber) > parseFloat(oneRow.otherNumber)) {
message.warning('每托箱个数最多' + oneRow.otherNumber + '箱') // message.warning('' + oneRow.otherNumber + '')
twoRow.xNumber = oneRow.otherNumber // twoRow.xNumber = oneRow.otherNumber
twoRow.children = [] // twoRow.children = []
twoRow.qtyOne = parseFloat(twoRow.xNumber) * parseFloat(oneRow.packQty) // twoRow.qtyOne = parseFloat(twoRow.xNumber) * parseFloat(oneRow.packQty)
} // }
twoRow.qtyOne = parseFloat(twoRow.xNumber) * parseFloat(oneRow.packQty) twoRow.qtyOne = parseFloat(twoRow.xNumber) * parseFloat(oneRow.packQty)
let num = 0 // let num = 0
oneRow.packageList.forEach((item) => { // oneRow.packageList.forEach((item) => {
num += parseFloat(item.xNumber) || 0 // num += parseFloat(item.xNumber) || 0
}) // })
if (num > oneRow.allPackQty) { // if (num > oneRow.allPackQty) {
message.warning('总箱数不可以大于' + oneRow.allPackQty) // message.warning('' + oneRow.allPackQty)
twoRow.xNumber = '' // twoRow.xNumber = ''
twoRow.qtyOne = '' // twoRow.qtyOne = ''
return // return
} // }
// //
// //
if (oneRow.packUnit && oneRow.packQty) { if (oneRow.packUnit && oneRow.packQty) {
@ -450,14 +510,14 @@ const blurOne = (oneRow, twoRow) => {
if (j == twoRow.xNumbery - 1) { if (j == twoRow.xNumbery - 1) {
twoRow.children.push({ twoRow.children.push({
id: twoId.value, id: twoId.value,
xPoNumber: j + 1, // xPoNumber: j + 1,
qtyTwo: twoRow.xLastNumber qtyTwo: twoRow.xLastNumber
}) })
} else { } else {
// //
twoRow.children.push({ twoRow.children.push({
id: twoId.value, id: twoId.value,
xPoNumber: j + 1, // xPoNumber: j + 1,
qtyTwo: oneRow.packQty qtyTwo: oneRow.packQty
}) })
} }
@ -465,7 +525,7 @@ const blurOne = (oneRow, twoRow) => {
// , // ,
twoRow.children.push({ twoRow.children.push({
id: twoId.value, id: twoId.value,
xPoNumber: j + 1, // xPoNumber: j + 1,
qtyTwo: oneRow.packQty qtyTwo: oneRow.packQty
}) })
} }
@ -475,11 +535,11 @@ const blurOne = (oneRow, twoRow) => {
} }
// //
const blurTwo = (oneRow, twoRow, threeRow) => { const blurTwo = (oneRow, twoRow, threeRow) => {
if (parseFloat(threeRow.qtyTwo) > parseFloat(oneRow.packQty)) { // if (parseFloat(threeRow.qtyTwo) > parseFloat(oneRow.packQty)) {
message.warning('数量最多为' + oneRow.packQty) // message.warning('' + oneRow.packQty)
threeRow.qtyTwo = oneRow.packQty // threeRow.qtyTwo = oneRow.packQty
return // return
} // }
let num = 0 let num = 0
twoRow.children.forEach((item) => { twoRow.children.forEach((item) => {
num += parseFloat(item.qtyTwo) || 0 num += parseFloat(item.qtyTwo) || 0
@ -488,10 +548,10 @@ const blurTwo = (oneRow, twoRow, threeRow) => {
} }
// //
const blurThree = (oneRow, twoRow, thereeRow) => { const blurThree = (oneRow, twoRow, thereeRow) => {
if (parseFloat(thereeRow.qtyTwo) > parseFloat(oneRow.packQty)) { // if (parseFloat(thereeRow.qtyTwo) > parseFloat(oneRow.packQty)) {
message.warning('每箱个数最多' + oneRow.packQty) // message.warning('' + oneRow.packQty)
thereeRow.qtyTwo = oneRow.packQty // thereeRow.qtyTwo = oneRow.packQty
} // }
let num = 0 let num = 0
twoRow.children.forEach((item) => { twoRow.children.forEach((item) => {
num += parseFloat(item.qtyTwo) || 0 num += parseFloat(item.qtyTwo) || 0

325
src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRecordMainDifference/index.vue

@ -0,0 +1,325 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="SupplierinvoiceRecordMain.allSchemas.searchSchema" @search="searchList" @reset="searchList" >
<template #cha>
<div style="display:flex;flex-direction: row">
<el-input-number />
<span>{{' 到 '}}</span>
<el-input-number />
</div>
</template>
</Search>
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="SupplierinvoiceRecordMain.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table ref="tableRef"
:selection="true"
v-clientTable
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
@getSelectionRows="getSelectionRows"
>
<template #number="{row}">
<el-button type="primary" link @click="openDetail(row, t('ts.单据号'), row.number)">
<span>{{ row.number }}</span>
</el-button>
</template>
<template #differencePrice="{row}">
<span :class="{'red-text':row.differencePrice!=0}">{{ row.differencePrice }}</span>
</template>
<template #action="{ row,$index }">
<ButtonBase :Butttondata="butttondata(row,$index)" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="formRef"
@success="getList"
:rules="SupplierinvoiceRecordMainRules"
:formAllSchemas="SupplierinvoiceRecordMain.allSchemas"
:tableAllSchemas="SupplierinvoiceRecordDetail.allSchemas"
:tableFormRules="SupplierinvoiceRecordDetailRules"
:isBusiness="true"
/>
<!-- 详情 -->
<Detail
ref="detailRef"
:annexTable="[{
label: t('ts.合同附件'),
prop: 'Annex',
tableName:'contract',
showDownload:true,
hiddenDelete:true,
queryParams:[{
queryField:'tableId',
rowField:'annexMasterId',
}],
},{
label: t('ts.发票附件'),
prop: 'Annex',
tableName:'invoice',
showDownload:true,
hiddenDelete:true,
queryParams:[{
queryField:'tableId',
rowField:'annexMasterId',
}],
},{
label: t('ts.货运单附件'),
prop: 'Annex',
tableName:'waybill',
showDownload:true,
hiddenDelete:true,
queryParams:[{
queryField:'tableId',
rowField:'annexMasterId',
}],
},{
label: t('ts.其他附件'),
prop: 'Annex',
tableName:'invoiceOther',
showDownload:true,
hiddenDelete:true,
queryParams:[{
queryField:'tableId',
rowField:'annexMasterId',
}],
}]"
:annexAlias="{
hidden:true,
label:t('ts.其他附件'),
showDownload:true,
hiddenDelete:true
}"
:isBasic="false"
direction="horizontal"
:column="3"
:allSchemas="SupplierinvoiceRecordDetailMain.allSchemas"
:detailAllSchemas="SupplierinvoiceRecordDetail.allSchemas"
:detailAllSchemasRules="SupplierinvoiceRecordDetailRules"
:apiPage="SupplierinvoiceRecordDetailApi.getSupplierinvoiceRecordDeatilPage"
>
<template #differencePrice="{row}">
<span :class="{'red-text':row.differencePrice!=0}">{{ row.differencePrice }}</span>
</template>
</Detail>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { SupplierinvoiceRecordMain,SupplierinvoiceRecordMainRules,SupplierinvoiceRecordDetail,SupplierinvoiceRecordDetailRules,SupplierinvoiceRecordDetailMain } from './supplierinvoiceRecordMain.data'
import * as SupplierinvoiceRecordMainApi from '@/api/wms/supplierinvoiceRecordMain'
import * as SupplierinvoiceRecordDetailApi from '@/api/wms/supplierinvoiceRecordDeatil'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import * as SupplierinvoiceRequestDetailApi from '@/api/wms/supplierinvoiceRequestDetail'
import * as PackageApi from "@/api/wms/package";
import {getAccessToken} from "@/utils/auth";
import {getJmreportBaseUrl} from "@/utils/systemParam";
//
defineOptions({ name: 'SupplierinvoiceRecordMain' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(SupplierinvoiceRecordMain.allSchemas.tableColumns)
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: SupplierinvoiceRecordMainApi.getSupplierinvoiceRecordMainPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultExportBtn({hasPermi:'wms:supplierinvoice-record-main:export'}), //
defaultButtons.mainLisSelectiontPointBtn(null), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'export') { //
handleExport()
}else if (val=='selection_point'){//
handleSelectionPoint()
} else if (val == 'refresh') { //
if (tableObject.params.filters && tableObject.params.filters.length > 0 ) {
searchFormClick({
filters: tableObject.params.filters
})
} else {
getList()
}
} else if (val == 'filtrate') { //
}else { //
console.log('其他按钮', item)
}
}
const BASE_URL = getJmreportBaseUrl()
const srcPoint = ref(BASE_URL + '/jmreport/view/970966724605804544?token=' + getAccessToken())
const handleSelectionPoint = async ()=>{
let rows:any = []
selectionRows.value.forEach(item=>{
rows = [...rows,...item.selectionRows.map(item1=>item1.id)]
})
if(rows.length==0){
message.warning('至少选择一条数据!')
return
}
console.log('批量打印',rows.join(','))
window.open(srcPoint.value+'&ids='+rows.join(','))
}
// -
const butttondata = (row,$index) => {
return [
{
label: t('ts.查看明细'),
name: 'open_detail',
type: 'primary',
icon: '',
color: '',
hasPermi: '',
link: true, //
}
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'open_detail') { //
openDetail(row, '单据号', row.number)
}
}
//
const { wsCache } = useCache()
/** 详情操作 */
const detailRef = ref()
const openDetail = async (row: any, titleName: any, titleValue: any) => {
console.log('openDetail',row)
const departmentCode = wsCache.get(CACHE_KEY.DEPT).find((account) => account.id == row.departmentCode)?.name
//masterId
const { tableObject: requestTableObject, tableMethods:requestTableMethods } = useTable({
getListApi: SupplierinvoiceRequestDetailApi.getSupplierinvoiceRequestDetailPage //
})
const { getList:requestGetList } = requestTableMethods
requestTableObject.params.number = row.requestNumber
await requestGetList()
if(requestTableObject.tableList.length>0){
row.annexMasterId = requestTableObject.tableList[0].masterId
}
if (departmentCode) row.departmentCode = JSON.parse(JSON.stringify(departmentCode))
detailRef.value.openDetail(row, titleName, titleValue)
}
const searchList = (model)=>{
if(model.postingDate&&model.postingDate.length>1){
model.postingDate[1] = model.postingDate[1].replace('00:00:00','23:59:59')
}
selectionRows.value = []
setSearchParams(model)
}
const selectionRows = ref<any>([])
const tableRef = ref()
const getSelectionRows = (currentPage,currentPageSelectionRows) => {
console.log("getSelectionRows",currentPage,currentPageSelectionRows)
const currentRows = selectionRows.value.find(item=>item.currentPage==currentPage)
if(currentRows){
currentRows.selectionRows = currentPageSelectionRows
}else{
selectionRows.value.push({
currentPage,
selectionRows:currentPageSelectionRows
})
}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
let rows:any = []
selectionRows.value.forEach(item=>{
rows = [...rows,...item.selectionRows.map(item1=>item1.number)]
})
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await SupplierinvoiceRecordMainApi.exportSupplierinvoiceRecordMain({...tableObject.params,checkNums:rows})
download.excel(data, `${t('ts.供应商发票记录主')}.xlsx`)
} catch {
} finally {
exportLoading.value = false
}
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
})
</script>
<style lang="scss" scoped>
.is-red{
border-radius:var(--el-border-radius-base);
border:1px solid var(--el-color-danger);
box-shadow: 0 0 0 1px var(--el-color-danger) inset;
}
.red-text{
color:var(--el-color-danger);
font-weight:700;
}
</style>

1557
src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRecordMainDifference/supplierinvoiceRecordMain.data.ts

File diff suppressed because it is too large
Loading…
Cancel
Save