|
@@ -112,7 +112,9 @@
|
|
|
<tr align="center" style="height: 30px">
|
|
<tr align="center" style="height: 30px">
|
|
|
<td :colspan="5">
|
|
<td :colspan="5">
|
|
|
<div style="margin-left: 35px">
|
|
<div style="margin-left: 35px">
|
|
|
- {{convertToChineseCurrency(getTotalValue('singlePrice', 2)) }}
|
|
|
|
|
|
|
+ {{
|
|
|
|
|
+ convertToChineseCurrency(getTotalValue('singlePrice', 2))
|
|
|
|
|
+ }}
|
|
|
</div>
|
|
</div>
|
|
|
</td>
|
|
</td>
|
|
|
<td :colspan="3">
|
|
<td :colspan="3">
|
|
@@ -164,161 +166,164 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
-import { getSendSaleOrderrecordDetailSplit } from '@/api/saleManage/saleordersendrecord';
|
|
|
|
|
-import { getInfoBySourceBizNoAll } from '@/api/wms';
|
|
|
|
|
-import { mapGetters } from 'vuex';
|
|
|
|
|
-import dictMixins from '@/mixins/dictMixins';
|
|
|
|
|
|
|
+ import { getSendSaleOrderrecordDetailSplit } from '@/api/saleManage/saleordersendrecord';
|
|
|
|
|
+ import { getInfoBySourceBizNoAll } from '@/api/wms';
|
|
|
|
|
+ import { mapGetters } from 'vuex';
|
|
|
|
|
+ import dictMixins from '@/mixins/dictMixins';
|
|
|
|
|
|
|
|
-export default {
|
|
|
|
|
- mixins: [dictMixins],
|
|
|
|
|
|
|
+ export default {
|
|
|
|
|
+ mixins: [dictMixins],
|
|
|
|
|
|
|
|
- name: 'print',
|
|
|
|
|
- computed: {
|
|
|
|
|
- ...mapGetters(['user'])
|
|
|
|
|
- },
|
|
|
|
|
- props: {
|
|
|
|
|
- groupName: ''
|
|
|
|
|
- },
|
|
|
|
|
- data() {
|
|
|
|
|
- return {
|
|
|
|
|
- checked: '',
|
|
|
|
|
- page: [],
|
|
|
|
|
- QRvisible: false,
|
|
|
|
|
- isPrintPrice: false,
|
|
|
|
|
- formData: {},
|
|
|
|
|
- outBound: {}
|
|
|
|
|
- };
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ name: 'print',
|
|
|
|
|
+ computed: {
|
|
|
|
|
+ ...mapGetters(['user'])
|
|
|
|
|
+ },
|
|
|
|
|
+ props: {
|
|
|
|
|
+ groupName: ''
|
|
|
|
|
+ },
|
|
|
|
|
+ data() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ checked: '',
|
|
|
|
|
+ page: [],
|
|
|
|
|
+ QRvisible: false,
|
|
|
|
|
+ isPrintPrice: false,
|
|
|
|
|
+ formData: {},
|
|
|
|
|
+ outBound: {}
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
|
|
|
|
|
- methods: {
|
|
|
|
|
- getTotalValue(key, num) {
|
|
|
|
|
- let val = this.formData?.productList?.reduce((total, item) => {
|
|
|
|
|
- return (total += Number(item[key]));
|
|
|
|
|
- }, 0);
|
|
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ getTotalValue(key, num) {
|
|
|
|
|
+ let val = this.formData?.productList?.reduce((total, item) => {
|
|
|
|
|
+ return (total += Number(item[key]));
|
|
|
|
|
+ }, 0);
|
|
|
|
|
|
|
|
- return (
|
|
|
|
|
- (val &&
|
|
|
|
|
- parseFloat(val)
|
|
|
|
|
- .toFixed(num)
|
|
|
|
|
- .replace(/\.?0+$/, '')) ||
|
|
|
|
|
- 0
|
|
|
|
|
- );
|
|
|
|
|
- },
|
|
|
|
|
- async open(id) {
|
|
|
|
|
- this.formData = await getSendSaleOrderrecordDetailSplit(id);
|
|
|
|
|
- this.QRvisible = true;
|
|
|
|
|
|
|
+ return (
|
|
|
|
|
+ (val &&
|
|
|
|
|
+ parseFloat(val)
|
|
|
|
|
+ .toFixed(num)
|
|
|
|
|
+ .replace(/\.?0+$/, '')) ||
|
|
|
|
|
+ 0
|
|
|
|
|
+ );
|
|
|
|
|
+ },
|
|
|
|
|
+ async open(id) {
|
|
|
|
|
+ this.formData = await getSendSaleOrderrecordDetailSplit(id);
|
|
|
|
|
+ this.QRvisible = true;
|
|
|
|
|
|
|
|
- this.page = this.chunkArray(this.formData.productList, 6);
|
|
|
|
|
- console.log(this.page, 'this.page');
|
|
|
|
|
- // let dataArray = await getInfoBySourceBizNoAll(this.formData.docNo);
|
|
|
|
|
- // this.outBound = JSON.parse(JSON.stringify(dataArray[0]));
|
|
|
|
|
- // this.outBound['outInDetailRecordRequestList'] = [];
|
|
|
|
|
|
|
+ this.page = this.chunkArray(this.formData.productList, 6);
|
|
|
|
|
+ console.log(this.page, 'this.page');
|
|
|
|
|
+ // let dataArray = await getInfoBySourceBizNoAll(this.formData.docNo);
|
|
|
|
|
+ // this.outBound = JSON.parse(JSON.stringify(dataArray[0]));
|
|
|
|
|
+ // this.outBound['outInDetailRecordRequestList'] = [];
|
|
|
|
|
|
|
|
- // dataArray.forEach((item) => {
|
|
|
|
|
- // item.outInDetailList.forEach((val) => {
|
|
|
|
|
- // if (val.outInDetailRecordRequestList.length) {
|
|
|
|
|
- // val.outInDetailRecordRequestList.forEach((j) => {
|
|
|
|
|
- // j['categoryName'] = val.categoryName;
|
|
|
|
|
- // j['categoryModel'] = val.categoryModel;
|
|
|
|
|
- // j['specification'] = val.specification;
|
|
|
|
|
- // j['categoryCode'] = val.categoryCode;
|
|
|
|
|
- // });
|
|
|
|
|
- // this.outBound['outInDetailRecordRequestList'].push(
|
|
|
|
|
- // ...val.outInDetailRecordRequestList
|
|
|
|
|
- // );
|
|
|
|
|
- // } else {
|
|
|
|
|
- // this.outBound['outInDetailRecordRequestList'].push(val);
|
|
|
|
|
- // }
|
|
|
|
|
- // });
|
|
|
|
|
- // });
|
|
|
|
|
- //包装维度
|
|
|
|
|
- },
|
|
|
|
|
- chunkArray(array, size) {
|
|
|
|
|
- const result = [];
|
|
|
|
|
- for (let i = 0; i < array.length; i += size) {
|
|
|
|
|
- result.push(array.slice(i, i + size));
|
|
|
|
|
- }
|
|
|
|
|
- return result;
|
|
|
|
|
- },
|
|
|
|
|
- close() {
|
|
|
|
|
- this.QRvisible = false;
|
|
|
|
|
- this.page = [];
|
|
|
|
|
- },
|
|
|
|
|
- convertToChineseCurrency(amount) {
|
|
|
|
|
- // 定义数字到汉字的映射
|
|
|
|
|
- const chineseNums = [
|
|
|
|
|
- '零',
|
|
|
|
|
- '壹',
|
|
|
|
|
- '贰',
|
|
|
|
|
- '参',
|
|
|
|
|
- '肆',
|
|
|
|
|
- '伍',
|
|
|
|
|
- '陆',
|
|
|
|
|
- '柒',
|
|
|
|
|
- '捌',
|
|
|
|
|
- '玖'
|
|
|
|
|
- ];
|
|
|
|
|
- // 定义单位
|
|
|
|
|
- const units = [
|
|
|
|
|
- '分',
|
|
|
|
|
- '角',
|
|
|
|
|
- '元',
|
|
|
|
|
- '拾',
|
|
|
|
|
- '佰',
|
|
|
|
|
- '佰',
|
|
|
|
|
- '亿',
|
|
|
|
|
- '万',
|
|
|
|
|
- '仟',
|
|
|
|
|
- '佰'
|
|
|
|
|
- ];
|
|
|
|
|
|
|
+ // dataArray.forEach((item) => {
|
|
|
|
|
+ // item.outInDetailList.forEach((val) => {
|
|
|
|
|
+ // if (val.outInDetailRecordRequestList.length) {
|
|
|
|
|
+ // val.outInDetailRecordRequestList.forEach((j) => {
|
|
|
|
|
+ // j['categoryName'] = val.categoryName;
|
|
|
|
|
+ // j['categoryModel'] = val.categoryModel;
|
|
|
|
|
+ // j['specification'] = val.specification;
|
|
|
|
|
+ // j['categoryCode'] = val.categoryCode;
|
|
|
|
|
+ // });
|
|
|
|
|
+ // this.outBound['outInDetailRecordRequestList'].push(
|
|
|
|
|
+ // ...val.outInDetailRecordRequestList
|
|
|
|
|
+ // );
|
|
|
|
|
+ // } else {
|
|
|
|
|
+ // this.outBound['outInDetailRecordRequestList'].push(val);
|
|
|
|
|
+ // }
|
|
|
|
|
+ // });
|
|
|
|
|
+ // });
|
|
|
|
|
+ //包装维度
|
|
|
|
|
+ },
|
|
|
|
|
+ chunkArray(array, size) {
|
|
|
|
|
+ const result = [];
|
|
|
|
|
+ for (let i = 0; i < array.length; i += size) {
|
|
|
|
|
+ result.push(array.slice(i, i + size));
|
|
|
|
|
+ }
|
|
|
|
|
+ return result;
|
|
|
|
|
+ },
|
|
|
|
|
+ close() {
|
|
|
|
|
+ this.QRvisible = false;
|
|
|
|
|
+ this.page = [];
|
|
|
|
|
+ },
|
|
|
|
|
+ convertToChineseCurrency(amount) {
|
|
|
|
|
+ // 定义数字到汉字的映射
|
|
|
|
|
+ const chineseNums = [
|
|
|
|
|
+ '零',
|
|
|
|
|
+ '壹',
|
|
|
|
|
+ '贰',
|
|
|
|
|
+ '参',
|
|
|
|
|
+ '肆',
|
|
|
|
|
+ '伍',
|
|
|
|
|
+ '陆',
|
|
|
|
|
+ '柒',
|
|
|
|
|
+ '捌',
|
|
|
|
|
+ '玖'
|
|
|
|
|
+ ];
|
|
|
|
|
+ // 定义单位
|
|
|
|
|
+ const units = [
|
|
|
|
|
+ '分',
|
|
|
|
|
+ '角',
|
|
|
|
|
+ '元',
|
|
|
|
|
+ '拾',
|
|
|
|
|
+ '佰',
|
|
|
|
|
+ '佰',
|
|
|
|
|
+ '亿',
|
|
|
|
|
+ '万',
|
|
|
|
|
+ '仟',
|
|
|
|
|
+ '佰'
|
|
|
|
|
+ ];
|
|
|
|
|
|
|
|
- // 处理小数部分
|
|
|
|
|
- let decimalPart = (amount * 100) % 100; // 获取分
|
|
|
|
|
- let decimalStr = '';
|
|
|
|
|
- if (decimalPart !== 0) {
|
|
|
|
|
- decimalStr = chineseNums[decimalPart % 10] + units[0]; // 分
|
|
|
|
|
- if (decimalPart >= 10) {
|
|
|
|
|
- decimalStr =
|
|
|
|
|
- chineseNums[Math.floor(decimalPart / 10)] + units[1] + decimalStr; // 角
|
|
|
|
|
|
|
+ // 处理小数部分
|
|
|
|
|
+ let decimalPart = (amount * 100) % 100; // 获取分
|
|
|
|
|
+ let decimalStr = '';
|
|
|
|
|
+ if (decimalPart !== 0) {
|
|
|
|
|
+ decimalStr = chineseNums[decimalPart % 10] + units[0]; // 分
|
|
|
|
|
+ if (decimalPart >= 10) {
|
|
|
|
|
+ decimalStr =
|
|
|
|
|
+ chineseNums[Math.floor(decimalPart / 10)] + units[1] + decimalStr; // 角
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
- // 处理整数部分
|
|
|
|
|
- let integerPart = Math.floor(amount);
|
|
|
|
|
- let integerStr = '';
|
|
|
|
|
- if (integerPart === 0) {
|
|
|
|
|
- integerStr = chineseNums[0]; // 特殊处理0元的情况
|
|
|
|
|
- } else {
|
|
|
|
|
- integerPart = integerPart
|
|
|
|
|
- .toString()
|
|
|
|
|
- .replace(/(0+)$/, '')
|
|
|
|
|
- .replace(/9(?=0)/g, '玖'); // 处理9后面跟0的情况
|
|
|
|
|
- integerStr = integerPart
|
|
|
|
|
- .split('')
|
|
|
|
|
- .reverse()
|
|
|
|
|
- .map((num, index) => {
|
|
|
|
|
- return chineseNums[parseInt(num)] + units[index + 2]; // 从元开始计数,跳过已经处理的分和角
|
|
|
|
|
- })
|
|
|
|
|
- .reverse()
|
|
|
|
|
- .join('');
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // 处理整数部分
|
|
|
|
|
+ let integerPart = Math.floor(amount);
|
|
|
|
|
+ let integerStr = '';
|
|
|
|
|
+ if (integerPart === 0) {
|
|
|
|
|
+ integerStr = chineseNums[0]; // 特殊处理0元的情况
|
|
|
|
|
+ } else {
|
|
|
|
|
+ integerPart = integerPart
|
|
|
|
|
+ .toString()
|
|
|
|
|
+ .replace(/(0+)$/, '')
|
|
|
|
|
+ .replace(/9(?=0)/g, '玖'); // 处理9后面跟0的情况
|
|
|
|
|
+ integerStr = integerPart
|
|
|
|
|
+ .split('')
|
|
|
|
|
+ .reverse()
|
|
|
|
|
+ .map((num, index) => {
|
|
|
|
|
+ return chineseNums[parseInt(num)] + units[index + 2]; // 从元开始计数,跳过已经处理的分和角
|
|
|
|
|
+ })
|
|
|
|
|
+ .reverse()
|
|
|
|
|
+ .join('');
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- // 清理多余的零和单位
|
|
|
|
|
- integerStr = integerStr
|
|
|
|
|
- .replace(/零([元|万|亿])/g, '$1')
|
|
|
|
|
- .replace(/零+/g, '零')
|
|
|
|
|
- .replace(/零([角|分])/g, '$1');
|
|
|
|
|
|
|
+ // 清理多余的零和单位
|
|
|
|
|
+ integerStr = integerStr
|
|
|
|
|
+ .replace(/零([元|万|亿])/g, '$1')
|
|
|
|
|
+ .replace(/零+/g, '零')
|
|
|
|
|
+ .replace(/零([角|分])/g, '$1');
|
|
|
|
|
|
|
|
- // 组合整数部分和小数部分
|
|
|
|
|
- return integerStr + (decimalStr ? '整' : '') + decimalStr;
|
|
|
|
|
- },
|
|
|
|
|
- print() {
|
|
|
|
|
- const printSection = document.getElementById('printSection');
|
|
|
|
|
- // 创建打印任务
|
|
|
|
|
- const printWindow = window.open('', '_blank');
|
|
|
|
|
- printWindow.document.open();
|
|
|
|
|
- printWindow.document.write('<html><head><title>打印预览</title>');
|
|
|
|
|
- printWindow.document.write(`<style>
|
|
|
|
|
|
|
+ // 组合整数部分和小数部分
|
|
|
|
|
+ return integerStr + (decimalStr ? '整' : '') + decimalStr;
|
|
|
|
|
+ },
|
|
|
|
|
+ print() {
|
|
|
|
|
+ const printSection = document.getElementById('printSection');
|
|
|
|
|
+ // 创建打印任务
|
|
|
|
|
+ const printWindow = window.open('', '_blank');
|
|
|
|
|
+ printWindow.document.open();
|
|
|
|
|
+ printWindow.document.write('<html><head><title>打印预览</title>');
|
|
|
|
|
+ printWindow.document.write(`<style>
|
|
|
|
|
+ @page { size: 310mm 100mm; margin: 0; }
|
|
|
|
|
+ body { font-family: "Courier New"; font-size: 10pt; }
|
|
|
|
|
+ table { width: 300mm; border-collapse: collapse; }
|
|
|
@media print {
|
|
@media print {
|
|
|
table{
|
|
table{
|
|
|
border:none
|
|
border:none
|
|
@@ -328,12 +333,12 @@ export default {
|
|
|
page-break-inside: avoid !important;
|
|
page-break-inside: avoid !important;
|
|
|
}
|
|
}
|
|
|
@page {
|
|
@page {
|
|
|
- size: 30cm 11cm; /* 设置打印尺寸 */
|
|
|
|
|
- margin: 0; /* 去除页边距 */
|
|
|
|
|
|
|
+ // size: 241mm 140mm;
|
|
|
|
|
+ // margin: 10mm; /* 去除页边距 */
|
|
|
}
|
|
}
|
|
|
body {
|
|
body {
|
|
|
- width: 30cm;
|
|
|
|
|
- height: 11cm;
|
|
|
|
|
|
|
+ // width: 40cm;
|
|
|
|
|
+ // height: 11cm;
|
|
|
padding: 0;
|
|
padding: 0;
|
|
|
margin: 0;
|
|
margin: 0;
|
|
|
}
|
|
}
|
|
@@ -346,20 +351,20 @@ export default {
|
|
|
|
|
|
|
|
</style>`);
|
|
</style>`);
|
|
|
|
|
|
|
|
- printWindow.document.write('</head><body>');
|
|
|
|
|
- printWindow.document.write(printSection.innerHTML);
|
|
|
|
|
- printWindow.document.write('</body></html>');
|
|
|
|
|
- printWindow.document.close();
|
|
|
|
|
- printWindow.onload = function () {
|
|
|
|
|
- printWindow.print();
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ printWindow.document.write('</head><body>');
|
|
|
|
|
+ printWindow.document.write(printSection.innerHTML);
|
|
|
|
|
+ printWindow.document.write('</body></html>');
|
|
|
|
|
+ printWindow.document.close();
|
|
|
|
|
+ printWindow.onload = function () {
|
|
|
|
|
+ printWindow.print();
|
|
|
|
|
+ };
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
-};
|
|
|
|
|
|
|
+ };
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
|
<style>
|
|
|
-@media print {
|
|
|
|
|
|
|
+ /* @media print {
|
|
|
.print {
|
|
.print {
|
|
|
page-break-before: always !important;
|
|
page-break-before: always !important;
|
|
|
page-break-inside: avoid !important;
|
|
page-break-inside: avoid !important;
|
|
@@ -368,5 +373,5 @@ export default {
|
|
|
size: 30cm 11cm;
|
|
size: 30cm 11cm;
|
|
|
margin: 0;
|
|
margin: 0;
|
|
|
}
|
|
}
|
|
|
-}
|
|
|
|
|
|
|
+} */
|
|
|
</style>
|
|
</style>
|