| | |
| | | import QRCode from "qrcode"; |
| | | import companyInfo from "@/stores/sd/companyInfo"; |
| | | import userInfo from "@/stores/userInfo" |
| | | import {add} from '@/utils/decimal' |
| | | //语言获取 |
| | | const company = companyInfo() |
| | | const {t} = useI18n() |
| | |
| | | const details = ref([]) |
| | | const user=userInfo() |
| | | |
| | | let totalQuantity = 0; // 用于记录总数量 |
| | | let totalArea = 0; // 用于记录总面积 |
| | | |
| | | const data = ref({ |
| | | printList: [] |
| | |
| | | //处理同配置打印 |
| | | handleGetQRCode() |
| | | handleSummary() |
| | | AreaQuantitySummary() |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | router.push("/login") |
| | |
| | | totalQuantity += collection.quantity * 1; |
| | | //每个序号面积 |
| | | collection.total_area = parseFloat((collection.width * collection.height * collection.quantity / 1000000).toFixed(2)) |
| | | totalArea += collection.total_area * 1; |
| | | totalArea = add(totalArea, collection.total_area) |
| | | totalWeight += collection.width * collection.height * collection.quantity / 1000000 * collection.separation * 2.5 * 1; |
| | | //每个序号周长 |
| | | collection.perimeter = parseFloat(((collection.width * 2 + collection.height * 2) * collection.quantity / 1000).toFixed(3)) |
| | |
| | | } |
| | | } |
| | | |
| | | const AreaQuantitySummary = () => { |
| | | |
| | | console.log(produceList.value) |
| | | for (let i = 0; i < produceList.value.length; i++) { |
| | | // 遍历当前项目的 detail 数组 |
| | | for (let j = 0; j < produceList.value[i].detail.length; j++) { |
| | | // 累加数量 |
| | | totalQuantity = add(totalQuantity,produceList.value[i].detail[j].quantity) |
| | | // 累加面积 |
| | | totalArea = add(totalArea,produceList.value[i].detail[j].gross_area) |
| | | } |
| | | } |
| | | |
| | | } |
| | | </script> |
| | | |
| | | <template> |
| | |
| | | <div>{{ company.companyName }}</div> |
| | | <div>生产流程卡</div> |
| | | <div style="font-weight: bolder;display: flex;justify-content:space-between"> |
| | | <div>打印人:{{user.user.userName}} 时间:{{formattedTime}}</div> |
| | | <div> |
| | | 打印人:{{user.user.userName}} |
| | | 时间:{{formattedTime}} |
| | | |
| | | <span style="font-weight: bolder;" v-if="name=='金华福喜天成玻璃有限公司'"> |
| | | 打印总数量:{{totalQuantity}} |
| | | 打印总面积:{{totalArea}} |
| | | </span> |
| | | </div> |
| | | <div> |
| | | <span v-if="name!='金华福喜天成玻璃有限公司'" style="font-size: 10px">{{itemFlow.otherRemarks}}</span> |
| | | 流程卡号: {{ |
| | |
| | | <td rowspan='2'>编号</td> |
| | | <td rowspan="2">小片顺序</td> |
| | | <td rowspan='2' style="width: 90px">宽*高</td> |
| | | <td rowspan='2'>数量</td> |
| | | <td rowspan='2' >数量</td> |
| | | <td rowspan='2'>面积</td> |
| | | <td rowspan='2'>周长</td> |
| | | <td rowspan='2'>半径/备注</td> |
| | |
| | | <td v-else>{{ itemDatile.s01Value }}</td> |
| | | <td>{{ itemDatile.technology_number }}</td> |
| | | <td>{{ itemDatile.child_width }}</td> |
| | | <td class="item" style="width: 5%;height: 100%;"> |
| | | <td class="item" style="width: 60px;height: 100%;"> |
| | | <input v-model="itemDatile.quantity" style="width: 100%;height: 100%" @keyup="handleSummary()"/> |
| | | </td> |
| | | <td>{{ itemDatile.total_area }}</td> |
| | |
| | | 数量: |
| | | <label>{{ itemsum.quantity }}</label> |
| | | 面积: |
| | | <label>{{ parseFloat(itemsum.gross_area.toFixed(2)) }}</label> |
| | | <label>{{ itemsum.gross_area }}</label> |
| | | 重量: |
| | | <label>{{ parseFloat(itemsum.weight.toFixed(2)) }}</label> |
| | | </td> |