| | |
| | | <script setup> |
| | | /*生产加工单竖版*/ |
| | | import request from "@/utils/request" |
| | | import {computed, onMounted, ref} from "vue" |
| | | import PrintFoot from "@/components/sd/order/PrintFoot.vue" |
| | |
| | | const grossNum = ref({ |
| | | quantity: 0, |
| | | grossArea: 0, |
| | | perimeter: 0 |
| | | perimeter: 0, |
| | | weight:0 |
| | | }) |
| | | const getData = () => { |
| | | request.get(`/order/printOrderProductDetail/${props.orderId}/${selectedValues.value}`).then(res => { |
| | | console.log(res.data) |
| | | data.value= res.data |
| | | productIdData.value=data.value.orderProductDetail |
| | | data.value.orderProductDetail.forEach(item => { |
| | | grossNum.value.quantity += getQuantity(item.productDetail) |
| | | grossNum.value.grossArea += getArea(item.productDetail) |
| | | grossNum.value.perimeter += getPerimeter(item.productDetail) |
| | | grossNum.value.weight += getWeight(item.productDetail) |
| | | stringToJson(item.productDetail) |
| | | }) |
| | | |
| | | grossNum.value.quantity = parseFloat(grossNum.value.quantity.toFixed(2)) |
| | | grossNum.value.grossArea = parseFloat(grossNum.value.grossArea.toFixed(2)) |
| | | grossNum.value.perimeter = parseFloat(grossNum.value.perimeter.toFixed(2)) |
| | | grossNum.value.perimeter = parseFloat(grossNum.value.perimeter.toFixed(3)) |
| | | grossNum.value.weight = parseFloat(grossNum.value.weight.toFixed(2)) |
| | | |
| | | }) |
| | | } |
| | |
| | | grossNum.value.quantity=0 |
| | | grossNum.value.grossArea=0 |
| | | grossNum.value.perimeter=0 |
| | | grossNum.value.weight=0 |
| | | data.value= res.data |
| | | |
| | | data.value.orderProductDetail.forEach(item => { |
| | | grossNum.value.quantity += getQuantity(item.productDetail) |
| | | grossNum.value.grossArea += getArea(item.productDetail) |
| | | grossNum.value.perimeter += getPerimeter(item.productDetail) |
| | | grossNum.value.weight += getWeight(item.productDetail) |
| | | stringToJson(item.productDetail) |
| | | }) |
| | | grossNum.value.quantity = parseFloat(grossNum.value.quantity.toFixed(2)) |
| | | grossNum.value.grossArea = parseFloat(grossNum.value.grossArea.toFixed(2)) |
| | | grossNum.value.perimeter = parseFloat(grossNum.value.perimeter.toFixed(2)) |
| | | grossNum.value.perimeter = parseFloat(grossNum.value.perimeter.toFixed(3)) |
| | | grossNum.value.weight = parseFloat(grossNum.value.weight.toFixed(2)) |
| | | |
| | | }) |
| | | |
| | |
| | | productList.forEach(item => { |
| | | perimeter += item.perimeter |
| | | }) |
| | | return parseFloat(perimeter.toFixed(2)) |
| | | return parseFloat(perimeter.toFixed(3)) |
| | | } |
| | | |
| | | const getWeight = (productList) => { |
| | | let weight = 0 |
| | | productList.forEach(item => { |
| | | weight += item.weight*item.quantity |
| | | }) |
| | | return parseFloat(weight.toFixed(2)) |
| | | } |
| | | |
| | | |
| | | const printSheet = () => { |
| | | } |
| | |
| | | </tr> |
| | | |
| | | <tr class="title-s"> |
| | | <th colspan="2" style="width: 30%"></th> |
| | | <th colspan="2" style="width: 30%;text-align: left;"><span>总重量:{{ grossNum.weight }}</span></th> |
| | | <th colspan="5" style="width: 40%;"> |
| | | <h3 >生产任务单(成品)</h3> |
| | | <h3 >生产任务单({{data.order.orderType}})</h3> |
| | | </th> |
| | | <th colspan="2" style="width: 30%;">订单编号:<span>{{ data.order.orderId }}</span></th> |
| | | <th colspan="2" style="width: 30%;">订单编号:<span>{{ data.order.orderId }}</span> |
| | | <span v-if="company.companyName==='常州市吉利玻璃有限公司'&& data.order.batch!==''">(原{{ data.order.batch }})</span> |
| | | </th> |
| | | </tr> |
| | | <tr> |
| | | <th style="text-align: left;border:none;font-weight: bold;font-size: 17px;" colspan="4"> |
| | | 客户名称:<span>{{ data.order.customerName }}</span></th> |
| | | <th style="text-align: left;border:none;font-weight: bold;font-size: 17px;" colspan="3"> |
| | | <th style="text-align: left;border:none;font-weight: bold;font-size: 17px;" v-if="data.order.batch!==''" colspan="3"> |
| | | 项目名称:<span>{{ data.order.project }}({{data.order.batch}})</span></th> |
| | | <th style="text-align: left;border:none;font-weight: bold;font-size: 17px;" v-else colspan="3"> |
| | | 项目名称:<span>{{ data.order.project }}</span></th> |
| | | <th style="text-align: left;border:none;font-weight: bold;font-size: 17px;" colspan="2"> |
| | | 发货日期:<span>{{ data.order.deliveryDate }}</span></th> |
| | |
| | | <tr v-if="index===0"> |
| | | <th style="width: 6%;font-weight: bold;">序</th> |
| | | <th style="width: 15%;font-weight: bold;" >楼层编号</th> |
| | | <th style="width: 25%;font-weight: bold;" colspan="3">宽X高</th> |
| | | <th style="width: 20%;font-weight: bold;" colspan="3">宽X高</th> |
| | | <th style="width: 8%;font-weight: bold;">数量</th> |
| | | <th style="width: 8%;font-weight: bold;">周长</th> |
| | | <th style="width: 12%;font-weight: bold;">面积</th> |
| | | <th style="width: 17%;font-weight: bold;" colspan="2">加工要求</th> |
| | | <th style="width: 22%;font-weight: bold;" colspan="2">加工要求/备注</th> |
| | | </tr> |
| | | |
| | | |
| | |
| | | <tr class="day-in" v-for="(items, index1) in item.productDetail" :key="index1"> |
| | | <td>{{items.orderNumber}}</td> |
| | | <td>{{items.buildingNumber}}</td> |
| | | <td colspan="3" style="font-size: 20px;font-weight: bold;" v-if="items.otherColumns?.S02">{{items.otherColumns?.S02}}</td> |
| | | <td colspan="3" style="font-size: 20px;font-weight: bold;" v-if="items.otherColumns?.S02&&company.companyName!='上海北玻玻璃技术工业有限公司'">{{items.otherColumns?.S02}}</td> |
| | | <td colspan="3" style="font-size: 17px;white-space:nowrap;font-weight: bold;" v-else-if="items.differentSize===1 && items.bendRadius==null"> |
| | | <template v-for="(orderGlassDetail, index1) in items.orderGlassDetails" > |
| | | ({{orderGlassDetail.childWidth}}x{{orderGlassDetail.childHeight}}) |
| | |
| | | </td> |
| | | <td colspan="3" style="font-size: 20px;font-weight: bold;" v-else>{{items.width}}x{{items.height}}</td> |
| | | <td style="font-size: 20px;font-weight: bold;">{{items.quantity}}</td> |
| | | <td style="font-size: 20px;font-weight: bold;">{{items.perimeter}}</td> |
| | | <td style="font-size: 20px;font-weight: bold;">{{items.grossArea.toFixed(2)}}</td> |
| | | <td colspan="2">{{items.processingNote}}</td> |
| | | <td colspan="2">{{items.processingNote}} |
| | | {{items.remarks==null?'':'/'}} |
| | | {{items.remarks}}</td> |
| | | </tr> |
| | | <tr class="day-in" > |
| | | <td style="font-size: 15px;font-weight: bold;" colspan="5">小计:</td> |
| | | <td style="font-size: 20px;font-weight: bold;">{{getQuantity(item.productDetail)}}</td> |
| | | <td style="font-size: 20px;font-weight: bold;">{{getPerimeter(item.productDetail)}}</td> |
| | | <td style="font-size: 20px;font-weight: bold;">{{getArea(item.productDetail)}}</td> |
| | | <td colspan="2"></td> |
| | | </tr> |
| | |
| | | <tr class="day-in"> |
| | | <td style="font-size: 15px;font-weight: bold;" colspan="5">合计:</td> |
| | | <td style="font-size: 20px;font-weight: bold;">{{grossNum.quantity}}</td> |
| | | <td style="font-size: 20px;font-weight: bold;">{{grossNum.perimeter}}</td> |
| | | <td style="font-size: 20px;font-weight: bold;">{{grossNum.grossArea}}</td> |
| | | <td colspan="2"></td> |
| | | </tr> |