diff --git a/pages/mypage/compents/xcrw/detail/dbForm.vue b/pages/mypage/compents/xcrw/detail/dbForm.vue
index 1636087..873c787 100644
--- a/pages/mypage/compents/xcrw/detail/dbForm.vue
+++ b/pages/mypage/compents/xcrw/detail/dbForm.vue
@@ -12,44 +12,40 @@
-
+
{{o.itemDesc}}
- {{o.isNormal == 0?'异常':'正常'}}
+ ({{o.isNormal == 0?'异常':'正常'}}{{o.isHandle?'已处理':'未处理'}})
-
+
现场图片
-
+
-
+
现场视频
-
+
问题描述
{{o.itemProblemDesc}}
-
- 处理状态
- {{o.isHandle?'已处理':'未处理'}}
-
处理图片
-
+
-
+
处理视频
-
-
+
+
@@ -164,6 +160,22 @@
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 = []
}
@@ -369,6 +381,8 @@
.xj-text {
margin-left: 10%;
margin-top: 2%;
+ font-size: 16px;
+ border-bottom:1px solid #f0f0f0 ;
}
.subsectioin {
diff --git a/pages/mypage/compents/xcrw/detail/index.vue b/pages/mypage/compents/xcrw/detail/index.vue
index ac619b4..a1f96c6 100644
--- a/pages/mypage/compents/xcrw/detail/index.vue
+++ b/pages/mypage/compents/xcrw/detail/index.vue
@@ -93,7 +93,7 @@
// 获取巡查项
async getXjItem(id){
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){
this.xjItem = data.data
}
@@ -107,8 +107,8 @@
},
onLoad(option){
this.taskTitle = option.taskTitle
- this.taskType = JSON.parse(option.taskType)
- this.taskContent = JSON.parse(option.taskContent)
+ this.taskType = option.taskType
+ this.taskContent = option.taskContent
this.startDate = (option.startDate)
this.endDate = option.endDate == "null" ? "" : option.endDate
this.status = option.status
diff --git a/pages/mypage/compents/xcrw/index.vue b/pages/mypage/compents/xcrw/index.vue
index 0109fa4..11e6fcd 100644
--- a/pages/mypage/compents/xcrw/index.vue
+++ b/pages/mypage/compents/xcrw/index.vue
@@ -20,6 +20,7 @@
+
@@ -28,7 +29,7 @@
- {{item.status == 1 ? "继续任务": "开始任务" }}
+ {{status[item.status]}}
@@ -44,6 +45,7 @@
+
{
+ item.url ='http://223.75.53.141:9102/test.by-lyf.tmp' + item.filePath
+ return item
+ })
},
methods: {
submit(){
@@ -182,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/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 @@
+