新增的功能

master
xielei 2024-11-07 16:40:56 +08:00
parent 33036d899d
commit a889e04d97
7 changed files with 215 additions and 107 deletions

View File

@ -12,44 +12,40 @@
</template> </template>
<view class="xj-content"> <view class="xj-content">
<view class="xj-text" v-for="(o,i) in item.children" :key="i"> <view class="xj-text" v-for="(o,i) in item.children" :key="i">
<view style="display: flex;justify-content: space-between;"> <view style="display: flex;align-items: center;">
<text>{{o.itemDesc}}</text> <text>{{o.itemDesc}}</text>
<text>{{o.isNormal == 0?'异常':'正常'}}</text> <text>{{o.isNormal == 0?'异常':'正常'}}{{o.isHandle?'已处理':'未处理'}}</text>
</view> </view>
<view class="" v-if="o.isNormal == 0"> <view class="" v-if="o.isNormal == 0">
<view style="display: flex;justify-content: space-between;"> <view style="">
<text>现场图片</text> <text>现场图片</text>
<view class="" v-for="item in o.inspectPics"> <view class="" v-for="item in o.inspectPics">
<image :src="item"></image> <image :src="item.url" style="width: 80px;height: 80px;margin: 5px;" ></image>
</view> </view>
</view> </view>
<view style="display: flex;justify-content: space-between;"> <view v-if="o.inspectVideos.length">
<text>现场视频</text> <text>现场视频</text>
<view class="" v-for="item in o.inspectVideos"> <view class="" v-for="item in o.inspectVideos">
<image :src="item"></image> <video :src="item.url" style="width: 80px;height: 80px;margin: 5px;" show-fullscreen-btn :show-progress='false'></video>
</view> </view>
</view> </view>
<view style="display: flex;justify-content: space-between;"> <view style="display: flex;justify-content: space-between;">
<text>问题描述</text> <text>问题描述</text>
<text>{{o.itemProblemDesc}}</text> <text>{{o.itemProblemDesc}}</text>
</view> </view>
<view style="display: flex;justify-content: space-between;">
<text>处理状态</text>
<text>{{o.isHandle?'已处理':'未处理'}}</text>
</view>
</view> </view>
<view class="" v-if="o.isHandle == 1"> <view class="" v-if="o.isHandle == 1">
<view style=""> <view style="">
<text>处理图片</text> <text>处理图片</text>
<view class="" v-for="item in o.handlePics"> <view class="" v-for="item in o.handlePics">
<image :src="item"></image> <image :src="item.url" style="width: 80px;height: 80px;margin: 5px;"></image>
</view> </view>
</view> </view>
<view style="display: flex;justify-content: space-between;"> <view style="" v-if="o.handleVideos.length">
<text>处理视频</text> <text>处理视频</text>
<!-- <text>{{o.handleVideos}}</text> -->
<view class="" v-for="item in o.handleVideos"> <view class="" v-for="item in o.handleVideos">
<video :src="item"></video>
<video :src="item.url" style="width: 80px;height: 80px;margin: 5px;" show-fullscreen-btn></video>
</view> </view>
</view> </view>
<view style="display: flex;justify-content: space-between;"> <view style="display: flex;justify-content: space-between;">
@ -164,6 +160,22 @@
this.listData = n.map(item => { this.listData = n.map(item => {
item.childen = item.children.map(i => { item.childen = item.children.map(i => {
i.handlePics?.map(item1=>{
item1.url ='http://223.75.53.141:9102/test.by-lyf.tmp' + item1.filePath
return item1
})
i.handleVideos?.map(item1=>{
item1.url ='http://223.75.53.141:9102/test.by-lyf.tmp' + item1.filePath
return item1
})
i.inspectPics?.map(item1=>{
item1.url ='http://223.75.53.141:9102/test.by-lyf.tmp' + item1.filePath
return item1
})
i.inspectVideos?.map(item1=>{
item1.url ='http://223.75.53.141:9102/test.by-lyf.tmp' + item1.filePath
return item1
})
if (!i.handlePics) { if (!i.handlePics) {
i.handlePics = [] i.handlePics = []
} }
@ -369,6 +381,8 @@
.xj-text { .xj-text {
margin-left: 10%; margin-left: 10%;
margin-top: 2%; margin-top: 2%;
font-size: 16px;
border-bottom:1px solid #f0f0f0 ;
} }
.subsectioin { .subsectioin {

View File

@ -93,7 +93,7 @@
// //
async getXjItem(id){ async getXjItem(id){
try { try {
const {data} = await uni.$http.get(`/gunshiApp/xyt/inspect/detail/info?taskId=${id}`) const {data} = await uni.$http.get(`/gunshiApp/xyt/inspect/detail/info?taskId=${this.id}`)
if(data.code == 200){ if(data.code == 200){
this.xjItem = data.data this.xjItem = data.data
} }
@ -107,8 +107,8 @@
}, },
onLoad(option){ onLoad(option){
this.taskTitle = option.taskTitle this.taskTitle = option.taskTitle
this.taskType = JSON.parse(option.taskType) this.taskType = option.taskType
this.taskContent = JSON.parse(option.taskContent) this.taskContent = option.taskContent
this.startDate = (option.startDate) this.startDate = (option.startDate)
this.endDate = option.endDate == "null" ? "" : option.endDate this.endDate = option.endDate == "null" ? "" : option.endDate
this.status = option.status this.status = option.status

View File

@ -20,6 +20,7 @@
</view> </view>
</view> </view>
<view class="" style="style='overflow: auto;height:calc(100vh - 150px)'">
<view class="" v-for="(item,i) in list" :key="i" style="background-color: #fff;margin-top:10px;"> <view class="" v-for="(item,i) in list" :key="i" style="background-color: #fff;margin-top:10px;">
<view class="item"> <view class="item">
<!-- {{item.title}} --> <!-- {{item.title}} -->
@ -28,7 +29,7 @@
</view> </view>
<view class="titleRight" @click="toDetail(item)"> <view class="titleRight" @click="toDetail(item)">
<view class="border"> <view class="border">
{{item.status == 1 ? "继续任务": "开始任务" }} {{status[item.status]}}
</view> </view>
<u-icon name="arrow-right" size="20"></u-icon> <u-icon name="arrow-right" size="20"></u-icon>
</view> </view>
@ -44,6 +45,7 @@
</view> </view>
</view> </view>
</view> </view>
</view>
</view> </view>
<u-datetime-picker <u-datetime-picker
@ -70,6 +72,11 @@
export default { export default {
data() { data() {
return { return {
status:{
0:'开始任务',
1:'继续任务',
2:'已完成'
},
startTime:stm, startTime:stm,
endTime:etm, endTime:etm,
stm, stm,
@ -105,7 +112,7 @@
end:moment(this.etm).format("YYYY-MM-DD"), end:moment(this.etm).format("YYYY-MM-DD"),
}, },
inspectUserId:userId, inspectUserId:userId,
statusList:[0,1] statusList:[2]
} }
try { try {
const res = await uni.$http.post("/gunshiApp/xyt/inspect/task/list",params) const res = await uni.$http.post("/gunshiApp/xyt/inspect/task/list",params)

View File

@ -129,6 +129,10 @@
this.queItem.handleUserName = uni.getStorageSync('value').userName this.queItem.handleUserName = uni.getStorageSync('value').userName
this.queItem.handleTime = moment().format('YYYY-MM-DD HH:mm:ss') this.queItem.handleTime = moment().format('YYYY-MM-DD HH:mm:ss')
this.queItem.handleUserId = uni.getStorageSync('value').userId this.queItem.handleUserId = uni.getStorageSync('value').userId
this.queItem.handlePics.map(item=>{
item.url ='http://223.75.53.141:9102/test.by-lyf.tmp' + item.filePath
return item
})
}, },
methods: { methods: {
submit(){ submit(){
@ -182,7 +186,7 @@
uploadFilePromise(url, name) { uploadFilePromise(url, name) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let a = uni.uploadFile({ let a = uni.uploadFile({
url: 'http://local.gunshiiot.com:18083/gunshiApp/xyt/maintain/service/file/upload/singleSimple', // url: 'http://local.gunshiiot.com:18083/gunshiApp/xyt/inspect/task/file/upload/singleSimple', //
filePath: url, filePath: url,
name: 'file', name: 'file',
formData: { formData: {

View File

@ -1,7 +1,6 @@
<template> <template>
<view class="contentItem"> <view class="contentItem" style="height: calc(100% - 350px);">
<uni-collapse> <uni-collapse>
<uni-collapse-item title-border="none" v-for="(item,index) in listData" :key="index" :border="false" <uni-collapse-item title-border="none" v-for="(item,index) in listData" :key="index" :border="false"
:show-animation="true"> :show-animation="true">
<template v-slot:title> <template v-slot:title>
@ -15,13 +14,13 @@
<view class="xj-text" v-for="(o,i) in item.children" :key="i"> <view class="xj-text" v-for="(o,i) in item.children" :key="i">
<text>{{o.itemDesc}}</text> <text>{{o.itemDesc}}</text>
<view class="subsectioin"> <view class="subsectioin">
<u--form labelPosition="left" :model="o" ref="uForm"> <u--form labelPosition="left" :model="o" ref="uForm" label-width="100px">
<u-form-item label="状态" prop="isNormal" borderBottom required> <u-form-item label="状态" prop="isNormal" borderBottom required >
<u-subsection :list="list" :current="getNormal(o.isNormal)" mode="subsection" <u-subsection :list="list" :current="getNormal(o.isNormal)" mode="subsection"
@change="(e)=>change(e,o,index,i,'isNormal')" @change="(e)=>change(e,o,index,i,'isNormal')"
style="width:200px;margin-left: 10px"></u-subsection> style="width:200px;margin-left: 10px"></u-subsection>
</u-form-item> </u-form-item>
<view class="" v-if="o.isNormal"> <view class="" v-if="o.isNormal==0">
<u-form-item label="现场图片" prop="inspectPics" borderBottom required> <u-form-item label="现场图片" prop="inspectPics" borderBottom required>
<u-upload accept="image" :fileList="o.inspectPics" <u-upload accept="image" :fileList="o.inspectPics"
@afterRead="(e)=>afterRead(e,o,index,i)" @afterRead="(e)=>afterRead(e,o,index,i)"
@ -42,7 +41,7 @@
mode="subsection" @change="(e)=>change(e,o,index,i,'isHandle')" mode="subsection" @change="(e)=>change(e,o,index,i,'isHandle')"
style="width:200px;margin-left: 10px"></u-subsection> style="width:200px;margin-left: 10px"></u-subsection>
</u-form-item> </u-form-item>
<view class="" v-if="o.isHandle !== 1"> <view class="" v-if="o.isHandle == 1">
<u-form-item label="现场图片" prop="handlePics" borderBottom required> <u-form-item label="现场图片" prop="handlePics" borderBottom required>
<u-upload accept="image" :fileList="o.handlePics" <u-upload accept="image" :fileList="o.handlePics"
@afterRead="(e)=>afterRead(e,o,index,i)" @afterRead="(e)=>afterRead(e,o,index,i)"
@ -59,30 +58,29 @@
<u--textarea v-model="o.handleDesc" placeholder="请输入内容"></u--textarea> <u--textarea v-model="o.handleDesc" placeholder="请输入内容"></u--textarea>
</u-form-item> </u-form-item>
</view> </view>
<view class="" v-if="o.isHandle == 1"> <view class="" v-if="o.isHandle == 0">
<u-form-item label="责任人" prop="handleUserId" borderBottom <u-form-item label="责任人" prop="handleUserId" borderBottom required>
@click="showSex = true; hideKeyboard()" required> <uni-data-picker :localdata="treeList" popup-title="" v-model="o.handleUserId"
<u--input v-model="o.handleUserId" disabled disabledColor="#ffffff" :border="false"
placeholder="请选择性别" border="none"></u--input> :map="{'text':'title','value':'value'}"
<u-icon slot="right" name="arrow-right"></u-icon> ></uni-data-picker>
</u-form-item> </u-form-item>
</view> </view>
</view> </view>
</u--form> </u--form>
<u-action-sheet :show="showSex" :actions="actions" title="请选择性别" description="如果选择保密会报错"
@close="showSex = false" @select="sexSelect">
</u-action-sheet>
</view> </view>
</view> </view>
</view> </view>
</uni-collapse-item> </uni-collapse-item>
<view class="" style="display: flex;">
<u-button text="保存" customStyle="margin-top: 50px" @click="submit"></u-button>
<u-button type="primary" text="结束巡检" customStyle="margin-top: 50px" @click="submit"></u-button>
</view>
</uni-collapse>
</uni-collapse>
<view class="" style="display: flex;">
<u-button text="保存" customStyle="margin-top: 50px" @click="submit(1)"></u-button>
<u-button type="primary" text="结束巡检" customStyle="margin-top: 50px" @click="submit(2)"></u-button>
</view>
</view> </view>
</template> </template>
@ -94,11 +92,13 @@
}, },
data() { data() {
return { return {
list: ["正常", "异常"], list: ["异常","正常", ],
listStatus: ["已处理", "未处理"], listStatus: ["未处理","已处理"],
current: 0, current: 0,
listData: [], listData: [],
showSex: false, showSex: false,
treeList:[],
deptUserList:[],
actions: [{ actions: [{
name: '男', name: '男',
}, },
@ -113,12 +113,31 @@
}, },
mounted() { mounted() {
// this.listData = this.xjItem // this.listData = this.xjItem
this.getTreeList()
}, },
watch: { watch: {
xjItem: function(n, o) { xjItem: function(n, o) {
this.listData = n.map(item => { this.listData = n.map(item => {
item.childen = item.children.map(i => { item.childen = item.children.map(i => {
i.handlePics?.map(item1=>{
item1.url ='http://223.75.53.141:9102/test.by-lyf.tmp' + item1.filePath
return item1
})
i.handleVideos?.map(item1=>{
item1.url ='http://223.75.53.141:9102/test.by-lyf.tmp' + item1.filePath
return item1
})
i.inspectPics?.map(item1=>{
item1.url ='http://223.75.53.141:9102/test.by-lyf.tmp' + item1.filePath
return item1
})
i.inspectVideos?.map(item1=>{
item1.url ='http://223.75.53.141:9102/test.by-lyf.tmp' + item1.filePath
return item1
})
if (!i.handlePics) { if (!i.handlePics) {
i.handlePics = [] i.handlePics = []
} }
@ -135,10 +154,59 @@
}) })
return item return item
}) })
console.log(n, this.listData, 'this.listData ');
} }
}, },
methods: { methods: {
nodeclick(e){
console.log(e,'1212');
},
buildTree (data, parentId) {
let tree = [];
data.forEach((node) => {
node.title = node.deptName;
node.key = node.deptId;
if (node.parentId === parentId) {
let children = this.buildTree(data, node.deptId);
if (children.length) {
node.children = children;
}
tree.push(node);
}
});
return tree;
},
handleTreeList(dept, user) {
const deptArr = dept.map(item => {
return {
...item,
value: item.deptId,
title: item.deptName,
disabled: item.userId ? false : true,
children: user.filter(u => u.deptId == item.deptId).map(u => ({
...u,
value: String(u.userId),
title: u.nickName
}))
}
})
console.log("deptArr",deptArr);
const treelist = this.buildTree(deptArr,0)
return treelist
},
async getTreeList (){
const res = await uni.$http.get('/gunshiApp/xyt/system/dept/list')
const resUser = await uni.$http.get('/gunshiApp/xyt/system/user/list?pageNum=1&pageSize=9999User')
this.deptUserList = resUser.data.rows
if (res.data.data?.length > 0 && resUser.data.rows?.length > 0) {
// return this.handleTreeList(res.data.data,res.data.rows)
console.log();
this.treeList = this.handleTreeList(res.data.data,resUser.data.rows)
} else {
// return []
this.treeList =[]
}
},
getIsItem(arr) { getIsItem(arr) {
return arr.filter(item1 => item1.isNormal !== 1 && item1.isNormal !== 0).length return arr.filter(item1 => item1.isNormal !== 1 && item1.isNormal !== 0).length
}, },
@ -164,44 +232,55 @@
return 3 return 3
} }
}, },
async uploadContent() { async uploadContent(status) {
try { try {
let params = { let params = {
status: 2, status: status,
list: [] list: []
} }
this.listData.map(i => { this.listData.map(i => {
params.list.push(i.children) params.list=i.children.map(item=>{ item.handleUserName = this.deptUserList.find(it=>it.userId==item.handleUserId)?.nickName
console.log(this.deptUserList.find(it=>it.userId==item.handleUserId));
return item
})
}) })
const { const {
data data
} = await uni.$http.post(`/gunshiApp/xyt/inspect/task/finish`, params) } = await uni.$http.post(`/gunshiApp/xyt/inspect/task/finish`, params)
console.log(data,'2121');
if(data.code==200){
uni.$showMsg('提交成功');
uni.navigateTo({
url:'/pages/xcrw/index'
})
}
} catch (error) { } catch (error) {
uni.$showMsg(); uni.$showMsg();
} }
}, },
submit() { submit(status) {
let tigger = true let tigger = true
// //
this.listData.forEach(item => { this.listData.forEach(item => {
item.ab = item.children.filter(i => { item.ab = item.children.filter(i => {
if (i.isNormal == 1) { if (i.isNormal == 0) {
if (i.inspectPics?.length && i.itemProblemDesc) { if (i.inspectPics?.length && i.itemProblemDesc) {
tigger = true tigger = true
} else { } else {
tigger = false tigger = false
uni.$showMsg('请填写现场问题描述和上传现场照片');
} }
if (i.isHandle == 0) { if (i.isHandle == 1) {
if (i.handlePics?.length && i.handleDesc) { if (i.handlePics?.length && i.handleDesc) {
tigger = true tigger = true
} else { } else {
tigger = false tigger = false
uni.$showMsg('请填写处理问题描述和上传处理照片');
} }
} else if (i.isHandle == 1) { } else if (i.isHandle == 0) {
tigger = true tigger = true
} }
} else if (i.isNormal == 0) { } else if (i.isNormal == 1) {
tigger = true tigger = true
} }
}) })
@ -209,7 +288,9 @@
}) })
console.log(tigger, 'arr'); console.log(tigger, 'arr');
if (tigger) { if (tigger) {
this.uploadContent() this.uploadContent(status)
}else{
} }
// //
// if() // if()
@ -247,7 +328,7 @@
uploadFilePromise(url, name, index, index1) { uploadFilePromise(url, name, index, index1) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let a = uni.uploadFile({ let a = uni.uploadFile({
url: 'http://local.gunshiiot.com:18083/gunshiApp/xyt/maintain/service/file/upload/singleSimple', // url: 'http://local.gunshiiot.com:18083/gunshiApp/xyt/inspect/task/file/upload/singleSimple', //
filePath: url, filePath: url,
name: 'file', name: 'file',
formData: { formData: {
@ -273,14 +354,15 @@
// this.model1.userInfo.sex = e.name // this.model1.userInfo.sex = e.name
// this.$refs.uForm.validateField('userInfo.sex') // this.$refs.uForm.validateField('userInfo.sex')
}, },
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.contentItem { .contentItem {
height: 260px; // height: 260px;
overflow: auto; // overflow: auto;
.itemC { .itemC {
display: flex; display: flex;

View File

@ -1,5 +1,5 @@
<template> <template>
<view :style="{height:'100vh',overflow:'hidden'}"> <view :style="{height:'100vh'}">
<u-status-bar></u-status-bar> <u-status-bar></u-status-bar>
<u-navbar :title="taskTitle" :autoBack="true" :titleStyle="{ <u-navbar :title="taskTitle" :autoBack="true" :titleStyle="{
fontSize:'18px' fontSize:'18px'
@ -37,9 +37,12 @@
</view> </view>
</view> </view>
<view v-show="status == 0 && btnStatus == 0" style="display:flex;justify-content: center;margin-top: 20%;"> <view v-show="status !== 2 && btnStatus == 0" style="display:flex;justify-content: center;margin-top: 20%;">
<view class="circle-btn" @click="startXc"></view> <view v-show="status !== 2 && btnStatus == 0" class="circle-btn" @click="startXc">{{statusType[status]}}</view>
</view> </view>
<view class="" style="height: calc(100vh - 311px);overflow: auto;">
<view v-show="btnStatus != 0" style="margin: 10px;background-color: #fff;padding: 10px;"> <view v-show="btnStatus != 0" style="margin: 10px;background-color: #fff;padding: 10px;">
<view class="item"> <view class="item">
<view class="blueTiao"></view> <view class="blueTiao"></view>
@ -47,10 +50,11 @@
巡检项 巡检项
</view> </view>
</view> </view>
<view class="contentItem"> <view class="contentItem1" style="height: 100%;">
<db-form :xjItem="xjItem"></db-form> <db-form :xjItem="xjItem"></db-form>
</view> </view>
</view> </view>
</view>
</view> </view>
</view> </view>
</template> </template>
@ -74,19 +78,30 @@
btnStatus: 0, btnStatus: 0,
xjItem:[], xjItem:[],
list:["正常","异常"], list:["正常","异常"],
current:3 current:3,
statusType:{
0:'开始巡查',
1:'继续巡查',
2:'已完成'
},
}; };
}, },
methods: { methods: {
// //
async startXc(){ async startXc(){
try { try {
// const {data} = await uni.$http.get(`/gunshiApp/xyt/inspect/task/startInspect/${this.id}`) if(status == 0){
// if(data.code == 200){ const {data} = await uni.$http.get(`/gunshiApp/xyt/inspect/task/startInspect/${this.id}`)
// this.btnStatus = 1; if(data.code == 200){
// } this.btnStatus = 1;
this.btnStatus = 1; this.getXjItem(this.id)
this.getXjItem(this.id) }
}else if(status == 1){
this.btnStatus = 1;
this.getXjItem(this.id)
}
} catch (error) { } catch (error) {
uni.$showMsg(); uni.$showMsg();
} }
@ -102,16 +117,15 @@
uni.$showMsg(); uni.$showMsg();
} }
}, },
change(e){
this.current = e;
}
}, },
onLoad(option){ onLoad(option){
this.taskTitle = option.taskTitle this.taskTitle = option.taskTitle
this.taskType = JSON.parse(option.taskType) this.taskType = option.taskType
this.taskContent = JSON.parse(option.taskContent) this.taskContent = option.taskContent
this.startDate = (option.startDate) this.startDate = (option.startDate)
this.endDate = option.endDate == "null" ? "" : option.endDate this.endDate = option.endDate == "null" ? "" : option.endDate
this.status = option.status this.status = option.status
this.id = option.id this.id = option.id
} }
@ -132,7 +146,15 @@
border-top: 1px solid #eee; border-top: 1px solid #eee;
border-bottom: 1px solid #eee; border-bottom: 1px solid #eee;
} }
.circle-btn{
width: 120px;
height: 120px;
background-color: #007aff;
border-radius: 50%;
color:#fff;
text-align: center;
line-height: 120px;
}
.item { .item {
padding-bottom: 10px; padding-bottom: 10px;
@ -187,35 +209,4 @@
padding: 10px; padding: 10px;
} }
} }
.circle-btn{
width: 120px;
height: 120px;
background-color: #007aff;
border-radius: 50%;
color:#fff;
text-align: center;
line-height: 120px;
}
.yuandian{
display: inline-block;
width: 10px;
height: 10px;
background-color: #409eff;
border-radius: 50%;
margin-right: 10px;
}
.xj-content{
height: 300px;
overflow-y: auto;
}
.xj-text{
margin-left: 10%;
margin-top: 2%;
}
.subsectioin{
display: flex;
column-gap: 10px;
align-items: center;
margin-top: 10px;
}
</style> </style>

View File

@ -1,7 +1,7 @@
<template> <template>
<view :style="{height:'100vh',overflow:'hidden'}"> <view :style="{height:'100vh',overflow:'hidden'}">
<u-status-bar></u-status-bar> <u-status-bar></u-status-bar>
<u-navbar title="巡查任务" :autoBack="true" :titleStyle="{ <u-navbar title="巡查任务1" :autoBack="true" :titleStyle="{
fontSize:'18px' fontSize:'18px'
}" :height='44' :safeAreaInsetTop=true leftIconSize='20' leftIconColor='rgb(153, 153, 153)'> }" :height='44' :safeAreaInsetTop=true leftIconSize='20' leftIconColor='rgb(153, 153, 153)'>
</u-navbar> </u-navbar>
@ -19,7 +19,10 @@
</view> </view>
</view> </view>
</view> </view >
<view class="" style='overflow: auto;height:calc(100vh - 150px)'>
<view class="" v-for="(item,i) in list" :key="i" style="background-color: #fff;margin-top:10px;"> <view class="" v-for="(item,i) in list" :key="i" style="background-color: #fff;margin-top:10px;">
<view class="item"> <view class="item">
<!-- {{item.title}} --> <!-- {{item.title}} -->
@ -28,7 +31,7 @@
</view> </view>
<view class="titleRight" @click="toDetail(item)"> <view class="titleRight" @click="toDetail(item)">
<view class="border"> <view class="border">
{{item.status == 1 ? "继续任务": "开始任务" }} {{status[item.status]}}
</view> </view>
<u-icon name="arrow-right" size="20"></u-icon> <u-icon name="arrow-right" size="20"></u-icon>
</view> </view>
@ -44,6 +47,7 @@
</view> </view>
</view> </view>
</view> </view>
</view>
</view> </view>
<u-datetime-picker <u-datetime-picker
@ -70,6 +74,11 @@
export default { export default {
data() { data() {
return { return {
status:{
0:'开始任务',
1:'继续任务',
// 2:''
},
startTime:stm, startTime:stm,
endTime:etm, endTime:etm,
stm, stm,
@ -115,6 +124,7 @@
} }
}, },
toDetail(record){ toDetail(record){
console.log(record);
uni.navigateTo({ uni.navigateTo({
url:`/pages/xcrw/detail/index?taskTitle=${record.taskTitle}&taskType=${record.taskType}&taskContent=${record.taskContent}&startDate=${record.startDate}&endDate=${record.endDate}&status=${record.status}&id=${record.id}` url:`/pages/xcrw/detail/index?taskTitle=${record.taskTitle}&taskType=${record.taskType}&taskContent=${record.taskContent}&startDate=${record.startDate}&endDate=${record.endDate}&status=${record.status}&id=${record.id}`
}) })