又一次小改

master
cxy 12 hours ago
parent 748b0784a0
commit 34523dcde2

@ -0,0 +1,49 @@
/*
Navicat MySQL Data Transfer
Source Server : cxy
Source Server Version : 80200
Source Host : localhost:3306
Source Database : express_management
Target Server Type : MYSQL
Target Server Version : 80200
File Encoding : 65001
Date: 2024-11-23 21:42:21
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for express_info
-- ----------------------------
DROP TABLE IF EXISTS `express_info`;
CREATE TABLE `express_info` (
`id` int NOT NULL,
`expressId` varchar(50) NOT NULL,
`sename` varchar(20) NOT NULL,
`sephone` varchar(15) NOT NULL,
`seaddress` varchar(100) NOT NULL,
`rename` varchar(20) NOT NULL,
`rephone` varchar(15) NOT NULL,
`readdress` varchar(100) NOT NULL,
`issigned` tinyint(1) NOT NULL,
`signtime` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`id` int unsigned NOT NULL AUTO_INCREMENT,
`username` varchar(20) NOT NULL,
`password` varchar(32) NOT NULL,
`nickname` varchar(10) DEFAULT NULL,
`isCourier` tinyint(1) NOT NULL DEFAULT '0',
`create_time` datetime DEFAULT NULL,
`update_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

@ -139,14 +139,14 @@ onMounted(() => {
<style scoped>
.sf-city-services {
font-family: 'Helvetica Neue', Arial, sans-serif;
background-color: #f5f5f5;
background-color: #ede3e7;
min-height: 100vh;
display: flex;
flex-direction: column;
}
.header {
background-color: cyan;
background-color: #5cb3cc;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
padding: 10px 0;
display: flex;

@ -1,5 +1,3 @@
<template>
<el-container class="layout-container">
<!-- 左侧菜单 -->
@ -26,7 +24,7 @@
</el-icon>
<span>个人中心</span>
</template>
<el-menu-item index="/userInfo">
<el-menu-item index="/user/userInfo">
<el-icon>
<User/>
</el-icon>
@ -86,10 +84,10 @@ import {
} from '@element-plus/icons-vue'
import avatar from '@/assets/default.png'
import {userInfoService} from "@/api/user";
import {useUserInfoStore} from "@/stores/userInfo";
import {useUserInfoStore} from "@/store/userInfo";
import {useRouter} from "vue-router";
import {ElMessage, ElMessageBox} from "element-plus";
import {useTokenStore} from "@/stores/token";
import {useTokenStore} from "@/store/token";
const userInfoStore = useUserInfoStore();
const getUserInfo = async () => {
@ -127,13 +125,14 @@ const handleCommand = (command) => {
<style lang="scss" scoped>
.layout-container {
height: 100vh;
background-color: #f5f5f5;
.el-aside {
background-color: #ccccd6;
&__logo {
height: 120px;
background: url('/logo.png') no-repeat center / 120px auto;
background: url('/zy.jpg') no-repeat center / 120px auto;
}
.el-menu {
@ -168,7 +167,7 @@ const handleCommand = (command) => {
align-items: center;
justify-content: center;
font-size: 14px;
color: #ccccd6;
color: black;
}
}
</style>

@ -71,7 +71,7 @@ import {ref} from "vue";
import {userLoginService, userRegisterService} from "@/api/user";
import {ElMessage} from "element-plus";
import {useRouter} from "vue-router";
import {useTokenStore} from "@/stores/token";
import {useTokenStore} from "@/store/token";
// Register page and Login page use the same view.
// By default, show login.

@ -15,7 +15,7 @@
<el-input v-model="form.senderName" placeholder="请填写发件人姓名"></el-input>
</el-form-item>
<el-form-item label="联系电话">
<el-input placeholder="请填写发件人联系电话"></el-input>
<el-input v-model="form.senderPhone" placeholder="请填写发件人联系电话"></el-input>
</el-form-item>
<el-form-item label="省市区" >
<el-input v-model="form.senderCity" placeholder="请填写发件人省市区"></el-input>
@ -46,7 +46,7 @@
<el-input v-model="form.receiverName" placeholder="请填写收件人姓名"></el-input>
</el-form-item>
<el-form-item label="联系电话" >
<el-input placeholder="请填写收件人联系电话"></el-input>
<el-input v-model="form.receiverPhone" placeholder="请填写收件人联系电话"></el-input>
</el-form-item>
<el-form-item label="省市区" >
<el-input v-model="form.receiverCity" placeholder="请填写收件人省市区"></el-input>
@ -79,39 +79,28 @@
<script setup>
import { reactive,ref } from 'vue';
import { ElMessage } from 'element-plus';
import {expressStore} from "@/stores/express.js";
import {expressStore} from "@/store/express.js";
const store = expressStore();
const sendType = ref(0); //
const form = reactive({
"express_no": "SF1234567890",
"senderName": "",
"senderPhone": "",
"senderCity": "",
"receiverName": "",
"receiverPhone": "",
"receiverCity": "",
"s_datetime": " 2024-11-11 11:11:11"
"s_datetime": new Date().toISOString().slice(0, 19).replace('T', ' ')
})
const confirmOrder =() => {
const currentExpressNo = parseInt(form.express_no.replace('SF', ''));
form.express_no = "SF" + (currentExpressNo + 1).toString();
store.add(form);
ElMessage({
message: '下单成功!',
type:'success'
})
}
//
const resetForm = () => {
form.value = {
name: '',
phone: '',
address: {
region: '',
detail: ''
},
company: ''
};
};
</script>

@ -2,21 +2,23 @@
<el-row class="page">
<el-row class="block-view" v-for="(item,index) in expressList">
<el-row class="top">
<el-row>运单号 {{item.express_no}}}</el-row>
<el-row class="top-time">签收时间 {{item.s_datetime}}}</el-row>
<el-row>运单号 {{item.express_no}}</el-row>
<el-row class="top-time">签收时间 {{item.s_datetime}}</el-row>
</el-row>
<el-row class="express-view">
<el-row class="express-no-view">
<el-text class="city">{{item.senderCity}}}</el-text>
<el-text class="user">{{item.senderName}}}</el-text>
<el-text class="city">寄件地址 {{item.senderCity}}</el-text>
<el-text class="user">寄件人{{item.senderName}}</el-text>
<el-text class="phone">联系电话 {{item.senderPhone}}</el-text>
</el-row>
<el-row class="express-no-view">
<el-image class="arrow" src="/arrow.png"></el-image>
<el-text class="sign">已签收</el-text>
</el-row>
<el-row class="express-no-view">
<el-text class="city">{{item.receiverCity}}}</el-text>
<el-text class="user">{{item.receiverName}}}</el-text>
<el-text class="city">收件地址 {{item.receiverCity}}</el-text>
<el-text class="user">收件人{{item.receiverName}}</el-text>
<el-text class="phone">联系电话 {{item.receiverPhone}}</el-text>
</el-row>
<el-row class="express-icon-view">
<el-icon @click=" deleteByIndex(index)"><Delete /></el-icon>
@ -38,19 +40,25 @@
</el-dialog>
<el-dialog v-model=" dialogFormVisible" title="修改快递信息" width=" 500">
<el-form :model=" form">
<el-form :model="form">
<el-form-item label=" 寄送城市" :label-width=" formLabelWidth">
<el-input v-model=" form.senderCity" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label=" 寄送人" :label-width=" formLabelWidth">
<el-input v-model=" form.senderName" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label=" 寄送电话" :label-width=" formLabelWidth">
<el-input v-model=" form.senderPhone" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label=" 收件城市" :label-width=" formLabelWidth">
<el-input v-model=" form.receiverCity" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label=" 收件人" :label-width=" formLabelWidth">
<el-input v-model=" form.receiverName" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label=" 收件电话" :label-width=" formLabelWidth">
<el-input v-model=" form.receiverPhone" autocomplete="off"></el-input>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
@ -63,13 +71,14 @@
<script lang="ts"setup>
import { Delete, Edit } from '@element-plus/icons-vue'
import { reactive, ref } from 'vue'
import { ElMessage } from "element-plus";
import { expressStore } from '@/stores/express.js'
import { ElMessageBox } from "element-plus";
import { expressStore } from '@/store/express.js'
const store = expressStore()
const item = expressStore()
const { expressList } = reactive(store)
const dialogVisible = ref(false)
const handleClose = (done: () => void) => {
ElMessage.confirm('确认关闭?').then(() => {
ElMessageBox.confirm('确认关闭?').then(() => {
done()
}).catch(() => {
@ -87,12 +96,25 @@ const deleteByIndexConfirm = () => {
store.deleteByIndex(formIndex)
}
const dialogFormVisible = ref(false)
const formLabelWidth = '140px'
const form = reactive({
"express_no": '',
"senderCity": '',
"senderName": '',
"senderPhone": '',
"receiverCity": '',
"receiverName": '',
"receiverPhone": '',
"s_datetime": '',
})
const modify = (item, index) => {
dialogFormVisible.value = true
form.senderCity = item.senderCity
form.senderName = item.senderName
form.senderPhone = item.senderPhone
form.receiverCity = item.receiverCity
form.receiverName = item.receiverName
form.receiverPhone = item.receiverPhone
formIndex = index
}
@ -102,7 +124,6 @@ const modifyConfirm = () => {
store.modify(form,formIndex)
}
</script>
<style>

@ -46,7 +46,7 @@
<script setup>
import { ref } from 'vue'
import { useUserInfoStore } from "@/stores/userInfo.js";
import { useUserInfoStore } from "@/store/userInfo.js";
import { userInfoUpdateService } from "@/api/user";
import { ElMessage } from "element-plus";

@ -24,7 +24,7 @@
</template>
<script setup>
import {ref} from 'vue'
import {useUserInfoStore} from "@/stores/userInfo.js";
import {useUserInfoStore} from "@/store/userInfo.js";
import {userInfoUpdateService} from "@/api/user";
import {ElMessage} from "element-plus";

@ -28,7 +28,7 @@ const routes = [
component: Layout,
children: [
{
path: '/userInfo',
path: '/user/userInfo',
component: UserInfo
},
{

@ -0,0 +1,50 @@
import {defineStore} from 'pinia'
export const expressStore = defineStore('express', {
state: () => {
return {
expressList: [
{
express_no: '123456789',
s_datetime: '2023-10-01 10:00',
senderCity: '北京',
senderName: '张三',
senderPhone: '13800000000',
receiverCity: '上海',
receiverName: '李四',
receiverPhone: '13900000000'
},
{
express_no: '987654321',
s_datetime: '2023-10-02 11:00',
senderCity: '广州',
senderName: '王五',
senderPhone: '13700000000',
receiverCity: '深圳',
receiverName: '赵六',
receiverPhone: '13600000000'
}
]
}
},
getters: {},
actions: {
add(item) {
this.expressList.push(item)
},
modify(item, index) {
this.expressList[index] = item
},
deleteByIndex(index) {
this.expressList.splice(index, 1)
}
},
persist: {
enabled: true,
strategies: [{
key: 'express',
storage: localStorage,
paths: ['expressList']
}],
}
})

@ -1,29 +0,0 @@
import {defineStore} from 'pinia'
export const expressStore = defineStore('express', {
state: () => {
return {
expressList: [],
}
},
getters: {},
actions: {
add(item) {
this.expressList.push(item)
},
modify(item, index) {
this.expressList[index] = item
},
remove(index) {
this.expressList.splice(index, 1)
}
},
persist: {
enabled: true,
strategies: [{
key: 'express',
storage: localStorage,
path: ['express']
}],
}
})

@ -1,6 +1,6 @@
import axios from "axios";
import {ElMessage} from "element-plus";
import {useTokenStore} from "@/stores/token";
import {useTokenStore} from "@/store/token";
import router from "../router/index.js";
const instance = axios.create({baseURL: '/api'});

Loading…
Cancel
Save