|
@ -1,18 +1,18 @@ |
|
|
<template> |
|
|
<template> |
|
|
<el-dialog v-model="dialogTableVisible" :title="t('ts.标签')" width="1100"> |
|
|
<el-dialog v-model="dialogTableVisible" :title="t('ts.标签')" width="1150"> |
|
|
<div v-loading="isLoading"> |
|
|
<div v-loading="isLoading"> |
|
|
<el-table |
|
|
<el-table |
|
|
:data="showTableData()" |
|
|
:data="showTableData()" |
|
|
border |
|
|
border |
|
|
row-key="id" |
|
|
row-key="id" |
|
|
style="width: 1050px; max-height: 70vh; overflow-y: auto" |
|
|
style="width: 1100px; max-height: 70vh; overflow-y: auto;" |
|
|
v-if="tableData.length > 0 && dialogTableVisible == true" |
|
|
v-if="tableData.length > 0 && dialogTableVisible == true" |
|
|
|
|
|
|
|
|
> |
|
|
> |
|
|
<el-table-column type="expand" width="50"> |
|
|
<el-table-column type="expand" width="100"> |
|
|
<template #default="scope"> |
|
|
<template #default="scope"> |
|
|
<div |
|
|
<div |
|
|
style="margin-left: 400px; margin-top: -8px; margin-bottom: -8px" |
|
|
style="margin-left: 50px; margin-top: -8px; margin-bottom: -8px" |
|
|
v-if=" |
|
|
v-if=" |
|
|
scope.row.packUnit && |
|
|
scope.row.packUnit && |
|
|
scope.row.packQty && |
|
|
scope.row.packQty && |
|
@ -23,14 +23,14 @@ |
|
|
<el-table |
|
|
<el-table |
|
|
:data="scope.row.packageList" |
|
|
:data="scope.row.packageList" |
|
|
border |
|
|
border |
|
|
style="width: 550px" |
|
|
style="width: 1050px;" |
|
|
row-key="id" |
|
|
row-key="id" |
|
|
:row-class-name="getRowClass" |
|
|
:row-class-name="getRowClass" |
|
|
> |
|
|
> |
|
|
<el-table-column type="expand" width="50"> |
|
|
<el-table-column type="expand" width="50"> |
|
|
<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: 800px" row-key="id"> |
|
|
<el-table-column :label="t('ts.箱行号')" width="100" prop="xPoNumber" align="center"> |
|
|
<el-table-column :label="t('ts.箱行号')" width="100" prop="xPoNumber" align="center"> |
|
|
<template #default="scope2"> |
|
|
<template #default="scope2"> |
|
|
{{ scope2.$index + 1 }} |
|
|
{{ scope2.$index + 1 }} |
|
@ -44,6 +44,42 @@ |
|
|
/> |
|
|
/> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column :label="t('ts.钢卷号')" width="100" prop="steelCoilNumber" align="center"> |
|
|
|
|
|
<template #default="scope1"> |
|
|
|
|
|
<el-input |
|
|
|
|
|
v-model="scope1.row.steelCoilNumber" |
|
|
|
|
|
/> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column :label="t('ts.炉号')" width="100" prop="heatNumber" align="center"> |
|
|
|
|
|
<template #default="scope1"> |
|
|
|
|
|
<el-input |
|
|
|
|
|
v-model="scope1.row.heatNumber" |
|
|
|
|
|
/> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column :label="t('ts.热处理日期')" width="150" prop="heatTreatmentDate" align="center"> |
|
|
|
|
|
<template #default="scope1"> |
|
|
|
|
|
<el-date-picker style="width: 100%" |
|
|
|
|
|
v-model="scope1.row.heatTreatmentDate" |
|
|
|
|
|
:clearable="true" |
|
|
|
|
|
placeholder="热处理日期" |
|
|
|
|
|
format="YYYY-MM-DD" |
|
|
|
|
|
value-format="x" |
|
|
|
|
|
/> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column :label="t('ts.有效期')" width="150" prop="effectiveDate" align="center"> |
|
|
|
|
|
<template #default="scope1"> |
|
|
|
|
|
<el-date-picker style="width: 100%" |
|
|
|
|
|
v-model="scope1.row.effectiveDate" |
|
|
|
|
|
:clearable="true" |
|
|
|
|
|
placeholder="有效期" |
|
|
|
|
|
format="YYYY-MM-DD" |
|
|
|
|
|
value-format="x" |
|
|
|
|
|
/> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
<el-table-column :label="t('ts.添加箱')" width="100" prop="add" align="center"> |
|
|
<el-table-column :label="t('ts.添加箱')" width="100" prop="add" align="center"> |
|
|
<template #header> |
|
|
<template #header> |
|
|
<el-button |
|
|
<el-button |
|
@ -91,6 +127,40 @@ |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column :label="t('ts.数量')" width="100" prop="qtyOne" align="center" /> |
|
|
<el-table-column :label="t('ts.数量')" width="100" prop="qtyOne" align="center" /> |
|
|
|
|
|
<el-table-column :label="t('ts.钢卷号')" width="100" prop="steelCoilNumber" align="center"> |
|
|
|
|
|
<template #default="scope1"> |
|
|
|
|
|
<span>{{ scope1.row.steelCoilNumber }}</span> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column :label="t('ts.炉号')" width="100" prop="heatNumber" align="center"> |
|
|
|
|
|
<template #default="scope1"> |
|
|
|
|
|
<span>{{ scope1.row.heatNumber }}</span> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column :label="t('ts.热处理日期')" width="150" prop="heatTreatmentDate" align="center"> |
|
|
|
|
|
<template #default="scope1"> |
|
|
|
|
|
<el-date-picker style="width: 100%" |
|
|
|
|
|
disabled |
|
|
|
|
|
v-model="scope1.row.heatTreatmentDate" |
|
|
|
|
|
:clearable="true" |
|
|
|
|
|
placeholder="热处理日期" |
|
|
|
|
|
format="YYYY-MM-DD" |
|
|
|
|
|
value-format="x" |
|
|
|
|
|
/> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column :label="t('ts.有效期')" width="150" prop="effectiveDate" align="center"> |
|
|
|
|
|
<template #default="scope1"> |
|
|
|
|
|
<el-date-picker style="width: 100%" |
|
|
|
|
|
disabled |
|
|
|
|
|
v-model="scope1.row.effectiveDate" |
|
|
|
|
|
:clearable="true" |
|
|
|
|
|
placeholder="有效期" |
|
|
|
|
|
format="YYYY-MM-DD" |
|
|
|
|
|
value-format="x" |
|
|
|
|
|
/> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
<el-table-column :label="t('ts.操作')" width="100" prop="action" align="center"> |
|
|
<el-table-column :label="t('ts.操作')" width="100" prop="action" align="center"> |
|
|
<template #default="scope1"> |
|
|
<template #default="scope1"> |
|
|
<el-button |
|
|
<el-button |
|
@ -109,11 +179,11 @@ |
|
|
</el-table> |
|
|
</el-table> |
|
|
</div> |
|
|
</div> |
|
|
<div |
|
|
<div |
|
|
style="margin-left: 550px; margin-top: -8px; margin-bottom: -8px" |
|
|
style="margin-left: 250px; margin-top: -8px; margin-bottom: -8px" |
|
|
v-if="scope.row.packUnit && scope.row.packQty && !scope.row.secondPackUnit" |
|
|
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: 800px" row-key="id"> |
|
|
<el-table-column :label="t('ts.箱行号')" width="100" prop="xPoNumber" align="center"> |
|
|
<el-table-column :label="t('ts.箱行号')" width="100" prop="xPoNumber" align="center"> |
|
|
<template #default="scope1"> |
|
|
<template #default="scope1"> |
|
|
{{ scope1.$index + 1 }} |
|
|
{{ scope1.$index + 1 }} |
|
@ -127,6 +197,42 @@ |
|
|
/> |
|
|
/> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column :label="t('ts.钢卷号')" width="100" prop="steelCoilNumber" align="center"> |
|
|
|
|
|
<template #default="scope1"> |
|
|
|
|
|
<el-input |
|
|
|
|
|
v-model="scope1.row.steelCoilNumber" |
|
|
|
|
|
/> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column :label="t('ts.炉号')" width="100" prop="heatNumber" align="center"> |
|
|
|
|
|
<template #default="scope1"> |
|
|
|
|
|
<el-input |
|
|
|
|
|
v-model="scope1.row.heatNumber" |
|
|
|
|
|
/> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column :label="t('ts.热处理日期')" width="150" prop="heatTreatmentDate" align="center"> |
|
|
|
|
|
<template #default="scope1"> |
|
|
|
|
|
<el-date-picker style="width: 100%" |
|
|
|
|
|
v-model="scope1.row.heatTreatmentDate" |
|
|
|
|
|
:clearable="true" |
|
|
|
|
|
placeholder="热处理日期" |
|
|
|
|
|
format="YYYY-MM-DD" |
|
|
|
|
|
value-format="x" |
|
|
|
|
|
/> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column :label="t('ts.有效期')" width="150" prop="effectiveDate" align="center"> |
|
|
|
|
|
<template #default="scope1"> |
|
|
|
|
|
<el-date-picker style="width: 100%" |
|
|
|
|
|
v-model="scope1.row.effectiveDate" |
|
|
|
|
|
:clearable="true" |
|
|
|
|
|
placeholder="有效期" |
|
|
|
|
|
format="YYYY-MM-DD" |
|
|
|
|
|
value-format="x" |
|
|
|
|
|
/> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
<el-table-column :label="t('ts.添加箱')" width="100" prop="add" align="center"> |
|
|
<el-table-column :label="t('ts.添加箱')" width="100" prop="add" align="center"> |
|
|
<template #header> |
|
|
<template #header> |
|
|
<el-button |
|
|
<el-button |
|
@ -227,6 +333,7 @@ const intData = async () => { |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
const expandChange = (row: any, expandedRows: any[]) => { |
|
|
const expandChange = (row: any, expandedRows: any[]) => { |
|
|
|
|
|
console.log('展开数据',row) |
|
|
// 判断托信息和箱信息是否都存在 |
|
|
// 判断托信息和箱信息是否都存在 |
|
|
if (row.secondPackUnit && row.secondPackQty && row.packUnit && row.packQty) { |
|
|
if (row.secondPackUnit && row.secondPackQty && row.packUnit && row.packQty) { |
|
|
// 总共需要多少箱 |
|
|
// 总共需要多少箱 |
|
@ -258,7 +365,11 @@ const expandChange = (row: any, expandedRows: any[]) => { |
|
|
// tPoNumber: i + 1, |
|
|
// tPoNumber: i + 1, |
|
|
xNumber: '', |
|
|
xNumber: '', |
|
|
qtyOne: '', |
|
|
qtyOne: '', |
|
|
isTuo: 1 //有托 |
|
|
isTuo: 1, //有托 |
|
|
|
|
|
steelCoilNumber:row.steelCoilNumber,// 钢卷号 |
|
|
|
|
|
heatNumber:row.heatNumber,// 炉号 |
|
|
|
|
|
heatTreatmentDate:row.heatTreatmentDate, // 热处理日期 |
|
|
|
|
|
effectiveDate:row.effectiveDate // 有效日期 |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 如果有余数 |
|
|
// 如果有余数 |
|
@ -291,7 +402,11 @@ const expandChange = (row: any, expandedRows: any[]) => { |
|
|
for (let j = 0; j < cur.xNumber; j++) { |
|
|
for (let j = 0; j < cur.xNumber; j++) { |
|
|
twoId.value++ |
|
|
twoId.value++ |
|
|
cur.children[j] = { |
|
|
cur.children[j] = { |
|
|
id: twoId.value |
|
|
id: twoId.value, |
|
|
|
|
|
steelCoilNumber:row.steelCoilNumber,// 钢卷号 |
|
|
|
|
|
heatNumber:row.heatNumber,// 炉号 |
|
|
|
|
|
heatTreatmentDate:row.heatTreatmentDate, // 热处理日期 |
|
|
|
|
|
effectiveDate:row.effectiveDate // 有效日期 |
|
|
// xPoNumber: j + 1 |
|
|
// xPoNumber: j + 1 |
|
|
} |
|
|
} |
|
|
// 如果有余数 |
|
|
// 如果有余数 |
|
@ -311,6 +426,7 @@ const expandChange = (row: any, expandedRows: any[]) => { |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 只有箱规格 |
|
|
// 只有箱规格 |
|
|
if (!row.secondPackUnit && row.packUnit && row.packQty) { |
|
|
if (!row.secondPackUnit && row.packUnit && row.packQty) { |
|
|
// 数量%每箱数量 获取总共几箱 |
|
|
// 数量%每箱数量 获取总共几箱 |
|
@ -326,7 +442,8 @@ const expandChange = (row: any, expandedRows: any[]) => { |
|
|
id: oneId.value, |
|
|
id: oneId.value, |
|
|
// xPoNumber: i + 1, |
|
|
// xPoNumber: i + 1, |
|
|
qtyOne: row.qty, |
|
|
qtyOne: row.qty, |
|
|
isTuo: 0 //无托 |
|
|
isTuo: 0, //无托 |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
row.packageList.forEach((cur) => { |
|
|
row.packageList.forEach((cur) => { |
|
@ -334,7 +451,11 @@ const expandChange = (row: any, expandedRows: any[]) => { |
|
|
for (let j = 0; j < row.allXiangQty; j++) { |
|
|
for (let j = 0; j < row.allXiangQty; j++) { |
|
|
twoId.value++ |
|
|
twoId.value++ |
|
|
cur.children[j] = { |
|
|
cur.children[j] = { |
|
|
id: twoId.value |
|
|
id: twoId.value, |
|
|
|
|
|
steelCoilNumber:row.steelCoilNumber,// 钢卷号 |
|
|
|
|
|
heatNumber:row.heatNumber,// 炉号 |
|
|
|
|
|
heatTreatmentDate:row.heatTreatmentDate, // 热处理日期 |
|
|
|
|
|
effectiveDate:row.effectiveDate // 有效日期 |
|
|
// xPoNumber: j + 1 |
|
|
// xPoNumber: j + 1 |
|
|
} |
|
|
} |
|
|
// 数量除以箱数量获取余数 |
|
|
// 数量除以箱数量获取余数 |
|
@ -435,7 +556,11 @@ const addT = (oneRow) => { |
|
|
// : 1, //行号是上一行的行号加1 |
|
|
// : 1, //行号是上一行的行号加1 |
|
|
xNumber: '', |
|
|
xNumber: '', |
|
|
qtyOne: '', |
|
|
qtyOne: '', |
|
|
isTuo: 1 //有托 |
|
|
isTuo: 1, //有托 |
|
|
|
|
|
steelCoilNumber:oneRow.steelCoilNumber,// 钢卷号 |
|
|
|
|
|
heatNumber:oneRow.heatNumber,// 炉号 |
|
|
|
|
|
heatTreatmentDate:oneRow.heatTreatmentDate, // 热处理日期 |
|
|
|
|
|
effectiveDate:oneRow.effectiveDate // 有效日期 |
|
|
}) |
|
|
}) |
|
|
oneRow.allTuoQty = oneRow.packageList.length |
|
|
oneRow.allTuoQty = oneRow.packageList.length |
|
|
} |
|
|
} |
|
@ -446,6 +571,7 @@ const removeT = (oneRow, oneIndex, twoRow, twoIndex) => { |
|
|
} |
|
|
} |
|
|
// 添加箱 |
|
|
// 添加箱 |
|
|
const addX = (oneRow, oneIndex, twoRow, twoIndex, type) => { |
|
|
const addX = (oneRow, oneIndex, twoRow, twoIndex, type) => { |
|
|
|
|
|
console.log('添加箱',oneRow) |
|
|
twoId.value++ |
|
|
twoId.value++ |
|
|
// 有父级托的时候 |
|
|
// 有父级托的时候 |
|
|
if (type == 1) { |
|
|
if (type == 1) { |
|
@ -461,7 +587,11 @@ const addX = (oneRow, oneIndex, twoRow, twoIndex, type) => { |
|
|
// twoRow?.children?.length > 0 |
|
|
// twoRow?.children?.length > 0 |
|
|
// ? twoRow?.children[twoRow.children.length - 1]?.xPoNumber + 1 |
|
|
// ? twoRow?.children[twoRow.children.length - 1]?.xPoNumber + 1 |
|
|
// : 1, |
|
|
// : 1, |
|
|
qtyTwo: oneRow.packQty |
|
|
qtyTwo: oneRow.packQty, |
|
|
|
|
|
steelCoilNumber:oneRow.steelCoilNumber,// 钢卷号 |
|
|
|
|
|
heatNumber:oneRow.heatNumber,// 炉号 |
|
|
|
|
|
heatTreatmentDate:oneRow.heatTreatmentDate, // 热处理日期 |
|
|
|
|
|
effectiveDate:oneRow.effectiveDate // 有效日期 |
|
|
}) |
|
|
}) |
|
|
twoRow.xNumber = twoRow.children.length |
|
|
twoRow.xNumber = twoRow.children.length |
|
|
let num = 0 |
|
|
let num = 0 |
|
@ -474,7 +604,11 @@ const addX = (oneRow, oneIndex, twoRow, twoIndex, type) => { |
|
|
oneRow.isTuo = 1 //无托 |
|
|
oneRow.isTuo = 1 //无托 |
|
|
twoRow.children.push({ |
|
|
twoRow.children.push({ |
|
|
id: twoId.value, |
|
|
id: twoId.value, |
|
|
qtyTwo: oneRow.packQty |
|
|
qtyTwo: oneRow.packQty, |
|
|
|
|
|
steelCoilNumber:oneRow.steelCoilNumber,// 钢卷号 |
|
|
|
|
|
heatNumber:oneRow.heatNumber,// 炉号 |
|
|
|
|
|
heatTreatmentDate:oneRow.heatTreatmentDate, // 热处理日期 |
|
|
|
|
|
effectiveDate:oneRow.effectiveDate // 有效日期 |
|
|
}) |
|
|
}) |
|
|
//无托的时候默认显示一条托用来记录托数量 |
|
|
//无托的时候默认显示一条托用来记录托数量 |
|
|
let num = 0 |
|
|
let num = 0 |
|
|