import * as PRODUCTDETAILS from '../service/api/financialDetail'

method:{

//转化时间格式

formatDate(now) {

var year = now.getFullYear()

var month = now.getMonth() + 1

var date = now.getDate()

return year + '-' + month + '-' + date

},

//获取商品详情

async getOrderDetails() {

const params = {

id: this.id

}

try {

const res = await PRODUCTDETAILS.orderDetails(params)

if (res) {

console.log(res.data)

this.data = res.data

if (res.data.status == 0) {

this.data.status = '未结束'

} else {

this.data.status = '已结束'

}

this.data.workStart = this.formatDate(new Date(this.data.workStart))

this.data.workEnd = this.formatDate(new Date(this.data.workEnd))

this.data.gmtCreate = this.formatDate(new Date(this.data.gmtCreate))

}

} catch (err) {

console.log(err)

}

},

 

}

Logo

前往低代码交流专区

更多推荐