使用登陆人替代从数据中获取经手人
调整打印页面的边距和字体大小 移除合立经手人必须为同一人的校验逻辑
This commit is contained in:
parent
43b06761b8
commit
5f02acff84
@ -97,7 +97,7 @@ v-model="queryParams.ownerName" placeholder="请输入责任人" clearable @keyu
|
|||||||
</template>
|
</template>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col>
|
<el-col>
|
||||||
<el-form ref="multipleTable" :model="list" v-loading="formLoading" label-width="0" >
|
<el-form :model="list" v-loading="formLoading" label-width="0" >
|
||||||
<el-table v-loading="loading" :data="list" :show-overflow-tooltip="true" class="hl-table" show-summary :summary-method="getSummaries" @selection-change="handleSelectionChange" :row-class-name="tableRowClassName">
|
<el-table v-loading="loading" :data="list" :show-overflow-tooltip="true" class="hl-table" show-summary :summary-method="getSummaries" @selection-change="handleSelectionChange" :row-class-name="tableRowClassName">
|
||||||
<el-table-column type="selection" width="70"/>
|
<el-table-column type="selection" width="70"/>
|
||||||
<el-table-column label="序号" type="index" align="center" fixed min-width="70px" />
|
<el-table-column label="序号" type="index" align="center" fixed min-width="70px" />
|
||||||
@ -278,13 +278,13 @@ const print = async () => {
|
|||||||
合立经手人: item.duEmpName,
|
合立经手人: item.duEmpName,
|
||||||
}))
|
}))
|
||||||
console.log(JSON.parse(JSON.stringify(printData)))
|
console.log(JSON.parse(JSON.stringify(printData)))
|
||||||
//校验责任人必须是同一人
|
//校验责任人必须是同一人 =10.29 取消管控
|
||||||
const duEmpNames = printData.map(item => item.合立经手人);
|
// const duEmpNames = printData.map(item => item.合立经手人);
|
||||||
const uniqueDuEmpNames = new Set(duEmpNames);
|
// const uniqueDuEmpNames = new Set(duEmpNames);
|
||||||
if (uniqueDuEmpNames.size !== 1) {
|
// if (uniqueDuEmpNames.size !== 1) {
|
||||||
message.error("合立经手人必须是同一人,请确认");
|
// message.error("合立经手人必须是同一人,请确认");
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
const printDataStr = JSON.parse(JSON.stringify(printData));
|
const printDataStr = JSON.parse(JSON.stringify(printData));
|
||||||
// 生成打印模板 顺序分别为 编号 日期 客户名 模具名 件号 零件名称 材料 规格 数量 单价 总价格 要求日期
|
// 生成打印模板 顺序分别为 编号 日期 客户名 模具名 件号 零件名称 材料 规格 数量 单价 总价格 要求日期
|
||||||
// 将其放在table中 调用打印
|
// 将其放在table中 调用打印
|
||||||
|
|||||||
@ -88,6 +88,11 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, computed } from 'vue'
|
import { ref, computed } from 'vue'
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
|
import { useUserStore } from '@/store/modules/user'
|
||||||
|
const userStore = useUserStore();
|
||||||
|
const userName = userStore.getUser.nickname//nickname
|
||||||
|
console.log(userStore,`userStore`);
|
||||||
|
|
||||||
// 精确浮点数加法函数
|
// 精确浮点数加法函数
|
||||||
const floatAdd = (a, b) => {
|
const floatAdd = (a, b) => {
|
||||||
var c, d, e;
|
var c, d, e;
|
||||||
@ -125,7 +130,7 @@ const dialogVisible = ref(false)
|
|||||||
const rows = ref<Record<string, any>[]>([])
|
const rows = ref<Record<string, any>[]>([])
|
||||||
|
|
||||||
const nowDate = dayjs().format('YYYY-MM-DD')
|
const nowDate = dayjs().format('YYYY-MM-DD')
|
||||||
const duEmpName = computed(() => (rows.value[0] ? rows.value[0]['合立经手人'] ?? '' : ''))
|
const duEmpName = computed(() => userName)
|
||||||
|
|
||||||
// 计算总数量
|
// 计算总数量
|
||||||
const sumQuantity = computed(() => {
|
const sumQuantity = computed(() => {
|
||||||
@ -164,12 +169,13 @@ const onPrint = () => {
|
|||||||
doc.write(`
|
doc.write(`
|
||||||
<style>
|
<style>
|
||||||
/* 针式打印纸规格:241mm×140mm,撕边后222mm */
|
/* 针式打印纸规格:241mm×140mm,撕边后222mm */
|
||||||
@page { size: 241mm 140mm; margin: 0; }
|
@page { size: 241mm 140mm; margin: 5mm; }
|
||||||
|
|
||||||
body {
|
body {
|
||||||
font-family: Arial, "Microsoft YaHei", sans-serif;
|
font-family: Arial, "Microsoft YaHei", sans-serif;
|
||||||
color:#000;
|
color:#000;
|
||||||
margin: 0;
|
margin: 5px;
|
||||||
|
font-size: 12px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
/* 打印区域适配撕边后的有效宽度 */
|
/* 打印区域适配撕边后的有效宽度 */
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user