liuyg
2022-02-25 664e5fe392dc063734a2e4a370c833ca9cdf53fb
src/views/activitys/real.vue
@@ -27,7 +27,6 @@
      <!-- @row-click="rowClick" -->
      <template slot="menuLeft">
        <el-button
          v-show="true"
          size="mini"
          icon="el-icon-delete"
@@ -188,7 +187,7 @@
        dialogClickModal: false,
        column: [
          {
            label: "任务标题",
            label: "巡查标题",
            prop: "rname",
            search: true,
            searchSpan: 4,
@@ -203,7 +202,7 @@
          },
          {
            label: "下发时间",
            label: "开始时间",
            type: "datetime",
            prop: "time",
            width: 160,
@@ -219,7 +218,7 @@
            ],
          },
          {
            label: "任务封面",
            label: "封面",
            prop: "url",
            // align:'center',
            width: 80,
@@ -256,7 +255,7 @@
          //   ],
          // },
          {
            label: "任务内容",
            label: "巡查内容",
            prop: "content",
            span: 24,
          },
@@ -317,89 +316,114 @@
            dicUrl: "/api/jurisdiction/lazy-tree",
            props: {
              label: "title",
              value: "id"
              value: "id",
            },
            checkStrictly: true,
            rules: [
              {
                required: true,
                message: "请选择所属辖区",
                trigger: "click"
              }
            ]
                trigger: "click",
              },
            ],
          },
          // {
          //   label: "省份",
          //   hide: true,
          //   prop: "province",
          //   // search: true,
          //   width: 100,
          //   searchSpan: 2,
          //   searchLabelWidth: 45,
          //   placeholder: "省份",
          //   type: "select",
          //   value: "36",
          //   props: {
          //     label: "name",
          //     value: "code",
          //   },
          //   cascaderItem: ["city", "district"],
          //   dicUrl: "/api/blade-system/region/select",
          //   span: 6,
          //   className: "cityreal1",
          //   addDisplay: true,
          //   editDisplay: true,
          //   viewDisplay: true,
          // },
          // {
          //   label: "地市",
          //   hide: true,
          //   prop: "city",
          //   type: "select",
          //   width: 100,
          //   searchPlaceholder: "地市",
          //   placeholder: "地市",
          //   searchLabelWidth: 1,
          //   value: "3601",
          //   searchSpan: 2,
          //   // search: true,
          //   props: {
          //     label: "name",
          //     value: "code",
          //   },
          //   dicUrl: "/api/blade-system/region/select?code={{key}}",
          //   span: 3,
          //   labelWidth: "0",
          //   className: "cityreal2",
          //   addDisplay: true,
          //   editDisplay: true,
          //   viewDisplay: true,
          // },
          // {
          //   label: "区县",
          //   hide: true,
          //   searchSpan: 2,
          //   searchLabelWidth: 1,
          //   width: 100,
          //   searchPlaceholder: "区县",
          //   placeholder: "区县",
          //   // search: true,
          //   prop: "district",
          //   type: "select",
          //   props: {
          //     label: "name",
          //     value: "code",
          //   },
          //   dicUrl: "/api/blade-system/region/select?code={{key}}",
          //   span: 3,
          //   labelWidth: "0",
          //   className: "cityreal3",
          //   addDisplay: true,
          //   editDisplay: true,
          //   viewDisplay: true,
          // },
          {
            label: "集合点",
            prop: "gathername",
            labelWidth: 100,
            span: 9,
            overHidden: true,
            rules: [
              {
                required: true,
                message: "请选择地址",
                trigger: "blur",
              },
            ],
          },
          {
            label: "省份",
            label: null,
            prop: "map",
            labelWidth: 10,
            searchSpan: 0,
            // maxlength: 5,
            hide: true,
            prop: "province",
            // search: true,
            width: 100,
            searchSpan: 2,
            searchLabelWidth: 45,
            placeholder: "省份",
            type: "select",
            value: "36",
            props: {
              label: "name",
              value: "code",
            },
            cascaderItem: ["city", "district"],
            dicUrl: "/api/blade-system/region/select",
            span: 6,
            className: "cityreal1",
            addDisplay: true,
            editDisplay: true,
            viewDisplay: true,
            span: 2,
            // display:false,
            component: "AvueMap",
          },
          {
            label: "地市",
            hide: true,
            prop: "city",
            type: "select",
            width: 100,
            searchPlaceholder: "地市",
            placeholder: "地市",
            searchLabelWidth: 1,
            value: "3601",
            searchSpan: 2,
            // search: true,
            props: {
              label: "name",
              value: "code",
            },
            dicUrl: "/api/blade-system/region/select?code={{key}}",
            span: 3,
            labelWidth: "0",
            className: "cityreal2",
            addDisplay: true,
            editDisplay: true,
            viewDisplay: true,
          },
          {
            label: "区县",
            hide: true,
            searchSpan: 2,
            searchLabelWidth: 1,
            width: 100,
            searchPlaceholder: "区县",
            placeholder: "区县",
            // search: true,
            prop: "district",
            type: "select",
            props: {
              label: "name",
              value: "code",
            },
            dicUrl: "/api/blade-system/region/select?code={{key}}",
            span: 3,
            labelWidth: "0",
            className: "cityreal3",
            addDisplay: true,
            editDisplay: true,
            viewDisplay: true,
          },
          {
            label: "任务状态",
            label: "巡查状态",
            prop: "rtype",
            type: "select",
            value: "2",
@@ -448,6 +472,21 @@
          //   addDisplay: false,
          //   editDisplay: false,
          // },
          {
            label: "发布人",
            prop: "fname",
            // multiple: true,
            // dicUrl: "/api/catalogs/catalogs/getBigTree",
            // props: {
            //   label: "title",
            // },
            width: 72,
            // hide: true,
            // leafOnly: "",
            addDisplay: false,
            editDisplay: false,
            viewDisplay: false,
          },
          {
            label: "积分数值",
            prop: "integral",
@@ -498,7 +537,7 @@
          // },
          {
            label: "请在下方地图中,建立路径!",
            labelWidth: "0",
            labelWidth: 0,
            className: "mapClass",
            prop: "haveMap",
            hide: true,
@@ -563,15 +602,17 @@
          this.form.wd = val.latitude;
          this.form.jd = val.longitude;
          this.form.gather = val.latitude + "," + val.longitude;
          var address = val.formattedAddress.toString();
          if (address.search("县") != -1) {
            this.form.place = address.substring(
            this.form.gathername = address.substring(
              address.indexOf("县") + 1,
              address.length
            );
          }
          if (address.search("区") != -1) {
            this.form.place = address.substring(
            this.form.gathername = address.substring(
              address.indexOf("区") + 1,
              address.length
            );
@@ -672,9 +713,13 @@
  methods: {
    rowSave(row, done, loading) {
      // console.log(row);
      // console.log(this.userInfo);
      // return;
      var userId1 = this.userInfo.user_id;
      var username = this.userInfo.nick_name;
      var phone = this.userInfo.phone;
      let latleng = row.map.latitude + "," + row.map.longitude;
      let d = {
        line: row.line, //路线
        rname: row.rname, //标题
@@ -688,8 +733,14 @@
        content: row.content, //内容
        rtype: row.rtype, //任务状态
        fid: userId1,//发起人id
        serid: userId1, //发起人id
        fname: username, //发起人id
        jurisdiction: row.jurisdiction
        captain: username, //队长
        phone: phone, //发起人电话
        jurisdiction: row.jurisdiction,
        gather: row.gather, //地址经纬度
        gathername: row.map.formattedAddress, //地址经纬度
        tasktype: "0", //任务类型0:治安巡查 1:治安义务宣传 2:治安防范培训
      };
      // console.log(d);
      // done();
@@ -716,14 +767,12 @@
        setTimeout(function () {
          try {
            that.$refs.modalForm.addLinesDraw(val);
          } catch (error) {
          }
          } catch (error) {}
        }, 1500);
      } else {
        try {
          that.$refs.modalForm.addLinesDraw(val);
        } catch (error) {
        }
        } catch (error) {}
      }
    },
    rowUpdate(row, index, done, loading) {
@@ -835,6 +884,7 @@
      this.onLoad(this.page, this.query);
    },
    onLoad(page, params = {}) {
      params["tasktype"] = "0"; // 治安巡查
      getList(page.currentPage, page.pageSize,params).then((res) => {
        const data = res.data.data;
        this.page.total = data.total;