| | |
| | | let titleList = ref([]) |
| | | let dataList = ref([]) |
| | | let list = ref([]) |
| | | let lastList = ref([]) |
| | | let lastList=ref([]) |
| | | |
| | | let filterData = ref({}) |
| | | |
| | |
| | | onMounted(() => { |
| | | request.post(`/processCard/getSelectPrintCustomLabel/${type}`, data.value).then((res) => { |
| | | if (res.code == 200) { |
| | | |
| | | console.log(res.data.data) |
| | | produceList.value = deepClone(res.data.title) |
| | | list.value = deepClone(res.data.data) |
| | | const data = produceList.value[0].value |
| | | dataList = JSON.parse(`[${data}]`); |
| | | labelList = dataList[0] |
| | | for (let i = 0; i < list.value.length; i++) { |
| | | let count = list.value[i].data.length |
| | | let count= list.value[i].data.length |
| | | for (let j = 0; j < count; j++) { |
| | | for (let k = 0; k < list.value[i].data[j].quantity; k++) { |
| | | for (let k = 0; k < list.value[i].data[j].quantity; k++){ |
| | | lastList.value.push(list.value[i].data[j]) |
| | | } |
| | | } |
| | | } |
| | | console.log(lastList.value) |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | router.push("/login") |
| | |
| | | }) |
| | | |
| | | } |
| | | |
| | | ) |
| | | |
| | | |
| | | |
| | | |
| | | // 打印方法 |
| | | const printFlowCard = () => { |
| | | // 需要打印的局部区域赋予"print-wrap"的id |
| | | let el = document.getElementById("print"); |
| | | let el = document.getElementById("printFlowCard"); |
| | | let doc = document; |
| | | let body = doc.body || doc.getElementsByTagName("body")[0]; |
| | | let printId = "print-" + Date.now(); |
| | |
| | | <template> |
| | | <el-button id="printButton" @click="printFlowCard();">{{ $t('basicData.print') }}</el-button> |
| | | <div id="printFlowCard" > |
| | | <div id="entirety" v-for="(item,id) in labelList" > |
| | | <div class="row1">{{ item.customer_name }}</div> |
| | | <div id="entirety" v-for="(item,id) in lastList" > |
| | | <div class="row1"> |
| | | <span>{{ item.customerAbbreviation }}</span> |
| | | <span>{{ item.orderId }}</span> |
| | | </div> |
| | | <div class="row2"> |
| | | <span>{{ item.order_id }}</span> |
| | | <span>{{ item.type_name }}</span> |
| | | <span>{{ item.project }}</span> |
| | | <span>{{ item.building_number }}</span> |
| | | </div> |
| | | <div class="row3">{{item.width}}*{{item.height}}={{item.quantity}}</div> |
| | | <div class="row5"> |
| | | <span>{{item.project}}</span> |
| | | <span>{{ item.building_number }}</span> |
| | | </div> |
| | | <div class="row6"> |
| | | <span>{{item.glass_child}}</span> |
| | | <span>{{item.processing_note}}</span> |
| | | <span>{{item.remarks}}</span> |
| | | <span>{{ item.processingNote }}</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | padding: 0; |
| | | } |
| | | |
| | | body { |
| | | font-weight: bolder; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | #printButton { |
| | | margin-top: -20px; |
| | | /*margin-top: -20px;*/ |
| | | width: 100px; |
| | | } |
| | | |
| | | /*成*/ |
| | | .printFlowCard_finished { |
| | | /* |
| | | font-family: 'Microsoft YaHei', '微软雅黑', sans-serif; |
| | | */ |
| | | #printFlowCard { |
| | | justify-content: left; |
| | | flex-wrap: wrap; |
| | | font-size: 12pt; |
| | | display: flex; |
| | | flex-direction: column; |
| | | margin-left: 5px; |
| | | margin-top: 15px; |
| | | } |
| | | |
| | | |
| | | /*成*/ |
| | | .entirety_finished { |
| | | display: flex; |
| | | #entirety{ |
| | | text-align: center; |
| | | flex-direction: column; |
| | | margin-left: 10px; |
| | | width: 100%; |
| | | height: 100%; |
| | | |
| | | width: 337px; |
| | | height: 120px; |
| | | } |
| | | |
| | | /*div{ |
| | | font-family: 'Microsoft YaHei', '微软雅黑', sans-serif; |
| | | }*/ |
| | | .row1 { |
| | | font-size: 12pt; |
| | | font-weight: bold; |
| | | height: 25px; |
| | | } |
| | | |
| | | .row2 { |
| | | font-size: 12pt; |
| | | font-weight: bold; |
| | | height: 25px; |
| | | } |
| | | span { |
| | | font-size: 12pt; |
| | | font-weight: bold; |
| | | } |
| | | |
| | | .row3 { |
| | | text-align: center; |
| | | font-weight: bolder; |
| | | font-size: 22px; |
| | | /*display: flex; |
| | | justify-content:space-evenly;*/ |
| | | } |
| | | |
| | | .row3 label { |
| | | font-size: 22px; |
| | | margin-top: 28px; |
| | | } |
| | | |
| | | .contentRow { |
| | | font-weight: bolder; |
| | | display: flex; |
| | | text-align: center; |
| | | width: 100%; |
| | | } |
| | | |
| | | label { |
| | | font-weight: bolder; |
| | | /*font-family: 'Microsoft YaHei', '微软雅黑', sans-serif;*/ |
| | | } |
| | | |
| | | .contentRow .row1 { |
| | | width: 30%; |
| | | margin-top: -5px; |
| | | height: 30px; |
| | | font-size: 20pt; |
| | | font-weight: bolder; |
| | | } |
| | | |
| | | .entirety_finished .row4 { |
| | | font-weight: bolder; |
| | | text-align: right; |
| | | margin-right: 10px; |
| | | .row5 { |
| | | height: 25px; |
| | | font-weight: bold; |
| | | font-size: 12pt; |
| | | } |
| | | |
| | | .contentRow .row1, .contentRow .row2 { |
| | | text-align: left; |
| | | font-weight: bolder; |
| | | .row6 { |
| | | height: 15px; |
| | | font-weight: bold; |
| | | font-size: 8pt; |
| | | } |
| | | |
| | | |
| | | |
| | | @page { |
| | | size: auto; /* auto is the initial value */ |
| | | margin: 13mm 4mm 0mm 6mm; /* this affects the margin in the printer settings */ |
| | | margin: 7mm 4mm 2mm 6mm /* this affects the margin in the printer settings */ |
| | | |
| | | } |
| | | |
| | | @media print { |
| | | div { |
| | | page-break-inside: avoid; |
| | | } |
| | | |
| | | .entirety_finished { |
| | | page-break-before: always; |
| | | } |
| | | |
| | | } |
| | | |
| | | .printFlowCard_finished1 { |
| | | flex-wrap: wrap; |
| | | font-size: 8pt; |
| | | display: flex; |
| | | flex-direction: column; |
| | | } |
| | | |
| | | |
| | | /*成*/ |
| | | .entirety_finished1 { |
| | | display: flex; |
| | | text-align: center; |
| | | flex-direction: column; |
| | | margin-left: 10px; |
| | | width: 337px; |
| | | height: 120px; |
| | | |
| | | } |
| | | |
| | | .contentRow1 { |
| | | font-weight: bolder; |
| | | display: flex; |
| | | text-align: center; |
| | | width: 100%; |
| | | } |
| | | |
| | | .contentRow1 .row1 { |
| | | width: 30%; |
| | | font-weight: bolder; |
| | | } |
| | | |
| | | .entirety_finished1 .row4 { |
| | | font-weight: bolder; |
| | | text-align: right; |
| | | margin-right: 10px; |
| | | } |
| | | |
| | | .contentRow1 .row1, .contentRow1 .row2 { |
| | | text-align: left; |
| | | font-weight: bolder; |
| | | } |
| | | |
| | | </style> |