智慧农业后台管理页面
guoshilong
2022-08-15 682bd4d3b940f2950efbfbb853d5ee29d8010bf2
src/views/task/task.vue
@@ -27,10 +27,11 @@
                   @click="handleDelete">删 除
        </el-button>
      </template>
      <template slot-scope="{ type, size, row }" slot="menu">
      <template slot-scope="{ type, size, row}" slot="menu">
        <el-button
          icon="el-icon-circle-plus-outline"
          @click="chuli(row)"
          v-show="row.status"
          :size="size"
          :type="type"
        >处理
@@ -96,6 +97,10 @@
        selection: true,
        dialogClickModal: false,
        gradeBoxVisible: false,
        disabled:false,
        refreshBtn:false,
        columnBtn:false,
        searchShowBtn:false,
        column: [
          {
            label: "任务名称",
@@ -548,7 +553,7 @@
    this.initData();
  },
  computed: {
    ...mapGetters(["permission", "userInfo"]),
    ...mapGetters(["permission", "userInfo","$farmId"]),
    permissionList() {
      return {
        addBtn: this.vaildData(this.permission.task_add, false),
@@ -578,6 +583,20 @@
      },
      immediate: true,
    },
      '$farmId':{
      handler (newName, oldName) {
          //获取农地数据
          getLandList(this.$farmId).then((res) => {
              if (res.data.code == 200) {
                  var landIdcolumn = this.findObject(this.option.column, "landId")
                  this.landList = res.data.data
                  landIdcolumn.dicData = res.data.data
              }
          })
          this.query={}
          this.onLoad(this.page)
      }
    }
  },
  methods: {
    //入库
@@ -625,7 +644,7 @@
    initData() {
      var that = this;
      //获取农地数据
      getLandList(this.userInfo.dept_id).then((res) => {
      getLandList(this.$farmId).then((res) => {
        if (res.data.code == 200) {
          var landIdcolumn = that.findObject(that.option.column, "landId");
          that.landList = res.data.data;
@@ -706,6 +725,9 @@
        getDetail(this.form.id).then(res => {
          this.form = res.data.data;
        });
        if(type=="edit"){
          this.form.status==0?this.option.disabled=true:this.option.disabled=false
        }
      }
      done();
    },
@@ -737,6 +759,7 @@
    },
    onLoad(page, params = {}) {
      this.loading = true;
      params["farmId"] = this.$farmId
      getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
        const data = res.data.data;
        this.page.total = data.total;