zhc4dev
wangjiadong 2 years ago
parent fdf877fd4b
commit b0abb05cae
  1. 62
      ant-design-vue-jeecg/src/views/customershoppingcart/admin/CustomerShoppingCartList.vue
  2. 66
      ant-design-vue-jeecg/src/views/customershoppingcart/admin/modules/CustomerShoppingCartForm.vue
  3. 2
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customershoppingcart/controller/CustomerShoppingCartController.java
  4. 69
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customershoppingcart/entity/CustomerShoppingCart.java

@ -88,22 +88,26 @@
</template>
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
<!--<a @click="handleEdit(record)">编辑</a>-->
<a-divider type="vertical" />
<a-dropdown>
<!-- <a-dropdown>
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
<a-menu slot="overlay">
<a-menu-item>
<a-menu-item>-->
<a @click="handleDetail(record)">购买</a>
<a-divider type="vertical" />
<a @click="handleDetail(record)">详情</a>
</a-menu-item>
<a-menu-item>
<a-divider type="vertical" />
<a @click="spxq(record)">商品详情</a>
<a-divider type="vertical" />
<!-- </a-menu-item>
<a-menu-item>-->
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</a-menu-item>
<!--</a-menu-item>
</a-menu>
</a-dropdown>
</a-dropdown>-->
</span>
</a-table>
@ -114,13 +118,14 @@
</div>
<!-- <zy-goods-form ref="ZyGoodsForm" @ok="modalFormOk"></zy-goods-form>-->
<customer-shopping-cart-modal ref="modalForm" @ok="modalFormOk"></customer-shopping-cart-modal>
</a-card>
</template>
<script>
import ZyGoodsForm from './modules/ZyGoodsForm'
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
@ -132,7 +137,8 @@
name: 'CustomerShoppingCartList',
mixins:[JeecgListMixin, mixinDevice],
components: {
CustomerShoppingCartModal
CustomerShoppingCartModal,
ZyGoodsForm
},
data () {
return {
@ -163,14 +169,25 @@
dataIndex: 'createTime'
},
{
title:'用户',
title:'商品',
align:"center",
dataIndex: 'userId_dictText'
dataIndex: 'goodsId_dictText'
},
{
title:'商品',
align:"center",
dataIndex: 'goodsId_dictText'
dataIndex: 'goodsname'
},
/*{
title:'图片',
align:"center",
dataIndex: 'goodimg',
scopedSlots: {customRender: 'imgSlot'}
},*/
{
title:'款式',
align:"center",
dataIndex: 'styleId_dictText'
},
{
title:'当前单价',
@ -182,6 +199,16 @@
align:"center",
dataIndex: 'number'
},
{
title:'发货地址',
align:"center",
dataIndex: 'placeorigin'
},
{
title:'总价',
align:"center",
dataIndex: 'zj'
},
{
title: '操作',
dataIndex: 'action',
@ -212,6 +239,12 @@
},
},
methods: {
spxq(record){
this.$ref.ZyGoodsForm.edit(record);
this.$ref.ZyGoodsForm.title = "测试页面";
this.$ref.ZyGoodsForm.disableSubmit = false;
},
onSelectChange(selectedRowKeys) {
this.selectedRowKeys = selectedRowKeys
},
@ -230,9 +263,6 @@
}
}
},
initDictConfig(){
},

