You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
81 lines
1.8 KiB
81 lines
1.8 KiB
|
|
function formatDate(time) {
|
|
var date = getDate(time)
|
|
var format = 'Y-M-D h:m:s'
|
|
var formateArr = ['Y', 'M', 'D', 'h', 'm', 's'];
|
|
var returnArr = [];
|
|
returnArr.push(date.getFullYear());
|
|
returnArr.push(formatNumber(date.getMonth() + 1));
|
|
returnArr.push(formatNumber(date.getDate()));
|
|
returnArr.push(formatNumber(date.getHours()));
|
|
returnArr.push(formatNumber(date.getMinutes()));
|
|
returnArr.push(formatNumber(date.getSeconds()));
|
|
for (var i = 0; i < returnArr.length; i++) {
|
|
format = format.replace(formateArr[i], returnArr[i]);
|
|
}
|
|
return format;
|
|
}
|
|
|
|
function formatNumber(n) {
|
|
n = n.toString()
|
|
return n[1] ? n : '0' + n
|
|
}
|
|
|
|
function description(taglist) {
|
|
if(!taglist || !taglist.length){
|
|
return ''
|
|
}
|
|
return taglist.toString()
|
|
}
|
|
|
|
function offerStatus(status) {
|
|
if(status == 0){
|
|
return '选标中'
|
|
} else if (status == 1) {
|
|
return '未中标'
|
|
} else if (status == 2) {
|
|
return '已中标'
|
|
} else if (status == 3) {
|
|
return '取消'
|
|
} else if (status == 4) {
|
|
return '已关闭'
|
|
}
|
|
return ''
|
|
}
|
|
|
|
function offerCollor(status) {
|
|
if (status == 0) {
|
|
return 'text-black'
|
|
} else if (status == 1) {
|
|
return 'text-grey'
|
|
} else if (status == 2) {
|
|
return 'text-blue'
|
|
} else if (status == 3) {
|
|
return 'text-red'
|
|
} else if (status == 4) {
|
|
return 'text-red'
|
|
}
|
|
return 'text-blue'
|
|
}
|
|
|
|
function mssageTitle(type){
|
|
if (type == 'bidOrder') {
|
|
return '报价通知'
|
|
} else if (type == 'demand') {
|
|
return '项目通知'
|
|
}
|
|
return '调度通知'
|
|
}
|
|
|
|
function formatPrice(price) {
|
|
return Number(parseFloat(price) / 100).toFixed(2)
|
|
}
|
|
|
|
module.exports = {
|
|
formatDate: formatDate,
|
|
description: description,
|
|
offerStatus: offerStatus,
|
|
offerCollor: offerCollor,
|
|
mssageTitle: mssageTitle,
|
|
formatPrice: formatPrice
|
|
}
|