|
|
@@ -38,10 +38,13 @@
|
|
|
style="width: 80px; height: 80px"
|
|
|
src="@/assets/logo.jpg"
|
|
|
alt=""
|
|
|
+ v-if="groupName.includes('宝悦')"
|
|
|
/>
|
|
|
<div>
|
|
|
- <div style="font-size: 14px">湖南宝悦新型建材有限公司</div>
|
|
|
- <div style="font-size: 10px"
|
|
|
+ <div style="font-size: 14px">{{
|
|
|
+ groupName || '湖南宝悦新型建材有限公司'
|
|
|
+ }}</div>
|
|
|
+ <div style="font-size: 10px" v-if="groupName.includes('宝悦')"
|
|
|
>HUNAN BAO YUE BULIDING MATERAIL</div
|
|
|
>
|
|
|
</div>
|
|
|
@@ -91,9 +94,9 @@
|
|
|
>
|
|
|
<tbody>
|
|
|
<tr align="center">
|
|
|
- <td style="padding: 1px;width: 120px" > 产品编码 </td>
|
|
|
- <td style="padding: 1px;"> 产品名称 </td>
|
|
|
- <td style="padding: 1px;width: 130px;"> 规格 </td>
|
|
|
+ <td style="padding: 1px; width: 120px"> 产品编码 </td>
|
|
|
+ <td style="padding: 1px"> 产品名称 </td>
|
|
|
+ <td style="padding: 1px; width: 130px"> 规格 </td>
|
|
|
<!-- <td style="padding: 1px"> 型号 </td> -->
|
|
|
<td style="padding: 1px"> 单位 </td>
|
|
|
<td style="padding: 1px"> 数量 </td>
|
|
|
@@ -112,9 +115,7 @@
|
|
|
<td style="padding: 1px">{{ item.measuringUnit }}</td>
|
|
|
<td style="padding: 1px">{{ item.totalCount }}</td>
|
|
|
<td style="padding: 1px">{{ item.blockCount }}</td>
|
|
|
- <td style="padding: 1px">{{
|
|
|
- item.extField.packagingStrength
|
|
|
- }}</td>
|
|
|
+ <td style="padding: 1px">{{ item.extField.packagingStrength }}</td>
|
|
|
<td style="padding: 1px">{{ item.extField.packagingDensity }}</td>
|
|
|
<td style="padding: 1px" v-if="isPrintPrice">{{
|
|
|
item.discountSinglePrice
|
|
|
@@ -221,135 +222,139 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { mapGetters } from 'vuex';
|
|
|
-import JsBarcode from 'jsbarcode';
|
|
|
-import { getSendSaleOrderrecordDetailSplit } from '@/api/saleManage/saleordersendrecord';
|
|
|
-export default {
|
|
|
- name: 'print',
|
|
|
- computed: {
|
|
|
- ...mapGetters(['user'])
|
|
|
- },
|
|
|
- props: {},
|
|
|
- data() {
|
|
|
- return {
|
|
|
- checked: '',
|
|
|
- QRvisible: false,
|
|
|
- isPrintPrice: false,
|
|
|
- codeList: [],
|
|
|
- formData: {},
|
|
|
- carName:""
|
|
|
- };
|
|
|
- },
|
|
|
+ import { mapGetters } from 'vuex';
|
|
|
+ import JsBarcode from 'jsbarcode';
|
|
|
+ import { getSendSaleOrderrecordDetailSplit } from '@/api/saleManage/saleordersendrecord';
|
|
|
+ export default {
|
|
|
+ name: 'print',
|
|
|
+ computed: {
|
|
|
+ ...mapGetters(['user'])
|
|
|
+ },
|
|
|
+ props: {
|
|
|
+ groupName: ''
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ checked: '',
|
|
|
+ QRvisible: false,
|
|
|
+ isPrintPrice: false,
|
|
|
+ codeList: [],
|
|
|
+ formData: {},
|
|
|
+ carName: ''
|
|
|
+ };
|
|
|
+ },
|
|
|
|
|
|
- methods: {
|
|
|
- open(id, isPrintPrice) {
|
|
|
- this.isPrintPrice = isPrintPrice;
|
|
|
- getSendSaleOrderrecordDetailSplit(id).then((data) => {
|
|
|
- if (JSON.stringify(data) != '{}') {
|
|
|
- this.formData = data;
|
|
|
- this.formData['carName']=data.carList.map(item=>item.name).toString()
|
|
|
- this.formData.projectName = data.saleOrderList?.[0]?.projectName;
|
|
|
- this.formData.driverNames = data.logisticTrakListNoteVOList
|
|
|
- .map((item) => item.driverName)
|
|
|
- .join(','); // 承运人
|
|
|
- this.codeList = data.productList;
|
|
|
- this.formData.markerName = this.user.info.name;
|
|
|
- }
|
|
|
- this.QRvisible = true;
|
|
|
- this.$nextTick(() => {
|
|
|
- JsBarcode('#print', data.docNo, {
|
|
|
- format: 'CODE39', //选择要使用的条形码类型
|
|
|
- width: 0.8, //设置条之间的宽度
|
|
|
- height: 50, //高度
|
|
|
- displayValue: false, //是否在条形码下方显示文字
|
|
|
- text: '', //覆盖显示的文本
|
|
|
- fontOptions: 'bold italic', //使文字加粗体或变斜体
|
|
|
- font: 'fantasy', //设置文本的字体
|
|
|
- textAlign: 'right', //设置文本的水平对齐方式
|
|
|
- textPosition: 'top', //设置文本的垂直位置
|
|
|
- textMargin: 1, //设置条形码和文本之间的间距
|
|
|
- fontSize: 15, //设置文本的大小
|
|
|
- background: '#fff', //设置条形码的背景
|
|
|
- lineColor: '#000', //设置条和文本的颜色。
|
|
|
- margin: 2 //设置条形码周围的空白边距
|
|
|
+ methods: {
|
|
|
+ open(id, isPrintPrice) {
|
|
|
+ this.isPrintPrice = isPrintPrice;
|
|
|
+ getSendSaleOrderrecordDetailSplit(id).then((data) => {
|
|
|
+ if (JSON.stringify(data) != '{}') {
|
|
|
+ this.formData = data;
|
|
|
+ this.formData['carName'] = data.carList
|
|
|
+ .map((item) => item.name)
|
|
|
+ .toString();
|
|
|
+ this.formData.projectName = data.saleOrderList?.[0]?.projectName;
|
|
|
+ this.formData.driverNames = data.logisticTrakListNoteVOList
|
|
|
+ .map((item) => item.driverName)
|
|
|
+ .join(','); // 承运人
|
|
|
+ this.codeList = data.productList;
|
|
|
+ this.formData.markerName = this.user.info.name;
|
|
|
+ }
|
|
|
+ this.QRvisible = true;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ JsBarcode('#print', data.docNo, {
|
|
|
+ format: 'CODE39', //选择要使用的条形码类型
|
|
|
+ width: 0.8, //设置条之间的宽度
|
|
|
+ height: 50, //高度
|
|
|
+ displayValue: false, //是否在条形码下方显示文字
|
|
|
+ text: '', //覆盖显示的文本
|
|
|
+ fontOptions: 'bold italic', //使文字加粗体或变斜体
|
|
|
+ font: 'fantasy', //设置文本的字体
|
|
|
+ textAlign: 'right', //设置文本的水平对齐方式
|
|
|
+ textPosition: 'top', //设置文本的垂直位置
|
|
|
+ textMargin: 1, //设置条形码和文本之间的间距
|
|
|
+ fontSize: 15, //设置文本的大小
|
|
|
+ background: '#fff', //设置条形码的背景
|
|
|
+ lineColor: '#000', //设置条和文本的颜色。
|
|
|
+ margin: 2 //设置条形码周围的空白边距
|
|
|
+ });
|
|
|
});
|
|
|
});
|
|
|
- });
|
|
|
- },
|
|
|
- close() {
|
|
|
- this.QRvisible = false;
|
|
|
- },
|
|
|
- //获取当前日期函数
|
|
|
- getNowFormatDate() {
|
|
|
- let date = new Date(),
|
|
|
- obj = {
|
|
|
- year: date.getFullYear(), //获取完整的年份(4位)
|
|
|
- month: date.getMonth() + 1, //获取当前月份(0-11,0代表1月)
|
|
|
- strDate: date.getDate(), // 获取当前日(1-31)
|
|
|
- week: '星期' + '日一二三四五六'.charAt(date.getDay()), //获取当前星期几(0 ~ 6,0代表星期天)
|
|
|
- hour: date.getHours(), //获取当前小时(0 ~ 23)
|
|
|
- minute: date.getMinutes(), //获取当前分钟(0 ~ 59)
|
|
|
- second: date.getSeconds() //获取当前秒数(0 ~ 59)
|
|
|
+ },
|
|
|
+ close() {
|
|
|
+ this.QRvisible = false;
|
|
|
+ },
|
|
|
+ //获取当前日期函数
|
|
|
+ getNowFormatDate() {
|
|
|
+ let date = new Date(),
|
|
|
+ obj = {
|
|
|
+ year: date.getFullYear(), //获取完整的年份(4位)
|
|
|
+ month: date.getMonth() + 1, //获取当前月份(0-11,0代表1月)
|
|
|
+ strDate: date.getDate(), // 获取当前日(1-31)
|
|
|
+ week: '星期' + '日一二三四五六'.charAt(date.getDay()), //获取当前星期几(0 ~ 6,0代表星期天)
|
|
|
+ hour: date.getHours(), //获取当前小时(0 ~ 23)
|
|
|
+ minute: date.getMinutes(), //获取当前分钟(0 ~ 59)
|
|
|
+ second: date.getSeconds() //获取当前秒数(0 ~ 59)
|
|
|
+ };
|
|
|
+ Object.keys(obj).forEach((key) => {
|
|
|
+ if (obj[key] < 10) obj[key] = `0${obj[key]}`;
|
|
|
+ });
|
|
|
+ // return `${obj.year}年${obj.month}月${obj.strDate}日 ${obj.hour}:${obj.minute}:${obj.second}`;
|
|
|
+ return `${obj.year}-${obj.month}-${obj.strDate}`;
|
|
|
+ },
|
|
|
+ print() {
|
|
|
+ const printSection = document.getElementById('printSection');
|
|
|
+ // 创建打印任务
|
|
|
+ const printWindow = window.open('', '_blank');
|
|
|
+ printWindow.document.open();
|
|
|
+ printWindow.document.write('<html><head><title>打印预览</title>');
|
|
|
+ printWindow.document.write(
|
|
|
+ '<link rel="stylesheet" href="your-stylesheet-url.css" type="text/css" />'
|
|
|
+ );
|
|
|
+ printWindow.document.write('</head><body>');
|
|
|
+ printWindow.document.write(printSection.innerHTML);
|
|
|
+ printWindow.document.write('</body></html>');
|
|
|
+ printWindow.document.close();
|
|
|
+ printWindow.onload = function () {
|
|
|
+ printWindow.print();
|
|
|
};
|
|
|
- Object.keys(obj).forEach((key) => {
|
|
|
- if (obj[key] < 10) obj[key] = `0${obj[key]}`;
|
|
|
- });
|
|
|
- // return `${obj.year}年${obj.month}月${obj.strDate}日 ${obj.hour}:${obj.minute}:${obj.second}`;
|
|
|
- return `${obj.year}-${obj.month}-${obj.strDate}`;
|
|
|
- },
|
|
|
- print() {
|
|
|
- const printSection = document.getElementById('printSection');
|
|
|
- // 创建打印任务
|
|
|
- const printWindow = window.open('', '_blank');
|
|
|
- printWindow.document.open();
|
|
|
- printWindow.document.write('<html><head><title>打印预览</title>');
|
|
|
- printWindow.document.write(
|
|
|
- '<link rel="stylesheet" href="your-stylesheet-url.css" type="text/css" />'
|
|
|
- );
|
|
|
- printWindow.document.write('</head><body>');
|
|
|
- printWindow.document.write(printSection.innerHTML);
|
|
|
- printWindow.document.write('</body></html>');
|
|
|
- printWindow.document.close();
|
|
|
- printWindow.onload = function () {
|
|
|
- printWindow.print();
|
|
|
- };
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
-};
|
|
|
+ };
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|
|
|
-#printSection {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- justify-content: center;
|
|
|
- flex-direction: column;
|
|
|
- .table_box {
|
|
|
- width: 70%;
|
|
|
- table-layout: fixed;
|
|
|
- word-break: break-all;
|
|
|
- word-wrap: break-word;
|
|
|
- }
|
|
|
- th,
|
|
|
- td {
|
|
|
- padding: 20px;
|
|
|
- position: relative;
|
|
|
- }
|
|
|
- .barCode {
|
|
|
- position: absolute;
|
|
|
- right: 10px;
|
|
|
- top: 50%;
|
|
|
- transform: translateY(-50%);
|
|
|
- }
|
|
|
- .person {
|
|
|
- width: 70%;
|
|
|
+ #printSection {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
- margin-bottom: 10px;
|
|
|
- > div {
|
|
|
- flex: 1;
|
|
|
+ flex-direction: column;
|
|
|
+ .table_box {
|
|
|
+ width: 70%;
|
|
|
+ table-layout: fixed;
|
|
|
+ word-break: break-all;
|
|
|
+ word-wrap: break-word;
|
|
|
+ }
|
|
|
+ th,
|
|
|
+ td {
|
|
|
+ padding: 20px;
|
|
|
+ position: relative;
|
|
|
+ }
|
|
|
+ .barCode {
|
|
|
+ position: absolute;
|
|
|
+ right: 10px;
|
|
|
+ top: 50%;
|
|
|
+ transform: translateY(-50%);
|
|
|
+ }
|
|
|
+ .person {
|
|
|
+ width: 70%;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ margin-bottom: 10px;
|
|
|
+ > div {
|
|
|
+ flex: 1;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
-}
|
|
|
</style>
|