优化供应商导出功能

This commit is contained in:
季圣华 2021-10-12 00:41:53 +08:00
parent ed58d997b5
commit 96a6f5fb0f
6 changed files with 59 additions and 20 deletions

View File

@ -43,7 +43,7 @@
<a-button type="primary" icon="import">导入</a-button>
</a-popover>
</a-upload>
<a-button type="primary" icon="download" @click="handleExportXls('客户信息')">导出</a-button>
<a-button type="primary" @click="exportExcel" icon="download">导出</a-button>
<a-dropdown>
<a-menu slot="overlay">
<a-menu-item key="1" v-if="btnEnableList.indexOf(1)>-1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
@ -93,6 +93,7 @@
<script>
import CustomerModal from './modules/CustomerModal'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { openDownloadDialog, sheet2blob} from "@/utils/util"
import JDate from '@/components/jeecg/JDate'
export default {
name: "CustomerList",
@ -117,6 +118,9 @@
telephone:'',
phonenum:''
},
ipagination:{
pageSizeOptions: ['10', '20', '30', '100', '200']
},
// 表头
columns: [
{
@ -133,6 +137,7 @@
{ title: '联系人', dataIndex: 'contacts',width:70,align:"center"},
{ title: '手机号码', dataIndex: 'telephone',width:100,align:"center"},
{ title: '联系电话', dataIndex: 'phoneNum',width:100,align:"center"},
{ title: '电子邮箱', dataIndex: 'email',width:150,align:"center"},
{ title: '期初应收',dataIndex: 'beginNeedGet',width:80,align:"center"},
{ title: '期末应收',dataIndex: 'allNeedGet',width:80,align:"center"},
{ title: '税率(%)', dataIndex: 'taxRate',width:80,align:"center"},
@ -152,7 +157,6 @@
delete: "/supplier/delete",
deleteBatch: "/supplier/deleteBatch",
importExcelUrl: "/supplier/importExcel",
exportXlsUrl: "/supplier/exportExcel",
batchSetStatusUrl: "/supplier/batchSetStatus"
}
}
@ -176,6 +180,15 @@
if(this.btnEnableList.indexOf(1)===-1) {
this.$refs.modalForm.isReadOnly = true
}
},
exportExcel() {
let aoa = [['名称', '联系人', '手机号码', '联系电话', '电子邮箱', '期初应付', '期末应付', '税率(%)']]
for (let i = 0; i < this.dataSource.length; i++) {
let ds = this.dataSource[i]
let item = [ds.supplier, ds.contacts, ds.telephone, ds.phoneNum, ds.email, ds.beginNeedPay, ds.allNeedPay, ds.taxRate]
aoa.push(item)
}
openDownloadDialog(sheet2blob(aoa), '客户信息')
}
}
}

View File

@ -42,7 +42,7 @@
<a-button type="primary" icon="import">导入</a-button>
</a-popover>
</a-upload>
<a-button type="primary" icon="download" @click="handleExportXls('会员信息')">导出</a-button>
<a-button type="primary" @click="exportExcel" icon="download">导出</a-button>
<a-dropdown>
<a-menu slot="overlay">
<a-menu-item key="1" v-if="btnEnableList.indexOf(1)>-1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
@ -92,6 +92,7 @@
<script>
import MemberModal from './modules/MemberModal'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { openDownloadDialog, sheet2blob} from "@/utils/util"
import JDate from '@/components/jeecg/JDate'
export default {
name: "MemberList",
@ -116,6 +117,9 @@
telephone:'',
phonenum:''
},
ipagination:{
pageSizeOptions: ['10', '20', '30', '100', '200']
},
// 表头
columns: [
{
@ -130,8 +134,9 @@
},
{ title: '名称',dataIndex: 'supplier',width:150},
{ title: '联系人', dataIndex: 'contacts',width:70,align:"center"},
{ title: '手机号码', dataIndex: 'telephone',width:110,align:"center"},
{ title: '手机号码', dataIndex: 'telephone',width:100,align:"center"},
{ title: '联系电话', dataIndex: 'phoneNum',width:100,align:"center"},
{ title: '电子邮箱', dataIndex: 'email',width:150,align:"center"},
{ title: '预付款',dataIndex: 'advanceIn',width:70,align:"center"},
{ title: '状态',dataIndex: 'enabled',width:70,align:"center",
scopedSlots: { customRender: 'customRenderFlag' }
@ -149,7 +154,6 @@
delete: "/supplier/delete",
deleteBatch: "/supplier/deleteBatch",
importExcelUrl: "/supplier/importExcel",
exportXlsUrl: "/supplier/exportExcel",
batchSetStatusUrl: "/supplier/batchSetStatus"
}
}
@ -173,6 +177,15 @@
if(this.btnEnableList.indexOf(1)===-1) {
this.$refs.modalForm.isReadOnly = true
}
},
exportExcel() {
let aoa = [['名称', '联系人', '手机号码', '联系电话', '电子邮箱', '预付款']]
for (let i = 0; i < this.dataSource.length; i++) {
let ds = this.dataSource[i]
let item = [ds.supplier, ds.contacts, ds.telephone, ds.phoneNum, ds.email, ds.advanceIn]
aoa.push(item)
}
openDownloadDialog(sheet2blob(aoa), '会员信息')
}
}
}

