| | |
| | | import deepClone from "@/utils/deepClone"; |
| | | import {ElMessage} from "element-plus"; |
| | | import useUserInfoStore from "@/stores/userInfo"; |
| | | import {Food} from "@element-plus/icons-vue"; |
| | | import {Bottom, Burger, Food} from "@element-plus/icons-vue"; |
| | | const company = companyInfo() |
| | | const userStore = useUserInfoStore() |
| | | const username = userStore.user.userName |
| | | |
| | | let dialogVisible = ref(false) |
| | | |
| | | |
| | | let props = defineProps({ |
| | | orderId:null |
| | | }) |
| | | let productId=ref({ |
| | | |
| | | }) |
| | | let data = ref({ |
| | | order:{ |
| | |
| | | }, |
| | | orderProductDetail:[] |
| | | }) |
| | | let productIdData = ref([ |
| | | |
| | | |
| | | ]) |
| | | const selectedValues = ref([]) |
| | | |
| | | const grossNum = ref({ |
| | | quantity: 0, |
| | | grossArea: 0, |
| | | perimeter: 0 |
| | | }) |
| | | const getData = () => { |
| | | request.get(`/order/printOrderProductDetail/${props.orderId}`).then(res => { |
| | | request.get(`/order/printOrderProductDetail/${props.orderId}/${selectedValues.value}`).then(res => { |
| | | console.log(res.data) |
| | | data.value= res.data |
| | | data.value.orderProductDetail.forEach(item => { |
| | | productIdData.value.push(item.productId) |
| | | grossNum.value.quantity += getQuantity(item.productDetail) |
| | | grossNum.value.grossArea += getArea(item.productDetail) |
| | | grossNum.value.perimeter += getPerimeter(item.productDetail) |
| | | stringToJson(item.productDetail) |
| | | }) |
| | | console.log(productIdData.value) |
| | | grossNum.value.quantity = parseFloat(grossNum.value.quantity.toFixed(3)) |
| | | grossNum.value.grossArea = parseFloat(grossNum.value.grossArea.toFixed(3)) |
| | | grossNum.value.perimeter = parseFloat(grossNum.value.perimeter.toFixed(3)) |
| | | |
| | | }) |
| | | } |
| | | |
| | | const handleChange = () => { |
| | | |
| | | request.get(`/order/printOrderProductDetail/${props.orderId}/${selectedValues.value}`).then(res => { |
| | | console.log(res.data) |
| | | data.value= res.data |
| | | data.value.orderProductDetail.forEach(item => { |
| | |
| | | grossNum.value.perimeter += getPerimeter(item.productDetail) |
| | | stringToJson(item.productDetail) |
| | | }) |
| | | |
| | | console.log(productIdData) |
| | | grossNum.value.quantity = parseFloat(grossNum.value.quantity.toFixed(3)) |
| | | grossNum.value.grossArea = parseFloat(grossNum.value.grossArea.toFixed(3)) |
| | | grossNum.value.perimeter = parseFloat(grossNum.value.perimeter.toFixed(3)) |
| | | |
| | | }) |
| | | |
| | | } |
| | | |
| | | const handleDoubleClick = () => { |
| | | dialogVisible.value=true |
| | | } |
| | | |
| | | onMounted(() => { |
| | |
| | | |
| | | |
| | | <template> |
| | | <div id="sheet"> |
| | | |
| | | <div id="sheet" @dblclick="handleDoubleClick" > |
| | | <table style="border-style: none;" > |
| | | <thead> |
| | | <tr class="title-s"> |
| | |
| | | |
| | | <tr class="title-s"> |
| | | <th colspan="2"></th> |
| | | <th colspan="5"> |
| | | <h3 >生成任务单(成品)</h3> |
| | | <th colspan="5" > |
| | | <h3 style="margin-left: 25%">生成任务单(成品)</h3> |
| | | </th> |
| | | <th colspan="2" style="text-align: left;font-weight: bold;">订单编号:<span>{{ data.order.orderId }}</span></th> |
| | | <th colspan="2" style="text-align: center;font-weight: bold;">订单编号:<span>{{ data.order.orderId }}</span></th> |
| | | </tr> |
| | | <tr> |
| | | <th style="text-align: left;border:none;font-weight: bold;font-size: 17px;" colspan="4"> |
| | |
| | | |
| | | </table> |
| | | |
| | | <el-dialog v-model="dialogVisible" style="width: 40%;height: 20%;margin-top: 10%" > |
| | | <el-select v-model="selectedValues" style="width: 100%" @change="handleChange" multiple placeholder="请选择"> |
| | | <el-option |
| | | v-for="item in productIdData" |
| | | :key="item" |
| | | :label="item" |
| | | :value="item"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-dialog> |
| | | |
| | | </div> |
| | | |