前台和后台

<template>
	<div>
		<h1 align="center">SpringBoot阶段机试,ts={{ts}}</h1>
		<el-form :inline="true" :model="formInline" class="demo-form-inline">
			<el-form-item label="客户名称">
				<el-input v-model="formInline.name" placeholder="客户名称" clearable></el-input>
			</el-form-item>

			<el-form-item>
				<el-button type="primary" @click="getList()">查询</el-button>
				<el-button type="primary" @click="handleAdd()">添加</el-button>
			</el-form-item>
		</el-form>
		<el-table :data="tableData" style="width: 100%">
			<el-table-column prop="id" label="编号" width="180"></el-table-column>
			<el-table-column prop="name" label="名称" width="180"></el-table-column>
			<el-table-column prop="phone" label="电话" width="180"></el-table-column>
			<el-table-column prop="addr" label="地址" width="180"></el-table-column>
			<el-table-column label="操作">
				<template slot-scope="scope">
					<el-button size="mini" @click="handleLook(scope.row)">查看</el-button>
					<el-button size="mini" @click="handleUpdate(scope.row)">修改</el-button>
					<el-button size="mini" type="danger" @click="handleDel(scope.row.id)">删除</el-button>
				</template>
			</el-table-column>
		</el-table>


		<el-dialog :title="title" :visible.sync="dialogFormVisible" :close-on-click-modal="false">
			<el-form :model="form" :rules="rules" ref="form">
				<el-form-item label="客户名称" :label-width="formLabelWidth" prop="name">
					<el-input v-model="form.name" autocomplete="off"></el-input>
				</el-form-item>
				<el-form-item label="联系号码" :label-width="formLabelWidth" prop="phone">
					<el-input v-model="form.phone" autocomplete="off"></el-input>
				</el-form-item>
				<el-form-item label="联系地址" :label-width="formLabelWidth" prop="addr">
					<el-input type="textarea" :rows="2" placeholder="请输入地址" v-model="form.addr" autocomplete="off">
					</el-input>
				</el-form-item>
			</el-form>
			<div slot="footer" class="dialog-footer">
				<el-button @click="dialogFormVisible = false">取 消</el-button>
				<el-button type="primary" @click="submitForm('form')">确 定</el-button>
			</div>
		</el-dialog>
		
		<!-- 查看 -->
		<el-dialog :title="title" :visible.sync="dialogFormVisible1" :close-on-click-modal="false">
			<el-form :model="form" :rules="rules" ref="form">
				<el-form-item label="客户名称" :label-width="formLabelWidth" prop="name">
					<el-input v-model="form.name" autocomplete="off" :disabled="true"></el-input>
				</el-form-item>
				<el-form-item label="联系号码" :label-width="formLabelWidth" prop="phone">
					<el-input v-model="form.phone" autocomplete="off" :disabled="true"></el-input>
				</el-form-item>
				<el-form-item label="联系地址" :label-width="formLabelWidth" prop="addr">
					<el-input type="textarea" :rows="2" placeholder="请输入地址" v-model="form.addr" autocomplete="off" :disabled="true">
					</el-input>
				</el-form-item>
			</el-form>
			<div slot="footer" class="dialog-footer">
				<el-button @click="dialogFormVisible = false">取 消</el-button>
				<el-button type="primary" @click="submitForm('form')">确 定</el-button>
			</div>
		</el-dialog>


	</div>
</template>

<script>
	export default {
		data: function() {
			return {
				ts: new Date().getTime(),
				formInline: {
					name: '',
				},
				tableData: [],
				dialogFormVisible: false,
				dialogFormVisible1: false,
				form: {
					name: '',
					phone: '',
					addr: '',
				},
				formLabelWidth: '120px',
				title: '',
				textarea: '',
				rules: {
					name: [{
							required: true,
							message: '请输入客户名称',
							trigger: 'blur'
						},
						{
							min: 2,
							max: 10,
							message: '长度在 2 到 10 个字符',
							trigger: 'blur'
						}
					],
					phone: [{
							required: true,
							message: '请输入联系电话',
							trigger: 'blur'
						},
						{
							min: 8,
							max: 11,
							message: '请输入 8 到 11 位数字',
							trigger: 'blur'
						}
					],
					addr: [{
						required: true,
						message: '请输入地址',
						trigger: 'blur'
					}],
				}
			};
		},
		methods: {
			onSubmit() {
				console.log('submit!');
			},
			getList() {
				let url = this.axios.urls.CUSTOMER_LIST;
				let data = this.formInline;
				this.axios.post(url, data).then(resp => {
					this.tableData = resp.data;
				});
			},
			handleAdd() {
				this.title = '添加客户';
				this.form.name = '';
				this.form.phone = '';
				this.form.addr = '';
				this.dialogFormVisible = true;
			},
			handleUpdate(row) {
				this.title = '修改客户';
				this.form = row;
				this.dialogFormVisible = true;
				this.bian = false;
			},
			handleLook(row) {
				this.title = '查看客户';
				this.form = row;
				this.dialogFormVisible1 = true;
				this.bian = false;
			},
			handleDel(id){
				this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
				          confirmButtonText: '确定',
				          cancelButtonText: '取消',
				          type: 'warning'
				        }).then(() => {
							
							let url=this.axios.urls.CUSTOMER_DEL;
							let data={id:id};
							this.axios.post(url,data).then(res=>{
									
								if(res.data.code==0){
									this.$message({
									  type: 'success',
									  message: '删除成功!'
									});
									this.getList();
								}else{
									this.$message({
									  type: 'success',
									  message: '删除失败!'
									});
								}
							});
				         
				        }).catch(() => {
				          this.$message({
				            type: 'info',
				            message: '已取消删除'
				          });          
				        });
			},
			submitForm(formName) {
				this.$refs[formName].validate((valid) => {
					if (valid) {
						// alert('submit!');
						if (this.title == "添加客户") {
							//添加功能
							let url = this.axios.urls.CUSTOMER_ADD;
							let data = this.form;
							this.axios.post(url, data).then(res => {
								if (res.data.code == 0) {
									this.$message("添加成功!!!");
									this.getList();
								}
							});
						} else {
							//修改功能
							let url = this.axios.urls.CUSTOMER_UPDATE;
							let data = this.form;
							this.axios.post(url, data).then(res => {
								if (res.data.succes) {
									alert("修改失败");
									this.getList();
								}
							});
						}
						this.dialogFormVisible = false;
					} else {
						console.log('error submit!!');
						return false;
					}
				});
			}
		},
		created() {
			this.getList();
		},
	}
