wl
2022-07-25 4d35cc54167abbaffe090a309ef4c9aaf171e579
添加和修改
3个文件已修改
433 ■■■■ 已修改文件
src/api/cause.js 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/plugins/element.js 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cause/Entry.vue 424 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/cause.js
@@ -20,5 +20,12 @@
        params:{
            id:params
        }
    })
}
export function user(params) {
    return request({
        url: '/cause/getManagerList',
        method: 'get',
    })
}
src/plugins/element.js
@@ -17,7 +17,5 @@
Vue.use(Button).use(Container).use(Header).use(Aside).use(Menu).use(Submenu).use(MenuItem).use(Main).use(Icon).use(Card)
    .use(Col).use(Row).use(Card).use(Table).use(TableColumn).use(Form).use(FormItem).use(Input).use(Select).use(Option)
    .use(Pagination).use(Dialog).use(Upload).use(DatePicker).use(Image)
Vue.prototype.$message = Message
src/views/cause/Entry.vue
@@ -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="firstTime" label="最早发案日期" width="150" header-align="center" align="center">
          <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">
@@ -52,8 +52,8 @@
          </el-table-column>
          <el-table-column label="操作" width="240" header-align="center" align="center">
            <template slot-scope="scope">
              <el-button type="text" size="medium" @click="handleAudit(scope.row)">编辑</el-button>
              <el-button type="text" size="medium" @click="handleAudit(scope.row)">报案人员</el-button>
              <el-button type="text" size="medium" @click="updateCauseDialogVisible(scope.row)">编辑</el-button>
              <el-button type="text" size="medium" @click="reporterVisible=true">报案人员</el-button>
              <el-button type="text" size="medium" @click="handleAudit(scope.row)">群公告</el-button>
              <el-button type="text" size="medium" @click="removeCause(scope.row.id)" style="color:#ff0000">删除
              </el-button>
