pull/1/head
siontion 9 months ago
commit 0896e5542a

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

@ -0,0 +1,28 @@
<template>
<el-button class="default-btn primary-btn" @click="printHandle()"></el-button>
<!-- 打印 - 弹框-->
<Print ref="printRef" :info="dialogInfo" />
</template>
<script setup lang="ts">
import {ref,reactive} from 'vue'
import Print from './print.vue' //
/**
* 打印小票
*/
const printRef = ref() //
let dialogVisible = ref(false) //
let dialogInfo = ref({}) //
const data = ref<Record<string, any>>({});
/**
* 打印小票
*/
const printHandle =()=> {
dialogInfo.value = data.value || {};
dialogVisible.value = true;
printRef.value.open()
}
</script>

@ -0,0 +1,345 @@
<template>
<Dialog title="打印" v-model="dialogVisible" width="1000">
<!-- 打印预览 -->
<div class="print-wrap page" ref="print">
<table border="2" cellspacing="0" id="table">
<tbody>
<tr>
<td colspan="2">
<div style="width: 110px; text-align: center">
<img
src="/src/assets/imgs/exlogo.png"
style="width: 100%; padding-left: 20px"
alt=""
/>
</div>
</td>
<td colspan="6">
<span style="font-size: 20px; font-weight: 700">开发项目启动单</span>
</td>
<td colspan="2">
<div style="border-bottom: 1px solid #666">项目编号</div>
<div>{{ `项目编号码` }}</div>
</td>
</tr>
</tbody>
<tbody>
<tr>
<td colspan="2"> 客户名称 </td>
<td colspan="5">
<span>{{ '公司名字' }}</span>
</td>
<td colspan="1">{{ `密称` }}</td>
<td> 编码 </td>
<td>{{ `1091` }} </td>
</tr>
</tbody>
<tr>
<td colspan="2"> 项目名称 </td>
<td colspan="6">
{{ `系列摸具` }}
</td>
<td> 业务员 </td>
<td>{{ `xxx` }} </td>
</tr>
<tr>
<td colspan="2"> 项目工期 </td>
<td colspan="1"> </td>
<td colspan="1">
<span>{{ '2024/1/11' }}</span>
</td>
<td colspan="1"></td>
<td colspan="1">{{ `2024/4/11` }}</td>
<td>天数</td>
<td colspan="1">{{ `92` }}</td>
<td colspan="1"> 是否紧急 </td>
<td colspan="1">{{ `` }} </td>
</tr>
<tr>
<td colspan="10">
<div style="display: flex; justify-content: space-between">
<div style="width: 42%; font-size: 12px; display: flex; flex-direction: column">
<div style="text-align: left; width: 100%">客户提供资料</div>
<div
id="fruitForm"
style="display: flex; justify-content: flex-start; align-items: center"
>
<!-- <input
type="checkbox"
id="checkbox1"
name="fruit"
:checked="isSelected.includes(1)"
disabled
/> -->
<span class="checkbox" v-if="isSelected.includes(1) == false"></span>
<span class="checkbox" v-else-if="isSelected.includes(1) == true"></span>
<label for="checkbox1">开发合同</label>
<!-- <input
type="checkbox"
id="checkbox2"
name="fruit"
:checked="isSelected.includes(2)"
disabled
/> -->
<span class="checkbox" v-if="isSelected.includes(2) == false"></span>
<span class="checkbox" v-else-if="isSelected.includes(2) == true"></span>
<label for="checkbox2">技术协议</label>
<!-- <input
type="checkbox"
id="checkbox3"
name="fruit"
:checked="isSelected.includes(3)"
disabled
/> -->
<span class="checkbox" v-if="isSelected.includes(3) == false"></span>
<span class="checkbox" v-else-if="isSelected.includes(3) == true"></span>
<label for="checkbox3">图纸/数模</label>
</div>
</div>
<div style="width: 25%; display: flex; justify-content: center; font-size: 12px">
<span>费用说明</span>
<div style="border: 1px solid #333; width: 70px">
<div style="border-bottom: 1px solid #333">{{ `无费用` }}</div>
<div>{{ `` }}</div>
</div>
</div>
<div style="width: 22%; display: flex; justify-content: center; font-size: 12px">
<div>
<div>类别</div>
<div>性质</div>
</div>
<div style="border: 1px solid #333; width: 70px">
<div style="border-bottom: 1px solid #333">{{ `黑色` }}</div>
<div>{{ `新制` }}</div>
</div>
</div>
</div>
</td>
</tr>
<tbody>
<tr
><td colspan="10"> <div style="text-align: left; width: 100%">子项目信息</div></td></tr
>
<tr>
<td class="xh"> 序号 </td>
<td colspan="2"> 名称 </td>
<td> 设备型号 </td>
<td> 简称 </td>
<td> 数量 </td>
<td> 主要材料 </td>
<td colspan="3"> 子项目编号 </td>
</tr>
<tr v-for="item in 8" :key="item.index">
<td>{{ item }}</td>
<td colspan="2"></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td colspan="3"></td>
</tr>
</tbody>
<tbody>
<tr>
<td colspan="10">
<div style="text-align: left; width: 100%">备注</div>
</td>
</tr>
<tr>
<td colspan="10">
<div style="text-align: left; width: 100px; height: 150px">
<p> {{ '999' }}</p>
</div>
</td>
</tr>
</tbody>
<tbody>
<tr>
<td colspan="3"> 编制/日期 </td>
<td colspan="3"> 审核/日期 </td>
<td colspan="4"> 批准/日期 </td>
</tr>
<tr>
<td colspan="3">1</td>
<td colspan="3"> </td>
<td colspan="4"> </td>
</tr>
<tr>
<td colspan="3">1</td>
<td colspan="3"> </td>
<td colspan="4"> </td>
</tr>
</tbody>
</table>
</div>
<template #footer>
<!-- 打印 -->
<el-button @click="onPrint" type="primary">打印</el-button>
<el-button @click="outopen"></el-button>
</template>
</Dialog>
</template>
<script setup lang="ts">
// import { ref, reactive } from 'vue'
import { Check } from '@element-plus/icons-vue'
const dialogVisible = ref(false) //
const onPrint = () => {
// dom
const printNode = document.querySelector('.print-wrap')
if (!printNode) return
//
const newIframe: any = document.createElement('iframe')
newIframe.setAttribute(
'style',
'width:0px;height:0px;position:absolute;left:-9999px;top:-9999px;'
)
newIframe.setAttribute('align', 'center')
document.body.appendChild(newIframe)
//
let doc: any = null
doc = newIframe.contentWindow.document
doc.write(`
<style type="text/css">
/* 浏览器打印基本样式 */
.page {
width: 21cm;
min-height: 29.7cm;
padding: 10mm;
margin: 20px auto;
border: 1px #d3d3d3 solid;
border-radius: 5px;
background: white;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
position: relative;
font-size: 14px !important;
}
@page {
size: A4;
margin:1cm;
}
@media print {
.page {
margin: 10mm;
border: initial;
border-radius: initial;
width: initial;
min-height: initial;
box-shadow: initial;
background: initial;
page-break-after: always;
}
}
table {
width: 100%; /* 让表格宽度100%占满其父元素宽度 */
height: auto; /* 高度根据内容自适应 */
font-size: 14px;
text-align: center;
border-collapse: collapse;
margin-top: 5mm; /* 添加顶部外边距,替代原先的页内边距 */
td {
padding: 10px 0;
border: 1px solid #333;
}
}
.xh {
width: 50px !important;
}
.checkbox {
border: 2px solid #999;
width: 10px;
height: 10px;
display: flex;
justify-content: center;
align-items: center;
margin-left:10px ;
}
</style>
<div>
${printNode.innerHTML}
</div>`)
doc.close()
//
setTimeout(() => {
newIframe.contentWindow.focus()
newIframe.contentWindow.print()
document.body.removeChild(newIframe) //
dialogVisible.value = false
}, 100)
}
const outopen = () => {
dialogVisible.value = false
}
const queryParams: any = ref({
code: undefined
})
const isSelected = ref([1, 3])
/** 打开弹窗 */
const open = async (type: string, id?: number) => {
dialogVisible.value = true
}
defineExpose({ open }) // open
</script>
<style scoped lang="scss">
.page {
width: 21cm;
min-height: 29.7cm;
padding: 10mm;
margin: 20px auto;
border: 1px #d3d3d3 solid;
border-radius: 5px;
background: white;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
position: relative;
font-size: 14px !important;
}
@page {
size: A4;
margin: 0;
}
@media print {
.page {
margin: 0;
border: initial;
border-radius: initial;
width: initial;
min-height: initial;
box-shadow: initial;
background: initial;
page-break-after: always;
}
}
table {
width: 100%; /* 让表格宽度100%占满其父元素宽度 */
height: auto; /* 高度根据内容自适应 */
font-size: 14px;
text-align: center;
border-collapse: collapse;
margin-top: 5mm; /* 添加顶部外边距,替代原先的页内边距 */
td {
padding: 10px 0;
border: 1px solid #333;
}
}
.xh {
width: 50px !important;
}
.checkbox {
border: 2px solid #999;
width: 15px;
height: 15px;
display: flex;
justify-content: center;
align-items: center;
margin-left: 10px;
}
/*
A4的大小21cm*29.7cmwidth:794px;
单位换算1 inch = 2.54 cm 1mm = 96 px 1 cm = 37.79528 px*/
</style>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -55,3 +55,63 @@ CREATE TABLE `wms_storage_mat` (
`tenant_id` bigint(20) NOT NULL COMMENT '租户编号',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 COMMENT = '入/出库物料表' ROW_FORMAT = DYNAMIC;
DROP TABLE IF EXISTS project_order;
CREATE TABLE `project_order` (
`id` BIGINT ( 20 ) NOT NULL AUTO_INCREMENT COMMENT '自增字段,唯一',
`code` VARCHAR ( 64 ) NOT NULL COMMENT '项目编号,唯一',
`order_status` INT ( 11 ) NOT NULL DEFAULT '0' COMMENT '单据状态 已保存/已送审/已审核/已启动/已打回/已终止',
`delivery_status` TINYINT ( 1 ) NOT NULL COMMENT '发货状态 未发货/部分发货/全部发货',
`business_man` BIGINT ( 20 ) DEFAULT NULL COMMENT '业务员',
`business_dept_id` BIGINT ( 20 ) NOT NULL COMMENT '提出部门id',
`customer_id` BIGINT ( 20 ) NOT NULL COMMENT '客户id',
`mould_name` VARCHAR ( 255 ) NOT NULL COMMENT '模具名称',
`business_line` CHAR ( 1 ) NOT NULL COMMENT '业务线',
`blueprint_no` VARCHAR ( 32 ) COMMENT '图号',
`has_price` TINYINT ( 1 ) NOT NULL COMMENT '是否有价格',
`price` DECIMAL ( 20, 6 ) COMMENT '价格 保留四位小数',
`currency` char(1) COMMENT '币种',
`project_start_time` DATETIME NOT NULL COMMENT '项目开始时间',
`project_end_time` DATETIME COMMENT '项目结束时间',
`is_urgency` TINYINT ( 1 ) NOT NULL COMMENT '是否紧急',
`property` TINYINT ( 1 ) NOT NULL COMMENT '性质 新制|维修',
`reference_technology` VARCHAR ( 255 ) COMMENT '可引用的原有技术',
`has_alter` TINYINT ( 1 ) NOT NULL COMMENT '是否已变更',
`last_alter_time` DATETIME COMMENT '上一次变更时间',
`quality_requirement` VARCHAR ( 255 ) COMMENT '检验要求',
`remark` VARCHAR ( 255 ) COMMENT '备注',
`has_contract` TINYINT ( 1 ) NOT NULL COMMENT '有无合同',
`has_technology_protocol` TINYINT ( 1 ) NOT NULL COMMENT '有无技术协议',
`has_blueprint` TINYINT ( 1 ) NOT NULL COMMENT '有无图纸/数模',
`blueprint_remark` VARCHAR ( 255 ) NOT NULL COMMENT '图纸/数模 说明',
`status` TINYINT ( 1 ) NOT NULL DEFAULT '1' COMMENT '状态,1表示正常2表示禁用',
`creator` VARCHAR ( 64 ) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '创建者',
`create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updater` VARCHAR ( 64 ) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '更新者',
`update_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`deleted` BIT ( 1 ) NOT NULL DEFAULT b'0' COMMENT '是否删除',
`tenant_id` BIGINT ( 20 ) NOT NULL DEFAULT '0' COMMENT '租户编号',
PRIMARY KEY ( `id` ) USING BTREE,
UNIQUE KEY `idx_code` ( `code` ) USING BTREE
) ENGINE = InnoDB COMMENT = '项目订单表';
DROP TABLE IF EXISTS project_order_sub;
CREATE TABLE `project_order_sub` (
`id` BIGINT ( 20 ) NOT NULL AUTO_INCREMENT COMMENT '自增字段,唯一',
`project_order_id` BIGINT ( 20 ) NOT NULL COMMENT '项目订单id',
`name` VARCHAR ( 128 ) NOT NULL COMMENT '子项目名称,唯一',
`device_model` VARCHAR ( 64 ) COMMENT '设备型号',
`amount` INT ( 11 ) NOT NULL COMMENT '数量',
`composition_id` BIGINT(20) NOT NULL COMMENT '材质',
`remark` VARCHAR ( 255 ) COMMENT '备注',
`status` TINYINT ( 1 ) NOT NULL DEFAULT '1' COMMENT '状态,1表示正常2表示禁用',
`creator` VARCHAR ( 64 ) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '创建者',
`create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updater` VARCHAR ( 64 ) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '更新者',
`update_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`deleted` BIT ( 1 ) NOT NULL DEFAULT b'0' COMMENT '是否删除',
`tenant_id` BIGINT ( 20 ) NOT NULL DEFAULT '0' COMMENT '租户编号',
PRIMARY KEY ( `id` ) USING BTREE,
UNIQUE KEY `idx_name` ( `name` ) USING BTREE
) ENGINE = InnoDB COMMENT = '项目订单子项目表';

Loading…
Cancel
Save