generated from Leo_Ding/web-template
核销记录添加搜索条件和导出功能
This commit is contained in:
parent
899b75ed27
commit
be2c76d9bc
@ -231,7 +231,6 @@ async function handleExport() {
|
||||
}
|
||||
// 注意添加 { responseType: 'blob' }
|
||||
const response = await apis.activity.exportFile({ activityId })
|
||||
console.log(response)
|
||||
const url = window.URL.createObjectURL(new Blob([response]))
|
||||
const link = document.createElement('a')
|
||||
link.href = url
|
||||
|
||||
@ -10,6 +10,11 @@
|
||||
<a-select-option :value="2">盐城</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col >
|
||||
<a-form-item label="手机号" name="customerPhone" style="width: 500px;">
|
||||
<a-input v-model:value="searchFormData.customerPhone"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col >
|
||||
<a-space>
|
||||
|
||||
@ -432,7 +432,7 @@ async function handleEdit(record = {}) {
|
||||
price: data.price,
|
||||
status: data.status,
|
||||
basicArea: data.area,
|
||||
disclaimerContain: decryptString(data.disclaimerContain),
|
||||
|
||||
title: data.title,
|
||||
videos: data.videos ? data.videos.map(item => config('http.apiBasic') + item) : [],
|
||||
advisers: data.advisers ? data.advisers.map(item => ({ adviserName: item.name, adviserPhone: item.phone, adviserImg: item.avatar ? [config('http.apiBasic') + item.avatar] : [] })) : [{ adviserName: '', adviserPhone: '', adviserImg: [] },
|
||||
@ -468,6 +468,7 @@ async function handleEdit(record = {}) {
|
||||
lifeNum: data.surroundings && data.surroundings.lifeNum,
|
||||
metroNum: data.surroundings && data.surroundings.metroNum,
|
||||
schoolNum: data.surroundings && data.surroundings.schoolNum,
|
||||
disclaimerContain: decryptString(data.disclaimerContain),
|
||||
}
|
||||
} catch (error) {
|
||||
message.error({ content: error.message })
|
||||
|
||||
@ -1,21 +1,16 @@
|
||||
<template>
|
||||
<!-- <x-search-bar class="mb-8-2">
|
||||
<x-search-bar class="mb-8-2">
|
||||
<template #default="{ gutter, colSpan }">
|
||||
<a-form :model="searchFormData" layout="inline">
|
||||
<a-row :gutter="gutter">
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="岗位名称" name="name">
|
||||
<a-input placeholder="请输入岗位名称" v-model:value="searchFormData.name"></a-input>
|
||||
<a-form-item label="客户电话" name="customerPhone">
|
||||
<a-input placeholder="请输入客户电话" v-model:value="searchFormData.customerPhone"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="状态" name="status">
|
||||
<a-select v-model:value="searchFormData.status" allowClear>
|
||||
<a-select-option value="">全部</a-select-option>
|
||||
<a-select-option value="enabled">启用</a-select-option>
|
||||
<a-select-option value="disabled">停用</a-select-option>
|
||||
</a-select>
|
||||
<a-form-item label="所属日期" name="signDate">
|
||||
<a-month-picker v-model:value="searchFormData.signDate" @change="handleDateChange"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col class="align-right" v-bind="colSpan">
|
||||
@ -29,10 +24,16 @@
|
||||
</a-row>
|
||||
</a-form>
|
||||
</template>
|
||||
</x-search-bar> -->
|
||||
</x-search-bar>
|
||||
<a-row :gutter="8" :wrap="false">
|
||||
<a-col flex="auto">
|
||||
|
||||
<a-card type="flex">
|
||||
<div class="exportExcel" style="margin-bottom: 10px;">
|
||||
<a-button type="primary">
|
||||
<a :href='config("http.apiBasic") + `/api/v1/sign-in-dailies/excl?signYear=${signYear}&signMonth=${signMonth}`'>导出Excel</a>
|
||||
</a-button>
|
||||
</div>
|
||||
<a-table :columns="columns" :data-source="listData" bordered="true" :loading="loading"
|
||||
:pagination="paginationState" :scroll="{ x: 1000 }" @change="onTableChange">
|
||||
<template #bodyCell="{ column, record }">
|
||||
@ -89,6 +90,8 @@ import { usePagination } from '@/hooks'
|
||||
import { PlusOutlined, EditOutlined, DeleteOutlined } from '@ant-design/icons-vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { signInEnum } from "@/enums/useEnum"
|
||||
const signYear=ref('')
|
||||
const signMonth=ref('')
|
||||
defineOptions({
|
||||
name: 'signInSet',
|
||||
})
|
||||
@ -110,6 +113,7 @@ getPageList()
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
async function getPageList() {
|
||||
console.log(searchFormData.value)
|
||||
try {
|
||||
showLoading()
|
||||
const { pageSize, current } = paginationState
|
||||
@ -131,7 +135,20 @@ async function getPageList() {
|
||||
hideLoading()
|
||||
}
|
||||
}
|
||||
|
||||
function handleDateChange(date, dateString) {
|
||||
if (dateString) {
|
||||
const [year, month] = dateString.split('-')
|
||||
signYear.value = Number(year)
|
||||
signMonth.value = Number(month)
|
||||
searchFormData.value.signYear = signYear.value
|
||||
searchFormData.value.signMonth = signMonth.value
|
||||
} else {
|
||||
signYear.value = ''
|
||||
signMonth.value = ''
|
||||
searchFormData.value.signYear = ''
|
||||
searchFormData.value.signMonth = ''
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@ -144,11 +161,11 @@ function handleDelete(params) {
|
||||
return new Promise((resolve, reject) => {
|
||||
; (async () => {
|
||||
try {
|
||||
const form={
|
||||
const form = {
|
||||
...params,
|
||||
status:'success'
|
||||
status: 'success'
|
||||
}
|
||||
const { success } = await apis.signIn.updateSingInItem(form.id,form).catch(() => {
|
||||
const { success } = await apis.signIn.updateSingInItem(form.id, form).catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
if (config('http.code.success') === success) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user