zhc4dev
wangjiadong 2 years ago
parent cacb1dc68b
commit 4596b749d9
  1. 13
      ant-design-vue-jeecg/src/views/collecttype/admin/CollectTypeList.vue
  2. 10
      ant-design-vue-jeecg/src/views/customercollectgoods/admin/modules/CustomercollectgoodsForm.vue
  3. 26
      ant-design-vue-jeecg/src/views/customershoppingcart/admin/modules/CustomerShoppingCartForm.vue
  4. 10
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customershoppingcart/controller/CustomerShoppingCartController.java

@ -84,19 +84,20 @@
<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="handleAddChild(record)">添加下级</a>
</a-menu-item>
<a-menu-item>
<a-divider type="vertical" />
<!-- </a-menu-item>
<a-menu-item>-->
<a-popconfirm title="确定删除吗?" @confirm="() => handleDeleteNode(record.id)" placement="topLeft">
<a>删除</a>
</a-popconfirm>
</a-menu-item>
<!--</a-menu-item>
</a-menu>
</a-dropdown>
</a-dropdown>-->
</span>
</a-table>

@ -3,7 +3,7 @@
<j-form-container :disabled="formDisabled">
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<a-row>
<a-col :span="24">
<a-col :span="24" >
<a-form-model-item label="用户" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="username">
<j-popup
v-model="model.username"
@ -29,12 +29,12 @@
/>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-col :span="24" v-if="false">
<a-form-model-item label="当前单价" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="price">
<a-input v-model="model.price" placeholder="请输入当前单价" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-col :span="24" v-if="false">
<a-form-model-item label="收藏夹" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="collectTypeId">
<j-search-select-tag v-model="model.collectTypeId" dict="collect_type,collect_type_name,id" />
</a-form-model-item>
@ -76,6 +76,10 @@
},
confirmLoading: false,
validatorRules: {
goodsname: [
{ required: true, message: '请输入商品!'},
],
},
url: {
add: "/customercollectgoods/customercollectgoods/add",

@ -21,7 +21,7 @@
/>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-col :span="24" v-if="false">
<a-form-model-item label="商品" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="goodsId">
<j-search-select-tag v-model="model.goodsId" dict="zy_goods,goods_name,id" />
</a-form-model-item>
@ -41,17 +41,17 @@
</a-col>
<a-col :span="24">
<a-form-model-item label="图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="goodimg">
<j-image-upload isMultiple v-model="model.goodimg" ></j-image-upload>
<j-image-upload isMultiple v-model="model.goodimg" disabled></j-image-upload>
</a-form-model-item>
</a-col>
<a-col :span="24">
<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" />
<j-search-select-tag v-model="model.styleId" dict="zy_cloths_style,type_name,id" disabled/>
</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-input-number v-model="model.price" placeholder="请输入当前单价" style="width: 100%" disabled/>
</a-form-model-item>
</a-col>
<a-col :span="24">
@ -61,12 +61,12 @@
</a-col>
<a-col :span="24">
<a-form-model-item label="发货地址" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="placeorigin">
<a-input v-model="model.placeorigin" placeholder="请输入发货地址" ></a-input>
<a-input v-model="model.placeorigin" placeholder="请输入发货地址" disabled></a-input>
</a-form-model-item>
</a-col>
<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-input-number v-model="model.zj" placeholder="请输入总价" style="width: 100%" disabled/>
</a-form-model-item>
</a-col>
</a-row>
@ -74,6 +74,7 @@
</j-form-container>
</a-spin>
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
@ -105,9 +106,15 @@
},
confirmLoading: false,
validatorRules: {
username: [
{ required: true, message: '请输入用户!'},
],
goodsname: [
{ required: true, message: '请输入商品!'},
],
number: [
{pattern: /^\d*\$/,message:'请输入大于0的数'},
{ required: true, message: '请输入数量!'},
{pattern: /^\d*$/,message:'请输入大于0的数'}
],
},
url: {
@ -163,6 +170,9 @@
})
},
popupCallback(value,row){
this.model = Object.assign(this.model, row);
},
}
}
</script>

@ -118,9 +118,13 @@ 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("添加成功!");
if(customerShoppingCart.getPrice()==null){
return Result.error("商品无单价");
} else {
customerShoppingCart.setZj(customerShoppingCart.getNumber() * customerShoppingCart.getPrice());
customerShoppingCartService.save(customerShoppingCart);
return Result.OK("添加成功!");
}
}
/**

Loading…
Cancel
Save