parent
9832aac5f5
commit
1ff2d6bbf0
44 changed files with 3460 additions and 24 deletions
@ -0,0 +1,198 @@ |
||||
<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-dict-select-tag placeholder="请选择商品" v-model="queryParam.goodsId" dictCode="zy_goods,goods_name,id"/> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24"> |
||||
<a-form-item label="辅料"> |
||||
<j-dict-select-tag placeholder="请选择辅料" v-model="queryParam.accessoriesId" dictCode="zy_accessories,contents,id"/> |
||||
</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="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button> |
||||
<a @click="handleToggleSearch" style="margin-left: 8px"> |
||||
{{ toggleSearchStatus ? '收起' : '展开' }} |
||||
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/> |
||||
</a> |
||||
</span> |
||||
</a-col> |
||||
</a-row> |
||||
</a-form> |
||||
</div> |
||||
<!-- 查询区域-END --> |
||||
|
||||
<!-- 操作按钮区域 --> |
||||
<div class="table-operator"> |
||||
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> |
||||
<a-button type="primary" icon="download" @click="handleExportXls('商品辅料表')">导出</a-button> |
||||
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> |
||||
<a-button type="primary" icon="import">导入</a-button> |
||||
</a-upload> |
||||
<!-- 高级查询区域 --> |
||||
<j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> |
||||
<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" |
||||
:scroll="{x:true}" |
||||
bordered |
||||
rowKey="id" |
||||
:columns="columns" |
||||
:dataSource="dataSource" |
||||
:pagination="ipagination" |
||||
:loading="loading" |
||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" |
||||
class="j-table-force-nowrap" |
||||
@change="handleTableChange"> |
||||
|
||||
<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"> |
||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> |
||||
<a-button |
||||
v-else |
||||
:ghost="true" |
||||
type="primary" |
||||
icon="download" |
||||
size="small" |
||||
@click="downloadFile(text)"> |
||||
下载 |
||||
</a-button> |
||||
</template> |
||||
|
||||
<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 @click="handleDetail(record)">详情</a> |
||||
</a-menu-item> |
||||
<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> |
||||
|
||||
<goods-accessories-modal ref="modalForm" @ok="modalFormOk"></goods-accessories-modal> |
||||
</a-card> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import '@/assets/less/TableExpand.less' |
||||
import { mixinDevice } from '@/utils/mixin' |
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
||||
import GoodsAccessoriesModal from './modules/GoodsAccessoriesModal' |
||||
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' |
||||
|
||||
export default { |
||||
name: 'GoodsAccessoriesList', |
||||
mixins:[JeecgListMixin, mixinDevice], |
||||
components: { |
||||
GoodsAccessoriesModal |
||||
}, |
||||
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: 'goodsId_dictText' |
||||
}, |
||||
{ |
||||
title:'辅料', |
||||
align:"center", |
||||
dataIndex: 'accessoriesId_dictText' |
||||
}, |
||||
{ |
||||
title: '操作', |
||||
dataIndex: 'action', |
||||
align:"center", |
||||
fixed:"right", |
||||
width:147, |
||||
scopedSlots: { customRender: 'action' } |
||||
} |
||||
], |
||||
url: { |
||||
list: "/goodsaccessories/goodsAccessories/list", |
||||
delete: "/goodsaccessories/goodsAccessories/delete", |
||||
deleteBatch: "/goodsaccessories/goodsAccessories/deleteBatch", |
||||
exportXlsUrl: "/goodsaccessories/goodsAccessories/exportXls", |
||||
importExcelUrl: "goodsaccessories/goodsAccessories/importExcel", |
||||
|
||||
}, |
||||
dictOptions:{}, |
||||
superFieldList:[], |
||||
} |
||||
}, |
||||
created() { |
||||
this.getSuperFieldList(); |
||||
}, |
||||
computed: { |
||||
importExcelUrl: function(){ |
||||
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; |
||||
}, |
||||
}, |
||||
methods: { |
||||
initDictConfig(){ |
||||
}, |
||||
getSuperFieldList(){ |
||||
let fieldList=[]; |
||||
fieldList.push({type:'string',value:'goodsId',text:'商品id',dictCode:'zy_goods,goods_name,id'}) |
||||
fieldList.push({type:'string',value:'accessoriesId',text:'辅料id',dictCode:'zy_accessories,contents,id'}) |
||||
this.superFieldList = fieldList |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
<style scoped> |
||||
@import '~@assets/less/common.less'; |
||||
</style> |
@ -0,0 +1,109 @@ |
||||
<template> |
||||
<a-spin :spinning="confirmLoading"> |
||||
<j-form-container :disabled="formDisabled"> |
||||
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> |
||||
<a-row> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="商品" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="goodsId"> |
||||
<j-dict-select-tag type="list" v-model="model.goodsId" dictCode="zy_goods,goods_name,id" placeholder="请选择商品" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="辅料" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="accessoriesId"> |
||||
<j-dict-select-tag type="list" v-model="model.accessoriesId" dictCode="zy_accessories,contents,id" placeholder="请选择辅料" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
</a-row> |
||||
</a-form-model> |
||||
</j-form-container> |
||||
</a-spin> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import { httpAction, getAction } from '@/api/manage' |
||||
import { validateDuplicateValue } from '@/utils/util' |
||||
|
||||
export default { |
||||
name: 'GoodsAccessoriesForm', |
||||
components: { |
||||
}, |
||||
props: { |
||||
//表单禁用 |
||||
disabled: { |
||||
type: Boolean, |
||||
default: false, |
||||
required: false |
||||
} |
||||
}, |
||||
data () { |
||||
return { |
||||
model:{ |
||||
}, |
||||
labelCol: { |
||||
xs: { span: 24 }, |
||||
sm: { span: 5 }, |
||||
}, |
||||
wrapperCol: { |
||||
xs: { span: 24 }, |
||||
sm: { span: 16 }, |
||||
}, |
||||
confirmLoading: false, |
||||
validatorRules: { |
||||
}, |
||||
url: { |
||||
add: "/goodsaccessories/goodsAccessories/add", |
||||
edit: "/goodsaccessories/goodsAccessories/edit", |
||||
queryById: "/goodsaccessories/goodsAccessories/queryById" |
||||
} |
||||
} |
||||
}, |
||||
computed: { |
||||
formDisabled(){ |
||||
return this.disabled |
||||
}, |
||||
}, |
||||
created () { |
||||
//备份model原始值 |
||||
this.modelDefault = JSON.parse(JSON.stringify(this.model)); |
||||
}, |
||||
methods: { |
||||
add () { |
||||
this.edit(this.modelDefault); |
||||
}, |
||||
edit (record) { |
||||
this.model = Object.assign({}, record); |
||||
this.visible = true; |
||||
}, |
||||
submitForm () { |
||||
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; |
||||
}) |
||||
} |
||||
|
||||
}) |
||||
}, |
||||
} |
||||
} |
||||
</script> |
@ -0,0 +1,60 @@ |
||||
<template> |
||||
<j-modal |
||||
:title="title" |
||||
:width="width" |
||||
:visible="visible" |
||||
switchFullscreen |
||||
@ok="handleOk" |
||||
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }" |
||||
@cancel="handleCancel" |
||||
cancelText="关闭"> |
||||
<goods-accessories-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></goods-accessories-form> |
||||
</j-modal> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import GoodsAccessoriesForm from './GoodsAccessoriesForm' |
||||
export default { |
||||
name: 'GoodsAccessoriesModal', |
||||
components: { |
||||
GoodsAccessoriesForm |
||||
}, |
||||
data () { |
||||
return { |
||||
title:'', |
||||
width:800, |
||||
visible: false, |
||||
disableSubmit: false |
||||
} |
||||
}, |
||||
methods: { |
||||
add () { |
||||
this.visible=true |
||||
this.$nextTick(()=>{ |
||||
this.$refs.realForm.add(); |
||||
}) |
||||
}, |
||||
edit (record) { |
||||
this.visible=true |
||||
this.$nextTick(()=>{ |
||||
this.$refs.realForm.edit(record); |
||||
}) |
||||
}, |
||||
close () { |
||||
this.$emit('close'); |
||||
this.visible = false; |
||||
}, |
||||
handleOk () { |
||||
this.$refs.realForm.submitForm(); |
||||
}, |
||||
submitCallback(){ |
||||
this.$emit('ok'); |
||||
this.visible = false; |
||||
}, |
||||
handleCancel () { |
||||
this.close() |
||||
} |
||||
} |
||||
} |
||||
</script> |
@ -0,0 +1,84 @@ |
||||
<template> |
||||
<a-drawer |
||||
:title="title" |
||||
:width="width" |
||||
placement="right" |
||||
:closable="false" |
||||
@close="close" |
||||
destroyOnClose |
||||
:visible="visible"> |
||||
<goods-accessories-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></goods-accessories-form> |
||||
<div class="drawer-footer"> |
||||
<a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button> |
||||
<a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button> |
||||
</div> |
||||
</a-drawer> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import GoodsAccessoriesForm from './GoodsAccessoriesForm' |
||||
|
||||
export default { |
||||
name: 'GoodsAccessoriesModal', |
||||
components: { |
||||
GoodsAccessoriesForm |
||||
}, |
||||
data () { |
||||
return { |
||||
title:"操作", |
||||
width:800, |
||||
visible: false, |
||||
disableSubmit: false |
||||
} |
||||
}, |
||||
methods: { |
||||
add () { |
||||
this.visible=true |
||||
this.$nextTick(()=>{ |
||||
this.$refs.realForm.add(); |
||||
}) |
||||
}, |
||||
edit (record) { |
||||
this.visible=true |
||||
this.$nextTick(()=>{ |
||||
this.$refs.realForm.edit(record); |
||||
}); |
||||
}, |
||||
close () { |
||||
this.$emit('close'); |
||||
this.visible = false; |
||||
}, |
||||
submitCallback(){ |
||||
this.$emit('ok'); |
||||
this.visible = false; |
||||
}, |
||||
handleOk () { |
||||
this.$refs.realForm.submitForm(); |
||||
}, |
||||
handleCancel () { |
||||
this.close() |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="less" scoped> |
||||
/** Button按钮间距 */ |
||||
.ant-btn { |
||||
margin-left: 30px; |
||||
margin-bottom: 30px; |
||||
float: right; |
||||
} |
||||
.drawer-footer{ |
||||
position: absolute; |
||||
bottom: -8px; |
||||
width: 100%; |
||||
border-top: 1px solid #e8e8e8; |
||||
padding: 10px 16px; |
||||
text-align: right; |
||||
left: 0; |
||||
background: #fff; |
||||
border-radius: 0 0 2px 2px; |
||||
} |
||||
</style> |
@ -0,0 +1,198 @@ |
||||
<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-dict-select-tag placeholder="请选择商品" v-model="queryParam.goodsId" dictCode="zy_goods,goods_name,id"/> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24"> |
||||
<a-form-item label="面料"> |
||||
<j-dict-select-tag placeholder="请选择面料" v-model="queryParam.fabricId" dictCode="zy_fabric,name,id"/> |
||||
</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="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button> |
||||
<a @click="handleToggleSearch" style="margin-left: 8px"> |
||||
{{ toggleSearchStatus ? '收起' : '展开' }} |
||||
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/> |
||||
</a> |
||||
</span> |
||||
</a-col> |
||||
</a-row> |
||||
</a-form> |
||||
</div> |
||||
<!-- 查询区域-END --> |
||||
|
||||
<!-- 操作按钮区域 --> |
||||
<div class="table-operator"> |
||||
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> |
||||
<a-button type="primary" icon="download" @click="handleExportXls('商品面料表')">导出</a-button> |
||||
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> |
||||
<a-button type="primary" icon="import">导入</a-button> |
||||
</a-upload> |
||||
<!-- 高级查询区域 --> |
||||
<j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> |
||||
<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" |
||||
:scroll="{x:true}" |
||||
bordered |
||||
rowKey="id" |
||||
:columns="columns" |
||||
:dataSource="dataSource" |
||||
:pagination="ipagination" |
||||
:loading="loading" |
||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" |
||||
class="j-table-force-nowrap" |
||||
@change="handleTableChange"> |
||||
|
||||
<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"> |
||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> |
||||
<a-button |
||||
v-else |
||||
:ghost="true" |
||||
type="primary" |
||||
icon="download" |
||||
size="small" |
||||
@click="downloadFile(text)"> |
||||
下载 |
||||
</a-button> |
||||
</template> |
||||
|
||||
<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 @click="handleDetail(record)">详情</a> |
||||
</a-menu-item> |
||||
<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> |
||||
|
||||
<goods-fabric-modal ref="modalForm" @ok="modalFormOk"></goods-fabric-modal> |
||||
</a-card> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import '@/assets/less/TableExpand.less' |
||||
import { mixinDevice } from '@/utils/mixin' |
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
||||
import GoodsFabricModal from './modules/GoodsFabricModal' |
||||
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' |
||||
|
||||
export default { |
||||
name: 'GoodsFabricList', |
||||
mixins:[JeecgListMixin, mixinDevice], |
||||
components: { |
||||
GoodsFabricModal |
||||
}, |
||||
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: 'goodsId_dictText' |
||||
}, |
||||
{ |
||||
title:'面料', |
||||
align:"center", |
||||
dataIndex: 'fabricId_dictText' |
||||
}, |
||||
{ |
||||
title: '操作', |
||||
dataIndex: 'action', |
||||
align:"center", |
||||
fixed:"right", |
||||
width:147, |
||||
scopedSlots: { customRender: 'action' } |
||||
} |
||||
], |
||||
url: { |
||||
list: "/goodsfabric/goodsFabric/list", |
||||
delete: "/goodsfabric/goodsFabric/delete", |
||||
deleteBatch: "/goodsfabric/goodsFabric/deleteBatch", |
||||
exportXlsUrl: "/goodsfabric/goodsFabric/exportXls", |
||||
importExcelUrl: "goodsfabric/goodsFabric/importExcel", |
||||
|
||||
}, |
||||
dictOptions:{}, |
||||
superFieldList:[], |
||||
} |
||||
}, |
||||
created() { |
||||
this.getSuperFieldList(); |
||||
}, |
||||
computed: { |
||||
importExcelUrl: function(){ |
||||
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; |
||||
}, |
||||
}, |
||||
methods: { |
||||
initDictConfig(){ |
||||
}, |
||||
getSuperFieldList(){ |
||||
let fieldList=[]; |
||||
fieldList.push({type:'string',value:'goodsId',text:'商品id',dictCode:'zy_goods,goods_name,id'}) |
||||
fieldList.push({type:'string',value:'fabricId',text:'面料id',dictCode:'zy_fabric,name,id'}) |
||||
this.superFieldList = fieldList |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
<style scoped> |
||||
@import '~@assets/less/common.less'; |
||||
</style> |
@ -0,0 +1,109 @@ |
||||
<template> |
||||
<a-spin :spinning="confirmLoading"> |
||||
<j-form-container :disabled="formDisabled"> |
||||
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> |
||||
<a-row> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="商品" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="goodsId"> |
||||
<j-dict-select-tag type="list" v-model="model.goodsId" dictCode="zy_goods,goods_name,id" placeholder="请选择商品" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="面料" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="fabricId"> |
||||
<j-dict-select-tag type="list" v-model="model.fabricId" dictCode="zy_fabric,name,id" placeholder="请选择面料" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
</a-row> |
||||
</a-form-model> |
||||
</j-form-container> |
||||
</a-spin> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import { httpAction, getAction } from '@/api/manage' |
||||
import { validateDuplicateValue } from '@/utils/util' |
||||
|
||||
export default { |
||||
name: 'GoodsFabricForm', |
||||
components: { |
||||
}, |
||||
props: { |
||||
//表单禁用 |
||||
disabled: { |
||||
type: Boolean, |
||||
default: false, |
||||
required: false |
||||
} |
||||
}, |
||||
data () { |
||||
return { |
||||
model:{ |
||||
}, |
||||
labelCol: { |
||||
xs: { span: 24 }, |
||||
sm: { span: 5 }, |
||||
}, |
||||
wrapperCol: { |
||||
xs: { span: 24 }, |
||||
sm: { span: 16 }, |
||||
}, |
||||
confirmLoading: false, |
||||
validatorRules: { |
||||
}, |
||||
url: { |
||||
add: "/goodsfabric/goodsFabric/add", |
||||
edit: "/goodsfabric/goodsFabric/edit", |
||||
queryById: "/goodsfabric/goodsFabric/queryById" |
||||
} |
||||
} |
||||
}, |
||||
computed: { |
||||
formDisabled(){ |
||||
return this.disabled |
||||
}, |
||||
}, |
||||
created () { |
||||
//备份model原始值 |
||||
this.modelDefault = JSON.parse(JSON.stringify(this.model)); |
||||
}, |
||||
methods: { |
||||
add () { |
||||
this.edit(this.modelDefault); |
||||
}, |
||||
edit (record) { |
||||
this.model = Object.assign({}, record); |
||||
this.visible = true; |
||||
}, |
||||
submitForm () { |
||||
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; |
||||
}) |
||||
} |
||||
|
||||
}) |
||||
}, |
||||
} |
||||
} |
||||
</script> |
@ -0,0 +1,60 @@ |
||||
<template> |
||||
<j-modal |
||||
:title="title" |
||||
:width="width" |
||||
:visible="visible" |
||||
switchFullscreen |
||||
@ok="handleOk" |
||||
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }" |
||||
@cancel="handleCancel" |
||||
cancelText="关闭"> |
||||
<goods-fabric-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></goods-fabric-form> |
||||
</j-modal> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import GoodsFabricForm from './GoodsFabricForm' |
||||
export default { |
||||
name: 'GoodsFabricModal', |
||||
components: { |
||||
GoodsFabricForm |
||||
}, |
||||
data () { |
||||
return { |
||||
title:'', |
||||
width:800, |
||||
visible: false, |
||||
disableSubmit: false |
||||
} |
||||
}, |
||||
methods: { |
||||
add () { |
||||
this.visible=true |
||||
this.$nextTick(()=>{ |
||||
this.$refs.realForm.add(); |
||||
}) |
||||
}, |
||||
edit (record) { |
||||
this.visible=true |
||||
this.$nextTick(()=>{ |
||||
this.$refs.realForm.edit(record); |
||||
}) |
||||
}, |
||||
close () { |
||||
this.$emit('close'); |
||||
this.visible = false; |
||||
}, |
||||
handleOk () { |
||||
this.$refs.realForm.submitForm(); |
||||
}, |
||||
submitCallback(){ |
||||
this.$emit('ok'); |
||||
this.visible = false; |
||||
}, |
||||
handleCancel () { |
||||
this.close() |
||||
} |
||||
} |
||||
} |
||||
</script> |
@ -0,0 +1,84 @@ |
||||
<template> |
||||
<a-drawer |
||||
:title="title" |
||||
:width="width" |
||||
placement="right" |
||||
:closable="false" |
||||
@close="close" |
||||
destroyOnClose |
||||
:visible="visible"> |
||||
<goods-fabric-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></goods-fabric-form> |
||||
<div class="drawer-footer"> |
||||
<a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button> |
||||
<a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button> |
||||
</div> |
||||
</a-drawer> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import GoodsFabricForm from './GoodsFabricForm' |
||||
|
||||
export default { |
||||
name: 'GoodsFabricModal', |
||||
components: { |
||||
GoodsFabricForm |
||||
}, |
||||
data () { |
||||
return { |
||||
title:"操作", |
||||
width:800, |
||||
visible: false, |
||||
disableSubmit: false |
||||
} |
||||
}, |
||||
methods: { |
||||
add () { |
||||
this.visible=true |
||||
this.$nextTick(()=>{ |
||||
this.$refs.realForm.add(); |
||||
}) |
||||
}, |
||||
edit (record) { |
||||
this.visible=true |
||||
this.$nextTick(()=>{ |
||||
this.$refs.realForm.edit(record); |
||||
}); |
||||
}, |
||||
close () { |
||||
this.$emit('close'); |
||||
this.visible = false; |
||||
}, |
||||
submitCallback(){ |
||||
this.$emit('ok'); |
||||
this.visible = false; |
||||
}, |
||||
handleOk () { |
||||
this.$refs.realForm.submitForm(); |
||||
}, |
||||
handleCancel () { |
||||
this.close() |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="less" scoped> |
||||
/** Button按钮间距 */ |
||||
.ant-btn { |
||||
margin-left: 30px; |
||||
margin-bottom: 30px; |
||||
float: right; |
||||
} |
||||
.drawer-footer{ |
||||
position: absolute; |
||||
bottom: -8px; |
||||
width: 100%; |
||||
border-top: 1px solid #e8e8e8; |
||||
padding: 10px 16px; |
||||
text-align: right; |
||||
left: 0; |
||||
background: #fff; |
||||
border-radius: 0 0 2px 2px; |
||||
} |
||||
</style> |
@ -0,0 +1,217 @@ |
||||
<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-dict-select-tag placeholder="请选择商品" v-model="queryParam.goodsId" dictCode="zy_goods,goods_name,id"/> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24"> |
||||
<a-form-item label="款式"> |
||||
<j-dict-select-tag placeholder="请选择款式" v-model="queryParam.styleId" dictCode="zy_cloths_style,style_names,id"/> |
||||
</a-form-item> |
||||
</a-col> |
||||
<template v-if="toggleSearchStatus"> |
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24"> |
||||
<a-form-item label="模块"> |
||||
<j-dict-select-tag placeholder="请选择模块" v-model="queryParam.moduleId" dictCode="zy_cloths_modular ,modular_name,id"/> |
||||
</a-form-item> |
||||
</a-col> |
||||
</template> |
||||
<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="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button> |
||||
<a @click="handleToggleSearch" style="margin-left: 8px"> |
||||
{{ toggleSearchStatus ? '收起' : '展开' }} |
||||
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/> |
||||
</a> |
||||
</span> |
||||
</a-col> |
||||
</a-row> |
||||
</a-form> |
||||
</div> |
||||
<!-- 查询区域-END --> |
||||
|
||||
<!-- 操作按钮区域 --> |
||||
<div class="table-operator"> |
||||
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> |
||||
<a-button type="primary" icon="download" @click="handleExportXls('商品模块表')">导出</a-button> |
||||
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> |
||||
<a-button type="primary" icon="import">导入</a-button> |
||||
</a-upload> |
||||
<!-- 高级查询区域 --> |
||||
<j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> |
||||
<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" |
||||
:scroll="{x:true}" |
||||
bordered |
||||
rowKey="id" |
||||
:columns="columns" |
||||
:dataSource="dataSource" |
||||
:pagination="ipagination" |
||||
:loading="loading" |
||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" |
||||
class="j-table-force-nowrap" |
||||
@change="handleTableChange"> |
||||
|
||||
<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"> |
||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> |
||||
<a-button |
||||
v-else |
||||
:ghost="true" |
||||
type="primary" |
||||
icon="download" |
||||
size="small" |
||||
@click="downloadFile(text)"> |
||||
下载 |
||||
</a-button> |
||||
</template> |
||||
|
||||
<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 @click="handleDetail(record)">详情</a> |
||||
</a-menu-item> |
||||
<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> |
||||
|
||||
<goods-module-modal ref="modalForm" @ok="modalFormOk"></goods-module-modal> |
||||
</a-card> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import '@/assets/less/TableExpand.less' |
||||
import { mixinDevice } from '@/utils/mixin' |
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
||||
import GoodsModuleModal from './modules/GoodsModuleModal' |
||||
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' |
||||
|
||||
export default { |
||||
name: 'GoodsModuleList', |
||||
mixins:[JeecgListMixin, mixinDevice], |
||||
components: { |
||||
GoodsModuleModal |
||||
}, |
||||
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: 'goodsId_dictText' |
||||
}, |
||||
{ |
||||
title:'款式', |
||||
align:"center", |
||||
dataIndex: 'styleId_dictText' |
||||
}, |
||||
{ |
||||
title:'模块', |
||||
align:"center", |
||||
dataIndex: 'moduleId_dictText' |
||||
}, |
||||
{ |
||||
title:'部位', |
||||
align:"center", |
||||
dataIndex: 'place' |
||||
}, |
||||
{ |
||||
title: '操作', |
||||
dataIndex: 'action', |
||||
align:"center", |
||||
fixed:"right", |
||||
width:147, |
||||
scopedSlots: { customRender: 'action' } |
||||
} |
||||
], |
||||
url: { |
||||
list: "/goodsmodule/goodsModule/list?goodsid="+this.$route.query.goodsid, |
||||
delete: "/goodsmodule/goodsModule/delete", |
||||
deleteBatch: "/goodsmodule/goodsModule/deleteBatch", |
||||
exportXlsUrl: "/goodsmodule/goodsModule/exportXls", |
||||
importExcelUrl: "goodsmodule/goodsModule/importExcel", |
||||
|
||||
}, |
||||
dictOptions:{}, |
||||
superFieldList:[], |
||||
} |
||||
}, |
||||
created() { |
||||
this.getSuperFieldList(); |
||||
}, |
||||
computed: { |
||||
importExcelUrl: function(){ |
||||
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; |
||||
}, |
||||
}, |
||||
methods: { |
||||
initDictConfig(){ |
||||
}, |
||||
getSuperFieldList(){ |
||||
let fieldList=[]; |
||||
fieldList.push({type:'string',value:'goodsId',text:'商品',dictCode:'zy_goods,goods_name,id'}) |
||||
fieldList.push({type:'string',value:'styleId',text:'款式',dictCode:'zy_cloths_style,style_names,id'}) |
||||
fieldList.push({type:'string',value:'moduleId',text:'模块',dictCode:'zy_cloths_modular ,modular_name,id'}) |
||||
fieldList.push({type:'string',value:'place',text:'部位',dictCode:''}) |
||||
this.superFieldList = fieldList |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
<style scoped> |
||||
@import '~@assets/less/common.less'; |
||||
</style> |
@ -0,0 +1,114 @@ |
||||
<template> |
||||
<a-spin :spinning="confirmLoading"> |
||||
<j-form-container :disabled="formDisabled"> |
||||
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> |
||||
<a-row> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="商品" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="goodsId"> |
||||
<j-dict-select-tag type="list" v-model="model.goodsId" dictCode="zy_goods,goods_name,id" placeholder="请选择商品" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="款式" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="styleId"> |
||||
<j-dict-select-tag type="list" v-model="model.styleId" dictCode="zy_cloths_style,style_names,id" placeholder="请选择款式" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="模块" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="moduleId"> |
||||
<j-dict-select-tag type="list" v-model="model.moduleId" dictCode="zy_cloths_modular ,modular_name,id" placeholder="请选择模块" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
</a-row> |
||||
</a-form-model> |
||||
</j-form-container> |
||||
</a-spin> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import { httpAction, getAction } from '@/api/manage' |
||||
import { validateDuplicateValue } from '@/utils/util' |
||||
|
||||
export default { |
||||
name: 'GoodsModuleForm', |
||||
components: { |
||||
}, |
||||
props: { |
||||
//表单禁用 |
||||
disabled: { |
||||
type: Boolean, |
||||
default: false, |
||||
required: false |
||||
} |
||||
}, |
||||
data () { |
||||
return { |
||||
model:{ |
||||
}, |
||||
labelCol: { |
||||
xs: { span: 24 }, |
||||
sm: { span: 5 }, |
||||
}, |
||||
wrapperCol: { |
||||
xs: { span: 24 }, |
||||
sm: { span: 16 }, |
||||
}, |
||||
confirmLoading: false, |
||||
validatorRules: { |
||||
}, |
||||
url: { |
||||
add: "/goodsmodule/goodsModule/add", |
||||
edit: "/goodsmodule/goodsModule/edit", |
||||
queryById: "/goodsmodule/goodsModule/queryById" |
||||
} |
||||
} |
||||
}, |
||||
computed: { |
||||
formDisabled(){ |
||||
return this.disabled |
||||
}, |
||||
}, |
||||
created () { |
||||
//备份model原始值 |
||||
this.modelDefault = JSON.parse(JSON.stringify(this.model)); |
||||
}, |
||||
methods: { |
||||
add () { |
||||
this.edit(this.modelDefault); |
||||
}, |
||||
edit (record) { |
||||
this.model = Object.assign({}, record); |
||||
this.visible = true; |
||||
}, |
||||
submitForm () { |
||||
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; |
||||
}) |
||||
} |
||||
|
||||
}) |
||||
}, |
||||
} |
||||
} |
||||
</script> |
@ -0,0 +1,60 @@ |
||||
<template> |
||||
<j-modal |
||||
:title="title" |
||||
:width="width" |
||||
:visible="visible" |
||||
switchFullscreen |
||||
@ok="handleOk" |
||||
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }" |
||||
@cancel="handleCancel" |
||||
cancelText="关闭"> |
||||
<goods-module-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></goods-module-form> |
||||
</j-modal> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import GoodsModuleForm from './GoodsModuleForm' |
||||
export default { |
||||
name: 'GoodsModuleModal', |
||||
components: { |
||||
GoodsModuleForm |
||||
}, |
||||
data () { |
||||
return { |
||||
title:'', |
||||
width:800, |
||||
visible: false, |
||||
disableSubmit: false |
||||
} |
||||
}, |
||||
methods: { |
||||
add () { |
||||
this.visible=true |
||||
this.$nextTick(()=>{ |
||||
this.$refs.realForm.add(); |
||||
}) |
||||
}, |
||||
edit (record) { |
||||
this.visible=true |
||||
this.$nextTick(()=>{ |
||||
this.$refs.realForm.edit(record); |
||||
}) |
||||
}, |
||||
close () { |
||||
this.$emit('close'); |
||||
this.visible = false; |
||||
}, |
||||
handleOk () { |
||||
this.$refs.realForm.submitForm(); |
||||
}, |
||||
submitCallback(){ |
||||
this.$emit('ok'); |
||||
this.visible = false; |
||||
}, |
||||
handleCancel () { |
||||
this.close() |
||||
} |
||||
} |
||||
} |
||||
</script> |
@ -0,0 +1,84 @@ |
||||
<template> |
||||
<a-drawer |
||||
:title="title" |
||||
:width="width" |
||||
placement="right" |
||||
:closable="false" |
||||
@close="close" |
||||
destroyOnClose |
||||
:visible="visible"> |
||||
<goods-module-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></goods-module-form> |
||||
<div class="drawer-footer"> |
||||
<a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button> |
||||
<a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button> |
||||
</div> |
||||
</a-drawer> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import GoodsModuleForm from './GoodsModuleForm' |
||||
|
||||
export default { |
||||
name: 'GoodsModuleModal', |
||||
components: { |
||||
GoodsModuleForm |
||||
}, |
||||
data () { |
||||
return { |
||||
title:"操作", |
||||
width:800, |
||||
visible: false, |
||||
disableSubmit: false |
||||
} |
||||
}, |
||||
methods: { |
||||
add () { |
||||
this.visible=true |
||||
this.$nextTick(()=>{ |
||||
this.$refs.realForm.add(); |
||||
}) |
||||
}, |
||||
edit (record) { |
||||
this.visible=true |
||||
this.$nextTick(()=>{ |
||||
this.$refs.realForm.edit(record); |
||||
}); |
||||
}, |
||||
close () { |
||||
this.$emit('close'); |
||||
this.visible = false; |
||||
}, |
||||
submitCallback(){ |
||||
this.$emit('ok'); |
||||
this.visible = false; |
||||
}, |
||||
handleOk () { |
||||
this.$refs.realForm.submitForm(); |
||||
}, |
||||
handleCancel () { |
||||
this.close() |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="less" scoped> |
||||
/** Button按钮间距 */ |
||||
.ant-btn { |
||||
margin-left: 30px; |
||||
margin-bottom: 30px; |
||||
float: right; |
||||
} |
||||
.drawer-footer{ |
||||
position: absolute; |
||||
bottom: -8px; |
||||
width: 100%; |
||||
border-top: 1px solid #e8e8e8; |
||||
padding: 10px 16px; |
||||
text-align: right; |
||||
left: 0; |
||||
background: #fff; |
||||
border-radius: 0 0 2px 2px; |
||||
} |
||||
</style> |
@ -0,0 +1,351 @@ |
||||
<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="商品编号"> |
||||
<a-input placeholder="请输入商品编号" v-model="queryParam.goodsCode"></a-input> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24"> |
||||
<a-form-item label="商品名称"> |
||||
<a-input placeholder="请输入商品名称" v-model="queryParam.goodsName"></a-input> |
||||
</a-form-item> |
||||
</a-col> |
||||
<template v-if="toggleSearchStatus"> |
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24"> |
||||
<a-form-item label="是否定制"> |
||||
<j-dict-select-tag placeholder="请选择是否定制" v-model="queryParam.customized" dictCode="yn"/> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24"> |
||||
<a-form-item label="类型"> |
||||
<j-dict-select-tag placeholder="请选择类型" v-model="queryParam.clothsTypeId" dictCode="zy_cloths_type ,type_name,id"/> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24"> |
||||
<a-form-item label="型号"> |
||||
<j-dict-select-tag placeholder="请选择型号" v-model="queryParam.modelId" dictCode="zy_style_model,model_number,id"/> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24"> |
||||
<a-form-item label="款式"> |
||||
<j-dict-select-tag placeholder="请选择款式" v-model="queryParam.styleId" dictCode="zy_cloths_style,style_names,id"/> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24"> |
||||
<a-form-item label="是否推荐"> |
||||
<j-dict-select-tag placeholder="请选择是否推荐" v-model="queryParam.recommend" dictCode="yn"/> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24"> |
||||
<a-form-item label="状态"> |
||||
<j-dict-select-tag placeholder="请选择状态" v-model="queryParam.status" dictCode="good_status"/> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24"> |
||||
<a-form-item label="企业"> |
||||
<j-select-depart placeholder="请选择企业" v-model="queryParam.enterprisesId"/> |
||||
</a-form-item> |
||||
</a-col> |
||||
</template> |
||||
<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="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button> |
||||
<a @click="handleToggleSearch" style="margin-left: 8px"> |
||||
{{ toggleSearchStatus ? '收起' : '展开' }} |
||||
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/> |
||||
</a> |
||||
</span> |
||||
</a-col> |
||||
</a-row> |
||||
</a-form> |
||||
</div> |
||||
<!-- 查询区域-END --> |
||||
|
||||
<!-- 操作按钮区域 --> |
||||
<div class="table-operator"> |
||||
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> |
||||
<a-button type="primary" icon="download" @click="handleExportXls('商品表')">导出</a-button> |
||||
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> |
||||
<a-button type="primary" icon="import">导入</a-button> |
||||
</a-upload> |
||||
<!-- 高级查询区域 --> |
||||
<j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> |
||||
<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" |
||||
:scroll="{x:true}" |
||||
bordered |
||||
rowKey="id" |
||||
:columns="columns" |
||||
:dataSource="dataSource" |
||||
:pagination="ipagination" |
||||
:loading="loading" |
||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" |
||||
class="j-table-force-nowrap" |
||||
@change="handleTableChange"> |
||||
|
||||
<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"> |
||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> |
||||
<a-button |
||||
v-else |
||||
:ghost="true" |
||||
type="primary" |
||||
icon="download" |
||||
size="small" |
||||
@click="downloadFile(text)"> |
||||
下载 |
||||
</a-button> |
||||
</template> |
||||
|
||||
<span slot="action" slot-scope="text, record"> |
||||
<a @click="handleEdit(record)">编辑</a> |
||||
|
||||
<a-divider type="vertical" /> |
||||
<a @click="goodsModule(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 @click="handleDetail(record)">详情</a> |
||||
</a-menu-item> |
||||
<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> |
||||
|
||||
<zy-goods-modal ref="modalForm" @ok="modalFormOk"></zy-goods-modal> |
||||
</a-card> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import '@/assets/less/TableExpand.less' |
||||
import { mixinDevice } from '@/utils/mixin' |
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
||||
import ZyGoodsModal from './modules/ZyGoodsModal' |
||||
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' |
||||
|
||||
export default { |
||||
name: 'ZyGoodsList', |
||||
mixins:[JeecgListMixin, mixinDevice], |
||||
components: { |
||||
ZyGoodsModal |
||||
}, |
||||
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: 'goodsCode' |
||||
}, |
||||
{ |
||||
title:'商品名称', |
||||
align:"center", |
||||
dataIndex: 'goodsName' |
||||
}, |
||||
{ |
||||
title:'商品描述', |
||||
align:"center", |
||||
dataIndex: 'goodsIntr' |
||||
}, |
||||
{ |
||||
title:'是否定制', |
||||
align:"center", |
||||
dataIndex: 'customized_dictText' |
||||
}, |
||||
{ |
||||
title:'商品图片', |
||||
align:"center", |
||||
dataIndex: 'goodsPicture', |
||||
scopedSlots: {customRender: 'imgSlot'} |
||||
}, |
||||
{ |
||||
title:'默认图片', |
||||
align:"center", |
||||
dataIndex: 'defaultPicture', |
||||
scopedSlots: {customRender: 'imgSlot'} |
||||
}, |
||||
{ |
||||
title:'商品视频', |
||||
align:"center", |
||||
dataIndex: 'goodsVideo', |
||||
scopedSlots: {customRender: 'fileSlot'} |
||||
}, |
||||
{ |
||||
title:'类型', |
||||
align:"center", |
||||
dataIndex: 'clothsTypeId_dictText' |
||||
}, |
||||
{ |
||||
title:'型号', |
||||
align:"center", |
||||
dataIndex: 'modelId_dictText' |
||||
}, |
||||
{ |
||||
title:'款式', |
||||
align:"center", |
||||
dataIndex: 'styleId_dictText' |
||||
}, |
||||
{ |
||||
title:'单位', |
||||
align:"center", |
||||
dataIndex: 'unit' |
||||
}, |
||||
{ |
||||
title:'包装个数', |
||||
align:"center", |
||||
dataIndex: 'number' |
||||
}, |
||||
{ |
||||
title:'单价', |
||||
align:"center", |
||||
dataIndex: 'unitPrice' |
||||
}, |
||||
{ |
||||
title:'折扣', |
||||
align:"center", |
||||
dataIndex: 'discount' |
||||
}, |
||||
{ |
||||
title:'促销价', |
||||
align:"center", |
||||
dataIndex: 'promotionPrice' |
||||
}, |
||||
{ |
||||
title:'是否推荐', |
||||
align:"center", |
||||
dataIndex: 'recommend_dictText' |
||||
}, |
||||
{ |
||||
title:'产地', |
||||
align:"center", |
||||
dataIndex: 'placeOrigin' |
||||
}, |
||||
{ |
||||
title:'状态', |
||||
align:"center", |
||||
dataIndex: 'status_dictText' |
||||
}, |
||||
{ |
||||
title:'企业', |
||||
align:"center", |
||||
dataIndex: 'enterprisesId_dictText' |
||||
}, |
||||
{ |
||||
title: '操作', |
||||
dataIndex: 'action', |
||||
align:"center", |
||||
fixed:"right", |
||||
width:147, |
||||
scopedSlots: { customRender: 'action' } |
||||
} |
||||
], |
||||
url: { |
||||
list: "/zygoods/zyGoods/list", |
||||
delete: "/zygoods/zyGoods/delete", |
||||
deleteBatch: "/zygoods/zyGoods/deleteBatch", |
||||
exportXlsUrl: "/zygoods/zyGoods/exportXls", |
||||
importExcelUrl: "zygoods/zyGoods/importExcel", |
||||
|
||||
}, |
||||
dictOptions:{}, |
||||
superFieldList:[], |
||||
} |
||||
}, |
||||
created() { |
||||
this.getSuperFieldList(); |
||||
}, |
||||
computed: { |
||||
importExcelUrl: function(){ |
||||
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; |
||||
}, |
||||
}, |
||||
methods: { |
||||
goodsModule(record) |
||||
{ |
||||
this.$router.push({ |
||||
path: '/goodsmodule/GoodsModuleList', |
||||
query: { // 路由携带参数 |
||||
'goodsid': record.id, |
||||
} |
||||
}); |
||||
}, |
||||
initDictConfig(){ |
||||
}, |
||||
getSuperFieldList(){ |
||||
let fieldList=[]; |
||||
fieldList.push({type:'string',value:'goodsCode',text:'商品编号',dictCode:''}) |
||||
fieldList.push({type:'string',value:'goodsName',text:'商品名称',dictCode:''}) |
||||
fieldList.push({type:'string',value:'goodsIntr',text:'商品描述',dictCode:''}) |
||||
fieldList.push({type:'int',value:'customized',text:'是否定制',dictCode:'yn'}) |
||||
fieldList.push({type:'string',value:'goodsPicture',text:'商品图片',dictCode:''}) |
||||
fieldList.push({type:'string',value:'defaultPicture',text:'默认图片',dictCode:''}) |
||||
fieldList.push({type:'string',value:'goodsVideo',text:'商品视频',dictCode:''}) |
||||
fieldList.push({type:'string',value:'clothsTypeId',text:'类型',dictCode:'zy_cloths_type ,type_name,id'}) |
||||
fieldList.push({type:'string',value:'modelId',text:'型号',dictCode:'zy_style_model,model_number,id'}) |
||||
fieldList.push({type:'string',value:'styleId',text:'款式',dictCode:'zy_cloths_style,style_names,id'}) |
||||
fieldList.push({type:'string',value:'unit',text:'单位',dictCode:''}) |
||||
fieldList.push({type:'int',value:'number',text:'包装个数',dictCode:''}) |
||||
fieldList.push({type:'double',value:'unitPrice',text:'单价',dictCode:''}) |
||||
fieldList.push({type:'double',value:'discount',text:'折扣',dictCode:''}) |
||||
fieldList.push({type:'double',value:'promotionPrice',text:'促销价',dictCode:''}) |
||||
fieldList.push({type:'int',value:'recommend',text:'是否推荐',dictCode:'yn'}) |
||||
fieldList.push({type:'string',value:'placeOrigin',text:'产地',dictCode:''}) |
||||
fieldList.push({type:'int',value:'status',text:'状态',dictCode:'good_status'}) |
||||
fieldList.push({type:'sel_depart',value:'enterprisesId',text:'企业'}) |
||||
this.superFieldList = fieldList |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
<style scoped> |
||||
@import '~@assets/less/common.less'; |
||||
</style> |
@ -0,0 +1,219 @@ |
||||
<template> |
||||
<a-spin :spinning="confirmLoading"> |
||||
<j-form-container :disabled="formDisabled"> |
||||
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> |
||||
<a-row> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="商品编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="goodsCode"> |
||||
<a-input v-model="model.goodsCode" placeholder="请输入商品编号" ></a-input> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="商品名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="goodsName"> |
||||
<a-input v-model="model.goodsName" placeholder="请输入商品名称" ></a-input> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="商品描述" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="goodsIntr"> |
||||
<a-input v-model="model.goodsIntr" placeholder="请输入商品描述" ></a-input> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="是否定制" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="customized"> |
||||
<j-dict-select-tag type="radio" v-model="model.customized" dictCode="yn" placeholder="请选择是否定制" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="商品图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="goodsPicture"> |
||||
<j-image-upload isMultiple v-model="model.goodsPicture" ></j-image-upload> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="默认图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="defaultPicture"> |
||||
<j-image-upload isMultiple v-model="model.defaultPicture" ></j-image-upload> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="商品视频" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="goodsVideo"> |
||||
<j-upload v-model="model.goodsVideo" ></j-upload> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="clothsTypeId"> |
||||
<j-dict-select-tag type="list" v-model="model.clothsTypeId" dictCode="zy_cloths_type ,type_name,id" placeholder="请选择类型id" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="型号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="modelId"> |
||||
<j-dict-select-tag type="list" v-model="model.modelId" dictCode="zy_style_model,model_number,id" placeholder="请选择型号id" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="款式" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="styleId"> |
||||
<j-dict-select-tag type="list" v-model="model.styleId" dictCode="zy_cloths_style,style_names,id" placeholder="请选择款式id" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="单位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="unit"> |
||||
<a-input v-model="model.unit" placeholder="请输入单位" ></a-input> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="包装个数" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="number"> |
||||
<a-input-number v-model="model.number" placeholder="请输入包装个数" style="width: 100%" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="单价" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="unitPrice"> |
||||
<a-input-number v-model="model.unitPrice" placeholder="请输入单价" style="width: 100%" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="折扣" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="discount"> |
||||
<a-input-number v-model="model.discount" placeholder="请输入折扣" style="width: 100%" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="促销价" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="promotionPrice"> |
||||
<a-input-number v-model="model.promotionPrice" placeholder="请输入促销价" style="width: 100%" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="是否推荐" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="recommend"> |
||||
<j-dict-select-tag type="radio" v-model="model.recommend" dictCode="yn" placeholder="请选择是否推荐" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="产地" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="placeOrigin"> |
||||
<a-input v-model="model.placeOrigin" placeholder="请输入产地" ></a-input> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status"> |
||||
<j-dict-select-tag type="radio" v-model="model.status" dictCode="good_status" placeholder="请选择状态" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="企业" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="enterprisesId"> |
||||
<j-select-depart v-model="model.enterprisesId" multi /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
</a-row> |
||||
</a-form-model> |
||||
</j-form-container> |
||||
</a-spin> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import { httpAction, getAction } from '@/api/manage' |
||||
import { validateDuplicateValue } from '@/utils/util' |
||||
|
||||
export default { |
||||
name: 'ZyGoodsForm', |
||||
components: { |
||||
}, |
||||
props: { |
||||
//表单禁用 |
||||
disabled: { |
||||
type: Boolean, |
||||
default: false, |
||||
required: false |
||||
} |
||||
}, |
||||
data () { |
||||
return { |
||||
model:{ |
||||
customized:0, |
||||
recommend:0, |
||||
status:1, |
||||
}, |
||||
labelCol: { |
||||
xs: { span: 24 }, |
||||
sm: { span: 5 }, |
||||
}, |
||||
wrapperCol: { |
||||
xs: { span: 24 }, |
||||
sm: { span: 16 }, |
||||
}, |
||||
confirmLoading: false, |
||||
validatorRules: { |
||||
goodsCode: [ |
||||
{ required: true, message: '请输入商品编号!'}, |
||||
], |
||||
styleId: [ |
||||
{ required: true, message: '请选择款式!'}, |
||||
], |
||||
number: [ |
||||
{ required: false}, |
||||
{ pattern: /^-?\d+$/, message: '请输入整数!'}, |
||||
], |
||||
unitPrice: [ |
||||
{ required: false}, |
||||
{ pattern: /^(([1-9][0-9]*)|([0]\.\d{0,2}|[1-9][0-9]*\.\d{0,2}))$/, message: '请输入正确的金额!'}, |
||||
], |
||||
discount: [ |
||||
{ required: false}, |
||||
{ pattern: /^(([1-9][0-9]*)|([0]\.\d{0,2}|[1-9][0-9]*\.\d{0,2}))$/, message: '请输入正确的金额!'}, |
||||
], |
||||
promotionPrice: [ |
||||
{ required: false}, |
||||
{ pattern: /^(([1-9][0-9]*)|([0]\.\d{0,2}|[1-9][0-9]*\.\d{0,2}))$/, message: '请输入正确的金额!'}, |
||||
], |
||||
}, |
||||
url: { |
||||
add: "/zygoods/zyGoods/add", |
||||
edit: "/zygoods/zyGoods/edit", |
||||
queryById: "/zygoods/zyGoods/queryById" |
||||
} |
||||
} |
||||
}, |
||||
computed: { |
||||
formDisabled(){ |
||||
return this.disabled |
||||
}, |
||||
}, |
||||
created () { |
||||
//备份model原始值 |
||||
this.modelDefault = JSON.parse(JSON.stringify(this.model)); |
||||
}, |
||||
methods: { |
||||
add () { |
||||
this.edit(this.modelDefault); |
||||
}, |
||||
edit (record) { |
||||
this.model = Object.assign({}, record); |
||||
this.visible = true; |
||||
}, |
||||
submitForm () { |
||||
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; |
||||
}) |
||||
} |
||||
|
||||
}) |
||||
}, |
||||
} |
||||
} |
||||
</script> |
@ -0,0 +1,60 @@ |
||||
<template> |
||||
<j-modal |
||||
:title="title" |
||||
:width="width" |
||||
:visible="visible" |
||||
switchFullscreen |
||||
@ok="handleOk" |
||||
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }" |
||||
@cancel="handleCancel" |
||||
cancelText="关闭"> |
||||
<zy-goods-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></zy-goods-form> |
||||
</j-modal> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import ZyGoodsForm from './ZyGoodsForm' |
||||
export default { |
||||
name: 'ZyGoodsModal', |
||||
components: { |
||||
ZyGoodsForm |
||||
}, |
||||
data () { |
||||
return { |
||||
title:'', |
||||
width:800, |
||||
visible: false, |
||||
disableSubmit: false |
||||
} |
||||
}, |
||||
methods: { |
||||
add () { |
||||
this.visible=true |
||||
this.$nextTick(()=>{ |
||||
this.$refs.realForm.add(); |
||||
}) |
||||
}, |
||||
edit (record) { |
||||
this.visible=true |
||||
this.$nextTick(()=>{ |
||||
this.$refs.realForm.edit(record); |
||||
}) |
||||
}, |
||||
close () { |
||||
this.$emit('close'); |
||||
this.visible = false; |
||||
}, |
||||
handleOk () { |
||||
this.$refs.realForm.submitForm(); |
||||
}, |
||||
submitCallback(){ |
||||
this.$emit('ok'); |
||||
this.visible = false; |
||||
}, |
||||
handleCancel () { |
||||
this.close() |
||||
} |
||||
} |
||||
} |
||||
</script> |
@ -0,0 +1,84 @@ |
||||
<template> |
||||
<a-drawer |
||||
:title="title" |
||||
:width="width" |
||||
placement="right" |
||||
:closable="false" |
||||
@close="close" |
||||
destroyOnClose |
||||
:visible="visible"> |
||||
<zy-goods-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></zy-goods-form> |
||||
<div class="drawer-footer"> |
||||
<a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button> |
||||
<a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button> |
||||
</div> |
||||
</a-drawer> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import ZyGoodsForm from './ZyGoodsForm' |
||||
|
||||
export default { |
||||
name: 'ZyGoodsModal', |
||||
components: { |
||||
ZyGoodsForm |
||||
}, |
||||
data () { |
||||
return { |
||||
title:"操作", |
||||
width:800, |
||||
visible: false, |
||||
disableSubmit: false |
||||
} |
||||
}, |
||||
methods: { |
||||
add () { |
||||
this.visible=true |
||||
this.$nextTick(()=>{ |
||||
this.$refs.realForm.add(); |
||||
}) |
||||
}, |
||||
edit (record) { |
||||
this.visible=true |
||||
this.$nextTick(()=>{ |
||||
this.$refs.realForm.edit(record); |
||||
}); |
||||
}, |
||||
close () { |
||||
this.$emit('close'); |
||||
this.visible = false; |
||||
}, |
||||
submitCallback(){ |
||||
this.$emit('ok'); |
||||
this.visible = false; |
||||
}, |
||||
handleOk () { |
||||
this.$refs.realForm.submitForm(); |
||||
}, |
||||
handleCancel () { |
||||
this.close() |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="less" scoped> |
||||
/** Button按钮间距 */ |
||||
.ant-btn { |
||||
margin-left: 30px; |
||||
margin-bottom: 30px; |
||||
float: right; |
||||
} |
||||
.drawer-footer{ |
||||
position: absolute; |
||||
bottom: -8px; |
||||
width: 100%; |
||||
border-top: 1px solid #e8e8e8; |
||||
padding: 10px 16px; |
||||
text-align: right; |
||||
left: 0; |
||||
background: #fff; |
||||
border-radius: 0 0 2px 2px; |
||||
} |
||||
</style> |
@ -0,0 +1,171 @@ |
||||
package org.jeecg.modules.demo.goodsaccessories.controller; |
||||
|
||||
import java.util.Arrays; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import java.util.stream.Collectors; |
||||
import java.io.IOException; |
||||
import java.io.UnsupportedEncodingException; |
||||
import java.net.URLDecoder; |
||||
import javax.servlet.http.HttpServletRequest; |
||||
import javax.servlet.http.HttpServletResponse; |
||||
import org.jeecg.common.api.vo.Result; |
||||
import org.jeecg.common.system.query.QueryGenerator; |
||||
import org.jeecg.common.util.oConvertUtils; |
||||
import org.jeecg.modules.demo.goodsaccessories.entity.GoodsAccessories; |
||||
import org.jeecg.modules.demo.goodsaccessories.service.IGoodsAccessoriesService; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil; |
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants; |
||||
import org.jeecgframework.poi.excel.entity.ExportParams; |
||||
import org.jeecgframework.poi.excel.entity.ImportParams; |
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; |
||||
import org.jeecg.common.system.base.controller.JeecgController; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.web.bind.annotation.*; |
||||
import org.springframework.web.multipart.MultipartFile; |
||||
import org.springframework.web.multipart.MultipartHttpServletRequest; |
||||
import org.springframework.web.servlet.ModelAndView; |
||||
import com.alibaba.fastjson.JSON; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import org.jeecg.common.aspect.annotation.AutoLog; |
||||
|
||||
/** |
||||
* @Description: 商品辅料表 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2022-12-06 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Api(tags="商品辅料表") |
||||
@RestController |
||||
@RequestMapping("/goodsaccessories/goodsAccessories") |
||||
@Slf4j |
||||
public class GoodsAccessoriesController extends JeecgController<GoodsAccessories, IGoodsAccessoriesService> { |
||||
@Autowired |
||||
private IGoodsAccessoriesService goodsAccessoriesService; |
||||
|
||||
/** |
||||
* 分页列表查询 |
||||
* |
||||
* @param goodsAccessories |
||||
* @param pageNo |
||||
* @param pageSize |
||||
* @param req |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "商品辅料表-分页列表查询") |
||||
@ApiOperation(value="商品辅料表-分页列表查询", notes="商品辅料表-分页列表查询") |
||||
@GetMapping(value = "/list") |
||||
public Result<?> queryPageList(GoodsAccessories goodsAccessories, |
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
||||
HttpServletRequest req) { |
||||
QueryWrapper<GoodsAccessories> queryWrapper = QueryGenerator.initQueryWrapper(goodsAccessories, req.getParameterMap()); |
||||
Page<GoodsAccessories> page = new Page<GoodsAccessories>(pageNo, pageSize); |
||||
IPage<GoodsAccessories> pageList = goodsAccessoriesService.page(page, queryWrapper); |
||||
return Result.OK(pageList); |
||||
} |
||||
|
||||
/** |
||||
* 添加 |
||||
* |
||||
* @param goodsAccessories |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "商品辅料表-添加") |
||||
@ApiOperation(value="商品辅料表-添加", notes="商品辅料表-添加") |
||||
@PostMapping(value = "/add") |
||||
public Result<?> add(@RequestBody GoodsAccessories goodsAccessories) { |
||||
goodsAccessoriesService.save(goodsAccessories); |
||||
return Result.OK("添加成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 编辑 |
||||
* |
||||
* @param goodsAccessories |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "商品辅料表-编辑") |
||||
@ApiOperation(value="商品辅料表-编辑", notes="商品辅料表-编辑") |
||||
@PutMapping(value = "/edit") |
||||
public Result<?> edit(@RequestBody GoodsAccessories goodsAccessories) { |
||||
goodsAccessoriesService.updateById(goodsAccessories); |
||||
return Result.OK("编辑成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 通过id删除 |
||||
* |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "商品辅料表-通过id删除") |
||||
@ApiOperation(value="商品辅料表-通过id删除", notes="商品辅料表-通过id删除") |
||||
@DeleteMapping(value = "/delete") |
||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) { |
||||
goodsAccessoriesService.removeById(id); |
||||
return Result.OK("删除成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 批量删除 |
||||
* |
||||
* @param ids |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "商品辅料表-批量删除") |
||||
@ApiOperation(value="商品辅料表-批量删除", notes="商品辅料表-批量删除") |
||||
@DeleteMapping(value = "/deleteBatch") |
||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
||||
this.goodsAccessoriesService.removeByIds(Arrays.asList(ids.split(","))); |
||||
return Result.OK("批量删除成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 通过id查询 |
||||
* |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "商品辅料表-通过id查询") |
||||
@ApiOperation(value="商品辅料表-通过id查询", notes="商品辅料表-通过id查询") |
||||
@GetMapping(value = "/queryById") |
||||
public Result<?> queryById(@RequestParam(name="id",required=true) String id) { |
||||
GoodsAccessories goodsAccessories = goodsAccessoriesService.getById(id); |
||||
if(goodsAccessories==null) { |
||||
return Result.error("未找到对应数据"); |
||||
} |
||||
return Result.OK(goodsAccessories); |
||||
} |
||||
|
||||
/** |
||||
* 导出excel |
||||
* |
||||
* @param request |
||||
* @param goodsAccessories |
||||
*/ |
||||
@RequestMapping(value = "/exportXls") |
||||
public ModelAndView exportXls(HttpServletRequest request, GoodsAccessories goodsAccessories) { |
||||
return super.exportXls(request, goodsAccessories, GoodsAccessories.class, "商品辅料表"); |
||||
} |
||||
|
||||
/** |
||||
* 通过excel导入数据 |
||||
* |
||||
* @param request |
||||
* @param response |
||||
* @return |
||||
*/ |
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
||||
return super.importExcel(request, response, GoodsAccessories.class); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,67 @@ |
||||
package org.jeecg.modules.demo.goodsaccessories.entity; |
||||
|
||||
import java.io.Serializable; |
||||
import java.io.UnsupportedEncodingException; |
||||
import java.util.Date; |
||||
import java.math.BigDecimal; |
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import lombok.Data; |
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import org.springframework.format.annotation.DateTimeFormat; |
||||
import org.jeecgframework.poi.excel.annotation.Excel; |
||||
import org.jeecg.common.aspect.annotation.Dict; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.EqualsAndHashCode; |
||||
import lombok.experimental.Accessors; |
||||
|
||||
/** |
||||
* @Description: 商品辅料表 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2022-12-06 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Data |
||||
@TableName("goods_accessories") |
||||
@Accessors(chain = true) |
||||
@EqualsAndHashCode(callSuper = false) |
||||
@ApiModel(value="goods_accessories对象", description="商品辅料表") |
||||
public class GoodsAccessories implements Serializable { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/**主键*/ |
||||
@TableId(type = IdType.ASSIGN_ID) |
||||
@ApiModelProperty(value = "主键") |
||||
private java.lang.String id; |
||||
/**创建人*/ |
||||
@ApiModelProperty(value = "创建人") |
||||
private java.lang.String createBy; |
||||
/**创建日期*/ |
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
||||
@ApiModelProperty(value = "创建日期") |
||||
private java.util.Date createTime; |
||||
/**更新人*/ |
||||
@ApiModelProperty(value = "更新人") |
||||
private java.lang.String updateBy; |
||||
/**更新日期*/ |
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
||||
@ApiModelProperty(value = "更新日期") |
||||
private java.util.Date updateTime; |
||||
/**所属部门*/ |
||||
@ApiModelProperty(value = "所属部门") |
||||
private java.lang.String sysOrgCode; |
||||
/**商品id*/ |
||||
@Excel(name = "商品id", width = 15, dictTable = "zy_goods", dicText = "goods_name", dicCode = "id") |
||||
@Dict(dictTable = "zy_goods", dicText = "goods_num", dicCode = "id") |
||||
@ApiModelProperty(value = "商品id") |
||||
private java.lang.String goodsId; |
||||
/**辅料id*/ |
||||
@Excel(name = "辅料id", width = 15, dictTable = "zy_accessories", dicText = "contents", dicCode = "id") |
||||
@Dict(dictTable = "zy_accessories", dicText = "contents", dicCode = "id") |
||||
@ApiModelProperty(value = "辅料id") |
||||
private java.lang.String accessoriesId; |
||||
} |
@ -0,0 +1,17 @@ |
||||
package org.jeecg.modules.demo.goodsaccessories.mapper; |
||||
|
||||
import java.util.List; |
||||
|
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.jeecg.modules.demo.goodsaccessories.entity.GoodsAccessories; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
||||
/** |
||||
* @Description: 商品辅料表 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2022-12-06 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface GoodsAccessoriesMapper extends BaseMapper<GoodsAccessories> { |
||||
|
||||
} |
@ -0,0 +1,5 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
<mapper namespace="org.jeecg.modules.demo.goodsaccessories.mapper.GoodsAccessoriesMapper"> |
||||
|
||||
</mapper> |
@ -0,0 +1,14 @@ |
||||
package org.jeecg.modules.demo.goodsaccessories.service; |
||||
|
||||
import org.jeecg.modules.demo.goodsaccessories.entity.GoodsAccessories; |
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
||||
/** |
||||
* @Description: 商品辅料表 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2022-12-06 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface IGoodsAccessoriesService extends IService<GoodsAccessories> { |
||||
|
||||
} |
@ -0,0 +1,19 @@ |
||||
package org.jeecg.modules.demo.goodsaccessories.service.impl; |
||||
|
||||
import org.jeecg.modules.demo.goodsaccessories.entity.GoodsAccessories; |
||||
import org.jeecg.modules.demo.goodsaccessories.mapper.GoodsAccessoriesMapper; |
||||
import org.jeecg.modules.demo.goodsaccessories.service.IGoodsAccessoriesService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
||||
/** |
||||
* @Description: 商品辅料表 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2022-12-06 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Service |
||||
public class GoodsAccessoriesServiceImpl extends ServiceImpl<GoodsAccessoriesMapper, GoodsAccessories> implements IGoodsAccessoriesService { |
||||
|
||||
} |
@ -0,0 +1,171 @@ |
||||
package org.jeecg.modules.demo.goodsfabric.controller; |
||||
|
||||
import java.util.Arrays; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import java.util.stream.Collectors; |
||||
import java.io.IOException; |
||||
import java.io.UnsupportedEncodingException; |
||||
import java.net.URLDecoder; |
||||
import javax.servlet.http.HttpServletRequest; |
||||
import javax.servlet.http.HttpServletResponse; |
||||
import org.jeecg.common.api.vo.Result; |
||||
import org.jeecg.common.system.query.QueryGenerator; |
||||
import org.jeecg.common.util.oConvertUtils; |
||||
import org.jeecg.modules.demo.goodsfabric.entity.GoodsFabric; |
||||
import org.jeecg.modules.demo.goodsfabric.service.IGoodsFabricService; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil; |
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants; |
||||
import org.jeecgframework.poi.excel.entity.ExportParams; |
||||
import org.jeecgframework.poi.excel.entity.ImportParams; |
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; |
||||
import org.jeecg.common.system.base.controller.JeecgController; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.web.bind.annotation.*; |
||||
import org.springframework.web.multipart.MultipartFile; |
||||
import org.springframework.web.multipart.MultipartHttpServletRequest; |
||||
import org.springframework.web.servlet.ModelAndView; |
||||
import com.alibaba.fastjson.JSON; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import org.jeecg.common.aspect.annotation.AutoLog; |
||||
|
||||
/** |
||||
* @Description: 商品面料表 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2022-12-06 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Api(tags="商品面料表") |
||||
@RestController |
||||
@RequestMapping("/goodsfabric/goodsFabric") |
||||
@Slf4j |
||||
public class GoodsFabricController extends JeecgController<GoodsFabric, IGoodsFabricService> { |
||||
@Autowired |
||||
private IGoodsFabricService goodsFabricService; |
||||
|
||||
/** |
||||
* 分页列表查询 |
||||
* |
||||
* @param goodsFabric |
||||
* @param pageNo |
||||
* @param pageSize |
||||
* @param req |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "商品面料表-分页列表查询") |
||||
@ApiOperation(value="商品面料表-分页列表查询", notes="商品面料表-分页列表查询") |
||||
@GetMapping(value = "/list") |
||||
public Result<?> queryPageList(GoodsFabric goodsFabric, |
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
||||
HttpServletRequest req) { |
||||
QueryWrapper<GoodsFabric> queryWrapper = QueryGenerator.initQueryWrapper(goodsFabric, req.getParameterMap()); |
||||
Page<GoodsFabric> page = new Page<GoodsFabric>(pageNo, pageSize); |
||||
IPage<GoodsFabric> pageList = goodsFabricService.page(page, queryWrapper); |
||||
return Result.OK(pageList); |
||||
} |
||||
|
||||
/** |
||||
* 添加 |
||||
* |
||||
* @param goodsFabric |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "商品面料表-添加") |
||||
@ApiOperation(value="商品面料表-添加", notes="商品面料表-添加") |
||||
@PostMapping(value = "/add") |
||||
public Result<?> add(@RequestBody GoodsFabric goodsFabric) { |
||||
goodsFabricService.save(goodsFabric); |
||||
return Result.OK("添加成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 编辑 |
||||
* |
||||
* @param goodsFabric |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "商品面料表-编辑") |
||||
@ApiOperation(value="商品面料表-编辑", notes="商品面料表-编辑") |
||||
@PutMapping(value = "/edit") |
||||
public Result<?> edit(@RequestBody GoodsFabric goodsFabric) { |
||||
goodsFabricService.updateById(goodsFabric); |
||||
return Result.OK("编辑成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 通过id删除 |
||||
* |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "商品面料表-通过id删除") |
||||
@ApiOperation(value="商品面料表-通过id删除", notes="商品面料表-通过id删除") |
||||
@DeleteMapping(value = "/delete") |
||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) { |
||||
goodsFabricService.removeById(id); |
||||
return Result.OK("删除成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 批量删除 |
||||
* |
||||
* @param ids |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "商品面料表-批量删除") |
||||
@ApiOperation(value="商品面料表-批量删除", notes="商品面料表-批量删除") |
||||
@DeleteMapping(value = "/deleteBatch") |
||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
||||
this.goodsFabricService.removeByIds(Arrays.asList(ids.split(","))); |
||||
return Result.OK("批量删除成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 通过id查询 |
||||
* |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "商品面料表-通过id查询") |
||||
@ApiOperation(value="商品面料表-通过id查询", notes="商品面料表-通过id查询") |
||||
@GetMapping(value = "/queryById") |
||||
public Result<?> queryById(@RequestParam(name="id",required=true) String id) { |
||||
GoodsFabric goodsFabric = goodsFabricService.getById(id); |
||||
if(goodsFabric==null) { |
||||
return Result.error("未找到对应数据"); |
||||
} |
||||
return Result.OK(goodsFabric); |
||||
} |
||||
|
||||
/** |
||||
* 导出excel |
||||
* |
||||
* @param request |
||||
* @param goodsFabric |
||||
*/ |
||||
@RequestMapping(value = "/exportXls") |
||||
public ModelAndView exportXls(HttpServletRequest request, GoodsFabric goodsFabric) { |
||||
return super.exportXls(request, goodsFabric, GoodsFabric.class, "商品面料表"); |
||||
} |
||||
|
||||
/** |
||||
* 通过excel导入数据 |
||||
* |
||||
* @param request |
||||
* @param response |
||||
* @return |
||||
*/ |
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
||||
return super.importExcel(request, response, GoodsFabric.class); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,67 @@ |
||||
package org.jeecg.modules.demo.goodsfabric.entity; |
||||
|
||||
import java.io.Serializable; |
||||
import java.io.UnsupportedEncodingException; |
||||
import java.util.Date; |
||||
import java.math.BigDecimal; |
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import lombok.Data; |
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import org.springframework.format.annotation.DateTimeFormat; |
||||
import org.jeecgframework.poi.excel.annotation.Excel; |
||||
import org.jeecg.common.aspect.annotation.Dict; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.EqualsAndHashCode; |
||||
import lombok.experimental.Accessors; |
||||
|
||||
/** |
||||
* @Description: 商品面料表 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2022-12-06 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Data |
||||
@TableName("goods_fabric") |
||||
@Accessors(chain = true) |
||||
@EqualsAndHashCode(callSuper = false) |
||||
@ApiModel(value="goods_fabric对象", description="商品面料表") |
||||
public class GoodsFabric implements Serializable { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/**主键*/ |
||||
@TableId(type = IdType.ASSIGN_ID) |
||||
@ApiModelProperty(value = "主键") |
||||
private java.lang.String id; |
||||
/**创建人*/ |
||||
@ApiModelProperty(value = "创建人") |
||||
private java.lang.String createBy; |
||||
/**创建日期*/ |
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
||||
@ApiModelProperty(value = "创建日期") |
||||
private java.util.Date createTime; |
||||
/**更新人*/ |
||||
@ApiModelProperty(value = "更新人") |
||||
private java.lang.String updateBy; |
||||
/**更新日期*/ |
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
||||
@ApiModelProperty(value = "更新日期") |
||||
private java.util.Date updateTime; |
||||
/**所属部门*/ |
||||
@ApiModelProperty(value = "所属部门") |
||||
private java.lang.String sysOrgCode; |
||||
/**商品id*/ |
||||
@Excel(name = "商品id", width = 15, dictTable = "zy_goods", dicText = "goods_name", dicCode = "id") |
||||
@Dict(dictTable = "zy_goods", dicText = "goods_num", dicCode = "id") |
||||
@ApiModelProperty(value = "商品id") |
||||
private java.lang.String goodsId; |
||||
/**面料id*/ |
||||
@Excel(name = "面料id", width = 15, dictTable = "zy_fabric", dicText = "name", dicCode = "id") |
||||
@Dict(dictTable = "zy_fabric", dicText = "name", dicCode = "id") |
||||
@ApiModelProperty(value = "面料id") |
||||
private java.lang.String fabricId; |
||||
} |
@ -0,0 +1,17 @@ |
||||
package org.jeecg.modules.demo.goodsfabric.mapper; |
||||
|
||||
import java.util.List; |
||||
|
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.jeecg.modules.demo.goodsfabric.entity.GoodsFabric; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
||||
/** |
||||
* @Description: 商品面料表 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2022-12-06 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface GoodsFabricMapper extends BaseMapper<GoodsFabric> { |
||||
|
||||
} |
@ -0,0 +1,5 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
<mapper namespace="org.jeecg.modules.demo.goodsfabric.mapper.GoodsFabricMapper"> |
||||
|
||||
</mapper> |
@ -0,0 +1,14 @@ |
||||
package org.jeecg.modules.demo.goodsfabric.service; |
||||
|
||||
import org.jeecg.modules.demo.goodsfabric.entity.GoodsFabric; |
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
||||
/** |
||||
* @Description: 商品面料表 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2022-12-06 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface IGoodsFabricService extends IService<GoodsFabric> { |
||||
|
||||
} |
@ -0,0 +1,19 @@ |
||||
package org.jeecg.modules.demo.goodsfabric.service.impl; |
||||
|
||||
import org.jeecg.modules.demo.goodsfabric.entity.GoodsFabric; |
||||
import org.jeecg.modules.demo.goodsfabric.mapper.GoodsFabricMapper; |
||||
import org.jeecg.modules.demo.goodsfabric.service.IGoodsFabricService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
||||
/** |
||||
* @Description: 商品面料表 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2022-12-06 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Service |
||||
public class GoodsFabricServiceImpl extends ServiceImpl<GoodsFabricMapper, GoodsFabric> implements IGoodsFabricService { |
||||
|
||||
} |
@ -0,0 +1,172 @@ |
||||
package org.jeecg.modules.demo.goodsmodule.controller; |
||||
|
||||
import java.util.Arrays; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import java.util.stream.Collectors; |
||||
import java.io.IOException; |
||||
import java.io.UnsupportedEncodingException; |
||||
import java.net.URLDecoder; |
||||
import javax.servlet.http.HttpServletRequest; |
||||
import javax.servlet.http.HttpServletResponse; |
||||
import org.jeecg.common.api.vo.Result; |
||||
import org.jeecg.common.system.query.QueryGenerator; |
||||
import org.jeecg.common.util.oConvertUtils; |
||||
import org.jeecg.modules.demo.goodsmodule.entity.GoodsModule; |
||||
import org.jeecg.modules.demo.goodsmodule.service.IGoodsModuleService; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil; |
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants; |
||||
import org.jeecgframework.poi.excel.entity.ExportParams; |
||||
import org.jeecgframework.poi.excel.entity.ImportParams; |
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; |
||||
import org.jeecg.common.system.base.controller.JeecgController; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.web.bind.annotation.*; |
||||
import org.springframework.web.multipart.MultipartFile; |
||||
import org.springframework.web.multipart.MultipartHttpServletRequest; |
||||
import org.springframework.web.servlet.ModelAndView; |
||||
import com.alibaba.fastjson.JSON; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import org.jeecg.common.aspect.annotation.AutoLog; |
||||
|
||||
/** |
||||
* @Description: 商品模块表 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2022-12-08 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Api(tags="商品模块表") |
||||
@RestController |
||||
@RequestMapping("/goodsmodule/goodsModule") |
||||
@Slf4j |
||||
public class GoodsModuleController extends JeecgController<GoodsModule, IGoodsModuleService> { |
||||
@Autowired |
||||
private IGoodsModuleService goodsModuleService; |
||||
|
||||
/** |
||||
* 分页列表查询 |
||||
* |
||||
* @param goodsModule |
||||
* @param pageNo |
||||
* @param pageSize |
||||
* @param req |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "商品模块表-分页列表查询") |
||||
@ApiOperation(value="商品模块表-分页列表查询", notes="商品模块表-分页列表查询") |
||||
@GetMapping(value = "/list") |
||||
public Result<?> queryPageList(GoodsModule goodsModule, |
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
||||
HttpServletRequest req,String goodsid) { |
||||
QueryWrapper<GoodsModule> queryWrapper = QueryGenerator.initQueryWrapper(goodsModule, req.getParameterMap()); |
||||
queryWrapper.eq("goods_id",goodsid); |
||||
Page<GoodsModule> page = new Page<GoodsModule>(pageNo, pageSize); |
||||
IPage<GoodsModule> pageList = goodsModuleService.page(page, queryWrapper); |
||||
return Result.OK(pageList); |
||||
} |
||||
|
||||
/** |
||||
* 添加 |
||||
* |
||||
* @param goodsModule |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "商品模块表-添加") |
||||
@ApiOperation(value="商品模块表-添加", notes="商品模块表-添加") |
||||
@PostMapping(value = "/add") |
||||
public Result<?> add(@RequestBody GoodsModule goodsModule) { |
||||
goodsModuleService.save(goodsModule); |
||||
return Result.OK("添加成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 编辑 |
||||
* |
||||
* @param goodsModule |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "商品模块表-编辑") |
||||
@ApiOperation(value="商品模块表-编辑", notes="商品模块表-编辑") |
||||
@PutMapping(value = "/edit") |
||||
public Result<?> edit(@RequestBody GoodsModule goodsModule) { |
||||
goodsModuleService.updateById(goodsModule); |
||||
return Result.OK("编辑成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 通过id删除 |
||||
* |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "商品模块表-通过id删除") |
||||
@ApiOperation(value="商品模块表-通过id删除", notes="商品模块表-通过id删除") |
||||
@DeleteMapping(value = "/delete") |
||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) { |
||||
goodsModuleService.removeById(id); |
||||
return Result.OK("删除成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 批量删除 |
||||
* |
||||
* @param ids |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "商品模块表-批量删除") |
||||
@ApiOperation(value="商品模块表-批量删除", notes="商品模块表-批量删除") |
||||
@DeleteMapping(value = "/deleteBatch") |
||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
||||
this.goodsModuleService.removeByIds(Arrays.asList(ids.split(","))); |
||||
return Result.OK("批量删除成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 通过id查询 |
||||
* |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "商品模块表-通过id查询") |
||||
@ApiOperation(value="商品模块表-通过id查询", notes="商品模块表-通过id查询") |
||||
@GetMapping(value = "/queryById") |
||||
public Result<?> queryById(@RequestParam(name="id",required=true) String id) { |
||||
GoodsModule goodsModule = goodsModuleService.getById(id); |
||||
if(goodsModule==null) { |
||||
return Result.error("未找到对应数据"); |
||||
} |
||||
return Result.OK(goodsModule); |
||||
} |
||||
|
||||
/** |
||||
* 导出excel |
||||
* |
||||
* @param request |
||||
* @param goodsModule |
||||
*/ |
||||
@RequestMapping(value = "/exportXls") |
||||
public ModelAndView exportXls(HttpServletRequest request, GoodsModule goodsModule) { |
||||
return super.exportXls(request, goodsModule, GoodsModule.class, "商品模块表"); |
||||
} |
||||
|
||||
/** |
||||
* 通过excel导入数据 |
||||
* |
||||
* @param request |
||||
* @param response |
||||
* @return |
||||
*/ |
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
||||
return super.importExcel(request, response, GoodsModule.class); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,80 @@ |
||||
package org.jeecg.modules.demo.goodsmodule.entity; |
||||
|
||||
import java.io.Serializable; |
||||
import java.io.UnsupportedEncodingException; |
||||
import java.util.Date; |
||||
import java.math.BigDecimal; |
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import lombok.Data; |
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import org.springframework.format.annotation.DateTimeFormat; |
||||
import org.jeecgframework.poi.excel.annotation.Excel; |
||||
import org.jeecg.common.aspect.annotation.Dict; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.EqualsAndHashCode; |
||||
import lombok.experimental.Accessors; |
||||
|
||||
/** |
||||
* @Description: 商品模块表 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2022-12-08 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Data |
||||
@TableName("goods_module") |
||||
@Accessors(chain = true) |
||||
@EqualsAndHashCode(callSuper = false) |
||||
@ApiModel(value="goods_module对象", description="商品模块表") |
||||
public class GoodsModule implements Serializable { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/**主键*/ |
||||
@TableId(type = IdType.ASSIGN_ID) |
||||
@ApiModelProperty(value = "主键") |
||||
private java.lang.String id; |
||||
/**创建人*/ |
||||
@ApiModelProperty(value = "创建人") |
||||
private java.lang.String createBy; |
||||
/**创建日期*/ |
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
||||
@ApiModelProperty(value = "创建日期") |
||||
private java.util.Date createTime; |
||||
/**更新人*/ |
||||
@ApiModelProperty(value = "更新人") |
||||
private java.lang.String updateBy; |
||||
/**更新日期*/ |
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
||||
@ApiModelProperty(value = "更新日期") |
||||
private java.util.Date updateTime; |
||||
/**所属部门*/ |
||||
@ApiModelProperty(value = "所属部门") |
||||
private java.lang.String sysOrgCode; |
||||
/**商品id*/ |
||||
@Excel(name = "商品id", width = 15, dictTable = "zy_goods", dicText = "goods_name", dicCode = "id") |
||||
@Dict(dictTable = "zy_goods", dicText = "goods_name", dicCode = "id") |
||||
@ApiModelProperty(value = "商品id") |
||||
private java.lang.String goodsId; |
||||
/**款式id*/ |
||||
@Excel(name = "款式id", width = 15, dictTable = "zy_cloths_style", dicText = "style_names", dicCode = "id") |
||||
@Dict(dictTable = "zy_cloths_style", dicText = "style_names", dicCode = "id") |
||||
@ApiModelProperty(value = "款式id") |
||||
private java.lang.String styleId; |
||||
/**款式模块id*/ |
||||
@Excel(name = "款式模块id", width = 15) |
||||
@ApiModelProperty(value = "款式模块id") |
||||
private java.lang.String styleModuleId; |
||||
/**模块id*/ |
||||
@Excel(name = "模块id", width = 15, dictTable = "zy_cloths_modular ", dicText = "modular_name", dicCode = "id") |
||||
@Dict(dictTable = "zy_cloths_modular ", dicText = "modular_name", dicCode = "id") |
||||
@ApiModelProperty(value = "模块id") |
||||
private java.lang.String moduleId; |
||||
/**部位*/ |
||||
@Excel(name = "部位", width = 15) |
||||
@ApiModelProperty(value = "部位") |
||||
private java.lang.String place; |
||||
} |
@ -0,0 +1,17 @@ |
||||
package org.jeecg.modules.demo.goodsmodule.mapper; |
||||
|
||||
import java.util.List; |
||||
|
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.jeecg.modules.demo.goodsmodule.entity.GoodsModule; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
||||
/** |
||||
* @Description: 商品模块表 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2022-12-08 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface GoodsModuleMapper extends BaseMapper<GoodsModule> { |
||||
|
||||
} |
@ -0,0 +1,5 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
<mapper namespace="org.jeecg.modules.demo.goodsmodule.mapper.GoodsModuleMapper"> |
||||
|
||||
</mapper> |
@ -0,0 +1,14 @@ |
||||
package org.jeecg.modules.demo.goodsmodule.service; |
||||
|
||||
import org.jeecg.modules.demo.goodsmodule.entity.GoodsModule; |
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
||||
/** |
||||
* @Description: 商品模块表 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2022-12-08 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface IGoodsModuleService extends IService<GoodsModule> { |
||||
|
||||
} |
@ -0,0 +1,19 @@ |
||||
package org.jeecg.modules.demo.goodsmodule.service.impl; |
||||
|
||||
import org.jeecg.modules.demo.goodsmodule.entity.GoodsModule; |
||||
import org.jeecg.modules.demo.goodsmodule.mapper.GoodsModuleMapper; |
||||
import org.jeecg.modules.demo.goodsmodule.service.IGoodsModuleService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
||||
/** |
||||
* @Description: 商品模块表 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2022-12-08 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Service |
||||
public class GoodsModuleServiceImpl extends ServiceImpl<GoodsModuleMapper, GoodsModule> implements IGoodsModuleService { |
||||
|
||||
} |
@ -0,0 +1,230 @@ |
||||
package org.jeecg.modules.demo.zygoods.controller; |
||||
|
||||
import java.util.Arrays; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import java.util.stream.Collectors; |
||||
import java.io.IOException; |
||||
import java.io.UnsupportedEncodingException; |
||||
import java.net.URLDecoder; |
||||
import javax.servlet.http.HttpServletRequest; |
||||
import javax.servlet.http.HttpServletResponse; |
||||
import org.jeecg.common.api.vo.Result; |
||||
import org.jeecg.common.system.query.QueryGenerator; |
||||
import org.jeecg.common.util.oConvertUtils; |
||||
import org.jeecg.modules.demo.base.service.IZyClothsModularService; |
||||
import org.jeecg.modules.demo.goodsmodule.entity.GoodsModule; |
||||
import org.jeecg.modules.demo.goodsmodule.service.IGoodsModuleService; |
||||
import org.jeecg.modules.demo.zygoods.entity.ZyGoods; |
||||
import org.jeecg.modules.demo.zygoods.service.IZyGoodsService; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
|
||||
import org.jeecg.modules.zyclothsstyle.service.IZyClothsStyleService; |
||||
import org.jeecg.modules.zystylemodel.entity.ZyStyleModel; |
||||
import org.jeecg.modules.zystylemodel.service.IZyStyleModelService; |
||||
import org.jeecg.modules.zystylemodule.entity.ZyStyleModule; |
||||
import org.jeecg.modules.zystylemodule.service.IZyStyleModuleService; |
||||
import org.jeecgframework.poi.excel.ExcelImportUtil; |
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants; |
||||
import org.jeecgframework.poi.excel.entity.ExportParams; |
||||
import org.jeecgframework.poi.excel.entity.ImportParams; |
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; |
||||
import org.jeecg.common.system.base.controller.JeecgController; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.web.bind.annotation.*; |
||||
import org.springframework.web.multipart.MultipartFile; |
||||
import org.springframework.web.multipart.MultipartHttpServletRequest; |
||||
import org.springframework.web.servlet.ModelAndView; |
||||
import com.alibaba.fastjson.JSON; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import org.jeecg.common.aspect.annotation.AutoLog; |
||||
|
||||
/** |
||||
* @Description: 商品表 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2022-12-07 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Api(tags="商品表") |
||||
@RestController |
||||
@RequestMapping("/zygoods/zyGoods") |
||||
@Slf4j |
||||
public class ZyGoodsController extends JeecgController<ZyGoods, IZyGoodsService> { |
||||
@Autowired |
||||
private IZyGoodsService zyGoodsService; |
||||
@Autowired |
||||
private IGoodsModuleService goodsModuleService; |
||||
@Autowired |
||||
private IZyStyleModuleService zyStyleModuleService; |
||||
@Autowired |
||||
private IZyClothsModularService zyClothsModularService; |
||||
@Autowired |
||||
private IZyClothsStyleService zyClothsStyleService; |
||||
|
||||
/** |
||||
* 分页列表查询 |
||||
* |
||||
* @param zyGoods |
||||
* @param pageNo |
||||
* @param pageSize |
||||
* @param req |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "商品表-分页列表查询") |
||||
@ApiOperation(value="商品表-分页列表查询", notes="商品表-分页列表查询") |
||||
@GetMapping(value = "/list") |
||||
public Result<?> queryPageList(ZyGoods zyGoods, |
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
||||
HttpServletRequest req) { |
||||
QueryWrapper<ZyGoods> queryWrapper = QueryGenerator.initQueryWrapper(zyGoods, req.getParameterMap()); |
||||
Page<ZyGoods> page = new Page<ZyGoods>(pageNo, pageSize); |
||||
IPage<ZyGoods> pageList = zyGoodsService.page(page, queryWrapper); |
||||
return Result.OK(pageList); |
||||
} |
||||
|
||||
/** |
||||
* 添加 |
||||
* |
||||
* @param zyGoods |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "商品表-添加") |
||||
@ApiOperation(value="商品表-添加", notes="商品表-添加") |
||||
@PostMapping(value = "/add") |
||||
public Result<?> add(@RequestBody ZyGoods zyGoods,HttpServletRequest req) { |
||||
zyGoodsService.save(zyGoods); |
||||
ZyStyleModule zyStyleModule = new ZyStyleModule(); |
||||
QueryWrapper<ZyStyleModule> queryWrapperzsm = QueryGenerator.initQueryWrapper(zyStyleModule, req.getParameterMap()); |
||||
queryWrapperzsm.eq("style_id",zyGoods.getStyleId()); |
||||
List<ZyStyleModule> listzsm = zyStyleModuleService.list(queryWrapperzsm); |
||||
for (int i = 0 ; i < listzsm.size() ; i++){ |
||||
GoodsModule goodsModule = new GoodsModule(); |
||||
goodsModule.setGoodsId(zyGoods.getId()); |
||||
goodsModule.setStyleId(zyGoods.getStyleId()); |
||||
goodsModule.setStyleModuleId(listzsm.get(i).getId()); |
||||
goodsModule.setModuleId(listzsm.get(i).getModularId()); |
||||
//部位暂时没有字段,zy_cloths_modular的place
|
||||
//goodsModule.setPlace();
|
||||
goodsModuleService.save(goodsModule); |
||||
} |
||||
return Result.OK("添加成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 编辑 |
||||
* |
||||
* @param zyGoods |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "商品表-编辑") |
||||
@ApiOperation(value="商品表-编辑", notes="商品表-编辑") |
||||
@PutMapping(value = "/edit") |
||||
public Result<?> edit(@RequestBody ZyGoods zyGoods,HttpServletRequest req) { |
||||
zyGoodsService.updateById(zyGoods); |
||||
GoodsModule goodsModule = new GoodsModule(); |
||||
QueryWrapper<GoodsModule> queryWrappergm = QueryGenerator.initQueryWrapper(goodsModule, req.getParameterMap()); |
||||
queryWrappergm.eq("goods_id",zyGoods.getId()); |
||||
goodsModuleService.remove(queryWrappergm); |
||||
ZyStyleModule zyStyleModule = new ZyStyleModule(); |
||||
QueryWrapper<ZyStyleModule> queryWrapperzsm = QueryGenerator.initQueryWrapper(zyStyleModule, req.getParameterMap()); |
||||
queryWrapperzsm.eq("style_id",zyGoods.getStyleId()); |
||||
List<ZyStyleModule> listzsm = zyStyleModuleService.list(queryWrapperzsm); |
||||
for (int i = 0 ; i < listzsm.size() ; i++){ |
||||
GoodsModule goodsModule1 = new GoodsModule(); |
||||
goodsModule1.setGoodsId(zyGoods.getId()); |
||||
goodsModule1.setStyleId(zyGoods.getStyleId()); |
||||
goodsModule1.setStyleModuleId(listzsm.get(i).getId()); |
||||
goodsModule1.setModuleId(listzsm.get(i).getModularId()); |
||||
//部位暂时没有字段,zy_cloths_modular的place
|
||||
//goodsModule1.setPlace();
|
||||
goodsModuleService.save(goodsModule1); |
||||
} |
||||
return Result.OK("编辑成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 通过id删除 |
||||
* |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "商品表-通过id删除") |
||||
@ApiOperation(value="商品表-通过id删除", notes="商品表-通过id删除") |
||||
@DeleteMapping(value = "/delete") |
||||
public Result<?> delete(@RequestParam(name="id",required=true) String id,HttpServletRequest req) { |
||||
zyGoodsService.removeById(id); |
||||
GoodsModule goodsModule = new GoodsModule(); |
||||
QueryWrapper<GoodsModule> queryWrappergm = QueryGenerator.initQueryWrapper(goodsModule, req.getParameterMap()); |
||||
queryWrappergm.eq("goods_id",id); |
||||
goodsModuleService.remove(queryWrappergm); |
||||
return Result.OK("删除成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 批量删除 |
||||
* |
||||
* @param ids |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "商品表-批量删除") |
||||
@ApiOperation(value="商品表-批量删除", notes="商品表-批量删除") |
||||
@DeleteMapping(value = "/deleteBatch") |
||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids,HttpServletRequest req) { |
||||
this.zyGoodsService.removeByIds(Arrays.asList(ids.split(","))); |
||||
String [] str = ids.split(","); |
||||
for(int i = 0 ; i < str.length ; i++){ |
||||
GoodsModule goodsModule = new GoodsModule(); |
||||
QueryWrapper<GoodsModule> queryWrappergm = QueryGenerator.initQueryWrapper(goodsModule, req.getParameterMap()); |
||||
queryWrappergm.eq("goods_id",str[i]); |
||||
goodsModuleService.remove(queryWrappergm); |
||||
} |
||||
return Result.OK("批量删除成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 通过id查询 |
||||
* |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "商品表-通过id查询") |
||||
@ApiOperation(value="商品表-通过id查询", notes="商品表-通过id查询") |
||||
@GetMapping(value = "/queryById") |
||||
public Result<?> queryById(@RequestParam(name="id",required=true) String id) { |
||||
ZyGoods zyGoods = zyGoodsService.getById(id); |
||||
if(zyGoods==null) { |
||||
return Result.error("未找到对应数据"); |
||||
} |
||||
return Result.OK(zyGoods); |
||||
} |
||||
|
||||
/** |
||||
* 导出excel |
||||
* |
||||
* @param request |
||||
* @param zyGoods |
||||
*/ |
||||
@RequestMapping(value = "/exportXls") |
||||
public ModelAndView exportXls(HttpServletRequest request, ZyGoods zyGoods) { |
||||
return super.exportXls(request, zyGoods, ZyGoods.class, "商品表"); |
||||
} |
||||
|
||||
/** |
||||
* 通过excel导入数据 |
||||
* |
||||
* @param request |
||||
* @param response |
||||
* @return |
||||
*/ |
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
||||
return super.importExcel(request, response, ZyGoods.class); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,140 @@ |
||||
package org.jeecg.modules.demo.zygoods.entity; |
||||
|
||||
import java.io.Serializable; |
||||
import java.io.UnsupportedEncodingException; |
||||
import java.util.Date; |
||||
import java.math.BigDecimal; |
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import lombok.Data; |
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import org.springframework.format.annotation.DateTimeFormat; |
||||
import org.jeecgframework.poi.excel.annotation.Excel; |
||||
import org.jeecg.common.aspect.annotation.Dict; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.EqualsAndHashCode; |
||||
import lombok.experimental.Accessors; |
||||
|
||||
/** |
||||
* @Description: 商品表 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2022-12-07 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Data |
||||
@TableName("zy_goods") |
||||
@Accessors(chain = true) |
||||
@EqualsAndHashCode(callSuper = false) |
||||
@ApiModel(value="zy_goods对象", description="商品表") |
||||
public class ZyGoods implements Serializable { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/**主键*/ |
||||
@TableId(type = IdType.ASSIGN_ID) |
||||
@ApiModelProperty(value = "主键") |
||||
private java.lang.String id; |
||||
/**创建人*/ |
||||
@ApiModelProperty(value = "创建人") |
||||
private java.lang.String createBy; |
||||
/**创建日期*/ |
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
||||
@ApiModelProperty(value = "创建日期") |
||||
private java.util.Date createTime; |
||||
/**更新人*/ |
||||
@ApiModelProperty(value = "更新人") |
||||
private java.lang.String updateBy; |
||||
/**更新日期*/ |
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
||||
@ApiModelProperty(value = "更新日期") |
||||
private java.util.Date updateTime; |
||||
/**所属部门*/ |
||||
@ApiModelProperty(value = "所属部门") |
||||
private java.lang.String sysOrgCode; |
||||
/**商品编号*/ |
||||
@Excel(name = "商品编号", width = 15) |
||||
@ApiModelProperty(value = "商品编号") |
||||
private java.lang.String goodsCode; |
||||
/**商品名称*/ |
||||
@Excel(name = "商品名称", width = 15) |
||||
@ApiModelProperty(value = "商品名称") |
||||
private java.lang.String goodsName; |
||||
/**商品描述*/ |
||||
@Excel(name = "商品描述", width = 15) |
||||
@ApiModelProperty(value = "商品描述") |
||||
private java.lang.String goodsIntr; |
||||
/**是否定制*/ |
||||
@Excel(name = "是否定制", width = 15, dicCode = "yn") |
||||
@Dict(dicCode = "yn") |
||||
@ApiModelProperty(value = "是否定制") |
||||
private java.lang.Integer customized; |
||||
/**商品图片*/ |
||||
@Excel(name = "商品图片", width = 15) |
||||
@ApiModelProperty(value = "商品图片") |
||||
private java.lang.String goodsPicture; |
||||
/**默认图片*/ |
||||
@Excel(name = "默认图片", width = 15) |
||||
@ApiModelProperty(value = "默认图片") |
||||
private java.lang.String defaultPicture; |
||||
/**商品视频*/ |
||||
@Excel(name = "商品视频", width = 15) |
||||
@ApiModelProperty(value = "商品视频") |
||||
private java.lang.String goodsVideo; |
||||
/**类型id*/ |
||||
@Excel(name = "类型id", width = 15, dictTable = "zy_cloths_type ", dicText = "type_name", dicCode = "id") |
||||
@Dict(dictTable = "zy_cloths_type ", dicText = "type_name", dicCode = "id") |
||||
@ApiModelProperty(value = "类型id") |
||||
private java.lang.String clothsTypeId; |
||||
/**型号id*/ |
||||
@Excel(name = "型号id", width = 15, dictTable = "zy_style_model", dicText = "model_number", dicCode = "id") |
||||
@Dict(dictTable = "zy_style_model", dicText = "model_number", dicCode = "id") |
||||
@ApiModelProperty(value = "型号id") |
||||
private java.lang.String modelId; |
||||
/**款式id*/ |
||||
@Excel(name = "款式id", width = 15, dictTable = "zy_cloths_style", dicText = "style_names", dicCode = "id") |
||||
@Dict(dictTable = "zy_cloths_style", dicText = "style_names", dicCode = "id") |
||||
@ApiModelProperty(value = "款式id") |
||||
private java.lang.String styleId; |
||||
/**单位*/ |
||||
@Excel(name = "单位", width = 15) |
||||
@ApiModelProperty(value = "单位") |
||||
private java.lang.String unit; |
||||
/**包装个数*/ |
||||
@Excel(name = "包装个数", width = 15) |
||||
@ApiModelProperty(value = "包装个数") |
||||
private java.lang.Integer number; |
||||
/**单价*/ |
||||
@Excel(name = "单价", width = 15) |
||||
@ApiModelProperty(value = "单价") |
||||
private java.lang.Double unitPrice; |
||||
/**折扣*/ |
||||
@Excel(name = "折扣", width = 15) |
||||
@ApiModelProperty(value = "折扣") |
||||
private java.lang.Double discount; |
||||
/**促销价*/ |
||||
@Excel(name = "促销价", width = 15) |
||||
@ApiModelProperty(value = "促销价") |
||||
private java.lang.Double promotionPrice; |
||||
/**是否推荐*/ |
||||
@Excel(name = "是否推荐", width = 15, dicCode = "yn") |
||||
@Dict(dicCode = "yn") |
||||
@ApiModelProperty(value = "是否推荐") |
||||
private java.lang.Integer recommend; |
||||
/**产地*/ |
||||
@Excel(name = "产地", width = 15) |
||||
@ApiModelProperty(value = "产地") |
||||
private java.lang.String placeOrigin; |
||||
/**状态*/ |
||||
@Excel(name = "状态", width = 15, dicCode = "good_status") |
||||
@Dict(dicCode = "good_status") |
||||
@ApiModelProperty(value = "状态") |
||||
private java.lang.Integer status; |
||||
/**企业id*/ |
||||
@Excel(name = "企业id", width = 15, dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") |
||||
@Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") |
||||
@ApiModelProperty(value = "企业id") |
||||
private java.lang.String enterprisesId; |
||||
} |
@ -0,0 +1,20 @@ |
||||
package org.jeecg.modules.demo.zygoods.mapper; |
||||
|
||||
import java.util.List; |
||||
|
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.jeecg.modules.demo.zygoods.entity.ZyGoods; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
||||
/** |
||||
* @Description: 商品表 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2022-12-07 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface ZyGoodsMapper extends BaseMapper<ZyGoods> { |
||||
public boolean deleteByMainId(@Param("mainId") String mainId); |
||||
|
||||
public List<ZyGoods> selectByMainId(@Param("mainId") String mainId); |
||||
|
||||
} |
@ -0,0 +1,16 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
<mapper namespace="org.jeecg.modules.demo.zygoods.mapper.ZyGoodsMapper"> |
||||
<delete id="deleteByMainId" parameterType="java.lang.String"> |
||||
DELETE |
||||
FROM zy_goods |
||||
WHERE |
||||
id = #{mainId} </delete> |
||||
|
||||
<select id="selectByMainId" parameterType="java.lang.String" resultType="org.jeecg.modules.demo.zygoods.mapper.ZyGoodsMapper"> |
||||
SELECT * |
||||
FROM zy_goods |
||||
WHERE |
||||
id = #{mainId} </select> |
||||
|
||||
</mapper> |
@ -0,0 +1,17 @@ |
||||
package org.jeecg.modules.demo.zygoods.service; |
||||
|
||||
import org.jeecg.modules.demo.zygoods.entity.ZyGoods; |
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @Description: 商品表 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2022-12-07 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface IZyGoodsService extends IService<ZyGoods> { |
||||
public List<ZyGoods> selectByMainId(String mainId); |
||||
|
||||
} |
@ -0,0 +1,29 @@ |
||||
package org.jeecg.modules.demo.zygoods.service.impl; |
||||
|
||||
import org.jeecg.modules.demo.zygoods.entity.ZyGoods; |
||||
import org.jeecg.modules.demo.zygoods.mapper.ZyGoodsMapper; |
||||
import org.jeecg.modules.demo.zygoods.service.IZyGoodsService; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @Description: 商品表 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2022-12-07 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Service |
||||
public class ZyGoodsServiceImpl extends ServiceImpl<ZyGoodsMapper, ZyGoods> implements IZyGoodsService { |
||||
@Autowired |
||||
private ZyGoodsMapper zyGoodsMapper; |
||||
|
||||
@Override |
||||
public List<ZyGoods> selectByMainId(String mainId) { |
||||
return zyGoodsMapper.selectByMainId(mainId); |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue