diff --git a/components/dates/yy-mm-dd-hh-ss.vue b/components/dates/yy-mm-dd-hh-ss.vue new file mode 100644 index 0000000..eab00e0 --- /dev/null +++ b/components/dates/yy-mm-dd-hh-ss.vue @@ -0,0 +1,295 @@ + + + + + diff --git a/jsFile/requst.js b/jsFile/requst.js index 49acd9d..ddbe154 100644 --- a/jsFile/requst.js +++ b/jsFile/requst.js @@ -63,6 +63,7 @@ const request = (method, url, options) => { methods = 'GET' headers = { 'Content-Type': 'application/json; charset=UTF-8', + 'Authorization': 'Bearer '+uni.getStorageSync('token') || '', 'token':uni.getStorageSync('token') || '' } break; @@ -70,14 +71,16 @@ const request = (method, url, options) => { methods = 'POST' headers = { 'Content-Type': 'application/json; charset=UTF-8', - 'token':uni.getStorageSync('token') || '' + 'Authorization': 'Bearer '+uni.getStorageSync('token') || '', + 'token':uni.getStorageSync('token') || '' } break; case 'postForm': methods = 'POST' headers = { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8', - 'token':uni.getStorageSync('token') || '' + 'Authorization': 'Bearer '+uni.getStorageSync('token') || '', + 'token':uni.getStorageSync('token') || '' } break; } @@ -124,7 +127,8 @@ const uploadFile = (url, options) => { formData: tempData, header: { 'Content-Type': 'multipart/form-data;charset=UTF-8', - 'token':uni.getStorageSync('token') || '' + 'Authorization': 'Bearer '+uni.getStorageSync('token') || '', + 'token':uni.getStorageSync('token') || '' }, success: res => { if (res.statusCode == 200) { diff --git a/jsFile/tools.js b/jsFile/tools.js index 263e8e3..af51ea1 100644 --- a/jsFile/tools.js +++ b/jsFile/tools.js @@ -229,6 +229,65 @@ const tools = { // console.log(time2);//1398250549123 // console.log(time3);//1398250549000 }, + // 返回当前时间 + returnCurrentTime(format,type) { + let date = new Date(); + let year = date.getFullYear(); // 年 + let month = date.getMonth() + 1; // 月 + let day = date.getDate(); // 日 + let time = date.getHours(); // 时 + let minu = date.getSeconds(); // 分 + let second = date.getMinutes(); // 秒 + + let newTime = ''; + switch (type){ + case 0: + newTime = `${year}${format}${month < 10? '0' + month : month}${format}${day < 10 ? '0' + day : day} ${time < 10 ? '0' + time : time}:${minu < 10 ? '0' + minu : minu}`; // 2022-03-31 16:05 + break; + case 1: + newTime = `${year}${format}${month < 10? '0' + month : month}${format}${day < 10 ? '0' + day : day} ${time < 10 ? '0' + time : time}:${minu < 10 ? '0' + minu : minu}:${second < 10 ? '0' + second : second}`; // 2022-03-31 16:10:07 + break; + } + return newTime; + }, + // 返回时间xx天xx小时xx分钟 + returnTimeFormat(startTime,endTime){ + console.log(startTime,endTime); + let newTimeFormat = ''; + let currentTimestamp = this.timeToTimestamp(endTime) - this.timeToTimestamp(startTime); + return this.returnTimestampToTime(currentTimestamp); + }, + // 返回时间戳转时、分对象 + returnTimestampToTime(timestamp){ + let timeStr = ''; + var day = parseInt((timestamp % (1000 * 60 * 60 * 24 * 12)) / (1000 * 60 * 60 * 24)); + var hours = parseInt((timestamp % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); + var seconds = parseInt((timestamp % (1000 * 60 * 60)) / (1000 * 60)); + day = day < 10 ? ('0' + day) : day; + hours = hours < 10 ? ('0' + hours) : hours; + seconds = seconds < 10 ? ('0' + seconds) : seconds; + if(day*1==0) { + if(hours*1==0) { + seconds*1==0 ? timeStr = 0 : timeStr = `${seconds}分钟`; + } else { + timeStr = `${hours}小时${seconds}分钟`; + } + } else { + timeStr = `${day}天${hours}小时${seconds}分钟`; + } + return timeStr; + }, + // 时间戳转时分秒 00 : 00 : 00 + formatDuring: function(mss) { + // let dangTime = Math.round(new Date()/1000)//获取当前时间戳 + var hours = parseInt((mss % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); + var seconds = parseInt((mss % (1000 * 60 * 60)) / (1000 * 60)); + var minutes = (mss % (1000 * 60)) / 1000; + hours = hours < 10 ? ('0' + hours) : hours; + seconds = seconds < 10 ? ('0' + seconds) : seconds; + minutes = minutes < 10 ? ('0' + minutes) : minutes; + return hours + ' : ' + seconds + ' : ' + minutes; + }, // 随机数生成 randomStr(){ var strData = ""; @@ -281,16 +340,6 @@ const tools = { duration:newTime }) }, - formatDuring: function(mss) { - // let dangTime = Math.round(new Date()/1000)//获取当前时间戳 - var hours = parseInt((mss % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); - var minutes = parseInt((mss % (1000 * 60 * 60)) / (1000 * 60)); - var seconds = (mss % (1000 * 60)) / 1000; - hours = hours < 10 ? ('0' + hours) : hours; - minutes = minutes < 10 ? ('0' + minutes) : minutes; - seconds = seconds < 10 && seconds >= 1 ? ('0' + seconds) : seconds; - return hours + ' : ' + minutes + ' : ' + seconds; - }, // 富文本 escape2Html(str) { var arrEntities = { 'lt': '<', 'gt': '>', 'nbsp': ' ', 'amp': '&', 'quot': '"' }; diff --git a/pages/mountingsList/mountingsList.vue b/pages/mountingsList/mountingsList.vue index fd90ad7..539972a 100644 --- a/pages/mountingsList/mountingsList.vue +++ b/pages/mountingsList/mountingsList.vue @@ -3,129 +3,149 @@ - - - - - + + + + + + + + + + + + + + {{item.name}} + + + + + + 配件品牌:{{item.brand}} + 规格型号{{item.model}} + + 已用数量:{{item.remark}}张 + + - + {{item.num}} + + + + + + + + *请注意规格型号的选择,不同型号不同价格。 + 费用合计:¥{{item.sum}} + + + + - - - - - - - - - - - - {{item.name}} - - - - - - - - - - 配件品牌:{{item.brand}} - - - 规格型号{{item.model}} - - - - - 已用数量:{{item.remark}}张 - - - - - - - - {{item.num}} - - - + - - - - - - - - *请注意规格型号的选择,不同型号不同价格。 - - - 费用合计:¥{{item.sum}} - - - - - - - + diff --git a/pages/workOrder/workOrder.vue b/pages/workOrder/workOrder.vue index 3d5b9d9..140cdfc 100644 --- a/pages/workOrder/workOrder.vue +++ b/pages/workOrder/workOrder.vue @@ -17,47 +17,46 @@ 结算审核 - 工单编号: - + 项目编号: - + 项目名称: - + 产品类型: - + 安装位置: - + 故障类型: - + 紧急程度: - + 故障说明: -