baizonghao
2023-05-19 ef85af030be4daed22ad6845e3a248150309438a
src/views/cause/Entry.vue
@@ -16,13 +16,13 @@
            <el-button type="primary" @click="search">查询</el-button>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" @click="addAduitDialogVisible = true">添加</el-button>
            <el-button type="primary" @click="addAduitAnJian">添加</el-button>
          </el-form-item>
          <el-form-item>
            <el-upload name="multipartFile" class="upload-demo" action="/api/cause/upload " :show-file-list="false"
              :before-upload="beforeAvatarUpload" :on-success="respond" :limit="1">
              <el-button type="primary">导入</el-button>
<!--              <el-button type="primary">导入</el-button>-->
            </el-upload>
          </el-form-item>
        </el-form>
@@ -35,17 +35,17 @@
          </el-table-column>
          <el-table-column prop="reportNumber" label="报案人数" width="100" header-align="center" align="center">
          </el-table-column>
             <el-table-column prop="totalMoney" label="预估总金额" width="100" header-align="center" align="center">
          <el-table-column prop="totalMoney" label="预估总金额" width="100" header-align="center" align="center">
          </el-table-column>
          <el-table-column prop="firstTime" label="最早发案日期" width="160" header-align="center" align="center">
          </el-table-column>
          <el-table-column prop="status" label="案件状态" width="110" header-align="center" align="center">
            <template slot-scope="scope">
              <span v-if="scope.row.status == 0">受理中</span>
              <span v-if="scope.row.status == 1">不予立案</span>
              <span v-if="scope.row.status == 2">以立案</span>
              <span v-if="scope.row.status == 3">已结案</span>
              <span v-if="scope.row.status == 4">已立案</span>
              <span v-if="scope.row.status == 0">立案</span>
              <span v-if="scope.row.status == 1">初查</span>
              <span v-if="scope.row.status == 2">受理</span>
              <span v-if="scope.row.status == 3">移送起诉</span>
              <span v-if="scope.row.status == 4">结案</span>
            </template>
          </el-table-column>
          <el-table-column prop="userName" label="负责人" width="130" header-align="center" align="center">
@@ -70,7 +70,7 @@
    <!--添加案件弹窗-->
    <el-dialog title="添加案件" :visible.sync="addAduitDialogVisible" :before-close="addAduitClose">
      <el-row :gutter="15">
        <el-form ref="causeForm" :model="causeForm" :rules="addCauseRules" size="medium" label-width="100px">
        <el-form ref="causeForm" :model="causeForm" :rules="addCauseRules" size="medium" label-width="140px">
          <el-col :span="12">
            <el-form-item label="案件编号 " prop="number">
              <el-input v-model="causeForm.number" clearable :style="{ width: '100%' }" placeholder="输入案件编号">
@@ -83,15 +83,16 @@
              </el-input>
            </el-form-item>
          </el-col>
           <el-col :span="12">
          <el-col :span="12">
            <el-form-item label="预估总金额" prop="totalMoney">
              <el-input v-model="causeForm.totalMoney" clearable :style="{ width: '100%' }" placeholder="输入预估总金额"></el-input>
              <el-input v-model="causeForm.totalMoney" clearable :style="{ width: '100%' }"
                placeholder="输入预估总金额"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="最早发案" prop="firstTime">
          <el-col :span="24">
            <el-form-item label="最早发案时间" prop="firstTime">
              <el-date-picker v-model="causeForm.firstTime" type="datetime" placeholder="选择日期时间" clearable
                :style="{ width: '100%' }" value-format="yyyy-MM-dd HH:mm:ss">
                :style="{ width: '40%' }" value-format="yyyy-MM-dd HH:mm:ss">
              </el-date-picker>
            </el-form-item>
          </el-col>
@@ -111,7 +112,7 @@
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="案件描述" prop="description">
              <el-input v-model="causeForm.description" type="textarea" placeholder="请输入多行文本"
@@ -143,13 +144,13 @@
              </el-input>
            </el-form-item>
          </el-col>
             <el-col :span="12">
          <el-col :span="12">
            <el-form-item label="预估总金额" prop="totalMoney">
              <el-input v-model="updataCauseForm.totalMoney" clearable :style="{ width: '100%' }"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="最发早案时间" prop="firstTime">
            <el-form-item label="最早发案时间" prop="firstTime">
              <el-date-picker v-model="updataCauseForm.firstTime" type="datetime" placeholder="选择日期时间"
                :style="{ width: '100%' }" value-format="yyyy-MM-dd HH:mm:ss">
              </el-date-picker>
