问题修复
This commit is contained in:
parent
7e37debfb1
commit
cb2f2588d2
|
|
@ -8,7 +8,7 @@
|
||||||
v-show="showSearch"
|
v-show="showSearch"
|
||||||
label-width="80px"
|
label-width="80px"
|
||||||
>
|
>
|
||||||
<el-form-item label="申请日期1">
|
<el-form-item label="申请日期">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="queryParams.time"
|
v-model="queryParams.time"
|
||||||
type="daterange"
|
type="daterange"
|
||||||
|
|
|
||||||
|
|
@ -96,6 +96,7 @@
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="primary"
|
type="primary"
|
||||||
|
v-if="scope.row.taskStatus != 33"
|
||||||
@click="openLld(scope.row, 1)"
|
@click="openLld(scope.row, 1)"
|
||||||
>
|
>
|
||||||
出库单
|
出库单
|
||||||
|
|
@ -234,6 +235,7 @@
|
||||||
<el-table-column align="center" label="序号" show-overflow-tooltip type="index" />
|
<el-table-column align="center" label="序号" show-overflow-tooltip type="index" />
|
||||||
<el-table-column align="center" label="机具名称" prop="typeName" show-overflow-tooltip />
|
<el-table-column align="center" label="机具名称" prop="typeName" show-overflow-tooltip />
|
||||||
<el-table-column align="center" label="规格型号" prop="typeModelName" show-overflow-tooltip />
|
<el-table-column align="center" label="规格型号" prop="typeModelName" show-overflow-tooltip />
|
||||||
|
<el-table-column align="center" label="设备编号" prop="maCode" show-overflow-tooltip v-if="leaseOutDetailParams.manageType==0"/>
|
||||||
<el-table-column align="center" label="出库时间" prop="outTime" show-overflow-tooltip />
|
<el-table-column align="center" label="出库时间" prop="outTime" show-overflow-tooltip />
|
||||||
<el-table-column align="center" label="本次出库数量" prop="outNum" show-overflow-tooltip />
|
<el-table-column align="center" label="本次出库数量" prop="outNum" show-overflow-tooltip />
|
||||||
<el-table-column align="center" label="出库人" prop="userName" show-overflow-tooltip />
|
<el-table-column align="center" label="出库人" prop="userName" show-overflow-tooltip />
|
||||||
|
|
@ -428,80 +430,72 @@
|
||||||
<el-dialog :visible.sync="open" width="1138px" append-to-body @close="closePage">
|
<el-dialog :visible.sync="open" width="1138px" append-to-body @close="closePage">
|
||||||
<div style="height: 500px; overflow-y: scroll; padding: 0 20px">
|
<div style="height: 500px; overflow-y: scroll; padding: 0 20px">
|
||||||
<vue-easy-print tableShow ref="remarksPrintRef" class="print">
|
<vue-easy-print tableShow ref="remarksPrintRef" class="print">
|
||||||
<div class="title" style="text-align: center; font-weight: 600; font-size: 26px">
|
<div v-for="(item, index) in groupedLeaseOutDetailRecord" :key="index" class="print-page">
|
||||||
重庆市送变电机具设备分公司工机具出库单
|
<div class="title" style="text-align: center; font-weight: 600; font-size: 26px">
|
||||||
</div>
|
重庆市送变电机具设备分公司工机具出库单
|
||||||
<div class="info" style="margin-top: 10px; display: flex; flex-wrap: wrap">
|
|
||||||
<div class="item" style="width: 50%; flex-shrink: 0; margin-bottom: 5px; font-size: 14px">
|
|
||||||
<span>领料单位:</span>{{ leaseOutData.unitName }}
|
|
||||||
</div>
|
</div>
|
||||||
<div class="item" style="width: 50%; flex-shrink: 0; margin-bottom: 5px; font-size: 14px">
|
<div class="info" style="margin-top: 10px; display: flex; flex-wrap: wrap">
|
||||||
<span>出库时间:</span>
|
<div class="item" style="width: 50%; flex-shrink: 0; margin-bottom: 5px; font-size: 14px">
|
||||||
<!-- 添加精确到时分秒的日期选择器 -->
|
<span>领料单位:</span>{{ leaseOutData.unitName }}
|
||||||
<el-date-picker
|
</div>
|
||||||
v-show="showSelect"
|
<div class="item" style="width: 50%; flex-shrink: 0; margin-bottom: 5px; font-size: 14px">
|
||||||
v-model="leaseOutData.outTime"
|
<span>出库时间:</span>
|
||||||
type="datetime"
|
<!-- 添加精确到时分秒的日期选择器 -->
|
||||||
value-format="yyyy-MM-dd HH:mm:ss"
|
<el-date-picker
|
||||||
style="width: 200px"
|
v-show="showSelect"
|
||||||
placeholder="请选择出库时间"
|
v-model="item.date"
|
||||||
@change="changeTime"
|
type="datetime"
|
||||||
/>
|
value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
<span v-show="!showSelect" @click="showSelect = true" style="cursor: pointer">{{formattedOutTime
|
style="width: 200px"
|
||||||
}}</span>
|
placeholder="请选择出库时间"
|
||||||
|
@change="(newValue) => changeTime(index, newValue)"
|
||||||
|
:picker-options="{}"
|
||||||
|
/>
|
||||||
|
<span v-show="!showSelect" @click="showSelect = true" style="cursor: pointer">{{formattedOutTime(item.date)
|
||||||
|
}}</span>
|
||||||
|
<!-- <span>{{ date }}</span> -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="item" style="width: 50%; flex-shrink: 0; margin-bottom: 5px; font-size: 14px">
|
||||||
|
<span>工程名称:</span>{{ leaseOutData.proName }}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div class="item" style="width: 50%; flex-shrink: 0; margin-bottom: 5px; font-size: 14px">
|
<el-table :data="item.group" class="table" border style="margin-top: 20px; padding: 1px" :row-class-name="setRowClassName">
|
||||||
<span>出库时间:</span>{{ leaseOutData.updateTime }}
|
<el-table-column label="序号" align="center" type="index" />
|
||||||
</div> -->
|
<el-table-column
|
||||||
<div class="item" style="width: 50%; flex-shrink: 0; margin-bottom: 5px; font-size: 14px">
|
type="expand"
|
||||||
<span>工程名称:</span>{{ leaseOutData.proName }}
|
>
|
||||||
</div>
|
<template slot-scope="scope">
|
||||||
<!-- <div class="item" style="width: 50%; flex-shrink: 0; margin-bottom: 5px; font-size: 14px">
|
<el-table v-if="scope.row && scope.row.maWholeVos" :data="scope.row.maWholeVos">
|
||||||
<span>编号:</span>{{ leaseOutData.code }}
|
<el-table-column align="center" label="机具名称" prop="typeName" />
|
||||||
</div> -->
|
<el-table-column align="center" label="规格型号" prop="deviceType" />
|
||||||
</div>
|
<el-table-column align="center" label="预领数量" prop="applyNum" />
|
||||||
<el-table :data="leaseOutDetailRecord" class="table" border style="margin-top: 20px; padding: 1px" :row-class-name="setRowClassName">
|
<el-table-column align="center" label="库存数量" prop="num" />
|
||||||
<el-table-column label="序号" align="center" type="index" />
|
</el-table>
|
||||||
<el-table-column
|
</template>
|
||||||
type="expand"
|
</el-table-column>
|
||||||
>
|
<el-table-column label="类型名称" align="center" prop="typeName" />
|
||||||
<template slot-scope="scope">
|
<el-table-column label="规格型号" align="center" prop="typeModelName" />
|
||||||
<el-table v-if="scope.row && scope.row.maWholeVos" :data="scope.row.maWholeVos">
|
<el-table-column label="单位" align="center" prop="unitNames" />
|
||||||
<el-table-column align="center" label="机具名称" prop="typeName" />
|
<el-table-column label="出库数量" align="center" prop="outNum" />
|
||||||
<el-table-column align="center" label="规格型号" prop="deviceType" />
|
<el-table-column label="状态" align="center" prop="status" >
|
||||||
<el-table-column align="center" label="预领数量" prop="applyNum" />
|
<template slot-scope="scope">
|
||||||
<el-table-column align="center" label="库存数量" prop="num" />
|
<span>完好</span>
|
||||||
</el-table>
|
</template>
|
||||||
</template>
|
</el-table-column>
|
||||||
</el-table-column>
|
<el-table-column label="设备编码" align="center" prop="maCode" />
|
||||||
<el-table-column label="类型名称" align="center" prop="typeName" />
|
<el-table-column label="备注" align="center" prop="remark" />
|
||||||
<el-table-column label="规格型号" align="center" prop="typeModelName" />
|
</el-table>
|
||||||
<el-table-column label="单位" align="center" prop="unitNames" />
|
|
||||||
<el-table-column label="出库数量" align="center" prop="outNum" />
|
|
||||||
<el-table-column label="状态" align="center" prop="status" >
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span>完好</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="设备编码" align="center" prop="maCode" />
|
|
||||||
<el-table-column label="备注" align="center" prop="remark" />
|
|
||||||
<!-- <el-table-column label="出库方式" align="center" prop="manageTypeName" /> -->
|
|
||||||
</el-table>
|
|
||||||
|
|
||||||
<div style="margin: 15px 0;text-align: center; font-size: 20px; font-weight: 800">机器类设备需维修人员检查后确定好坏</div>
|
<div style="margin: 15px 0;text-align: center; font-size: 20px; font-weight: 800">机器类设备需维修人员检查后确定好坏</div>
|
||||||
<div class="fillIn" style=" display: flex">
|
<div class="fillIn" style=" display: flex">
|
||||||
<div class="item" style="width: 60%">
|
<div class="item" style="width: 60%">
|
||||||
<span>机具分公司发货人:</span>
|
<span>机具分公司发货人:</span>
|
||||||
|
</div>
|
||||||
|
<div class="item">
|
||||||
|
<span>分公司领用人:</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="item">
|
|
||||||
<span>分公司领用人:</span>
|
|
||||||
</div>
|
|
||||||
<!-- <div class="item" style="width: 25%">
|
|
||||||
<span>仓库:</span>
|
|
||||||
</div>
|
|
||||||
<div class="item" style="width: 25%">
|
|
||||||
<span>操作人:</span>
|
|
||||||
</div> -->
|
|
||||||
</div>
|
</div>
|
||||||
</vue-easy-print>
|
</vue-easy-print>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -627,6 +621,7 @@ export default {
|
||||||
typeId: '',
|
typeId: '',
|
||||||
startTime: '',
|
startTime: '',
|
||||||
endTime: '',
|
endTime: '',
|
||||||
|
manageType: '',
|
||||||
},
|
},
|
||||||
leaseOutDetailsList: [],
|
leaseOutDetailsList: [],
|
||||||
outTime: [],
|
outTime: [],
|
||||||
|
|
@ -667,6 +662,9 @@ export default {
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
outTime:'',
|
outTime:'',
|
||||||
|
remarkLease:'',
|
||||||
|
groupedLeaseOutDetailRecord: [],
|
||||||
|
oldGroupedLeaseOutDetailRecord: [],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
|
@ -679,21 +677,42 @@ export default {
|
||||||
this.GetProData()
|
this.GetProData()
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
formattedOutTime() {
|
// groupedLeaseOutDetailRecord() {
|
||||||
if (this.leaseOutData.outTime instanceof Date) {
|
// const groupedMap = {};
|
||||||
const year = this.leaseOutData.outTime.getFullYear();
|
// const recordList = this.leaseOutDetailRecord || [];
|
||||||
const month = String(this.leaseOutData.outTime.getMonth() + 1).padStart(2, '0');
|
// recordList.forEach(item => {
|
||||||
const day = String(this.leaseOutData.outTime.getDate()).padStart(2, '0');
|
// const date = item.createTime;
|
||||||
const hours = String(this.leaseOutData.outTime.getHours()).padStart(2, '0');
|
// if (!groupedMap[date]) {
|
||||||
const minutes = String(this.leaseOutData.outTime.getMinutes()).padStart(2, '0');
|
// groupedMap[date] = [];
|
||||||
const seconds = String(this.leaseOutData.outTime.getSeconds()).padStart(2, '0');
|
// }
|
||||||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
// groupedMap[date].push(item);
|
||||||
}
|
// });
|
||||||
return this.leaseOutData.outTime;
|
// // 将对象转换为数组
|
||||||
}
|
// return Object.entries(groupedMap).map(([date, group]) => ({ date, group }));
|
||||||
|
// }
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
formattedOutTime(date) {
|
||||||
|
if (typeof date === 'string') {
|
||||||
|
// 直接将 ISO 8601 格式字符串转换为 Date 对象
|
||||||
|
date = new Date(date);
|
||||||
|
} else if (!(date instanceof Date)) {
|
||||||
|
console.error('传入的日期既不是字符串也不是 Date 对象:', date);
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
// 检查转换后的 date 是否为有效的 Date 对象
|
||||||
|
if (isNaN(date.getTime())) {
|
||||||
|
console.error('传入的日期格式无效:', date);
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
const year = date.getFullYear();
|
||||||
|
const month = String(date.getMonth() + 1).padStart(2, '0');
|
||||||
|
const day = String(date.getDate()).padStart(2, '0');
|
||||||
|
const hours = String(date.getHours()).padStart(2, '0');
|
||||||
|
const minutes = String(date.getMinutes()).padStart(2, '0');
|
||||||
|
const seconds = String(date.getSeconds()).padStart(2, '0');
|
||||||
|
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
||||||
|
},
|
||||||
generateUUID() {
|
generateUUID() {
|
||||||
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
|
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
|
||||||
const r = Math.random() * 16 | 0;
|
const r = Math.random() * 16 | 0;
|
||||||
|
|
@ -799,6 +818,7 @@ export default {
|
||||||
this.isView = true
|
this.isView = true
|
||||||
this.dialogQuery.id = row.id
|
this.dialogQuery.id = row.id
|
||||||
this.leaseOutDetailParams.id = row.id
|
this.leaseOutDetailParams.id = row.id
|
||||||
|
this.leaseOutDetailParams.manageType = row.manageType
|
||||||
this.resetDialogQuery()
|
this.resetDialogQuery()
|
||||||
// this.getDialogList();
|
// this.getDialogList();
|
||||||
},
|
},
|
||||||
|
|
@ -826,6 +846,7 @@ export default {
|
||||||
this.leaseType = row.leaseType
|
this.leaseType = row.leaseType
|
||||||
this.resetDialogQuery()
|
this.resetDialogQuery()
|
||||||
this.timeTemp = row.estimateLeaseTime
|
this.timeTemp = row.estimateLeaseTime
|
||||||
|
this.remarkLease = row.remarkLease
|
||||||
// this.getDialogList()
|
// this.getDialogList()
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -840,6 +861,7 @@ export default {
|
||||||
// 提取年、月、日并格式化为 YYYY-MM-DD 格式
|
// 提取年、月、日并格式化为 YYYY-MM-DD 格式
|
||||||
const formattedDate = `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}-${String(date.getDate()).padStart(2, '0')}`;
|
const formattedDate = `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}-${String(date.getDate()).padStart(2, '0')}`;
|
||||||
this.codeOutForm.createTime = formattedDate;
|
this.codeOutForm.createTime = formattedDate;
|
||||||
|
this.codeOutForm.remark = this.remarkLease
|
||||||
this.outNum = row.outNum
|
this.outNum = row.outNum
|
||||||
this.outQuery.typeId = row.typeId
|
this.outQuery.typeId = row.typeId
|
||||||
this.outObj = row
|
this.outObj = row
|
||||||
|
|
@ -862,6 +884,7 @@ export default {
|
||||||
// 提取年、月、日并格式化为 YYYY-MM-DD 格式
|
// 提取年、月、日并格式化为 YYYY-MM-DD 格式
|
||||||
const formattedDate = `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}-${String(date.getDate()).padStart(2, '0')}`;
|
const formattedDate = `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}-${String(date.getDate()).padStart(2, '0')}`;
|
||||||
this.numOutForm.createTime = formattedDate
|
this.numOutForm.createTime = formattedDate
|
||||||
|
this.numOutForm.remark = this.remarkLease
|
||||||
// console.log(row)
|
// console.log(row)
|
||||||
let obj = {}
|
let obj = {}
|
||||||
this.$set(obj, 'taskId', row.taskId)
|
this.$set(obj, 'taskId', row.taskId)
|
||||||
|
|
@ -1045,6 +1068,7 @@ export default {
|
||||||
this.leaseOutDetailParams.typeId = row.typeId
|
this.leaseOutDetailParams.typeId = row.typeId
|
||||||
this.leaseOutDetailParams.startTime = ''
|
this.leaseOutDetailParams.startTime = ''
|
||||||
this.leaseOutDetailParams.endTime = ''
|
this.leaseOutDetailParams.endTime = ''
|
||||||
|
this.leaseOutDetailParams.manageType = row.manageType
|
||||||
this.outTime = []
|
this.outTime = []
|
||||||
this.onHandleQuery().then(() => {
|
this.onHandleQuery().then(() => {
|
||||||
this.outRecordVisible = true
|
this.outRecordVisible = true
|
||||||
|
|
@ -1064,6 +1088,29 @@ export default {
|
||||||
this.leaseOutData = res.data
|
this.leaseOutData = res.data
|
||||||
this.leaseOutData.outTime = res.data.outTime ? new Date(res.data.outTime) : ''
|
this.leaseOutData.outTime = res.data.outTime ? new Date(res.data.outTime) : ''
|
||||||
this.outTime = this.leaseOutData.outTime
|
this.outTime = this.leaseOutData.outTime
|
||||||
|
|
||||||
|
// 按年月日对 leaseOutDetailRecord 进行分组
|
||||||
|
const groupedRecords = {};
|
||||||
|
this.leaseOutDetailRecord.forEach(item => {
|
||||||
|
// 假设 item.createTime 是日期字符串
|
||||||
|
const createTime = new Date(item.createTime);
|
||||||
|
const year = createTime.getFullYear();
|
||||||
|
const month = String(createTime.getMonth() + 1).padStart(2, '0');
|
||||||
|
const day = String(createTime.getDate()).padStart(2, '0');
|
||||||
|
const dateKey = `${year}-${month}-${day}`;
|
||||||
|
|
||||||
|
if (!groupedRecords[dateKey]) {
|
||||||
|
groupedRecords[dateKey] = [];
|
||||||
|
}
|
||||||
|
groupedRecords[dateKey].push(item);
|
||||||
|
});
|
||||||
|
|
||||||
|
// 将分组结果赋值给新的属性
|
||||||
|
this.groupedLeaseOutDetailRecord = Object.entries(groupedRecords).map(([date, group]) => ({
|
||||||
|
date: new Date(date + 'T08:00:00'),
|
||||||
|
group
|
||||||
|
}));
|
||||||
|
this.oldGroupedLeaseOutDetailRecord = JSON.parse(JSON.stringify(this.groupedLeaseOutDetailRecord));
|
||||||
},
|
},
|
||||||
// 领料单 打印
|
// 领料单 打印
|
||||||
print() {
|
print() {
|
||||||
|
|
@ -1161,27 +1208,31 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
changeTime(newValue) {
|
changeTime(index, newValue) {
|
||||||
|
console.log("Vvvvvvvvv",this.oldGroupedLeaseOutDetailRecord[index].date)
|
||||||
this.$confirm('确认要修改出库时间吗?', '提示', {
|
this.$confirm('确认要修改出库时间吗?', '提示', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
|
// 确保 newValue 是字符串格式
|
||||||
|
const updateTime = typeof newValue === 'string' ? newValue : newValue.toISOString().replace('T', ' ').slice(0, 19);
|
||||||
// 调用接口更新出库时间
|
// 调用接口更新出库时间
|
||||||
updateOutTime({
|
updateOutTime({
|
||||||
id: this.rowTemp.id, // 假设需要传递记录的 ID
|
id: this.rowTemp.id, // 假设需要传递记录的 ID
|
||||||
updateTime: newValue,
|
updateTime: newValue,
|
||||||
taskId: this.rowTemp.taskId,
|
taskId: this.rowTemp.taskId,
|
||||||
preTime: this.outTime,
|
preTime: this.formattedOutTime(this.oldGroupedLeaseOutDetailRecord[index].date),
|
||||||
outTime:newValue,
|
outTime:newValue,
|
||||||
}).then((response) => {
|
}).then((response) => {
|
||||||
if (response.code === 200) { // 假设接口返回成功状态码为 200
|
if (response.code === 200) { // 假设接口返回成功状态码为 200
|
||||||
this.leaseOutData.outTime = newValue;
|
this.$set(this.groupedLeaseOutDetailRecord[index], 'date', new Date(updateTime));
|
||||||
this.showSelect = false;
|
this.showSelect = false;
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
message: '出库时间修改成功'
|
message: '出库时间修改成功'
|
||||||
});
|
});
|
||||||
|
this.oldGroupedLeaseOutDetailRecord[index].date = this.groupedLeaseOutDetailRecord[index].date
|
||||||
} else {
|
} else {
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
|
|
@ -1217,4 +1268,18 @@ export default {
|
||||||
::v-deep .no-expand-row .el-table__expand-icon {
|
::v-deep .no-expand-row .el-table__expand-icon {
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.print-page {
|
||||||
|
// 确保每个出库单在打印时从新页面开始
|
||||||
|
page-break-after: always;
|
||||||
|
margin-bottom: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media print {
|
||||||
|
.print-page:last-child {
|
||||||
|
// 最后一个出库单不添加分页
|
||||||
|
page-break-after: avoid;
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -657,6 +657,10 @@ export default {
|
||||||
|
|
||||||
//正则校验配件费用
|
//正则校验配件费用
|
||||||
meneyIntegerValidator(rule, value, callback) {
|
meneyIntegerValidator(rule, value, callback) {
|
||||||
|
// 处理 null 值
|
||||||
|
if (value === null) {
|
||||||
|
value = '';
|
||||||
|
}
|
||||||
const reg = /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/
|
const reg = /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/
|
||||||
if (value === '' || reg.test(value)) {
|
if (value === '' || reg.test(value)) {
|
||||||
callback()
|
callback()
|
||||||
|
|
@ -681,6 +685,10 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
numberIntegerValidatorPart(rule, value, callback) {
|
numberIntegerValidatorPart(rule, value, callback) {
|
||||||
|
// 处理 null 值
|
||||||
|
if (value === null) {
|
||||||
|
value = '';
|
||||||
|
}
|
||||||
// 若值为空字符串,直接通过验证
|
// 若值为空字符串,直接通过验证
|
||||||
if (value === '') {
|
if (value === '') {
|
||||||
callback();
|
callback();
|
||||||
|
|
|
||||||
|
|
@ -545,6 +545,9 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
numberIntegerValidatorPart(rule, value, callback) {
|
numberIntegerValidatorPart(rule, value, callback) {
|
||||||
|
if (value === null) {
|
||||||
|
value = '';
|
||||||
|
}
|
||||||
// 若值为空字符串,直接通过验证
|
// 若值为空字符串,直接通过验证
|
||||||
if (value === '') {
|
if (value === '') {
|
||||||
callback();
|
callback();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue