shuishen
2024-04-18 4522ab3fe8bd45ee753ef187448c1e884bbc601f
src/views/cGovernance/taskECall.vue
@@ -2,21 +2,39 @@
<template>
    <basic-container>
        <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" @row-del="rowDel"
            v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave"
            :before-open="beforeOpen" @search-change="searchChange" @search-reset="searchReset"
            @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
            @refresh-change="refreshChange" @on-load="onLoad">
      v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave" :before-open="beforeOpen"
      @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange"
      @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
            <template slot="menuLeft">
                <el-button size="small" icon="el-icon-delete" plain v-if="permission.article_delete" @click="handleDelete">删
                    除
                </el-button>
            </template>
      <template slot="menu" slot-scope="{row, size, index}">
        <el-button size="small" type="text" icon="el-icon-share" plain @click="share(row)">分享
        </el-button>
      </template>
            <template slot-scope="{row, size}" slot="phone">
                <el-button :size="size" type="text" @click="showStringDispose(row, 'phoneflag')"
                    v-text="textDispose(row, 'phoneflag', 'phone')">
                </el-button>
            </template>
        </avue-crud>
    <el-dialog title="分享" append-to-body :visible.sync="sharePopup" center @close="popupClose">
      <div style="display: flex; justify-content: center; ">
        <el-radio-group v-model="circleRadio">
          <el-radio :label="0">邻里圈</el-radio>
          <el-radio :label="1">协同圈</el-radio>
        </el-radio-group>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="sharePopup = false">取 消</el-button>
        <el-button type="primary" @click="shareCircle()">确 定</el-button>
      </span>
    </el-dialog>
    </basic-container>
</template>
@@ -28,6 +46,9 @@
    add,
    getECallEvent
} from "@/api/task/eCall"
  import {
    add as circleAdd,
  } from "@/api/circle/circle"
import {
    getList as getHouseList,
    getDetatil as getHouseDetail
@@ -63,12 +84,15 @@
            },
            datetime: "",
            selectionList: [],
        sharePopup: false,
        circleRadio: 0,
        shareCircleRow: {},
            option: {
                labelWidth: 96,
                searchLabelWidth: 96,
          // searchLabelWidth: 96,
                searchShow: true,
                searchMenuSpan: 3,
                menuWidth: 210,
          menuWidth: 310,
                height: "auto",
                calcHeight: 54,
@@ -145,13 +169,11 @@
                        label: "name",
                        value: "id",
                    },
                    rules: [
                        {
              rules: [{
                            required: true,
                            message: "请选择所属社区",
                            trigger: "blur",
                        },
                    ],
              }, ],
                },
                {
@@ -192,7 +214,8 @@
                    {
                        validator: validatorPhone,
                        trigger: 'blur'
                    }],
                }
              ],
                    slot: true
                },
                {
@@ -507,6 +530,41 @@
            this.selectionList = []
            this.$refs.crud.toggleSelection()
        },
      share(row) {
        console.table(row)
        this.shareCircleRow = row
        this.sharePopup = true
      },
      // 分享圈子
      shareCircle() {
        this.sharePopup = false
        let param = {}
        param.circleType = this.circleRadio
        param.houseCode = this.shareCircleRow.addressCode
        param.circleImages = this.shareCircleRow.imageUrls
        param.communityCode = this.shareCircleRow.communityCode
        param.circleText = this.shareCircleRow.remark
        param.evenType = 2
        param.eventId = this.shareCircleRow.id
        circleAdd(param).then(
          () => {
            this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!",
            })
            done()
          },
          (error) => {
            window.console.log(error)
            loading()
          }
        )
      },
      popupClose() {
        this.sharePopup = false
      },
        handleDelete () {
            if (this.selectionList.length === 0) {
                this.$message.warning("请选择至少一条数据")