莳松crm管理系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ss-crm-manage-web/src/views/Clue/Order/Comp/AfterSales.vue

252 lines
7.4 KiB

10 months ago
<template>
<div>
<el-form :model="searchForm" label-width="0" inline>
<el-form-item>
10 months ago
<el-input v-model="searchForm.signId" placeholder="成交单号" clearable />
10 months ago
</el-form-item>
<el-form-item>
10 months ago
<el-input v-model="searchForm.name" placeholder="线索名称" clearable />
10 months ago
</el-form-item>
<el-form-item>
10 months ago
<el-select v-model="searchForm.state" placeholder="审核状态" clearable>
<el-option label="待审核" :value="1" />
<el-option label="已撤销" :value="2" />
<el-option label="已通过" :value="3" />
<el-option label="已驳回" :value="4" />
</el-select>
</el-form-item>
<el-form-item>
<el-select v-model="searchForm.signUser" placeholder="登记人" clearable filterable>
10 months ago
<el-option
v-for="item in userOptions"
:key="item.id"
:label="item.nickname"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-date-picker
v-model="searchForm.dealDate"
type="daterange"
10 months ago
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
10 months ago
range-separator="-"
10 months ago
start-placeholder="成交日期"
end-placeholder="成交日期"
10 months ago
/>
</el-form-item>
<el-form-item>
10 months ago
<el-select v-model="searchForm.applyUser" placeholder="申请人" clearable filterable>
10 months ago
<el-option
v-for="item in userOptions"
:key="item.id"
:label="item.nickname"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-date-picker
10 months ago
v-model="searchForm.applyTime"
10 months ago
type="daterange"
10 months ago
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
10 months ago
range-separator="-"
start-placeholder="申请日期"
end-placeholder="申请日期"
/>
</el-form-item>
<el-form-item>
<el-button @click="handleSearch">查询</el-button>
<el-button @click="handleReset">重置</el-button>
<el-button @click="batchAudit">批量审核</el-button>
</el-form-item>
</el-form>
10 months ago
<el-table
v-loading="loading"
:data="tableList"
border
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" :selectable="(row) => row.state == 1" />
10 months ago
<el-table-column prop="signId" label="成交单号" min-width="150px" />
<el-table-column prop="name" label="线索名称" min-width="200px" />
<el-table-column prop="phone" label="联系方式" min-width="150px" />
<el-table-column prop="reason" label="售后原因" min-width="150px" />
<el-table-column prop="refundAmount" label="退款金额" min-width="90px" />
9 months ago
<el-table-column prop="percentageDeductAmount" label="提成扣款" min-width="90px" />
<el-table-column prop="isCompanyReceipts" label="是否公司收款" min-width="120px" />
10 months ago
<el-table-column prop="isReturns" label="是否退货" min-width="90px" />
<el-table-column prop="solution" label="解决方案" min-width="150px" />
<el-table-column prop="signUserName" label="登记人" min-width="90px" />
10 months ago
<el-table-column
prop="dealDate"
label="成交日期"
min-width="120px"
:formatter="dateFormatter"
/>
10 months ago
<el-table-column prop="applyUserName" label="申请人" min-width="90px" />
10 months ago
<el-table-column
prop="applyTime"
label="申请时间"
min-width="120px"
:formatter="dateFormatter"
/>
10 months ago
<el-table-column prop="stateName" label="审核状态" fixed="right" min-width="90px" />
10 months ago
<el-table-column label="操作" width="150px" fixed="right">
<template #default="{ row }">
<el-button type="primary" style="padding: 0" text @click="handleDetail(row.id)">
详情
</el-button>
10 months ago
<el-button
type="primary"
style="padding: 0"
text
v-if="row.state == 1 && currentUserId == row.applyUser"
v-hasPermi="['clue:order:after-sale']"
@click="handleCancel(row.id)"
>
10 months ago
撤销
</el-button>
10 months ago
<el-button
type="primary"
style="padding: 0"
text
v-if="row.state == 1"
v-hasPermi="['clue:order:after-sale-audit']"
10 months ago
@click="handleAudit(row)"
10 months ago
>
10 months ago
审核
</el-button>
</template>
</el-table-column>
</el-table>
<Pagination
v-model:limit="searchForm.pageSize"
v-model:page="searchForm.pageNo"
:total="total"
@pagination="getList"
/>
10 months ago
<DialogAfterSaleAudit ref="afterSaleAuditDialog" @success="getList" />
10 months ago
<DialogAfterSaleDetail ref="afterSaleDetailDialog" />
<DialogBatchAudit ref="batchAuditDialog" @success="getList" />
10 months ago
</div>
</template>
<script setup name="AfterSales">
10 months ago
import * as AfterSaleApi from '@/api/clue/afterSale'
import { getSimpleUserList as getUserOption } from '@/api/system/user'
import { useUserStore } from '@/store/modules/user'
10 months ago
import DialogAfterSaleAudit from './DialogAfterSaleAudit.vue'
10 months ago
import DialogAfterSaleDetail from './DialogAfterSaleDetail.vue'
import DialogBatchAudit from './DialogBatchAudit.vue'
10 months ago
9 months ago
import { removeNullField } from '@/utils'
10 months ago
import { dateFormatter } from '@/utils/formatTime'
10 months ago
const afterSaleAuditDialog = ref()
10 months ago
const userStore = useUserStore()
const message = useMessage() // 消息弹窗
const currentUserId = userStore.getUser.id
10 months ago
const searchForm = ref({
signId: undefined,
name: undefined,
dealDate: [],
10 months ago
state: undefined,
10 months ago
dealUser: undefined,
createDate: [],
createUser: undefined,
pageNo: 1,
pageSize: 20
})
const userOptions = ref([])
const tableList = ref([])
const total = ref(0)
function handleSearch() {
searchForm.value.pageNo = 1
getList()
}
function handleReset() {
searchForm.value = {
signId: undefined,
name: undefined,
10 months ago
state: undefined,
10 months ago
dealDate: [],
dealUser: undefined,
createDate: [],
createUser: undefined,
pageNo: 1,
pageSize: 20
}
}
10 months ago
const loading = ref(false)
async function getList() {
loading.value = true
try {
9 months ago
const data = await AfterSaleApi.getAfterSalePage(removeNullField(searchForm.value))
10 months ago
tableList.value = data.list
total.value = data.total
} finally {
loading.value = false
}
10 months ago
}
10 months ago
const batchIds = ref([])
function handleSelectionChange(val) {
10 months ago
batchIds.value = val.map((it) => it.id)
10 months ago
}
const batchAuditDialog = ref()
function batchAudit() {
if (batchIds.value.length) {
batchAuditDialog.value.open('aftersale', batchIds.value)
} else {
message.info('请选择表格中需要审核的数据')
}
10 months ago
}
10 months ago
const afterSaleDetailDialog = ref()
10 months ago
function handleDetail(id) {
10 months ago
afterSaleDetailDialog.value.open(id)
10 months ago
}
10 months ago
async function handleCancel(id) {
try {
// 删除的二次确认
await message.confirm('是否确认撤销申请?')
// 发起删除
await AfterSaleApi.cancelApplyAfterSale({ id })
message.success('撤销成功!')
// 刷新列表
await getList()
} catch (err) {
console.log(err)
}
10 months ago
}
10 months ago
function handleAudit(row) {
afterSaleAuditDialog.value.open(row)
10 months ago
}
10 months ago
function getOptions() {
getUserOption().then((data) => {
userOptions.value = data
})
}
10 months ago
onMounted(() => {
10 months ago
getOptions()
10 months ago
handleSearch()
})
</script>
<style lang="scss" scoped></style>