|
@@ -247,103 +247,12 @@
|
|
|
console.log(`当前页: ${val}`);
|
|
|
this.gettaskList()
|
|
|
},
|
|
|
-
|
|
|
- // 废止任务
|
|
|
- async repeal() {
|
|
|
- // 判断任务是否为该创建者创建
|
|
|
- for (let i = 0; i < this.multipleSelection.length; i++) {
|
|
|
- if (rymc != this.multipleSelection[i].releaser) {
|
|
|
- this.$alert('任务仅创建者可以废止!', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- callback: action => {}
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- var that = this;
|
|
|
- let canPub = 0
|
|
|
- const length = this.multipleSelection.length;
|
|
|
- // var val = this.selectedData;
|
|
|
- this.pubarr = this.multipleSelection;
|
|
|
- for (let i = 0; i < length; i++) {
|
|
|
- if (this.pubarr[i].ispublic == '1') {
|
|
|
- this.pubarr[i].ispublic = 2
|
|
|
- canPub = 1
|
|
|
- } else {
|
|
|
- this.$alert('任务不在可废止状态!', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- callback: action => {
|
|
|
-
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- if(canPub==1){
|
|
|
- const result = await this.$http.post('isPublicTask', {
|
|
|
- pubarr: that.pubarr,
|
|
|
- token: token
|
|
|
- })
|
|
|
- if (result.data.code == 0) {
|
|
|
- this.$message({
|
|
|
- type: 'success',
|
|
|
- message: '任务已废止!'
|
|
|
- });
|
|
|
- that.gettaskList()
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
// 批量选中
|
|
|
handleSelectionChange(val) {
|
|
|
this.multipleSelection = val;
|
|
|
console.log(this.multipleSelection)
|
|
|
},
|
|
|
|
|
|
- // 批量删除
|
|
|
- handleSelectionChange(val) {
|
|
|
- this.multipleSelection = val;
|
|
|
- // console.log(this.multipleSelection)
|
|
|
- },
|
|
|
- // 删除任务
|
|
|
- async delArray() {
|
|
|
- // 判断任务是否为该创建者创建
|
|
|
- for (let i = 0; i < this.multipleSelection.length; i++) {
|
|
|
- if (rymc != this.multipleSelection[i].releaser) {
|
|
|
- this.$alert('任务仅创建者可以删除!', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- callback: action => {
|
|
|
-
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- var that = this;
|
|
|
- const length = this.multipleSelection.length;
|
|
|
- // var val = this.selectedData;
|
|
|
- for (let i = 0; i < length; i++) {
|
|
|
- // console.log(this.multipleSelection[i])
|
|
|
- this.delarr.push(this.multipleSelection[i].id);
|
|
|
- }
|
|
|
- const result = await this.$http.post('delTask', {
|
|
|
- delarr: that.delarr,
|
|
|
- token: token
|
|
|
- })
|
|
|
- if (result.data.code == 0) {
|
|
|
- this.$message({
|
|
|
- type: 'success',
|
|
|
- message: '删除成功!'
|
|
|
- });
|
|
|
- that.gettaskList()
|
|
|
- } else {
|
|
|
- this.$message({
|
|
|
- type: 'error',
|
|
|
- message: '删除失败!'
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- this.$refs.multipleTable.clearSelection();
|
|
|
- },
|
|
|
// 获取任务列表
|
|
|
async gettaskList() {
|
|
|
console.log(this.queryInfo)
|
|
@@ -361,6 +270,16 @@
|
|
|
this.total = res.data.total
|
|
|
},
|
|
|
|
|
|
+ // 获取分页数据
|
|
|
+ async choseModel() {
|
|
|
+ const result = await this.$http.post('getPesticidesList', this.queryInfo)
|
|
|
+ // 判断业务逻辑
|
|
|
+ if (result.data.code == 0) {
|
|
|
+ this.pesticidesList = result.data.data.rows
|
|
|
+ this.total = result.data.data.total
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
runtask(id) {
|
|
|
console.log(id)
|
|
|
this.$router.push({
|