@@ -193,7 +194,7 @@
          <template slot="header">
            <el-form :inline="true" :model="queryInfoReport" class="demo-form-inline">
              <el-form-item label="报案人:">
                <el-input placeholder="请输入姓名或身份证" v-model="queryInfoReport.people" :style="{ width: '180px' }">
                <el-input placeholder="请输入姓名" v-model="queryInfoReport.people" :style="{ width: '180px' }">
                </el-input>
              </el-form-item>
              <el-form-item label="手机号码:">
@@ -205,30 +206,31 @@
                  <el-option v-for="item in optionsGroup" :key="item.value" :label="item.label" :value="item.value">
                  </el-option>
                </el-select>
              </el-form-item>
<!--              </el-form-item>-->
              <el-form-item label="报案材料:">
                <el-select v-model="queryInfoReport.HavaMaterial" :style="{ width: '100px' }">
                  <el-option v-for="item in optionsMate" :key="item.value" :label="item.label" :value="item.value">
                  </el-option>
                </el-select>
              </el-form-item>
<!--              <el-form-item label="报案材料:">-->
<!--                <el-select v-model="queryInfoReport.HavaMaterial" :style="{ width: '100px' }">-->
<!--                  <el-option v-for="item in optionsMate" :key="item.value" :label="item.label" :value="item.value">-->
<!--                  </el-option>-->
<!--                </el-select>-->
<!--              </el-form-item>-->
              <el-form-item>
<!--              <el-form-item>-->
                <el-button type="primary" @click="searchByCondition">查询</el-button>
              </el-form-item>
              <el-form-item>
                <el-button type="primary" @click="addVisibelReport">添加</el-button>
                <el-button type="primary" @click="exportExcel">导出</el-button>
              </el-form-item>
              <el-form-item>
                <el-upload name="multipartFile" class="upload-demo" action="/api/cause/reporterUpload"
                  :show-file-list="false" :data="{ causeId: this.reportCauseId }" :before-upload="beforeAvatarUpload"
                  :on-success="reporterRespond" :limit="1">
                  <el-button type="primary">导入</el-button>
<!--                  <el-button type="primary">导入</el-button>-->
                </el-upload>
              </el-form-item>
              <el-form-item>
                <el-button type="primary" @click="exportExcel">报案材料导出</el-button>
<!--                <el-button type="primary" @click="exportExcel">报案材料导出</el-button>-->
              </el-form-item>
            </el-form>
@@ -261,7 +263,8 @@
            </el-table-column>
            <el-table-column width="100" prop="reportMaterials" label="报案材料">
              <template slot-scope="scope">
                <span>{{ scope.row.reportMaterials === null ? "未提交" : "已提交" }}</span>
                <span>{{ scope.row.reportMaterials === null || scope.row.reportMaterials === '' ? "未提交" : "已提交"
}}</span>
              </template>
            </el-table-column>
            <el-table-column width="200" prop="reportTime" label="报案时间">
@@ -272,11 +275,13 @@
            <el-table-column label="操作">
              <template slot-scope="scope">
                <el-button type="text" size="medium" @click="updataReport(scope.row)">编辑</el-button>
                <el-button type="text" size="medium"
                  @click="leaveReport(scope.row.id, scope.row.causeId, scope.row.groupId)" style="color:#ff0000"
                  :disabled="scope.row.isInGroup == 0">退群 </el-button>
<!--                <el-button type="text" size="medium"-->
<!--                  @click="leaveReport(scope.row.id, scope.row.causeId, scope.row.groupId)" style="color:#ff0000"-->
<!--                  :disabled="scope.row.isInGroup == 0">退群 </el-button>-->
<!--                <el-button type="text" size="medium" @click="removeReport(scope.row.id, scope.row.causeId)"-->
<!--                  style="color:#ff0000" :disabled="scope.row.isInGroup == 1">删除 </el-button>-->
                <el-button type="text" size="medium" @click="removeReport(scope.row.id, scope.row.causeId)"
                  style="color:#ff0000" :disabled="scope.row.isInGroup == 1">删除 </el-button>
                           style="color:#ff0000" >删除 </el-button>
              </template>
            </el-table-column>
          </el-table>
