|
@@ -172,6 +172,10 @@
|
|
|
import {
|
|
import {
|
|
|
Debounce
|
|
Debounce
|
|
|
} from "../util/anitthro.js"
|
|
} from "../util/anitthro.js"
|
|
|
|
|
+ import {
|
|
|
|
|
+ concat,
|
|
|
|
|
+ reduce
|
|
|
|
|
+ } from 'lodash-es';
|
|
|
export default {
|
|
export default {
|
|
|
name: "task-details",
|
|
name: "task-details",
|
|
|
components: {
|
|
components: {
|
|
@@ -290,14 +294,19 @@
|
|
|
task_id: id,
|
|
task_id: id,
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
- console.log(res)
|
|
|
|
|
- this.taskinfo = res
|
|
|
|
|
- if (this.taskinfo.img_list == "" || this.taskinfo.img_list.length == 0) {
|
|
|
|
|
|
|
+ console.log(res, 'get task info 0221')
|
|
|
|
|
+ const newImgList = reduce(res.clock_in_list, (pre, current) => concat(pre, current.img_list || []), [])
|
|
|
|
|
+ console.log(newImgList, 'new img list')
|
|
|
|
|
+ if (!this.taskinfo.img_list || this.taskinfo.img_list.length == 0) {
|
|
|
this.taskinfo.img_list = []
|
|
this.taskinfo.img_list = []
|
|
|
} else {
|
|
} else {
|
|
|
this.taskinfo.img_list = JSON.parse(this.taskinfo.img_list)
|
|
this.taskinfo.img_list = JSON.parse(this.taskinfo.img_list)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ if (!this.taskinfo.img_list.length && newImgList.length > 0) {
|
|
|
|
|
+ this.taskinfo.img_list = newImgList;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (this.taskinfo.task_type == "有害生物监测") {
|
|
if (this.taskinfo.task_type == "有害生物监测") {
|
|
|
this.task_type = true
|
|
this.task_type = true
|
|
|
} else {
|
|
} else {
|
|
@@ -349,14 +358,14 @@
|
|
|
},
|
|
},
|
|
|
async taskfillingdraft() { //任务填报接口
|
|
async taskfillingdraft() { //任务填报接口
|
|
|
// this.gettaskinfo()
|
|
// this.gettaskinfo()
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
var arr = JSON.parse(JSON.stringify(this.$store.state.worndatabase))
|
|
var arr = JSON.parse(JSON.stringify(this.$store.state.worndatabase))
|
|
|
console.log(this.draft)
|
|
console.log(this.draft)
|
|
|
console.log(arr)
|
|
console.log(arr)
|
|
|
for (var i = 0; i < arr.length; i++) {
|
|
for (var i = 0; i < arr.length; i++) {
|
|
|
for (var j = 0; j < this.draft.length; j++) {
|
|
for (var j = 0; j < this.draft.length; j++) {
|
|
|
if (arr[i].id == this.draft[j].record_id) {
|
|
if (arr[i].id == this.draft[j].record_id) {
|
|
|
- arr.splice(i,1)
|
|
|
|
|
|
|
+ arr.splice(i, 1)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -368,15 +377,15 @@
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- this.draft = this.draft.concat(arr)
|
|
|
|
|
|
|
+ this.draft = this.draft.concat(arr)
|
|
|
this.$store.state.worndatabase = JSON.parse(JSON.stringify(this.draft))
|
|
this.$store.state.worndatabase = JSON.parse(JSON.stringify(this.draft))
|
|
|
// console.log(arr)
|
|
// console.log(arr)
|
|
|
- for(var i = 0; i < this.draft.length; i++){
|
|
|
|
|
- if(this.draft[i].id){
|
|
|
|
|
|
|
+ for (var i = 0; i < this.draft.length; i++) {
|
|
|
|
|
+ if (this.draft[i].id) {
|
|
|
this.draft[i]["record_id"] = this.draft[i].id
|
|
this.draft[i]["record_id"] = this.draft[i].id
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- console.log(this.draft,"0000")
|
|
|
|
|
|
|
+ console.log(this.draft, "0000")
|
|
|
var data = {}
|
|
var data = {}
|
|
|
if (this.task_type) {
|
|
if (this.task_type) {
|
|
|
data = {
|
|
data = {
|
|
@@ -385,16 +394,16 @@
|
|
|
img_list: JSON.stringify(this.urllist), // 是 图片列表 ['http://www.c.com']
|
|
img_list: JSON.stringify(this.urllist), // 是 图片列表 ['http://www.c.com']
|
|
|
trap_record_list: JSON.stringify(this.draft),
|
|
trap_record_list: JSON.stringify(this.draft),
|
|
|
}
|
|
}
|
|
|
- console.log("有数据",data)
|
|
|
|
|
|
|
+ console.log("有数据", data)
|
|
|
} else {
|
|
} else {
|
|
|
data = {
|
|
data = {
|
|
|
task_id: this.task_id, // 是 任务id
|
|
task_id: this.task_id, // 是 任务id
|
|
|
report_msg: this.textareavalue, // 是 任务汇报内容
|
|
report_msg: this.textareavalue, // 是 任务汇报内容
|
|
|
img_list: JSON.stringify(this.urllist), // 是 图片列表 ['http://www.c.com']
|
|
img_list: JSON.stringify(this.urllist), // 是 图片列表 ['http://www.c.com']
|
|
|
}
|
|
}
|
|
|
- console.log("无数据",data)
|
|
|
|
|
|
|
+ console.log("无数据", data)
|
|
|
}
|
|
}
|
|
|
- console.log(data,555)
|
|
|
|
|
|
|
+ console.log(data, 555)
|
|
|
const res = await this.$myRequest({
|
|
const res = await this.$myRequest({
|
|
|
url: '/api/api_gateway?method=app.task.task_filling_draft',
|
|
url: '/api/api_gateway?method=app.task.task_filling_draft',
|
|
|
data: data,
|
|
data: data,
|