| | |
| | | import companyInfo from "@/stores/sd/companyInfo" |
| | | import deepClone from "@/utils/deepClone"; |
| | | import {ElMessage} from "element-plus"; |
| | | import {add,multiply,multiplyAuto,divideAuto} from '@/utils/decimal'; |
| | | import {add,addAuto} from '@/utils/decimal'; |
| | | |
| | | const company = companyInfo() |
| | | let produceList = ref([]) |
| | |
| | | let produceList2 = ref([]) |
| | | |
| | | |
| | | const deliveryId = ref() |
| | | |
| | | const pageData = ref() |
| | | const getData = () => { |
| | | if(props.deliveryId===null || props.deliveryId===undefined || props.deliveryId===''){ |
| | | return |
| | | } |
| | | deliveryId.value = props.deliveryId[0].deliveryId |
| | | form.value.deliveryId=props.deliveryId |
| | | form.value.type=company.productName |
| | | form.value.state=props.type |
| | |
| | | |
| | | request.post(`/delivery/getSelectDeliveryPrinting`,form.value).then((res) => { |
| | | if(res.code==200){ |
| | | console.log(res.data) |
| | | produceList.value = deepClone(res.data) |
| | | for(let i=0;i<produceList.value.length;i++){ |
| | | produceList.value[i].data.forEach(item =>{ |
| | | let para = |
| | | item.DeliveryDetail.orderId= |
| | | takeCare.value+ |
| | | item.DeliveryDetail.orderDetail.edgingType |
| | | +'\n' |
| | | +item.DeliveryDetail.orderDetail.shape || '' |
| | | `${takeCare.value}\n${item.DeliveryDetail.orderDetail.edgingType || item.DeliveryDetail.orderDetail.shape}` |
| | | |
| | | }) |
| | | let produceList1= ({ |
| | | data:null, |
| | |
| | | } |
| | | |
| | | } |
| | | //给数据进行分页 |
| | | pageData.value = groupArrayByFive(produceList2.value[0].data) |
| | | delivery.value = produceList2.value[0].delivery |
| | | console.log(delivery.value) |
| | | |
| | | |
| | | |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | |
| | | }) |
| | | } |
| | | |
| | | function groupArrayByFive(arr) { |
| | | let result = []; |
| | | for (let i = 0; i < arr.length; i += 4) { |
| | | result.push(arr.slice(i, i + 4)); |
| | | } |
| | | return result; |
| | | } |
| | | let deliveryDate = ref() |
| | | onMounted(() => { |
| | | const today = new Date |
| | | today.setTime(today.getTime()) |
| | | deliveryDate.value = today.getFullYear() + |
| | | '-' + ("0" + (today.getMonth() + 1)).slice(-2) |
| | | + '-' + ("0" + today.getDate()).slice(-2) |
| | | getData() |
| | | }) |
| | | |
| | |
| | | |
| | | const printSheet = () => { |
| | | } |
| | | let companyName = ref('洛阳玻璃公司') |
| | | |
| | | |
| | | const getQuantitySum = (page)=>{ |
| | | console.log(page) |
| | | if(pageData.value[page] === undefined){ |
| | | return 0 |
| | | } |
| | | return pageData.value[page].reduce((accumulator, currentValue) => { |
| | | return addAuto(accumulator,currentValue.DeliveryDetail.quantity,2) |
| | | }, 0) |
| | | } |
| | | const getAreaSum = (page)=>{ |
| | | if(pageData.value[page] === undefined){ |
| | | return 0 |
| | | } |
| | | return pageData.value[page].reduce((accumulator, currentValue) => { |
| | | return addAuto(accumulator,currentValue.DeliveryDetail.area,2) |
| | | }, 0) |
| | | } |
| | | const getMoneySum = (page)=>{ |
| | | if(pageData.value[page] === undefined){ |
| | | return 0 |
| | | } |
| | | return pageData.value[page].reduce((accumulator, currentValue) => { |
| | | return addAuto(accumulator,currentValue.DeliveryDetail.money,2) |
| | | }, 0) |
| | | } |
| | | |
| | | |
| | | defineExpose({ |
| | |
| | | </script> |
| | | |
| | | <template> |
| | | <div id="sheet"> |
| | | <div class="pages" v-for="(item, index) in produceList2" :key="index"> |
| | | <div > |
| | | <el-row id="footsum" :gutter="20" > |
| | | <el-col :span="20"></el-col> |
| | | <el-col :span="4" style="font-weight: bolder;font-size: 17px" >{{delivery.creator}}</el-col> |
| | | </el-row> |
| | | <el-row id="footsum1" :gutter="20" > |
| | | <el-col :span="2" ></el-col> |
| | | <el-col :span="5" style="font-weight: bolder;font-size: 17px">{{ delivery.contacts }}</el-col> |
| | | <el-col :span="5" style="font-weight: bolder;font-size: 17px">{{ delivery.contactNumber }}</el-col> |
| | | <el-col :span="1" ></el-col> |
| | | <el-col :span="11" style="font-weight: bolder;font-size: 17px">{{ delivery.deliveryAddress }}</el-col> |
| | | </el-row> |
| | | |
| | | <table class="content1" v-for="(page,pageIndex) in pageData" > |
| | | <thead> |
| | | <tr style="height: 3.2cm"><td></td></tr> |
| | | |
| | | <tr> |
| | | <td colspan="6" > |
| | | <el-row :gutter="20"> |
| | | <el-col :span="2"></el-col> |
| | | <el-col :span="9"> |
| | | <input v-model="companyName" style="border: 0;width: 100%;height: 100%;font-size:19px;font-weight: bolder "/> |
| | | </el-col> |
| | | <el-col :span="5" style="font-weight: bolder;font-size: 17px"> {{deliveryId}} </el-col> |
| | | <el-col :span="5"></el-col> |
| | | <el-col :span="3" style="white-space: nowrap;">{{deliveryDate}}</el-col> |
| | | </el-row> |
| | | </td> |
| | | </tr> |
| | | <tr style="height: 0.5cm"><td></td></tr> |
| | | |
| | | <tr style="margin-top: 20px"> |
| | | <td colspan="6"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="3"></el-col> |
| | | <el-col :span="9" style="font-size: 21px;font-weight: bold">{{delivery.customerName }}</el-col> |
| | | <el-col :span="3"> </el-col> |
| | | <el-col :span="9" style="font-size: 21px;font-weight: bold;white-space: nowrap;"> {{delivery.project }}</el-col> |
| | | </el-row> |
| | | </td> |
| | | </tr> |
| | | <tr style="height: 0.4cm"><td></td></tr> |
| | | <tr> |
| | | <td colspan="6"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="2"></el-col> |
| | | <el-col :span="12" style="font-size: 17px"> {{delivery.orderId }}</el-col> |
| | | </el-row> |
| | | </td> |
| | | </tr> |
| | | |
| | | <tr style="height: 0.2cm"><td></td></tr> |
| | | |
| | | |
| | | <div id="header"> |
| | | <div id="header-pane"> |
| | | <div>洛阳玻璃公司</div> |
| | | <div style="margin: auto;">{{item.delivery.deliveryId}}</div> |
| | | <div>{{item.delivery.deliveryDate }}</div> |
| | | </div> |
| | | |
| | | <div id="header-customer" style="display: flex;height: 50px;line-height: 50px"> |
| | | <div>{{item.delivery.customerName }}</div> |
| | | <div style="margin-left: 60%;">{{item.delivery.project }}</div> |
| | | </div> |
| | | </thead> |
| | | <tbody > |
| | | <tr v-for="(item,index) in page"> |
| | | <td style="width: 5cm"> |
| | | <el-input class="textarea" type="textarea" |
| | | style="font-weight: bolder;" |
| | | :autosize="{ minRows: 1, maxRows: 20 }" |
| | | v-model="item.DeliveryDetail.orderDetail.productName" /> |
| | | </td> |
| | | <td style="width: 0.8cm"></td> |
| | | |
| | | <div id="header-order-id" style="height: 50px;line-height: 50px"> |
| | | <div>{{item.delivery.orderId }}</div> |
| | | </div> |
| | | </div> |
| | | <td style="width: 5cm"> |
| | | <el-input class="textarea" type="textarea" |
| | | style="font-weight: bolder;" |
| | | :autosize="{ minRows: 1, maxRows: 20 }" |
| | | v-model="item.DeliveryDetail.orderId" /> |
| | | |
| | | <div id="content"> |
| | | <div style="display:flex;margin-top: 20px" id="content-pane" v-for="(items, index) in item.data" :key="index"> |
| | | <div style="width: 200px;"> |
| | | <el-input class="textarea" type="textarea" :autosize="{ minRows: 2, maxRows: 20 }" v-model="items.DeliveryDetail.orderDetail.productName" /> |
| | | </div> |
| | | <div style="width: 200px"> |
| | | <el-input class="textarea" type="textarea" :autosize="{ minRows: 2, maxRows: 20 }" v-model="items.DeliveryDetail.orderId" /> |
| | | </div> |
| | | <div style="width: 70px">{{items.DeliveryDetail.quantity}}</div> |
| | | <div style="width: 70px">{{items.DeliveryDetail.area}}</div> |
| | | <div style="width: 70px" v-if="props.type===1">{{items.DeliveryDetail.price}}</div> |
| | | <div style="width: 70px" v-if="props.type===1">{{items.DeliveryDetail.money}}</div> |
| | | </div> |
| | | <div style="display:flex;height: 50px" id="content-total"> |
| | | <div style="width: 200px;"></div> |
| | | <div style="width: 200px"></div> |
| | | <div style="width: 70px">{{item.delivery.quantity}}</div> |
| | | <div style="width: 70px">{{item.delivery.area}}</div> |
| | | <div style="width: 70px"></div> |
| | | <div style="width: 70px" v-if="props.type===1">{{item.delivery.money }}</div> |
| | | </div> |
| | | <div style="height: 70px" id="content-name"> |
| | | <div style="margin-left: 610px">{{item.delivery.creator }}</div> |
| | | </div> |
| | | <div style="display:flex;" id="content-customer"> |
| | | <div style="margin-left: 80px">{{item.delivery.contacts}} {{item.delivery.contactNumber }}</div> |
| | | <div style="margin-left: 200px">{{item.delivery.deliveryAddress}}</div> |
| | | </div> |
| | | </td> |
| | | <td style="width: 60px"> |
| | | {{item.DeliveryDetail.quantity}} |
| | | </td> |
| | | <td style="width: 100px"> |
| | | {{item.DeliveryDetail.area}} |
| | | </td> |
| | | |
| | | </div> |
| | | <td |
| | | v-if="props.type===1" |
| | | style="width: 80px" |
| | | > |
| | | {{item.DeliveryDetail.price}} |
| | | </td> |
| | | <td |
| | | v-if="props.type===1" |
| | | > |
| | | {{item.DeliveryDetail.money}} |
| | | </td> |
| | | </tr> |
| | | |
| | | </div> |
| | | <tr> |
| | | <td></td> |
| | | <td></td> |
| | | <td></td> |
| | | <td> |
| | | {{getQuantitySum(pageIndex)}} |
| | | </td> |
| | | <td> |
| | | {{getAreaSum(pageIndex)}} |
| | | </td> |
| | | <td></td> |
| | | <td v-if="props.type===1"> |
| | | {{getMoneySum(pageIndex)}} |
| | | </td> |
| | | </tr> |
| | | </tbody> |
| | | </table> |
| | | |
| | | |
| | | </div> |
| | | |
| | | |
| | |
| | | |
| | | |
| | | <style scoped> |
| | | #sheet{ |
| | | width: 21cm; |
| | | } |
| | | table{ |
| | | width: 21cm |
| | | |
| | | } |
| | | .content1{ |
| | | page-break-after: always; |
| | | |
| | | } |
| | | span{ |
| | | width: 7cm; |
| | | text-align: center; |
| | | } |
| | | tbody *{ |
| | | font-size: 16px; font-weight: bolder; |
| | | } |
| | | tbody *{ |
| | | font-size: 16px; font-weight: bolder; |
| | | } |
| | | #footsum1,#footsum{ |
| | | font-weight: bolder;font-size: 17px; |
| | | } |
| | | |
| | | @media print { |
| | | @page { |
| | | margin: 12mm 10mm 20mm 10mm !important; |
| | | } |
| | | .pages { |
| | | page-break-after: always; |
| | | } |
| | | @page { |
| | | @top-right { |
| | | margin-top: 50px; |
| | | content: ""; /* 使用counter添加页码 */ |
| | | } |
| | | } |
| | | #footsum{ |
| | | position: fixed; |
| | | bottom: 4.2cm; |
| | | width: 100%; /* 或者设置成具体的宽度 */ |
| | | font-size: 17px; |
| | | |
| | | } |
| | | #footsum1{ |
| | | position: fixed; |
| | | bottom: 2cm; |
| | | width: 100%; /* 或者设置成具体的宽度 */ |
| | | } |
| | | } |
| | | #header-pane{ |
| | | display: flex; |
| | | width: 100%; |
| | | height: 90px; |
| | | line-height: 90px; |
| | | } |
| | | |
| | | .textarea{ |
| | | --el-border-color: rgba(255,255,255,0.0); |
| | | --el-input-focus-border-color: rgba(255,255,255,0.0); |
| | |
| | | --el-input-hover-border-color: rgba(255,255,255,0.0); |
| | | --el-input-hover-border-width: 0px; |
| | | } |
| | | textarea { |
| | | |
| | | font-size: 16px; |
| | | border:none; |
| | | text-align: right; |
| | | font-weight: bolder; |
| | | width: 100%; |
| | | height: 100%; |
| | | } |
| | | |
| | | |
| | | |