1.0.3 的相关功能
This commit is contained in:
@@ -179,6 +179,41 @@
|
||||
<el-dialog v-model="detailDialogVisible" title="详情">
|
||||
<div v-if="detailRow" v-html="detailRow.desc_collect" class="detils-content"></div>
|
||||
</el-dialog>
|
||||
<el-dialog v-model="reportDialogVisible" title="标记无效" width="600px">
|
||||
<el-form :model="reportForm" label-width="80px">
|
||||
<el-form-item label="描述">
|
||||
<el-input
|
||||
v-model="reportForm.desc"
|
||||
type="textarea"
|
||||
:rows="4"
|
||||
placeholder="请输入无效原因或说明"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="附件">
|
||||
<el-upload
|
||||
v-model:file-list="reportFileList"
|
||||
:headers="uploadHeaders"
|
||||
:action="reportUploadAction"
|
||||
multiple
|
||||
:limit="9"
|
||||
:on-success="handleReportUploadSuccess"
|
||||
:on-exceed="handleReportExceed"
|
||||
:on-remove="removeReportFile"
|
||||
>
|
||||
<el-button type="primary">上传附件</el-button>
|
||||
<!-- <template #tip>
|
||||
<div class="el-upload__tip">支持图片、视频或文件</div>
|
||||
</template> -->
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="reportDialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="submitReport">确定</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@@ -186,6 +221,7 @@
|
||||
import { Plus } from '@element-plus/icons-vue'
|
||||
import { CrmService } from '@/api/crmApi'
|
||||
import { useAuth } from '@/composables/useAuth'
|
||||
import { useUploadHeaders } from '@/composables/useUploadHeaders'
|
||||
const { hasAuth } = useAuth()
|
||||
const searchValue = ref('')
|
||||
const selectValue = ref('')
|
||||
@@ -195,6 +231,11 @@
|
||||
const loading = ref(false)
|
||||
const detailDialogVisible = ref(false)
|
||||
const detailRow = ref<any>(null)
|
||||
const reportDialogVisible = ref(false)
|
||||
const reportForm = reactive({ id: '', desc: '' })
|
||||
const reportFileList = ref<any[]>([])
|
||||
const { uploadHeaders } = useUploadHeaders()
|
||||
const reportUploadAction = `${import.meta.env.VITE_API_URL}/ticket/upload`
|
||||
const pagination = reactive({
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
@@ -335,19 +376,32 @@
|
||||
}
|
||||
// 标记无效
|
||||
const reportfn = (row: any) => {
|
||||
ElMessageBox.confirm('确定要标记无效吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
reportForm.id = row.id
|
||||
reportForm.desc = ''
|
||||
reportFileList.value = []
|
||||
reportDialogVisible.value = true
|
||||
}
|
||||
const handleReportUploadSuccess = (_response: any, _file: any, fileList: any[]) => {
|
||||
reportFileList.value = fileList
|
||||
}
|
||||
const handleReportExceed = () => {
|
||||
ElMessage.warning('最多可上传 9 个附件')
|
||||
}
|
||||
const removeReportFile = (_file: any, fileList: any[]) => {
|
||||
reportFileList.value = fileList
|
||||
}
|
||||
const submitReport = async () => {
|
||||
const attachments = reportFileList.value
|
||||
.map((f: any) => f?.response?.data?.file_name)
|
||||
.filter(Boolean)
|
||||
const res = await CrmService.customerReport({
|
||||
id: reportForm.id,
|
||||
remark: reportForm.desc,
|
||||
img: attachments
|
||||
})
|
||||
.then(async () => {
|
||||
const res = await CrmService.customerReport({ id: row.id })
|
||||
ElMessage.success(res?.message || '提交成功!')
|
||||
gettableList()
|
||||
})
|
||||
.catch(() => {
|
||||
// 用户点击了取消
|
||||
})
|
||||
ElMessage.success(res?.message || '提交成功!')
|
||||
reportDialogVisible.value = false
|
||||
gettableList()
|
||||
}
|
||||
function processImages(html: string) {
|
||||
const parser = new DOMParser()
|
||||
|
||||
Reference in New Issue
Block a user