|
|
@@ -12,7 +12,7 @@
|
|
|
v-model="input"
|
|
|
clearable
|
|
|
@change="searchData"
|
|
|
- placeholder="请选择任务处理人"
|
|
|
+ placeholder="请选择任务处理人/实际处理人"
|
|
|
size="mini"
|
|
|
>
|
|
|
<el-option
|
|
|
@@ -96,7 +96,16 @@
|
|
|
width="180"
|
|
|
>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="report_time" label="带回时间" width="280">
|
|
|
+ <el-table-column
|
|
|
+ prop="actual_operator_name"
|
|
|
+ label="实际处理人"
|
|
|
+ width="180"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.actual_operator_name || "暂无" }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="report_time" label="带回时间">
|
|
|
<template slot-scope="scope">
|
|
|
<span>{{ scope.row.report_time || "暂无" }}</span>
|
|
|
</template>
|
|
|
@@ -289,16 +298,16 @@ export default {
|
|
|
options: [
|
|
|
{
|
|
|
value: "待接收",
|
|
|
- label: "待接收",
|
|
|
+ label: "待接收"
|
|
|
},
|
|
|
{
|
|
|
value: "已接收",
|
|
|
- label: "已接收",
|
|
|
+ label: "已接收"
|
|
|
},
|
|
|
{
|
|
|
value: "已填报",
|
|
|
- lanbel: "已填报",
|
|
|
- },
|
|
|
+ lanbel: "已填报"
|
|
|
+ }
|
|
|
],
|
|
|
value: "", // 任务状态
|
|
|
value1: "", // 时间筛选
|
|
|
@@ -315,8 +324,8 @@ export default {
|
|
|
options1: [
|
|
|
{
|
|
|
value: "选项1",
|
|
|
- label: "黄金糕",
|
|
|
- },
|
|
|
+ label: "黄金糕"
|
|
|
+ }
|
|
|
],
|
|
|
value2: "",
|
|
|
input2: "",
|
|
|
@@ -325,11 +334,12 @@ export default {
|
|
|
// 已识别
|
|
|
examineObj: {}, // 选中的对象值
|
|
|
fillList: [], // 填报详情数据
|
|
|
+ spareData: [], // 填报详情备用数据
|
|
|
// models: Array(fillList.length).fill(''), // 填报select数据
|
|
|
models: null, // 填报select数据
|
|
|
insectVal: "", // 添加 - 有害生物
|
|
|
numVal: "", // 添加 - 数量
|
|
|
- loading1: false, // 加载
|
|
|
+ loading1: false // 加载
|
|
|
};
|
|
|
},
|
|
|
//监听属性 类似于data概念
|
|
|
@@ -342,7 +352,7 @@ export default {
|
|
|
this.fullHeight = val;
|
|
|
this.timer = true;
|
|
|
let that = this;
|
|
|
- setTimeout(function () {
|
|
|
+ setTimeout(function() {
|
|
|
//防止过度调用监测事件,导致卡顿
|
|
|
that.timer = false;
|
|
|
}, 400);
|
|
|
@@ -353,8 +363,9 @@ export default {
|
|
|
dialogVisible(val) {
|
|
|
if (val == false) {
|
|
|
this.fillList = [];
|
|
|
+ this.spareData = []; // 备用数据
|
|
|
}
|
|
|
- },
|
|
|
+ }
|
|
|
},
|
|
|
//方法集合
|
|
|
methods: {
|
|
|
@@ -412,10 +423,10 @@ export default {
|
|
|
operator_user_id: this.input, // 任务处理人id
|
|
|
start_time: this.startTime, // 开始时间
|
|
|
end_time: this.endTime, // 结束时间
|
|
|
- task_status: this.value, // 任务状态
|
|
|
- }),
|
|
|
+ task_status: this.value // 任务状态
|
|
|
+ })
|
|
|
})
|
|
|
- .then((res) => {
|
|
|
+ .then(res => {
|
|
|
if (res.data.data.total_item !== 0) {
|
|
|
this.tableSum = res.data.data.total_item;
|
|
|
var data = res.data.data.page_list;
|
|
|
@@ -428,7 +439,7 @@ export default {
|
|
|
}
|
|
|
this.loading = false;
|
|
|
})
|
|
|
- .catch((err) => {
|
|
|
+ .catch(err => {
|
|
|
this.loading = false;
|
|
|
});
|
|
|
},
|
|
|
@@ -438,12 +449,18 @@ export default {
|
|
|
this.$axios({
|
|
|
method: "POST",
|
|
|
url: "/api/api_gateway?method=control_center.task.task_user_list",
|
|
|
+ data: this.qs.stringify({
|
|
|
+ user_type: "operator", // 用户类型,operator(任务处理人), supervisor(任务监督人), owner(任务发布人)
|
|
|
+ operator_id: "", // 已经选择的任务处理人id
|
|
|
+ supervisor_id: "", // 已经选择的任务监督人id
|
|
|
+ owner_id: "" // 已经选择的任务发布人id
|
|
|
+ })
|
|
|
})
|
|
|
- .then((res) => {
|
|
|
- if (res.data.data.operator_user_list.length !== 0) {
|
|
|
- var data = res.data.data.operator_user_list;
|
|
|
+ .then(res => {
|
|
|
+ if (res.data.data.length !== 0) {
|
|
|
+ var data = res.data.data;
|
|
|
var list = [];
|
|
|
- data.forEach((item) => {
|
|
|
+ data.forEach(item => {
|
|
|
var obj = {};
|
|
|
obj["value"] = item.user_id;
|
|
|
obj["label"] = item.real_name;
|
|
|
@@ -452,7 +469,7 @@ export default {
|
|
|
this.conductorList = list;
|
|
|
}
|
|
|
})
|
|
|
- .catch((err) => {});
|
|
|
+ .catch(err => {});
|
|
|
},
|
|
|
|
|
|
// 确认接收
|
|
|
@@ -460,28 +477,28 @@ export default {
|
|
|
this.$confirm("此操作将确认接收, 是否继续?", "提示", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
- type: "warning",
|
|
|
+ type: "warning"
|
|
|
})
|
|
|
.then(() => {
|
|
|
this.$axios({
|
|
|
method: "POST",
|
|
|
url: "/api/api_gateway?method=control_center.task.discern_modify",
|
|
|
data: this.qs.stringify({
|
|
|
- record_id: data.id, // 任务id
|
|
|
- }),
|
|
|
+ record_id: data.id // 任务id
|
|
|
+ })
|
|
|
})
|
|
|
- .then((res) => {
|
|
|
+ .then(res => {
|
|
|
if (res.data.data == true) {
|
|
|
this.$message({
|
|
|
type: "success",
|
|
|
message: "接收成功!",
|
|
|
- duration: 1500,
|
|
|
+ duration: 1500
|
|
|
});
|
|
|
this.loading = true;
|
|
|
this.tableList();
|
|
|
}
|
|
|
})
|
|
|
- .catch((err) => {
|
|
|
+ .catch(err => {
|
|
|
console.log(err);
|
|
|
});
|
|
|
})
|
|
|
@@ -489,7 +506,7 @@ export default {
|
|
|
this.$message({
|
|
|
type: "info",
|
|
|
message: "已取消接收",
|
|
|
- duration: 1500,
|
|
|
+ duration: 1500
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
@@ -501,29 +518,31 @@ export default {
|
|
|
// 填报记录详情接口
|
|
|
this.$axios({
|
|
|
method: "POST",
|
|
|
- url: "/api/api_gateway?method=control_center.task.trap_pest_record_info",
|
|
|
+ url:
|
|
|
+ "/api/api_gateway?method=control_center.task.trap_pest_record_info",
|
|
|
data: this.qs.stringify({
|
|
|
- trap_record_id: data.id, // 任务id
|
|
|
- }),
|
|
|
+ trap_record_id: data.id // 任务id
|
|
|
+ })
|
|
|
})
|
|
|
- .then((res) => {
|
|
|
- var data = res.data.data;
|
|
|
- var list = [];
|
|
|
- var arr = []
|
|
|
- data.forEach((item, index) => {
|
|
|
- var obj = {};
|
|
|
- obj["value"] = item.id;
|
|
|
- obj["label"] = item.pest_name;
|
|
|
- obj["num"] = item.pest_number;
|
|
|
- obj["ind"] = index;
|
|
|
- list.push(obj);
|
|
|
- arr.push(item.id)
|
|
|
- });
|
|
|
- this.fillList = list;
|
|
|
- this.models = arr
|
|
|
- this.dialogVisible = true;
|
|
|
+ .then(res => {
|
|
|
+ var data = res.data.data;
|
|
|
+ var list = [];
|
|
|
+ var arr = [];
|
|
|
+ data.forEach((item, index) => {
|
|
|
+ var obj = {};
|
|
|
+ obj["value"] = item.id;
|
|
|
+ obj["label"] = item.pest_name;
|
|
|
+ obj["num"] = item.pest_number;
|
|
|
+ obj["ind"] = index;
|
|
|
+ list.push(obj);
|
|
|
+ arr.push(item.id);
|
|
|
+ });
|
|
|
+ this.fillList = list;
|
|
|
+ this.spareData = list; // 备用数据
|
|
|
+ this.models = arr;
|
|
|
+ this.dialogVisible = true;
|
|
|
})
|
|
|
- .catch((err) => {
|
|
|
+ .catch(err => {
|
|
|
console.log(err);
|
|
|
});
|
|
|
},
|
|
|
@@ -531,23 +550,22 @@ export default {
|
|
|
// 添加有害生物
|
|
|
addInsect() {
|
|
|
if (this.insectVal !== "" && this.numVal !== "") {
|
|
|
-
|
|
|
- var array = []
|
|
|
+ var array = [];
|
|
|
for (var i = 0; i < this.fillList.length; i++) {
|
|
|
- var obj = {}
|
|
|
- obj['pest_name'] = this.fillList[i].label
|
|
|
- obj['pest_number'] = this.fillList[i].num
|
|
|
- array.push(obj)
|
|
|
+ var obj = {};
|
|
|
+ obj["pest_name"] = this.fillList[i].label;
|
|
|
+ obj["pest_number"] = this.fillList[i].num;
|
|
|
+ array.push(obj);
|
|
|
}
|
|
|
var obj1 = {};
|
|
|
obj1["pest_name"] = this.insectVal;
|
|
|
obj1["pest_number"] = Number(this.numVal);
|
|
|
- array = [...array, obj1]
|
|
|
+ array = [...array, obj1];
|
|
|
|
|
|
this.$confirm("此操作将新增有害生物, 是否继续?", "提示", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
- type: "warning",
|
|
|
+ type: "warning"
|
|
|
})
|
|
|
.then(() => {
|
|
|
this.$axios({
|
|
|
@@ -555,22 +573,22 @@ export default {
|
|
|
url: "/api/api_gateway?method=control_center.task.discern_add",
|
|
|
data: this.qs.stringify({
|
|
|
record_id: this.examineObj.id, // 任务id
|
|
|
- pest_list: JSON.stringify(array), // 害虫数组
|
|
|
- }),
|
|
|
+ pest_list: JSON.stringify(array) // 害虫数组
|
|
|
+ })
|
|
|
})
|
|
|
- .then((res) => {
|
|
|
+ .then(res => {
|
|
|
if (res.data.message == "") {
|
|
|
this.$message({
|
|
|
type: "success",
|
|
|
message: "添加成功!",
|
|
|
- duration: 1500,
|
|
|
+ duration: 1500
|
|
|
});
|
|
|
this.examine(this.examineObj);
|
|
|
}
|
|
|
this.insectVal = "";
|
|
|
this.numVal = "";
|
|
|
})
|
|
|
- .catch((err) => {
|
|
|
+ .catch(err => {
|
|
|
console.log(err);
|
|
|
});
|
|
|
})
|
|
|
@@ -578,124 +596,131 @@ export default {
|
|
|
this.$message({
|
|
|
type: "info",
|
|
|
message: "已取消添加",
|
|
|
- duration: 1500,
|
|
|
+ duration: 1500
|
|
|
});
|
|
|
});
|
|
|
} else {
|
|
|
this.$message({
|
|
|
type: "info",
|
|
|
message: "请将信息填写完整!",
|
|
|
- duration: 1500,
|
|
|
+ duration: 1500
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
|
|
|
// 删除有害生物
|
|
|
delInsect(data) {
|
|
|
- this.$confirm('此操作将永久删除该有害生物, 是否继续?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- this.loading1 = true
|
|
|
- var list = this.fillList
|
|
|
- list.splice(data.ind, 1)
|
|
|
- var arr = []
|
|
|
- list.forEach((item) => {
|
|
|
- var obj = {}
|
|
|
- obj['pest_name'] = item.label
|
|
|
- obj['pest_number'] = item.num
|
|
|
- arr.push(obj)
|
|
|
- })
|
|
|
+ this.$confirm("此操作将永久删除该有害生物, 是否继续?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.loading1 = true;
|
|
|
+ var list = this.fillList;
|
|
|
+ list.splice(data.ind, 1);
|
|
|
+ var arr = [];
|
|
|
+ list.forEach(item => {
|
|
|
+ var obj = {};
|
|
|
+ obj["pest_name"] = item.label;
|
|
|
+ obj["pest_number"] = item.num;
|
|
|
+ arr.push(obj);
|
|
|
+ });
|
|
|
this.$axios({
|
|
|
method: "POST",
|
|
|
url: "/api/api_gateway?method=control_center.task.discern_add",
|
|
|
data: this.qs.stringify({
|
|
|
record_id: this.examineObj.id, // 任务id
|
|
|
- pest_list: JSON.stringify(arr), // 害虫数组
|
|
|
+ pest_list: JSON.stringify(arr) // 害虫数组
|
|
|
})
|
|
|
- }).then((res) => {
|
|
|
- if (res.data.message == "") {
|
|
|
- this.$message({
|
|
|
- type: "success",
|
|
|
- message: "删除成功!",
|
|
|
- duration: 1500,
|
|
|
- });
|
|
|
- this.examine(this.examineObj);
|
|
|
- }
|
|
|
- this.loading1 = false
|
|
|
- }).catch((err) => {
|
|
|
- this.loading1 = false
|
|
|
})
|
|
|
- }).catch(() => {
|
|
|
+ .then(res => {
|
|
|
+ if (res.data.message == "") {
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "删除成功!",
|
|
|
+ duration: 1500
|
|
|
+ });
|
|
|
+ this.examine(this.examineObj);
|
|
|
+ }
|
|
|
+ this.loading1 = false;
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ this.loading1 = false;
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
this.$message({
|
|
|
- type: 'info',
|
|
|
- message: '已取消删除',
|
|
|
- duration: 1500,
|
|
|
- });
|
|
|
+ type: "info",
|
|
|
+ message: "已取消删除",
|
|
|
+ duration: 1500
|
|
|
+ });
|
|
|
});
|
|
|
},
|
|
|
|
|
|
// 编辑有害生物
|
|
|
compileInsect(e, data, index) {
|
|
|
- // this.loading1 = true
|
|
|
- var list = this.fillList
|
|
|
- var newList = []
|
|
|
- // 下拉框数据改变处理
|
|
|
- for (var i = 0; i < list.length; i++) {
|
|
|
- var obj = {}
|
|
|
- if (e == list[i].value) {
|
|
|
- obj['pest_name'] = list[i].label
|
|
|
- obj['pest_number'] = data.num
|
|
|
- newList.push(obj)
|
|
|
- }
|
|
|
- }
|
|
|
- // 修改数据为可发送到后端接口数据
|
|
|
- var arr = []
|
|
|
- list.forEach((item) => {
|
|
|
- var obj = {}
|
|
|
- obj['pest_name'] = item.label
|
|
|
- obj['pest_number'] = item.num
|
|
|
- arr.push(obj)
|
|
|
+ this.$confirm("此操作将编辑该有害生物, 是否继续?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
})
|
|
|
- arr.splice(index, 1, ...newList)
|
|
|
- this.$confirm('此操作将编辑该有害生物, 是否继续?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- // this.$axios({
|
|
|
- // method: "POST",
|
|
|
- // url: "/api/api_gateway?method=control_center.task.discern_add",
|
|
|
- // data: this.qs.stringify({
|
|
|
- // record_id: this.examineObj.id, // 任务id
|
|
|
- // pest_list: JSON.stringify(arr), // 害虫数组
|
|
|
- // }),
|
|
|
- // })
|
|
|
- // .then((res) => {
|
|
|
- // if (res.data.message == "") {
|
|
|
- // this.$message({
|
|
|
- // type: "success",
|
|
|
- // message: "编辑成功!",
|
|
|
- // duration: 1500,
|
|
|
- // });
|
|
|
- // this.examine(this.examineObj);
|
|
|
- // }
|
|
|
- // this.insectVal = "";
|
|
|
- // this.numVal = "";
|
|
|
- // })
|
|
|
- // .catch((err) => {
|
|
|
- // console.log(err);
|
|
|
- // });
|
|
|
- }).catch(() => {
|
|
|
- this.$set(this.fillList, index, data)
|
|
|
- console.log(this.fillList)
|
|
|
+ .then(() => {
|
|
|
+ this.$set(this.models, index, e);
|
|
|
+ var list = this.spareData;
|
|
|
+ var newList = [];
|
|
|
+ // 下拉框数据改变处理
|
|
|
+ for (var i = 0; i < list.length; i++) {
|
|
|
+ var obj = {};
|
|
|
+ if (e == list[i].value) {
|
|
|
+ obj["pest_name"] = list[i].label;
|
|
|
+ obj["pest_number"] = data.num;
|
|
|
+ newList.push(obj);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 修改数据为可发送到后端接口数据
|
|
|
+ var arr = [];
|
|
|
+ var list = this.fillList;
|
|
|
+ list.forEach(item => {
|
|
|
+ var obj = {};
|
|
|
+ obj["pest_name"] = item.label;
|
|
|
+ obj["pest_number"] = item.num;
|
|
|
+ arr.push(obj);
|
|
|
+ });
|
|
|
+ arr.splice(index, 1, ...newList);
|
|
|
+ this.$axios({
|
|
|
+ method: "POST",
|
|
|
+ url: "/api/api_gateway?method=control_center.task.discern_add",
|
|
|
+ data: this.qs.stringify({
|
|
|
+ record_id: this.examineObj.id, // 任务id
|
|
|
+ pest_list: JSON.stringify(arr) // 害虫数组
|
|
|
+ })
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ if (res.data.message == "") {
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "编辑成功!",
|
|
|
+ duration: 1500
|
|
|
+ });
|
|
|
+ this.examine(this.examineObj);
|
|
|
+ }
|
|
|
+ this.insectVal = "";
|
|
|
+ this.numVal = "";
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.log(err);
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.loading1 = false;
|
|
|
+ this.$set(this.models, index, this.fillList[index].value);
|
|
|
this.$message({
|
|
|
- type: 'info',
|
|
|
- message: '已取消编辑'
|
|
|
- });
|
|
|
+ type: "info",
|
|
|
+ message: "已取消编辑"
|
|
|
+ });
|
|
|
});
|
|
|
- },
|
|
|
+ }
|
|
|
},
|
|
|
//生命周期 - 创建完成(可以访问当前this实例)
|
|
|
created() {},
|
|
|
@@ -712,10 +737,10 @@ export default {
|
|
|
updated() {}, //生命周期 - 更新之后
|
|
|
beforeDestroy() {}, //生命周期 - 销毁之前
|
|
|
destroyed() {}, //生命周期 - 销毁完成
|
|
|
- activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
|
|
|
+ activated() {} //如果页面有keep-alive缓存功能,这个函数会触发
|
|
|
};
|
|
|
</script>
|
|
|
-<style lang='less' scoped>
|
|
|
+<style lang="less" scoped>
|
|
|
.laboratory_box {
|
|
|
// 搜索
|
|
|
.search_box {
|
|
|
@@ -783,4 +808,4 @@ export default {
|
|
|
overflow-y: auto;
|
|
|
}
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|