@ -3,22 +3,22 @@
<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="temiimg">
<j-image-upload isMultiple v-model="model.temiimg" ></j-image-upload>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="创建日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="createTime">
<j-date placeholder="请选择创建日期" v-model="model.createTime" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" disabled/>
</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 label="用户" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="username">
<j-popup
v-model="model.username"
field="username"
org-fields="id,realname"
dest-fields="userId,username"
code="findcust"
:multi="true"
@input="popupCallback"
/>
</a-form-model-item>
</a-col>
<a-col :span="24">
@ -27,41 +27,53 @@
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="当前单价" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="price">
<a-input-number v-model="model.price" placeholder="请输入当前单价" style="width: 100%" />
<a-form-model-item label="商品" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="goodsname">
<j-popup
v-model="model.goodsname"
field="goodsname"
org-fields="id,goods_name,style_id,unit_price,place_origin,default_picture"
dest-fields="goodsId,goodsname,styleId,price,placeorigin,goodimg"
code="findgoods2"
:multi="true"
@input="popupCallback"
/>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="number">
<a-input-number v-model="model.number" placeholder="请输入数量" style="width: 100%" />
<a-form-model-item label="图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="goodimg">
<j-image-upload isMultiple v-model="model.goodimg" ></j-image-upload>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="面料" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="temp1">
<a-input v-model="model.temp1" placeholder="请输入面料" ></a-input>
<a-form-model-item label="款式" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="styleId">
<j-search-select-tag v-model="model.styleId" dict="zy_cloths_style,type_name,id" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="发货地" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="temp2">
<a-input v-model="model.temp2" placeholder="请输入中间字段临时存储" disabled></a-input>
<a-form-model-item label="当前单价" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="price">
<a-input-number v-model="model.price" placeholder="请输入当前单价" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="number">
<a-input-number v-model="model.number" placeholder="请输入数量" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="中间字段临时存储" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="temp3">
<a-input v-model="model.temp3" placeholder="发货地" disabled ></a-input>
<a-form-model-item label="发货地址" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="placeorigin">
<a-input v-model="model.placeorigin" placeholder="请输入发货地" ></a-input>
</a-form-model-item>
</a-col>
<!-- <a-col :span="24">
<a-form-model-item label="中间字段临时存储" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="temp4">
<a-input v-model="model.temp4" placeholder="请输入中间字段临时存储" ></a-input>
<a-col :span="24">
<a-form-model-item label="总价" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="zj">
<a-input-number v-model="model.zj" placeholder="请输入总价" style="width: 100%" />
</a-form-model-item>
</a-col>-->
</a-col>
</a-row>
</a-form-model>
</j-form-container>
</a-spin>
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
@ -93,6 +105,10 @@
},
confirmLoading: false,
validatorRules: {
number: [
{pattern: /^\d*\$/,message:'请输入大于0的数'},
],
},
url: {
add: "/customershoppingcart/customerShoppingCart/add",

@ -118,6 +118,7 @@ public class CustomerShoppingCartController extends JeecgController<CustomerShop
@ApiOperation(value="购物车-添加", notes="购物车-添加")
@PostMapping(value = "/add")
public Result<?> add(@RequestBody CustomerShoppingCart customerShoppingCart) {
customerShoppingCart.setZj(customerShoppingCart.getNumber() * customerShoppingCart.getPrice());
customerShoppingCartService.save(customerShoppingCart);
return Result.OK("添加成功!");
}
@ -132,6 +133,7 @@ public class CustomerShoppingCartController extends JeecgController<CustomerShop
@ApiOperation(value="购物车-编辑", notes="购物车-编辑")
@PutMapping(value = "/edit")
public Result<?> edit(@RequestBody CustomerShoppingCart customerShoppingCart) {
customerShoppingCart.setZj(customerShoppingCart.getNumber() * customerShoppingCart.getPrice());
customerShoppingCartService.updateById(customerShoppingCart);
return Result.OK("编辑成功!");
}

@ -36,62 +36,67 @@ public class CustomerShoppingCart implements Serializable {
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private String id;
private java.lang.String id;
/**创建人*/
@ApiModelProperty(value = "创建人")
private String createBy;
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 Date createTime;
private java.util.Date createTime;
/**更新人*/
@ApiModelProperty(value = "更新人")
private String updateBy;
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 Date updateTime;
private java.util.Date updateTime;
/**所属部门*/
@ApiModelProperty(value = "所属部门")
private String sysOrgCode;
private java.lang.String sysOrgCode;
/**用户*/
@Excel(name = "用户", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username")
@Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username")
@Excel(name = "用户", width = 15)
@ApiModelProperty(value = "用户")
private String userId;
private java.lang.String userId;
/**用户*/
@Excel(name = "用户", width = 15)
@ApiModelProperty(value = "用户")
private java.lang.String username;
/**商品*/
@Excel(name = "商品", width = 15, dictTable = "zy_goods", dicText = "goods_name", dicCode = "id")
@Dict(dictTable = "zy_goods", dicText = "goods_name", dicCode = "id")
@ApiModelProperty(value = "商品")
private String goodsId;
private java.lang.String goodsId;
/**商品*/
@Excel(name = "商品", width = 15)
@ApiModelProperty(value = "商品")
private java.lang.String goodsname;
/**图片*/
@Excel(name = "图片", width = 15)
@ApiModelProperty(value = "图片")
private java.lang.String goodimg;
/**款式*/
@Excel(name = "款式", width = 15)
@ApiModelProperty(value = "款式")
private java.lang.String styleId;
/**当前单价*/
@Excel(name = "当前单价", width = 15)
@ApiModelProperty(value = "当前单价")
private Double price;
private java.lang.Double price;
/**数量*/
@Excel(name = "数量", width = 15)
@ApiModelProperty(value = "数量")
private Integer number;
/**中间字段临时存储*/
@Excel(name = "中间字段临时存储", width = 15)
@ApiModelProperty(value = "中间字段临时存储")
private String temp1;
/**中间字段临时存储*/
@Excel(name = "中间字段临时存储", width = 15)
@ApiModelProperty(value = "中间字段临时存储")
private String temp2;
/**中间字段临时存储*/
@Excel(name = "中间字段临时存储", width = 15)
@ApiModelProperty(value = "中间字段临时存储")
private String temp3;
/**中间字段临时存储*/
@Excel(name = "中间字段临时存储", width = 15)
@ApiModelProperty(value = "中间字段临时存储")
private String temp4;
/**图片字段*/
@Excel(name = "图片字段", width = 15)
@ApiModelProperty(value = "图片字段")
private String temiimg;
private java.lang.Integer number;
/**发货地址*/
@Excel(name = "发货地址", width = 15)
@ApiModelProperty(value = "发货地址")
private java.lang.String placeorigin;
/**总价*/
@Excel(name = "总价", width = 15)
@ApiModelProperty(value = "总价")
private java.lang.Double zj;
}

Loading…
Cancel
Save