@@ -65,67 +65,215 @@
        layout="prev, pager, next" :total="total"></el-pagination>
    </el-card>
     <!--添加人员弹窗-->
          <el-dialog title="添加" :visible.sync="addAduitDialogVisible" width="50%" :before-close="addAduitClose">
    <!--添加案件弹窗-->
    <el-dialog title="添加案件" :visible.sync="addAduitDialogVisible" width="50%" :before-close="addAduitClose">
            <el-row :gutter="15">
              <el-form ref="addAduitForm" :model="auditFrom" :rules="rules" size="medium" label-width="100px">
                <el-col :span="12">
                  <el-form-item label="报案人 " prop="reporterName">
                    <el-input v-model="auditFrom.reporterName" placeholder="请输入报案人 " clearable
                      :style="{ width: '100%' }">
        <el-form ref="addAduitForm" :model="causeForm" :rules="rules" size="medium" label-width="100px">
          <el-col :span="18">
            <el-form-item label="案件编号 " prop="number">
              <el-input v-model="causeForm.number" 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-col :span="18">
            <el-form-item label="案件名称" prop="name">
              <el-input v-model="causeForm.name" 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>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item label="被骗时间" prop="cheatTime">
                    <el-date-picker v-model="auditFrom.tmpTime" type="datetime" placeholder="选择日期时间"
                      :style="{ width: '100%' }" format="yyyy-MM-dd HH:mm:ss" :value-format="auditFrom.cheatTime">
          <el-col :span="18">
            <el-form-item label="最早发案时间" prop="firstTime">
              <el-date-picker v-model="causeForm.firstTime" type="datetime" placeholder="选择日期时间"
                :style="{ width: '100%' }" value-format="yyyy-MM-dd HH:mm:ss">
                    </el-date-picker>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item label="涉案金额" prop="amountInvolved">
                    <el-input v-model="auditFrom.amountInvolved" placeholder="请输入涉案金额" clearable
                      :style="{ width: '100%' }"></el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="24">
                  <el-form-item label="案件描述" prop="reportDescription">
                    <el-input v-model="auditFrom.reportDescription" placeholder="请输入案件描述" clearable
                      :style="{ width: '100%' }"></el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="24">
                  <el-form-item label="补充信息" prop="information">
                    <el-input v-model="auditFrom.information" type="textarea" placeholder="请输入补充信息"
                      :autosize="{ minRows: 4, maxRows: 4 }" :style="{ width: '100%' }"></el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="24">
                  <el-form-item label="关联案件" prop="causeId">
                    <el-select v-model="auditFrom.causeId" placeholder="请选择下拉选择" clearable :style="{ width: '50%' }">
                      <el-option v-for="item in causeOptions" :key="item.id" :label="item.name" :value="item.id">
          <el-col :span="18">
            <el-form-item label="案件状态" prop="status">
              <el-select v-model="causeForm.status" placeholder="请选择下拉选择" clearable :style="{ width: '100%' }">
                <el-option v-for="item in causeOptions" :key="item.value" :label="item.label" :value="item.value">
                      </el-option>
                    </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="18">
            <el-form-item label="负责人" prop="userId">
              <el-select v-model="causeForm.userId" placeholder="请选择下拉选择" clearable :style="{ width: '100%' }">
                <el-option v-for="item in user" :key="item.userId" :label="item.userName" :value="item.userId"
                  :disabled="item.disabled"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="18">
            <el-form-item label="案件描述" prop="description">
              <el-input v-model="causeForm.description" clearable :style="{ width: '100%', height: '50%' }"></el-input>
                  </el-form-item>
                </el-col>
              </el-form>
            </el-row>
            <span slot="footer" class="dialog-footer">
              <el-button @click="addAduitDialogVisible = false">取 消</el-button>
              <el-button type="primary" @click="addAduit">确 定</el-button>
        <el-button type="primary" @click="createCause">确 定</el-button>
      </span>
    </el-dialog>
    <!--修改案件弹窗-->
    <el-dialog title="修改案件" :visible.sync="updateAduitDialogVisible" width="50%" :before-close="updateAduitClose">
      <el-row :gutter="15">
        <el-form ref="addAduitForm" :model="updataCauseForm" :rules="rules" size="medium" label-width="100px">
          <el-col :span="18">
            <el-form-item label="案件编号 " prop="number">
              <el-input v-model="updataCauseForm.number" clearable :style="{ width: '100%' }">
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="18">
            <el-form-item label="案件名称" prop="name">
              <el-input v-model="updataCauseForm.name" clearable :style="{ width: '100%' }">
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="18">
            <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>
            </el-form-item>
          </el-col>
          <el-col :span="18">
            <el-form-item label="案件状态" prop="status">
              <el-select v-model="updataCauseForm.status" clearable :style="{ width: '100%' }">
                <el-option v-for="item in causeOptions" :key="item.value" :label="item.label" :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="18">
            <el-form-item label="负责人" prop="userId">
              <el-select v-model="updataCauseForm.userName" clearable :style="{ width: '100%' }">
                <el-option v-for="item in user" :key="item.userId" :label="item.userName" :value="item.userId"
                  :disabled="item.disabled"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="18">
            <el-form-item label="案件描述" prop="description">
              <el-input v-model="updataCauseForm.description" clearable :style="{ width: '100%', height: '50%' }">
              </el-input>
            </el-form-item>
          </el-col>
        </el-form>
      </el-row>
      <span slot="footer" class="dialog-footer">
        <el-button @click="updateAduitDialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="updateCause">确 定</el-button>
      </span>
    </el-dialog>
     <!--修改案件弹窗-->
    <el-dialog title="修改案件" :visible.sync="updateAduitDialogVisible" width="50%" :before-close="updateAduitClose">
      <el-row :gutter="15">
        <el-form ref="addAduitForm" :model="updataCauseForm" :rules="rules" size="medium" label-width="100px">
          <el-col :span="18">
            <el-form-item label="案件编号 " prop="number">
              <el-input v-model="updataCauseForm.number" clearable :style="{ width: '100%' }">
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="18">
            <el-form-item label="案件名称" prop="name">
              <el-input v-model="updataCauseForm.name" clearable :style="{ width: '100%' }">
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="18">
            <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>
            </el-form-item>
          </el-col>
          <el-col :span="18">
            <el-form-item label="案件状态" prop="status">
              <el-select v-model="updataCauseForm.status" clearable :style="{ width: '100%' }">
                <el-option v-for="item in causeOptions" :key="item.value" :label="item.label" :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="18">
            <el-form-item label="负责人" prop="userId">
              <el-select v-model="updataCauseForm.userName" clearable :style="{ width: '100%' }">
                <el-option v-for="item in user" :key="item.userId" :label="item.userName" :value="item.userId"
                  :disabled="item.disabled"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="18">
            <el-form-item label="案件描述" prop="description">
              <el-input v-model="updataCauseForm.description" clearable :style="{ width: '100%', height: '50%' }">
              </el-input>
            </el-form-item>
          </el-col>
        </el-form>
      </el-row>
      <span slot="footer" class="dialog-footer">
        <el-button @click="updateAduitDialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="updateCause">确 定</el-button>
      </span>
    </el-dialog>
     <!--案件人员弹窗-->
    <el-dialog title="报案人员" :visible.sync="reporterVisible" width="50%" :before-close="updateAduitClose">
      <el-row :gutter="15">
        <el-form ref="addAduitForm" :model="updataCauseForm" :rules="rules" size="medium" label-width="100px">
          <el-col :span="18">
            <el-form-item label="案件编号 " prop="number">
              <el-input v-model="updataCauseForm.number" clearable :style="{ width: '100%' }">
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="18">
            <el-form-item label="案件名称" prop="name">
              <el-input v-model="updataCauseForm.name" clearable :style="{ width: '100%' }">
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="18">
            <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>
            </el-form-item>
          </el-col>
          <el-col :span="18">
            <el-form-item label="案件状态" prop="status">
              <el-select v-model="updataCauseForm.status" clearable :style="{ width: '100%' }">
                <el-option v-for="item in causeOptions" :key="item.value" :label="item.label" :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="18">
            <el-form-item label="负责人" prop="userId">
              <el-select v-model="updataCauseForm.userName" clearable :style="{ width: '100%' }">
                <el-option v-for="item in user" :key="item.userId" :label="item.userName" :value="item.userId"
                  :disabled="item.disabled"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="18">
            <el-form-item label="案件描述" prop="description">
              <el-input v-model="updataCauseForm.description" clearable :style="{ width: '100%', height: '50%' }">
              </el-input>
            </el-form-item>
          </el-col>
        </el-form>
      </el-row>
      <span slot="footer" class="dialog-footer">
        <el-button @click="updateAduitDialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="updateCause">确 定</el-button>
            </span>
          </el-dialog>
  </div>
