时间保存问题

pull/2/head
gexinzhineng/gxzn27 2023-02-01 15:18:59 +08:00
parent 9e35ca512c
commit e718263f5f
1 changed files with 5 additions and 3 deletions

View File

@ -13,7 +13,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { FormExpose } from '@/components/Form' import { FormExpose } from '@/components/Form'
import XEUtils from 'xe-utils' // import XEUtils from 'xe-utils'
// import // import
import * as LeaveApi from '@/api/bpm/leave' import * as LeaveApi from '@/api/bpm/leave'
@ -39,8 +39,10 @@ const submitForm = async () => {
// //
actionLoading.value = true actionLoading.value = true
const data = unref(formRef)?.formModel as LeaveApi.LeaveVO const data = unref(formRef)?.formModel as LeaveApi.LeaveVO
data.startTime = XEUtils.toDateString(data.startTime, 'yyyy-MM-dd HH:mm:ss') // data.startTime = XEUtils.toDateString(data.startTime, 'yyyy-MM-dd HH:mm:ss')
data.endTime = XEUtils.toDateString(data.endTime, 'yyyy-MM-dd HH:mm:ss') // data.endTime = XEUtils.toDateString(data.endTime, 'yyyy-MM-dd HH:mm:ss')
data.startTime = Date.parse(new Date(data.startTime).toString())
data.endTime = Date.parse(new Date(data.endTime).toString())
// //
await LeaveApi.createLeaveApi(data) await LeaveApi.createLeaveApi(data)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))