396a1871 by lxs

入表功能调整

1 parent 850e14f7
......@@ -748,9 +748,12 @@ const setTableFields = (info) => {
costFileds.value = row;
const date = new Date(info.baseDate);
const currDay = date.toLocaleDateString('zh-CN', { year: 'numeric', month: 'long' });
const modifiedStr = currDay.replace(/(\d+)(\d+)月/, (_, year, month) => {
return `${year}年1-${month}月`;
});
tableField.value.at(-1).visible = true;
tableField.value = tableField.value.filter(item => item.field.indexOf('name') > -1 || item.field == 'total');
tableField.value.splice(-1, 0, ...fields, { label: currDay, field: 'baseNum', type: 'input', width: 120, align: 'right', columClass: 'edit_cell' });
tableField.value.splice(-1, 0, ...fields, { label: modifiedStr, field: 'baseNum', type: 'input', width: 120, align: 'right', columClass: 'edit_cell' });
// 设置table数据
let datas: any = [];
tableData.value.map(t => {
......@@ -1238,7 +1241,7 @@ const exportBookToExcel = async () => {
border: borderStyle // 添加边框样式
}
// 判断当前列是否为数值列
// 判断当前列是否为数值列
const isNumeric = isNumericColumn[C];
// 数值列的对齐方式
const alignment = {
......@@ -1384,7 +1387,7 @@ onUpdated(() => {
show-overflow-tooltip>
<template #default="scope">
<div class="input_cell" v-if="item.type == 'input'">
<el-input v-model.trim="scope.row[item.field]" :placeholder="scope.row.edit?'':'--'"
<el-input v-model.trim="scope.row[item.field]" :placeholder="scope.row.edit ? '' : '--'"
:maxlength="item.maxlength ?? ''" @change="(val) => inputChange(val, scope, item.field)"
@input="(val) => inputEventChange(val, scope, item.field)"
:disabled="scope.row.edit ? false : true" clearable></el-input>
......@@ -1827,6 +1830,7 @@ onUpdated(() => {
.input_cell {
position: relative;
.el-input .el-input__inner {
text-align: right;
height: 24px;
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!