|
@@ -1,351 +0,0 @@
|
|
|
-<template>
|
|
|
- <div class="app-container">
|
|
|
- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
- <el-form-item label="标题" prop="phone">
|
|
|
- <el-input
|
|
|
- v-model="queryParams.header"
|
|
|
- placeholder="请输入标题"
|
|
|
- clearable
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="电话" prop="phone">
|
|
|
- <el-input
|
|
|
- v-model="queryParams.phone"
|
|
|
- placeholder="请输入电话"
|
|
|
- clearable
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="审核状态" prop="status">
|
|
|
- <el-select clearable v-model="queryParams.status" placeholder="请选择">
|
|
|
- <el-option v-for="dict in dict.type.review_status" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="领取状态" prop="lostFoundStatus">
|
|
|
- <el-select clearable v-if="type == 'swzl'" v-model="queryParams.lostFoundStatus" placeholder="请选择">
|
|
|
- <el-option v-for="dict in dict.type.claim_status" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
|
|
- </el-select>
|
|
|
- <el-select clearable v-if="type == 'xwqs'" v-model="queryParams.lostFoundStatus" placeholder="请选择">
|
|
|
- <el-option v-for="dict in dict.type.lookfor_status" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item>
|
|
|
- <el-button type="primary" icon="el-icon-search" size="mini" @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
|
|
|
- type="primary"
|
|
|
- plain
|
|
|
- icon="el-icon-plus"
|
|
|
- size="mini"
|
|
|
- @click="handleAdd"
|
|
|
- v-hasPermi="['lostfound:lostfound:add']"
|
|
|
- >新增</el-button>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
-
|
|
|
- <el-table v-loading="loading" :data="lostfoundList" @selection-change="handleSelectionChange">
|
|
|
- <el-table-column type="selection" width="55" align="center" />
|
|
|
- <el-table-column label="标题" align="center" prop="header" />
|
|
|
- <el-table-column label="图片" align="center" prop="photo" width="100">
|
|
|
- <template slot-scope="scope">
|
|
|
- <image-preview :src="scope.row.photo" :width="50" :height="50"/>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="地点" align="center" prop="place" />
|
|
|
- <el-table-column label="时间" align="center" prop="findTime" width="180">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>{{ parseTime(scope.row.findTime, '{y}-{m}-{d}') }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="电话" align="center" prop="phone" />
|
|
|
- <el-table-column label="审核状态" align="center" prop="statusText" />
|
|
|
- <el-table-column label="领取状态" align="center" prop="lostFoundStatusText" />
|
|
|
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button
|
|
|
- size="mini"
|
|
|
- type="text"
|
|
|
- icon="el-icon-check"
|
|
|
- @click="handleVerify({ ...scope.row, verify: '0' })"
|
|
|
- v-if="scope.row.status == '0'"
|
|
|
- >通过</el-button>
|
|
|
- <el-button
|
|
|
- size="mini"
|
|
|
- type="text"
|
|
|
- icon="el-icon-check"
|
|
|
- @click="handleVerify({ ...scope.row, verify: '1' })"
|
|
|
- v-if="scope.row.status == '0'"
|
|
|
- >驳回</el-button>
|
|
|
- <el-button
|
|
|
- size="mini"
|
|
|
- type="text"
|
|
|
- icon="el-icon-edit"
|
|
|
- @click="handleUpdate(scope.row)"
|
|
|
- >修改</el-button>
|
|
|
- <el-button
|
|
|
- size="mini"
|
|
|
- type="text"
|
|
|
- icon="el-icon-delete"
|
|
|
- @click="handleDelete(scope.row)"
|
|
|
- >删除</el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
-
|
|
|
- <pagination
|
|
|
- v-show="total>0"
|
|
|
- :total="total"
|
|
|
- :page.sync="queryParams.pageNum"
|
|
|
- :limit.sync="queryParams.pageSize"
|
|
|
- @pagination="getList"
|
|
|
- />
|
|
|
-
|
|
|
- <!-- 添加或修改失物寻物对话框 -->
|
|
|
- <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
|
- <el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
- <el-form-item label="标题" prop="header">
|
|
|
- <el-input v-model="form.header" type="text" placeholder="请输入内容" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="图片">
|
|
|
- <image-upload :limit="1" v-model="form.photo"/>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="描述" prop="description">
|
|
|
- <el-input v-model="form.description" type="textarea" placeholder="请输入内容" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="领取状态" prop="origin">
|
|
|
- <el-select v-if="type == 'swzl'" v-model="form.lostFoundStatus" placeholder="请选择">
|
|
|
- <el-option v-for="dict in dict.type.claim_status" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
|
|
- </el-select>
|
|
|
- <el-select v-if="type == 'xwqs'" v-model="form.lostFoundStatus" placeholder="请选择">
|
|
|
- <el-option v-for="dict in dict.type.lookfor_status" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <!-- <el-form-item label="审核人" prop="reviewBy">
|
|
|
- <el-input v-model="form.reviewBy" placeholder="请输入审核人" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="审核时间" prop="reviewTime">
|
|
|
- <el-date-picker clearable
|
|
|
- v-model="form.reviewTime"
|
|
|
- type="date"
|
|
|
- value-format="yyyy-MM-dd"
|
|
|
- placeholder="请选择审核时间">
|
|
|
- </el-date-picker>
|
|
|
- </el-form-item> -->
|
|
|
- <!-- <el-form-item label="备注" prop="remark">
|
|
|
- <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
|
|
- </el-form-item> -->
|
|
|
- <el-form-item label="地点" prop="place">
|
|
|
- <el-input v-model="form.place" type="textarea" placeholder="请输入内容" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="时间" prop="findTime">
|
|
|
- <el-date-picker clearable
|
|
|
- v-model="form.findTime"
|
|
|
- type="datetime"
|
|
|
- value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
- placeholder="请选择时间">
|
|
|
- </el-date-picker>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="电话" prop="phone">
|
|
|
- <el-input v-model="form.phone" placeholder="请输入电话" />
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- <div slot="footer" class="dialog-footer">
|
|
|
- <el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
- <el-button @click="cancel">取 消</el-button>
|
|
|
- </div>
|
|
|
- </el-dialog>
|
|
|
- </div>
|
|
|
-</template>
|
|
|
-
|
|
|
-<script>
|
|
|
-import { listLostfound, getLostfound, delLostfound, addLostfound, updateLostfound, verifyLostfound } from "@/api/lostfound/lostfound";
|
|
|
-
|
|
|
-export default {
|
|
|
- name: "Lostfound",
|
|
|
- dicts: ['review_status', 'claim_status', 'lookfor_status'],
|
|
|
- data() {
|
|
|
- return {
|
|
|
- // 遮罩层
|
|
|
- loading: true,
|
|
|
- // 选中数组
|
|
|
- ids: [],
|
|
|
- // 非单个禁用
|
|
|
- single: true,
|
|
|
- // 非多个禁用
|
|
|
- multiple: true,
|
|
|
- // 显示搜索条件
|
|
|
- showSearch: true,
|
|
|
- // 总条数
|
|
|
- total: 0,
|
|
|
- // 失物寻物表格数据
|
|
|
- lostfoundList: [],
|
|
|
- // 弹出层标题
|
|
|
- title: "",
|
|
|
- // 是否显示弹出层
|
|
|
- open: false,
|
|
|
- // 查询参数
|
|
|
- queryParams: {
|
|
|
- pageNum: 1,
|
|
|
- pageSize: 10,
|
|
|
- header: null,
|
|
|
- photo: null,
|
|
|
- description: null,
|
|
|
- type: null,
|
|
|
- origin: null,
|
|
|
- status: null,
|
|
|
- lostFoundStatus: null,
|
|
|
- reviewBy: null,
|
|
|
- reviewTime: null,
|
|
|
- place: null,
|
|
|
- findTime: null,
|
|
|
- phone: null
|
|
|
- },
|
|
|
- // 表单参数
|
|
|
- form: {},
|
|
|
- // 表单校验
|
|
|
- rules: {
|
|
|
- },
|
|
|
- type: ''
|
|
|
- };
|
|
|
- },
|
|
|
- created() {
|
|
|
- const { type } = this.$route.query;
|
|
|
- this.type = type;
|
|
|
- this.queryParams.type = type;
|
|
|
- this.getList();
|
|
|
- },
|
|
|
- methods: {
|
|
|
- // 失物招领审核
|
|
|
- handleVerify(row){
|
|
|
- const _this = this;
|
|
|
- if (row.verify == '0') {
|
|
|
- this.$modal.confirm('是否确认审核"' + row.header + '"数据项?').then(function() {
|
|
|
- return verifyLostfound({ type: _this.type, id: row.id, status: '1' });
|
|
|
- }).then(() => {
|
|
|
- this.getList();
|
|
|
- this.$modal.msgSuccess("审核成功");
|
|
|
- }).catch(() => {});
|
|
|
- } else {
|
|
|
- this.$modal.prompt('请输入驳回原因').then(({ value }) => {
|
|
|
- return verifyLostfound({ type: _this.type, id: row.id, status: '2', remark: value });
|
|
|
- }).then(() => {
|
|
|
- this.getList();
|
|
|
- this.$modal.msgSuccess("驳回成功");
|
|
|
- }).catch(() => {});
|
|
|
- }
|
|
|
- },
|
|
|
- /** 查询失物寻物列表 */
|
|
|
- getList() {
|
|
|
- this.loading = true;
|
|
|
- listLostfound(this.queryParams).then(response => {
|
|
|
- this.lostfoundList = response.rows.map(e => {
|
|
|
- const dict = this.dict.type.review_status.find(j => j.value == e.status);
|
|
|
- e.statusText = dict.label;
|
|
|
- const lostFoundStatuDict = this.type == 'swzl' ? this.dict.type.claim_status.find(j => j.value == e.lostFoundStatus) : this.dict.type.lookfor_status.find(j => j.value == e.lostFoundStatus);
|
|
|
- e.lostFoundStatusText = lostFoundStatuDict.label;
|
|
|
- return e;
|
|
|
- });
|
|
|
- this.total = response.total;
|
|
|
- this.loading = false;
|
|
|
- });
|
|
|
- },
|
|
|
- // 取消按钮
|
|
|
- cancel() {
|
|
|
- this.open = false;
|
|
|
- this.reset();
|
|
|
- },
|
|
|
- // 表单重置
|
|
|
- reset() {
|
|
|
- this.form = {
|
|
|
- id: null,
|
|
|
- header: null,
|
|
|
- photo: null,
|
|
|
- description: null,
|
|
|
- type: null,
|
|
|
- origin: null,
|
|
|
- status: null,
|
|
|
- lostFoundStatus: null,
|
|
|
- createBy: null,
|
|
|
- createTime: null,
|
|
|
- updateBy: null,
|
|
|
- updateTime: null,
|
|
|
- reviewBy: null,
|
|
|
- reviewTime: null,
|
|
|
- remark: null,
|
|
|
- place: null,
|
|
|
- findTime: null,
|
|
|
- phone: null
|
|
|
- };
|
|
|
- this.resetForm("form");
|
|
|
- },
|
|
|
- /** 搜索按钮操作 */
|
|
|
- handleQuery() {
|
|
|
- this.queryParams.pageNum = 1;
|
|
|
- this.getList();
|
|
|
- },
|
|
|
- /** 重置按钮操作 */
|
|
|
- resetQuery() {
|
|
|
- this.resetForm("queryForm");
|
|
|
- this.handleQuery();
|
|
|
- },
|
|
|
- // 多选框选中数据
|
|
|
- handleSelectionChange(selection) {
|
|
|
- this.ids = selection.map(item => item.id)
|
|
|
- this.single = selection.length!==1
|
|
|
- this.multiple = !selection.length
|
|
|
- },
|
|
|
- /** 新增按钮操作 */
|
|
|
- handleAdd() {
|
|
|
- this.reset();
|
|
|
- this.open = true;
|
|
|
- this.title = this.type == 'swzl' ? '添加失物招领' : "添加寻物启事";
|
|
|
- },
|
|
|
- /** 修改按钮操作 */
|
|
|
- handleUpdate(row) {
|
|
|
- this.reset();
|
|
|
- getLostfound({ type: this.type, id: row.id}).then(response => {
|
|
|
- this.form = response.data;
|
|
|
- this.open = true;
|
|
|
- this.title = this.type == 'swzl' ? '修改失物招领' : "修改寻物启事";
|
|
|
- });
|
|
|
- },
|
|
|
- /** 提交按钮 */
|
|
|
- submitForm() {
|
|
|
- this.$refs["form"].validate(valid => {
|
|
|
- if (valid) {
|
|
|
- this.form.type = this.type;
|
|
|
- if (this.form.id != null) {
|
|
|
- updateLostfound(this.form).then(response => {
|
|
|
- this.$modal.msgSuccess("修改成功");
|
|
|
- this.open = false;
|
|
|
- this.getList();
|
|
|
- });
|
|
|
- } else {
|
|
|
- addLostfound(this.form).then(response => {
|
|
|
- this.$modal.msgSuccess("新增成功");
|
|
|
- this.open = false;
|
|
|
- this.getList();
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- /** 删除按钮操作 */
|
|
|
- handleDelete(row) {
|
|
|
- const _this = this;
|
|
|
- this.$modal.confirm('是否确认删除"' + row.header + '"数据项?').then(function() {
|
|
|
- return delLostfound({type: _this.type, id: row.id});
|
|
|
- }).then(() => {
|
|
|
- this.getList();
|
|
|
- this.$modal.msgSuccess("删除成功");
|
|
|
- }).catch(() => {});
|
|
|
- }
|
|
|
- }
|
|
|
-};
|
|
|
-</script>
|