</script>

<style>
</style>

前台

package com.zking.spboot.controller;

import com.zking.spboot.model.Customer;
import com.zking.spboot.service.CustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@CrossOrigin
@RestController
@RequestMapping("/customer")
public class CustomerController {

    @Autowired
    private CustomerService customerService;

    @RequestMapping("/list")
    public List<Customer> list(Customer customer){
    List<Customer> customerslist=customerService.list(customer);
    return customerslist;
    }

    @RequestMapping("/add")
    public Object add(Customer customer){
        Map<String,Object> res=new HashMap<>();
        customerService.insert(customer);
        res.put("code","0");
        res.put("msg","增加成功");
        return res;
    }


    @RequestMapping("/del")
    public Object del(Integer id){
        Map<String,Object> res=new HashMap<>();
        customerService.deleteByPrimaryKey(id);
        res.put("code","0");
        res.put("msg","删除成功");
        return res;
    }

    @RequestMapping("/update")
    public boolean update(Customer customer){
        int i=customerService.updateByPrimaryKeySelective(customer);
        if(i>0){
            return  true;
        }
        else {
            return false;
        }
    }


    @RequestMapping("/look")
    public Customer look(Integer id){
       Customer look=customerService.selectByPrimaryKey(id);
        return look;
    }



}

 后台

### 回答1: SSM物流系统源码的前台后台分别指的是系统的用户界面和管理界面。 前台是指物流系统的用户界面,主要提供给物流系统的客户使用。它包含了各种用户功能模块,例如:用户注册登录、货物查询、订单管理、运输跟踪、客户反馈等。前台界面设计需要考虑用户友好性和易用性,通过简洁清晰的界面和交互设计,方便用户进行各种操作和查询。 后台是指物流系统的管理界面,主要提供给物流系统的管理员使用。它包含了各种管理功能模块,例如:用户管理、订单管理、运输管理、仓储管理、财务管理等。后台界面设计需要考虑系统的管理需求,通过清晰的界面和功能设计,方便管理员对系统进行各种操作和管理。 SSM物流系统源码的前台后台开发涉及到前端技术和后端技术的应用。前台界面开发需要使用HTML、CSS、JavaScript等前端技术,后台功能开发需要使用Java语言和基于Spring、SpringMVC、MyBatis等开发框架进行后台开发。同时,为了保证系统的稳定性和安全性,还需要考虑数据库设计和优化,使用MySQL等数据库进行数据存储和管理。 综上所述,SSM物流系统源码的前台后台分别支持物流系统的用户和管理员的需求,通过前端和后端技术的应用实现了用户功能和管理功能的设计和开发。 ### 回答2: SSM物流系统源码是一个基于SSM(Spring+SpringMVC+MyBatis)框架开发的物流管理系统的代码。该系统分为前台后台两个部分。 前台部分是系统的用户界面,主要提供给客户进行物流查询、下单、支付等操作。用户可以通过在系统中输入快递单号进行查询物流信息,也可以在系统中下单并选择支付方式进行付款。前台界面一般会包括首页、物流查询页、下单页、支付页等。 后台部分是系统的管理界面,主要提供给物流公司的员工进行物流管理、订单处理等操作。管理员可以通过后台界面查看物流订单、处理客户的退款申请、管理物流人员等。后台界面一般会包括登录页、订单管理页、退款处理页、物流人员管理页等。 SSM物流系统源码的前台后台部分,都使用了SSM框架进行开发,充分利用了Spring提供的依赖注入、事务管理等特性,SpringMVC提供的MVC模式和控制器、视图的分离,以及MyBatis提供的持久层对象与数据库的映射。这样可以使代码简洁、易于维护,并且提供了高度的灵活性和可扩展性。 总之,SSM物流系统源码的前台后台部分分别满足了客户和物流公司的不同需求,通过前台提供物流查询和下单服务,后台提供订单管理和物流人员管理功能,实现了一个完整的物流管理系统。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值