View File

@ -42,7 +42,7 @@
<a-button type="primary" icon="import">导入</a-button>
</a-popover>
</a-upload>
<a-button type="primary" icon="download" @click="handleExportXls('供应商信息')">导出</a-button>
<a-button type="primary" @click="exportExcel" icon="download">导出</a-button>
<a-dropdown>
<a-menu slot="overlay">
<a-menu-item key="1" v-if="btnEnableList.indexOf(1)>-1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
@ -92,6 +92,7 @@
<script>
import VendorModal from './modules/VendorModal'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { openDownloadDialog, sheet2blob} from "@/utils/util"
import JDate from '@/components/jeecg/JDate'
export default {
name: "VendorList",
@ -116,6 +117,9 @@
telephone:'',
phonenum:''
},
ipagination:{
pageSizeOptions: ['10', '20', '30', '100', '200']
},
// 表头
columns: [
{
@ -130,8 +134,9 @@
},
{ title: '名称',dataIndex: 'supplier',width:150},
{ title: '联系人', dataIndex: 'contacts',width:70,align:"center"},
{ title: '手机号码', dataIndex: 'telephone',width:110,align:"center"},
{ title: '手机号码', dataIndex: 'telephone',width:100,align:"center"},
{ title: '联系电话', dataIndex: 'phoneNum',width:100,align:"center"},
{ title: '电子邮箱', dataIndex: 'email',width:150,align:"center"},
{ title: '期初应付',dataIndex: 'beginNeedPay',width:80,align:"center"},
{ title: '期末应付',dataIndex: 'allNeedPay',width:80,align:"center"},
{ title: '税率(%)', dataIndex: 'taxRate',width:80,align:"center"},
@ -151,7 +156,6 @@
delete: "/supplier/delete",
deleteBatch: "/supplier/deleteBatch",
importExcelUrl: "/supplier/importExcel",
exportXlsUrl: "/supplier/exportExcel",
batchSetStatusUrl: "/supplier/batchSetStatus"
}
}
@ -175,6 +179,15 @@
if(this.btnEnableList.indexOf(1)===-1) {
this.$refs.modalForm.isReadOnly = true
}
},
exportExcel() {
let aoa = [['名称', '联系人', '手机号码', '联系电话', '电子邮箱', '期初应付', '期末应付', '税率(%)']]
for (let i = 0; i < this.dataSource.length; i++) {
let ds = this.dataSource[i]
let item = [ds.supplier, ds.contacts, ds.telephone, ds.phoneNum, ds.email, ds.beginNeedPay, ds.allNeedPay, ds.taxRate]
aoa.push(item)
}
openDownloadDialog(sheet2blob(aoa), '供应商信息')
}
}
}

View File

@ -32,13 +32,13 @@
</a-form-item>
</a-col>
<a-col :span="24/2">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="电子邮箱">
<a-input placeholder="请输入电子邮箱" v-decorator.trim="[ 'email' ]" />
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="联系电话">
<a-input placeholder="请输入联系电话" v-decorator.trim="[ 'phoneNum' ]" />
</a-form-item>
</a-col>
<a-col :span="24/2">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="联系电话">
<a-input placeholder="请输入联系电话" v-decorator.trim="[ 'phoneNum' ]" />
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="电子邮箱">
<a-input placeholder="请输入电子邮箱" v-decorator.trim="[ 'email' ]" />
</a-form-item>
</a-col>
<a-col :span="24/2">

View File

@ -32,13 +32,13 @@
</a-form-item>
</a-col>
<a-col :span="24/2">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="电子邮箱">
<a-input placeholder="请输入电子邮箱" v-decorator.trim="[ 'email' ]" />
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="联系电话">
<a-input placeholder="请输入联系电话" v-decorator.trim="[ 'phoneNum' ]" />
</a-form-item>
</a-col>
<a-col :span="24/2">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="联系电话">
<a-input placeholder="请输入联系电话" v-decorator.trim="[ 'phoneNum' ]" />
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="电子邮箱">
<a-input placeholder="请输入电子邮箱" v-decorator.trim="[ 'email' ]" />
</a-form-item>
</a-col>
<a-col :span="24/2">

View File

@ -32,13 +32,13 @@
</a-form-item>
</a-col>
<a-col :span="24/2">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="电子邮箱">
<a-input placeholder="请输入电子邮箱" v-decorator.trim="[ 'email' ]" />
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="联系电话">
<a-input placeholder="请输入联系电话" v-decorator.trim="[ 'phoneNum' ]" />
</a-form-item>
</a-col>
<a-col :span="24/2">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="联系电话">
<a-input placeholder="请输入联系电话" v-decorator.trim="[ 'phoneNum' ]" />
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="电子邮箱">
<a-input placeholder="请输入电子邮箱" v-decorator.trim="[ 'email' ]" />
</a-form-item>
</a-col>
<a-col :span="24/2">