<template>
  <div class="app-container">
    <el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" label-width="68px">
      <el-form-item label="任务名称" prop="summaryTaskName">
        <el-input
          v-model="queryParams.summaryTaskName"
          clearable
          placeholder="请输入任务名称"
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="填写对象" prop="fillObjects">
        <el-select v-model="queryParams.fillObjects" clearable collapse-tags multiple placeholder="请选择填写对象"
                   size="mini">
          <el-option
            v-for="item in summaryTaskOptions"
            :key="item.dictValue"
            :label="item.dictLabel"
            :value="item.dictValue">
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="生效时间" prop="datetimerange">
        <el-date-picker
          v-model="datetimerange"
          align="left"
          end-placeholder="结束日期"
          range-separator="至"
          start-placeholder="开始日期"
          style="width: 240px"
          type="daterange"
          size="mini"
          value-format="yyyy-MM-dd">
        </el-date-picker>
      </el-form-item>
      <el-form-item>
        <el-button icon="el-icon-search" size="mini" type="primary" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          v-hasPermi="['sfa:summaryTask:add']"
          icon="el-icon-plus"
          plain
          size="mini"
          type="primary"
          @click="handleAdd"
        >新增
        </el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="summaryTaskList">
      <el-table-column align="center" label="任务名称" prop="summaryTaskName"/>
      <el-table-column :show-overflow-tooltip="true" align="center" label="填写对象" prop="fillObject">
        <template slot-scope="scope">
          <span>{{ fillObjectFormat(scope.row, scope.column) }}</span>
          <!--          <dict-tag :options="dict.type.summary_task_type" :value="scope.row.fillObject" />-->
        </template>
      </el-table-column>
      <el-table-column align="center" label="开始时间" prop="startTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.startTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
        </template>
      </el-table-column>
      <el-table-column align="center" label="结束时间" prop="stopTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.stopTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
        </template>
      </el-table-column>
      <el-table-column align="center" label="是否发布" prop="status">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.sfa_publish_type" :value="scope.row.status"/>
        </template>
      </el-table-column>
      <el-table-column align="center" class-name="small-padding fixed-width" label="操作">
        <template slot-scope="scope">
          <el-button
            v-hasPermi="['sfa:summaryTask:edit']"
            icon="el-icon-edit"
            size="mini"
            type="text"
            @click="handleUpdate(scope.row)"
          >修改
          </el-button>
          <el-button
            v-if="scope.row.status==0"
            v-hasPermi="['platform:article:edit']"
            icon="el-icon-check"
            size="mini"
            type="text"
            @click="handleRelease(scope.row)"
          >发布
          </el-button>
          <el-button
            v-hasPermi="['sfa:summaryTask:remove']"
            class="text-danger"
            icon="el-icon-delete"
            size="mini"
            type="text"
            @click="handleDelete(scope.row)"
          >删除
          </el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-view"
            @click="previewFn(scope.row)"
          >预览</el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :limit.sync="queryParams.pageSize"
      :page.sync="queryParams.pageNum"
      :total="total"
      @pagination="getList"
    />

    <!-- 添加或修改主管任务配置对话框 -->
    <el-dialog :title="title" :visible.sync="open" append-to-body width="720px">
      <el-form ref="form" :model="form" :rules="rules" label-width="90px" >
        <el-form-item label="任务名称" prop="summaryTaskName">
          <el-input v-model="form.summaryTaskName" :disabled="status" placeholder="请输入任务名称" size="mini"/>
        </el-form-item>
        <el-form-item label="填写对象" prop="fillObjects">
          <el-select v-model="form.fillObjects" clearable collapse-tags multiple placeholder="请选择填写对象" style="width: 100%;" size="mini">
            <el-option
              v-for="item in summaryTaskOptions"
              :key="item.dictValue"
              :label="item.dictLabel"
              :value="item.dictValue">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="生效时间" prop="datetimerange">
          <el-date-picker
            v-model="form.datetimerange"
            align="left"
            end-placeholder="结束日期"
            range-separator="至"
            start-placeholder="开始日期"
            type="daterange"
            value-format="yyyy-MM-dd" size="mini" style="width: 100%;">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="发布状态" prop="status">
          <el-radio-group v-model="form.status" size="mini" :disabled="status">
            <el-radio
              v-for="dict in dict.type.sfa_publish_type"
              :key="dict.value"
              :label="dict.value"
              :value="dict.value"
            >{{ dict.label }}
            </el-radio>
          </el-radio-group>
        </el-form-item>
        <div>
          <el-divider>答题内容设置</el-divider>
          <el-card class="box-card el-zcard" shadow="never" v-for="(item,index)  in form.customItemList" :key="index">
              <div>
                <el-form-item :label="index+1+'.答题类型'"  :prop="'customItemList.' + index +'.answerType'" :rules="rules.answerType">
                  <el-select v-model="item.answerType" :disabled="status" clearable placeholder="请选择答题类型" size="mini" @change="answerTypeChange(index)" style="width: 88%;">
                    <el-option
                      v-for="item in answerTypeOptions"
                      :key="item.dictValue"
                      :label="item.dictLabel"
                      :value="item.dictValue">
                    </el-option>
                  </el-select>
                  <span class="el-icon-circle-plus-outline addBtn" @click="addTypeFn"></span>
                  <span  v-show="form.customItemList.length>1"  class="el-icon-remove-outline addBtn" @click="reduceTypeFn(index)"></span>
                </el-form-item>
                <el-form-item class="collectionForm1" label="标题"  :prop="'customItemList.' + index +'.customName'" :rules="rules.customName">
                  <el-input v-model="item.customName" :disabled="status" placeholder="请输入标题" size="mini"/>
                </el-form-item>
                <el-form-item label="是否必填" :prop="'customItemList.' + index +'.isMust'" :rules="rules.isMust">
                  <el-radio-group :disabled="status" v-model="item.isMust" size="mini">
                    <el-radio label="0">是</el-radio>
                    <el-radio label="1">否</el-radio>
                  </el-radio-group>
                </el-form-item>
                <div v-for="(itemlist,indexlist) in item.customOptionList" :key="indexlist" class="collectionForm1">
                  <div v-show="item.answerType == 'dx' || item.answerType == 'duox'">
                    <div v-show="indexlist==0">
                      <el-form-item :prop="'customItemList.'+index+'.customOptionList.' + indexlist +'.customOption'" :rules="rules.collectionOption" label="选项">
                        <el-input :disabled="status" v-model="itemlist.customOption" clearable placeholder="请输入内容" size="mini"/>
                        <span class="el-icon-circle-plus-outline addBtn" @click="addFn(index)"></span>
                        <span v-show="item.customOptionList.length>2" class="el-icon-remove-outline addBtn" @click="reduceFn(index,indexlist)"></span>
                      </el-form-item>
                    </div>
                    <div v-show="indexlist != 0">
                      <el-form-item :prop="'customItemList.'+index+'.customOptionList.' + indexlist +'.customOption'" :rules="rules.collectionOption" label="">
                        <el-input :disabled="status" v-model="itemlist.customOption" clearable placeholder="请输入内容" size="mini"/>
                        <span class="el-icon-circle-plus-outline addBtn" @click="addFn(index)"></span>
                        <span v-show="item.customOptionList.length>2" class="el-icon-remove-outline addBtn" @click="reduceFn(index,indexlist)"></span>
                      </el-form-item>
                    </div>
                  </div>
                </div>
                <div v-show="item.answerType != 'dx'&&item.answerType != 'duox'">
                  <el-form-item :prop="'customItemList.'+index+'.remark'" :rules="rules.remark" label="备注">
                    <el-input :disabled="status" v-model="item.remark" clearable placeholder="请输入内容" size="mini"/>
                  </el-form-item>
                </div>
              </div>
          </el-card>

        </div>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm" size="mini">确 定</el-button>
        <el-button @click="cancel" size="mini">取 消</el-button>
      </div>
    </el-dialog>
    <el-dialog :title="title" :visible.sync="viewOpen" append-to-body width="720px">
      <el-form ref="form" :model="form" :rules="rules" label-width="90px" >
        <el-form-item label="任务名称" prop="summaryTaskName">
          <el-input v-model="form.summaryTaskName" disabled size="mini"/>
        </el-form-item>
        <el-form-item label="填写对象" prop="fillObjects">
          <el-select v-model="form.fillObjects" clearable disabled  multiple placeholder="请选择填写对象" style="width: 100%;" size="mini">
            <el-option
              v-for="item in summaryTaskOptions"
              :key="item.dictValue"
              :label="item.dictLabel"
              :value="item.dictValue">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="生效时间" prop="datetimerange">
          <el-date-picker
            disabled
            v-model="form.datetimerange"
            align="left"
            end-placeholder="结束日期"
            range-separator="至"
            start-placeholder="开始日期"
            type="daterange"
            value-format="yyyy-MM-dd" size="mini" style="width: 100%;">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="发布状态" prop="status">
          <el-radio-group v-model="form.status" size="mini" disabled>
            <el-radio
              v-for="dict in dict.type.sfa_publish_type"
              :key="dict.value"
              :label="dict.value"
              :value="dict.value"
            >{{ dict.label }}
            </el-radio>
          </el-radio-group>
        </el-form-item>
        <div>
          <el-divider>答题预览</el-divider>
          <el-card class="box-card el-zcard el-zcards" shadow="never" v-for="(item,index)  in form.customItemList" :key="index">
              <el-form-item>
                  <span class="font-red" v-if="item.isMust == 0">*</span>{{index+1+'、'+item.customName}}
                  <icon :answerType="item.answerType"></icon>
              </el-form-item>
                <el-form-item v-show="item.answerType == 'duox'">
                  <checkbox :checkboxValF="item.answer" :checkboxOptions="item.customOptionList"></checkbox>
                </el-form-item>
                <el-form-item v-show="item.answerType == 'dx'">
                  <radio  :radioValF="item.answer" :radioOptions="item.customOptionList"></radio>
                </el-form-item>
              <div v-show="item.answerType != 'dx'&&item.answerType != 'duox'&&item.remark">
                <el-form-item :prop="'customItemList.'+index+'.remark'">
                  <p class="textinfo">注：{{item.remark}}</p>
                </el-form-item>
              </div>
          </el-card>
        </div>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="cancelView" size="mini">关闭</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import {
  listSummaryTask,
  getSummaryTask,
  delSummaryTask,
  addSummaryTask,
  updateSummaryTask,
  changeSummaryTask,
  editPublish, userSummary
} from "@/api/sfa/summaryTask";
import checkbox from "@/views/components/sfa/checkboxs";
import radio from "@/views/components/sfa/radios";
import icon from "@/views/components/sfa/icon";
import {softRemove} from "@/api/sfa/task";
export default {
  name: "SummaryTask",
  dicts: ['summary_task_type', 'sfa_publish_type'],
  components: { radio,checkbox,icon },
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 主管任务配置表格数据
      summaryTaskList: [],
      //起止时间
      datetimerange: [],
      //填写对象
      summaryTaskOptions: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        summaryTaskName: null,

        fillObject: null,
        startTime: null,
        stopTime: null,
        status: null,
      },
      answerTypeOptions: [ {
        "searchValue": null,
        "createBy": "admin",
        "createTime": "2021-12-14 13:53:13",
        "updateBy": null,
        "updateTime": null,
        "remark": "单选",
        "params": {},
        "pageSize": null,
        "pageNum": null,
        "dictCode": 170,
        "dictSort": 0,
        "dictLabel": "公司",
        "dictValue": "gs",
        "dictType": "sfa_collection_answer_type",
        "cssClass": null,
        "listClass": "default",
        "isDefault": "N",
        "status": "0",
        "default": false
      },
        {
          "searchValue": null,
          "createBy": "admin",
          "createTime": "2021-12-14 13:53:13",
          "updateBy": null,
          "updateTime": null,
          "remark": "单选",
          "params": {},
          "pageSize": null,
          "pageNum": null,
          "dictCode": 170,
          "dictSort": 0,
          "dictLabel": "大区",
          "dictValue": "dq",
          "dictType": "sfa_collection_answer_type",
          "cssClass": null,
          "listClass": "default",
          "isDefault": "N",
          "status": "0",
          "default": false
        },
        {
          "searchValue": null,
          "createBy": "admin",
          "createTime": "2021-12-14 13:53:13",
          "updateBy": null,
          "updateTime": null,
          "remark": "单选",
          "params": {},
          "pageSize": null,
          "pageNum": null,
          "dictCode": 170,
          "dictSort": 0,
          "dictLabel": "销售部",
          "dictValue": "xsb",
          "dictType": "sfa_collection_answer_type",
          "cssClass": null,
          "listClass": "default",
          "isDefault": "N",
          "status": "0",
          "default": false
        },{
        "searchValue": null,
        "createBy": "admin",
        "createTime": "2021-12-14 13:53:13",
        "updateBy": null,
        "updateTime": null,
        "remark": "单选",
        "params": {},
        "pageSize": null,
        "pageNum": null,
        "dictCode": 170,
        "dictSort": 0,
        "dictLabel": "单选",
        "dictValue": "dx",
        "dictType": "sfa_collection_answer_type",
        "cssClass": null,
        "listClass": "default",
        "isDefault": "N",
        "status": "0",
        "default": false
      }, {
        "searchValue": null,
        "createBy": "admin",
        "createTime": "2021-12-14 13:53:47",
        "updateBy": null,
        "updateTime": null,
        "remark": "多选",
        "params": {},
        "pageSize": null,
        "pageNum": null,
        "dictCode": 171,
        "dictSort": 1,
        "dictLabel": "多选",
        "dictValue": "duox",
        "dictType": "sfa_collection_answer_type",
        "cssClass": null,
        "listClass": "default",
        "isDefault": "N",
        "status": "0",
        "default": false
      }, {
        "searchValue": null,
        "createBy": "admin",
        "createTime": "2021-12-14 13:54:17",
        "updateBy": null,
        "updateTime": null,
        "remark": "文本",
        "params": {},
        "pageSize": null,
        "pageNum": null,
        "dictCode": 172,
        "dictSort": 2,
        "dictLabel": "文本",
        "dictValue": "wb",
        "dictType": "sfa_collection_answer_type",
        "cssClass": null,
        "listClass": "default",
        "isDefault": "N",
        "status": "0",
        "default": false
      }, {
        "searchValue": null,
        "createBy": "admin",
        "createTime": "2022-01-26 01:50:59",
        "updateBy": null,
        "updateTime": null,
        "remark": "照片",
        "params": {},
        "pageSize": null,
        "pageNum": null,
        "dictCode": 221,
        "dictSort": 3,
        "dictLabel": "照片",
        "dictValue": "zp",
        "dictType": "sfa_collection_answer_type",
        "cssClass": null,
        "listClass": "default",
        "isDefault": "N",
        "status": "0",
        "default": false
      }, {
        "searchValue": null,
        "createBy": "admin",
        "createTime": "2022-02-08 06:24:18",
        "updateBy": null,
        "updateTime": null,
        "remark": "数字",
        "params": {},
        "pageSize": null,
        "pageNum": null,
        "dictCode": 248,
        "dictSort": 4,
        "dictLabel": "数字",
        "dictValue": "sz",
        "dictType": "sfa_collection_answer_type",
        "cssClass": null,
        "listClass": "default",
        "isDefault": "N",
        "status": "0",
        "default": false
      }, {
        "searchValue": null,
        "createBy": "admin",
        "createTime": "2022-02-08 06:24:18",
        "updateBy": null,
        "updateTime": null,
        "remark": "日期",
        "params": {},
        "pageSize": null,
        "pageNum": null,
        "dictCode": 248,
        "dictSort": 4,
        "dictLabel": "日期",
        "dictValue": "rq",
        "dictType": "sfa_collection_answer_type",
        "cssClass": null,
        "listClass": "default",
        "isDefault": "N",
        "status": "0",
        "default": false
      }],
      // 表单参数
      form: {
        datetimerange:[],
        customItemList:[
          {
            answerType:"",
            customName:"",
            isMust:"",
            remark:"",
            customOptionList: [
              {collectionOption: ''}
            ],
          }
        ],
      },
      // 表单校验
      rules: {
        summaryTaskName: [
          {required: true, message: "任务名称不能为空", trigger: "blur"}
        ],
        fillObject: [
          {required: true, message: "填写对象不能为空", trigger: "blur"}
        ],
        datetimerange: [
          {required: true, message: "生效时间不能为空", trigger: "blur"}
        ],
        status: [
          {required: true, message: "状态不能为空", trigger: "blur"}
        ],
        collectionCode: [{required: true, message: '请输入采集项编号', trigger: 'blur'}],
        collectionName: [{required: true, message: '请输入采集项名称', trigger: 'blur'}],
        collectionType: [{required: true, message: '请选择采集项类型', trigger: 'change'}],
        isMust: [{required: true, message: '请选择是否必填', trigger: 'change'}],
        isValid: [{required: true, message: '请选择是否有效', trigger: 'change'}],
        isPicture: [{required: true, message: '请选择是否支持图片', trigger: 'change'}],
        isMustPicture: [{required: true, message: '请选择图片是否必填', trigger: 'change'}],
        answerType: [{required: true, message: '请选择回答类型', trigger: 'change'}],
        collectionOption: [{required: true, message: '请输入选项内容', trigger: 'blur'}],
        customName:[{required: true, message: '请输入标题', trigger: 'blur'}],

      },
      fillObject: [],
      viewOpen:false,
      status:false
    };
  },
  created() {
    this.getDicts("summary_task_type").then(response => {
      this.summaryTaskOptions = response.data;
    });
    this.getList();
  },
  methods: {
    addTypeFn() {
      this.form.customItemList.push({
        answerType: "",
        customName: "",
        isMust: "",
        remark: "",
        customOptionList: [
          {customOption: ''}
        ],
      })
    },
    reduceTypeFn(index) {
      this.form.customItemList.splice(index, 1);
    },
    // 回答类型改变
    answerTypeChange(val) {
      this.form.customItemList[val].remark = ""
      if (this.form.customItemList[val].answerType != 'dx' && this.form.customItemList[val].answerType != 'duox') {
        this.form.customItemList[val].customOptionList = [];
      } else {
        if (this.form.customItemList[val].customOptionList.length < 1) {
          this.form.customItemList[val].customOptionList.push({customOption: ''})
        }
      }
      this.$forceUpdate();
    },
    addFn(index) {
      this.form.customItemList[index].customOptionList.push({customOption: ''});
    },
    reduceFn(index, itemIndex) {
      this.form.customItemList[index].customOptionList.splice(itemIndex, 1);
    },
    /** 查询主管任务配置列表 */
    getList() {
      this.loading = true;
      listSummaryTask(this.queryParams).then(response => {
        this.summaryTaskList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 填写对象
    fillObjectFormat(row, column) {
      if (row.fillObject != null) {
        return this.selectDictLabels(this.summaryTaskOptions, row.fillObject);
      } else {
        return ""
      }
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        summaryId: null,
        summaryTaskName: null,
        fillObjects: [],
        fillObject: null,
        startTime: null,
        stopTime: null,
        status: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null,
        delFlag: null,
        datetimerange: [],
        customItemList: [
          {
            customOptionList: [
              {customOption: ''}
            ],
          }
        ],
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      if (this.datetimerange == null || this.datetimerange == []) {
        this.queryParams.startTime = '';
        this.queryParams.stopTime = '';
      } else {
        this.queryParams.startTime = this.datetimerange[0];
        this.queryParams.stopTime = this.datetimerange[1];
      }
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.datetimerange = [];
      this.resetForm("queryForm");
      this.handleQuery();
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.status = false
      this.form.status = "0";
      this.open = true;
      this.title = "添加主管任务配置";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const summaryId = row.summaryId || this.ids
      getSummaryTask(summaryId).then(response => {
        response.data.fillObjects = response.data.fillObject.split(',');
        response.data.datetimerange = []
        response.data.datetimerange[0] = response.data.startTime;
        response.data.datetimerange[1] = response.data.stopTime;
        if (response.data.status == "1") {
          this.status = true
        } else {
          this.status = false
        }
        this.form = response.data;
        this.open = true;
        this.title = "修改主管任务配置";
      });
    },
    previewFn(row) {
      this.reset();
      const summaryId = row.summaryId || this.ids
      getSummaryTask(summaryId).then(response => {
        response.data.fillObjects = response.data.fillObject.split(',');
        response.data.datetimerange = []
        response.data.datetimerange[0] = response.data.startTime;
        response.data.datetimerange[1] = response.data.stopTime;
        this.form = response.data;
        this.viewOpen = true;
        this.title = "主管任务配置详情";
      });
    },
    cancelView() {
      this.viewOpen = false;
    },
    /** 提交按钮 */
    submitForm() {
      if (this.form.datetimerange == null || this.form.datetimerange == []) {
        this.form.startTime = '';
        this.form.stopTime = '';
      } else {
        this.form.startTime = this.form.datetimerange[0];
        this.form.stopTime = this.form.datetimerange[1];
      }
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.summaryId != null) {
            if (this.status) {
              editPublish(this.form).then(response => {
                this.$modal.msgSuccess("修改成功");
                this.open = false;
                this.getList();
              });
            } else {
              updateSummaryTask(this.form).then(response => {
                this.$modal.msgSuccess("修改成功");
                this.open = false;
                this.getList();
              });
            }

          } else {
            addSummaryTask(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 发布按钮操作 */
    handleRelease(row) {
      this.$modal.confirm('是否确认发布"' + row.summaryTaskName + '"的数据项？').then(function () {
        row.status = 1;
        return changeSummaryTask(row.summaryId, row.status);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("发布成功");
      }).catch(() => {
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const summaryIds = row.summaryId || this.ids;
      let that = this;
      this.$modal.confirm('是否确认删除主管任务配置编号为"' + summaryIds + '"的数据项？').then(function () {
        return delSummaryTask(summaryIds).then(response => {
          if(response.code==200){
            that.$modal.msgSuccess("删除成功");
            that.getList();
          }
        });
      })
    },
  }
};
</script>
<style scoped>
.addBtn {
  font-size: 18px;
  margin-left: 10px;
  cursor: pointer;
  color: #409eff;
}
.font-red {
  color: #ff4949;
  position: absolute;
  left: -8px;
  top: 2px;
}
</style>
