odc.xiaohui
2023-03-09 fcb6cfdbdb5fbce7d02d8513719237e65a72f474
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,7 +35,7 @@
          </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>
@@ -83,9 +83,10 @@
              </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">
@@ -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,7 +144,7 @@
              </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>
@@ -224,7 +225,7 @@
                <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>
@@ -261,7 +262,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,9 +274,9 @@
            <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>
              </template>
@@ -289,15 +291,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 +364,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 +429,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 +604,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 +742,7 @@
        size: 10,
      },
      auditFrom: {
        pic: '',
        reporterName: '',
        mobile: '',
        idcard: '',
@@ -824,7 +838,7 @@
          message: '请选择案件状态 ',
          trigger: 'blur'
        }],
          totalMoney: [{
        totalMoney: [{
          required: true,
          message: '请输入预估总金额 ',
          trigger: 'blur'
@@ -890,6 +904,7 @@
      }
      ],
      updateReportForm: {
        pic: '',
        reporterName: '',
        mobile: '',
        idcard: '',
@@ -905,6 +920,7 @@
      //案件人员表格数据
      updateReportPrams: {
        id: '',
        pic:'',
        reporterName: '',
        mobile: '',
        idcard: '',
@@ -930,6 +946,7 @@
      },
      updataCauseForm: {
        id: '',
        pic:'',
        name: '',
        number: '',
        firstTime: '',
@@ -1075,6 +1092,18 @@
  },
  methods:
  {
    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() {
@@ -1214,6 +1243,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 +1305,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 +1323,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) {
@@ -1364,7 +1395,7 @@
          } else {
            this.$message({
              type: "error",
              message: "表单不能为空"
              message: res.data.msg
            })
          }
        }
@@ -1589,4 +1620,4 @@
::v-deep(.el-table thead) {
  color: #000000;
}
</style>
</style>