@@ -48,6 +69,11 @@
url: '/pages/modifyPassword/modifyPassword'
},
]
+ const xjxList = [
+ {img: '../../static/images/info.png', name: '巡查任务', url:'/pages/mypage/compents/xcrw/index'},
+ {img: '../../static/images/password.png', name: '维修养护', url:'/pages/mypage/compents/wxyh/index'},
+ {img: '../../static/images/password.png', name: '问题处理', url:'/pages/mypage/compents/wtcl/index'},
+ ]
export default {
data() {
return {
@@ -56,14 +82,15 @@
userresponse: '防汛办',
version: '011.14.23',
func: func,
+ xjxList:xjxList,
default_src: uni.getStorageSync('avatar'),
}
},
methods: {
navigateToSubPage(index) {
uni.navigateTo({
- url: func[index].url,
- animationType: 'pop-in',
+ url: xjxList[index].url,
+ animationType:'pop-in',
})
},
logout() {
@@ -225,4 +252,11 @@
color: white;
background-color: #007afd;
}
-
\ No newline at end of file
+ .xjxList{
+ display: flex;
+ flex-direction: column;
+ align-items: start;
+ justify-content: start;
+ height: 20vh;
+ }
+
diff --git a/pages/wtcl/detail/index.vue b/pages/wtcl/detail/index.vue
index 95063a5..3d9fc27 100644
--- a/pages/wtcl/detail/index.vue
+++ b/pages/wtcl/detail/index.vue
@@ -1,7 +1,7 @@
-
@@ -70,7 +70,7 @@
- afterRead(e,queItem)"
@delete="(e)=>deletePic(e,queItem)" name="handlePics" multiple
:maxCount="10">
@@ -128,10 +128,25 @@
console.log(uni.getStorageSync('value'));
this.queItem.handleUserName = uni.getStorageSync('value').userName
this.queItem.handleTime = moment().format('YYYY-MM-DD HH:mm:ss')
- },
+ 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: {
submit(){
- // /inspect/detail/handle
+ //
+ if(this.queItem.handlePics?.length < 0 || !this.queItem.handleDesc){
+ console.log(this.queItem);
+ uni.$showMsg('请填写处理内容和上传图片');
+ return;
+ }else{
+ console.log(this.queItem);
+ uni.$http.post('/gunshiApp/xyt/inspect/detail/handle', this.queItem).then(res => {
+ uni.$showMsg(res.data.description);
+ })
+ }
},
// 删除图片
deletePic(event, o) {
@@ -143,7 +158,12 @@
// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
console.log(event,'2342132');
let lists = [].concat(event.file)
+
+ if(!this.queItem[event.name]){
+ this.queItem[event.name]=[]
+ }
let fileListLen = this.queItem[event.name]?.length
+ console.log(this.queItem[event.name]);
lists.map((item) => {
this.queItem[event.name].push({
...item,
@@ -166,7 +186,7 @@
uploadFilePromise(url, name) {
return new Promise((resolve, reject) => {
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,
name: 'file',
formData: {
diff --git a/pages/wtcl/index.vue b/pages/wtcl/index.vue
index 57f9bdb..be6c131 100644
--- a/pages/wtcl/index.vue
+++ b/pages/wtcl/index.vue
@@ -5,8 +5,8 @@
fontSize:'18px'
}" :height='44' :safeAreaInsetTop=true leftIconSize='20' leftIconColor='rgb(153, 153, 153)'>
-
-
+
+
开始时间
diff --git a/pages/xcrw/detail/dbForm.vue b/pages/xcrw/detail/dbForm.vue
index dbacff0..8151d5d 100644
--- a/pages/xcrw/detail/dbForm.vue
+++ b/pages/xcrw/detail/dbForm.vue
@@ -1,7 +1,6 @@
-
+
-
@@ -15,13 +14,13 @@
{{o.itemDesc}}
-
-
+
+
change(e,o,index,i,'isNormal')"
style="width:200px;margin-left: 10px">
-
+
afterRead(e,o,index,i)"
@@ -42,7 +41,7 @@
mode="subsection" @change="(e)=>change(e,o,index,i,'isHandle')"
style="width:200px;margin-left: 10px">
-
+
afterRead(e,o,index,i)"
@@ -59,30 +58,29 @@
-
-
-
-
+
+
+
-
-
+
+
-
-
-
-
+
-
+
+
+
+
@@ -94,11 +92,13 @@
},
data() {
return {
- list: ["正常", "异常"],
- listStatus: ["已处理", "未处理"],
+ list: ["异常","正常", ],
+ listStatus: ["未处理","已处理"],
current: 0,
listData: [],
showSex: false,
+ treeList:[],
+ deptUserList:[],
actions: [{
name: '男',
},
@@ -113,12 +113,31 @@
},
mounted() {
// this.listData = this.xjItem
+
+ this.getTreeList()
},
watch: {
xjItem: function(n, o) {
this.listData = n.map(item => {
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) {
i.handlePics = []
}
@@ -135,10 +154,59 @@
})
return item
})
- console.log(n, this.listData, 'this.listData ');
}
},
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) {
return arr.filter(item1 => item1.isNormal !== 1 && item1.isNormal !== 0).length
},
@@ -164,44 +232,55 @@
return 3
}
},
- async uploadContent() {
+ async uploadContent(status) {
try {
let params = {
- status: 2,
+ status: status,
list: []
}
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 {
data
} = 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) {
uni.$showMsg();
}
},
- submit() {
+ submit(status) {
let tigger = true
//判断是否符合提交条件
this.listData.forEach(item => {
item.ab = item.children.filter(i => {
- if (i.isNormal == 1) {
+ if (i.isNormal == 0) {
if (i.inspectPics?.length && i.itemProblemDesc) {
tigger = true
} else {
tigger = false
+ uni.$showMsg('请填写现场问题描述和上传现场照片');
}
- if (i.isHandle == 0) {
+ if (i.isHandle == 1) {
if (i.handlePics?.length && i.handleDesc) {
tigger = true
} else {
tigger = false
+ uni.$showMsg('请填写处理问题描述和上传处理照片');
}
- } else if (i.isHandle == 1) {
+ } else if (i.isHandle == 0) {
tigger = true
}
- } else if (i.isNormal == 0) {
+ } else if (i.isNormal == 1) {
tigger = true
}
})
@@ -209,7 +288,9 @@
})
console.log(tigger, 'arr');
if (tigger) {
- this.uploadContent()
+ this.uploadContent(status)
+ }else{
+
}
//
// if()
@@ -247,7 +328,7 @@
uploadFilePromise(url, name, index, index1) {
return new Promise((resolve, reject) => {
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,
name: 'file',
formData: {
@@ -273,14 +354,15 @@
// this.model1.userInfo.sex = e.name
// this.$refs.uForm.validateField('userInfo.sex')
},
+
}
}
\ No newline at end of file
diff --git a/pages/xcrw/index.vue b/pages/xcrw/index.vue
index 1f0cf55..ac1dbc1 100644
--- a/pages/xcrw/index.vue
+++ b/pages/xcrw/index.vue
@@ -1,7 +1,7 @@
-
@@ -19,7 +19,10 @@
-
+
+
+
+
@@ -28,7 +31,7 @@
- {{item.status == 1 ? "继续任务": "开始任务" }}
+ {{status[item.status]}}
@@ -44,6 +47,7 @@
+
-
-
+
+
{{k}}
@@ -43,7 +43,23 @@
}
},
methods:{
-
+ getColor(v){
+ if(v>=0 && v<10){
+ return '#bdef9a'
+ }
+ if(v>=10 && v<25){ return '#bdef9a'}
+ if(v>=20 && v<50){return '#6ec1fb'}
+ if(v>=50 && v<100){return '#1d1bc7'}
+ if(v>=100 && v<250){return '#eb20f5'}
+ if(v>=250){return '#761e50'}
+
+ // #bdef9a 0-10,
+ // #bdef9a 10-25
+ // #6ec1fb 20-50
+ // #1d1bc7 50-100
+ // #eb20f5 100-250
+ // #761e50 >=250
+ },
// 获取雨量站
async getYlzData(){
try {