123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330 |
- <template>
- <div class="mainTitle">文章列表</div>
- <br />
- <div class="lists">
- <!-- @click="() => toDetail(item)" -->
- <el-table :data="listTable" style="width: 100%">
- <el-table-column prop="title" label="标题" width="450px" />
- <el-table-column prop="phone" label="用户名" />
- <el-table-column prop="source" label="来源">
- <template #default="scope">
- {{ source[scope.row.source - 1] }}
- </template>
- </el-table-column>
- <el-table-column prop="" label="回复状态">
- <template #default="scope">
- {{ replyFlag[scope.row.replyFlag] }}
- </template>
- </el-table-column>
- <el-table-column prop="createTime" label="更新时间">
- <template #default="scope">
- {{ format(scope.row.createTime) }}
- </template>
- </el-table-column>
- <el-table-column prop="modifyTime" label="推送时间">
- <template #default="scope">
- {{ format(scope.row.modifyTime) }}
- </template>
- </el-table-column>
- <el-table-column prop="clueInfoCount" label="数量" />
- <el-table-column prop="" label="操作" width="200px">
- <template #default="scope">
- <el-popconfirm
- v-if="scope.row.status === 0"
- confirm-button-text="通过"
- cancel-button-text="不通过"
- @confirm="() => confirm(scope)"
- @cancel="() => cancel(scope)"
- title="是否通过该报料?"
- >
- <template #reference>
- <el-button link type="primary" size="small">审核</el-button>
- </template>
- </el-popconfirm>
- <el-button
- link
- type="primary"
- size="small"
- @click="() => lookBL(scope)"
- >
- 查看
- </el-button>
- <el-button
- link
- v-if="scope.row.replyFlag != 1"
- type="primary"
- size="small"
- @click="() => replyBL(scope)"
- >
- 回复
- </el-button>
- <el-popconfirm
- confirm-button-text="删除"
- cancel-button-text="不删除"
- @confirm="() => deleteBL(scope)"
- title="是否删除该报料?"
- >
- <template #reference>
- <el-button link type="danger" size="small"> 删除 </el-button>
- </template>
- </el-popconfirm>
- </template>
- </el-table-column>
- </el-table>
- <el-dialog v-model="reportingDetail" title="报料详情" width="30%">
- <div style="overflow-y: auto">
- <el-row>
- <el-col :span="5">联系方式:</el-col>
- <el-col :span="19">
- <div v-text="reportingDetailData.row.phone"></div>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="5">上报地址:</el-col>
- <el-col :span="19">
- <div v-text="reportingDetailData.row.address"></div>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="5">报料详情:</el-col>
- <el-col :span="19">
- <div
- v-for="(v, i) in reportingDetailData.row.clueInfos"
- :key="i"
- style="padding: 10px 0; position: relative;padding-right: 112px;"
- >
- <span v-if="v.type == 0" v-text="v.materialUrl"></span>
- <img
- v-if="v.type == 1"
- :src="v.localUrl"
- alt="图片丢失"
- style="width: 80px"
- />
- <small
- style="
- color: #999;
- position: absolute;
- right: 0;
- top: 50%;
- transform: translateY(-50%);
- "
- v-text="format(v.addTime)"
- ></small>
- </div>
- </el-col>
- </el-row>
- <el-row
- v-if="
- reportingDetailData.row.clueReplies &&
- reportingDetailData.row.clueReplies.length
- "
- >
- <el-col :span="5">回复内容:</el-col>
- <el-col :span="19">
- <div v-text="reportingDetailData.row.clueReplies[0].content"></div>
- </el-col>
- </el-row>
- </div>
- </el-dialog>
- <el-dialog v-model="reportingReplyStatus" title="回复" width="30%">
- <el-row>
- <el-col :span="5">报料内容:</el-col>
- <el-col :span="19">
- <div
- v-for="(v, i) in reportingDetailData.row.clueInfos"
- :key="i"
- style="padding: 2px 0; position: relative;padding-right: 112px;"
- >
- <span v-if="v.type == 0" v-text="v.materialUrl"></span>
- <img
- v-if="v.type == 1"
- :src="v.localUrl"
- alt="图片丢失"
- style="width: 80px"
- />
- <small
- style="
- color: #999;
- position: absolute;
- right: 0;
- top: 50%;
- transform: translateY(-50%);
- "
- v-text="format(v.addTime)"
- ></small>
- </div>
- </el-col>
- </el-row>
- <br />
- <el-row>
- <el-col :span="5">回复内容:</el-col>
- <el-col :span="19">
- <el-input
- v-model="reportingDetailData.row.reply"
- :rows="2"
- type="textarea"
- placeholder="请输入回复内容"
- />
- </el-col>
- </el-row>
- <template #footer>
- <span class="dialog-footer">
- <el-button type="primary" @click="replySave"> 确定 </el-button>
- </span>
- </template>
- </el-dialog>
- </div>
- </template>
- <script setup>
- import { ref, defineExpose, defineEmits } from 'vue';
- // import { useRouter } from 'vue-router';
- import dayjs from 'dayjs';
- import { ElMessage } from 'element-plus';
- import {
- getreporting,
- delreporting,
- getreportingDetail,
- reportingShenhe,
- reportingReply,
- } from '../../../api/index';
- let T = undefined;
- let total = -1;
- // const router = useRouter();
- const listTable = ref([]);
- const reportingDetail = ref(false);
- const reportingReplyStatus = ref(false);
- const reportingDetailData = ref({});
- const source = ['热线电话', '微信公众号', 'app', '小程序'];
- const replyFlag = ['未回复', '已回复'];
- const emit = defineEmits(['setTotal']);
- const format = value => {
- return dayjs(value).format('YYYY-MM-DD HH:mm:ss');
- };
- // const toDetail = item => {
- // router.push({
- // path: '/analysis_detail',
- // query: {
- // detail: JSON.stringify(item),
- // },
- // });
- // };
- const getlist = search => {
- if (search.page === 1) {
- listTable.value = [];
- total = -1;
- } else if ((search.page - 1) * search.pageSize >= total) return;
- if (T) T = window.clearTimeout(T);
- T = window.setTimeout(() => {
- getreporting({
- data: search,
- })
- .then(res => {
- listTable.value = res.records || [];
- total = res.total || 0;
- emit('setTotal', total);
- if (T) T = window.clearTimeout(T);
- })
- .catch(() => {
- if (T) T = window.clearTimeout(T);
- });
- }, 200);
- };
- const deleteBL = item => {
- delreporting({ data: { id: item.row.id } }).then(() => {
- ElMessage({
- type: 'success',
- message: '删除成功',
- });
- listTable.value.splice(item.$index, 1);
- });
- };
- const lookBL = item => {
- getreportingDetail({ data: { id: item.row.id } }).then(res => {
- reportingDetail.value = true;
- reportingDetailData.value.row = res;
- });
- };
- const replyBL = item => {
- getreportingDetail({ data: { id: item.row.id } }).then(res => {
- reportingReplyStatus.value = true;
- reportingDetailData.value.row = res;
- reportingDetailData.value.$index = item.$index;
- });
- };
- const replySave = () => {
- reportingReplyStatus.value = false;
- reportingReply({
- data: {
- clueId: reportingDetailData.value.row.id,
- content: reportingDetailData.value.row.reply || '',
- userName: reportingReplyStatus.value.author || '',
- },
- }).then(() => {
- listTable.value[reportingDetailData.value.$index].replyFlag = 1;
- });
- };
- const confirm = item => {
- reportingShenhe({ data: { id: item.row.id, status: 1 } }).then(() => {
- ElMessage({
- type: 'success',
- message: '审核通过',
- });
- listTable.value[item.$index].status = 1;
- });
- };
- const cancel = item => {
- reportingShenhe({ data: { id: item.row.id, status: -1 } }).then(() => {
- ElMessage({
- type: 'success',
- message: '拒绝通过',
- });
- listTable.value[item.$index].status = -1;
- });
- };
- defineExpose({
- getlist,
- });
- </script>
- <style scoped>
- .mainTitle {
- padding: 0 20px;
- position: relative;
- line-height: 60px;
- border-bottom: 1px solid #f5f5f5;
- }
- .lists {
- padding: 0.5em;
- }
- .list {
- border-radius: 5px;
- padding: 0.5em;
- cursor: pointer;
- line-height: 1.8em;
- font-size: 14px;
- }
- .list:hover {
- background-color: rgba(64, 158, 255, 0.1);
- }
- .list:not(:last-child) {
- border-bottom: 1px dashed #b9c0d3;
- }
- </style>
- <style>
- .lists .el-row {
- line-height: 2em;
- }
- </style>
|