Browse Source

生成标签

master_hella_20240701
zhang_li 5 months ago
parent
commit
3197972a7e
  1. 1
      src/locales/en-US.ts
  2. 1
      src/locales/zh-CN.ts
  3. 342
      src/views/wms/basicDataManage/itemManage/packageunit/packageunit.data.ts
  4. 157
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/labelForm.vue

1
src/locales/en-US.ts

@ -885,7 +885,6 @@ export default {
:'Open', :'Open',
:'Save', :'Save',
:'Next', :'Next',
:'Next',
:'Please select filter', :'Please select filter',
:'Please inputr content', :'Please inputr content',
:'Attachment', :'Attachment',

1
src/locales/zh-CN.ts

@ -885,7 +885,6 @@ export default {
:'打开', :'打开',
:'保存', :'保存',
:'下一步', :'下一步',
:'下一步',
:'请选择筛选对象', :'请选择筛选对象',
:'请输入内容', :'请输入内容',
:'附件', :'附件',

342
src/views/wms/basicDataManage/itemManage/packageunit/packageunit.data.ts

@ -3,6 +3,316 @@ import { dateFormatter } from '@/utils/formatTime'
import { fa } from 'element-plus/es/locale' import { fa } from 'element-plus/es/locale'
import * as PackageunitApi from '@/api/wms/packageunit' import * as PackageunitApi from '@/api/wms/packageunit'
import { Select } from '@element-plus/icons-vue/dist/types' import { Select } from '@element-plus/icons-vue/dist/types'
export const Packageunit1 = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '包装代码',
field: 'code',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
},
{
label: '包装名称',
field: 'name',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
},
{
label: '包装类型',
field: 'type',
dictType: DICT_TYPE.PACK_UNIT_TYPE,
dictClass: 'string',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
},
{
label: '长',
field: 'length',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '宽',
field: 'width',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '高',
field: 'height',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '重量',
field: 'weight',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '单位',
field: 'unit',
sort: 'custom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isSearch: false,
table: {
width: 150
},
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
},
table: {
width: 150
},
},
{
label: '包装描述',
field: 'desc',
sort: 'custom',
isSearch: false,
table: {
width: 150
},
},
{
label: '是否重复使用',
field: 'reuse',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: false,
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
},
table: {
width: 150
},
},
{
label: '是否管理包装库存',
field: 'manageBalance',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: false,
form: {
component: 'Switch',
value: 'FALSE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
},
table: {
width: 180
},
},
{
label: '生效时间',
field: 'activeTime',
sort: 'custom',
table: {
width: 180
},
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '失效时间',
field: 'expireTime',
sort: 'custom',
table: {
width: 180
},
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
table: {
width: 180
},
formatter: dateFormatter,
isForm: false,
},
{
label: '创建者',
field: 'creator',
isForm: false,
isTable: true
},
{
label: '最后更新时间',
field: 'updateTime',
sort: 'custom',
isDetail: true,
isForm: false,
isTable: false,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width:'100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
}
},
{
label: '最后更新者',
field: 'updater',
isDetail: true,
isForm: false,
isTable: false,
table: {
width: 150
}
},
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 150
},
},
{
label: '删除时间',
field: 'deletionTime',
sort: 'custom',
isForm: false,
isTable: false,
isDetail: false,
table: {
width: 180
},
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '删除者',
field: 'deleterId',
sort: 'custom',
isDetail: false,
isForm: false,
isTable: false,
table: {
width: 150
},
},
{
label: '扩展属性',
field: 'extraProperties',
sort: 'custom',
isForm: false,
isDetail: false,
isTable: false,
table: {
width: 150
},
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isForm: false,
isDetail: false,
isTable: false,
table: {
width: 150
},
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '地点',
field: 'siteId',
sort: 'custom',
isForm: false,
isDetail: false,
isTable: false,
table: {
width: 150
},
},
{
label: '操作',
field: 'action',
isForm: false,
isDetail: false,
table: {
width: 150,
fixed: 'right'
}
}
]))
export const Packageunit = useCrudSchemas(reactive<CrudSchema[]>([ export const Packageunit = useCrudSchemas(reactive<CrudSchema[]>([
{ {
@ -13,15 +323,31 @@ export const Packageunit = useCrudSchemas(reactive<CrudSchema[]>([
table: { table: {
width: 150 width: 150
}, },
},{
label: '父包装代码',
field: 'parentCode',
sort: 'custom',
isTable:false,
table: {
width: 150
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择到库位代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '包装规格信息', // 查询弹窗标题
searchAllSchemas: Packageunit1.allSchemas, // 查询弹窗所需类
searchPage: PackageunitApi.getPackageunitPage, // 查询弹窗所需分页方法
searchCondition:[{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
}
}, },
// {
// label: '父包装代码',
// field: 'parentCode',
// sort: 'custom',
// table: {
// width: 150
// },
// },
{ {
label: '包装名称', label: '包装名称',
field: 'name', field: 'name',

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

@ -155,12 +155,12 @@ const openLabel = (tableList) => {
tableData.value = tableList tableData.value = tableList
intData() intData()
} }
const oneId = ref(0)//id const oneId = ref(0) //id
const twoId = ref(0)//id const twoId = ref(0) //id
const intData = () => { const intData = () => {
// 1 // 1
tableData.value.forEach((item) => { tableData.value.forEach((item) => {
item.packQty1 = 3 item.packQty1 = 11
// //
if (item.packUnit && item.packQty) { if (item.packUnit && item.packQty) {
@ -170,70 +170,67 @@ const intData = () => {
item.otherNumber = parseFloat(item.packQty) / parseFloat(item.secondPackQty) item.otherNumber = parseFloat(item.packQty) / parseFloat(item.secondPackQty)
// % // %
item.allPackQty = Math.ceil(parseFloat(item.orderQty) / parseFloat(item.secondPackQty)) item.allPackQty = Math.ceil(parseFloat(item.orderQty) / parseFloat(item.secondPackQty))
// %
item.allTuoQty = Math.ceil(parseFloat(item.orderQty) / parseFloat(item.packQty))
item.children = [] item.children = []
//
for (let i = 0; i < item.packQty1; i++) { for (let i = 0; i < item.packQty1; i++) {
oneId.value++ oneId.value++
// //
if (item.lastNumber) { item.children[i] = {
// id: oneId.value,
if (i == item.packQty1 - 1) { tPoNumber: i + 1,
item.children.push({ xNumber: '',
id: oneId.value, qtyOne: ''
tPoNumber: i + 1, }
xNumber: Math.ceil(item.lastNumber / parseFloat(item.secondPackQty)), //
qtyOne: item.lastNumber for (let j = 0; j < item.allTuoQty; j++) {
}) if (i == j) {
} else { //
// if (item.lastNumber) {
item.children.push({ //
id: oneId.value, if (j == item.allTuoQty - 1) {
tPoNumber: i + 1, item.children[j].xNumber = Math.ceil(item.lastNumber / parseFloat(item.secondPackQty))
xNumber: item.otherNumber, item.children[j].qtyOne = item.lastNumber
qtyOne: item.packQty }else{
}) //
item.children[j].xNumber = item.otherNumber
item.children[j].qtyOne = item.packQty
}
}else{
// ,
item.children[j].xNumber = item.otherNumber
item.children[j].qtyOne = item.packQty
}
} }
} else {
// ,
item.children.push({
id: oneId.value,
tPoNumber: i + 1,
xNumber: item.otherNumber,
qtyOne: item.packQty
})
} }
} }
// //
if (item.secondPackUnit && item.secondPackQty) { if (item.secondPackUnit && item.secondPackQty) {
item.children.forEach((cur, key) => { item.children.forEach((cur, key) => {
cur.children = [] cur.children = []
// //
cur.xLastNumber = parseFloat(cur.xNumber) % parseFloat(item.secondPackQty) cur.xLastNumber = parseFloat(cur.qtyOne) % parseFloat(item.secondPackQty)
for (let j = 0; j < cur.xNumber; j++) { // cur.xiangNumber = Math.ceil(parseFloat(cur.qtyOne) / parseFloat(item.secondPackQty))
for (let i = 0; i < cur.xNumber; i++) {
twoId.value++ twoId.value++
cur.children[i]={
id: twoId.value,
xPoNumber: i + 1,
}
// //
if (cur.xLastNumber) { if (cur.xLastNumber) {
// //
if (j == cur.xNumbery - 1) { if (i == cur.xNumber - 1) {
cur.children.push({ cur.children[i].qtyTwo = cur.xLastNumber
id: twoId.value,
xPoNumber: j + 1,
qtyTwo: cur.xLastNumber
})
} else { } else {
// //
cur.children.push({ cur.children[i].qtyTwo = item.secondPackQty
id: twoId.value,
xPoNumber: j + 1,
qtyTwo: item.secondPackQty
})
} }
} else { } else {
// , // ,
cur.children.push({ cur.children[i].qtyTwo = item.secondPackQty
id: twoId.value,
xPoNumber: j + 1,
qtyTwo: item.secondPackQty
})
} }
} }
}) })
@ -241,38 +238,44 @@ const intData = () => {
} else { } else {
// //
item.lastNumber = parseFloat(item.orderQty) % parseFloat(item.secondPackQty) item.lastNumber = parseFloat(item.orderQty) % parseFloat(item.secondPackQty)
// %
item.allPackQty = Math.ceil(parseFloat(item.orderQty) / parseFloat(item.secondPackQty))
item.children = [] item.children = []
console.log(item.packQty1) console.log(333,item.lastNumber)
//
for (let i = 0; i < item.packQty1; i++) { for (let i = 0; i < item.packQty1; i++) {
oneId.value++ oneId.value++
if (item.lastNumber) { //
// item.children[i] = {
if (i == item.packQty - 1) { id: oneId.value,
item.children.push({ xPoNumber: i + 1,
id: oneId.value, qtyOne: ''
xPoNumber: i + 1, }
qtyOne: item.lastNumber console.log(444,item.allPackQty)
}) //
} else { for (let j = 0; j < item.allPackQty; j++) {
// if (i == j) {
item.children.push({ //
id: oneId.value, if (item.lastNumber) {
xPoNumber: i + 1, //
qtyOne: item.secondPackQty if (j == item.allPackQty - 1) {
}) item.children[j].qtyOne = item.lastNumber
}else{
//
item.children[j].qtyOne = item.secondPackQty
}
}else{
// ,
item.children[j].qtyOne = item.secondPackQty
}
} }
} else {
item.children.push({
id: oneId.value,
xPoNumber: i + 1,
qtyOne: item.secondPackQty
})
} }
} }
console.log(item.children)
} }
}) })
console.log(tableData.value) console.log(111, tableData.value)
} }
/** 弹窗按钮 */ /** 弹窗按钮 */
let Butttondata: any = [] let Butttondata: any = []
@ -297,9 +300,9 @@ const submitForm = () => {
let arr = tableData.value.map((item) => { let arr = tableData.value.map((item) => {
item.allNumber = 0 item.allNumber = 0
// //
item.children.forEach((cur) => { item.children.forEach((cur) => {
item.allNumber += parseFloat(cur.qtyOne) || 0 item.allNumber += parseFloat(cur.qtyOne) || 0
}) })
if (item.allNumber == parseFloat(item.orderQty)) { if (item.allNumber == parseFloat(item.orderQty)) {
return true return true
@ -383,6 +386,7 @@ const blurOne = (oneRow, twoRow) => {
twoRow.xNumber = oneRow.otherNumber twoRow.xNumber = oneRow.otherNumber
twoRow.children = [] twoRow.children = []
twoRow.qtyOne = parseFloat(twoRow.xNumber) * parseFloat(oneRow.secondPackQty) twoRow.qtyOne = parseFloat(twoRow.xNumber) * parseFloat(oneRow.secondPackQty)
return
} }
twoRow.qtyOne = parseFloat(twoRow.xNumber) * parseFloat(oneRow.secondPackQty) twoRow.qtyOne = parseFloat(twoRow.xNumber) * parseFloat(oneRow.secondPackQty)
let num = 0 let num = 0
@ -392,6 +396,7 @@ const blurOne = (oneRow, twoRow) => {
if (num > oneRow.allPackQty) { if (num > oneRow.allPackQty) {
message.warning('总箱数不可以大于' + oneRow.allPackQty) message.warning('总箱数不可以大于' + oneRow.allPackQty)
twoRow.xNumber = '' twoRow.xNumber = ''
twoRow.qtyOne = ''
return return
} }
// //
@ -437,7 +442,7 @@ const blurTwo = (oneRow, twoRow, threeRow) => {
console.log(parseFloat(threeRow.qtyTwo)) console.log(parseFloat(threeRow.qtyTwo))
console.log(parseFloat(oneRow.secondPackQty)) console.log(parseFloat(oneRow.secondPackQty))
if (parseFloat(threeRow.qtyTwo) > parseFloat(oneRow.secondPackQty)) { if (parseFloat(threeRow.qtyTwo) > parseFloat(oneRow.secondPackQty)) {
message.warning('数量最多为'+oneRow.secondPackQty) message.warning('数量最多为' + oneRow.secondPackQty)
threeRow.qtyTwo = oneRow.secondPackQty threeRow.qtyTwo = oneRow.secondPackQty
return return
} }

Loading…
Cancel
Save