智慧农业后台管理页面
guoshilong
2022-09-27 afa8ee521affdce4f4cac9ba32ede9d22b76a13e
src/views/task/task.vue
@@ -72,6 +72,14 @@
export default {
  data() {
    const validateNum = (rule, value, callback) => {
      if (!/^[1-9]\d*$/.test(value)) {
        callback(new Error("请输入正整数"));
      } else {
        callback();
      }
    };
    return {
      form: {},
      query: {},
@@ -165,10 +173,10 @@
            // dicUrl: `/api/soldr/soldr/selectSol`,
            props: {
              label: "spn",
              value: "stockId1"
              value: "id"
            },
            change: function (value) {
              console.log(value.value)
              // console.log(value.value)
            }
          },
          {
@@ -179,6 +187,11 @@
            type: "number",
            // labelWidth: 110,
            display: false,
            rules:[{
              require:false,
              trigger: "blur",
              validator: validateNum
            }]
          },
          {
            label: "拍照照片",
@@ -274,6 +287,7 @@
        viewBtn: true,
        selection: true,
        dialogClickModal: false,
        emptyBtn:false,
        column: [
          {
            label: "任务名称",
@@ -338,10 +352,10 @@
            dicUrl: `/api/soldr/soldr/selectSol`,
            props: {
              label: "spn",
              value: "stockId1"
              value: "id"
            },
            change: function (value) {
              console.log(value.value)
              // console.log(value.value)
            }
          },
          {
@@ -482,7 +496,7 @@
              value: "stock_id1"
            },
            change: function (value) {
              console.log(value.value)
              // console.log(value.value)
            }
          },
          {
@@ -497,6 +511,7 @@
          {
            label: "拍照照片",
            prop: "type",
            value:"1",
            span: 6,
            disabled: true,
            type: "switch",
@@ -595,9 +610,16 @@
    }
  },
  methods: {
    //入库
    //处理
    submitR(row, done, loading) {
      var that = this;
      if(row.type == "0"){
        if(row.tp == ""){
          that.$message.warning("请上传照片")
          done()
          return
        }
      }
      updatechuli(row).then(
        () => {
          that.onLoad(this.page);
@@ -647,8 +669,10 @@
      getLandList(this.$farmId).then((res) => {
        if (res.data.code == 200) {
          var landIdcolumn = that.findObject(that.option.column, "landId");
          var landIdColumnChuli = that.findObject(that.optionchuli.column,"landId")
          that.landList = res.data.data;
          landIdcolumn.dicData = res.data.data;
          landIdColumnChuli.dicData = res.data.data
        }
      })
    },
@@ -679,6 +703,14 @@
      });
    },
    rowUpdate(row, index, done, loading) {
      if(row.stockNum<0){
        this.$message({
          type: "warning",
          message: "农资量不能为负数!"
        });
        done();
        return
      }
      update(row).then(() => {
        this.onLoad(this.page);
        this.$message({