零件采购收货 单价增加输入选择行回车进入下一行功能,增加选择行数据进行打印处理
This commit is contained in:
parent
aee7de95f7
commit
fbab232b17
@ -86,6 +86,7 @@ v-model="queryParams.supplierName" placeholder="供应商" clearable @keyup.ente
|
||||
<template #header>
|
||||
<div class="hl-card-info-icona"></div><span class="hl-card-info-text">订单明细</span>
|
||||
<el-button style="margin-left: 20px" @click="receiveGoods" type="success" size="large">收货</el-button>
|
||||
<el-button style="margin-left: 20px" @click="isPrint" type="primary" size="large">打印</el-button>
|
||||
<el-button
|
||||
style="margin-left: 20px"
|
||||
type="success"
|
||||
@ -102,7 +103,7 @@ v-model="queryParams.supplierName" placeholder="供应商" clearable @keyup.ente
|
||||
<el-form ref="subFormRef" :model="list" v-loading="formLoading" label-width="0" >
|
||||
<el-table
|
||||
v-loading="loading" :data="list" :show-overflow-tooltip="true" class="hl-table" ref="multipleTableRef" show-summary :summary-method="getSummaries" @selection-change="handleSelectionChange" :row-class-name="tableRowClassName">
|
||||
<el-table-column type="selection" width="80" />
|
||||
<el-table-column type="selection" width="80" fixed="left" />
|
||||
<!-- <el-table-column label="收货状态" align="center" prop="receivingStatus" min-width="120">-->
|
||||
<!-- <template #default="scope">-->
|
||||
<!-- <dict-tag :type="DICT_TYPE.HELI_PURCHASE_RECEIVING_STATUS" :value="scope.row.receivingStatus" />-->
|
||||
@ -118,21 +119,20 @@ v-model="queryParams.supplierName" placeholder="供应商" clearable @keyup.ente
|
||||
<el-table-column prop="purchaseAmount" min-width="100" label="采购数量" align="center" />
|
||||
<!-- <el-table-column prop="purchaseRemAmount" min-width="100" label="剩余数量" align="center"/>-->
|
||||
<el-table-column prop="purchaseRemAmounts" min-width="170" align="center" label="入库数量"/>
|
||||
<!-- <template #header><span class="hl-table_header">*</span>入库数量</template>-->
|
||||
<!-- <template #default="scope">-->
|
||||
<!-- <el-form-item :prop="`${scope.$index}.purchaseRemAmounts`" class="mb-0px!">-->
|
||||
<!-- <el-input-number style="width: 100%" v-model="scope.row.purchaseRemAmounts" placeholder="入库数量" :min="0" :precision="2" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column prop="estimatedPrice" min-width="170" label="单价" align="center">
|
||||
<template #header>单价</template>
|
||||
<template #default="scope">
|
||||
<el-form-item :prop="`${scope.$index}.unitPrice`" class="mb-0px!">
|
||||
<el-input-number
|
||||
style="width: 100%" v-model="scope.row.unitPrice" placeholder="单价" :min="0" :precision="2"
|
||||
|
||||
style="width: 100%"
|
||||
v-model="scope.row.unitPrice"
|
||||
placeholder="单价"
|
||||
:min="0"
|
||||
:precision="2"
|
||||
@change="changeUnitPrice(scope.row)"
|
||||
@input="(val)=>handleInput(val,scope.row)"
|
||||
@keyup.enter="(e)=>handleEnterUnitPrice(e,scope.row)"
|
||||
:id="'unitPrice'+scope.row.id"
|
||||
/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
@ -177,6 +177,7 @@ v-model="queryParams.supplierName" placeholder="供应商" clearable @keyup.ente
|
||||
</el-row>
|
||||
</el-card>
|
||||
</el-card>
|
||||
<PrintRef ref="printRef"/>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@ -191,6 +192,7 @@ import download from "@/utils/download";
|
||||
import {exportExcel} from "@/api/heli/purchaseordernodetail";
|
||||
import axios from "axios";
|
||||
import {getAccessToken, getTenantId} from "@/utils/auth";
|
||||
import PrintRef from "./print.vue"
|
||||
defineOptions({ name: 'PurchaseordernopartReceived' })
|
||||
const userStore = useUserStore()
|
||||
const username = userStore.getUser.nickname
|
||||
@ -257,12 +259,10 @@ const handleInput = (val: number, row: PurchaseOrderNoDetailApi.PurchaseOrderNoD
|
||||
const handleEnter = (e: KeyboardEvent, row: PurchaseOrderNoDetailApi.PurchaseOrderNoDetailVO) => {
|
||||
//敲下回车时切换到下一行的预估总价 如果为0.00将其=null
|
||||
console.log(e, 'e');
|
||||
//判断当前行是否为最后一行如为最后一行则不切换
|
||||
if (list.value.indexOf(row) == list.value.length - 1) {
|
||||
return
|
||||
}
|
||||
const index = list.value.findIndex((item) => item.id == row.id)
|
||||
//切换到下一行
|
||||
const input = document.getElementById("estimatedPrice" + list.value[index + 1].id);
|
||||
if (input) {
|
||||
input.focus();
|
||||
@ -273,6 +273,19 @@ const handleEnter = (e: KeyboardEvent, row: PurchaseOrderNoDetailApi.PurchaseOrd
|
||||
console.log(input, 'input');
|
||||
|
||||
|
||||
}
|
||||
const handleEnterUnitPrice = (e: KeyboardEvent, row: PurchaseOrderNoDetailApi.PurchaseOrderNoDetailVO) => {
|
||||
if (list.value.indexOf(row) == list.value.length - 1) {
|
||||
return
|
||||
}
|
||||
const index = list.value.findIndex((item) => item.id == row.id)
|
||||
const input = document.getElementById("unitPrice" + list.value[index + 1].id);
|
||||
if (input) {
|
||||
input.focus();
|
||||
if (list.value[index + 1].unitPrice == 0.00) {
|
||||
list.value[index + 1].unitPrice = ''
|
||||
}
|
||||
}
|
||||
}
|
||||
const getSummaries = (param: SummaryMethodProps) => {
|
||||
const summaryField = ["purchaseRemAmounts"];
|
||||
@ -496,7 +509,44 @@ const receiveGoods = async () => {
|
||||
loading.value = false;
|
||||
}
|
||||
}
|
||||
const printRef = ref<InstanceType<typeof PrintRef>>()
|
||||
const isPrint = async () => {
|
||||
function formatDate(val) {
|
||||
if (!val) return ''
|
||||
const date = new Date(val)
|
||||
return date.toLocaleDateString()
|
||||
}
|
||||
|
||||
try {
|
||||
const list = multipleSelection.value|| []; // 安全获取数据
|
||||
if(list.length==0){
|
||||
message.warning("请选择订单信息");
|
||||
return;
|
||||
}
|
||||
//日期 客户名 模具名 件号 零件名称 材料 规格 数量 单价 总价格 要求日期
|
||||
//createTime brief projectSubCode blueprintNo boomName compositionName matSpec purchaseAmount unitPrice estimatedPrice requireTime
|
||||
const data = list?.map((item,idx) => ({
|
||||
编号:idx + 1,
|
||||
日期: formatDate(item.createTime),
|
||||
客户名: item.brief,
|
||||
模具名: item.projectSubCode,
|
||||
件号: item.blueprintNo,
|
||||
零件名称: item.boomName,
|
||||
材料: item.compositionName,
|
||||
规格: item.matSpec,
|
||||
数量: item.purchaseAmount,
|
||||
单价: item.unitPrice,
|
||||
总价格: item.estimatedPrice,
|
||||
要求日期: formatDate(item.requireTime),
|
||||
})) || [];
|
||||
console.log(data)
|
||||
|
||||
// openPrintDialog(newVar)
|
||||
printRef.value?.open(data,"")
|
||||
} finally {
|
||||
}
|
||||
|
||||
}
|
||||
/** 初始化 **/
|
||||
const route = useRoute()
|
||||
const routeValue = ref('')
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
<div class="cell audit"> 审核:<span class="sign-space"></span> </div>
|
||||
<div class="cell handler"> 委外加工经手人:<span class="sign-space"></span> </div>
|
||||
<div class="cell receiver"> 收货人:<span class="sign-space"></span> </div>
|
||||
<div class="cell order-no"> 订单编号:<span class="sign-space">{{ purchaseNo }}</span> </div>
|
||||
<div class="cell order-no" v-if="purchaseNo"> 订单编号:<span class="sign-space">{{ purchaseNo }}</span> </div>
|
||||
</div>
|
||||
|
||||
<table class="sheet" border="1" cellspacing="0" cellpadding="0">
|
||||
@ -154,14 +154,13 @@ import * as PurchaseOrderNoApi from '@/api/heli/purchaseorderno'
|
||||
/**
|
||||
*
|
||||
* @param data 打印数据
|
||||
* @param str 采购订单号=订单编号
|
||||
* @param str 采购订单号=订单编号 零件采购收货时,订单编号为空。 零件采购订单管理 不为空
|
||||
*/
|
||||
const open = (data: Record<string, any>[],str: string) => {
|
||||
rows.value = Array.isArray(data) ? data : []
|
||||
dialogVisible.value = true;
|
||||
purchaseNo.value = str;
|
||||
console.log(query.id);
|
||||
|
||||
}
|
||||
defineExpose({ open })
|
||||
|
||||
@ -273,7 +272,9 @@ const onPrint = () => {
|
||||
iframe.contentWindow!.focus()
|
||||
iframe.contentWindow!.print()
|
||||
setTimeout(() => document.body.removeChild(iframe), 500)
|
||||
if(query.id){//用来判断零件采购订单管理 id=true,=false零件采购收货
|
||||
PurchaseOrderNoApi.updateIsPrint(query.id);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user