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 @@
+
+
+
+
+
+
+
+
+
+ {{ item + "年" }}
+
+
+
+
+ {{ formatNum(item) + "月" }}
+
+
+
+
+ {{ formatNum(item) + "日" }}
+
+
+
+
+ {{ formatNum(item) + "时" }}
+
+
+
+
+ {{ formatNum(item) + "分" }}
+
+
+
+
+
+
+
+
+
+
+
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 @@
结算审核
-
工单编号:
-
+
项目编号:
-
+
项目名称:
-
+
产品类型:
-
+
安装位置:
-
+
故障类型:
-
+
紧急程度:
-
+
故障说明:
-
+
故障图片:
-
+
-
+
@@ -66,19 +65,19 @@
报 单 人:
-
+
报单时间:
-
+
服务方式:
-
+
定位地址:
-
+
@@ -99,15 +98,38 @@
},
data() {
return {
- productType:'', // 产品类型
- installLocation:'', // 安装位置
- faultType:'', // 故障类型
- faultExplain:'', // 故障说明
- faultImgList:[], // 故障图片
- serviceMode: '' ,// 服务方式
+ targetObj:{
+ workOrderNo:'GD20211203-001',// 工单编号
+ projectNo:'GD20211203-001', // 项目编号
+ projectName:'湖南省林业科学院11楼会议室P2.5', // 项目名称
+ productType:'一拳超人', // 产品类型
+ installLocation:'手臂', // 安装位置
+ faultType:'脱节', // 故障类型
+ urgentDegree:'紧急', // 紧急程度
+ faultExplain:'摔了一跤', // 故障说明
+ faultImgList:[], // 故障图片
+ reporter:'林某', // 报单人
+ declarationTime:'2022/3/31 12:01:00', //报单时间
+ serviceMode: '手把手' ,// 服务方式
+ address:'四川省成都市成华区' ,// 定位地址
+ startTime:'' ,// 开始时间
+ endTime:'', // 结束时间
+ maintenanceTime:'',// 维保用时
+ waitingTime:'',// 等待时长
+ maintainer:'陈志远',//主维保人
+ ifParts:false,//是否更换配件
+ workDescribe:'',// 工作描述
+ maintenanceImgList:[],//维保图片
+ faultReason:'',//故障原因
+ maintenancePersonnel:''//维保人员
+ },
flag:true
}
},
+ onShow() {
+ uni.removeStorageSync('partsList');
+ uni.removeStorageSync('targetObj');
+ },
methods: {
// 上传图片
chooseImg(){
@@ -116,7 +138,7 @@
sourceType:['album','camera'],
success: (res) => {
let imgsrc = res.tempFilePaths[0];
- this.faultImgList.push(imgsrc);
+ this.targetObj.faultImgList.push(imgsrc);
}
})
},
@@ -124,35 +146,29 @@
if(this.checkEmpty()){
if(this.flag) {
this.flag = false;
- let params = {
- a:this.productType,
- b:this.installLocation,
- c:this.faultType,
- d:this.faultExplain,
- f:this.faultImgList.join(','),
- e:this.serviceMode
- }
- console.log(params);
+ this.targetObj.startTime = this.$toolAll.tools.returnCurrentTime('-',0);
+ uni.setStorageSync('targetObj',this.targetObj);
uni.navigateTo({
url: "/pages/workOrder/workorderTwo"
})
+ this.flag = true;
}
}
},
// 判空
checkEmpty(){
let result = false;
- if(!this.productType) {
+ if(!this.targetObj.productType) {
this.$toolAll.tools.showToast('请填写产品类型');
- } else if(!this.installLocation) {
+ } else if(!this.targetObj.installLocation) {
this.$toolAll.tools.showToast('请填写安装位置');
- } else if(!this.faultType) {
+ } else if(!this.targetObj.faultType) {
this.$toolAll.tools.showToast('请填写故障类型');
- } else if(!this.faultExplain) {
+ } else if(!this.targetObj.faultExplain) {
this.$toolAll.tools.showToast('请填写故障说明');
- } else if(this.faultImgList.length==0) {
+ } else if(this.targetObj.faultImgList.length==0) {
this.$toolAll.tools.showToast('请添加故障图片');
- } else if(!this.serviceMode) {
+ } else if(!this.targetObj.serviceMode) {
this.$toolAll.tools.showToast('请填写服务方式');
} else {
result = true;
diff --git a/pages/workOrder/workOrderLlsit.vue b/pages/workOrder/workOrderLlsit.vue
index 656ea22..c66213d 100644
--- a/pages/workOrder/workOrderLlsit.vue
+++ b/pages/workOrder/workOrderLlsit.vue
@@ -109,36 +109,36 @@
}
},
onLoad(op) {
- this.workeOrderStatusIndex = this.array.findIndex(item=>item.title==op.status);
+ this.workeOrderStatusIndex = this.array.findIndex(item=>item.name==op.status);
if(this.workeOrderStatusIndex!=-1) this.workeOrderStatus = '';
- this.getDatalist()
- this.getType()
+ // 调用获取工单状态事件
+ this.getType();
+ // 调用获取工单列表事件
+ this.getDatalist();
},
methods: {
+ // 获取工单状态
getType(){
-
this.$requst.get('/universal/api.order/order_type', {
list_rows: this.dataPage.list_rows,
page: this.dataPage.page,
}).then(res => {
// this.$toolAll.tools.showToast(res.msg);
- if (res.code == 1) {
- console.log(res.data,"---aa")
+ if (res.code) {
this.array=[...res.data]
- console.log( this.array)
} else {
}
})
},
-
+ // 获取工单列表
getDatalist(){
this.$requst.get('/universal/api.order/order_list',this.dataPage).then(res => {
// this.$toolAll.tools.showToast(res.msg);
- if (res.code == 1) {
+ if (res.code) {
this.dataList = res.data.data
} else if(res.code == 0){
- this.dataList = res.data.data
+ this.dataList = res.data.data
}
})
},
diff --git a/pages/workOrder/workorderTwo.vue b/pages/workOrder/workorderTwo.vue
index 0bd9dc5..86e94ad 100644
--- a/pages/workOrder/workorderTwo.vue
+++ b/pages/workOrder/workorderTwo.vue
@@ -1,8 +1,8 @@
-
+
-
+
1
@@ -17,46 +17,44 @@
结算审核
-
工单编号:
-
+
项目编号:
-
+
项目名称:
-
+
产品类型:
-
+
安装位置:
-
+
故障类型:
-
+
服务方式:
-
+
故障说明:
-
+
故障图片:
-
-
+