@@ -289,15 +294,15 @@
          :before-close="addReportVisibleClose">
          <el-row :gutter="15">
            <el-form ref="auditFrom" :model="auditFrom" :rules="addReportRules" size="medium" label-width="100px">
              <!-- <el-col :span="12">
            <el-form-item label="头像" prop="pic" required>
              <el-upload ref="pic" action="/api/minio/upload" :show-file-list="false" :on-success="handleAvatarSuccess"
                         list-type="picture-card" accept="image/*">
                <img v-if="picShow" :src="picShow" style="width: 145px;height: 145px">
                <i v-else class="el-icon-plus"></i>
              </el-upload>
            </el-form-item>
          </el-col> -->
              <el-col :span="12">
                <el-form-item label="头像" prop="pic" required>
                  <el-upload ref="pic" action="/api/minio/upload" :show-file-list="false"
                    :on-success="handleAvatarSuccess" list-type="picture-card" accept="image/*">
                    <img v-if="picShow" :src="picShow" style="width: 145px;height: 145px">
                    <i v-else class="el-icon-plus"></i>
                  </el-upload>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="报案人 " prop="reporterName">
                  <el-input v-model="auditFrom.reporterName" placeholder="请输入报案人 " clearable :style="{ width: '100%' }">
@@ -362,31 +367,42 @@
          :before-close="updateReportVisibleclose">
          <el-row :gutter="20">
            <el-form ref="updateReportForm" :model="updateReportForm" size="medium" label-width="100px">
              <!-- <el-col :span="12">
              <el-col :span="12">
                <el-form-item label="头像" prop="pic" required>
                  <el-upload ref="pic" action="/api/minio/upload" :show-file-list="false"
                    :on-success="handleAvatarSuccess" list-type="picture-card" accept="image/*">
                    <img v-if="updateReportForm.pic!=null||updateReportForm!=''" :src="updateReportForm.pic" style="width: 145px;height: 145px">
                    <i v-else class="el-icon-plus"></i>
                  </el-upload>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="报案人 " prop="reporterName">
                  <el-input v-model="auditFrom.reporterName" placeholder="请输入报案人 " clearable :style="{ width: '100%' }">
                  <el-input v-model="updateReportForm.reporterName" placeholder="请输入报案人 " clearable :style="{ width: '100%' }">
                  </el-input>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="手机号码" prop="mobile">
                  <el-input v-model="auditFrom.mobile" placeholder="请输入手机号码" clearable :style="{ width: '100%' }">
                  <el-input v-model="updateReportForm.mobile" placeholder="请输入手机号码" clearable :style="{ width: '100%' }">
                  </el-input>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="身份证号" prop="idcard">
                  <el-input v-model="auditFrom.idcard" placeholder="请输入身份证号" clearable :style="{ width: '100%' }">
                  <el-input v-model="updateReportForm.idcard" placeholder="请输入身份证号" clearable :style="{ width: '100%' }">
                  </el-input>
                </el-form-item>
              </el-col> -->
              <el-col :span="12">
              </el-col>
              <!-- <el-col :span="12">
                <el-form-item prop="reportTime" label="报案时间">
                  <el-date-picker v-model="updateReportForm.reportTime" type="datetime" placeholder="选择日期时间" clearable
                    :style="{ width: '100%' }" value-format="yyyy-MM-dd HH:mm:ss">
                  </el-date-picker>
                </el-form-item>
              </el-col>
              </el-col> -->
              <el-col :span="12">
                <el-form-item label="被骗时间" prop="cheatTime">
                  <el-date-picker v-model="updateReportForm.cheatTime" type="datetime" placeholder="选择日期时间" clearable
@@ -416,12 +432,12 @@
                <el-form-item label="上传" prop="fileList" required>
                  <el-upload ref="reportMaterials" :file-list="updateReportForm.fileList" action="/api/minio/upload"
                    list-type="picture" :on-success="handleReporterMaterialSuccess">
                    <img v-if="updateReportForm.reportMaterials!=''" :src="'/minio/img/'+updateReportForm.reportMaterials" style="width: 145px;height: 145px">
                    <el-button size="small" type="primary" icon="el-icon-upload">点击上传</el-button>
                  </el-upload>
                </el-form-item>
              </el-col>
              <!--
   <el-col :span="24">
              <!-- <el-col :span="24">
                <el-form-item label="上传" prop="fileList" required>
                  <el-upload ref="reportMaterials" :file-list="auditFrom.fileList" action="/api/minio/upload"
                    list-type="picture" :on-success="handleMaterialSuccess">
