yangys
2025-10-08 288369dd7487adc61fe45f24d6d141152f5492df
src/views/tasks/machinebacktask.vue
@@ -16,17 +16,9 @@
      @selection-change="selectionChange"
      @on-load="onLoad"
    >
      <template #menu-left>
        <!-- el-button type="primary" size="default" icon="el-icon-circle-plus" plain @click="handleExport">导出</el-button>
        <el-button type="primary" v-if="this.search.dirType!='REC'" :disabled="this.selection.length==0" size="default" icon="el-icon-circle-plus" plain @click="receiveBtn">接收已选</el-button>
-->
      </template>
      <!--
      <template #menu="scope">
        <el-button type="primary" v-if="scope.row.dirType==='TEMP'" text size="default" icon="el-icon-document-delete" @click.stop="rejectBtn(scope.row, scope.index)">拒绝</el-button>
        <el-button type="primary" v-if="scope.row.dirType==='TEMP'" text size="default" icon="el-icon-document-add" @click.stop="acceptBtn(scope.row, scope.index)">接收</el-button>
          <el-button type="primary" v-if="scope.row.status==1" text size="default" icon="el-icon-delete" @click.stop="handleDel(scope.row)">删除</el-button>
      </template>
      -->
    </avue-crud>
  </basic-container>
</template>
@@ -67,7 +59,7 @@
        emptyBtn: false,
        searchLabelWidth: "80",
        searchSpan: 4,
        menu:false,
        menu:true,
        width:'100%',
        column: [
          {
@@ -143,55 +135,28 @@
      this.selection = selection;
    },
    receiveAll() {
      //接收符合条件的所有数据
      this.$confirm('确定要接收符合条件的所有文件吗?', {  //同接收接口相同
        confirmButtonText: '是',
        cancelButtonText: '否',
        type: 'warning',
      }).then(() => {
        //调用接口
        this.loading = true;
        axios({
          url: '/blade-mdm/machinefile/file/temp-accept-all',
          method: 'post',
          params: {}
        }).then(
          res => {
            this.loading = false;
            this.onLoad();
          }
        );
      })
    handleDel(row) {
      this.loading = true;
      axios({
        url: '/blade-mdm/gkw/machinebacktask/remove',
        method: 'post',
        params: {ids: row.id},
      }).then(
        res => {
          this.loading = false;
          this.$message({
            type: 'success',
            message: '操作成功!',
          });
          this.onLoad();
          done();
        },
        error => {
          this.loading = false;
        }
      );
    },
    receiveBtn() {
      if(this.selection.length == 0) {
        ElMessage({message: '请选择数据',type: 'error'})
      }
      var ids = [];
      this.selection.forEach(item=> {
        ids.push(item.id);
      })
      this.$confirm('确定要接收吗?', {  //同接收接口相同
        confirmButtonText: '是',
        cancelButtonText: '否',
        type: 'warning',
      }).then(() => {
        //调用接口
        this.loading = true;
        axios({
          url: '/blade-mdm/machinefile/collect/temp-accept',
          method: 'post',
          params: {ids: ids.join(',')},
        }).then(
          res => {
            this.loading = false;
            this.onLoad();
          }
        );
      })
    },
    
    searchReset() {
      //this.onLoad(this.mypage);