methods: {
//提交表单关闭弹窗
handleSubmit(formName) {
this.$refs[formName].validate((valid) => {
if (!valid) {
return;
}
this.form.payment_time = Date.parse(new Date(this.form.payment_time)) / 1000;//转换为秒
this.form.refund_time = Date.parse(new Date(this.form.refund_time)) / 1000;
let data = {
id: this.form.id || '',
...this.form,
};
this.$post('/goods/bidding/payment/update', data, (res) => {
if (!res.status) {
this.$message.error(res.message || '操作失败!');
return;
}
this.$message.success('操作成功!');
this.handleClearData();
this.$emit('paipaymentFormdialogClose')
});
})
},
handleClearData() {
this.$refs['form'].resetFields();
},
}
var
date =
new
Date(
'2014-04-23 18:55:49:123'
);
// 有三种方式获取
var
time1 = date.getTime();
var
time2 = date.valueOf();
var
time3 = Date.parse(date);
console.log(time1);
//1398250549123
console.log(time2);
//1398250549123
console.log(time3);
//1398250549000
第一、第二种:会精确到毫秒
第三种:只能精确到秒,毫秒用000替代