企业管理--企业管理页面

This commit is contained in:
zhaoxiao
2021-08-23 15:51:38 +08:00
parent 71f2a1241f
commit e48595cf91
4 changed files with 453 additions and 75 deletions
@@ -0,0 +1,149 @@
<template>
<a-card :bordered="false">
<!-- 查询区域-start -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="企业名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
<!-- v-model="queryParam.businessName"-->
<a-input placeholder="请输入企业名称"></a-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span class="table-page-search-submitButtons">
<a-button type="primary" icon="search">查询</a-button>
<a-button icon="reload">重置</a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!-- 查询区域-end-->
<!-- 操作按钮区域-->
<div class="table-operator">
<a-button type="primary" icon="plus" @click="handleAdd">新增</a-button>
<a-button type="primary" icon="import">导入</a-button>
<a-button type="primary" icon="export">导出</a-button>
<a-button type="primary" icon="download">下载模板</a-button>
<a-button type="danger" icon="delete">批量删除</a-button>
</div>
<!-- 操作按钮区域-end-->
<!-- table表格区域-->
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:scroll="{x: 1000}"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange"
class="j-table-force-nowrap">
<template slot="htmlSlot" slot-scope="text">
<div v-html="text"></div>
</template>
<template slot="imgSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
<img v-else :src="getImgView(text)" height="25px" alt=""
style="max-width:80px;font-size: 12px;font-style: italic;"/>
</template>
<template slot="fileSlot" slot-scope="text,record">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<j-ellipsis @click.native="uploadFile(record.chargeNoticeFileId)" style="color:#219AFF;cursor: pointer"
:value="text" :length="20"/>
</template>
<span slot="action" class="action-span-cell" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
<a @click="handleDelete(record.id)">删除</a>
</span>
</a-table>
</div>
<business-mangement-modules ref="modalForm"></business-mangement-modules>
</a-card>
</template>
<script>
import { JeroListMixin } from '@/mixins/JeroListMixin'
import JEllipsis from '@comp/jero/JEllipsis'
import BusinessMangementModules from '@views/businessManagement/modules/BusinessMangementModules'
export default {
name: 'BusinessManagement',
components: { JEllipsis, BusinessMangementModules },
mixins: [JeroListMixin],
data() {
return {
labelCol: {
xs: { span: 24 },
sm: { span: 5 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 10 }
},
columns: [
{
title: '序号',
dataIndex: '',
key: 'rowIndex',
width: 60,
align: 'center',
customRender: function (t, r, index) {
return parseInt(index) + 1
}
}, {
title: '企业名称',
align: 'center',
width: 180,
dataIndex: ''
}, {
title: '公司地址',
align: 'center',
width: 180,
dataIndex: ''
}, {
title: '公司电话',
align: 'center',
dataIndex: ''
}, {
title: '创建时间',
align: 'center',
dataIndex: ''
}, {
title: '银行户名',
align: 'center',
width: 140,
dataIndex: ''
}, {
title: '操作',
dataIndex: 'action',
align: 'center',
fixed: 'right',
width: 160,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: '',
delete: '',
deleteBatch: '',
exportXlsUrl: '',
importExcelUrl: '',
exportTemplateUrl: ''
}
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>
@@ -0,0 +1,215 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
:confirmLoading="confirmLoading"
switchFullscreen
@ok="handleOk"
@cancel="handleCancel"
cancelText="关闭">
<a-spin :spinning="confirmLoading">
<a-form :form="form">
<a-row>
<a-col :xl="12" :sm="24">
<a-form-item label="企业名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入公司名称"
v-decorator="['businessName',validatorRules.businessName]"
:maxLength='50'
@change="e => {e.target.value = (e.target.value + '').trim()}"></a-input>
</a-form-item>
</a-col>
<a-col :xl="12" :sm="24">
<a-form-item label="公司地址" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入公司地址"
:maxLength='50'
@change="e => {e.target.value = (e.target.value + '').trim()}"></a-input>
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :xl="12" :sm="24">
<a-form-item label="公司电话" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入公司电话"
:maxLength='50'
@change="e => {e.target.value = (e.target.value + '').trim()}"></a-input>
</a-form-item>
</a-col>
<a-col :xl="12" :sm="24">
<a-form-item label="邮编" :labelCol="labelCol" :wrapperCol="wrapperCol" class="form-item-postcode">
<a-input placeholder="请输入邮编"
v-decorator="['postcode',validatorRules.postcode]"
:maxLength='50'
@change="e => {e.target.value = (e.target.value + '').trim()}"></a-input>
<a class="search-postcode" href="https://www.youbianku.com" target="_blank">查询邮编</a>
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :xl="12" :sm="24">
<a-form-item label="银行户名" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入银行户名"
:maxLength='50'
@change="e => {e.target.value = (e.target.value + '').trim()}"></a-input>
</a-form-item>
</a-col>
<a-col :xl="12" :sm="24">
<a-form-item label="开户行" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入开户行"
:maxLength='50'
@change="e => {e.target.value = (e.target.value + '').trim()}"></a-input>
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :xl="12" :sm="24">
<a-form-item label="银行账号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入银行账号"
:maxLength='50'
@change="e => {e.target.value = (e.target.value + '').trim()}"></a-input>
</a-form-item>
</a-col>
<a-col :xl="12" :sm="24">
<a-form-item label="税号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入税号"
:maxLength='50'
@change="e => {e.target.value = (e.target.value + '').trim()}"></a-input>
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col>
<a-form-item label="备注" :labelCol="remarksLabelCol" :wrapperCol="remarksWrapperCol">
<a-textarea
placeholder="请输入备注"
:auto-size="{ minRows: 3, maxRows: 6 }"
:maxLength='200'
@change="e => {e.target.value = (e.target.value + '').trim()}"/>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-spin>
</j-modal>
</template>
<script>
import { postcode } from '@/utils/validate'
import pick from 'lodash.pick'
export default {
name: 'BusinessMangementModules',
data() {
return {
title: '操作',
width: 800,
visible: false,
confirmLoading: false,
form: this.$form.createForm(this),
model: {},
labelCol: {
xs: { span: 24 },
sm: { span: 6 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 18 }
},
remarksLabelCol: {
xs: { span: 24 },
sm: { span: 3 }
},
remarksWrapperCol: {
xs: { span: 24 },
sm: { span: 21 }
},
validatorRules: {
businessName: {
rules: [{ required: true, message: '请输入企业名称' }],
validateTrigger: 'blur'
},
postcode: {
rules: [{ validator: this.checkPostcode }]
}
}
}
},
methods: {
add() {
this.edit({})
},
edit(record) {
this.form.resetFields()
this.model = Object.assign({}, record)
this.visible = true
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model, 'approvalDocumentNumber', 'dateYear', 'chargeNoticeName', 'chargeNoticeFileId'))
})
},
close() {
this.$emit('close')
this.visible = false
},
handleOk() {
const that = this
// 触发表单验证
this.form.validateFields((err, values) => {
if (!err) {
// let httpurl = ''
// let method = ''
// if (!this.model.id) {
// httpurl += this.url.add
// method = 'post'
// } else {
// httpurl += this.url.edit
// method = 'put'
// }
// const formData = Object.assign(this.model, values)
// console.log('表单提交数据', formData)
// httpAction(httpurl, formData, method).then((res) => {
// if (res.success) {
// that.$message.success(res.message)
// that.$emit('ok')
// that.close()
// } else {
// that.$message.warning(res.message)
// }
// }).finally(() => {
// that.confirmLoading = false
// })
}
})
},
handleCancel() {
this.close()
},
/**
* 邮编校验
* @param rules
* @param value
* @param callback
*/
checkPostcode(rules, value, callback) {
if (postcode(value)) {
callback()
} else {
callback('请输入正确格式的邮编')
}
}
}
}
</script>
<style scoped lang="less">
.form-item-postcode {
margin-bottom: 0;
}
.search-postcode {
color: #0090ff;
&:hover {
cursor: pointer;
}
}
</style>