@@ -134,26 +282,32 @@
<script>
import {
  casueList,
  remove
  remove,
  user,
  //saveSubject
} from '@/api/cause'
export default {
  name: "Entry",
  data() {
    return {
      causeOptions: [],
      auditFrom: {
        reporterName: '',
        mobile: '',
        idcard: '',
        cheatTime: '',
        amountInvolved: '',
        reportDescription: '',
        information: '',
        reportMaterials: "",
        causeId: '',
        fileList: [],
        tmpTime: '',
      causeForm: {
        name: '',
        number: '',
        firstTime: '',
        userId: '',
        status: '',
        description: '',
      },
      updataCauseForm: {
        id: '',
        name: '',
        number: '',
        firstTime: '',
        userName: '',
        status: '',
        userId: '',
        description: '',
      },
      casueList: [],
      queryInfo: {
@@ -162,6 +316,8 @@
        current: 1,
        size: 10
      },
      user: [],
      updateUser: [],
      options: [
        {
          value: null,
@@ -185,11 +341,35 @@
        },
        {
          value: '4',
          label: '已撤案'
        }
      ],
      causeOptions: [
        {
          value: '0',
          label: '未审核'
        },
        {
          value: '1',
          label: '不予立案'
        },
        {
          value: '2',
          label: '受理中'
        },
        {
          value: '3',
          label: '已结案'
        },
        {
          value: '4',
          label: '已撤案'
        }
      ],
      total: 0,
      addAduitDialogVisible: false,
      updateAduitDialogVisible: false,
      reporterVisible:false,
      rules: {
        reporterName: [{
          required: true,
@@ -235,28 +415,126 @@
    }
  },
  created() {
    this.init()
    this.init();
    this.userList();
  },
  methods:
  {
    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 = '已撤案';
      };
    }
    ,
    addAduitClose() {
      this.addAduitDialogVisible = false
      this.$refs.addAduitForm.resetFields()
      this.picShow = ""
    },
    addAduit() {
      this.$refs.addAduitForm.validate(async (vaild) => {
        if (!vaild) return this.$message.error('输入有误')
        this.auditFrom.reportMaterials = this.auditFrom.fileList.map(i => i.data).join(',')
        report(this.auditFrom).then(res => {
          this.$message.success('提交成功')
          this.addAduitDialogVisible = false
          this.getList()
        }).catch(err => {
          this.addAduitClose()
    updateAduitClose() {
      this.updateAduitDialogVisible = false
    },
    async createCause() {
      let form = null;
      form = this.causeForm;
      const data = form;
      this.$http.post('/api/cause/addCause',
        data
      ).then(res => {
        if (res.data.code == 200) {
          this.$message({
            type: "success",
            message: "添加成功"
          });
          this.addAduitDialogVisible = false;
         this.getList();
        } else {
          this.$message({
            type: "error",
            message: "表单不能为空"
        })
        }
      })
    },
    userList() {
      user().then(
        res => this.user = res
      )
    },
    async updateCause() {
      let form = null;
      form = this.updataCauseForm;
      const data = form;
      //saveSubject(params);
      data.userId = data.userName;
      for (let key in this.user) {
        if (data.userId == this.user[key].userName) {
          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;
      }
      this.$http.put('/api/cause/updateCause?id=' + data.id,
        data
      ).then(res => {
        if (res.data.code == 200) {
          this.$message({
            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 = '已撤案';
      };
          this.updateAduitDialogVisible = false;
          // location.reload();
          this.getList();
        } else {
          this.$message({
            type: "error",
            message: "表单不能为空"
          })
        }
      })
    },
    respond(res) {
      if (res.code == 200) {
        this.$message({