|
|
@@ -5,11 +5,11 @@
|
|
|
</view>
|
|
|
<view class="task-details__body">
|
|
|
<u-sticky>
|
|
|
- <task-tabs @tabClick="handleTabClick"></task-tabs>
|
|
|
+ <task-tabs @tabClick="handleTabClick" :tabList="tabList"></task-tabs>
|
|
|
</u-sticky>
|
|
|
<view class="task-details__content">
|
|
|
<transition name="slide-fade" mode="out-in" appear>
|
|
|
- <component :is="currentComponent" :dataSource="taskDetail"></component>
|
|
|
+ <component :is="currentComponent" :dataSource="taskDetail" :isEdit="isEdit"></component>
|
|
|
</transition>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -35,7 +35,29 @@
|
|
|
computed: {
|
|
|
...mapState({
|
|
|
wornlist: state => state.wornlist
|
|
|
- })
|
|
|
+ }),
|
|
|
+ tabList() {
|
|
|
+ if (this.task_type) {
|
|
|
+ return [{
|
|
|
+ id: 1,
|
|
|
+ name: '签到记录',
|
|
|
+ }, {
|
|
|
+ id: 2,
|
|
|
+ name: '诱捕器',
|
|
|
+ }, {
|
|
|
+ id: 3,
|
|
|
+ name: '行驶轨迹'
|
|
|
+ }]
|
|
|
+ } else {
|
|
|
+ return [{
|
|
|
+ id: 1,
|
|
|
+ name: '签到记录',
|
|
|
+ }, {
|
|
|
+ id: 3,
|
|
|
+ name: '行驶轨迹'
|
|
|
+ }]
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -46,6 +68,7 @@
|
|
|
draft: [],
|
|
|
taskinfo: {},
|
|
|
task_type: false,
|
|
|
+ isEdit: false,
|
|
|
istask: 1 // 任务模块
|
|
|
}
|
|
|
},
|
|
|
@@ -105,14 +128,17 @@
|
|
|
taskService.getTaskDetailByTaskID(this.taskID).then(res => {
|
|
|
console.warn(res, 'get task detail')
|
|
|
this.taskDetail = this.taskinfo = res;
|
|
|
+ this.isEdit = res.task_status === '处理中';
|
|
|
+ this.task_id = res.task_id;
|
|
|
|
|
|
- if (this.taskinfo.img_list == "" || this.taskinfo.img_list.length == 0) {
|
|
|
- this.taskinfo.img_list = []
|
|
|
- } else {
|
|
|
- this.taskinfo.img_list = JSON.parse(this.taskinfo.img_list)
|
|
|
- }
|
|
|
-
|
|
|
- if (this.taskinfo.task_type == "有害生物监测") {
|
|
|
+ console.log(this.taskinfo, '------------------------------- task info', this.taskDetail)
|
|
|
+ // if (this.taskinfo.img_list == "" || this.taskinfo.img_list.length == 0) {
|
|
|
+ // this.taskinfo.img_list = []
|
|
|
+ // } else {
|
|
|
+ // this.taskinfo.img_list = JSON.parse(this.taskinfo.img_list)
|
|
|
+ // }
|
|
|
+ console.warn(this.taskinfo.task_type, 'get task detail --1213144')
|
|
|
+ if (res.task_type == "有害生物监测") {
|
|
|
this.task_type = true
|
|
|
} else {
|
|
|
this.task_type = false
|
|
|
@@ -140,8 +166,8 @@
|
|
|
// this.gettaskinfo()
|
|
|
|
|
|
var arr = JSON.parse(JSON.stringify(this.$store.state.worndatabase))
|
|
|
- console.log(this.draft)
|
|
|
- console.log(arr)
|
|
|
+ console.warn(this.draft,'draft')
|
|
|
+ console.log(arr,'arr draft')
|
|
|
for (var i = 0; i < arr.length; i++) {
|
|
|
for (var j = 0; j < this.draft.length; j++) {
|
|
|
if (arr[i].id == this.draft[j].record_id) {
|
|
|
@@ -170,8 +196,8 @@
|
|
|
if (this.task_type) {
|
|
|
data = {
|
|
|
task_id: this.task_id, // 是 任务id
|
|
|
- report_msg: this.textareavalue, // 是 任务汇报内容
|
|
|
- img_list: JSON.stringify(this.urllist), // 是 图片列表 ['http://www.c.com']
|
|
|
+ // report_msg: this.textareavalue, // 是 任务汇报内容
|
|
|
+ // img_list: JSON.stringify(this.urllist), // 是 图片列表 ['http://www.c.com']
|
|
|
trap_record_list: JSON.stringify(this.draft),
|
|
|
}
|
|
|
console.log("有数据", data)
|