parent
68cd99a5da
commit
cbe74899bf
78 changed files with 5293 additions and 80 deletions
@ -0,0 +1,159 @@ |
||||
<template> |
||||
<div class="components-input-demo-presuffix"> |
||||
<!----> |
||||
<a-input @click="openModal" placeholder="请点击选择部门" v-model="departNames" readOnly :disabled="disabled"> |
||||
<a-icon slot="prefix" type="cluster" title="部门选择控件"/> |
||||
<a-icon v-if="departIds" slot="suffix" type="close-circle" @click="handleEmpty" title="清空"/> |
||||
</a-input> |
||||
|
||||
<j-select-depart-modal1 |
||||
ref="innerDepartSelectModal" |
||||
:modal-width="modalWidth" |
||||
:multi="multi" |
||||
:rootOpened="rootOpened" |
||||
:depart-id="departIds" |
||||
@ok="handleOK" |
||||
@initComp="initComp"/> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import JSelectDepartModal1 from './modal/JSelectDepartModal1' |
||||
export default { |
||||
name: 'JSelectDepart1', |
||||
components:{ |
||||
JSelectDepartModal1 |
||||
}, |
||||
props:{ |
||||
modalWidth:{ |
||||
type:Number, |
||||
default:500, |
||||
required:false |
||||
}, |
||||
multi:{ |
||||
type:Boolean, |
||||
default:false, |
||||
required:false |
||||
}, |
||||
rootOpened:{ |
||||
type:Boolean, |
||||
default:true, |
||||
required:false |
||||
}, |
||||
value:{ |
||||
type:String, |
||||
required:false |
||||
}, |
||||
disabled:{ |
||||
type: Boolean, |
||||
required: false, |
||||
default: false |
||||
}, |
||||
// 自定义返回字段,默认返回 id |
||||
customReturnField: { |
||||
type: String, |
||||
default: 'id' |
||||
}, |
||||
backDepart: { |
||||
type: Boolean, |
||||
default: false, |
||||
required: false |
||||
} |
||||
}, |
||||
data(){ |
||||
return { |
||||
visible:false, |
||||
confirmLoading:false, |
||||
departNames:"", |
||||
departIds:'' |
||||
} |
||||
}, |
||||
mounted(){ |
||||
this.departIds = this.value |
||||
}, |
||||
watch:{ |
||||
value(val){ |
||||
//update-begin-author:wangshuai date:20201124 for:组件 JSelectDepart.vue不是默认id时新内容编辑问题 gitee I247X2 |
||||
// if (this.customReturnField === 'id') { |
||||
this.departIds = val |
||||
// } |
||||
//update-end-author:wangshuai date:20201124 for:组件 JSelectDepart.vue不是默认id时新内容编辑问题 gitee I247X2 |
||||
} |
||||
}, |
||||
methods:{ |
||||
initComp(departNames){ |
||||
this.departNames = departNames |
||||
//update-begin-author:lvdandan date:20200513 for:TESTA-438 部门选择组件自定义返回值,数据无法回填 |
||||
//TODO 当返回字段为部门名称时会有问题,因为部门名称不唯一 |
||||
//返回字段不为id时,根据返回字段获取id |
||||
if(this.customReturnField !== 'id' && this.value){ |
||||
const dataList = this.$refs.innerDepartSelectModal.dataList; |
||||
console.log('this.value',this.value) |
||||
this.departIds = this.value.split(',').map(item => { |
||||
const data = dataList.filter(d=>d[this.customReturnField] === item) |
||||
return data.length > 0 ? data[0].id : '' |
||||
}).join(',') |
||||
} |
||||
//update-end-author:lvdandan date:20200513 for:TESTA-438 部门选择组件自定义返回值,数据无法回填 |
||||
}, |
||||
//返回选中的部门信息 |
||||
backDeparInfo(){ |
||||
if(this.backDepart===true){ |
||||
if(this.departIds && this.departIds.length>0){ |
||||
let arr1 = this.departIds.split(',') |
||||
let arr2 = this.departNames.split(',') |
||||
let info = [] |
||||
for(let i=0;i<arr1.length;i++){ |
||||
info.push({ |
||||
value: arr1[i], |
||||
text: arr2[i] |
||||
}) |
||||
} |
||||
this.$emit('back', info) |
||||
} |
||||
} |
||||
}, |
||||
openModal(){ |
||||
this.$refs.innerDepartSelectModal.show() |
||||
}, |
||||
handleOK(rows, idstr) { |
||||
let value = '' |
||||
if (!rows && rows.length <= 0) { |
||||
this.departNames = '' |
||||
this.departIds = '' |
||||
} else { |
||||
value = rows.map(row => row[this.customReturnField]).join(',') |
||||
this.departNames = rows.map(row => row['departName']).join(',') |
||||
this.departIds = idstr |
||||
} |
||||
this.$emit("change", value) |
||||
this.backDeparInfo() |
||||
}, |
||||
getDepartNames(){ |
||||
return this.departNames |
||||
}, |
||||
handleEmpty(){ |
||||
this.handleOK('') |
||||
} |
||||
}, |
||||
model: { |
||||
prop: 'value', |
||||
event: 'change' |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style scoped> |
||||
.components-input-demo-presuffix .anticon-close-circle { |
||||
cursor: pointer; |
||||
color: #ccc; |
||||
transition: color 0.3s; |
||||
font-size: 12px; |
||||
} |
||||
.components-input-demo-presuffix .anticon-close-circle:hover { |
||||
color: #f5222d; |
||||
} |
||||
.components-input-demo-presuffix .anticon-close-circle:active { |
||||
color: #666; |
||||
} |
||||
</style> |
@ -0,0 +1,251 @@ |
||||
<template> |
||||
<j-modal |
||||
title="选择部门" |
||||
:width="modalWidth" |
||||
:visible="visible" |
||||
:confirmLoading="confirmLoading" |
||||
@ok="handleSubmit" |
||||
@cancel="handleCancel" |
||||
wrapClassName="j-depart-select-modal" |
||||
switchFullscreen |
||||
cancelText="关闭"> |
||||
<a-spin tip="Loading..." :spinning="false"> |
||||
<a-input-search style="margin-bottom: 1px" placeholder="请输入部门名称按回车进行搜索" @search="onSearch" /> |
||||
<a-tree |
||||
checkable |
||||
class="my-dept-select-tree" |
||||
:treeData="treeData" |
||||
:checkStrictly="true" |
||||
@check="onCheck" |
||||
@select="onSelect" |
||||
@expand="onExpand" |
||||
:autoExpandParent="autoExpandParent" |
||||
:expandedKeys="expandedKeys" |
||||
:checkedKeys="checkedKeys"> |
||||
|
||||
<template slot="title" slot-scope="{title}"> |
||||
<span v-if="title.indexOf(searchValue) > -1"> |
||||
{{title.substr(0, title.indexOf(searchValue))}} |
||||
<span style="color: #f50">{{searchValue}}</span> |
||||
{{title.substr(title.indexOf(searchValue) + searchValue.length)}} |
||||
</span> |
||||
<span v-else>{{title}}</span> |
||||
</template> |
||||
</a-tree> |
||||
|
||||
</a-spin> |
||||
</j-modal> |
||||
</template> |
||||
|
||||
<script> |
||||
import { queryDepartTreeList1 } from '@/api/api' |
||||
export default { |
||||
name: 'JSelectDepartModal1', |
||||
props:['modalWidth','multi','rootOpened','departId'], |
||||
data(){ |
||||
return { |
||||
visible:false, |
||||
confirmLoading:false, |
||||
treeData:[], |
||||
autoExpandParent:true, |
||||
expandedKeys:[], |
||||
dataList:[], |
||||
checkedKeys:[], |
||||
checkedRows:[], |
||||
searchValue:"" |
||||
} |
||||
}, |
||||
created(){ |
||||
this.loadDepart(); |
||||
}, |
||||
watch:{ |
||||
departId(){ |
||||
this.initDepartComponent() |
||||
}, |
||||
visible: { |
||||
handler() { |
||||
if (this.departId) { |
||||
this.checkedKeys = this.departId.split(","); |
||||
// console.log('this.departId', this.departId) |
||||
} else { |
||||
this.checkedKeys = []; |
||||
} |
||||
} |
||||
} |
||||
}, |
||||
methods:{ |
||||
show(){ |
||||
this.visible=true |
||||
this.checkedRows=[] |
||||
this.checkedKeys=[] |
||||
}, |
||||
loadDepart(){ |
||||
queryDepartTreeList1().then(res=>{ |
||||
if(res.success){ |
||||
let arr = [...res.result] |
||||
this.reWriterWithSlot(arr) |
||||
this.treeData = arr |
||||
this.initDepartComponent() |
||||
if(this.rootOpened){ |
||||
this.initExpandedKeys(res.result) |
||||
} |
||||
} |
||||
}) |
||||
}, |
||||
initDepartComponent(){ |
||||
let names = '' |
||||
if(this.departId){ |
||||
let currDepartId = this.departId |
||||
for(let item of this.dataList){ |
||||
if(currDepartId.indexOf(item.key)>=0){ |
||||
names+=","+item.title |
||||
} |
||||
} |
||||
if(names){ |
||||
names = names.substring(1) |
||||
} |
||||
} |
||||
this.$emit("initComp",names) |
||||
}, |
||||
reWriterWithSlot(arr){ |
||||
for(let item of arr){ |
||||
if(item.children && item.children.length>0){ |
||||
this.reWriterWithSlot(item.children) |
||||
let temp = Object.assign({},item) |
||||
temp.children = {} |
||||
this.dataList.push(temp) |
||||
}else{ |
||||
this.dataList.push(item) |
||||
item.scopedSlots={ title: 'title' } |
||||
} |
||||
} |
||||
}, |
||||
initExpandedKeys(arr){ |
||||
if(arr && arr.length>0){ |
||||
let keys = [] |
||||
for(let item of arr){ |
||||
if(item.children && item.children.length>0){ |
||||
keys.push(item.id) |
||||
} |
||||
} |
||||
this.expandedKeys=[...keys] |
||||
}else{ |
||||
this.expandedKeys=[] |
||||
} |
||||
}, |
||||
onCheck (checkedKeys,info) { |
||||
if(!this.multi){ |
||||
let arr = checkedKeys.checked.filter(item => this.checkedKeys.indexOf(item) < 0) |
||||
this.checkedKeys = [...arr] |
||||
this.checkedRows = (this.checkedKeys.length === 0) ? [] : [info.node.dataRef] |
||||
}else{ |
||||
this.checkedKeys = checkedKeys.checked |
||||
this.checkedRows = this.getCheckedRows(this.checkedKeys) |
||||
} |
||||
}, |
||||
onSelect(selectedKeys,info) { |
||||
let keys = [] |
||||
keys.push(selectedKeys[0]) |
||||
if(!this.checkedKeys || this.checkedKeys.length===0 || !this.multi){ |
||||
this.checkedKeys = [...keys] |
||||
this.checkedRows=[info.node.dataRef] |
||||
}else{ |
||||
let currKey = info.node.dataRef.key |
||||
if(this.checkedKeys.indexOf(currKey)>=0){ |
||||
this.checkedKeys = this.checkedKeys.filter(item=> item !==currKey) |
||||
}else{ |
||||
this.checkedKeys.push(...keys) |
||||
} |
||||
} |
||||
this.checkedRows = this.getCheckedRows(this.checkedKeys) |
||||
}, |
||||
onExpand (expandedKeys) { |
||||
this.expandedKeys = expandedKeys |
||||
this.autoExpandParent = false |
||||
}, |
||||
handleSubmit(){ |
||||
if(!this.checkedKeys || this.checkedKeys.length==0){ |
||||
this.$emit("ok",'') |
||||
}else{ |
||||
let checkRow = this.getCheckedRows(this.checkedKeys) |
||||
let keyStr = this.checkedKeys.join(",") |
||||
this.$emit("ok", checkRow, keyStr) |
||||
} |
||||
this.handleClear() |
||||
}, |
||||
handleCancel(){ |
||||
this.handleClear() |
||||
}, |
||||
handleClear(){ |
||||
this.visible=false |
||||
this.checkedKeys=[] |
||||
}, |
||||
getParentKey(currKey,treeData){ |
||||
let parentKey |
||||
for (let i = 0; i < treeData.length; i++) { |
||||
const node = treeData[i] |
||||
if (node.children) { |
||||
if (node.children.some(item => item.key === currKey)) { |
||||
parentKey = node.key |
||||
} else if (this.getParentKey(currKey, node.children)) { |
||||
parentKey = this.getParentKey(currKey, node.children) |
||||
} |
||||
} |
||||
} |
||||
return parentKey |
||||
}, |
||||
onSearch(value){ |
||||
const expandedKeys = this.dataList.map((item) => { |
||||
if (item.title.indexOf(value) > -1) { |
||||
return this.getParentKey(item.key,this.treeData) |
||||
} |
||||
return null |
||||
}).filter((item, i, self) => item && self.indexOf(item) === i) |
||||
|
||||
Object.assign(this, { |
||||
expandedKeys, |
||||
searchValue: value, |
||||
autoExpandParent: true, |
||||
}) |
||||
|
||||
|
||||
}, |
||||
// 根据 checkedKeys 获取 rows |
||||
getCheckedRows(checkedKeys) { |
||||
const forChildren = (list, key) => { |
||||
for (let item of list) { |
||||
if (item.id === key) { |
||||
return item |
||||
} |
||||
if (item.children instanceof Array) { |
||||
let value = forChildren(item.children, key) |
||||
if (value != null) { |
||||
return value |
||||
} |
||||
} |
||||
} |
||||
return null |
||||
} |
||||
|
||||
let rows = [] |
||||
for (let key of checkedKeys) { |
||||
let row = forChildren(this.treeData, key) |
||||
if (row != null) { |
||||
rows.push(row) |
||||
} |
||||
} |
||||
return rows |
||||
} |
||||
} |
||||
} |
||||
|
||||
</script> |
||||
|
||||
<style lang="less" scoped> |
||||
// 限制部门选择树高度,避免部门太多时点击确定不便 |
||||
.my-dept-select-tree{ |
||||
height: 350px; |
||||
overflow-y: scroll; |
||||
} |
||||
|
||||
</style> |
@ -0,0 +1,363 @@ |
||||
<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.ordersId" dictCode="zy_orders,orders_num,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.goodsId" dictCode="zy_goods,goods_name,id"/> |
||||
</a-form-item> |
||||
</a-col> |
||||
<template v-if="toggleSearchStatus"> |
||||
<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> |
||||
<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.measureId" dictCode="customer_measure,username,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> |
||||
</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> |
||||
|
||||
<order-goods-modal ref="modalForm" @ok="modalFormOk"></order-goods-modal> |
||||
</a-card> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import '@/assets/less/TableExpand.less' |
||||
import { mixinDevice } from '@/utils/mixin' |
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
||||
import OrderGoodsModal from './modules/OrderGoodsModal' |
||||
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' |
||||
|
||||
export default { |
||||
name: 'OrderGoodsList', |
||||
mixins:[JeecgListMixin, mixinDevice], |
||||
components: { |
||||
OrderGoodsModal |
||||
}, |
||||
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: 'ordersId_dictText' |
||||
}, |
||||
{ |
||||
title:'商品', |
||||
align:"center", |
||||
dataIndex: 'goodsId_dictText' |
||||
}, |
||||
{ |
||||
title:'商品数量', |
||||
align:"center", |
||||
dataIndex: 'goodsNum' |
||||
}, |
||||
{ |
||||
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: 'measureId_dictText' |
||||
}, |
||||
{ |
||||
title:'商品图片', |
||||
align:"center", |
||||
dataIndex: 'goodsPicture' |
||||
}, |
||||
{ |
||||
title:'默认图片', |
||||
align:"center", |
||||
dataIndex: 'defaultPicture' |
||||
}, |
||||
{ |
||||
title:'商品视频', |
||||
align:"center", |
||||
dataIndex: 'goodsVideo', |
||||
scopedSlots: {customRender: 'fileSlot'} |
||||
}, |
||||
{ |
||||
title:'服装类型', |
||||
align:"center", |
||||
dataIndex: 'clothsTypeId' |
||||
}, |
||||
{ |
||||
title:'款式', |
||||
align:"center", |
||||
dataIndex: 'styleId' |
||||
}, |
||||
{ |
||||
title:'型号', |
||||
align:"center", |
||||
dataIndex: 'modelId' |
||||
}, |
||||
{ |
||||
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: 'totalPrice' |
||||
}, |
||||
{ |
||||
title:'商品实付总价', |
||||
align:"center", |
||||
dataIndex: 'payTotalPrice' |
||||
}, |
||||
{ |
||||
title: '操作', |
||||
dataIndex: 'action', |
||||
align:"center", |
||||
fixed:"right", |
||||
width:147, |
||||
scopedSlots: { customRender: 'action' } |
||||
} |
||||
], |
||||
url: { |
||||
list: "/ordergoods/orderGoods/list", |
||||
delete: "/ordergoods/orderGoods/delete", |
||||
deleteBatch: "/ordergoods/orderGoods/deleteBatch", |
||||
exportXlsUrl: "/ordergoods/orderGoods/exportXls", |
||||
importExcelUrl: "ordergoods/orderGoods/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:'ordersId',text:'订单',dictCode:'zy_orders,orders_num,id'}) |
||||
fieldList.push({type:'string',value:'goodsId',text:'商品',dictCode:'zy_goods,goods_name,id'}) |
||||
fieldList.push({type:'int',value:'goodsNum',text:'商品数量',dictCode:''}) |
||||
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:'measureId',text:'顾客量体',dictCode:'customer_measure,username,id'}) |
||||
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:'styleId',text:'款式',dictCode:'zy_cloths_style,style_names,id'}) |
||||
fieldList.push({type:'string',value:'modelId',text:'型号',dictCode:'zy_style_model,model_number,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:'double',value:'totalPrice',text:'商品总价',dictCode:''}) |
||||
fieldList.push({type:'double',value:'payTotalPrice',text:'商品实付总价',dictCode:''}) |
||||
this.superFieldList = fieldList |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
<style scoped> |
||||
@import '~@assets/less/common.less'; |
||||
</style> |
@ -0,0 +1,132 @@ |
||||
<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="ordersId"> |
||||
<j-dict-select-tag type="list" v-model="model.ordersId" dictCode="zy_orders,orders_num,id" placeholder="请选择订单" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<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="goodsNum"> |
||||
<a-input-number v-model="model.goodsNum" placeholder="请输入商品数量" style="width: 100%" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="顾客量体" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="measureId"> |
||||
<j-dict-select-tag type="list" v-model="model.measureId" dictCode="customer_measure,username,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: 'OrderGoodsForm', |
||||
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: { |
||||
ordersId: [ |
||||
{ required: true, message: '请选择订单!'}, |
||||
], |
||||
goodsId: [ |
||||
{ required: true, message: '请选择商品!'}, |
||||
], |
||||
goodsNum: [ |
||||
{ required: true, message: '请输入商品数量!'}, |
||||
{ pattern: /^[+]{0,1}(\d+)$/, message: '商品数量必须大于等于0!'}, |
||||
], |
||||
measureId: [ |
||||
{ required: true, message: '请选择顾客量体!'}, |
||||
], |
||||
}, |
||||
url: { |
||||
add: "/ordergoods/orderGoods/add", |
||||
edit: "/ordergoods/orderGoods/edit", |
||||
queryById: "/ordergoods/orderGoods/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="关闭"> |
||||
<order-goods-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></order-goods-form> |
||||
</j-modal> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import OrderGoodsForm from './OrderGoodsForm' |
||||
export default { |
||||
name: 'OrderGoodsModal', |
||||
components: { |
||||
OrderGoodsForm |
||||
}, |
||||
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"> |
||||
<order-goods-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></order-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 OrderGoodsForm from './OrderGoodsForm' |
||||
|
||||
export default { |
||||
name: 'OrderGoodsModal', |
||||
components: { |
||||
OrderGoodsForm |
||||
}, |
||||
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,211 @@ |
||||
<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.orderGoodsId" dictCode="order_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.goodsId" dictCode="zy_goods,goods_name,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.accessoriesId" dictCode="zy_accessories,contents,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> |
||||
|
||||
<order-goods-accessories-modal ref="modalForm" @ok="modalFormOk"></order-goods-accessories-modal> |
||||
</a-card> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import '@/assets/less/TableExpand.less' |
||||
import { mixinDevice } from '@/utils/mixin' |
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
||||
import OrderGoodsAccessoriesModal from './modules/OrderGoodsAccessoriesModal' |
||||
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' |
||||
|
||||
export default { |
||||
name: 'OrderGoodsAccessoriesList', |
||||
mixins:[JeecgListMixin, mixinDevice], |
||||
components: { |
||||
OrderGoodsAccessoriesModal |
||||
}, |
||||
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: 'orderGoodsId_dictText' |
||||
}, |
||||
{ |
||||
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: "/ordergoodsaccessories/orderGoodsAccessories/list", |
||||
delete: "/ordergoodsaccessories/orderGoodsAccessories/delete", |
||||
deleteBatch: "/ordergoodsaccessories/orderGoodsAccessories/deleteBatch", |
||||
exportXlsUrl: "/ordergoodsaccessories/orderGoodsAccessories/exportXls", |
||||
importExcelUrl: "ordergoodsaccessories/orderGoodsAccessories/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:'orderGoodsId',text:'订单商品',dictCode:'order_goods,goods_name,id'}) |
||||
fieldList.push({type:'string',value:'goodsId',text:'商品',dictCode:'zy_goods,goods_name,id'}) |
||||
fieldList.push({type:'string',value:'accessoriesId',text:'辅料',dictCode:'zy_accessories,contents,id'}) |
||||
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="orderGoodsId"> |
||||
<j-dict-select-tag type="list" v-model="model.orderGoodsId" dictCode="order_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="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: 'OrderGoodsAccessoriesForm', |
||||
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: "/ordergoodsaccessories/orderGoodsAccessories/add", |
||||
edit: "/ordergoodsaccessories/orderGoodsAccessories/edit", |
||||
queryById: "/ordergoodsaccessories/orderGoodsAccessories/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="关闭"> |
||||
<order-goods-accessories-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></order-goods-accessories-form> |
||||
</j-modal> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import OrderGoodsAccessoriesForm from './OrderGoodsAccessoriesForm' |
||||
export default { |
||||
name: 'OrderGoodsAccessoriesModal', |
||||
components: { |
||||
OrderGoodsAccessoriesForm |
||||
}, |
||||
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"> |
||||
<order-goods-accessories-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></order-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 OrderGoodsAccessoriesForm from './OrderGoodsAccessoriesForm' |
||||
|
||||
export default { |
||||
name: 'OrderGoodsAccessoriesModal', |
||||
components: { |
||||
OrderGoodsAccessoriesForm |
||||
}, |
||||
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,211 @@ |
||||
<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.orderGoodsId" dictCode="order_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.goodsId" dictCode="zy_goods,goods_name,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.fabricId" dictCode="zy_fabric,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> |
||||
|
||||
<order-goods-fabric-modal ref="modalForm" @ok="modalFormOk"></order-goods-fabric-modal> |
||||
</a-card> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import '@/assets/less/TableExpand.less' |
||||
import { mixinDevice } from '@/utils/mixin' |
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
||||
import OrderGoodsFabricModal from './modules/OrderGoodsFabricModal' |
||||
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' |
||||
|
||||
export default { |
||||
name: 'OrderGoodsFabricList', |
||||
mixins:[JeecgListMixin, mixinDevice], |
||||
components: { |
||||
OrderGoodsFabricModal |
||||
}, |
||||
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: 'orderGoodsId_dictText' |
||||
}, |
||||
{ |
||||
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: "/ordergoodsfabric/orderGoodsFabric/list", |
||||
delete: "/ordergoodsfabric/orderGoodsFabric/delete", |
||||
deleteBatch: "/ordergoodsfabric/orderGoodsFabric/deleteBatch", |
||||
exportXlsUrl: "/ordergoodsfabric/orderGoodsFabric/exportXls", |
||||
importExcelUrl: "ordergoodsfabric/orderGoodsFabric/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:'orderGoodsId',text:'订单商品',dictCode:'order_goods,goods_name,id'}) |
||||
fieldList.push({type:'string',value:'goodsId',text:'商品',dictCode:'zy_goods,goods_name,id'}) |
||||
fieldList.push({type:'string',value:'fabricId',text:'面料',dictCode:'zy_fabric,name,id'}) |
||||
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="orderGoodsId"> |
||||
<j-dict-select-tag type="list" v-model="model.orderGoodsId" dictCode="order_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="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: 'OrderGoodsFabricForm', |
||||
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: "/ordergoodsfabric/orderGoodsFabric/add", |
||||
edit: "/ordergoodsfabric/orderGoodsFabric/edit", |
||||
queryById: "/ordergoodsfabric/orderGoodsFabric/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="关闭"> |
||||
<order-goods-fabric-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></order-goods-fabric-form> |
||||
</j-modal> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import OrderGoodsFabricForm from './OrderGoodsFabricForm' |
||||
export default { |
||||
name: 'OrderGoodsFabricModal', |
||||
components: { |
||||
OrderGoodsFabricForm |
||||
}, |
||||
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"> |
||||
<order-goods-fabric-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></order-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 OrderGoodsFabricForm from './OrderGoodsFabricForm' |
||||
|
||||
export default { |
||||
name: 'OrderGoodsFabricModal', |
||||
components: { |
||||
OrderGoodsFabricForm |
||||
}, |
||||
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,228 @@ |
||||
<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.orderGoodsId" dictCode="order_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.goodsId" dictCode="zy_goods,goods_name,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.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="款式模块"> |
||||
<a-input placeholder="请输入款式模块" v-model="queryParam.styleModuleId"></a-input> |
||||
</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.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> |
||||
|
||||
<order-goods-module-modal ref="modalForm" @ok="modalFormOk"></order-goods-module-modal> |
||||
</a-card> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import '@/assets/less/TableExpand.less' |
||||
import { mixinDevice } from '@/utils/mixin' |
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
||||
import OrderGoodsModuleModal from './modules/OrderGoodsModuleModal' |
||||
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' |
||||
|
||||
export default { |
||||
name: 'OrderGoodsModuleList', |
||||
mixins:[JeecgListMixin, mixinDevice], |
||||
components: { |
||||
OrderGoodsModuleModal |
||||
}, |
||||
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: 'orderGoodsId_dictText' |
||||
}, |
||||
{ |
||||
title:'商品', |
||||
align:"center", |
||||
dataIndex: 'goodsId_dictText' |
||||
}, |
||||
{ |
||||
title:'款式', |
||||
align:"center", |
||||
dataIndex: 'styleId_dictText' |
||||
}, |
||||
{ |
||||
title:'模块', |
||||
align:"center", |
||||
dataIndex: 'moduleId_dictText' |
||||
}, |
||||
{ |
||||
title: '操作', |
||||
dataIndex: 'action', |
||||
align:"center", |
||||
fixed:"right", |
||||
width:147, |
||||
scopedSlots: { customRender: 'action' } |
||||
} |
||||
], |
||||
url: { |
||||
list: "/ordergoodsmodule/orderGoodsModule/list", |
||||
delete: "/ordergoodsmodule/orderGoodsModule/delete", |
||||
deleteBatch: "/ordergoodsmodule/orderGoodsModule/deleteBatch", |
||||
exportXlsUrl: "/ordergoodsmodule/orderGoodsModule/exportXls", |
||||
importExcelUrl: "ordergoodsmodule/orderGoodsModule/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:'orderGoodsId',text:'订单商品',dictCode:'order_goods,goods_name,id'}) |
||||
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:'styleModuleId',text:'款式模块',dictCode:''}) |
||||
fieldList.push({type:'string',value:'moduleId',text:'模块',dictCode:'zy_cloths_modular ,modular_name,id'}) |
||||
this.superFieldList = fieldList |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
<style scoped> |
||||
@import '~@assets/less/common.less'; |
||||
</style> |
@ -0,0 +1,119 @@ |
||||
<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="orderGoodsId"> |
||||
<j-dict-select-tag type="list" v-model="model.orderGoodsId" dictCode="order_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="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: 'OrderGoodsModuleForm', |
||||
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: "/ordergoodsmodule/orderGoodsModule/add", |
||||
edit: "/ordergoodsmodule/orderGoodsModule/edit", |
||||
queryById: "/ordergoodsmodule/orderGoodsModule/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="关闭"> |
||||
<order-goods-module-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></order-goods-module-form> |
||||
</j-modal> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import OrderGoodsModuleForm from './OrderGoodsModuleForm' |
||||
export default { |
||||
name: 'OrderGoodsModuleModal', |
||||
components: { |
||||
OrderGoodsModuleForm |
||||
}, |
||||
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"> |
||||
<order-goods-module-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></order-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 OrderGoodsModuleForm from './OrderGoodsModuleForm' |
||||
|
||||
export default { |
||||
name: 'OrderGoodsModuleModal', |
||||
components: { |
||||
OrderGoodsModuleForm |
||||
}, |
||||
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,455 @@ |
||||
<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.ischild" dictCode="ischild"/> |
||||
</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.ordersNum"></a-input> |
||||
</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.ordersType" dictCode="orders_type"/> |
||||
</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.paymentMethod" dictCode="payment_method"/> |
||||
</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.paymentStatus" dictCode="payment_status"/> |
||||
</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.accountNo"></a-input> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24"> |
||||
<a-form-item label="城市"> |
||||
<j-area-linkage type="cascader" v-model="queryParam.cityId" placeholder="请选择省市区"/> |
||||
</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.invoiceCustomerType" dictCode="invoice_customer_type"/> |
||||
</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.invoiceType" dictCode="invoice_type"/> |
||||
</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.accountNumber"></a-input> |
||||
</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.logisticsEnterprisesId"/> |
||||
</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.deliveryStatus" dictCode="delivery_status"/> |
||||
</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> |
||||
</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="pcaSlot" slot-scope="text"> |
||||
<div>{{ getPcaText(text) }}</div> |
||||
</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="chaidan(record)">拆单</a> |
||||
<a-divider type="vertical" /> |
||||
<a @click="handleEdit(record)">编辑</a> |
||||
<a-divider type="vertical" /> |
||||
<a @click="handleDetail(record)">详情</a> |
||||
<a-divider type="vertical" /> |
||||
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> |
||||
<a>删除</a> |
||||
</a-popconfirm> |
||||
</span> |
||||
|
||||
</a-table> |
||||
</div> |
||||
|
||||
<zy-orders-modal ref="modalForm" @ok="modalFormOk"></zy-orders-modal> |
||||
</a-card> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import '@/assets/less/TableExpand.less' |
||||
import { mixinDevice } from '@/utils/mixin' |
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
||||
import ZyOrdersModal from './modules/ZyOrdersModal' |
||||
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' |
||||
import Area from '@/components/_util/Area' |
||||
import { httpAction, getAction } from '@/api/manage' |
||||
|
||||
export default { |
||||
name: 'ZyOrdersList', |
||||
mixins:[JeecgListMixin, mixinDevice], |
||||
components: { |
||||
ZyOrdersModal |
||||
}, |
||||
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: 'ischild_dictText' |
||||
}, |
||||
{ |
||||
title:'原订单', |
||||
align:"center", |
||||
dataIndex: 'orderId_dictText' |
||||
}, |
||||
{ |
||||
title:'下单时间', |
||||
align:"center", |
||||
dataIndex: 'orderTime', |
||||
customRender:function (text) { |
||||
return !text?"":(text.length>10?text.substr(0,10):text) |
||||
} |
||||
}, |
||||
{ |
||||
title:'订单编号', |
||||
align:"center", |
||||
dataIndex: 'ordersNum' |
||||
}, |
||||
{ |
||||
title:'总金额(元)', |
||||
align:"center", |
||||
dataIndex: 'money' |
||||
}, |
||||
{ |
||||
title:'运费', |
||||
align:"center", |
||||
dataIndex: 'freight' |
||||
}, |
||||
{ |
||||
title:'促销', |
||||
align:"center", |
||||
dataIndex: 'promotionPrice' |
||||
}, |
||||
{ |
||||
title:'实付款', |
||||
align:"center", |
||||
dataIndex: 'actualPayment' |
||||
}, |
||||
{ |
||||
title:'交货期(天)', |
||||
align:"center", |
||||
dataIndex: 'deliveryTime' |
||||
}, |
||||
{ |
||||
title:'订单类型', |
||||
align:"center", |
||||
dataIndex: 'ordersType_dictText' |
||||
}, |
||||
{ |
||||
title:'顾客', |
||||
align:"center", |
||||
dataIndex: 'userId_dictText' |
||||
}, |
||||
{ |
||||
title:'商品条目数量', |
||||
align:"center", |
||||
dataIndex: 'goodsQuantity' |
||||
}, |
||||
{ |
||||
title:'支付方式', |
||||
align:"center", |
||||
dataIndex: 'paymentMethod_dictText' |
||||
}, |
||||
{ |
||||
title:'支付状态', |
||||
align:"center", |
||||
dataIndex: 'paymentStatus_dictText' |
||||
}, |
||||
{ |
||||
title:'账号/卡号', |
||||
align:"center", |
||||
dataIndex: 'accountNo' |
||||
}, |
||||
{ |
||||
title:'开户银行', |
||||
align:"center", |
||||
dataIndex: 'bankDeposit' |
||||
}, |
||||
{ |
||||
title:'支付时间', |
||||
align:"center", |
||||
dataIndex: 'paymentTime', |
||||
customRender:function (text) { |
||||
return !text?"":(text.length>10?text.substr(0,10):text) |
||||
} |
||||
}, |
||||
{ |
||||
title:'城市', |
||||
align:"center", |
||||
dataIndex: 'cityId', |
||||
scopedSlots: {customRender: 'pcaSlot'} |
||||
}, |
||||
{ |
||||
title:'地址', |
||||
align:"center", |
||||
dataIndex: 'address' |
||||
}, |
||||
{ |
||||
title:'邮编', |
||||
align:"center", |
||||
dataIndex: 'zipCode' |
||||
}, |
||||
{ |
||||
title:'收货人', |
||||
align:"center", |
||||
dataIndex: 'receiver_dictText' |
||||
}, |
||||
{ |
||||
title:'联系电话', |
||||
align:"center", |
||||
dataIndex: 'mobile' |
||||
}, |
||||
{ |
||||
title:'发票客户类型', |
||||
align:"center", |
||||
dataIndex: 'invoiceCustomerType_dictText' |
||||
}, |
||||
{ |
||||
title:'发票类型', |
||||
align:"center", |
||||
dataIndex: 'invoiceType_dictText' |
||||
}, |
||||
{ |
||||
title:'纳税人识别号', |
||||
align:"center", |
||||
dataIndex: 'taxIdentificationNumber' |
||||
}, |
||||
{ |
||||
title:'开票地址', |
||||
align:"center", |
||||
dataIndex: 'addressBilling' |
||||
}, |
||||
{ |
||||
title:'电话', |
||||
align:"center", |
||||
dataIndex: 'telephone' |
||||
}, |
||||
{ |
||||
title:'公户开户行', |
||||
align:"center", |
||||
dataIndex: 'bankPublic' |
||||
}, |
||||
{ |
||||
title:'公户账号', |
||||
align:"center", |
||||
dataIndex: 'accountNumber' |
||||
}, |
||||
{ |
||||
title:'销售门店', |
||||
align:"center", |
||||
dataIndex: 'salesEnterpriseId_dictText' |
||||
}, |
||||
{ |
||||
title:'销售员', |
||||
align:"center", |
||||
dataIndex: 'salespersonId_dictText' |
||||
}, |
||||
{ |
||||
title:'物流企业', |
||||
align:"center", |
||||
dataIndex: 'logisticsEnterprisesId_dictText' |
||||
}, |
||||
{ |
||||
title:'交付状态', |
||||
align:"center", |
||||
dataIndex: 'deliveryStatus_dictText' |
||||
}, |
||||
{ |
||||
title: '操作', |
||||
dataIndex: 'action', |
||||
align:"center", |
||||
fixed:"right", |
||||
width:147, |
||||
scopedSlots: { customRender: 'action' } |
||||
} |
||||
], |
||||
url: { |
||||
list: "/zyorders/zyOrders/list", |
||||
delete: "/zyorders/zyOrders/delete", |
||||
deleteBatch: "/zyorders/zyOrders/deleteBatch", |
||||
exportXlsUrl: "/zyorders/zyOrders/exportXls", |
||||
importExcelUrl: "zyorders/zyOrders/importExcel", |
||||
chaidan:"/zyorders/zyOrders/chaidan", |
||||
|
||||
}, |
||||
dictOptions:{}, |
||||
pcaData:'', |
||||
superFieldList:[], |
||||
} |
||||
}, |
||||
created() { |
||||
this.pcaData = new Area() |
||||
this.getSuperFieldList(); |
||||
}, |
||||
computed: { |
||||
importExcelUrl: function(){ |
||||
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; |
||||
}, |
||||
}, |
||||
methods: { |
||||
chaidan(record){ |
||||
if(record.ischild===0){ |
||||
getAction(this.url.chaidan,{id:record.id}).then((res) => { |
||||
if (res.success) { |
||||
this.$message.success("拆单成功!"); |
||||
this.loadData(); |
||||
}else{ |
||||
this.$message.error(res.message); |
||||
} |
||||
}) |
||||
}else{ |
||||
this.$message.warning("该订单为子单,不可进行拆单!"); |
||||
} |
||||
}, |
||||
getPcaText(code){ |
||||
return this.pcaData.getText(code); |
||||
}, |
||||
initDictConfig(){ |
||||
}, |
||||
getSuperFieldList(){ |
||||
let fieldList=[]; |
||||
fieldList.push({type:'int',value:'ischild',text:'是否子单',dictCode:'ischild'}) |
||||
fieldList.push({type:'string',value:'orderId',text:'原订单',dictCode:'zy_orders,orders_num,id'}) |
||||
fieldList.push({type:'date',value:'orderTime',text:'下单时间'}) |
||||
fieldList.push({type:'string',value:'ordersNum',text:'订单编号',dictCode:''}) |
||||
fieldList.push({type:'double',value:'money',text:'总金额',dictCode:''}) |
||||
fieldList.push({type:'double',value:'freight',text:'运费',dictCode:''}) |
||||
fieldList.push({type:'double',value:'promotionPrice',text:'促销',dictCode:''}) |
||||
fieldList.push({type:'double',value:'actualPayment',text:'实付款',dictCode:''}) |
||||
fieldList.push({type:'int',value:'deliveryTime',text:'交货期',dictCode:''}) |
||||
fieldList.push({type:'int',value:'ordersType',text:'订单类型',dictCode:'orders_type'}) |
||||
fieldList.push({type:'sel_user',value:'userId',text:'顾客'}) |
||||
fieldList.push({type:'int',value:'goodsQuantity',text:'商品条目数量',dictCode:''}) |
||||
fieldList.push({type:'int',value:'paymentMethod',text:'支付方式',dictCode:'payment_method'}) |
||||
fieldList.push({type:'int',value:'paymentStatus',text:'支付状态',dictCode:'payment_status'}) |
||||
fieldList.push({type:'string',value:'accountNo',text:'账号/卡号',dictCode:''}) |
||||
fieldList.push({type:'string',value:'bankDeposit',text:'开户银行',dictCode:''}) |
||||
fieldList.push({type:'date',value:'paymentTime',text:'支付时间'}) |
||||
fieldList.push({type:'pca',value:'cityId',text:'城市'}) |
||||
fieldList.push({type:'string',value:'address',text:'地址',dictCode:''}) |
||||
fieldList.push({type:'string',value:'zipCode',text:'邮编',dictCode:''}) |
||||
fieldList.push({type:'sel_user',value:'receiver',text:'收货人'}) |
||||
fieldList.push({type:'string',value:'mobile',text:'联系电话',dictCode:''}) |
||||
fieldList.push({type:'int',value:'invoiceCustomerType',text:'发票客户类型',dictCode:'invoice_customer_type'}) |
||||
fieldList.push({type:'int',value:'invoiceType',text:'发票类型',dictCode:'invoice_type'}) |
||||
fieldList.push({type:'string',value:'taxIdentificationNumber',text:'纳税人识别号',dictCode:''}) |
||||
fieldList.push({type:'string',value:'addressBilling',text:'开票地址',dictCode:''}) |
||||
fieldList.push({type:'string',value:'telephone',text:'电话',dictCode:''}) |
||||
fieldList.push({type:'string',value:'bankPublic',text:'公户开户行',dictCode:''}) |
||||
fieldList.push({type:'string',value:'accountNumber',text:'公户账号',dictCode:''}) |
||||
fieldList.push({type:'sel_depart',value:'salesEnterpriseId',text:'销售门店'}) |
||||
fieldList.push({type:'sel_user',value:'salespersonId',text:'销售员'}) |
||||
fieldList.push({type:'sel_depart',value:'logisticsEnterprisesId',text:'物流企业'}) |
||||
fieldList.push({type:'int',value:'deliveryStatus',text:'交付状态',dictCode:'delivery_status'}) |
||||
this.superFieldList = fieldList |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
<style scoped> |
||||
@import '~@assets/less/common.less'; |
||||
</style> |
@ -0,0 +1,306 @@ |
||||
<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="ischild"> |
||||
<j-dict-select-tag type="radio" v-model="model.ischild" dictCode="ischild" placeholder="请选择是否子单" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="订单编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ordersNum"> |
||||
<a-input v-model="model.ordersNum" placeholder="请输入订单编号" disabled></a-input> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="总金额(元)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="money"> |
||||
<a-input-number v-model="model.money" placeholder="请输入总金额" style="width: 100%" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="运费" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="freight"> |
||||
<a-input-number v-model="model.freight" 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="actualPayment"> |
||||
<a-input-number v-model="model.actualPayment" placeholder="请输入实付款" style="width: 100%" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="交货期(天)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="deliveryTime"> |
||||
<a-input-number v-model="model.deliveryTime" placeholder="请输入交货期" style="width: 100%" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="订单类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ordersType"> |
||||
<j-dict-select-tag type="radio" v-model="model.ordersType" dictCode="orders_type" placeholder="请选择订单类型" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="顾客" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="userId"> |
||||
<j-select-user-by-dep v-model="model.userId" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="商品条目数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="goodsQuantity"> |
||||
<a-input-number v-model="model.goodsQuantity" placeholder="请输入商品条目数量" style="width: 100%" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="支付方式" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="paymentMethod"> |
||||
<j-dict-select-tag type="radio" v-model="model.paymentMethod" dictCode="payment_method" placeholder="请选择支付方式" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="支付状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="paymentStatus"> |
||||
<j-dict-select-tag type="list" v-model="model.paymentStatus" dictCode="payment_status" placeholder="请选择支付状态" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="账号/卡号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="accountNo"> |
||||
<a-input v-model="model.accountNo" placeholder="请输入账号/卡号" ></a-input> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="开户银行" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="bankDeposit"> |
||||
<a-input v-model="model.bankDeposit" placeholder="请输入开户银行" ></a-input> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="城市" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="cityId"> |
||||
<j-area-linkage type="cascader" v-model="model.cityId" placeholder="请输入省市区" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="地址" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="address"> |
||||
<a-input v-model="model.address" placeholder="请输入地址" ></a-input> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="邮编" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="zipCode"> |
||||
<a-input v-model="model.zipCode" placeholder="请输入邮编" ></a-input> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="收货人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="receiver"> |
||||
<j-select-user-by-dep v-model="model.receiver" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="联系电话" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="mobile"> |
||||
<a-input v-model="model.mobile" placeholder="请输入联系电话" ></a-input> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="发票客户类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="invoiceCustomerType"> |
||||
<j-dict-select-tag type="radio" v-model="model.invoiceCustomerType" dictCode="invoice_customer_type" placeholder="请选择发票客户类型" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="发票类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="invoiceType"> |
||||
<j-dict-select-tag type="radio" v-model="model.invoiceType" dictCode="invoice_type" placeholder="请选择发票类型" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="纳税人识别号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="taxIdentificationNumber"> |
||||
<a-input v-model="model.taxIdentificationNumber" placeholder="请输入纳税人识别号" ></a-input> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="开票地址" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="addressBilling"> |
||||
<a-input v-model="model.addressBilling" placeholder="请输入开票地址" ></a-input> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="电话" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="telephone"> |
||||
<a-input v-model="model.telephone" placeholder="请输入电话" ></a-input> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="公户开户行" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="bankPublic"> |
||||
<a-input v-model="model.bankPublic" placeholder="请输入公户开户行" ></a-input> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="公户账号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="accountNumber"> |
||||
<a-input v-model="model.accountNumber" placeholder="请输入公户账号" ></a-input> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="销售门店" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="salesEnterpriseId"> |
||||
<j-select-depart v-model="model.salesEnterpriseId" multi /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="销售员" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="salespersonId"> |
||||
<j-select-user-by-dep v-model="model.salespersonId" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="物流企业" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="logisticsEnterprisesId"> |
||||
<j-select-depart v-model="model.logisticsEnterprisesId" multi /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="交付状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="deliveryStatus"> |
||||
<j-dict-select-tag type="list" v-model="model.deliveryStatus" dictCode="delivery_status" 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: 'ZyOrdersForm', |
||||
components: { |
||||
}, |
||||
props: { |
||||
//表单禁用 |
||||
disabled: { |
||||
type: Boolean, |
||||
default: false, |
||||
required: false |
||||
} |
||||
}, |
||||
data () { |
||||
return { |
||||
model:{ |
||||
ischild:0, |
||||
ordersType:0, |
||||
paymentMethod:0, |
||||
paymentStatus:0, |
||||
invoiceCustomerType:0, |
||||
invoiceType:0, |
||||
deliveryStatus:0, |
||||
}, |
||||
labelCol: { |
||||
xs: { span: 24 }, |
||||
sm: { span: 5 }, |
||||
}, |
||||
wrapperCol: { |
||||
xs: { span: 24 }, |
||||
sm: { span: 16 }, |
||||
}, |
||||
confirmLoading: false, |
||||
validatorRules: { |
||||
ordersNum: [ |
||||
{ required: true, message: '请输入订单编号!'}, |
||||
{ validator: (rule, value, callback) => validateDuplicateValue('zy_orders', 'orders_num', value, this.model.id, callback)}, |
||||
], |
||||
money: [ |
||||
{ required: false}, |
||||
{ pattern: /^(([1-9][0-9]*)|([0]\.\d{0,2}|[1-9][0-9]*\.\d{0,2}))$/, message: '请输入正确的金额!'}, |
||||
], |
||||
freight: [ |
||||
{ 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: '请输入正确的金额!'}, |
||||
], |
||||
actualPayment: [ |
||||
{ required: false}, |
||||
{ pattern: /^(([1-9][0-9]*)|([0]\.\d{0,2}|[1-9][0-9]*\.\d{0,2}))$/, message: '请输入正确的金额!'}, |
||||
], |
||||
deliveryTime: [ |
||||
{ required: false}, |
||||
{ pattern: /^[+]{0,1}(\d+)$/, message: '必须大于等于0!'}, |
||||
], |
||||
goodsQuantity: [ |
||||
{ required: false}, |
||||
{ pattern: /^[+]{0,1}(\d+)$/, message: '必须大于等于0!'}, |
||||
], |
||||
accountNo: [ |
||||
{ required: false}, |
||||
{ pattern: /^\d{16}$/, message: '请输入16位数字!'}, |
||||
], |
||||
zipCode: [ |
||||
{ required: false}, |
||||
{ pattern: /^[1-9]\d{5}$/, message: '请输入正确的邮政编码!'}, |
||||
], |
||||
mobile: [ |
||||
{ required: false}, |
||||
{ pattern: /^1[3456789]\d{9}$/, message: '请输入正确的手机号码!'}, |
||||
], |
||||
accountNumber: [ |
||||
{ required: false}, |
||||
{ pattern: /^\d{16}$/, message: '请输入16位数字!'}, |
||||
], |
||||
}, |
||||
url: { |
||||
add: "/zyorders/zyOrders/add", |
||||
edit: "/zyorders/zyOrders/edit", |
||||
queryById: "/zyorders/zyOrders/queryById", |
||||
getOrdersNum:"/zyorders/zyOrders/getOrdersNum", |
||||
} |
||||
} |
||||
}, |
||||
computed: { |
||||
formDisabled(){ |
||||
return this.disabled |
||||
}, |
||||
}, |
||||
created () { |
||||
//备份model原始值 |
||||
//this.modelDefault = JSON.parse(JSON.stringify(this.model)); |
||||
getAction(this.url.getOrdersNum).then((res) => { |
||||
if (res.success) { |
||||
this.$set(this.model, 'ordersNum', res.result) |
||||
} |
||||
}) |
||||
}, |
||||
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-orders-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></zy-orders-form> |
||||
</j-modal> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import ZyOrdersForm from './ZyOrdersForm' |
||||
export default { |
||||
name: 'ZyOrdersModal', |
||||
components: { |
||||
ZyOrdersForm |
||||
}, |
||||
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-orders-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></zy-orders-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 ZyOrdersForm from './ZyOrdersForm' |
||||
|
||||
export default { |
||||
name: 'ZyOrdersModal', |
||||
components: { |
||||
ZyOrdersForm |
||||
}, |
||||
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> |
@ -1,5 +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.mall.mapper.ZyOrdersMapper"> |
||||
<mapper namespace="org.jeecg.modules.demo.mall.mapper.ZyOrdersMapper1"> |
||||
|
||||
</mapper> |
||||
</mapper> |
||||
|
@ -0,0 +1,171 @@ |
||||
package org.jeecg.modules.demo.ordergoods.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.ordergoods.entity.OrderGoods; |
||||
import org.jeecg.modules.demo.ordergoods.service.IOrderGoodsService; |
||||
|
||||
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-28 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Api(tags="订单商品表") |
||||
@RestController |
||||
@RequestMapping("/ordergoods/orderGoods") |
||||
@Slf4j |
||||
public class OrderGoodsController extends JeecgController<OrderGoods, IOrderGoodsService> { |
||||
@Autowired |
||||
private IOrderGoodsService orderGoodsService; |
||||
|
||||
/** |
||||
* 分页列表查询 |
||||
* |
||||
* @param orderGoods |
||||
* @param pageNo |
||||
* @param pageSize |
||||
* @param req |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "订单商品表-分页列表查询") |
||||
@ApiOperation(value="订单商品表-分页列表查询", notes="订单商品表-分页列表查询") |
||||
@GetMapping(value = "/list") |
||||
public Result<?> queryPageList(OrderGoods orderGoods, |
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
||||
HttpServletRequest req) { |
||||
QueryWrapper<OrderGoods> queryWrapper = QueryGenerator.initQueryWrapper(orderGoods, req.getParameterMap()); |
||||
Page<OrderGoods> page = new Page<OrderGoods>(pageNo, pageSize); |
||||
IPage<OrderGoods> pageList = orderGoodsService.page(page, queryWrapper); |
||||
return Result.OK(pageList); |
||||
} |
||||
|
||||
/** |
||||
* 添加 |
||||
* |
||||
* @param orderGoods |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "订单商品表-添加") |
||||
@ApiOperation(value="订单商品表-添加", notes="订单商品表-添加") |
||||
@PostMapping(value = "/add") |
||||
public Result<?> add(@RequestBody OrderGoods orderGoods) { |
||||
orderGoodsService.save(orderGoods); |
||||
return Result.OK("添加成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 编辑 |
||||
* |
||||
* @param orderGoods |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "订单商品表-编辑") |
||||
@ApiOperation(value="订单商品表-编辑", notes="订单商品表-编辑") |
||||
@PutMapping(value = "/edit") |
||||
public Result<?> edit(@RequestBody OrderGoods orderGoods) { |
||||
orderGoodsService.updateById(orderGoods); |
||||
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) { |
||||
orderGoodsService.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.orderGoodsService.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) { |
||||
OrderGoods orderGoods = orderGoodsService.getById(id); |
||||
if(orderGoods==null) { |
||||
return Result.error("未找到对应数据"); |
||||
} |
||||
return Result.OK(orderGoods); |
||||
} |
||||
|
||||
/** |
||||
* 导出excel |
||||
* |
||||
* @param request |
||||
* @param orderGoods |
||||
*/ |
||||
@RequestMapping(value = "/exportXls") |
||||
public ModelAndView exportXls(HttpServletRequest request, OrderGoods orderGoods) { |
||||
return super.exportXls(request, orderGoods, OrderGoods.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, OrderGoods.class); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,162 @@ |
||||
package org.jeecg.modules.demo.ordergoods.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-28 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Data |
||||
@TableName("order_goods") |
||||
@Accessors(chain = true) |
||||
@EqualsAndHashCode(callSuper = false) |
||||
@ApiModel(value="order_goods对象", description="订单商品表") |
||||
public class OrderGoods 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_orders", dicText = "orders_num", dicCode = "id") |
||||
@Dict(dictTable = "zy_orders", dicText = "orders_num", dicCode = "id") |
||||
@ApiModelProperty(value = "订单id") |
||||
private java.lang.String ordersId; |
||||
/**商品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; |
||||
/**商品数量*/ |
||||
@Excel(name = "商品数量", width = 15) |
||||
@ApiModelProperty(value = "商品数量") |
||||
private java.lang.Integer goodsNum; |
||||
/**商品编号*/ |
||||
@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; |
||||
/**顾客量体id*/ |
||||
@Excel(name = "顾客量体id", width = 15, dictTable = "customer_measure", dicText = "username", dicCode = "id") |
||||
@Dict(dictTable = "customer_measure", dicText = "username", dicCode = "id") |
||||
@ApiModelProperty(value = "顾客量体id") |
||||
private java.lang.String measureId; |
||||
/**商品图片*/ |
||||
@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) |
||||
@Dict(dictTable = "zy_cloths_type ", dicText = "type_name", dicCode = "id") |
||||
@ApiModelProperty(value = "服装类型id") |
||||
private java.lang.String clothsTypeId; |
||||
/**款式id*/ |
||||
@Excel(name = "款式id", width = 15) |
||||
@Dict(dictTable = "zy_cloths_style", dicText = "style_names", dicCode = "id") |
||||
@ApiModelProperty(value = "款式id") |
||||
private java.lang.String styleId; |
||||
/**型号id*/ |
||||
@Excel(name = "型号id", width = 15) |
||||
@Dict(dictTable = "zy_style_model", dicText = "model_number", dicCode = "id") |
||||
@ApiModelProperty(value = "型号id") |
||||
private java.lang.String modelId; |
||||
/**单位*/ |
||||
@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; |
||||
/**商品总价*/ |
||||
@Excel(name = "商品总价", width = 15) |
||||
@ApiModelProperty(value = "商品总价") |
||||
private java.lang.Double totalPrice; |
||||
/**商品实付总价*/ |
||||
@Excel(name = "商品实付总价", width = 15) |
||||
@ApiModelProperty(value = "商品实付总价") |
||||
private java.lang.Double payTotalPrice; |
||||
} |
@ -0,0 +1,17 @@ |
||||
package org.jeecg.modules.demo.ordergoods.mapper; |
||||
|
||||
import java.util.List; |
||||
|
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.jeecg.modules.demo.ordergoods.entity.OrderGoods; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
||||
/** |
||||
* @Description: 订单商品表 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2022-12-28 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface OrderGoodsMapper extends BaseMapper<OrderGoods> { |
||||
|
||||
} |
@ -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.ordergoods.mapper.OrderGoodsMapper"> |
||||
|
||||
</mapper> |
@ -0,0 +1,14 @@ |
||||
package org.jeecg.modules.demo.ordergoods.service; |
||||
|
||||
import org.jeecg.modules.demo.ordergoods.entity.OrderGoods; |
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
||||
/** |
||||
* @Description: 订单商品表 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2022-12-28 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface IOrderGoodsService extends IService<OrderGoods> { |
||||
|
||||
} |
@ -0,0 +1,19 @@ |
||||
package org.jeecg.modules.demo.ordergoods.service.impl; |
||||
|
||||
import org.jeecg.modules.demo.ordergoods.entity.OrderGoods; |
||||
import org.jeecg.modules.demo.ordergoods.mapper.OrderGoodsMapper; |
||||
import org.jeecg.modules.demo.ordergoods.service.IOrderGoodsService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
||||
/** |
||||
* @Description: 订单商品表 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2022-12-28 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Service |
||||
public class OrderGoodsServiceImpl extends ServiceImpl<OrderGoodsMapper, OrderGoods> implements IOrderGoodsService { |
||||
|
||||
} |
@ -0,0 +1,171 @@ |
||||
package org.jeecg.modules.demo.ordergoodsaccessories.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.ordergoodsaccessories.entity.OrderGoodsAccessories; |
||||
import org.jeecg.modules.demo.ordergoodsaccessories.service.IOrderGoodsAccessoriesService; |
||||
|
||||
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-29 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Api(tags="订单商品辅料表") |
||||
@RestController |
||||
@RequestMapping("/ordergoodsaccessories/orderGoodsAccessories") |
||||
@Slf4j |
||||
public class OrderGoodsAccessoriesController extends JeecgController<OrderGoodsAccessories, IOrderGoodsAccessoriesService> { |
||||
@Autowired |
||||
private IOrderGoodsAccessoriesService orderGoodsAccessoriesService; |
||||
|
||||
/** |
||||
* 分页列表查询 |
||||
* |
||||
* @param orderGoodsAccessories |
||||
* @param pageNo |
||||
* @param pageSize |
||||
* @param req |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "订单商品辅料表-分页列表查询") |
||||
@ApiOperation(value="订单商品辅料表-分页列表查询", notes="订单商品辅料表-分页列表查询") |
||||
@GetMapping(value = "/list") |
||||
public Result<?> queryPageList(OrderGoodsAccessories orderGoodsAccessories, |
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
||||
HttpServletRequest req) { |
||||
QueryWrapper<OrderGoodsAccessories> queryWrapper = QueryGenerator.initQueryWrapper(orderGoodsAccessories, req.getParameterMap()); |
||||
Page<OrderGoodsAccessories> page = new Page<OrderGoodsAccessories>(pageNo, pageSize); |
||||
IPage<OrderGoodsAccessories> pageList = orderGoodsAccessoriesService.page(page, queryWrapper); |
||||
return Result.OK(pageList); |
||||
} |
||||
|
||||
/** |
||||
* 添加 |
||||
* |
||||
* @param orderGoodsAccessories |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "订单商品辅料表-添加") |
||||
@ApiOperation(value="订单商品辅料表-添加", notes="订单商品辅料表-添加") |
||||
@PostMapping(value = "/add") |
||||
public Result<?> add(@RequestBody OrderGoodsAccessories orderGoodsAccessories) { |
||||
orderGoodsAccessoriesService.save(orderGoodsAccessories); |
||||
return Result.OK("添加成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 编辑 |
||||
* |
||||
* @param orderGoodsAccessories |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "订单商品辅料表-编辑") |
||||
@ApiOperation(value="订单商品辅料表-编辑", notes="订单商品辅料表-编辑") |
||||
@PutMapping(value = "/edit") |
||||
public Result<?> edit(@RequestBody OrderGoodsAccessories orderGoodsAccessories) { |
||||
orderGoodsAccessoriesService.updateById(orderGoodsAccessories); |
||||
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) { |
||||
orderGoodsAccessoriesService.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.orderGoodsAccessoriesService.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) { |
||||
OrderGoodsAccessories orderGoodsAccessories = orderGoodsAccessoriesService.getById(id); |
||||
if(orderGoodsAccessories==null) { |
||||
return Result.error("未找到对应数据"); |
||||
} |
||||
return Result.OK(orderGoodsAccessories); |
||||
} |
||||
|
||||
/** |
||||
* 导出excel |
||||
* |
||||
* @param request |
||||
* @param orderGoodsAccessories |
||||
*/ |
||||
@RequestMapping(value = "/exportXls") |
||||
public ModelAndView exportXls(HttpServletRequest request, OrderGoodsAccessories orderGoodsAccessories) { |
||||
return super.exportXls(request, orderGoodsAccessories, OrderGoodsAccessories.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, OrderGoodsAccessories.class); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,72 @@ |
||||
package org.jeecg.modules.demo.ordergoodsaccessories.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-29 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Data |
||||
@TableName("order_goods_accessories") |
||||
@Accessors(chain = true) |
||||
@EqualsAndHashCode(callSuper = false) |
||||
@ApiModel(value="order_goods_accessories对象", description="订单商品辅料表") |
||||
public class OrderGoodsAccessories 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, dictTable = "order_goods", dicText = "goods_name", dicCode = "id") |
||||
@Dict(dictTable = "order_goods", dicText = "goods_name", dicCode = "id") |
||||
@ApiModelProperty(value = "订单商品") |
||||
private java.lang.String orderGoodsId; |
||||
/**商品*/ |
||||
@Excel(name = "商品", width = 15, dictTable = "zy_goods", dicText = "goods_name", dicCode = "id") |
||||
@Dict(dictTable = "zy_goods", dicText = "goods_name", dicCode = "id") |
||||
@ApiModelProperty(value = "商品") |
||||
private java.lang.String goodsId; |
||||
/**辅料*/ |
||||
@Excel(name = "辅料", width = 15, dictTable = "zy_accessories", dicText = "contents", dicCode = "id") |
||||
@Dict(dictTable = "zy_accessories", dicText = "contents", dicCode = "id") |
||||
@ApiModelProperty(value = "辅料") |
||||
private java.lang.String accessoriesId; |
||||
} |
@ -0,0 +1,17 @@ |
||||
package org.jeecg.modules.demo.ordergoodsaccessories.mapper; |
||||
|
||||
import java.util.List; |
||||
|
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.jeecg.modules.demo.ordergoodsaccessories.entity.OrderGoodsAccessories; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
||||
/** |
||||
* @Description: 订单商品辅料表 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2022-12-29 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface OrderGoodsAccessoriesMapper extends BaseMapper<OrderGoodsAccessories> { |
||||
|
||||
} |
@ -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.ordergoodsaccessories.mapper.OrderGoodsAccessoriesMapper"> |
||||
|
||||
</mapper> |
@ -0,0 +1,14 @@ |
||||
package org.jeecg.modules.demo.ordergoodsaccessories.service; |
||||
|
||||
import org.jeecg.modules.demo.ordergoodsaccessories.entity.OrderGoodsAccessories; |
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
||||
/** |
||||
* @Description: 订单商品辅料表 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2022-12-29 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface IOrderGoodsAccessoriesService extends IService<OrderGoodsAccessories> { |
||||
|
||||
} |
@ -0,0 +1,19 @@ |
||||
package org.jeecg.modules.demo.ordergoodsaccessories.service.impl; |
||||
|
||||
import org.jeecg.modules.demo.ordergoodsaccessories.entity.OrderGoodsAccessories; |
||||
import org.jeecg.modules.demo.ordergoodsaccessories.mapper.OrderGoodsAccessoriesMapper; |
||||
import org.jeecg.modules.demo.ordergoodsaccessories.service.IOrderGoodsAccessoriesService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
||||
/** |
||||
* @Description: 订单商品辅料表 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2022-12-29 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Service |
||||
public class OrderGoodsAccessoriesServiceImpl extends ServiceImpl<OrderGoodsAccessoriesMapper, OrderGoodsAccessories> implements IOrderGoodsAccessoriesService { |
||||
|
||||
} |
@ -0,0 +1,171 @@ |
||||
package org.jeecg.modules.demo.ordergoodsfabric.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.ordergoodsfabric.entity.OrderGoodsFabric; |
||||
import org.jeecg.modules.demo.ordergoodsfabric.service.IOrderGoodsFabricService; |
||||
|
||||
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-29 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Api(tags="订单商品面料表") |
||||
@RestController |
||||
@RequestMapping("/ordergoodsfabric/orderGoodsFabric") |
||||
@Slf4j |
||||
public class OrderGoodsFabricController extends JeecgController<OrderGoodsFabric, IOrderGoodsFabricService> { |
||||
@Autowired |
||||
private IOrderGoodsFabricService orderGoodsFabricService; |
||||
|
||||
/** |
||||
* 分页列表查询 |
||||
* |
||||
* @param orderGoodsFabric |
||||
* @param pageNo |
||||
* @param pageSize |
||||
* @param req |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "订单商品面料表-分页列表查询") |
||||
@ApiOperation(value="订单商品面料表-分页列表查询", notes="订单商品面料表-分页列表查询") |
||||
@GetMapping(value = "/list") |
||||
public Result<?> queryPageList(OrderGoodsFabric orderGoodsFabric, |
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
||||
HttpServletRequest req) { |
||||
QueryWrapper<OrderGoodsFabric> queryWrapper = QueryGenerator.initQueryWrapper(orderGoodsFabric, req.getParameterMap()); |
||||
Page<OrderGoodsFabric> page = new Page<OrderGoodsFabric>(pageNo, pageSize); |
||||
IPage<OrderGoodsFabric> pageList = orderGoodsFabricService.page(page, queryWrapper); |
||||
return Result.OK(pageList); |
||||
} |
||||
|
||||
/** |
||||
* 添加 |
||||
* |
||||
* @param orderGoodsFabric |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "订单商品面料表-添加") |
||||
@ApiOperation(value="订单商品面料表-添加", notes="订单商品面料表-添加") |
||||
@PostMapping(value = "/add") |
||||
public Result<?> add(@RequestBody OrderGoodsFabric orderGoodsFabric) { |
||||
orderGoodsFabricService.save(orderGoodsFabric); |
||||
return Result.OK("添加成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 编辑 |
||||
* |
||||
* @param orderGoodsFabric |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "订单商品面料表-编辑") |
||||
@ApiOperation(value="订单商品面料表-编辑", notes="订单商品面料表-编辑") |
||||
@PutMapping(value = "/edit") |
||||
public Result<?> edit(@RequestBody OrderGoodsFabric orderGoodsFabric) { |
||||
orderGoodsFabricService.updateById(orderGoodsFabric); |
||||
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) { |
||||
orderGoodsFabricService.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.orderGoodsFabricService.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) { |
||||
OrderGoodsFabric orderGoodsFabric = orderGoodsFabricService.getById(id); |
||||
if(orderGoodsFabric==null) { |
||||
return Result.error("未找到对应数据"); |
||||
} |
||||
return Result.OK(orderGoodsFabric); |
||||
} |
||||
|
||||
/** |
||||
* 导出excel |
||||
* |
||||
* @param request |
||||
* @param orderGoodsFabric |
||||
*/ |
||||
@RequestMapping(value = "/exportXls") |
||||
public ModelAndView exportXls(HttpServletRequest request, OrderGoodsFabric orderGoodsFabric) { |
||||
return super.exportXls(request, orderGoodsFabric, OrderGoodsFabric.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, OrderGoodsFabric.class); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,72 @@ |
||||
package org.jeecg.modules.demo.ordergoodsfabric.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-29 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Data |
||||
@TableName("order_goods_fabric") |
||||
@Accessors(chain = true) |
||||
@EqualsAndHashCode(callSuper = false) |
||||
@ApiModel(value="order_goods_fabric对象", description="订单商品面料表") |
||||
public class OrderGoodsFabric 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, dictTable = "order_goods", dicText = "goods_name", dicCode = "id") |
||||
@Dict(dictTable = "order_goods", dicText = "goods_name", dicCode = "id") |
||||
@ApiModelProperty(value = "订单商品") |
||||
private java.lang.String orderGoodsId; |
||||
/**商品*/ |
||||
@Excel(name = "商品", width = 15, dictTable = "zy_goods", dicText = "goods_name", dicCode = "id") |
||||
@Dict(dictTable = "zy_goods", dicText = "goods_name", dicCode = "id") |
||||
@ApiModelProperty(value = "商品") |
||||
private java.lang.String goodsId; |
||||
/**面料*/ |
||||
@Excel(name = "面料", width = 15, dictTable = "zy_fabric", dicText = "name", dicCode = "id") |
||||
@Dict(dictTable = "zy_fabric", dicText = "name", dicCode = "id") |
||||
@ApiModelProperty(value = "面料") |
||||
private java.lang.String fabricId; |
||||
} |
@ -0,0 +1,17 @@ |
||||
package org.jeecg.modules.demo.ordergoodsfabric.mapper; |
||||
|
||||
import java.util.List; |
||||
|
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.jeecg.modules.demo.ordergoodsfabric.entity.OrderGoodsFabric; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
||||
/** |
||||
* @Description: 订单商品面料表 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2022-12-29 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface OrderGoodsFabricMapper extends BaseMapper<OrderGoodsFabric> { |
||||
|
||||
} |
@ -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.ordergoodsfabric.mapper.OrderGoodsFabricMapper"> |
||||
|
||||
</mapper> |
@ -0,0 +1,14 @@ |
||||
package org.jeecg.modules.demo.ordergoodsfabric.service; |
||||
|
||||
import org.jeecg.modules.demo.ordergoodsfabric.entity.OrderGoodsFabric; |
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
||||
/** |
||||
* @Description: 订单商品面料表 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2022-12-29 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface IOrderGoodsFabricService extends IService<OrderGoodsFabric> { |
||||
|
||||
} |
@ -0,0 +1,19 @@ |
||||
package org.jeecg.modules.demo.ordergoodsfabric.service.impl; |
||||
|
||||
import org.jeecg.modules.demo.ordergoodsfabric.entity.OrderGoodsFabric; |
||||
import org.jeecg.modules.demo.ordergoodsfabric.mapper.OrderGoodsFabricMapper; |
||||
import org.jeecg.modules.demo.ordergoodsfabric.service.IOrderGoodsFabricService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
||||
/** |
||||
* @Description: 订单商品面料表 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2022-12-29 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Service |
||||
public class OrderGoodsFabricServiceImpl extends ServiceImpl<OrderGoodsFabricMapper, OrderGoodsFabric> implements IOrderGoodsFabricService { |
||||
|
||||
} |
@ -0,0 +1,171 @@ |
||||
package org.jeecg.modules.demo.ordergoodsmodule.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.ordergoodsmodule.entity.OrderGoodsModule; |
||||
import org.jeecg.modules.demo.ordergoodsmodule.service.IOrderGoodsModuleService; |
||||
|
||||
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-29 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Api(tags="订单商品模块表") |
||||
@RestController |
||||
@RequestMapping("/ordergoodsmodule/orderGoodsModule") |
||||
@Slf4j |
||||
public class OrderGoodsModuleController extends JeecgController<OrderGoodsModule, IOrderGoodsModuleService> { |
||||
@Autowired |
||||
private IOrderGoodsModuleService orderGoodsModuleService; |
||||
|
||||
/** |
||||
* 分页列表查询 |
||||
* |
||||
* @param orderGoodsModule |
||||
* @param pageNo |
||||
* @param pageSize |
||||
* @param req |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "订单商品模块表-分页列表查询") |
||||
@ApiOperation(value="订单商品模块表-分页列表查询", notes="订单商品模块表-分页列表查询") |
||||
@GetMapping(value = "/list") |
||||
public Result<?> queryPageList(OrderGoodsModule orderGoodsModule, |
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
||||
HttpServletRequest req) { |
||||
QueryWrapper<OrderGoodsModule> queryWrapper = QueryGenerator.initQueryWrapper(orderGoodsModule, req.getParameterMap()); |
||||
Page<OrderGoodsModule> page = new Page<OrderGoodsModule>(pageNo, pageSize); |
||||
IPage<OrderGoodsModule> pageList = orderGoodsModuleService.page(page, queryWrapper); |
||||
return Result.OK(pageList); |
||||
} |
||||
|
||||
/** |
||||
* 添加 |
||||
* |
||||
* @param orderGoodsModule |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "订单商品模块表-添加") |
||||
@ApiOperation(value="订单商品模块表-添加", notes="订单商品模块表-添加") |
||||
@PostMapping(value = "/add") |
||||
public Result<?> add(@RequestBody OrderGoodsModule orderGoodsModule) { |
||||
orderGoodsModuleService.save(orderGoodsModule); |
||||
return Result.OK("添加成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 编辑 |
||||
* |
||||
* @param orderGoodsModule |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "订单商品模块表-编辑") |
||||
@ApiOperation(value="订单商品模块表-编辑", notes="订单商品模块表-编辑") |
||||
@PutMapping(value = "/edit") |
||||
public Result<?> edit(@RequestBody OrderGoodsModule orderGoodsModule) { |
||||
orderGoodsModuleService.updateById(orderGoodsModule); |
||||
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) { |
||||
orderGoodsModuleService.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.orderGoodsModuleService.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) { |
||||
OrderGoodsModule orderGoodsModule = orderGoodsModuleService.getById(id); |
||||
if(orderGoodsModule==null) { |
||||
return Result.error("未找到对应数据"); |
||||
} |
||||
return Result.OK(orderGoodsModule); |
||||
} |
||||
|
||||
/** |
||||
* 导出excel |
||||
* |
||||
* @param request |
||||
* @param orderGoodsModule |
||||
*/ |
||||
@RequestMapping(value = "/exportXls") |
||||
public ModelAndView exportXls(HttpServletRequest request, OrderGoodsModule orderGoodsModule) { |
||||
return super.exportXls(request, orderGoodsModule, OrderGoodsModule.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, OrderGoodsModule.class); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,81 @@ |
||||
package org.jeecg.modules.demo.ordergoodsmodule.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-29 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Data |
||||
@TableName("order_goods_module") |
||||
@Accessors(chain = true) |
||||
@EqualsAndHashCode(callSuper = false) |
||||
@ApiModel(value="order_goods_module对象", description="订单商品模块表") |
||||
public class OrderGoodsModule 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 = "order_goods", dicText = "goods_name", dicCode = "id") |
||||
@Dict(dictTable = "order_goods", dicText = "goods_name", dicCode = "id") |
||||
@ApiModelProperty(value = "订单商品id") |
||||
private java.lang.String orderGoodsId; |
||||
/**商品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; |
||||
} |
@ -0,0 +1,17 @@ |
||||
package org.jeecg.modules.demo.ordergoodsmodule.mapper; |
||||
|
||||
import java.util.List; |
||||
|
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.jeecg.modules.demo.ordergoodsmodule.entity.OrderGoodsModule; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
||||
/** |
||||
* @Description: 订单商品模块表 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2022-12-29 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface OrderGoodsModuleMapper extends BaseMapper<OrderGoodsModule> { |
||||
|
||||
} |
@ -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.ordergoodsmodule.mapper.OrderGoodsModuleMapper"> |
||||
|
||||
</mapper> |
@ -0,0 +1,14 @@ |
||||
package org.jeecg.modules.demo.ordergoodsmodule.service; |
||||
|
||||
import org.jeecg.modules.demo.ordergoodsmodule.entity.OrderGoodsModule; |
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
||||
/** |
||||
* @Description: 订单商品模块表 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2022-12-29 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface IOrderGoodsModuleService extends IService<OrderGoodsModule> { |
||||
|
||||
} |
@ -0,0 +1,19 @@ |
||||
package org.jeecg.modules.demo.ordergoodsmodule.service.impl; |
||||
|
||||
import org.jeecg.modules.demo.ordergoodsmodule.entity.OrderGoodsModule; |
||||
import org.jeecg.modules.demo.ordergoodsmodule.mapper.OrderGoodsModuleMapper; |
||||
import org.jeecg.modules.demo.ordergoodsmodule.service.IOrderGoodsModuleService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
||||
/** |
||||
* @Description: 订单商品模块表 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2022-12-29 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Service |
||||
public class OrderGoodsModuleServiceImpl extends ServiceImpl<OrderGoodsModuleMapper, OrderGoodsModule> implements IOrderGoodsModuleService { |
||||
|
||||
} |
@ -0,0 +1,243 @@ |
||||
package org.jeecg.modules.demo.zyorders.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.ordergoods.entity.OrderGoods; |
||||
import org.jeecg.modules.demo.ordergoods.service.IOrderGoodsService; |
||||
import org.jeecg.modules.demo.zyorders.entity.ZyOrders; |
||||
import org.jeecg.modules.demo.zyorders.service.IZyOrdersService; |
||||
|
||||
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-26 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Api(tags="订单基本信息管理") |
||||
@RestController |
||||
@RequestMapping("/zyorders/zyOrders") |
||||
@Slf4j |
||||
public class ZyOrdersController extends JeecgController<ZyOrders, IZyOrdersService> { |
||||
@Autowired |
||||
private IZyOrdersService zyOrdersService; |
||||
@Autowired |
||||
private IOrderGoodsService orderGoodsService; |
||||
|
||||
/** |
||||
* 分页列表查询 |
||||
* |
||||
* @param zyOrders |
||||
* @param pageNo |
||||
* @param pageSize |
||||
* @param req |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "订单基本信息管理-分页列表查询") |
||||
@ApiOperation(value="订单基本信息管理-分页列表查询", notes="订单基本信息管理-分页列表查询") |
||||
@GetMapping(value = "/list") |
||||
public Result<?> queryPageList(ZyOrders zyOrders, |
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
||||
HttpServletRequest req) { |
||||
QueryWrapper<ZyOrders> queryWrapper = QueryGenerator.initQueryWrapper(zyOrders, req.getParameterMap()); |
||||
Page<ZyOrders> page = new Page<ZyOrders>(pageNo, pageSize); |
||||
IPage<ZyOrders> pageList = zyOrdersService.page(page, queryWrapper); |
||||
return Result.OK(pageList); |
||||
} |
||||
|
||||
/** |
||||
* 添加 |
||||
* |
||||
* @param zyOrders |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "订单基本信息管理-添加") |
||||
@ApiOperation(value="订单基本信息管理-添加", notes="订单基本信息管理-添加") |
||||
@PostMapping(value = "/add") |
||||
public Result<?> add(@RequestBody ZyOrders zyOrders) { |
||||
zyOrdersService.save(zyOrders); |
||||
return Result.OK("添加成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 编辑 |
||||
* |
||||
* @param zyOrders |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "订单基本信息管理-编辑") |
||||
@ApiOperation(value="订单基本信息管理-编辑", notes="订单基本信息管理-编辑") |
||||
@PutMapping(value = "/edit") |
||||
public Result<?> edit(@RequestBody ZyOrders zyOrders) { |
||||
zyOrdersService.updateById(zyOrders); |
||||
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) { |
||||
zyOrdersService.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.zyOrdersService.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) { |
||||
ZyOrders zyOrders = zyOrdersService.getById(id); |
||||
if(zyOrders==null) { |
||||
return Result.error("未找到对应数据"); |
||||
} |
||||
return Result.OK(zyOrders); |
||||
} |
||||
/** |
||||
* 生成订单编号 |
||||
* |
||||
* @param |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "生成订单编号") |
||||
@ApiOperation(value="生成订单编号", notes="生成订单编号") |
||||
@GetMapping(value = "/getOrdersNum") |
||||
public Result<?> getOrdersNum() { |
||||
String mrstr = "000000000000000000"; |
||||
int listsize = zyOrdersService.count(); |
||||
int strsize = listsize+1; |
||||
String str = strsize+""; |
||||
int strlength = str.length(); |
||||
String substr = mrstr.substring(0,mrstr.length()-strlength); |
||||
String OrdersNum = substr+str; |
||||
return Result.OK(OrdersNum); |
||||
} |
||||
|
||||
/** |
||||
* 拆单 |
||||
* |
||||
* @param |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "拆单") |
||||
@ApiOperation(value="拆单", notes="拆单") |
||||
@GetMapping(value = "/chaidan") |
||||
public Result<?> chaidan(@RequestParam(name="id",required=true) String id,HttpServletRequest req) { |
||||
ZyOrders zyOrders = zyOrdersService.getById(id); |
||||
if(zyOrders==null) { |
||||
return Result.error("未找到对应数据"); |
||||
}else{ |
||||
ZyOrders zos = new ZyOrders(); |
||||
QueryWrapper<ZyOrders> queryWrapperzos = QueryGenerator.initQueryWrapper(zos, req.getParameterMap()); |
||||
queryWrapperzos.eq("order_id",id); |
||||
List<ZyOrders> listzos = zyOrdersService.list(queryWrapperzos); |
||||
if(listzos.size()>0){ |
||||
return Result.error("该订单已经拆分,不可以再次拆单!"); |
||||
}else{ |
||||
OrderGoods orderGoods = new OrderGoods(); |
||||
QueryWrapper<OrderGoods> queryWrapperog = QueryGenerator.initQueryWrapper(orderGoods, req.getParameterMap()); |
||||
queryWrapperog.eq("orders_id",id); |
||||
List<OrderGoods> listog = orderGoodsService.list(queryWrapperog); |
||||
if(listog.size()>0){ |
||||
for (int i = 0 ; i < listog.size() ; i++){ |
||||
ZyOrders zo = new ZyOrders(); |
||||
zo = zyOrders; |
||||
zo.setId(null); |
||||
zo.setFreight(Double.parseDouble("0")); |
||||
zo.setIschild(1); |
||||
zo.setOrderId(id); |
||||
zo.setMoney(listog.get(i).getTotalPrice()); |
||||
zo.setPromotionPrice(listog.get(i).getPromotionPrice()); |
||||
zo.setActualPayment(listog.get(i).getPayTotalPrice()); |
||||
zo.setGoodsQuantity(1); |
||||
zyOrdersService.save(zo); |
||||
OrderGoods og = new OrderGoods(); |
||||
og = listog.get(i); |
||||
og.setOrdersId(zo.getId()); |
||||
orderGoodsService.updateById(og); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
return Result.OK("成功"); |
||||
} |
||||
|
||||
/** |
||||
* 导出excel |
||||
* |
||||
* @param request |
||||
* @param zyOrders |
||||
*/ |
||||
@RequestMapping(value = "/exportXls") |
||||
public ModelAndView exportXls(HttpServletRequest request, ZyOrders zyOrders) { |
||||
return super.exportXls(request, zyOrders, ZyOrders.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, ZyOrders.class); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,206 @@ |
||||
package org.jeecg.modules.demo.zyorders.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-26 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Data |
||||
@TableName("zy_orders") |
||||
@Accessors(chain = true) |
||||
@EqualsAndHashCode(callSuper = false) |
||||
@ApiModel(value="zy_orders对象", description="订单基本信息管理") |
||||
public class ZyOrders 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, dicCode = "ischild") |
||||
@Dict(dicCode = "ischild") |
||||
@ApiModelProperty(value = "是否子单") |
||||
private java.lang.Integer ischild; |
||||
/**原订单id*/ |
||||
@Excel(name = "原订单id", width = 15) |
||||
@Dict(dictTable = "zy_orders", dicText = "orders_num", dicCode = "id") |
||||
@ApiModelProperty(value = "原订单id") |
||||
private java.lang.String orderId; |
||||
/**下单时间*/ |
||||
@Excel(name = "下单时间", width = 15, format = "yyyy-MM-dd") |
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") |
||||
@DateTimeFormat(pattern="yyyy-MM-dd") |
||||
@ApiModelProperty(value = "下单时间") |
||||
private java.util.Date orderTime; |
||||
/**订单编号*/ |
||||
@Excel(name = "订单编号", width = 15) |
||||
@ApiModelProperty(value = "订单编号") |
||||
private java.lang.String ordersNum; |
||||
/**总金额*/ |
||||
@Excel(name = "总金额", width = 15) |
||||
@ApiModelProperty(value = "总金额") |
||||
private java.lang.Double money; |
||||
/**运费*/ |
||||
@Excel(name = "运费", width = 15) |
||||
@ApiModelProperty(value = "运费") |
||||
private java.lang.Double freight; |
||||
/**促销*/ |
||||
@Excel(name = "促销", width = 15) |
||||
@ApiModelProperty(value = "促销") |
||||
private java.lang.Double promotionPrice; |
||||
/**实付款*/ |
||||
@Excel(name = "实付款", width = 15) |
||||
@ApiModelProperty(value = "实付款") |
||||
private java.lang.Double actualPayment; |
||||
/**交货期*/ |
||||
@Excel(name = "交货期", width = 15) |
||||
@ApiModelProperty(value = "交货期") |
||||
private java.lang.Integer deliveryTime; |
||||
/**订单类型*/ |
||||
@Excel(name = "订单类型", width = 15, dicCode = "orders_type") |
||||
@Dict(dicCode = "orders_type") |
||||
@ApiModelProperty(value = "订单类型") |
||||
private java.lang.Integer ordersType; |
||||
/**顾客id*/ |
||||
@Excel(name = "顾客id", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username") |
||||
@Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username") |
||||
@ApiModelProperty(value = "顾客id") |
||||
private java.lang.String userId; |
||||
/**商品条目数量*/ |
||||
@Excel(name = "商品条目数量", width = 15) |
||||
@ApiModelProperty(value = "商品条目数量") |
||||
private java.lang.Integer goodsQuantity; |
||||
/**支付方式*/ |
||||
@Excel(name = "支付方式", width = 15, dicCode = "payment_method") |
||||
@Dict(dicCode = "payment_method") |
||||
@ApiModelProperty(value = "支付方式") |
||||
private java.lang.Integer paymentMethod; |
||||
/**支付状态*/ |
||||
@Excel(name = "支付状态", width = 15, dicCode = "payment_status") |
||||
@Dict(dicCode = "payment_status") |
||||
@ApiModelProperty(value = "支付状态") |
||||
private java.lang.Integer paymentStatus; |
||||
/**账号/卡号*/ |
||||
@Excel(name = "账号/卡号", width = 15) |
||||
@ApiModelProperty(value = "账号/卡号") |
||||
private java.lang.String accountNo; |
||||
/**开户银行*/ |
||||
@Excel(name = "开户银行", width = 15) |
||||
@ApiModelProperty(value = "开户银行") |
||||
private java.lang.String bankDeposit; |
||||
/**支付时间*/ |
||||
@Excel(name = "支付时间", width = 15, format = "yyyy-MM-dd") |
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") |
||||
@DateTimeFormat(pattern="yyyy-MM-dd") |
||||
@ApiModelProperty(value = "支付时间") |
||||
private java.util.Date paymentTime; |
||||
/**城市*/ |
||||
@Excel(name = "城市", width = 15) |
||||
@ApiModelProperty(value = "城市") |
||||
private java.lang.String cityId; |
||||
/**地址*/ |
||||
@Excel(name = "地址", width = 15) |
||||
@ApiModelProperty(value = "地址") |
||||
private java.lang.String address; |
||||
/**邮编*/ |
||||
@Excel(name = "邮编", width = 15) |
||||
@ApiModelProperty(value = "邮编") |
||||
private java.lang.String zipCode; |
||||
/**收货人*/ |
||||
@Excel(name = "收货人", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username") |
||||
@Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username") |
||||
@ApiModelProperty(value = "收货人") |
||||
private java.lang.String receiver; |
||||
/**联系电话*/ |
||||
@Excel(name = "联系电话", width = 15) |
||||
@ApiModelProperty(value = "联系电话") |
||||
private java.lang.String mobile; |
||||
/**发票客户类型*/ |
||||
@Excel(name = "发票客户类型", width = 15, dicCode = "invoice_customer_type") |
||||
@Dict(dicCode = "invoice_customer_type") |
||||
@ApiModelProperty(value = "发票客户类型") |
||||
private java.lang.Integer invoiceCustomerType; |
||||
/**发票类型*/ |
||||
@Excel(name = "发票类型", width = 15, dicCode = "invoice_type") |
||||
@Dict(dicCode = "invoice_type") |
||||
@ApiModelProperty(value = "发票类型") |
||||
private java.lang.Integer invoiceType; |
||||
/**纳税人识别号*/ |
||||
@Excel(name = "纳税人识别号", width = 15) |
||||
@ApiModelProperty(value = "纳税人识别号") |
||||
private java.lang.String taxIdentificationNumber; |
||||
/**开票地址*/ |
||||
@Excel(name = "开票地址", width = 15) |
||||
@ApiModelProperty(value = "开票地址") |
||||
private java.lang.String addressBilling; |
||||
/**电话*/ |
||||
@Excel(name = "电话", width = 15) |
||||
@ApiModelProperty(value = "电话") |
||||
private java.lang.String telephone; |
||||
/**公户开户行*/ |
||||
@Excel(name = "公户开户行", width = 15) |
||||
@ApiModelProperty(value = "公户开户行") |
||||
private java.lang.String bankPublic; |
||||
/**公户账号*/ |
||||
@Excel(name = "公户账号", width = 15) |
||||
@ApiModelProperty(value = "公户账号") |
||||
private java.lang.String accountNumber; |
||||
/**销售门店*/ |
||||
@Excel(name = "销售门店", width = 15, dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") |
||||
@Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") |
||||
@ApiModelProperty(value = "销售门店") |
||||
private java.lang.String salesEnterpriseId; |
||||
/**销售员*/ |
||||
@Excel(name = "销售员", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username") |
||||
@Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username") |
||||
@ApiModelProperty(value = "销售员") |
||||
private java.lang.String salespersonId; |
||||
/**物流企业*/ |
||||
@Excel(name = "物流企业", width = 15, dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") |
||||
@Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") |
||||
@ApiModelProperty(value = "物流企业") |
||||
private java.lang.String logisticsEnterprisesId; |
||||
/**交付状态*/ |
||||
@Excel(name = "交付状态", width = 15, dicCode = "delivery_status") |
||||
@Dict(dicCode = "delivery_status") |
||||
@ApiModelProperty(value = "交付状态") |
||||
private java.lang.Integer deliveryStatus; |
||||
} |
@ -0,0 +1,17 @@ |
||||
package org.jeecg.modules.demo.zyorders.mapper; |
||||
|
||||
import java.util.List; |
||||
|
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.jeecg.modules.demo.zyorders.entity.ZyOrders; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
||||
/** |
||||
* @Description: 订单基本信息管理 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2022-12-26 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface ZyOrdersMapper extends BaseMapper<ZyOrders> { |
||||
|
||||
} |
@ -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.zyorders.mapper.ZyOrdersMapper"> |
||||
|
||||
</mapper> |
@ -0,0 +1,14 @@ |
||||
package org.jeecg.modules.demo.zyorders.service; |
||||
|
||||
import org.jeecg.modules.demo.zyorders.entity.ZyOrders; |
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
||||
/** |
||||
* @Description: 订单基本信息管理 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2022-12-26 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface IZyOrdersService extends IService<ZyOrders> { |
||||
|
||||
} |
@ -0,0 +1,19 @@ |
||||
package org.jeecg.modules.demo.zyorders.service.impl; |
||||
|
||||
import org.jeecg.modules.demo.zyorders.entity.ZyOrders; |
||||
import org.jeecg.modules.demo.zyorders.mapper.ZyOrdersMapper; |
||||
import org.jeecg.modules.demo.zyorders.service.IZyOrdersService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
||||
/** |
||||
* @Description: 订单基本信息管理 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2022-12-26 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Service |
||||
public class ZyOrdersServiceImpl extends ServiceImpl<ZyOrdersMapper, ZyOrders> implements IZyOrdersService { |
||||
|
||||
} |
Loading…
Reference in new issue