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. 4
      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 @click="handleEdit(record)">编辑</a>
<a-divider type="vertical" /> <a-divider type="vertical" />
<a-dropdown> <!-- <a-dropdown>
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a> <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
<a-menu slot="overlay"> <a-menu slot="overlay">
<a-menu-item> <a-menu-item>-->
<a @click="handleAddChild(record)">添加下级</a> <a @click="handleAddChild(record)">添加下级</a>
</a-menu-item> <a-divider type="vertical" />
<a-menu-item> <!-- </a-menu-item>
<a-menu-item>-->
<a-popconfirm title="确定删除吗?" @confirm="() => handleDeleteNode(record.id)" placement="topLeft"> <a-popconfirm title="确定删除吗?" @confirm="() => handleDeleteNode(record.id)" placement="topLeft">
<a>删除</a> <a>删除</a>
</a-popconfirm> </a-popconfirm>
</a-menu-item> <!--</a-menu-item>
</a-menu> </a-menu>
</a-dropdown> </a-dropdown>-->
</span> </span>
</a-table> </a-table>

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

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

@ -118,10 +118,14 @@ public class CustomerShoppingCartController extends JeecgController<CustomerShop
@ApiOperation(value="购物车-添加", notes="购物车-添加") @ApiOperation(value="购物车-添加", notes="购物车-添加")
@PostMapping(value = "/add") @PostMapping(value = "/add")
public Result<?> add(@RequestBody CustomerShoppingCart customerShoppingCart) { public Result<?> add(@RequestBody CustomerShoppingCart customerShoppingCart) {
if(customerShoppingCart.getPrice()==null){
return Result.error("商品无单价");
} else {
customerShoppingCart.setZj(customerShoppingCart.getNumber() * customerShoppingCart.getPrice()); customerShoppingCart.setZj(customerShoppingCart.getNumber() * customerShoppingCart.getPrice());
customerShoppingCartService.save(customerShoppingCart); customerShoppingCartService.save(customerShoppingCart);
return Result.OK("添加成功!"); return Result.OK("添加成功!");
} }
}
/** /**
* 编辑 * 编辑

Loading…
Cancel
Save