feat: 修改时间问题
This commit is contained in:
@@ -1160,17 +1160,17 @@
|
||||
}
|
||||
return acc;
|
||||
},{})
|
||||
this.formData = {
|
||||
const formData = {
|
||||
...res.data,
|
||||
id: this.dataForm.id,
|
||||
sDate: res.data.sDate,
|
||||
eDate: res.data.eDate ? new Date(res.data.eDate).getTime() : null,
|
||||
applyDepId: res.data.applyDepId ? String(res.data.applyDepId) : '',
|
||||
applyDepName: res.data.applyDepName || '',
|
||||
applyDepData: res.data.applyDepData || null,
|
||||
...result
|
||||
};
|
||||
console.log(this.formData,'formData123')
|
||||
formData.sDate = res.data.sDate ? Number(new Date(res.data.sDate).getTime()) : null;
|
||||
formData.eDate = res.data.eDate ? Number(new Date(res.data.eDate).getTime()) : null;
|
||||
this.formData = {...formData}
|
||||
this.$nextTick(()=>{
|
||||
if (this.$refs.dynamicForm && this.$refs.dynamicForm.setFormData) {
|
||||
this.$refs.dynamicForm.setFormData('applyDepId', this.formData.applyDepId);
|
||||
@@ -1451,8 +1451,8 @@
|
||||
sumbitForm(data, callback) {
|
||||
const {billNoPrefix} = this.config
|
||||
if (!data) return;
|
||||
const filePathArr = [...data.attachment]
|
||||
const attachment = filePathArr.map(item => item.fileUrl)
|
||||
const filePathArr =Array(data.attachment) ? [...data.attachment] : [data.attachment]
|
||||
const attachment = !!filePathArr.length ? filePathArr.map(item => item.fileUrl) : []
|
||||
this.btnLoading = true;
|
||||
const applyDepName = this.deptList?.filter(item=>item.deptId === data.applyDepId)[0]?.deptName
|
||||
const formData = {
|
||||
@@ -1473,8 +1473,9 @@
|
||||
attachments: data.attachment,
|
||||
data: {
|
||||
...formData,
|
||||
eDate: this.formatTime(formData.eDate),
|
||||
sDate: this.formatTime(formData.sDate),
|
||||
...(formData?.eDate ? { eDate: this.formatTime(formData.eDate) } : {}),
|
||||
...(formData?.sDate ? { sDate: this.formatTime(formData.sDate) } : {})
|
||||
|
||||
}
|
||||
}
|
||||
const formMethod = createModel;
|
||||
|
||||
Reference in New Issue
Block a user