@@ -591,9 +607,9 @@
              </el-col>
              <el-col :span="12">
                <el-form-item label="状态" prop="status">
                    <span v-if="detailsGroupAn.status === 1">已发布</span>
                    <span v-else-if="detailsGroupAn.status === 0">未发布</span>
                    <span v-else="detailsGroupAn.status === 2">已下架</span>
                  <span v-if="detailsGroupAn.status === 1">已发布</span>
                  <span v-else-if="detailsGroupAn.status === 0">未发布</span>
                  <span v-else="detailsGroupAn.status === 2">已下架</span>
                </el-form-item>
              </el-col>
            </el-form>
@@ -729,6 +745,7 @@
        size: 10,
      },
      auditFrom: {
        pic: '',
        reporterName: '',
        mobile: '',
        idcard: '',
@@ -799,9 +816,7 @@
      reportCauseId: null,
      reportTotal: 0,
      reportList: [],
      addAduitDialogVisible: false,
      infoAduitDialogVisible: false,
      causeOptions: [],
      groupAnVisible: false,
      addCauseRules: {
        number: [{
@@ -824,7 +839,7 @@
          message: '请选择案件状态 ',
          trigger: 'blur'
        }],
          totalMoney: [{
        totalMoney: [{
          required: true,
          message: '请输入预估总金额 ',
          trigger: 'blur'
@@ -890,6 +905,7 @@
      }
      ],
      updateReportForm: {
        pic: '',
        reporterName: '',
        mobile: '',
        idcard: '',
@@ -905,6 +921,7 @@
      //案件人员表格数据
      updateReportPrams: {
        id: '',
        pic:'',
        reporterName: '',
        mobile: '',
        idcard: '',
@@ -930,6 +947,7 @@
      },
      updataCauseForm: {
        id: '',
        pic:'',
        name: '',
        number: '',
        firstTime: '',
@@ -954,49 +972,46 @@
        },
        {
          value: '0',
          label: '受理中'
          label: '立案'
        },
        {
          value: '1',
          label: '不予立案'
          label: '初查'
        },
        {
          value: '2',
          label: '已立案'
          label: '受理'
        },
        {
          value: '3',
          label: '已结案'
          label: '移送起诉'
        },
        {
          value: '4',
          label: '已撤案'
          label: '结案'
        }
      ],
      causeOptions: [
        {
          value: null,
          label: '全部'
          value: 0,
          label: '立案'
        },
        {
          value: '0',
          label: '未审核'
          value: 1,
          label: '初查'
        },
        {
          value: '1',
          label: '不予立案'
          value: 2,
          label: '受理'
        },
        {
          value: '2',
          label: '受理中'
          value: 3,
          label: '移送起诉'
        },
        {
          value: '3',
          label: '已结案'
        },
        {
          value: '4',
          label: '已撤案'
          value: 4,
          label: '结案'
        }
      ],
      total: null,
@@ -1075,6 +1090,21 @@
  },
  methods:
  {
    expExcel(){
    },
    addAduitAnJian(){
      let date=(new Date()).valueOf();//获取时间戳
      let txt = '1234567890';//生成的随机机器码
      let len =13;//机器码有多少位
      let pwd = '';//定义空变量用来接收机器码
      for (let i = 0; i < len; i++) {
        pwd += txt.charAt(Math.floor(Math.random() * txt.length));//循环机器码位数随机填充
      }
      let id= date+pwd;
      this.causeForm.number=id;
      this.addAduitDialogVisible=true;
    },
    //关闭案件的案件人员添加
    addReportVisibleClose() {
@@ -1184,7 +1214,7 @@
    //案件人员
    //导出文件
    exportExcel() {
      this.$http.post('/api/report/exportReporter?id=' + this.exportReportId, {}, { responseType: 'blob' })
      this.$http.post('/api//cause/exp?causeId=' + this.exportReportId, {}, { responseType: 'blob' })
        .then(res => {
          const fileName = decodeURI(res.headers['content-disposition'].split(';')[1].split('=')[1])
          const blob = new Blob([res.data], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' })
@@ -1214,6 +1244,8 @@
      this.updateReportPrams.groupId = this.updateReportForm.groupId
      this.updateReportPrams.id = this.updateReportForm.id
      this.updateReportPrams.reportMaterials = this.updateReportPrams.fileList.map(i => i.data).join(',')
      this.updateReportPrams.pic=this.updateReportForm.pic
      let form = null;
      form = this.updateReportPrams;
      const data = form;
@@ -1274,7 +1306,7 @@
        if (!vaild) return this.$message.error('输入有误')
        this.auditFrom.reportMaterials = this.auditFrom.fileList.map(i => i.data).join(',');
        this.auditFrom.causeId = this.reportCauseId;
        console.log(this.reportCauseId);
        // console.log(this.reportCauseId);
        report(this.auditFrom).then(res => {
          this.$message.success('提交成功')
          this.auditFrom = {}
@@ -1292,9 +1324,9 @@
    },
    handleAvatarSuccess(res, file) {
      this.auditFrom.pic = res.data
      getImgUrl(res.data).then(res => {
        this.picShow = res
        this.updateReportForm.pic = res
      })
    },
    async handleMaterialSuccess(res, file) {
@@ -1316,25 +1348,25 @@
    //案件录入相关
    updateCauseDialogVisible(row) {
      this.updateAduitDialogVisible = true,
        this.updataCauseForm = Object.assign({}, row);
      if (this.updataCauseForm.status == 0) {
        this.updataCauseForm.status = '未审核';
      };
      if (this.updataCauseForm.status == 1) {
        this.updataCauseForm.status = '不予立案';
      };
      if (this.updataCauseForm.status == 2) {
        this.updataCauseForm.status = '受理中';
      };
      if (this.updataCauseForm.status == 3) {
        this.updataCauseForm.status = '已结案';
      };
      if (this.updataCauseForm.status == 4) {
        this.updataCauseForm.status = '已撤案';
      };
    }
    ,
      this.updateAduitDialogVisible = true;
      this.updataCauseForm = Object.assign({}, row);
      // if (this.updataCauseForm.status == 0) {
      //   this.updataCauseForm.status = '未审核';
      // };
      // if (this.updataCauseForm.status == 1) {
      //   this.updataCauseForm.status = '不予立案';
      // };
      // if (this.updataCauseForm.status == 2) {
      //   this.updataCauseForm.status = '受理中';
      // };
      // if (this.updataCauseForm.status == 3) {
      //   this.updataCauseForm.status = '已结案';
      // };
      // if (this.updataCauseForm.status == 4) {
      //   this.updataCauseForm.status = '已撤案';
      // };
    },
    addAduitClose() {
      this.addAduitDialogVisible = false
    },
@@ -1364,7 +1396,7 @@
          } else {
            this.$message({
              type: "error",
              message: "表单不能为空"
              message: res.data.msg
            })
          }
        }
@@ -1388,21 +1420,21 @@
          data.userId = this.user[key].userId;
        }
      }
      if (data.status == '未审核') {
        data.status = 0;
      }
      if (data.status == '不予立案') {
        data.status = 1;
      }
      if (data.status == '受理中') {
        data.status = 2;
      }
      if (data.status == '已结案') {
        data.status = 3;
      }
      if (data.status == '已撤案') {
        data.status = 4;
      }
      // if (data.status == '未审核') {
      //   data.status = 0;
      // }
      // if (data.status == '不予立案') {
      //   data.status = 1;
      // }
      // if (data.status == '受理中') {
      //   data.status = 2;
      // }
      // if (data.status == '已结案') {
      //   data.status = 3;
      // }
      // if (data.status == '已撤案') {
      //   data.status = 4;
      // }
      this.$http.put('/api/cause/updateCause?id=' + data.id,
        data
      ).then(res => {
@@ -1411,21 +1443,21 @@
            type: "success",
            message: "修改成功"
          });
          if (this.updataCauseForm.status == 0) {
            this.updataCauseForm.status = '未审核';
          };
          if (this.updataCauseForm.status == 1) {
            this.updataCauseForm.status = '不予立案';
          };
          if (this.updataCauseForm.status == 2) {
            this.updataCauseForm.status = '受理中';
          };
          if (this.updataCauseForm.status == 3) {
            this.updataCauseForm.status = '已结案';
          };
          if (this.updataCauseForm.status == 4) {
            this.updataCauseForm.status = '已撤案';
          };
          // if (this.updataCauseForm.status == 0) {
          //   this.updataCauseForm.status = '未审核';
          // };
          // if (this.updataCauseForm.status == 1) {
          //   this.updataCauseForm.status = '不予立案';
          // };
          // if (this.updataCauseForm.status == 2) {
          //   this.updataCauseForm.status = '受理中';
          // };
          // if (this.updataCauseForm.status == 3) {
          //   this.updataCauseForm.status = '已结案';
          // };
          // if (this.updataCauseForm.status == 4) {
          //   this.updataCauseForm.status = '已撤案';
          // };
          this.updateAduitDialogVisible = false;
          // location.reload();
          this.getList();
@@ -1589,4 +1621,4 @@
::v-deep(.el-table thead) {
  color: #000000;
}
</style>
</style>