Commit 497c5c82fbc5b259b93d1f175446f2944cf9733d
1 parent
9accbcce
增加仓库界面
Showing
10 changed files
with
971 additions
and
0 deletions
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/config/WarehouseList.vue
0 → 100644
1 | +<template> | |
2 | + <a-card :bordered="false"> | |
3 | + <!-- 查询区域 --> | |
4 | + <div class="table-page-search-wrapper"> | |
5 | + <a-form layout="inline" @keyup.enter.native="searchQuery"> | |
6 | + <a-row :gutter="24"> | |
7 | + </a-row> | |
8 | + </a-form> | |
9 | + </div> | |
10 | + <!-- 查询区域-END --> | |
11 | + | |
12 | + <!-- 操作按钮区域 --> | |
13 | + <div class="table-operator"> | |
14 | + <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> | |
15 | + <a-button type="primary" icon="download" @click="handleExportXls('仓库')">导出</a-button> | |
16 | + <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> | |
17 | + <a-button type="primary" icon="import">导入</a-button> | |
18 | + </a-upload> | |
19 | + <!-- 高级查询区域 --> | |
20 | + <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> | |
21 | + <a-dropdown v-if="selectedRowKeys.length > 0"> | |
22 | + <a-menu slot="overlay"> | |
23 | + <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item> | |
24 | + </a-menu> | |
25 | + <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button> | |
26 | + </a-dropdown> | |
27 | + </div> | |
28 | + | |
29 | + <!-- table区域-begin --> | |
30 | + <div> | |
31 | + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> | |
32 | + <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项 | |
33 | + <a style="margin-left: 24px" @click="onClearSelected">清空</a> | |
34 | + </div> | |
35 | + | |
36 | + <a-table | |
37 | + ref="table" | |
38 | + size="middle" | |
39 | + :scroll="{x:true}" | |
40 | + bordered | |
41 | + rowKey="id" | |
42 | + :columns="columns" | |
43 | + :dataSource="dataSource" | |
44 | + :pagination="ipagination" | |
45 | + :loading="loading" | |
46 | + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" | |
47 | + class="j-table-force-nowrap" | |
48 | + @change="handleTableChange"> | |
49 | + | |
50 | + <template slot="htmlSlot" slot-scope="text"> | |
51 | + <div v-html="text"></div> | |
52 | + </template> | |
53 | + <template slot="imgSlot" slot-scope="text"> | |
54 | + <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span> | |
55 | + <img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> | |
56 | + </template> | |
57 | + <template slot="fileSlot" slot-scope="text"> | |
58 | + <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> | |
59 | + <a-button | |
60 | + v-else | |
61 | + :ghost="true" | |
62 | + type="primary" | |
63 | + icon="download" | |
64 | + size="small" | |
65 | + @click="downloadFile(text)"> | |
66 | + 下载 | |
67 | + </a-button> | |
68 | + </template> | |
69 | + | |
70 | + <span slot="action" slot-scope="text, record"> | |
71 | + <a @click="handleEdit(record)">编辑</a> | |
72 | + | |
73 | + <a-divider type="vertical" /> | |
74 | + <a-dropdown> | |
75 | + <a class="ant-dropdown-link">更多 <a-icon type="down" /></a> | |
76 | + <a-menu slot="overlay"> | |
77 | + <a-menu-item> | |
78 | + <a @click="handleDetail(record)">详情</a> | |
79 | + </a-menu-item> | |
80 | + <a-menu-item> | |
81 | + <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> | |
82 | + <a>删除</a> | |
83 | + </a-popconfirm> | |
84 | + </a-menu-item> | |
85 | + </a-menu> | |
86 | + </a-dropdown> | |
87 | + </span> | |
88 | + | |
89 | + </a-table> | |
90 | + </div> | |
91 | + | |
92 | + <warehouse-modal ref="modalForm" @ok="modalFormOk"></warehouse-modal> | |
93 | + </a-card> | |
94 | +</template> | |
95 | + | |
96 | +<script> | |
97 | + | |
98 | + import '@/assets/less/TableExpand.less' | |
99 | + import { mixinDevice } from '@/utils/mixin' | |
100 | + import { JeecgListMixin } from '@/mixins/JeecgListMixin' | |
101 | + import WarehouseModal from './modules/WarehouseModal' | |
102 | + | |
103 | + export default { | |
104 | + name: 'WarehouseList', | |
105 | + mixins:[JeecgListMixin, mixinDevice], | |
106 | + components: { | |
107 | + WarehouseModal | |
108 | + }, | |
109 | + data () { | |
110 | + return { | |
111 | + description: '仓库管理页面', | |
112 | + // 表头 | |
113 | + columns: [ | |
114 | + { | |
115 | + title: '#', | |
116 | + dataIndex: '', | |
117 | + key:'rowIndex', | |
118 | + width:60, | |
119 | + align:"center", | |
120 | + customRender:function (t,r,index) { | |
121 | + return parseInt(index)+1; | |
122 | + } | |
123 | + }, | |
124 | + { | |
125 | + title:'创建人', | |
126 | + align:"center", | |
127 | + dataIndex: 'createBy' | |
128 | + }, | |
129 | + { | |
130 | + title:'创建日期', | |
131 | + align:"center", | |
132 | + dataIndex: 'createTime' | |
133 | + }, | |
134 | + { | |
135 | + title:'更新人', | |
136 | + align:"center", | |
137 | + dataIndex: 'updateBy' | |
138 | + }, | |
139 | + { | |
140 | + title:'更新日期', | |
141 | + align:"center", | |
142 | + dataIndex: 'updateTime' | |
143 | + }, | |
144 | + { | |
145 | + title:'仓库编码', | |
146 | + align:"center", | |
147 | + dataIndex: 'code' | |
148 | + }, | |
149 | + { | |
150 | + title:'地址', | |
151 | + align:"center", | |
152 | + dataIndex: 'address' | |
153 | + }, | |
154 | + { | |
155 | + title:'城市', | |
156 | + align:"center", | |
157 | + dataIndex: 'city' | |
158 | + }, | |
159 | + { | |
160 | + title:'省份', | |
161 | + align:"center", | |
162 | + dataIndex: 'state' | |
163 | + }, | |
164 | + { | |
165 | + title:'区/县', | |
166 | + align:"center", | |
167 | + dataIndex: 'district' | |
168 | + }, | |
169 | + { | |
170 | + title:'国家', | |
171 | + align:"center", | |
172 | + dataIndex: 'country' | |
173 | + }, | |
174 | + { | |
175 | + title:'邮编', | |
176 | + align:"center", | |
177 | + dataIndex: 'postalcode' | |
178 | + }, | |
179 | + { | |
180 | + title:'联系人', | |
181 | + align:"center", | |
182 | + dataIndex: 'attentionto' | |
183 | + }, | |
184 | + { | |
185 | + title:'联系电话', | |
186 | + align:"center", | |
187 | + dataIndex: 'phonenum' | |
188 | + }, | |
189 | + { | |
190 | + title:'传真号', | |
191 | + align:"center", | |
192 | + dataIndex: 'faxnum' | |
193 | + }, | |
194 | + { | |
195 | + title:'名称', | |
196 | + align:"center", | |
197 | + dataIndex: 'name' | |
198 | + }, | |
199 | + { | |
200 | + title:'可用状态', | |
201 | + align:"center", | |
202 | + dataIndex: 'enable' | |
203 | + }, | |
204 | + { | |
205 | + title:'删除标记', | |
206 | + align:"center", | |
207 | + dataIndex: 'deleted' | |
208 | + }, | |
209 | + { | |
210 | + title:'自定义字段1', | |
211 | + align:"center", | |
212 | + dataIndex: 'userdef1' | |
213 | + }, | |
214 | + { | |
215 | + title:'自定义字段2', | |
216 | + align:"center", | |
217 | + dataIndex: 'userdef2' | |
218 | + }, | |
219 | + { | |
220 | + title:'自定义字段3', | |
221 | + align:"center", | |
222 | + dataIndex: 'userdef3' | |
223 | + }, | |
224 | + { | |
225 | + title: '操作', | |
226 | + dataIndex: 'action', | |
227 | + align:"center", | |
228 | + fixed:"right", | |
229 | + width:147, | |
230 | + scopedSlots: { customRender: 'action' } | |
231 | + } | |
232 | + ], | |
233 | + url: { | |
234 | + list: "/config/warehouse/list", | |
235 | + delete: "/config/warehouse/delete", | |
236 | + deleteBatch: "/config/warehouse/deleteBatch", | |
237 | + exportXlsUrl: "/config/warehouse/exportXls", | |
238 | + importExcelUrl: "config/warehouse/importExcel", | |
239 | + | |
240 | + }, | |
241 | + dictOptions:{}, | |
242 | + superFieldList:[], | |
243 | + } | |
244 | + }, | |
245 | + created() { | |
246 | + this.getSuperFieldList(); | |
247 | + }, | |
248 | + computed: { | |
249 | + importExcelUrl: function(){ | |
250 | + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; | |
251 | + }, | |
252 | + }, | |
253 | + methods: { | |
254 | + initDictConfig(){ | |
255 | + }, | |
256 | + getSuperFieldList(){ | |
257 | + let fieldList=[]; | |
258 | + fieldList.push({type:'string',value:'createBy',text:'创建人',dictCode:''}) | |
259 | + fieldList.push({type:'datetime',value:'createTime',text:'创建日期'}) | |
260 | + fieldList.push({type:'string',value:'updateBy',text:'更新人',dictCode:''}) | |
261 | + fieldList.push({type:'datetime',value:'updateTime',text:'更新日期'}) | |
262 | + fieldList.push({type:'string',value:'code',text:'仓库编码',dictCode:''}) | |
263 | + fieldList.push({type:'string',value:'address',text:'地址',dictCode:''}) | |
264 | + fieldList.push({type:'string',value:'city',text:'城市',dictCode:''}) | |
265 | + fieldList.push({type:'string',value:'state',text:'省份',dictCode:''}) | |
266 | + fieldList.push({type:'string',value:'district',text:'区/县',dictCode:''}) | |
267 | + fieldList.push({type:'string',value:'country',text:'国家',dictCode:''}) | |
268 | + fieldList.push({type:'string',value:'postalcode',text:'邮编',dictCode:''}) | |
269 | + fieldList.push({type:'string',value:'attentionto',text:'联系人',dictCode:''}) | |
270 | + fieldList.push({type:'string',value:'phonenum',text:'联系电话',dictCode:''}) | |
271 | + fieldList.push({type:'string',value:'faxnum',text:'传真号',dictCode:''}) | |
272 | + fieldList.push({type:'string',value:'name',text:'名称',dictCode:''}) | |
273 | + fieldList.push({type:'int',value:'enable',text:'可用状态',dictCode:''}) | |
274 | + fieldList.push({type:'int',value:'deleted',text:'删除标记',dictCode:''}) | |
275 | + fieldList.push({type:'string',value:'userdef1',text:'自定义字段1',dictCode:''}) | |
276 | + fieldList.push({type:'string',value:'userdef2',text:'自定义字段2',dictCode:''}) | |
277 | + fieldList.push({type:'string',value:'userdef3',text:'自定义字段3',dictCode:''}) | |
278 | + this.superFieldList = fieldList | |
279 | + } | |
280 | + } | |
281 | + } | |
282 | +</script> | |
283 | +<style scoped> | |
284 | + @import '~@assets/less/common.less'; | |
285 | +</style> | |
0 | 286 | \ No newline at end of file |
... | ... |
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/config/modules/WarehouseForm.vue
0 → 100644
1 | +<template> | |
2 | + <a-spin :spinning="confirmLoading"> | |
3 | + <j-form-container :disabled="formDisabled"> | |
4 | + <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> | |
5 | + <a-row> | |
6 | + <a-col :span="24"> | |
7 | + <a-form-model-item label="创建人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="createBy"> | |
8 | + <a-input v-model="model.createBy" placeholder="请输入创建人" ></a-input> | |
9 | + </a-form-model-item> | |
10 | + </a-col> | |
11 | + <a-col :span="24"> | |
12 | + <a-form-model-item label="创建日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="createTime"> | |
13 | + <j-date placeholder="请选择创建日期" v-model="model.createTime" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" /> | |
14 | + </a-form-model-item> | |
15 | + </a-col> | |
16 | + <a-col :span="24"> | |
17 | + <a-form-model-item label="更新人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="updateBy"> | |
18 | + <a-input v-model="model.updateBy" placeholder="请输入更新人" ></a-input> | |
19 | + </a-form-model-item> | |
20 | + </a-col> | |
21 | + <a-col :span="24"> | |
22 | + <a-form-model-item label="更新日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="updateTime"> | |
23 | + <j-date placeholder="请选择更新日期" v-model="model.updateTime" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" /> | |
24 | + </a-form-model-item> | |
25 | + </a-col> | |
26 | + <a-col :span="24"> | |
27 | + <a-form-model-item label="仓库编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="code"> | |
28 | + <a-input v-model="model.code" placeholder="请输入仓库编码" ></a-input> | |
29 | + </a-form-model-item> | |
30 | + </a-col> | |
31 | + <a-col :span="24"> | |
32 | + <a-form-model-item label="地址" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="address"> | |
33 | + <a-input v-model="model.address" placeholder="请输入地址" ></a-input> | |
34 | + </a-form-model-item> | |
35 | + </a-col> | |
36 | + <a-col :span="24"> | |
37 | + <a-form-model-item label="城市" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="city"> | |
38 | + <a-input v-model="model.city" placeholder="请输入城市" ></a-input> | |
39 | + </a-form-model-item> | |
40 | + </a-col> | |
41 | + <a-col :span="24"> | |
42 | + <a-form-model-item label="省份" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="state"> | |
43 | + <a-input v-model="model.state" placeholder="请输入省份" ></a-input> | |
44 | + </a-form-model-item> | |
45 | + </a-col> | |
46 | + <a-col :span="24"> | |
47 | + <a-form-model-item label="区/县" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="district"> | |
48 | + <a-input v-model="model.district" placeholder="请输入区/县" ></a-input> | |
49 | + </a-form-model-item> | |
50 | + </a-col> | |
51 | + <a-col :span="24"> | |
52 | + <a-form-model-item label="国家" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="country"> | |
53 | + <a-input v-model="model.country" placeholder="请输入国家" ></a-input> | |
54 | + </a-form-model-item> | |
55 | + </a-col> | |
56 | + <a-col :span="24"> | |
57 | + <a-form-model-item label="邮编" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="postalcode"> | |
58 | + <a-input v-model="model.postalcode" placeholder="请输入邮编" ></a-input> | |
59 | + </a-form-model-item> | |
60 | + </a-col> | |
61 | + <a-col :span="24"> | |
62 | + <a-form-model-item label="联系人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="attentionto"> | |
63 | + <a-input v-model="model.attentionto" placeholder="请输入联系人" ></a-input> | |
64 | + </a-form-model-item> | |
65 | + </a-col> | |
66 | + <a-col :span="24"> | |
67 | + <a-form-model-item label="联系电话" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="phonenum"> | |
68 | + <a-input v-model="model.phonenum" placeholder="请输入联系电话" ></a-input> | |
69 | + </a-form-model-item> | |
70 | + </a-col> | |
71 | + <a-col :span="24"> | |
72 | + <a-form-model-item label="传真号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="faxnum"> | |
73 | + <a-input v-model="model.faxnum" placeholder="请输入传真号" ></a-input> | |
74 | + </a-form-model-item> | |
75 | + </a-col> | |
76 | + <a-col :span="24"> | |
77 | + <a-form-model-item label="名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="name"> | |
78 | + <a-input v-model="model.name" placeholder="请输入名称" ></a-input> | |
79 | + </a-form-model-item> | |
80 | + </a-col> | |
81 | + <a-col :span="24"> | |
82 | + <a-form-model-item label="可用状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="enable"> | |
83 | + <a-input-number v-model="model.enable" placeholder="请输入可用状态" style="width: 100%" /> | |
84 | + </a-form-model-item> | |
85 | + </a-col> | |
86 | + <a-col :span="24"> | |
87 | + <a-form-model-item label="删除标记" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="deleted"> | |
88 | + <a-input-number v-model="model.deleted" placeholder="请输入删除标记" style="width: 100%" /> | |
89 | + </a-form-model-item> | |
90 | + </a-col> | |
91 | + <a-col :span="24"> | |
92 | + <a-form-model-item label="自定义字段1" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="userdef1"> | |
93 | + <a-input v-model="model.userdef1" placeholder="请输入自定义字段1" ></a-input> | |
94 | + </a-form-model-item> | |
95 | + </a-col> | |
96 | + <a-col :span="24"> | |
97 | + <a-form-model-item label="自定义字段2" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="userdef2"> | |
98 | + <a-input v-model="model.userdef2" placeholder="请输入自定义字段2" ></a-input> | |
99 | + </a-form-model-item> | |
100 | + </a-col> | |
101 | + <a-col :span="24"> | |
102 | + <a-form-model-item label="自定义字段3" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="userdef3"> | |
103 | + <a-input v-model="model.userdef3" placeholder="请输入自定义字段3" ></a-input> | |
104 | + </a-form-model-item> | |
105 | + </a-col> | |
106 | + </a-row> | |
107 | + </a-form-model> | |
108 | + </j-form-container> | |
109 | + </a-spin> | |
110 | +</template> | |
111 | + | |
112 | +<script> | |
113 | + | |
114 | + import { httpAction, getAction } from '@/api/manage' | |
115 | + import { validateDuplicateValue } from '@/utils/util' | |
116 | + | |
117 | + export default { | |
118 | + name: 'WarehouseForm', | |
119 | + components: { | |
120 | + }, | |
121 | + props: { | |
122 | + //表单禁用 | |
123 | + disabled: { | |
124 | + type: Boolean, | |
125 | + default: false, | |
126 | + required: false | |
127 | + } | |
128 | + }, | |
129 | + data () { | |
130 | + return { | |
131 | + model:{ | |
132 | + }, | |
133 | + labelCol: { | |
134 | + xs: { span: 24 }, | |
135 | + sm: { span: 5 }, | |
136 | + }, | |
137 | + wrapperCol: { | |
138 | + xs: { span: 24 }, | |
139 | + sm: { span: 16 }, | |
140 | + }, | |
141 | + confirmLoading: false, | |
142 | + validatorRules: { | |
143 | + code: [ | |
144 | + { required: true, message: '请输入仓库编码!'}, | |
145 | + ], | |
146 | + }, | |
147 | + url: { | |
148 | + add: "/config/warehouse/add", | |
149 | + edit: "/config/warehouse/edit", | |
150 | + queryById: "/config/warehouse/queryById" | |
151 | + } | |
152 | + } | |
153 | + }, | |
154 | + computed: { | |
155 | + formDisabled(){ | |
156 | + return this.disabled | |
157 | + }, | |
158 | + }, | |
159 | + created () { | |
160 | + //备份model原始值 | |
161 | + this.modelDefault = JSON.parse(JSON.stringify(this.model)); | |
162 | + }, | |
163 | + methods: { | |
164 | + add () { | |
165 | + this.edit(this.modelDefault); | |
166 | + }, | |
167 | + edit (record) { | |
168 | + this.model = Object.assign({}, record); | |
169 | + this.visible = true; | |
170 | + }, | |
171 | + submitForm () { | |
172 | + const that = this; | |
173 | + // 触发表单验证 | |
174 | + this.$refs.form.validate(valid => { | |
175 | + if (valid) { | |
176 | + that.confirmLoading = true; | |
177 | + let httpurl = ''; | |
178 | + let method = ''; | |
179 | + if(!this.model.id){ | |
180 | + httpurl+=this.url.add; | |
181 | + method = 'post'; | |
182 | + }else{ | |
183 | + httpurl+=this.url.edit; | |
184 | + method = 'put'; | |
185 | + } | |
186 | + httpAction(httpurl,this.model,method).then((res)=>{ | |
187 | + if(res.success){ | |
188 | + that.$message.success(res.message); | |
189 | + that.$emit('ok'); | |
190 | + }else{ | |
191 | + that.$message.warning(res.message); | |
192 | + } | |
193 | + }).finally(() => { | |
194 | + that.confirmLoading = false; | |
195 | + }) | |
196 | + } | |
197 | + | |
198 | + }) | |
199 | + }, | |
200 | + } | |
201 | + } | |
202 | +</script> | |
0 | 203 | \ No newline at end of file |
... | ... |
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/config/modules/WarehouseModal.Style#Drawer.vue
0 → 100644
1 | +<template> | |
2 | + <a-drawer | |
3 | + :title="title" | |
4 | + :width="width" | |
5 | + placement="right" | |
6 | + :closable="false" | |
7 | + @close="close" | |
8 | + destroyOnClose | |
9 | + :visible="visible"> | |
10 | + <warehouse-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></warehouse-form> | |
11 | + <div class="drawer-footer"> | |
12 | + <a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button> | |
13 | + <a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button> | |
14 | + </div> | |
15 | + </a-drawer> | |
16 | +</template> | |
17 | + | |
18 | +<script> | |
19 | + | |
20 | + import WarehouseForm from './WarehouseForm' | |
21 | + | |
22 | + export default { | |
23 | + name: 'WarehouseModal', | |
24 | + components: { | |
25 | + WarehouseForm | |
26 | + }, | |
27 | + data () { | |
28 | + return { | |
29 | + title:"操作", | |
30 | + width:800, | |
31 | + visible: false, | |
32 | + disableSubmit: false | |
33 | + } | |
34 | + }, | |
35 | + methods: { | |
36 | + add () { | |
37 | + this.visible=true | |
38 | + this.$nextTick(()=>{ | |
39 | + this.$refs.realForm.add(); | |
40 | + }) | |
41 | + }, | |
42 | + edit (record) { | |
43 | + this.visible=true | |
44 | + this.$nextTick(()=>{ | |
45 | + this.$refs.realForm.edit(record); | |
46 | + }); | |
47 | + }, | |
48 | + close () { | |
49 | + this.$emit('close'); | |
50 | + this.visible = false; | |
51 | + }, | |
52 | + submitCallback(){ | |
53 | + this.$emit('ok'); | |
54 | + this.visible = false; | |
55 | + }, | |
56 | + handleOk () { | |
57 | + this.$refs.realForm.submitForm(); | |
58 | + }, | |
59 | + handleCancel () { | |
60 | + this.close() | |
61 | + } | |
62 | + } | |
63 | + } | |
64 | +</script> | |
65 | + | |
66 | +<style lang="less" scoped> | |
67 | +/** Button按钮间距 */ | |
68 | + .ant-btn { | |
69 | + margin-left: 30px; | |
70 | + margin-bottom: 30px; | |
71 | + float: right; | |
72 | + } | |
73 | + .drawer-footer{ | |
74 | + position: absolute; | |
75 | + bottom: -8px; | |
76 | + width: 100%; | |
77 | + border-top: 1px solid #e8e8e8; | |
78 | + padding: 10px 16px; | |
79 | + text-align: right; | |
80 | + left: 0; | |
81 | + background: #fff; | |
82 | + border-radius: 0 0 2px 2px; | |
83 | + } | |
84 | +</style> | |
0 | 85 | \ No newline at end of file |
... | ... |
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/config/modules/WarehouseModal.vue
0 → 100644
1 | +<template> | |
2 | + <j-modal | |
3 | + :title="title" | |
4 | + :width="width" | |
5 | + :visible="visible" | |
6 | + switchFullscreen | |
7 | + @ok="handleOk" | |
8 | + :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" | |
9 | + @cancel="handleCancel" | |
10 | + cancelText="关闭"> | |
11 | + <warehouse-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></warehouse-form> | |
12 | + </j-modal> | |
13 | +</template> | |
14 | + | |
15 | +<script> | |
16 | + | |
17 | + import WarehouseForm from './WarehouseForm' | |
18 | + export default { | |
19 | + name: 'WarehouseModal', | |
20 | + components: { | |
21 | + WarehouseForm | |
22 | + }, | |
23 | + data () { | |
24 | + return { | |
25 | + title:'', | |
26 | + width:800, | |
27 | + visible: false, | |
28 | + disableSubmit: false | |
29 | + } | |
30 | + }, | |
31 | + methods: { | |
32 | + add () { | |
33 | + this.visible=true | |
34 | + this.$nextTick(()=>{ | |
35 | + this.$refs.realForm.add(); | |
36 | + }) | |
37 | + }, | |
38 | + edit (record) { | |
39 | + this.visible=true | |
40 | + this.$nextTick(()=>{ | |
41 | + this.$refs.realForm.edit(record); | |
42 | + }) | |
43 | + }, | |
44 | + close () { | |
45 | + this.$emit('close'); | |
46 | + this.visible = false; | |
47 | + }, | |
48 | + handleOk () { | |
49 | + this.$refs.realForm.submitForm(); | |
50 | + }, | |
51 | + submitCallback(){ | |
52 | + this.$emit('ok'); | |
53 | + this.visible = false; | |
54 | + }, | |
55 | + handleCancel () { | |
56 | + this.close() | |
57 | + } | |
58 | + } | |
59 | + } | |
60 | +</script> | |
0 | 61 | \ No newline at end of file |
... | ... |
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/config/warehouse/controller/WarehouseController.java
0 → 100644
1 | +package org.jeecg.modules.system.config.warehouse.controller; | |
2 | + | |
3 | +import java.util.Arrays; | |
4 | +import java.util.List; | |
5 | +import java.util.Map; | |
6 | +import java.util.stream.Collectors; | |
7 | +import java.io.IOException; | |
8 | +import java.io.UnsupportedEncodingException; | |
9 | +import java.net.URLDecoder; | |
10 | +import javax.servlet.http.HttpServletRequest; | |
11 | +import javax.servlet.http.HttpServletResponse; | |
12 | +import org.jeecg.common.api.vo.Result; | |
13 | +import org.jeecg.common.system.query.QueryGenerator; | |
14 | +import org.jeecg.common.util.oConvertUtils; | |
15 | + | |
16 | +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |
17 | +import com.baomidou.mybatisplus.core.metadata.IPage; | |
18 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |
19 | +import lombok.extern.slf4j.Slf4j; | |
20 | + | |
21 | +import org.jeecg.modules.system.config.warehouse.entity.Warehouse; | |
22 | +import org.jeecg.modules.system.config.warehouse.service.IWarehouseService; | |
23 | +import org.jeecgframework.poi.excel.ExcelImportUtil; | |
24 | +import org.jeecgframework.poi.excel.def.NormalExcelConstants; | |
25 | +import org.jeecgframework.poi.excel.entity.ExportParams; | |
26 | +import org.jeecgframework.poi.excel.entity.ImportParams; | |
27 | +import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; | |
28 | +import org.jeecg.common.system.base.controller.JeecgController; | |
29 | +import org.springframework.beans.factory.annotation.Autowired; | |
30 | +import org.springframework.web.bind.annotation.*; | |
31 | +import org.springframework.web.multipart.MultipartFile; | |
32 | +import org.springframework.web.multipart.MultipartHttpServletRequest; | |
33 | +import org.springframework.web.servlet.ModelAndView; | |
34 | +import com.alibaba.fastjson.JSON; | |
35 | +import io.swagger.annotations.Api; | |
36 | +import io.swagger.annotations.ApiOperation; | |
37 | +import org.jeecg.common.aspect.annotation.AutoLog; | |
38 | + | |
39 | + /** | |
40 | + * @Description: 仓库 | |
41 | + * @Author: jeecg-boot | |
42 | + * @Date: 2022-10-12 | |
43 | + * @Version: V1.0 | |
44 | + */ | |
45 | +@Api(tags="仓库") | |
46 | +@RestController | |
47 | +@RequestMapping("/config/warehouse") | |
48 | +@Slf4j | |
49 | +public class WarehouseController extends JeecgController<Warehouse, IWarehouseService> { | |
50 | + @Autowired | |
51 | + private IWarehouseService warehouseService; | |
52 | + | |
53 | + /** | |
54 | + * 分页列表查询 | |
55 | + * | |
56 | + * @param warehouse | |
57 | + * @param pageNo | |
58 | + * @param pageSize | |
59 | + * @param req | |
60 | + * @return | |
61 | + */ | |
62 | + //@AutoLog(value = "仓库-分页列表查询") | |
63 | + @ApiOperation(value="仓库-分页列表查询", notes="仓库-分页列表查询") | |
64 | + @GetMapping(value = "/list") | |
65 | + public Result<IPage<Warehouse>> queryPageList(Warehouse warehouse, | |
66 | + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, | |
67 | + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, | |
68 | + HttpServletRequest req) { | |
69 | + QueryWrapper<Warehouse> queryWrapper = QueryGenerator.initQueryWrapper(warehouse, req.getParameterMap()); | |
70 | + Page<Warehouse> page = new Page<Warehouse>(pageNo, pageSize); | |
71 | + IPage<Warehouse> pageList = warehouseService.page(page, queryWrapper); | |
72 | + return Result.OK(pageList); | |
73 | + } | |
74 | + | |
75 | + /** | |
76 | + * 添加 | |
77 | + * | |
78 | + * @param warehouse | |
79 | + * @return | |
80 | + */ | |
81 | + @AutoLog(value = "仓库-添加") | |
82 | + @ApiOperation(value="仓库-添加", notes="仓库-添加") | |
83 | + @PostMapping(value = "/add") | |
84 | + public Result<String> add(@RequestBody Warehouse warehouse) { | |
85 | + warehouseService.save(warehouse); | |
86 | + return Result.OK("添加成功!"); | |
87 | + } | |
88 | + | |
89 | + /** | |
90 | + * 编辑 | |
91 | + * | |
92 | + * @param warehouse | |
93 | + * @return | |
94 | + */ | |
95 | + @AutoLog(value = "仓库-编辑") | |
96 | + @ApiOperation(value="仓库-编辑", notes="仓库-编辑") | |
97 | + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) | |
98 | + public Result<String> edit(@RequestBody Warehouse warehouse) { | |
99 | + warehouseService.updateById(warehouse); | |
100 | + return Result.OK("编辑成功!"); | |
101 | + } | |
102 | + | |
103 | + /** | |
104 | + * 通过id删除 | |
105 | + * | |
106 | + * @param id | |
107 | + * @return | |
108 | + */ | |
109 | + @AutoLog(value = "仓库-通过id删除") | |
110 | + @ApiOperation(value="仓库-通过id删除", notes="仓库-通过id删除") | |
111 | + @DeleteMapping(value = "/delete") | |
112 | + public Result<String> delete(@RequestParam(name="id",required=true) String id) { | |
113 | + warehouseService.removeById(id); | |
114 | + return Result.OK("删除成功!"); | |
115 | + } | |
116 | + | |
117 | + /** | |
118 | + * 批量删除 | |
119 | + * | |
120 | + * @param ids | |
121 | + * @return | |
122 | + */ | |
123 | + @AutoLog(value = "仓库-批量删除") | |
124 | + @ApiOperation(value="仓库-批量删除", notes="仓库-批量删除") | |
125 | + @DeleteMapping(value = "/deleteBatch") | |
126 | + public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { | |
127 | + this.warehouseService.removeByIds(Arrays.asList(ids.split(","))); | |
128 | + return Result.OK("批量删除成功!"); | |
129 | + } | |
130 | + | |
131 | + /** | |
132 | + * 通过id查询 | |
133 | + * | |
134 | + * @param id | |
135 | + * @return | |
136 | + */ | |
137 | + //@AutoLog(value = "仓库-通过id查询") | |
138 | + @ApiOperation(value="仓库-通过id查询", notes="仓库-通过id查询") | |
139 | + @GetMapping(value = "/queryById") | |
140 | + public Result<Warehouse> queryById(@RequestParam(name="id",required=true) String id) { | |
141 | + Warehouse warehouse = warehouseService.getById(id); | |
142 | + if(warehouse==null) { | |
143 | + return Result.error("未找到对应数据"); | |
144 | + } | |
145 | + return Result.OK(warehouse); | |
146 | + } | |
147 | + | |
148 | + /** | |
149 | + * 导出excel | |
150 | + * | |
151 | + * @param request | |
152 | + * @param warehouse | |
153 | + */ | |
154 | + @RequestMapping(value = "/exportXls") | |
155 | + public ModelAndView exportXls(HttpServletRequest request, Warehouse warehouse) { | |
156 | + return super.exportXls(request, warehouse, Warehouse.class, "仓库"); | |
157 | + } | |
158 | + | |
159 | + /** | |
160 | + * 通过excel导入数据 | |
161 | + * | |
162 | + * @param request | |
163 | + * @param response | |
164 | + * @return | |
165 | + */ | |
166 | + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) | |
167 | + public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { | |
168 | + return super.importExcel(request, response, Warehouse.class); | |
169 | + } | |
170 | + | |
171 | +} | |
... | ... |
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/config/warehouse/entity/Warehouse.java
0 → 100644
1 | +package org.jeecg.modules.system.config.warehouse.entity; | |
2 | + | |
3 | +import java.io.Serializable; | |
4 | +import java.io.UnsupportedEncodingException; | |
5 | +import java.util.Date; | |
6 | +import java.math.BigDecimal; | |
7 | +import com.baomidou.mybatisplus.annotation.IdType; | |
8 | +import com.baomidou.mybatisplus.annotation.TableId; | |
9 | +import com.baomidou.mybatisplus.annotation.TableName; | |
10 | +import lombok.Data; | |
11 | +import com.fasterxml.jackson.annotation.JsonFormat; | |
12 | +import org.springframework.format.annotation.DateTimeFormat; | |
13 | +import org.jeecgframework.poi.excel.annotation.Excel; | |
14 | +import org.jeecg.common.aspect.annotation.Dict; | |
15 | +import io.swagger.annotations.ApiModel; | |
16 | +import io.swagger.annotations.ApiModelProperty; | |
17 | +import lombok.EqualsAndHashCode; | |
18 | +import lombok.experimental.Accessors; | |
19 | + | |
20 | +/** | |
21 | + * @Description: 仓库 | |
22 | + * @Author: jeecg-boot | |
23 | + * @Date: 2022-10-12 | |
24 | + * @Version: V1.0 | |
25 | + */ | |
26 | +@Data | |
27 | +@TableName("warehouse") | |
28 | +@Accessors(chain = true) | |
29 | +@EqualsAndHashCode(callSuper = false) | |
30 | +@ApiModel(value="warehouse对象", description="仓库") | |
31 | +public class Warehouse implements Serializable { | |
32 | + private static final long serialVersionUID = 1L; | |
33 | + | |
34 | + /**主键*/ | |
35 | + @TableId(type = IdType.ASSIGN_ID) | |
36 | + @ApiModelProperty(value = "主键") | |
37 | + private String id; | |
38 | + /**创建人*/ | |
39 | + @ApiModelProperty(value = "创建人") | |
40 | + private String createBy; | |
41 | + /**创建日期*/ | |
42 | + @ApiModelProperty(value = "创建日期") | |
43 | + private Date createTime; | |
44 | + /**更新人*/ | |
45 | + @ApiModelProperty(value = "更新人") | |
46 | + private String updateBy; | |
47 | + /**更新日期*/ | |
48 | + @ApiModelProperty(value = "更新日期") | |
49 | + private Date updateTime; | |
50 | + /**仓库编码*/ | |
51 | + @Excel(name = "仓库编码", width = 15) | |
52 | + @ApiModelProperty(value = "仓库编码") | |
53 | + private String code; | |
54 | + /**地址*/ | |
55 | + @Excel(name = "地址", width = 15) | |
56 | + @ApiModelProperty(value = "地址") | |
57 | + private String address; | |
58 | + /**城市*/ | |
59 | + @Excel(name = "城市", width = 15) | |
60 | + @ApiModelProperty(value = "城市") | |
61 | + private String city; | |
62 | + /**省份*/ | |
63 | + @Excel(name = "省份", width = 15) | |
64 | + @ApiModelProperty(value = "省份") | |
65 | + private String state; | |
66 | + /**区/县*/ | |
67 | + @Excel(name = "区/县", width = 15) | |
68 | + @ApiModelProperty(value = "区/县") | |
69 | + private String district; | |
70 | + /**国家*/ | |
71 | + @Excel(name = "国家", width = 15) | |
72 | + @ApiModelProperty(value = "国家") | |
73 | + private String country; | |
74 | + /**邮编*/ | |
75 | + @Excel(name = "邮编", width = 15) | |
76 | + @ApiModelProperty(value = "邮编") | |
77 | + private String postalcode; | |
78 | + /**联系人*/ | |
79 | + @Excel(name = "联系人", width = 15) | |
80 | + @ApiModelProperty(value = "联系人") | |
81 | + private String attentionto; | |
82 | + /**联系电话*/ | |
83 | + @Excel(name = "联系电话", width = 15) | |
84 | + @ApiModelProperty(value = "联系电话") | |
85 | + private String phonenum; | |
86 | + /**传真号*/ | |
87 | + @Excel(name = "传真号", width = 15) | |
88 | + @ApiModelProperty(value = "传真号") | |
89 | + private String faxnum; | |
90 | + /**名称*/ | |
91 | + @Excel(name = "名称", width = 15) | |
92 | + @ApiModelProperty(value = "名称") | |
93 | + private String name; | |
94 | + /**可用状态*/ | |
95 | + @Excel(name = "可用状态", width = 15) | |
96 | + @ApiModelProperty(value = "可用状态") | |
97 | + private Integer enable; | |
98 | + /**删除标记*/ | |
99 | + @Excel(name = "删除标记", width = 15) | |
100 | + @ApiModelProperty(value = "删除标记") | |
101 | + private Integer deleted; | |
102 | + /**自定义字段1*/ | |
103 | + @Excel(name = "自定义字段1", width = 15) | |
104 | + @ApiModelProperty(value = "自定义字段1") | |
105 | + private String userdef1; | |
106 | + /**自定义字段2*/ | |
107 | + @Excel(name = "自定义字段2", width = 15) | |
108 | + @ApiModelProperty(value = "自定义字段2") | |
109 | + private String userdef2; | |
110 | + /**自定义字段3*/ | |
111 | + @Excel(name = "自定义字段3", width = 15) | |
112 | + @ApiModelProperty(value = "自定义字段3") | |
113 | + private String userdef3; | |
114 | +} | |
... | ... |
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/config/warehouse/mapper/WarehouseMapper.java
0 → 100644
1 | +package org.jeecg.modules.system.config.warehouse.mapper; | |
2 | + | |
3 | +import java.util.List; | |
4 | + | |
5 | +import org.apache.ibatis.annotations.Param; | |
6 | +import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |
7 | +import org.jeecg.modules.system.config.warehouse.entity.Warehouse; | |
8 | + | |
9 | +/** | |
10 | + * @Description: 仓库 | |
11 | + * @Author: jeecg-boot | |
12 | + * @Date: 2022-10-12 | |
13 | + * @Version: V1.0 | |
14 | + */ | |
15 | +public interface WarehouseMapper extends BaseMapper<Warehouse> { | |
16 | + | |
17 | +} | |
... | ... |
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/config/warehouse/mapper/xml/WarehouseMapper.xml
0 → 100644
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/config/warehouse/service/IWarehouseService.java
0 → 100644
1 | +package org.jeecg.modules.system.config.warehouse.service; | |
2 | + | |
3 | +import com.baomidou.mybatisplus.extension.service.IService; | |
4 | +import org.jeecg.modules.system.config.warehouse.entity.Warehouse; | |
5 | + | |
6 | +/** | |
7 | + * @Description: 仓库 | |
8 | + * @Author: jeecg-boot | |
9 | + * @Date: 2022-10-12 | |
10 | + * @Version: V1.0 | |
11 | + */ | |
12 | +public interface IWarehouseService extends IService<Warehouse> { | |
13 | + | |
14 | +} | |
... | ... |
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/config/warehouse/service/impl/WarehouseServiceImpl.java
0 → 100644
1 | +package org.jeecg.modules.system.config.warehouse.service.impl; | |
2 | + | |
3 | +import org.jeecg.modules.system.config.warehouse.entity.Warehouse; | |
4 | +import org.jeecg.modules.system.config.warehouse.mapper.WarehouseMapper; | |
5 | +import org.jeecg.modules.system.config.warehouse.service.IWarehouseService; | |
6 | +import org.springframework.stereotype.Service; | |
7 | + | |
8 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
9 | + | |
10 | +/** | |
11 | + * @Description: 仓库 | |
12 | + * @Author: jeecg-boot | |
13 | + * @Date: 2022-10-12 | |
14 | + * @Version: V1.0 | |
15 | + */ | |
16 | +@Service | |
17 | +public class WarehouseServiceImpl extends ServiceImpl<WarehouseMapper, Warehouse> implements IWarehouseService { | |
18 | + | |
19 | +} | |
... | ... |