¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-card :bordered="false"> |
| | | <!-- æ¥è¯¢åºå --> |
| | | <div class="table-page-search-wrapper"> |
| | | <a-form layout="inline" @keyup.enter.native="searchQuery"> |
| | | <a-row :gutter="24"> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="ä¸å¡åç§°"> |
| | | <j-input placeholder="请è¾å
¥ä¸å¡åç§°" v-model="queryParam.businessName"></j-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="ä¸å¡ç¼ç "> |
| | | <j-input placeholder="请è¾å
¥ä¸å¡ç¼ç " v-model="queryParam.businessCode"></j-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="ç¼ç åç¼"> |
| | | <j-input placeholder="请è¾å
¥ç¼ç åç¼" v-model="queryParam.prefix"></j-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> |
| | | <a-button type="primary" @click="searchQuery" icon="search">æ¥è¯¢</a-button> |
| | | <a-button type="info" @click="searchReset" icon="reload" style="margin-left: 8px">éç½®</a-button> |
| | | </span> |
| | | </a-col> |
| | | |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | |
| | | <!-- æä½æé®åºå --> |
| | | <div class="table-operator"> |
| | | <a-button @click="handleAdd" type="primary" icon="plus">æ°å¢</a-button> |
| | | <a-dropdown v-if="selectedRowKeys.length > 0"> |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item key="1" @click="batchDel"> |
| | | <a-icon type="delete" /> |
| | | å é¤ |
| | | </a-menu-item> |
| | | </a-menu> |
| | | <a-button style="margin-left: 8px"> æ¹éæä½ |
| | | <a-icon type="down" /> |
| | | </a-button> |
| | | </a-dropdown> |
| | | </div> |
| | | |
| | | <!-- tableåºå-begin --> |
| | | <div> |
| | | <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> |
| | | <i class="anticon anticon-info-circle ant-alert-icon"></i> 已鿩 <a |
| | | style="font-weight: 600">{{ selectedRowKeys.length }}</a>项 |
| | | <a style="margin-left: 24px" @click="onClearSelected">æ¸
空</a> |
| | | </div> |
| | | |
| | | <a-table |
| | | ref="table" |
| | | size="middle" |
| | | bordered |
| | | rowKey="id" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | class="j-table-force-nowrap" |
| | | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" |
| | | @change="handleTableChange"> |
| | | |
| | | <span slot="action" slot-scope="text, record"> |
| | | <a @click="handleEdit(record)">ç¼è¾</a> |
| | | |
| | | <a-divider type="vertical" /> |
| | | <a-dropdown> |
| | | <a class="ant-dropdown-link">æ´å¤ <a-icon type="down" /></a> |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item> |
| | | <a-popconfirm title="ç¡®å®å é¤å?" @confirm="() => handleDelete(record.id)"> |
| | | <a>å é¤</a> |
| | | </a-popconfirm> |
| | | </a-menu-item> |
| | | </a-menu> |
| | | </a-dropdown> |
| | | </span> |
| | | |
| | | </a-table> |
| | | </div> |
| | | <!-- tableåºå-end --> |
| | | |
| | | <!-- 表ååºå --> |
| | | <sysBusinessCodeRule-modal ref="modalForm" @ok="modalFormOk"></sysBusinessCodeRule-modal> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | import '@/assets/less/TableExpand.less' |
| | | import SysBusinessCodeRuleModal from './modules/SysBusinessCodeRuleModal' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | |
| | | export default { |
| | | name: 'SysBusinessCodeRuleList', |
| | | mixins: [JeecgListMixin], |
| | | components: { |
| | | SysBusinessCodeRuleModal |
| | | }, |
| | | data() { |
| | | return { |
| | | description: 'ä¸å¡ç¼ç è§å管ç页é¢', |
| | | // 表头 |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | width: 60, |
| | | align: 'center', |
| | | customRender: function(t, r, index) { |
| | | return parseInt(index) + 1 |
| | | } |
| | | }, |
| | | { |
| | | title: 'ä¸å¡åç§°', |
| | | align: 'center', |
| | | dataIndex: 'businessName' |
| | | }, |
| | | { |
| | | title: 'ä¸å¡ç¼ç ', |
| | | align: 'center', |
| | | dataIndex: 'businessCode' |
| | | }, |
| | | { |
| | | title: 'ç¼ç åç¼', |
| | | align: 'center', |
| | | dataIndex: 'prefix' |
| | | }, |
| | | { |
| | | title: '年份ç¼ç æ ¼å¼', |
| | | align: 'center', |
| | | dataIndex: 'yearFormat' |
| | | }, |
| | | { |
| | | title: 'æä»½ç¼ç æ ¼å¼', |
| | | align: 'center', |
| | | dataIndex: 'monthFormat' |
| | | }, |
| | | { |
| | | title: '天ç¼ç æ ¼å¼', |
| | | align: 'center', |
| | | dataIndex: 'dayFormat' |
| | | }, |
| | | { |
| | | title: 'åºå·é¿åº¦', |
| | | align: 'center', |
| | | dataIndex: 'seqLength' |
| | | }, |
| | | { |
| | | title: 'å½ååºå·', |
| | | align: 'center', |
| | | dataIndex: 'currentNum' |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align: 'center', |
| | | scopedSlots: { customRender: 'action' } |
| | | } |
| | | ], |
| | | url: { |
| | | list: '/sys/sysBusinessCodeRule/list', |
| | | delete: '/sys/sysBusinessCodeRule/delete', |
| | | deleteBatch: '/sys/sysBusinessCodeRule/deleteBatch', |
| | | } |
| | | } |
| | | }, |
| | | computed: { |
| | | }, |
| | | methods: {} |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | @import '~@assets/less/common.less'; |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <j-modal |
| | | :title="title" |
| | | :width="800" |
| | | :visible="visible" |
| | | :confirmLoading="confirmLoading" |
| | | switchFullscreen |
| | | @ok="handleOk" |
| | | @cancel="handleCancel" |
| | | cancelText="å
³é"> |
| | | |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form-model ref="form" :model="model" :rules="validatorRules"> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="businessName" label="ä¸å¡åç§°"> |
| | | <a-input placeholder="请è¾å
¥ä¸å¡åç§°" v-model="model.businessName" /> |
| | | </a-form-model-item> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="businessCode" label="ä¸å¡ç¼ç "> |
| | | <a-input placeholder="请è¾å
¥ä¸å¡ç¼ç " v-model="model.businessCode" /> |
| | | </a-form-model-item> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="prefix" label="ç¼ç åç¼"> |
| | | <a-input placeholder="请è¾å
¥ç¼ç åç¼" v-model="model.prefix" /> |
| | | </a-form-model-item> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="yearFormat" label="年份ç¼ç æ ¼å¼"> |
| | | <a-input placeholder="åèæ¥æå¹´ä»½ç¼ç æ ¼å¼" v-model="model.yearFormat" /> |
| | | </a-form-model-item> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="monthFormat" label="æä»½ç¼ç æ ¼å¼"> |
| | | <a-input placeholder="åèæ¥ææä»½ç¼ç æ ¼å¼" v-model="model.monthFormat" /> |
| | | </a-form-model-item> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dayFormat" label="天ç¼ç æ ¼å¼"> |
| | | <a-input placeholder="åèæ¥æå¤©çç¼ç æ ¼å¼" v-model="model.dayFormat" /> |
| | | </a-form-model-item> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="seqLength" label="åºå·é¿åº¦"> |
| | | <a-input-number v-model="model.seqLength" :min="1" :max="10" :precision="0" /> |
| | | </a-form-model-item> |
| | | </a-form-model> |
| | | </a-spin> |
| | | </j-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import { httpAction } from '@/api/manage' |
| | | import { validateDuplicateValue } from '@/utils/util' |
| | | |
| | | export default { |
| | | name: 'SysBusinessCodeRuleModal', |
| | | data() { |
| | | return { |
| | | title: 'æä½', |
| | | visible: false, |
| | | model: {}, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 5 } |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 } |
| | | }, |
| | | confirmLoading: false, |
| | | validatorRules: { |
| | | businessName: [ |
| | | { required: true, message: '请è¾å
¥ä¸å¡åç§°!' } |
| | | ], |
| | | businessCode: [ |
| | | { required: true, message: '请è¾å
¥ä¸å¡ç¼ç !' }, |
| | | { validator: (rule, value, callback) => validateDuplicateValue('sys_business_code_rule', 'business_code', value, this.model.id, callback) } |
| | | ], |
| | | seqLength: [ |
| | | { required: true, message: '请è¾å
¥åºå·é¿åº¦!' } |
| | | ] |
| | | }, |
| | | url: { |
| | | add: '/sys/sysBusinessCodeRule/add', |
| | | edit: '/sys/sysBusinessCodeRule/edit' |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | | methods: { |
| | | add() { |
| | | //åå§åé»è®¤å¼ |
| | | this.edit({ seqLength: 4 }) |
| | | }, |
| | | edit(record) { |
| | | this.model = Object.assign({}, record) |
| | | this.visible = true |
| | | }, |
| | | close() { |
| | | this.$emit('close') |
| | | this.visible = false |
| | | this.$refs.form.clearValidate() |
| | | }, |
| | | handleOk() { |
| | | const that = this |
| | | // 触å表åéªè¯ |
| | | this.$refs.form.validate(valid => { |
| | | if (valid) { |
| | | that.confirmLoading = true |
| | | let httpurl = '' |
| | | let method = '' |
| | | if (!this.model.id) { |
| | | httpurl += this.url.add |
| | | method = 'post' |
| | | } else { |
| | | httpurl += this.url.edit |
| | | method = 'put' |
| | | } |
| | | httpAction(httpurl, this.model, method).then((res) => { |
| | | if (res.success) { |
| | | that.$message.success(res.message) |
| | | that.$emit('ok') |
| | | } else { |
| | | that.$message.warning(res.message) |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false |
| | | that.close() |
| | | }) |
| | | } else { |
| | | return false |
| | | } |
| | | }) |
| | | }, |
| | | handleCancel() { |
| | | this.close() |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | |
| | | </style> |