Browse Source

init web

master
wangzhenglan 2 years ago
commit
f6e32cda18
  1. 3
      .browserslistrc
  2. 5
      .editorconfig
  3. 26
      .eslintrc.js
  4. 23
      .gitignore
  5. 24
      README.md
  6. 14
      babel.config.js
  7. 31693
      package-lock.json
  8. 42
      package.json
  9. BIN
      public/favicon.ico
  10. 17
      public/index.html
  11. 17
      src/App.vue
  12. 9
      src/api/home.js
  13. 148
      src/api/prouduct.js
  14. 114
      src/api/supplier.js
  15. 539
      src/assets/ali-icon/demo.css
  16. 331
      src/assets/ali-icon/demo_index.html
  17. 45
      src/assets/ali-icon/iconfont.css
  18. BIN
      src/assets/ali-icon/iconfont.eot
  19. 1
      src/assets/ali-icon/iconfont.js
  20. 58
      src/assets/ali-icon/iconfont.json
  21. 47
      src/assets/ali-icon/iconfont.svg
  22. BIN
      src/assets/ali-icon/iconfont.ttf
  23. BIN
      src/assets/ali-icon/iconfont.woff
  24. BIN
      src/assets/ali-icon/iconfont.woff2
  25. 38
      src/assets/css/global.css
  26. BIN
      src/assets/images/logo.png
  27. BIN
      src/assets/logo.png
  28. 212
      src/components/Prouduct/InventoryAdd.vue
  29. 362
      src/components/Prouduct/InventoryList.vue
  30. 276
      src/components/Prouduct/ProuductAdd.vue
  31. 376
      src/components/Prouduct/ProuductList.vue
  32. 287
      src/components/Supplier/SupplierAdd.vue
  33. 423
      src/components/Supplier/SupplierList.vue
  34. 287
      src/components/Supplier/SupplyAdd.vue
  35. 376
      src/components/Supplier/SupplyList.vue
  36. 54
      src/main.js
  37. 86
      src/plugins/element.js
  38. 91
      src/router/index.js
  39. 15
      src/store/index.js
  40. 29
      src/util/auth.js
  41. 127
      src/util/axios.js
  42. 92
      src/util/element.js
  43. 6
      src/util/errorCode.js
  44. 44
      src/views/Dealer/Dealer_information.vue
  45. 22
      src/views/Dealer/Dealer_sales.vue
  46. 209
      src/views/Home.vue
  47. 22
      src/views/Order/Order_complete.vue
  48. 22
      src/views/Order/Order_outstanding.vue
  49. 98
      src/views/Prouduct/Prouduct.vue
  50. 97
      src/views/Prouduct/Prouduct_inventory.vue
  51. 97
      src/views/Supplier/Supplier_informstion.vue
  52. 97
      src/views/Supplier/Supplier_supply.vue
  53. 13
      src/views/Welcome.vue
  54. 3
      vue.config.js
  55. 24
      webpack.config.js

3
.browserslistrc

@ -0,0 +1,3 @@
> 1%
last 2 versions
not dead

5
.editorconfig

@ -0,0 +1,5 @@
[*.{js,jsx,ts,tsx,vue}]
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true

26
.eslintrc.js

@ -0,0 +1,26 @@
module.exports = {
root: true,
env: {
node: true
},
extends: [
'plugin:vue/essential',
'@vue/standard'
],
parserOptions: {
parser: 'babel-eslint'
},
rules: {
'no-console': 'off',
'no-debugger': 'off'
},
'extends': [
'plugin:vue/essential',
'@vue/standard'
]
}

23
.gitignore vendored

@ -0,0 +1,23 @@
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

24
README.md

@ -0,0 +1,24 @@
# jtadmin
## Project setup
```
npm install
```
### Compiles and hot-reloads for development
```
npm run serve
```
### Compiles and minifies for production
```
npm run build
```
### Lints and fixes files
```
npm run lint
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).

14
babel.config.js

@ -0,0 +1,14 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
],
plugins: [
[
'component',
{
libraryName: 'element-ui',
styleLibraryName: 'theme-chalk'
}
]
]
}

31693
package-lock.json generated

File diff suppressed because it is too large Load Diff

42
package.json

@ -0,0 +1,42 @@
{
"name": "jtadmin",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"axios": "^0.21.1",
"core-js": "^3.6.5",
"echarts": "^5.1.1",
"element-ui": "^2.4.5",
"sass-loader": "^10.1.1",
"vue": "^2.6.11",
"vue-quill-editor": "^3.0.6",
"vue-router": "^3.2.0",
"vuex": "^4.0.2"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-plugin-router": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"@vue/eslint-config-standard": "^5.1.2",
"babel-eslint": "^10.1.0",
"babel-plugin-component": "^1.1.1",
"eslint": "^6.7.2",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.0",
"eslint-plugin-vue": "^6.2.2",
"less": "^4.1.1",
"node-sass": "^7.0.1",
"vue-cli-plugin-element": "^1.0.1",
"vue-template-compiler": "^2.6.11",
"webpack": "^4.46.0",
"webpack-cli": "^4.10.0"
}
}

BIN
public/favicon.ico

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

17
public/index.html

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>

17
src/App.vue

@ -0,0 +1,17 @@
<template>
<div id="app">
<!-- <h3>我是默认访问的页面</h3> -->
<!-- 添加路由占位符-->
<router-view></router-view>
</div>
</template>
<script>
export default {
name: "app"
}
</script>
<style>
</style>

9
src/api/home.js

@ -0,0 +1,9 @@
import axios from "../util/axios";
export function getMenuList(){
return axios({
url: '/home/getRightsList',
method: 'get'
})
}

148
src/api/prouduct.js

@ -0,0 +1,148 @@
import axios from "../util/axios";
export function selectProuductList(data) {
return axios({
url: '/prouduct/selectList',
method: 'get',
params:data
})
}
export function deleteProuduct(data){
return axios({
url:'/prouduct/deleteProuduct',
method:'post',
params:data
})
}
export function onAddProuduct(data){
return axios({
url:'/prouduct/onAddProuduct',
method:'post',
params:data
})
}
export function updateProuduct(data){
return axios({
url:'/prouduct/updateProuduct',
method:'get',
params:data
})
}
export function addupdateProuduct(data){
return axios({
url:'/prouduct/addupdateProuduct',
method:'post',
params:data
})
}
export function toExcel(callback){
return axios({
url:'/prouduct/downloadExcel',
method:'post',
procgress: true,
back: callback,
responseType:'blob'
})
}
export function onSubmit(data){//data是前端传递给后端的值
return axios({
url:'/prouduct/onSubmit',
method:'get',
params:data
})
}
export function onbrandslist(){
return axios({
url:'/prouduct/onbrandslist',
method:'get'
})
}
export function onchannellist(){
return axios({
url:'/prouduct/onchannellist',
method:'get'
})
}
export function ontypelist(){
return axios({
url:'/prouduct/ontypelist',
method:'get'
})
}
export function inventorylist(data){
return axios({
url:'/inventory/inventorylist',
method:'get',
params:data
})
}
export function inventorytype(){
return axios({
url:'/inventory/typelist',
method:'post'
})
}
export function inventorybrands(){
return axios({
url:'/inventory/brandslist',
method:'post'
})
}
export function UpInventory(data){//data是前端传递给后端的值
return axios({
url:'/inventory/UpdateInventory',
method:'post',
params:data
})
}
export function inventoryselect(data){//data是前端传递给后端的值
return axios({
url:'/inventory/select',
method:'get',
params:data
})
}
export function handleDetail(data){//data是前端传递给后端的值
return axios({
url:'/inventory/handleDetail',
method:'post',
params:data
})
}
export function addInventoryList(data){//data是前端传递给后端的值
return axios({
url:'/inventory/addList',
method:'post',
params:data
})
}
export function InventoryExcel(callback){
return axios({
url:'/inventory/downloadExcel',
method:'post',
procgress: true,
back: callback,
responseType:'blob'
})
}

114
src/api/supplier.js

@ -0,0 +1,114 @@
import axios from "../util/axios";
export function selectSupplierList(data) {
return axios({
url: '/SupplierList/selectList',
method: 'get',
params:data
})
}
export function updateSupplier(data) {
return axios({
url: '/SupplierList/updateSupplier',
method: 'get',
params:data
})
}
export function deleteSupplier(data) {
return axios({
url: '/SupplierList/deleteSupplier',
method: 'get',
params:data
})
}
export function addupdateSupplier(data) {
return axios({
url: '/SupplierList/addupdateSupplier',
method: 'post',
params:data
})
}
export function onbrandslist() {
return axios({
url: '/SupplierList/onbrandslist',
method: 'get'
})
}
export function onAddSupplier(data) {
return axios({
url: '/SupplierList/onAddSupplier',
method: 'post',
params:data
})
}
export function onSubmit(data) {
return axios({
url: '/SupplierList/onSubmit',
method: 'get',
params:data
})
}
export function SupplierNum() {
return axios({
url: '/SupplierList/SupplierNum',
method: 'get'
})
}
export function selectSupplyList(data){
return axios({
url:'/Supply/selectSupplyList',
method:'get',
params:data
})
}
export function supplyDetail(data){
return axios({
url:'/Supply/supplyDetail',
method:'get',
params:data
})
}
export function onsupply(data){
return axios({
url:'/Supply/supplyselect',
method:'get',
params:data
})
}
export function goodsTypes(){
return axios({
url:'/Supply/goodsTypes',
method:'get'
})
}
export function Onorder(data){
return axios({
url:'/Supply/Onorder',
method:'get',
params:data
})
}

539
src/assets/ali-icon/demo.css

@ -0,0 +1,539 @@
/* Logo 字体 */
@font-face {
font-family: "iconfont logo";
src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834');
src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834#iefix') format('embedded-opentype'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.woff?t=1545807318834') format('woff'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.ttf?t=1545807318834') format('truetype'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.svg?t=1545807318834#iconfont') format('svg');
}
.logo {
font-family: "iconfont logo";
font-size: 160px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
/* tabs */
.nav-tabs {
position: relative;
}
.nav-tabs .nav-more {
position: absolute;
right: 0;
bottom: 0;
height: 42px;
line-height: 42px;
color: #666;
}
#tabs {
border-bottom: 1px solid #eee;
}
#tabs li {
cursor: pointer;
width: 100px;
height: 40px;
line-height: 40px;
text-align: center;
font-size: 16px;
border-bottom: 2px solid transparent;
position: relative;
z-index: 1;
margin-bottom: -1px;
color: #666;
}
#tabs .active {
border-bottom-color: #f00;
color: #222;
}
.tab-container .content {
display: none;
}
/* 页面布局 */
.main {
padding: 30px 100px;
width: 960px;
margin: 0 auto;
}
.main .logo {
color: #333;
text-align: left;
margin-bottom: 30px;
line-height: 1;
height: 110px;
margin-top: -50px;
overflow: hidden;
*zoom: 1;
}
.main .logo a {
font-size: 160px;
color: #333;
}
.helps {
margin-top: 40px;
}
.helps pre {
padding: 20px;
margin: 10px 0;
border: solid 1px #e7e1cd;
background-color: #fffdef;
overflow: auto;
}
.icon_lists {
width: 100% !important;
overflow: hidden;
*zoom: 1;
}
.icon_lists li {
width: 100px;
margin-bottom: 10px;
margin-right: 20px;
text-align: center;
list-style: none !important;
cursor: default;
}
.icon_lists li .code-name {
line-height: 1.2;
}
.icon_lists .icon {
display: block;
height: 100px;
line-height: 100px;
font-size: 42px;
margin: 10px auto;
color: #333;
-webkit-transition: font-size 0.25s linear, width 0.25s linear;
-moz-transition: font-size 0.25s linear, width 0.25s linear;
transition: font-size 0.25s linear, width 0.25s linear;
}
.icon_lists .icon:hover {
font-size: 100px;
}
.icon_lists .svg-icon {
/* 通过设置 font-size 来改变图标大小 */
width: 1em;
/* 图标和文字相邻时,垂直对齐 */
vertical-align: -0.15em;
/* 通过设置 color 来改变 SVG 的颜色/fill */
fill: currentColor;
/* path stroke 溢出 viewBox 部分在 IE 下会显示
normalize.css 中也包含这行 */
overflow: hidden;
}
.icon_lists li .name,
.icon_lists li .code-name {
color: #666;
}
/* markdown 样式 */
.markdown {
color: #666;
font-size: 14px;
line-height: 1.8;
}
.highlight {
line-height: 1.5;
}
.markdown img {
vertical-align: middle;
max-width: 100%;
}
.markdown h1 {
color: #404040;
font-weight: 500;
line-height: 40px;
margin-bottom: 24px;
}
.markdown h2,
.markdown h3,
.markdown h4,
.markdown h5,
.markdown h6 {
color: #404040;
margin: 1.6em 0 0.6em 0;
font-weight: 500;
clear: both;
}
.markdown h1 {
font-size: 28px;
}
.markdown h2 {
font-size: 22px;
}
.markdown h3 {
font-size: 16px;
}
.markdown h4 {
font-size: 14px;
}
.markdown h5 {
font-size: 12px;
}
.markdown h6 {
font-size: 12px;
}
.markdown hr {
height: 1px;
border: 0;
background: #e9e9e9;
margin: 16px 0;
clear: both;
}
.markdown p {
margin: 1em 0;
}
.markdown>p,
.markdown>blockquote,
.markdown>.highlight,
.markdown>ol,
.markdown>ul {
width: 80%;
}
.markdown ul>li {
list-style: circle;
}
.markdown>ul li,
.markdown blockquote ul>li {
margin-left: 20px;
padding-left: 4px;
}
.markdown>ul li p,
.markdown>ol li p {
margin: 0.6em 0;
}
.markdown ol>li {
list-style: decimal;
}
.markdown>ol li,
.markdown blockquote ol>li {
margin-left: 20px;
padding-left: 4px;
}
.markdown code {
margin: 0 3px;
padding: 0 5px;
background: #eee;
border-radius: 3px;
}
.markdown strong,
.markdown b {
font-weight: 600;
}
.markdown>table {
border-collapse: collapse;
border-spacing: 0px;
empty-cells: show;
border: 1px solid #e9e9e9;
width: 95%;
margin-bottom: 24px;
}
.markdown>table th {
white-space: nowrap;
color: #333;
font-weight: 600;
}
.markdown>table th,
.markdown>table td {
border: 1px solid #e9e9e9;
padding: 8px 16px;
text-align: left;
}
.markdown>table th {
background: #F7F7F7;
}
.markdown blockquote {
font-size: 90%;
color: #999;
border-left: 4px solid #e9e9e9;
padding-left: 0.8em;
margin: 1em 0;
}
.markdown blockquote p {
margin: 0;
}
.markdown .anchor {
opacity: 0;
transition: opacity 0.3s ease;
margin-left: 8px;
}
.markdown .waiting {
color: #ccc;
}
.markdown h1:hover .anchor,
.markdown h2:hover .anchor,
.markdown h3:hover .anchor,
.markdown h4:hover .anchor,
.markdown h5:hover .anchor,
.markdown h6:hover .anchor {
opacity: 1;
display: inline-block;
}
.markdown>br,
.markdown>p>br {
clear: both;
}
.hljs {
display: block;
background: white;
padding: 0.5em;
color: #333333;
overflow-x: auto;
}
.hljs-comment,
.hljs-meta {
color: #969896;
}
.hljs-string,
.hljs-variable,
.hljs-template-variable,
.hljs-strong,
.hljs-emphasis,
.hljs-quote {
color: #df5000;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-type {
color: #a71d5d;
}
.hljs-literal,
.hljs-symbol,
.hljs-bullet,
.hljs-attribute {
color: #0086b3;
}
.hljs-section,
.hljs-name {
color: #63a35c;
}
.hljs-tag {
color: #333333;
}
.hljs-title,
.hljs-attr,
.hljs-selector-id,
.hljs-selector-class,
.hljs-selector-attr,
.hljs-selector-pseudo {
color: #795da3;
}
.hljs-addition {
color: #55a532;
background-color: #eaffea;
}
.hljs-deletion {
color: #bd2c00;
background-color: #ffecec;
}
.hljs-link {
text-decoration: underline;
}
/* 代码高亮 */
/* PrismJS 1.15.0
https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript */
/**
* prism.js default theme for JavaScript, CSS and HTML
* Based on dabblet (http://dabblet.com)
* @author Lea Verou
*/
code[class*="language-"],
pre[class*="language-"] {
color: black;
background: none;
text-shadow: 0 1px white;
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
word-wrap: normal;
line-height: 1.5;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
pre[class*="language-"]::-moz-selection,
pre[class*="language-"] ::-moz-selection,
code[class*="language-"]::-moz-selection,
code[class*="language-"] ::-moz-selection {
text-shadow: none;
background: #b3d4fc;
}
pre[class*="language-"]::selection,
pre[class*="language-"] ::selection,
code[class*="language-"]::selection,
code[class*="language-"] ::selection {
text-shadow: none;
background: #b3d4fc;
}
@media print {
code[class*="language-"],
pre[class*="language-"] {
text-shadow: none;
}
}
/* Code blocks */
pre[class*="language-"] {
padding: 1em;
margin: .5em 0;
overflow: auto;
}
:not(pre)>code[class*="language-"],
pre[class*="language-"] {
background: #f5f2f0;
}
/* Inline code */
:not(pre)>code[class*="language-"] {
padding: .1em;
border-radius: .3em;
white-space: normal;
}
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: slategray;
}
.token.punctuation {
color: #999;
}
.namespace {
opacity: .7;
}
.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
color: #905;
}
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
color: #690;
}
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
color: #9a6e3a;
background: hsla(0, 0%, 100%, .5);
}
.token.atrule,
.token.attr-value,
.token.keyword {
color: #07a;
}
.token.function,
.token.class-name {
color: #DD4A68;
}
.token.regex,
.token.important,
.token.variable {
color: #e90;
}
.token.important,
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
.token.entity {
cursor: help;
}

331
src/assets/ali-icon/demo_index.html

@ -0,0 +1,331 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>IconFont Demo</title>
<link rel="shortcut icon" href="https://img.alicdn.com/tps/i4/TB1_oz6GVXXXXaFXpXXJDFnIXXX-64-64.ico" type="image/x-icon"/>
<link rel="stylesheet" href="https://g.alicdn.com/thx/cube/1.3.2/cube.min.css">
<link rel="stylesheet" href="demo.css">
<link rel="stylesheet" href="iconfont.css">
<script src="iconfont.js"></script>
<!-- jQuery -->
<script src="https://a1.alicdn.com/oss/uploads/2018/12/26/7bfddb60-08e8-11e9-9b04-53e73bb6408b.js"></script>
<!-- 代码高亮 -->
<script src="https://a1.alicdn.com/oss/uploads/2018/12/26/a3f714d0-08e6-11e9-8a15-ebf944d7534c.js"></script>
</head>
<body>
<div class="main">
<h1 class="logo"><a href="https://www.iconfont.cn/" title="iconfont 首页" target="_blank">&#xe86b;</a></h1>
<div class="nav-tabs">
<ul id="tabs" class="dib-box">
<li class="dib active"><span>Unicode</span></li>
<li class="dib"><span>Font class</span></li>
<li class="dib"><span>Symbol</span></li>
</ul>
<a href="https://www.iconfont.cn/manage/index?manage_type=myprojects&projectId=2362705" target="_blank" class="nav-more">查看项目</a>
</div>
<div class="tab-container">
<div class="content unicode" style="display: block;">
<ul class="icon_lists dib-box">
<li class="dib">
<span class="icon iconfont">&#xe612;</span>
<div class="name">用户</div>
<div class="code-name">&amp;#xe612;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe61e;</span>
<div class="name">权限</div>
<div class="code-name">&amp;#xe61e;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe600;</span>
<div class="name">订单</div>
<div class="code-name">&amp;#xe600;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe604;</span>
<div class="name">统计</div>
<div class="code-name">&amp;#xe604;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe601;</span>
<div class="name">商 品 </div>
<div class="code-name">&amp;#xe601;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe60a;</span>
<div class="name">用户</div>
<div class="code-name">&amp;#xe60a;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe60c;</span>
<div class="name"></div>
<div class="code-name">&amp;#xe60c;</div>
</li>
</ul>
<div class="article markdown">
<h2 id="unicode-">Unicode 引用</h2>
<hr>
<p>Unicode 是字体在网页端最原始的应用方式,特点是:</p>
<ul>
<li>兼容性最好,支持 IE6+,及所有现代浏览器。</li>
<li>支持按字体的方式去动态调整图标大小,颜色等等。</li>
<li>但是因为是字体,所以不支持多色。只能使用平台里单色的图标,就算项目里有多色图标也会自动去色。</li>
</ul>
<blockquote>
<p>注意:新版 iconfont 支持多色图标,这些多色图标在 Unicode 模式下将不能使用,如果有需求建议使用symbol 的引用方式</p>
</blockquote>
<p>Unicode 使用步骤如下:</p>
<h3 id="-font-face">第一步:拷贝项目下面生成的 <code>@font-face</code></h3>
<pre><code class="language-css"
>@font-face {
font-family: 'iconfont';
src: url('iconfont.eot');
src: url('iconfont.eot?#iefix') format('embedded-opentype'),
url('iconfont.woff2') format('woff2'),
url('iconfont.woff') format('woff'),
url('iconfont.ttf') format('truetype'),
url('iconfont.svg#iconfont') format('svg');
}
</code></pre>
<h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
<pre><code class="language-css"
>.iconfont {
font-family: "iconfont" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
</code></pre>
<h3 id="-">第三步:挑选相应图标并获取字体编码,应用于页面</h3>
<pre>
<code class="language-html"
>&lt;span class="iconfont"&gt;&amp;#x33;&lt;/span&gt;
</code></pre>
<blockquote>
<p>"iconfont" 是你项目下的 font-family。可以通过编辑项目查看,默认是 "iconfont"。</p>
</blockquote>
</div>
</div>
<div class="content font-class">
<ul class="icon_lists dib-box">
<li class="dib">
<span class="icon iconfont iconyonghu"></span>
<div class="name">
用户
</div>
<div class="code-name">.iconyonghu
</div>
</li>
<li class="dib">
<span class="icon iconfont iconquanxian"></span>
<div class="name">
权限
</div>
<div class="code-name">.iconquanxian
</div>
</li>
<li class="dib">
<span class="icon iconfont iconicon--copy"></span>
<div class="name">
订单
</div>
<div class="code-name">.iconicon--copy
</div>
</li>
<li class="dib">
<span class="icon iconfont iconziyuan"></span>
<div class="name">
统计
</div>
<div class="code-name">.iconziyuan
</div>
</li>
<li class="dib">
<span class="icon iconfont iconshangpin"></span>
<div class="name">
商 品
</div>
<div class="code-name">.iconshangpin
</div>
</li>
<li class="dib">
<span class="icon iconfont iconuser"></span>
<div class="name">
用户
</div>
<div class="code-name">.iconuser
</div>
</li>
<li class="dib">
<span class="icon iconfont iconsuo"></span>
<div class="name">
</div>
<div class="code-name">.iconsuo
</div>
</li>
</ul>
<div class="article markdown">
<h2 id="font-class-">font-class 引用</h2>
<hr>
<p>font-class 是 Unicode 使用方式的一种变种,主要是解决 Unicode 书写不直观,语意不明确的问题。</p>
<p>与 Unicode 使用方式相比,具有如下特点:</p>
<ul>
<li>兼容性良好,支持 IE8+,及所有现代浏览器。</li>
<li>相比于 Unicode 语意明确,书写更直观。可以很容易分辨这个 icon 是什么。</li>
<li>因为使用 class 来定义图标,所以当要替换图标时,只需要修改 class 里面的 Unicode 引用。</li>
<li>不过因为本质上还是使用的字体,所以多色图标还是不支持的。</li>
</ul>
<p>使用步骤如下:</p>
<h3 id="-fontclass-">第一步:引入项目下面生成的 fontclass 代码:</h3>
<pre><code class="language-html">&lt;link rel="stylesheet" href="./iconfont.css"&gt;
</code></pre>
<h3 id="-">第二步:挑选相应图标并获取类名,应用于页面:</h3>
<pre><code class="language-html">&lt;span class="iconfont iconxxx"&gt;&lt;/span&gt;
</code></pre>
<blockquote>
<p>"
iconfont" 是你项目下的 font-family。可以通过编辑项目查看,默认是 "iconfont"。</p>
</blockquote>
</div>
</div>
<div class="content symbol">
<ul class="icon_lists dib-box">
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#iconyonghu"></use>
</svg>
<div class="name">用户</div>
<div class="code-name">#iconyonghu</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#iconquanxian"></use>
</svg>
<div class="name">权限</div>
<div class="code-name">#iconquanxian</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#iconicon--copy"></use>
</svg>
<div class="name">订单</div>
<div class="code-name">#iconicon--copy</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#iconziyuan"></use>
</svg>
<div class="name">统计</div>
<div class="code-name">#iconziyuan</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#iconshangpin"></use>
</svg>
<div class="name">商 品 </div>
<div class="code-name">#iconshangpin</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#iconuser"></use>
</svg>
<div class="name">用户</div>
<div class="code-name">#iconuser</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#iconsuo"></use>
</svg>
<div class="name"></div>
<div class="code-name">#iconsuo</div>
</li>
</ul>
<div class="article markdown">
<h2 id="symbol-">Symbol 引用</h2>
<hr>
<p>这是一种全新的使用方式,应该说这才是未来的主流,也是平台目前推荐的用法。相关介绍可以参考这篇<a href="">文章</a>
这种用法其实是做了一个 SVG 的集合,与另外两种相比具有如下特点:</p>
<ul>
<li>支持多色图标了,不再受单色限制。</li>
<li>通过一些技巧,支持像字体那样,通过 <code>font-size</code>, <code>color</code> 来调整样式。</li>
<li>兼容性较差,支持 IE9+,及现代浏览器。</li>
<li>浏览器渲染 SVG 的性能一般,还不如 png。</li>
</ul>
<p>使用步骤如下:</p>
<h3 id="-symbol-">第一步:引入项目下面生成的 symbol 代码:</h3>
<pre><code class="language-html">&lt;script src="./iconfont.js"&gt;&lt;/script&gt;
</code></pre>
<h3 id="-css-">第二步:加入通用 CSS 代码(引入一次就行):</h3>
<pre><code class="language-html">&lt;style&gt;
.icon {
width: 1em;
height: 1em;
vertical-align: -0.15em;
fill: currentColor;
overflow: hidden;
}
&lt;/style&gt;
</code></pre>
<h3 id="-">第三步:挑选相应图标并获取类名,应用于页面:</h3>
<pre><code class="language-html">&lt;svg class="icon" aria-hidden="true"&gt;
&lt;use xlink:href="#icon-xxx"&gt;&lt;/use&gt;
&lt;/svg&gt;
</code></pre>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function () {
$('.tab-container .content:first').show()
$('#tabs li').click(function (e) {
var tabContent = $('.tab-container .content')
var index = $(this).index()
if ($(this).hasClass('active')) {
return
} else {
$('#tabs li').removeClass('active')
$(this).addClass('active')
tabContent.hide().eq(index).fadeIn()
}
})
})
</script>
</body>
</html>

45
src/assets/ali-icon/iconfont.css

@ -0,0 +1,45 @@
@font-face {font-family: "iconfont";
src: url('iconfont.eot?t=1614052170975'); /* IE9 */
src: url('iconfont.eot?t=1614052170975#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAXMAAsAAAAAC4QAAAWAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCDbAqJNIdOATYCJAMgCxIABCAFhG0HaRvBCciemjyJaVow1cYQ9YblwUNA9lj3VS9JI2kO4AWsG3ia8Wkln6jj/j4+z36aLIS3NF7SVGG7ULqf1kk46XCBjgsC4HL3E3gavj29yG5pVhaGWRkEuMA2OOEizCwBqV1/cMx0a0qwPJvNJTtwFDge0ICyv7HI/sVe7IX4VcTtKWbbxR14GgigJCMairq0uhksCGwTAWjB0ANg4dATERRiqvSAkzHoCBozXE/cArBV+3n6owZZAIwWgT2rW1cyDPkvvU/m8qKMQZERlhVnBXA+B3BAJQAE0CHQvgK4Ea8Eknr+FqEPgMvE6C96iZd62a/w98nBIngPZydLE5fP/8UDcBpBZyAMKAXk9gE7KmHAe0gs4PCeWKDBeyGDplDQQofCBj+bIhwyZFEkow4MAJjKCR+ABACtAegGpmykWRmNUw0Mj2S2l7Ihr+8ra9nikw397X4M2cS6Du7Emid9yi7kn/qwgSYlb3IfPbJO50Iciy9QT6/vE/o8aq/HW6gUquzThuYqUNdHqeLQx9bei6cZ2uFPUyzjgzX3PK3BHm22nzaecbfddko+2WrhV39lyxXStSOf23rPHqeJgx9aLTh6CsTuXoj9iQcKbfn90OGjZWdCbE+cOhnab2St2SVvdaGyIk8gjj3HaqHZzpOhVkdPe5nvORNifeLUsHBiTbEMQT7K2tp4Ciu7DQpabu1tBCyzVeqKsvZP+FffJOr73tYOO/o+xdj/rl8ruW2tJuOONdtcPz7u3XHJdtOxS22f+IPgn150KHyIrGXXg+PK96RsSH7yZO7jpVnDFLWOfB7uFopkSA/Ja7Dz5OrTXorTz51ylkxSvWEVVMbc/uvaSlPirScu2OR3oNL6Fa8a38u53/VyphJbdhAzOEcZYJk1C2oemOtv0WZdEtx52GXdVtjvUFboPulRVuFgcJAtHpPu9seYQYfqf5e/VvslLWZlXr8IMbiojLA+Pwk2NIPg09BpVZUW1y0OZi7aWBf4ZM2X+jo69b2SlvvrgqQk3KRPurHaMbZKWCXnd9ziw4JoG+K8izcv2sfBRq2MvmfCryO7gMLAc4ijIz7Rs126p+GQOCAWTywLPB6ocVqGlc52zkXLvuVk5eSwMMW+KeybjY+1SDsow7ZxO8Ye36hVGEiHWSe3jzLOoR0OEmkTuH+Lt3tXLxxB4KZVE06v14/YXwh1q0LMnC6bYTIBKXHiQCqDg/evq6h82WGlpsq0NnYlXExundm3x6e6PB86l4gqJ6p/D+SzGTrbDaMs9ZaNKqYmBI/VROUGz57UV3j3PWWc/893eBfytNmhSg0mdyLvmHQryhnJ5vNhBgAIDvOrvAFtGT9KLsvYz/eQwxdZXBbg+yD0G/sy/p6S5/iGzP9LrEKt/6Jln332P9P6mYReDdjTgTqy87/XCiQW/AECMQTBbt8HU5o7S6c0FAROfmKGqQPzKAMoPgB88d3h+FqkMuoQBYjpEJyBMSQBZ8pECmwl0Fhqgc7UFJQClJ23REBAolgCyMcyAYiPC8C4zgLn4yVSYL+AJho/QOcTCUqfwPlGSzYxVkUCHpDwMBocQ8wQq6NEk2SllzZiWq8ZEOwijdqKBZEJoYQq1dypMqzDQhF7RAOdKEkUogRWi0qF52GNhkWcwKrwkBSrlCQuM67qmKAvih1itWClJQE2QIINQxg0BoExhKVDKeMlVp7vb4TR9DQGCBE9n+ytMIGImR4hAbGIT4Ask+sS9WxKtciAlgiJohQE6lzM0kIoJSum4XEWAhe8TAUbIomFMkOUk4k46kcllcdWr9TO6QkAhb3ZDBhxEqSRTgaZJKFvWR2t1Fvw+gHdKCPxJ04TEyNncWNm48xYgMVCVOIQzTE6E72IBVLUswA=') format('woff2'),
url('iconfont.woff?t=1614052170975') format('woff'),
url('iconfont.ttf?t=1614052170975') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */
url('iconfont.svg?t=1614052170975#iconfont') format('svg'); /* iOS 4.1- */
}
.iconfont {
font-family: "iconfont" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.iconyonghu:before {
content: "\e612";
}
.iconquanxian:before {
content: "\e61e";
}
.iconicon--copy:before {
content: "\e600";
}
.iconziyuan:before {
content: "\e604";
}
.iconshangpin:before {
content: "\e601";
}
.iconuser:before {
content: "\e60a";
}
.iconsuo:before {
content: "\e60c";
}

BIN
src/assets/ali-icon/iconfont.eot

Binary file not shown.

1
src/assets/ali-icon/iconfont.js

File diff suppressed because one or more lines are too long

58
src/assets/ali-icon/iconfont.json

@ -0,0 +1,58 @@
{
"id": "2362705",
"name": "JT项目图标",
"font_family": "iconfont",
"css_prefix_text": "icon",
"description": "京淘项目中使用的图标",
"glyphs": [
{
"icon_id": "1135940",
"name": "用户",
"font_class": "yonghu",
"unicode": "e612",
"unicode_decimal": 58898
},
{
"icon_id": "2836957",
"name": "权限",
"font_class": "quanxian",
"unicode": "e61e",
"unicode_decimal": 58910
},
{
"icon_id": "7722152",
"name": "订单",
"font_class": "icon--copy",
"unicode": "e600",
"unicode_decimal": 58880
},
{
"icon_id": "9008792",
"name": "统计",
"font_class": "ziyuan",
"unicode": "e604",
"unicode_decimal": 58884
},
{
"icon_id": "19609047",
"name": "商 品 ",
"font_class": "shangpin",
"unicode": "e601",
"unicode_decimal": 58881
},
{
"icon_id": "2459201",
"name": "用户",
"font_class": "user",
"unicode": "e60a",
"unicode_decimal": 58890
},
{
"icon_id": "11746775",
"name": "锁",
"font_class": "suo",
"unicode": "e60c",
"unicode_decimal": 58892
}
]
}

47
src/assets/ali-icon/iconfont.svg

@ -0,0 +1,47 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<!--
2013-9-30: Created.
-->
<svg>
<metadata>
Created by iconfont
</metadata>
<defs>
<font id="iconfont" horiz-adv-x="1024" >
<font-face
font-family="iconfont"
font-weight="500"
font-stretch="normal"
units-per-em="1024"
ascent="896"
descent="-128"
/>
<missing-glyph />
<glyph glyph-name="yonghu" unicode="&#58898;" d="M951.616 2.88c0 0-28.736 62.912-129.472 199.808-25.984 35.328-59.328 77.12-94.4 119.68-57.536-52.416-132.992-84.544-215.744-84.544-83.072 0-158.784 32.384-216.448 85.184-35.264-42.752-68.736-84.8-94.912-120.32-100.8-136.96-129.472-199.808-129.472-199.808-17.344-39.232-2.496-77.824 36.544-77.824h807.36c39.040 0 56.64 42.496 36.544 77.824zM512 302.912c145.088 0 262.656 120.896 262.656 270.016 0 149.12-117.632 270.016-262.656 270.016-145.088 0-262.656-120.896-262.656-270.016 0-149.12 117.568-270.016 262.656-270.016z" horiz-adv-x="1024" />
<glyph glyph-name="quanxian" unicode="&#58910;" d="M826.514286 764.342857H731.428571V830.171429H643.657143C621.714286 866.742857 570.514286 896 512 896S402.285714 866.742857 380.342857 830.171429H292.571429v-65.828572H197.485714c-65.828571 0-124.342857-51.2-124.342857-124.342857v-636.342857c0-73.142857 58.514286-131.657143 124.342857-131.657143h629.028572c65.828571 0 124.342857 58.514286 124.342857 131.657143V640c0 73.142857-58.514286 124.342857-124.342857 124.342857z m-468.114286 0h73.142857c0 36.571429 36.571429 65.828571 87.771429 65.828572s87.771429-29.257143 87.771428-65.828572h73.142857v-131.657143H358.4V764.342857z m373.028571-702.171428H292.571429c-14.628571 0-29.257143 14.628571-29.257143 29.257142s14.628571 29.257143 29.257143 29.257143h438.857142c14.628571 0 29.257143-14.628571 29.257143-29.257143s-14.628571-29.257143-29.257143-29.257142z m0 160.914285H292.571429c-14.628571 0-29.257143 14.628571-29.257143 29.257143s14.628571 29.257143 29.257143 29.257143h438.857142c14.628571 0 29.257143-14.628571 29.257143-29.257143s-14.628571-29.257143-29.257143-29.257143zM731.428571 384H292.571429c-14.628571 0-29.257143 14.628571-29.257143 29.257143s14.628571 29.257143 29.257143 29.257143h438.857142c14.628571 0 29.257143-14.628571 29.257143-29.257143s-14.628571-29.257143-29.257143-29.257143z" horiz-adv-x="1024" />
<glyph glyph-name="icon--copy" unicode="&#58880;" d="M234.41187483-96.49378740999998a133.62303423 133.62303423 0 0 0-133.43998895 133.43998897L100.97188588 731.05379844A133.62303423 133.62303423 0 0 0 234.41187483 864.49378741l555.26777297 0a133.62303423 133.62303423 0 0 0 133.43998897-133.43998897l0-694.01607427a133.62303423 133.62303423 0 0 0-133.43998897-133.43998895z m0 902.23004882a74.86550821 74.86550821 0 0 1-74.7739856-74.77398558l0-694.01607427a74.86550821 74.86550821 0 0 1 74.7739856-74.77398558l555.26777297 0a74.86550821 74.86550821 0 0 1 74.7739856 74.77398558L864.4536334 731.05379844a74.86550821 74.86550821 0 0 1-74.7739856 74.77398558zM292.34569718 354.62123700999996a29.37876299 29.37876299 0 1 0 0 58.66600335l439.30860564 0a29.37876299 29.37876299 0 1 0 0-58.66600335zM292.34569718 215.87293573a29.37876299 29.37876299 0 1 0 0 58.29991287l299.73660072 0a29.37876299 29.37876299 0 1 0 0-58.75752601zM292.34569718 493.8271514a29.37876299 29.37876299 0 1 0 0 58.75752601l439.30860564 0a29.37876299 29.37876299 0 1 0 0-58.75752601z" horiz-adv-x="1024" />
<glyph glyph-name="ziyuan" unicode="&#58884;" d="M833.944426 854.682566v-938.638748a45.487878 45.487878 0 0 0-49.098027-41.155699h-13.718566a44.765848 44.765848 0 0 0-49.098027 38.98961V854.682566a45.487878 45.487878 0 0 0 49.098027 41.155699h13.718566a45.487878 45.487878 0 0 0 49.098027-41.155699zM547.298593 573.090942v-628.887961a45.487878 45.487878 0 0 0-49.098027-41.155699h-13.718566a45.487878 45.487878 0 0 0-51.264116 41.155699V573.090942a45.487878 45.487878 0 0 0 48.375997 41.155699h16.606685a45.487878 45.487878 0 0 0 49.098027-41.155699zM239.713896 333.377046v-389.174065a46.209908 46.209908 0 0 0-49.098027-41.155699h-13.718566a46.209908 46.209908 0 0 0-49.098027 41.155699V333.377046a46.209908 46.209908 0 0 0 49.098027 41.155699h13.718566a46.209908 46.209908 0 0 0 49.098027-41.155699zM627.443902-128m-38.98961 0l-549.464682 0q-38.98961 0-38.98961 38.98961l0 2.166089q0 38.98961 38.98961 38.989609l549.464682 0q38.98961 0 38.98961-38.989609l0-2.166089q0-38.98961-38.98961-38.98961ZM1023.116236-128m-38.98961 0l-223.10721 0q-38.98961 0-38.98961 38.98961l0 2.166089q0 38.98961 38.98961 38.989609l223.10721 0q38.98961 0 38.98961-38.989609l0-2.166089q0-38.98961-38.98961-38.98961Z" horiz-adv-x="1024" />
<glyph glyph-name="shangpin" unicode="&#58881;" d="M890.94 896H122.69c-54.58 0-98.9-46.98-98.9-104.72v-813.6c0-57.73 44.32-104.71 98.9-104.71h768.36c54.57 0 98.95 46.98 98.95 104.71v813.6C989.94 849.08 945.56 896 890.94 896z m-77.31-261.03c-18.6-152.91-149.05-271.54-306.86-271.54-157.63 0-288.07 118.63-306.67 271.54-0.13 1.11-0.2 2.21-0.2 3.3 0 15.1 12.6 27.69 28.12 27.69 14.1 0 25.9-10.52 27.63-24.51 15.4-124.89 122.08-222.1 251.12-222.1 129.05 0 235.9 97.21 251.31 222.1 1.73 13.99 13.53 24.51 27.63 24.51 16.64 0 29.93-14.47 27.92-30.99z" horiz-adv-x="1024" />
<glyph glyph-name="user" unicode="&#58890;" d="M511.435945 593.4156929999999m-302.584307 0a302.584307 302.584307 0 1 1 605.168614 0 302.584307 302.584307 0 1 1-605.168614 0ZM803.763157 292.54090199999996c-23.933222 18.804674-58.123539 17.095159-80.347245-5.128548-54.704508-54.704508-129.923205-88.894825-213.689483-88.894825s-158.984975 34.190317-213.689482 88.894825c-22.223706 22.223706-56.414023 25.642738-80.347245 5.128548C123.375845 213.90317200000004 54.995211 113.04173600000001 32.771505-25.429047999999966c-8.547579-56.414023 30.771285-102.570952 88.894824-102.570952H902.915077c56.414023 0 97.442404 46.156928 88.894825 102.570952-23.933222 138.470785-92.313856 239.33222-188.046745 317.96995z" horiz-adv-x="1024" />
<glyph glyph-name="suo" unicode="&#58892;" d="M521.8 728.2c84.7 0 154.5-64.1 165.1-147.1h99.8C774.9 721.6 659.9 832 519.6 832s-255.2-110.4-267-250.9h104.2c10.4 83 80.3 147.1 165 147.1zM767.7 520H256.3c-61.8 0-111.9-50.1-111.9-111.9V48c0-61.8 50.1-111.9 111.9-111.9h511.5c61.9 0 111.9 50.1 111.9 111.9V408c0 61.8-50.2 112-112 112zM559.6 218.4v-81.3c0-27.5-22.3-49.7-49.7-49.7-27.5 0-49.7 22.3-49.7 49.7v80.1c-13.4 12.9-21.8 30.9-21.8 51 0 39.1 31.8 70.9 70.9 70.9s70.9-31.8 70.9-70.9c-0.2-19.4-8-37-20.6-49.8z" horiz-adv-x="1024" />
</font>
</defs></svg>

After

Width:  |  Height:  |  Size: 6.4 KiB

BIN
src/assets/ali-icon/iconfont.ttf

Binary file not shown.

BIN
src/assets/ali-icon/iconfont.woff

Binary file not shown.

BIN
src/assets/ali-icon/iconfont.woff2

Binary file not shown.

38
src/assets/css/global.css

@ -0,0 +1,38 @@
/* 定义全局样式表 */
html,
body,
#app {
height: 100%;
width: 100%;
margin: 0;
padding: 0;
/* 定义最小宽度 */
min-width: 1366px;
}
/* 定义卡片样式 */
.el-card {
margin-top: 15px;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15) !important;
}
/* 定义表格上边距*/
.el-table {
margin-top: 15px;
}
/* 定义分页上边距*/
.el-pagination {
margin-top: 15px;
text-align: center;
}
/* 定义富文本编辑器的宽度 */
.ql-editor {
min-height: 350px;
}
video {
min-height: 200px;
min-width: 100%;
}

BIN
src/assets/images/logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
src/assets/logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

212
src/components/Prouduct/InventoryAdd.vue

@ -0,0 +1,212 @@
<template>
<div>
<el-form ref="addInventory" :inline="true" :model="addInventory" class="demo-form-inline" label-width="100px" :rules="rules">
<el-row style="padding-right:800px;" >
<el-col span="24">
<el-form-item label="产品编码" prop="productNum">
<el-input v-model="addInventory.productNum" ></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row style="padding-right:800px;">
<el-col span="24">
<el-form-item label="产品名称" prop="productName">
<el-input v-model="addInventory.productName" ></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row style="padding-right:800px;">
<el-col span="24">
<el-form-item label="产品类型" prop="productType">
<el-select v-model="addInventory.productType" >
<el-option v-for="item in typelist" :key="item.type" :value="item.type"></el-option>
{{item}}
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row style="padding-right:800px;">
<el-col span="24">
<el-form-item label="品牌" prop="productBrands">
<el-select v-model="addInventory.productBrands" >
<el-option v-for="item in brandslist" :key="item.brands" :value="item.brands"></el-option>
{{item}}
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row style="padding-right:800px;">
<el-col span="24">
<el-form-item label="总库存量" prop="allStock">
<el-input v-model="addInventory.allStock" ></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row style="padding-right:800px;">
<el-col span="24">
<el-form-item label="现余库存" prop="remainingQty">
<el-input v-model="addInventory.remainingQty" ></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row style="padding-left:250px">
<el-col span="2">
<el-form-item>
<el-button type="primary" @click="addInventoryList">添加</el-button>
</el-form-item>
</el-col>
<el-col span="2">
<el-form-item>
<el-button type="primary" @click="$router.go(0)">返回</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</template>
<script>
import {addInventoryList} from'@/api/prouduct.js'
// import {inventorybrands} from '@/api/prouduct.js'
// import {inventorytype}from '@/api/prouduct.js'
import {onbrandslist} from '@/api/prouduct.js'
import {ontypelist} from '@/api/prouduct.js'
export default {
data(){
const sureType =(rules,value,callback) => {
if (!value) {
return callback(new Error('请选择产品类型'))
}else{
callback();
}
};
const sureBrands=(rules,value,callback)=>{
if(!value){
return callback(new Error('请选择品牌'))
}else{
callback();
}
};
return{
addInventory:{
productNum:'',
productName:'',
productType:'',
productBrands:'',
allStock:'',
remainingQty:''
},
brandslist:[],
typelist:[],
rules:{
productNum:[
{ required: true, message: '产品编码不能为空',trigger: 'blur'}
],
productName:[
{required:true,message:'产品名称不能为空',trigger:'blur'},
{ min: 3, max: 30, message: '长度在 3 到 30 个字符', trigger: 'blur' }
],
productType:[
{required:true,validator:sureType,trigger:'change'}
],
productBrands:[
{ required: true,validator:sureBrands, trigger: "change"}
],
allStock:[
{required:true,message:'产品总量不能为空',trigger:'blur'}
],
remainingQty:[
{required:true,message:'现余库存不能为空',trigger:'blur'}
]
}
}
},
methods:{
addInventoryList(){
this.$refs.addInventory.validate((valid)=>{
if(valid){
addInventoryList(this.addInventory).then((response)=>{
if(response.code !==200)return this.$message.error("添加失败")
this.$message.success("添加成功")
})
this.$refs.addInventory.resetFields();
}
})
},
// //brandslist
// inventorybrands(){
// inventorybrands().then((response)=>{
// // console.log(response)
// this.brandslist=response.data
// })
// },
// //typelist
// inventorytype(){
// inventorytype().then((response)=>{
// console.log(response)
// this.typelist=response.data
// //console.log(this.typelist)
// })
// }
//brandslist
onbrandslist(){
onbrandslist().then((response)=>{
// console.log(response)
this.brandslist=response.data
})
},
//typelist
ontypelist(){
ontypelist().then((response)=>{
console.log(response)
this.typelist=response.data
})
}
// activated(){
// this.addbrandlist=this.$router.params.addbrands
// }
// onBack(){
// this.$router.push({path:"/prouduct"})
// }
},
created() {
this.ontypelist();
this.onbrandslist();
}
}
</script>
<style>
</style>

362
src/components/Prouduct/InventoryList.vue

@ -0,0 +1,362 @@
<template>
<div>
<div>
<el-form ref="selectInventory" :inline="true" :model="selectInventory" class="demo-form-inline" label-width="100px">
<el-row>
<el-col :span="2" style="margin-left=0px">
<p>品牌:</p>
</el-col>
<el-col :span="16">
<el-checkbox-group v-model="selectInventory.productBrands" size="small" style="margin-top=50px" :max="1">
<el-checkbox-button v-for="brands in brandslist" :label="brands.brands" :key="brands.brands" >{{brands.brands}}</el-checkbox-button>
</el-checkbox-group>
</el-col>
</el-row>
<el-row>
<el-col :span="2">
<p>产品类型:</p>
</el-col>
<el-col :span="14" style="padding-left: 25px;">
<el-checkbox-group v-model="selectInventory.productType" size="small" style="margin-top=30px " :max="1">
<el-checkbox-button v-for="type in typelist" :label="type.type" :key="type.type" >{{type.type}}</el-checkbox-button>
</el-checkbox-group>
</el-col>
<el-col :span="4" style=" margin-left: 10px;">
<el-button type="primary" @click="inventory" size="small">查询</el-button>
<el-button type="primary" @click="exportData()" size="small">导出</el-button>
</el-col>
</el-row>
</el-form>
</div>
<el-table :data="tableData" stripe border style="width:100%" highlight-current-row class="table">
  <el-table-column type="selection" width="55">
  </el-table-column>
  <el-table-column prop="productNum" label="产品编码" align="center" min-width="80">
  </el-table-column>
  <el-table-column prop="productName" label="产品名称" align="center" min-width="100">
<template slot-scope="scope">
<el-link type="primary" :underline="false">
<a @click="handleDetail(scope.row)">{{ scope.row.productName}}</a>
</el-link>
</template>
  </el-table-column>
  <el-table-column prop="productType" label="产品类型" align="center" min-width="120">
  </el-table-column>
<el-table-column prop="productBrands" label="品牌" align="center" min-width="120">
  </el-table-column>
  <el-table-column prop="allStock" label="总库存量" align="center" min-width="100">
  </el-table-column>
<el-table-column prop="remainingQty" label="现余库存" align="center" min-width="100">
  </el-table-column>
  <el-table-column prop="remainingQty" label="现余百分比/大约" align="center" min-width="120">
<template slot-scope="scope">
<div v-if="scope.row.remainingQty==2000">
<el-progress :text-inside="true" :stroke-width="24" :percentage="100" status="success"></el-progress></div>
<div v-else-if=" scope.row.remainingQty>=1600">
<el-progress :text-inside="true" :stroke-width="22" :percentage="80" status="danger"></el-progress>
</div>
<div v-else-if=" scope.row.remainingQty>=1400">
<el-progress :text-inside="true" :stroke-width="26" :percentage="70" status="warning"></el-progress></div>
<div v-else-if=" scope.row.remainingQty>=1000">
<el-progress :text-inside="true" :stroke-width="20" :percentage="50" status="exception"></el-progress></div>
<div v-else-if=" scope.row.remainingQty>0">
<el-progress :text-inside="true" :stroke-width="20" :percentage="25" color="red"></el-progress></div>
<div v-else-if=" scope.row.remainingQty==0">
<el-progress :text-inside="true" :stroke-width="20" :percentage="0"></el-progress></div>
</template>
  </el-table-column>
</el-table>
<div>
        <el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="queryInfo.pageNum"
:page-sizes="[5, 10, 20, 40]"
:page-size="queryInfo.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="total">
</el-pagination>
</div>
<!-- 定义修改页面 当对话框关闭时,将表格数据重置-->
<el-dialog title="修改产品信息" :visible.sync="updateDialogVisible" width="50%" @close="closeUpdateDialog">
<!-- 定义用户提交表单数据-->
<el-form :model="updateInventoryList" ref="addupdateProuduct" label-width="100px">
<el-form-item label="产品编码:" prop="productNum" >
<el-input v-model="updateInventoryList.productNum" disabled style="margin-right: 350px; width: 230px;"></el-input>
</el-form-item>
<el-form-item label="产品名称:" prop="productName">
<el-input v-model="updateInventoryList.productName" style="margin-right: 350px; width: 230px;"></el-input>
</el-form-item>
<el-form-item label="产品类型:" prop="productType">
<el-select v-model="updateInventoryList.productType" style="margin-right:350px;">
<el-option v-for="item in typelist" :key="item.type" :value="item.type"></el-option>
{{item}}
</el-select>
</el-form-item>
<el-form-item label="品牌:" prop="productBrands">
<el-select v-model="updateInventoryList.productBrands" style="margin-right:350px;">
<el-option v-for="item in brandslist" :key="item.brands" :value="item.brands"></el-option>
{{item}}
</el-select>
</el-form-item>
<el-form-item label="总库存量:" prop="allStock">
<el-input v-model="updateInventoryList.allStock" style="margin-right: 350px; width: 230px;"></el-input>
</el-form-item>
<el-form-item label="现余库存:" prop="remainingQty">
<el-input v-model="updateInventoryList.remainingQty" style="margin-right: 350px; width: 230px;"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="updateDialogVisible = false" > </el-button>
<el-button type="primary" @click="UpdateInventory()"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import {inventorylist} from '@/api/prouduct.js'
import {InventoryExcel} from '@/api/prouduct.js'
import {inventoryselect}from '@/api/prouduct.js'
// import {inventorybrands} from '@/api/prouduct.js'
import {message,confirm} from 'element-ui'
// import {inventorytype}from '@/api/prouduct.js'
import {onbrandslist} from '@/api/prouduct.js'
import {ontypelist} from '@/api/prouduct.js'
import {handleDetail} from '@/api/prouduct.js'
import {UpInventory} from '@/api/prouduct.js'
export default {
data() {
return {
selectInventory:{
productBrands:[],
productType:[]
},
updateInventoryList:[],
typelist:[],
brandslist:[],
tableData: [],
queryInfo: {
query: '',
pageNum: 1,
pageSize: 10
},
total: 0,
updateDialogVisible: false
}
},
methods: {
//
inventorylist(){
//this.queryInfoapidata
//data:result dataresult
inventorylist(this.queryInfo).then(({data:result})=>{
//console.log(result)
this.tableData=result.rows
this.total=result.total
})
},
handleSizeChange(pageSize){
//console.log(""+pageSize)
this.queryInfo.pageSize = pageSize
this.inventorylist()
},
handleCurrentChange(pageNum){
//console.log(":"+pageNum)
this.queryInfo.pageNum = pageNum
this.inventorylist()
},
//excel
exportData(){
InventoryExcel().then((data) => {
this.downloadFile(data)
})
},
/**
* 文件导出
*/
downloadFile(data) {
if (!data) {
return
}
const link = document.createElement('a');
let blob = new Blob([data], {
type: 'application/vnd.ms-excel'
});
link.style.display = 'none';
link.href = URL.createObjectURL(blob);
link.setAttribute('download', 'inventory info' + '.xls');
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
},
//
inventory(){
let inventory={}
var a =this.selectInventory.productType.join()
//
var b=this.selectInventory.productBrands.join()
inventory.productType=a
inventory.productBrands=b
inventoryselect(inventory).then((response)=>{
console.log(response)
this.tableData=response.data
if(response.code !==200) this.$message.error("查询失败")
this.$message.success("查询成功")
})
this.selectInventory.productBrands=[];
this.selectInventory.productType=[];
},
// //brandslist
// inventorybrands(){
// inventorybrands().then((response)=>{
// // console.log(response)
// this.brandslist=response.data
// })
// },
// //typelist
// inventorytype(){
// inventorytype().then((response)=>{
// console.log(response)
// this.typelist=response.data
// })
// }
//brandslist
onbrandslist(){
onbrandslist().then((response)=>{
// console.log(response)
this.brandslist=response.data
})
},
//typelist
ontypelist(){
ontypelist().then((response)=>{
console.log(response)
this.typelist=response.data
})
},
handleDetail(scope){
const data={productNum:scope.productNum}
this.updateDialogVisible=true
handleDetail(data).then((response)=>{
console.log(response.data)
this.updateInventoryList=response.data[0]
})
},
UpdateInventory(){
const inventory ={}
inventory.productNum=this.updateInventoryList.productNum
inventory.productName=this.updateInventoryList.productName
inventory.productType=this.updateInventoryList.productType
inventory.productBrands=this.updateInventoryList.productBrands
inventory.allStock=this.updateInventoryList.allStock
inventory.remainingQty=this.updateInventoryList.remainingQty
UpInventory(inventory).then((response)=>{
this.updateDialogVisible = false
// this.inventorylist();
if(response.code !==200){
return this.$message.error('修改失败')
}else{
this.$message.success('修改成功')
}
//
location.reload(true)
})
}
},
created() {
this.inventorylist();
// this.inventorybrands();
// this.inventorytype();
this.onbrandslist();
this.ontypelist();
}
}
</script>
<style lang="scss">
.demo-form-inline{
border-bottom:1px solid #ddd
}
.el-message--success {
top: 80px !important;
}
.el-message .el-icon-success {
font-size: 18px;
}
.el-message--success .el-message__content {
font-size: 18px;
font-weight: 700;
}
.table{
margin-top: 30px;
}
.el-checkbox{
margin-left: 10px;
}
.el-checkbox-group {
font-size: 0;
margin-left: -40px;
}
.el-checkbox-button--small .el-checkbox-button__inner {
padding: 9px 15px;
font-size: 12px;
border-radius: 0;
margin-top: 10px;
margin-left: 0px;
}
.el-checkbox-button, .el-checkbox-button__inner {
display: inline-block;
position: relative;
margin-left: 10px;
}
.element.style {
padding-left: 30px;
}
</style>

276
src/components/Prouduct/ProuductAdd.vue

@ -0,0 +1,276 @@
<template>
<div>
<el-form ref="addProuduct" :inline="true" :model="addProuduct" class="demo-form-inline" label-width="100px" :rules="rules">
<el-row style="padding-right:800px;" >
<el-col span="24">
<el-form-item label="产品编码:" prop="num">
<el-input v-model="addProuduct.num" ></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row style="padding-right:800px;">
<el-col span="24">
<el-form-item label="产品名称:" prop="name">
<el-input v-model="addProuduct.name" ></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row style="padding-right:800px;">
<el-col span="24">
<el-form-item label="产品类型:" prop="type">
<el-select v-model="addProuduct.type" >
<el-option v-for="item in addtypelist" :key="item.type" :value="item.type"></el-option>
{{item}}
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row style="padding-right:800px;">
<el-col span="24">
<el-form-item label="流通商品:" prop="state">
<el-select v-model="addProuduct.state" >
<el-option label="是" value='1'></el-option>
<el-option label="否" value='0'></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row style="padding-right:800px;">
<el-col span="24">
<el-form-item label="产品规格:" prop="size">
<el-input v-model="addProuduct.size" ></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row style="padding-right:800px;">
<el-col span="24">
<el-form-item label="产品功效:" prop="benefits">
<el-input v-model="addProuduct.benefits" ></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row style="padding-right:800px;">
<el-col span="24">
<el-form-item label="品牌:" prop="brands">
<el-select v-model="addProuduct.brands" >
<el-option v-for="item in addbrandslist" :key="item.brands" :value="item.brands"></el-option>
{{item}}
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row style="padding-right:800px;">
<el-col span="24">
<el-form-item label="产品组渠道:" prop="channel">
<el-select v-model="addProuduct.channel" >
<el-option v-for="item in addchannellist" :key="item.channel" :value="item.channel"></el-option>
{{item}}
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row style="padding-left:250px">
<el-col span="2">
<el-form-item>
<el-button type="primary" @click="onAddProuduct">添加</el-button>
</el-form-item>
</el-col>
<el-col span="2">
<el-form-item>
<el-button type="primary" @click="$router.go(0)">返回</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</template>
<script>
import {onAddProuduct} from'@/api/prouduct.js'
import {onbrandslist} from '@/api/prouduct.js'
import {onchannellist}from '@/api/prouduct.js'
import {ontypelist}from '@/api/prouduct.js'
export default {
data(){
const sureNum=(rules,value,callback)=>{
var checkNumber=/\D/
if (!value) {
return callback(new Error('产品编码不能为空'))
}else if(checkNumber.test(value)){
return callback(new Error('产品编码必须是数字'))
} else {
callback();
}
};
const sureType =(rules,value,callback) => {
if (!value) {
return callback(new Error('请选择产品类型'))
}else{
callback();
}
};
const sureState=(rules,value,callback)=>{
if(!value){
return callback(new Error('请选择是否流通'))
}else{
callback();
}
};
const sureSize=(rules,value,callback)=>{
if(!value){
return callback(new Error('产品规格不能为空'))
}else{
callback();
}
};
const sureBenefits=(rules,value,callback)=>{
if(!value){
return callback(new Error('产品功效不能为空'))
}else{
callback();
}
};
const sureBrands=(rules,value,callback)=>{
if(!value){
return callback(new Error('请选择品牌'))
}else{
callback();
}
};
const sureChannel=(rules,value,callback)=>{
if(!value){
return callback(new Error('请选择产品渠道'))
}else{
callback();
}
}
return{
addProuduct:{
num: '',
name: '',
type:'',
state:'',
size:'',
benefits:'',
brands:'',
channel:''
},
addbrandslist:[],
addchannellist:[],
addtypelist:[],
rules:{
num:[
{ required: true,validator:sureNum,trigger: 'blur'}
],
name: [
{ required: true, message: '产品名称不能为空', trigger: 'blur' },
{ min: 3, max: 30, message: '长度在 3 到 30 个字符', trigger: 'blur' }
],
type:[
{ required: true,validator:sureType, trigger: "change"}
],
state:[
{ required: true,validator:sureState, trigger: "change"}
],
size:[
{ required: true,validator:sureSize, trigger: "change"}
],
benefits:[
{ required: true,validator:sureBenefits, trigger: "change"}
],
brands:[
{ required: true,validator:sureBrands, trigger: "change"}
],
channel:[
{ required: true,validator:sureChannel, trigger: "change"}
]
}
}
},
methods:{
onAddProuduct(){
this.$refs.addProuduct.validate((valid)=>{
if(valid){
onAddProuduct(this.addProuduct).then((response)=>{
if(response.code !==200)return this.$message.error("添加失败")
this.$message.success("添加成功")
})
this.$refs.addProuduct.resetFields();
}
})
},
//brandslist
onbrandslist(){
onbrandslist().then((response)=>{
// console.log(response)
this.addbrandslist=response.data
})
},
//channellist
onchannellist(){
onchannellist().then((response)=>{
console.log(response)
this.addchannellist=response.data
})
},
//typelist
ontypelist(){
ontypelist().then((response)=>{
console.log(response)
this.addtypelist=response.data
})
},
// activated(){
// this.addbrandlist=this.$router.params.addbrands
// }
// onBack(){
// this.$router.push({path:"/prouduct"})
// }
},
created() {
this.onbrandslist();
this.onchannellist();
this.ontypelist();
}
}
</script>
<style>
</style>

376
src/components/Prouduct/ProuductList.vue

@ -0,0 +1,376 @@
<template>
<div>
<el-form :inline="true" ref="prdouctselect" :model="prdouctselect" class="demo-form-inline">
<el-form-item label="产品编码" prop="num">
<el-input v-model="prdouctselect.num" size="small" ></el-input>
</el-form-item>
<el-form-item label="产品名称" prop="name">
<el-input v-model="prdouctselect.name" size="small"></el-input>
</el-form-item>
<el-form-item label="产品类型" prop="type">
<el-select v-model="prdouctselect.type" size="small">
<el-option v-for="item in typelist" :key="item.type" :value="item.type"></el-option>
{{item}}
</el-select>
</el-form-item>
<el-form-item label="是否流通商品" prop="state">
<el-select v-model="prdouctselect.state" size="small">
<el-option label="是" value='1'></el-option>
<el-option label="否" value='0'></el-option>
</el-select>
</el-form-item>
<el-form-item label="产品规格" prop="size">
<el-input v-model="prdouctselect.size" size="small"></el-input>
</el-form-item>
<el-form-item label="产品功效" prop="benefits">
<el-input v-model="prdouctselect.benefits" size="small" ></el-input>
</el-form-item>
<el-form-item label="品项" prop="brands">
<el-select v-model="prdouctselect.brands" size="small">
<el-option v-for="item in brandslist" :key="item.brands" :value="item.brands"></el-option>
{{item}}
</el-select>
</el-form-item>
<el-form-item label="产品组渠道" prop="channel">
<el-select v-model="prdouctselect.channel" size="small">
<el-option v-for="item in channellist" :key="item.channel" :value="item.channel"></el-option>
{{item}}
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit" size="small">查询</el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="exportData()" size="small">导出</el-button>
</el-form-item>
</el-form>
<el-table :data="tableData" stripe border style="width:100%" highlight-current-row class="table">
  <el-table-column type="selection" width="55">
  </el-table-column>
  <el-table-column prop="num" label="产品编码" align="center" min-width="80">
  </el-table-column>
  <el-table-column prop="name" label="产品名称" align="center" min-width="100">
  </el-table-column>
  <el-table-column prop="type" label="产品类型" align="center" min-width="120">
  </el-table-column>
  <el-table-column prop="state" label="是否流通商品" align="center" :formatter="sfktFormate" min-width="100">
  </el-table-column>
  <el-table-column prop="size" label="产品规格" align="center" min-width="100">
  </el-table-column>
<el-table-column prop="benefits" label="产品功效" align="center" min-width="100">
  </el-table-column>
<el-table-column prop="brands" label="品项" align="center" min-width="100">
  </el-table-column>
<el-table-column prop="channel" label="产品组渠道" align="center" min-width="100">
  </el-table-column>
  <el-table-column label="操作" align="center" min-width="120">
    <template slot-scope="scope">
      <el-button size="small" type="primary" icon="el-icon-edit" circle @click="updateProuduct(scope.row)">修改</el-button>
      <el-button size="small" type="danger" icon="el-icon-delete" circle @click="deleteProuduct(scope.row)">删除</el-button>
    </template>
  </el-table-column>
</el-table>
 <div>
        <el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="queryInfo.pageNum"
:page-sizes="[5, 10, 20, 40]"
:page-size="queryInfo.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="total">
</el-pagination>
    </div>
<!-- 定义修改页面 当对话框关闭时,将表格数据重置-->
<el-dialog title="修改产品信息" :visible.sync="updateDialogVisible" width="50%" @close="closeUpdateDialog">
<!-- 定义用户提交表单数据-->
<el-form :model="addupdateProuduct" ref="addupdateProuduct" label-width="100px">
<el-form-item label="产品编码" prop="num">
<el-input v-model="addupdateProuduct.num" disabled style="margin-right: 350px; width: 230px;"></el-input>
</el-form-item>
<el-form-item label="产品名称" prop="name">
<el-input v-model="addupdateProuduct.name" style="margin-right: 350px; width: 230px;"></el-input>
</el-form-item>
<el-form-item label="产品类型" prop="type">
<el-select v-model="addupdateProuduct.type" style="margin-right: 350px; width: 230px;">
<el-option v-for="item in typelist" :key="item.type" :value="item.type"></el-option>
{{item}}
</el-select>
</el-form-item>
<el-form-item label="是否流通商品" prop="state">
<el-select v-model="addupdateProuduct.state" style="margin-right: 350px; width: 230px;">
<el-option label="true" value='1'></el-option>
<el-option label="false" value='0'></el-option>
</el-select>
</el-form-item>
<el-form-item label="产品规格" prop="size">
<el-input v-model="addupdateProuduct.size" style="margin-right: 350px; width: 230px;"></el-input>
</el-form-item>
<el-form-item label="产品功效" prop="benefits">
<el-input v-model="addupdateProuduct.benefits" style="margin-right: 350px; width: 230px;"></el-input>
</el-form-item>
<el-form-item label="品牌" prop="brands">
<el-select v-model="addupdateProuduct.brands" style="margin-right: 350px; width: 230px;">
<el-option v-for="item in brandslist" :key="item.brands" :value="item.brands"></el-option>
{{item}}
</el-select>
</el-form-item>
<el-form-item label="产品组渠道" prop="channel">
<el-select v-model="addupdateProuduct.channel" style="margin-right: 350px; width: 230px;">
<el-option v-for="item in channellist" :key="item.channel" :value="item.channel"></el-option>
{{item}}
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="updateDialogVisible = false" > </el-button>
<el-button type="primary" @click="onUpdateProuduct()"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import {selectProuductList} from '@/api/prouduct.js'
import {deleteProuduct} from '@/api/prouduct.js'
import {updateProuduct} from '@/api/prouduct.js'
import {addupdateProuduct} from '@/api/prouduct.js'
import {toExcel} from '@/api/prouduct.js'
import {onSubmit}from '@/api/prouduct.js'
import {onbrandslist} from '@/api/prouduct.js'
import {message,confirm} from 'element-ui'
import {onchannellist}from '@/api/prouduct.js'
import {ontypelist}from '@/api/prouduct.js'
export default {
data() {
return {
prdouctselect: {
num:'',
name:'',
type:'',
state:'',
benefits:'',
brands:'',
channel:''
},
typelist:[],
brandslist:[],
channellist:[],
tableData: [],
queryInfo: {
query: '',
pageNum: 1,
pageSize: 10
},
total: 0,
updateDialogVisible: false,
addupdateProuduct:{}
}
},
methods: {
//
selectProuductList(){
//this.queryInfoapidata
//data:result dataresult
selectProuductList(this.queryInfo).then(({data:result})=>{
this.tableData=result.rows
this.total=result.total
})
},
//
async deleteProuduct(scope){
const data={id:scope.id}
//1.
const confirmResult =await this.$confirm(
'此操作将永久删除 id为'+scope.id+', 是否继续?', '提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).catch(error => error)
// confirm cancel
if(confirmResult !== 'confirm'){
return this.$message.info("删除取消")
}else{
console.log(data);
deleteProuduct(data).then((response)=>{
if(response.code !==200)return this.$message.error("删除失败")
this.$message.success("删除成功")
this.selectProuductList()
})
}
},
//
updateProuduct(scope){
const data={id:scope.id}
   this.updateDialogVisible = true
updateProuduct(data).then((response)=>{
//console.log(response)
this.addupdateProuduct=response.data
}
)
},
//
onUpdateProuduct(){
let Prouduct={}
Prouduct.id=this.addupdateProuduct.id
Prouduct.num=this.addupdateProuduct.num
Prouduct.name=this.addupdateProuduct.name
Prouduct.type=this.addupdateProuduct.type
Prouduct.state=this.addupdateProuduct.state
Prouduct.size=this.addupdateProuduct.size
Prouduct.benefits=this.addupdateProuduct.benefits
Prouduct.brands=this.addupdateProuduct.brands
Prouduct.channel=this.addupdateProuduct.channel
addupdateProuduct(Prouduct).then((response)=>{
//console.log(response);
if(response.code !==200)return this.$message.error("用户修改失败")
this.$message.success("用户修改成功")
this.updateDialogVisible=false
this.selectProuductList()
})
},
handleSizeChange(pageSize){
//console.log(""+pageSize)
this.queryInfo.pageSize = pageSize
this.selectProuductList()
},
handleCurrentChange(pageNum){
//console.log(":"+pageNum)
this.queryInfo.pageNum = pageNum
this.selectProuductList()
},
//
sfktFormate(row,index){
if(row.state==0){
return "否";
}else if(row.state==1){
return "是";
}
},
closeUpdateDialog(){
//
this.$refs.addupdateProuduct.resetFields()
},
//excel
exportData(){
toExcel().then((data) => {
this.downloadFile(data)
})
},
/**
* 文件导出
*/
downloadFile(data) {
if (!data) {
return
}
const link = document.createElement('a');
let blob = new Blob([data], {
type: 'application/vnd.ms-excel'
});
link.style.display = 'none';
link.href = URL.createObjectURL(blob);
link.setAttribute('download', 'prouduct info' + '.xls');
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
},
//
onSubmit(){
let prouduct={}
prouduct.id=this.prdouctselect.id
prouduct.num=this.prdouctselect.num
prouduct.name=this.prdouctselect.name
prouduct.type=this.prdouctselect.type
prouduct.state=this.prdouctselect.state
prouduct.size=this.prdouctselect.size
prouduct.benefits=this.prdouctselect.benefits
prouduct.brands=this.prdouctselect.brands
prouduct.channel=this.prdouctselect.channel
onSubmit(prouduct).then((response)=>{
console.log(response)
this.tableData=response.data
if(response.code !==200) this.$message.error("查询失败")
this.$message.success("查询成功")
//
// this.$refs.prdouctselect.resetFields()
this.$refs['prdouctselect'].resetFields() //
})
},
//brandslist
onbrandslist(){
onbrandslist().then((response)=>{
// console.log(response)
this.brandslist=response.data
})
},
//channellist
onchannellist(){
onchannellist().then((response)=>{
console.log(response)
this.channellist=response.data
})
},
//typelist
ontypelist(){
ontypelist().then((response)=>{
console.log(response)
this.typelist=response.data
})
}
},
created() {
this.selectProuductList();
this.onbrandslist();
this.onchannellist();
this.ontypelist();
}
}
</script>
<style lang="scss">
.demo-form-inline{
border-bottom:1px solid #ddd
}
.el-message--success {
top: 80px !important;
}
.el-message .el-icon-success {
font-size: 18px;
}
.el-message--success .el-message__content {
font-size: 18px;
font-weight: 700;
}
.table{
margin-top: 20px;
}
</style>

287
src/components/Supplier/SupplierAdd.vue

@ -0,0 +1,287 @@
<template>
<div>
<el-steps :active="active" finish-status="success">
<el-step title="步骤 1"></el-step>
<el-step title="步骤 2"></el-step>
</el-steps>
<el-form ref="addSupplier" :inline="true" :model="addSupplier" :rules="rules" class="demo-form-inline" label-width="100px" title="供应商基本信息" v-if="active==0">
<el-row style="padding-right:100px;" >
<el-col span="24">
<el-form-item label="供应商编码" prop="supplierNum" >
<el-input v-model="addSupplier.supplierNum" disabled ></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row style="padding-right:100px;">
<el-col span="24">
<el-form-item label="供应商名称" prop="supplierName">
<el-input v-model="addSupplier.supplierName" ></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row style="padding-right:100px;">
<el-col span="24">
<el-form-item label="供应商品牌" prop="supplierBrands">
<el-select v-model="addSupplier.supplierBrands" >
<el-option v-for="item in addbrandslist" :key="item.brands" :value="item.brands"></el-option>
{{item}}
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row style="padding-right:100px;">
<el-col span="24">
<el-form-item label="供应商联系人" prop="supplierContact">
<el-input v-model="addSupplier.supplierContact" ></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row style="padding-right:100px;">
<el-col span="24">
<el-form-item label="联系电话" prop="supplierNumber">
<el-input v-model="addSupplier.supplierNumber"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-form ref="addSupplier2" :inline="true" :model="addSupplier2" :rules="rules2" class="demo-form-inline" label-width="100px" title="供应商基本信息" v-if="active==1">
<el-row style="padding-right:100px;">
<el-col span="24">
<el-form-item label="供应商收件人" prop="supplierReceiver">
<el-input v-model="addSupplier2.supplierReceiver"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row style="padding-right:100px;">
<el-col span="24">
<el-form-item label="供应商邮箱号" prop="supplierEmail">
<el-input v-model="addSupplier2.supplierEmail"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row style="padding-right:100px;">
<el-col span="24">
<el-form-item label="供应商起始日" prop="supplierStartDate">
<el-date-picker v-model="addSupplier2.supplierStartDate" type="date" placeholder="选择日期" format="yyyy 年 MM 月 dd 日" value-format="yyyy-MM-dd"></el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row style="padding-right:100px;">
<el-col span="24">
<el-form-item label="供应商终止日" prop="supplierTerminationDate">
<el-date-picker v-model="addSupplier2.supplierTerminationDate" type="date" placeholder="选择日期" format="yyyy 年 MM 月 dd 日" value-format="yyyy-MM-dd"></el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row style="padding-left:85px;">
<el-col span="24">
<el-form-item label="供应商地址" prop="supplierAddress">
<el-input v-model="addSupplier2.supplierAddress" style="width:400px"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-button style="margin-top: 12px;" @click="next" v-if="active==0">下一步</el-button>
<el-button style="margin-top: 12px;" @click="back" v-if="active==1">上一步</el-button>
<el-button style="margin-top: 12px;" @click="sure" v-if="active==1">添加</el-button>
<el-button style="margin-top: 12px;" @click="keep" v-if="active==2">返回</el-button>
</div>
</template>
<script>
import {onAddSupplier} from'@/api/supplier.js'
import {onbrandslist} from '@/api/prouduct.js'
import {ontypelist}from '@/api/prouduct.js'
import {SupplierNum} from '@/api/supplier.js'
export default {
data(){
const sureBrands=(rules,value,callback)=>{
if(!value){
return callback(new Error('请选择品牌'))
}else{
callback();
}
};
const sureNumber=(rules,value,callback)=>{
var checkNumber=/^(13[0-9]|14[5|7]|15[0|1|2|3|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\d{8}$/
if(!value){
return callback(new Error('联系电话不能为空'))
}else if(checkNumber.test(value)){
return callback()
}else{
callback(new Error('手机号格式不正确'));
}
};
const sureEmail=(rules2,value,callback)=>{
var checkEmail=/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/
if(!value){
return callback(new Error('邮箱不能为空'))
}else if(checkEmail.test(value)){
return callback();
}else{
callback(new Error('邮箱格式不正确'));
}
};
const sureDate=(rules2,value,callback)=>{
if(!value){
return callback(new Error('日期不能为空'))
}else{
return callback();
}
};
return{
active:0,
addSupplier:{
},
addSupplier2:{
},
addbrandslist:[],
addchannellist:[],
addtypelist:[],
rules:{
supplierName:[
{required:true,message:'产品名称不能为空',trigger:'blur'},
{ min: 3, max: 30, message: '长度在 3 到 30 个字符', trigger: 'blur' }
],
supplierBrands:[
{required:true,validator:sureBrands,trigger:'change'}
],
supplierContact:[
{ required: true,message:'联系人不能为空', trigger: "change"}
],
supplierNumber:[
{required:true,validator:sureNumber, trigger:'blur'}
]
},
rules2:{
supplierReceiver:[
{required:true,message:'收件人不能为空', trigger:'blur'}
],
supplierEmail:[
{required:true,validator:sureEmail, trigger:'blur'}
],
supplierStartDate:[
{required:true,validator:sureDate, trigger:'blur'}
],
supplierTerminationDate:[
{required:true,validator:sureDate, trigger:'blur'}
],
supplierAddress:[
{required:true,message:'供应商地址不能为空',trigger:'blur'}
]
}
}
},
methods:{
next() {
this.$refs.addSupplier.validate((valid)=>{
if(valid){
if (this.active++ > 2) this.active = 0;
}
})
},
back(){
if (this.active-- > 2) this.active = 0;
},
keep(){
location.reload(true)
},
sure(){
let Supplier={}
Supplier.supplierNum=this.addSupplier.supplierNum
Supplier.supplierName=this.addSupplier.supplierName
Supplier.supplierBrands=this.addSupplier.supplierBrands
Supplier.supplierContact=this.addSupplier.supplierContact
Supplier.supplierNumber=this.addSupplier.supplierNumber
Supplier.supplierReceiver=this.addSupplier2.supplierReceiver
Supplier.supplierEmail=this.addSupplier2.supplierEmail
Supplier.supplierStartDate=this.addSupplier2.supplierStartDate
Supplier.supplierTerminationDate=this.addSupplier2.supplierTerminationDate
Supplier.supplierAddress=this.addSupplier2.supplierAddress
this.$refs.addSupplier2.validate((valid)=>{
if(valid){
onAddSupplier(Supplier).then((response)=>{
if(response.code !==200)return this.$message.error("添加失败")
this.$message.success("添加成功")
this.active=2;
})
}
})
},
//brandslist
onbrandslist(){
onbrandslist().then((response)=>{
// console.log(response)
this.addbrandslist=response.data
})
},
//typelist
ontypelist(){
ontypelist().then((response)=>{
console.log(response)
this.addtypelist=response.data
})
},
//
SupplierNum(){
SupplierNum().then((response)=>{
console.log(response)
this.addSupplier.supplierNum=response.data
})
}
// activated(){
// this.addbrandlist=this.$router.params.addbrands
// }
// onBack(){
// this.$router.push({path:"/prouduct"})
// }
},
created() {
this.onbrandslist();
this.ontypelist();
this.SupplierNum();
}
}
</script>
<style>
</style>

423
src/components/Supplier/SupplierList.vue

@ -0,0 +1,423 @@
<template>
<div>
<el-form>
<el-row style="padding-top:20px">
<el-col span="8">
<el-form-item label="供应商名称" prop="supplierName" style="padding-right:100px">
<el-input v-model="supplierselect.supplierName" size="small" style="width:200px"></el-input>
</el-form-item>
</el-col>
<el-col span="8">
<el-form-item label="供应商品牌" prop="supplierBrands" style="padding-right:100px">
<el-select v-model="supplierselect.supplierBrands" size="small">
<el-option v-for="item in brandslist" :key="item.brands" :value="item.brands"></el-option>
{{item}}
</el-select>
</el-form-item>
</el-col>
<el-col span="2">
<el-form-item>
<el-button type="primary" @click="onSubmit" size="small">查询</el-button>
</el-form-item>
</el-col>
<el-col span="2">
<el-form-item>
<el-button type="primary" @click="exportData()" size="small">导出</el-button>
</el-form-item>
</el-col>
</el-row>
<el-divider></el-divider>
</el-form>
<el-table :data="tableData" stripe border style="width:100%" highlight-current-row class="table">
  <el-table-column type="selection" width="55">
  </el-table-column>
  <el-table-column prop="supplierNum" label="供应商编码" align="center" min-width="80">
  </el-table-column>
<el-table-column prop="supplierName" label="供应商名称" align="center" min-width="100">
<template slot-scope="scope">
<el-link type="primary" :underline="false">
<a @click="handleDetail(scope.row)">{{ scope.row.supplierName}}</a>
</el-link>
</template>
  </el-table-column>
  <el-table-column prop="supplierBrands" label="供应商品牌" align="center" min-width="80">
  </el-table-column>
  <el-table-column prop="supplierAddress" label="供应商地址" align="center" min-width="120">
  </el-table-column>
<el-table-column prop="supplierNumber" label="联系电话" align="center" min-width="100">
  </el-table-column>
  <el-table-column label="操作" align="center" min-width="120">
    <template slot-scope="scope">
      <el-button size="small" type="primary" icon="el-icon-edit" circle @click="updateSupplier(scope.row)">修改</el-button>
      <el-button size="small" type="danger" icon="el-icon-delete" circle @click="deleteSupplier(scope.row)">删除</el-button>
    </template>
  </el-table-column>
</el-table>
 <div>
        <el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="queryInfo.pageNum"
:page-sizes="[5, 10, 20, 40]"
:page-size="queryInfo.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="total">
</el-pagination>
    </div>
<!-- 定义修改页面 当对话框关闭时,将表格数据重置-->
<el-dialog title="修改供应商信息" :visible.sync="updateDialogVisible" width="50%" @close="closeUpdateDialog">
<!-- 定义用户提交表单数据-->
<el-form :model="addupdateSupplier" ref="addupdateSupplier" label-width="100px">
<el-form-item label="供应商编码" prop="supplierNum">
<!-- // disabled -->
<el-input v-model="addupdateSupplier.supplierNum" disabled style="max-width:220px"></el-input>
</el-form-item>
<el-form-item label="供应商名称" prop="supplierName">
<el-input v-model="addupdateSupplier.supplierName" style="max-width:220px"></el-input>
</el-form-item>
<el-form-item label="供应商品牌" prop="type">
<el-select v-model="addupdateSupplier.supplierBrands" >
<el-option v-for="item in brandslist" :key="item.supplierBrands" :value="item.supplierBrands" style="max-width:220px"></el-option>
{{item}}
</el-select>
</el-form-item>
<el-form-item label="供应商联系人" prop="supplierContact">
<el-input v-model="addupdateSupplier.supplierContact" style="max-width:220px"></el-input>
</el-form-item>
<el-form-item label="联系电话" prop="supplierNumber">
<el-input v-model="addupdateSupplier.supplierNumber" style="max-width:220px"></el-input>
</el-form-item>
<el-form-item label="供应商收件人" prop="supplierReceiver">
<el-input v-model="addupdateSupplier.supplierReceiver" style="max-width:220px"></el-input>
</el-form-item>
<el-form-item label="供应商邮箱号" prop="supplierEmail">
<el-input v-model="addupdateSupplier.supplierEmail" style="max-width:220px"></el-input>
</el-form-item>
<el-form-item label="供应商起始日" prop="supplierStartDate">
<el-date-picker v-model="addupdateSupplier.supplierStartDate" type="date" placeholder="选择日期" format="yyyy 年 MM 月 dd 日" value-format="yyyy-MM-dd"></el-date-picker>
</el-form-item>
<el-form-item label="供应商终止日" prop="supplierTerminationDate">
<el-date-picker v-model="addupdateSupplier.supplierTerminationDate" type="date" placeholder="选择日期" format="yyyy 年 MM 月 dd 日" value-format="yyyy-MM-dd"></el-date-picker>
</el-form-item>
<el-form-item label="供应商地址" prop="supplierAddress">
<el-input v-model="addupdateSupplier.supplierAddress" style="max-width:220px"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="updateDialogVisible = false" > </el-button>
<el-button type="primary" @click="onUpdateSupplier()"> </el-button>
</span>
</el-dialog>
<el-dialog title="供应商详情" :visible.sync="DetailsDialogVisible" width="50%" @close="closeDetailsDialog">
<!-- 定义用户提交表单数据-->
<el-descriptions class="margin-top" :column="2" :size="size" border>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-s-custom"></i>
供应商名称:
</template>
{{DetailsSupplier.supplierName}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-star-off"></i>
供应商品牌:
</template>
{{DetailsSupplier.supplierBrands}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-user"></i>
供应商联系人:
</template>
{{DetailsSupplier.supplierContact}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-phone"></i>
联系电话:
</template>
{{DetailsSupplier.supplierNumber}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-user"></i>
供应商收件人:
</template>
{{DetailsSupplier.supplierReceiver}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-message"></i>
供应商邮箱号:
</template>
{{DetailsSupplier.supplierEmail}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-date"></i>
供应商起始日:
</template>
{{DetailsSupplier.supplierStartDate}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-date"></i>
供应商终止日:
</template>
{{DetailsSupplier.supplierTerminationDate}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-office-building"></i>
供应商地址:
</template>
{{DetailsSupplier.supplierAddress}}
</el-descriptions-item>
</el-descriptions>
<template slot="footer" class="dialog-footer">
<el-button @click="DetailsDialogVisible = false" >关闭</el-button>
</template>
</el-dialog>
</div>
</template>
<script>
import {selectSupplierList} from '@/api/supplier.js'
import {deleteSupplier} from '@/api/supplier.js'
import {updateSupplier} from '@/api/supplier.js'
import {addupdateSupplier} from '@/api/supplier.js'
import {toExcel} from '@/api/prouduct.js'
import {onSubmit}from '@/api/supplier.js'
import {onbrandslist} from '@/api/prouduct.js'
import {message,confirm} from 'element-ui'
export default {
data() {
return {
supplierselect: {
supplierName:'',
supplierBrands:''
},
brandslist:[],
tableData: [],
queryInfo: {
query: '',
pageNum: 1,
pageSize: 10
},
total: 0,
updateDialogVisible: false,
DetailsDialogVisible:false,
addupdateSupplier:{},
DetailsSupplier:{}
}
},
methods: {
//
selectSupplierList(){
//this.queryInfoapidata
//data:result dataresult
selectSupplierList(this.queryInfo).then(({data:result})=>{
this.tableData=result.rows
this.total=result.total
})
},
//
async deleteSupplier(scope){
const data={supplierNum:scope.supplierNum}
//1.
const confirmResult =await this.$confirm(
'此操作将永久删除 supplierNum为'+scope.supplierNum+', 是否继续?', '提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).catch(error => error)
// confirm cancel
if(confirmResult !== 'confirm'){
return this.$message.info("删除取消")
}else{
console.log(data);
deleteSupplier(data).then((response)=>{
if(response.code !==200)return this.$message.error("删除失败")
this.$message.success("删除成功")
this.selectSupplierList()
})
}
},
//
updateSupplier(scope){
const data={supplierNum:scope.supplierNum}
   this.updateDialogVisible = true
updateSupplier(data).then((response)=>{
console.log(response)
this.addupdateSupplier=response.data[0]
})
},
//
onUpdateSupplier(){
let Supplier={}
Supplier.supplierNum=this.addupdateSupplier.supplierNum
Supplier.supplierName=this.addupdateSupplier.supplierName
Supplier.supplierBrands=this.addupdateSupplier.supplierBrands
Supplier.supplierAddress=this.addupdateSupplier.supplierAddress
Supplier.supplierNumber=this.addupdateSupplier.supplierNumber
Supplier.supplierContact=this.addupdateSupplier.supplierContact
Supplier.supplierReceiver=this.addupdateSupplier.supplierReceiver
Supplier.supplierEmail=this.addupdateSupplier.supplierEmail
Supplier.supplierStartDate=this.addupdateSupplier.supplierStartDate
Supplier.supplierTerminationDate=this.addupdateSupplier.supplierTerminationDate
addupdateSupplier(Supplier).then((response)=>{
console.log(response);
if(response.code !==200)return this.$message.error("用户修改失败")
this.$message.success("用户修改成功")
this.updateDialogVisible=false
this.selectSupplierList()
})
},
handleSizeChange(pageSize){
//console.log(""+pageSize)
this.queryInfo.pageSize = pageSize
this.selectSupplierList()
},
handleCurrentChange(pageNum){
//console.log(":"+pageNum)
this.queryInfo.pageNum = pageNum
this.selectSupplierList()
},
//
sfktFormate(row,index){
if(row.state==0){
return "否";
}else if(row.state==1){
return "是";
}
},
closeUpdateDialog(){
//
this.$refs.addupdateSupplier.resetFields()
},
//excel
exportData(){
toExcel().then((data) => {
this.downloadFile(data)
})
},
/**
* 文件导出
*/
downloadFile(data) {
if (!data) {
return
}
const link = document.createElement('a');
let blob = new Blob([data], {
type: 'application/vnd.ms-excel'
});
link.style.display = 'none';
link.href = URL.createObjectURL(blob);
link.setAttribute('download', 'prouduct info' + '.xls');
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
},
//
onSubmit(){
let supplier={}
supplier.supplierName=this.supplierselect.supplierName
supplier.supplierBrands=this.supplierselect.supplierBrands
onSubmit(supplier).then((response)=>{
console.log(response)
this.tableData=response.data
if(response.code !==200) this.$message.error("查询失败")
this.$message.success("查询成功")
this.$refs.supplierselect.resetFields()
})
},
//brandslist
onbrandslist(){
onbrandslist().then((response)=>{
console.log(response)
this.brandslist=response.data
})
},
handleDetail(scope){
const data={supplierNum:scope.supplierNum}
this.DetailsDialogVisible = true
updateSupplier(data).then((response)=>{
console.log(response)
this.DetailsSupplier=response.data[0]
})
},
},
created() {
this.selectSupplierList();
this.onbrandslist();
}
}
</script>
<style lang="scss">
.demo-form-inline{
border-bottom:1px solid #ddd
}
.el-message--success {
top: 80px !important;
}
.el-message .el-icon-success {
font-size: 18px;
}
.el-message--success .el-message__content {
font-size: 18px;
font-weight: 700;
}
.table{
margin-top: 20px;
}
/* el-divider 修改高度&虚线效果 */
.el-divider--horizontal{
margin: 8px 0;
background: 0 0;
border-top: 1px dashed #e8eaec;
}
</style>

287
src/components/Supplier/SupplyAdd.vue

@ -0,0 +1,287 @@
<template>
<div>
<el-steps :active="active" finish-status="success">
<el-step title="步骤 1"></el-step>
<el-step title="步骤 2"></el-step>
</el-steps>
<el-form ref="addSupplier" :inline="true" :model="addSupplier" :rules="rules" class="demo-form-inline" label-width="100px" title="供应商基本信息" v-if="active==0">
<el-row style="padding-right:100px;" >
<el-col span="24">
<el-form-item label="供应商编码" prop="supplierNum" >
<el-input v-model="addSupplier.supplierNum" disabled ></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row style="padding-right:100px;">
<el-col span="24">
<el-form-item label="供应商名称" prop="supplierName">
<el-input v-model="addSupplier.supplierName" ></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row style="padding-right:100px;">
<el-col span="24">
<el-form-item label="供应商品牌" prop="supplierBrands">
<el-select v-model="addSupplier.supplierBrands" >
<el-option v-for="item in addbrandslist" :key="item.brands" :value="item.brands"></el-option>
{{item}}
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row style="padding-right:100px;">
<el-col span="24">
<el-form-item label="供应商联系人" prop="supplierContact">
<el-input v-model="addSupplier.supplierContact" ></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row style="padding-right:100px;">
<el-col span="24">
<el-form-item label="联系电话" prop="supplierNumber">
<el-input v-model="addSupplier.supplierNumber"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-form ref="addSupplier2" :inline="true" :model="addSupplier2" :rules="rules2" class="demo-form-inline" label-width="100px" title="供应商基本信息" v-if="active==1">
<el-row style="padding-right:100px;">
<el-col span="24">
<el-form-item label="供应商收件人" prop="supplierReceiver">
<el-input v-model="addSupplier2.supplierReceiver"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row style="padding-right:100px;">
<el-col span="24">
<el-form-item label="供应商邮箱号" prop="supplierEmail">
<el-input v-model="addSupplier2.supplierEmail"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row style="padding-right:100px;">
<el-col span="24">
<el-form-item label="供应商起始日" prop="supplierStartDate">
<el-date-picker v-model="addSupplier2.supplierStartDate" type="date" placeholder="选择日期" format="yyyy 年 MM 月 dd 日" value-format="yyyy-MM-dd"></el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row style="padding-right:100px;">
<el-col span="24">
<el-form-item label="供应商终止日" prop="supplierTerminationDate">
<el-date-picker v-model="addSupplier2.supplierTerminationDate" type="date" placeholder="选择日期" format="yyyy 年 MM 月 dd 日" value-format="yyyy-MM-dd"></el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row style="padding-left:85px;">
<el-col span="24">
<el-form-item label="供应商地址" prop="supplierAddress">
<el-input v-model="addSupplier2.supplierAddress" style="width:400px"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-button style="margin-top: 12px;" @click="next" v-if="active==0">下一步</el-button>
<el-button style="margin-top: 12px;" @click="back" v-if="active==1">上一步</el-button>
<el-button style="margin-top: 12px;" @click="sure" v-if="active==1">添加</el-button>
<el-button style="margin-top: 12px;" @click="keep" v-if="active==2">返回</el-button>
</div>
</template>
<script>
import {onAddSupplier} from'@/api/supplier.js'
import {onbrandslist} from '@/api/prouduct.js'
import {ontypelist}from '@/api/prouduct.js'
import {SupplierNum} from '@/api/supplier.js'
export default {
data(){
const sureBrands=(rules,value,callback)=>{
if(!value){
return callback(new Error('请选择品牌'))
}else{
callback();
}
};
const sureNumber=(rules,value,callback)=>{
var checkNumber=/^(13[0-9]|14[5|7]|15[0|1|2|3|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\d{8}$/
if(!value){
return callback(new Error('联系电话不能为空'))
}else if(checkNumber.test(value)){
return callback()
}else{
callback(new Error('手机号格式不正确'));
}
};
const sureEmail=(rules2,value,callback)=>{
var checkEmail=/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/
if(!value){
return callback(new Error('邮箱不能为空'))
}else if(checkEmail.test(value)){
return callback();
}else{
callback(new Error('邮箱格式不正确'));
}
};
const sureDate=(rules2,value,callback)=>{
if(!value){
return callback(new Error('日期不能为空'))
}else{
return callback();
}
};
return{
active:0,
addSupplier:{
},
addSupplier2:{
},
addbrandslist:[],
addchannellist:[],
addtypelist:[],
rules:{
supplierName:[
{required:true,message:'产品名称不能为空',trigger:'blur'},
{ min: 3, max: 30, message: '长度在 3 到 30 个字符', trigger: 'blur' }
],
supplierBrands:[
{required:true,validator:sureBrands,trigger:'change'}
],
supplierContact:[
{ required: true,message:'联系人不能为空', trigger: "change"}
],
supplierNumber:[
{required:true,validator:sureNumber, trigger:'blur'}
]
},
rules2:{
supplierReceiver:[
{required:true,message:'收件人不能为空', trigger:'blur'}
],
supplierEmail:[
{required:true,validator:sureEmail, trigger:'blur'}
],
supplierStartDate:[
{required:true,validator:sureDate, trigger:'blur'}
],
supplierTerminationDate:[
{required:true,validator:sureDate, trigger:'blur'}
],
supplierAddress:[
{required:true,message:'供应商地址不能为空',trigger:'blur'}
]
}
}
},
methods:{
next() {
this.$refs.addSupplier.validate((valid)=>{
if(valid){
if (this.active++ > 2) this.active = 0;
}
})
},
back(){
if (this.active-- > 2) this.active = 0;
},
keep(){
location.reload(true)
},
sure(){
let Supplier={}
Supplier.supplierNum=this.addSupplier.supplierNum
Supplier.supplierName=this.addSupplier.supplierName
Supplier.supplierBrands=this.addSupplier.supplierBrands
Supplier.supplierContact=this.addSupplier.supplierContact
Supplier.supplierNumber=this.addSupplier.supplierNumber
Supplier.supplierReceiver=this.addSupplier2.supplierReceiver
Supplier.supplierEmail=this.addSupplier2.supplierEmail
Supplier.supplierStartDate=this.addSupplier2.supplierStartDate
Supplier.supplierTerminationDate=this.addSupplier2.supplierTerminationDate
Supplier.supplierAddress=this.addSupplier2.supplierAddress
this.$refs.addSupplier2.validate((valid)=>{
if(valid){
onAddSupplier(Supplier).then((response)=>{
if(response.code !==200)return this.$message.error("添加失败")
this.$message.success("添加成功")
this.active=2;
})
}
})
},
//brandslist
onbrandslist(){
onbrandslist().then((response)=>{
// console.log(response)
this.addbrandslist=response.data
})
},
//typelist
ontypelist(){
ontypelist().then((response)=>{
console.log(response)
this.addtypelist=response.data
})
},
//
SupplierNum(){
SupplierNum().then((response)=>{
console.log(response)
this.addSupplier.supplierNum=response.data
})
}
// activated(){
// this.addbrandlist=this.$router.params.addbrands
// }
// onBack(){
// this.$router.push({path:"/prouduct"})
// }
},
created() {
this.onbrandslist();
this.ontypelist();
this.SupplierNum();
}
}
</script>
<style>
</style>

376
src/components/Supplier/SupplyList.vue

@ -0,0 +1,376 @@
<template>
<div>
<el-form>
<el-row style="padding-top:20px">
<el-col span="8">
<el-form-item label="货物名称" prop="goodsName" style="padding-right:100px">
<el-input v-model="supplyselect.goodsName" size="small" style="width:200px"></el-input>
</el-form-item>
</el-col>
<el-col span="8">
<el-form-item label="类型" prop="goodsType" style="padding-right:100px">
<el-select v-model="supplyselect.goodsType" size="small">
<el-option v-for="item in goodsTypes" :key="item.goodsType" :value="item.goodsType"></el-option>
{{item}}
</el-select>
</el-form-item>
</el-col>
<el-col span="2">
<el-form-item>
<el-button type="primary" @click="onsupply" size="small">查询</el-button>
</el-form-item>
</el-col>
<el-col span="2">
<el-form-item>
<el-button type="primary" @click="exportData()" size="small">导出</el-button>
</el-form-item>
</el-col>
</el-row>
<el-divider></el-divider>
</el-form>
<el-table :data="tableData" stripe border style="width:100%" highlight-current-row class="table">
  <el-table-column type="selection" width="55">
  </el-table-column>
  <el-table-column prop="goodsName" label="货物名称" align="center" min-width="120">
  </el-table-column>
<el-table-column prop="goodsPrice" label="价格/元" align="center" min-width="80">
  </el-table-column>
  <el-table-column prop="goodsType" label="类型" align="center" min-width="80">
  </el-table-column>
  <el-table-column prop="goodsSize" label="规格" align="center" min-width="80">
  </el-table-column>
<el-table-column prop="goodsSupplier" label="供应商" align="center" min-width="100">
<template slot-scope="scope">
<el-link type="primary" :underline="false">
<a @click="supplyDetail(scope.row)">{{ scope.row.goodsSupplier}}</a>
</el-link>
</template>
  </el-table-column>
<el-table-column prop="goodsEffect" label="备注" align="center" min-width="100">
  </el-table-column>
  <el-table-column prop="goodsState" label="状态" align="center" min-width="80">
    <template slot-scope="scope">
<div v-if="scope.row.goodsState==1">
<el-button size="small" type="success" @click="Onorder(scope.row)">下订单</el-button> </div>
<div v-if="scope.row.goodsState==0">
<el-button size="small" type="danger" disabled >已下架</el-button></div>
    </template>
  </el-table-column>
</el-table>
 <div>
        <el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="queryInfo.pageNum"
:page-sizes="[5, 10, 20, 40]"
:page-size="queryInfo.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="total">
</el-pagination>
    </div>
<!-- 定义修改页面 当对话框关闭时,将表格数据重置-->
<el-dialog title="订单信息" :visible.sync="updateDialogVisible" width="50%" @close="closeUpdateDialog">
<!-- 定义用户提交表单数据-->
<el-form :model="orderSupply" ref="orderSupply" label-width="100px">
<el-form-item label="货物名称" prop="goodsName">
<!-- // disabled -->
<el-input v-model="orderSupply.goodsName" disabled style="max-width:220px"></el-input>
</el-form-item>
<el-form-item label="价格/元" prop="goodsPrice">
<el-input v-model="orderSupply.goodsPrice" disabled style="max-width:220px"></el-input>
</el-form-item>
<el-form-item label="类型" prop="goodsType">
<el-input v-model="orderSupply.goodsType" disabled style="max-width:220px"></el-input>
</el-form-item>
<el-form-item label="商品总价" prop="totalPrice" >
<el-input v-model="orderSupply.totalPrice" disabled style="max-width:220px"></el-input>
</el-form-item>
<el-form-item label="供应商" prop="goodsSupplier">
<el-input v-model="orderSupply.goodsSupplier" disabled style="max-width:220px"></el-input>
</el-form-item>
<el-form-item label="发货地址" prop="supplierAddress">
<el-input v-model="orderSupply.supplierList.supplierAddress" disabled style="max-width:220px"></el-input>
</el-form-item>
<el-form-item label="供应商收件人" prop="supplierReceiver">
<el-input v-model="orderSupply.supplierList.supplierReceiver" disabled style="max-width:220px"></el-input>
</el-form-item>
<el-form-item label="供应商联系电话" prop="supplierNumber" >
<el-input v-model="orderSupply.supplierList.supplierNumber" disabled style="max-width:220px"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="updateDialogVisible = false" > </el-button>
<el-button type="primary" @click="SureOrder()"> </el-button>
</span>
</el-dialog>
<el-dialog title="供应商详情" :visible.sync="DetailsDialogVisible" width="50%" @close="closeDetailsDialog">
<!-- 定义用户提交表单数据-->
<el-descriptions class="margin-top" :column="2" :size="size" border>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-s-custom"></i>
供应商名称:
</template>
{{DetailsSupplier.supplierName}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-star-off"></i>
供应商品牌:
</template>
{{DetailsSupplier.supplierBrands}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-user"></i>
供应商联系人:
</template>
{{DetailsSupplier.supplierContact}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-phone"></i>
联系电话:
</template>
{{DetailsSupplier.supplierNumber}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-user"></i>
供应商收件人:
</template>
{{DetailsSupplier.supplierReceiver}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-message"></i>
供应商邮箱号:
</template>
{{DetailsSupplier.supplierEmail}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-date"></i>
供应商起始日:
</template>
{{DetailsSupplier.supplierStartDate}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-date"></i>
供应商终止日:
</template>
{{DetailsSupplier.supplierTerminationDate}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-office-building"></i>
供应商地址:
</template>
{{DetailsSupplier.supplierAddress}}
</el-descriptions-item>
</el-descriptions>
<template slot="footer" class="dialog-footer">
<el-button @click="DetailsDialogVisible = false" >关闭</el-button>
</template>
</el-dialog>
</div>
</template>
<script>
import {selectSupplyList} from '@/api/supplier.js'
import {supplyDetail} from '@/api/supplier.js'
import {toExcel} from '@/api/prouduct.js'
import {onsupply}from '@/api/supplier.js'
import {goodsTypes} from '@/api/supplier.js'
import {message,confirm} from 'element-ui'
import {Onorder} from '@/api/supplier.js'
export default {
data() {
return {
orderSupply:{
goodsName:'',
goodsPrice:'',
goodsType:'',
totalPrice:'',
goodsSupplier:'',
supplierList:[]
},
supplyselect: {
goodsName:'',
goodsType:''
},
goodsTypes:[],
tableData: [],
queryInfo: {
query: '',
pageNum: 1,
pageSize: 10
},
total: 0,
updateDialogVisible:false,
DetailsDialogVisible:false,
addupdateSupplier:{},
DetailsSupplier:{}
}
},
methods: {
//
selectSupplyList(){
//this.queryInfoapidata
//data:result dataresult
selectSupplyList(this.queryInfo).then(({data:result})=>{
this.tableData=result.rows
this.total=result.total
})
},
handleSizeChange(pageSize){
//console.log(""+pageSize)
this.queryInfo.pageSize = pageSize
this.selectSupplyList()
},
handleCurrentChange(pageNum){
//console.log(":"+pageNum)
this.queryInfo.pageNum = pageNum
this.selectSupplyList()
},
//excel
exportData(){
toExcel().then((data) => {
this.downloadFile(data)
})
},
/**
* 文件导出
*/
downloadFile(data) {
if (!data) {
return
}
const link = document.createElement('a');
let blob = new Blob([data], {
type: 'application/vnd.ms-excel'
});
link.style.display = 'none';
link.href = URL.createObjectURL(blob);
link.setAttribute('download', 'prouduct info' + '.xls');
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
},
//
onsupply(){
let supply={}
supply.goodsName=this.supplyselect.goodsName
supply.goodsType=this.supplyselect.goodsType
onsupply(supply).then((response)=>{
console.log(response)
this.tableData=response.data
if(response.code !==200) this.$message.error("查询失败")
this.$message.success("查询成功")
this.supplyselect.goodsName='',
this.supplyselect.goodsType=''
})
},
//goodsTypes
goodsTypelist(){
goodsTypes().then((response)=>{
console.log(response)
this.goodsTypes=response.data
})
},
closeUpdateDialog(){
//
this.$refs.orderSupply.resetFields()
},
supplyDetail(scope){
const data={goodsSupplierFirm:scope.goodsSupplierFirm}
this.DetailsDialogVisible = true
supplyDetail(data).then((response)=>{
console.log(response)
this.DetailsSupplier=response.data[0]
})
},
Onorder(scope){
const data={goodsNum:scope.goodsNum}
this.updateDialogVisible=true
Onorder(data).then((response)=>{
this.orderSupply=response.data[0]
this.orderSupply.supplierList=response.data[0].supplierList[0]
})
},
SureOrder(){
}
},
created() {
this.selectSupplyList();
this.goodsTypelist();
}
}
</script>
<style lang="scss">
.demo-form-inline{
border-bottom:1px solid #ddd
}
.el-message--success {
top: 80px !important;
}
.el-message .el-icon-success {
font-size: 18px;
}
.el-message--success .el-message__content {
font-size: 18px;
font-weight: 700;
}
.table{
margin-top: 20px;
}
/* el-divider 修改高度&虚线效果 */
.el-divider--horizontal{
margin: 8px 0;
background: 0 0;
border-top: 1px dashed #e8eaec;
}
</style>

54
src/main.js

@ -0,0 +1,54 @@
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import './plugins/element.js'
import './assets/css/global.css'
import './assets/ali-icon/iconfont.css'
import axios from '@/util/axios.js'
/* 导入富文本编辑器 */
import VueQuillEditor from 'vue-quill-editor'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import './plugins/element.js'
import store from './store'
// import axios from 'axios'
/* 导入富文本编辑器对应的样式 */
import 'quill/dist/quill.core.css' // import styles
import 'quill/dist/quill.snow.css' // for snow theme
import 'quill/dist/quill.bubble.css' // for bubble theme
/* 向vue对象中添加全局对象 以后发送ajax请求使用$http对象 */
/* 父组件将参数传递给子组件 需要声明 prototype.key= xxx */
Vue.prototype.$http = axios
Vue.config.productionTip = false
/* 定义过滤器 */
/* Vue.filter("",function(){
过滤器需要添加teturn
}) */
Vue.filter("priceFormat",function(price){
//console.log(price)
return (price / 100).toFixed(2)
})
/* 将富文本编辑器注册为全局可用的组件 */
Vue.use(VueQuillEditor)
Vue.use(ElementUI);
Vue.config.productionTip = false
/* 向vue对象中添加全局对象 以后发送ajax请求使用$http对象 */
/* 父组件将参数传递给子组件 需要声明 prototype.key= xxx */
Vue.prototype.$api = axios
new Vue({
router,
render: h => h(App)
}).$mount('#app')

86
src/plugins/element.js

@ -0,0 +1,86 @@
import Vue from 'vue'
import {
Button,
Form,
FormItem,
Input,
Message,
Container,
Header,
Main,
Menu,
Aside,
Submenu,
MenuItemGroup,
MenuItem,
Breadcrumb,
BreadcrumbItem,
Card,
Row,
Col,
Table,
TableColumn,
Switch,
Tooltip,
Pagination,
Dialog,
MessageBox,
Tag,
Tree,
Select,
Option,
Cascader,
Alert,
Tabs,
TabPane,
Steps,
Step,
CheckboxGroup,
Checkbox,
Upload,
DatePicker
} from 'element-ui'
//实现父子组件参数传递
Vue.use(Button)
Vue.use(Form)
Vue.use(FormItem)
Vue.use(Input)
Vue.use(Container)
Vue.use(Header)
Vue.use(Main)
Vue.use(Aside)
Vue.use(Menu)
Vue.use(Submenu)
Vue.use(MenuItemGroup)
Vue.use(MenuItem)
Vue.use(Breadcrumb)
Vue.use(BreadcrumbItem)
Vue.use(Card)
Vue.use(Row)
Vue.use(Col)
Vue.use(Table)
Vue.use(TableColumn)
Vue.use(Switch)
Vue.use(Tooltip)
Vue.use(Pagination)
Vue.use(Dialog)
Vue.use(Tag)
Vue.use(Tree)
Vue.use(Select)
Vue.use(Option)
Vue.use(Cascader)
Vue.use(Alert)
Vue.use(Tabs)
Vue.use(TabPane)
Vue.use(Steps)
Vue.use(Step)
Vue.use(CheckboxGroup)
Vue.use(Checkbox)
Vue.use(Upload)
Vue.use(DatePicker)
//将弹框组件挂载到Vue对象中 用户可以使用this关键字调用
Vue.prototype.$message = Message
//通过MessageBox函数定义 消息提示框
Vue.prototype.$confirm = MessageBox.confirm

91
src/router/index.js

@ -0,0 +1,91 @@
import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Welcome from '../views/Welcome.vue'
import Prouduct from '../views/Prouduct/Prouduct.vue'
import Prouduct_inventory from '../views/Prouduct/Prouduct_inventory.vue'
import Supplier_informstion from '../views/Supplier/Supplier_informstion.vue'
import Supplier_supply from '../views/Supplier/Supplier_supply.vue'
import Dealer_sales from '../views/Dealer/Dealer_sales.vue'
import Dealer_information from '../views/Dealer/Dealer_information.vue'
import Order_outstanding from '../views/Order/Order_outstanding.vue'
import Order_complete from '../views/Order/Order_complete.vue'
Vue.use(VueRouter)
// // 解决ElementUI导航栏中的vue-router在3.0版本以上重复点菜单报错问题
// const originalPush = VueRouter.prototype.push
// VueRouter.prototype.push = function push(location) {
// return originalPush.call(this, location).catch(err => err)
// }
// 缓存原型上的push函数
const originPush = VueRouter.prototype.push
const originReplace = VueRouter.prototype.replace
// 给原型对象上的push指定新函数函数
VueRouter.prototype.push = function (location, onComplete, onAbort) {
// 判断如果没有指定回调函数, 通过call调用源函数并使用catch来处理错误
if (onComplete===undefined && onAbort===undefined) {
return originPush.call(this, location, onComplete, onAbort).catch(() => {})
} else { // 如果有指定任意回调函数, 通过call调用源push函数处理
originPush.call(this, location, onComplete, onAbort)
}
}
// replace同理处理
VueRouter.prototype.replace = function (location, onComplete, onAbort) {
if (onComplete===undefined && onAbort===undefined) {
return originReplace.call(this, location, onComplete, onAbort).catch(() => {})
} else {
originReplace.call(this, location, onComplete, onAbort)
}
}
const routes = [
{
path: '/',
name: 'Home',
component: Home, redirect:'/welcome',children:[
{path:'/welcome',component:Welcome},
{path:'/prouduct',component:Prouduct},
{path:'/prouduct_inventory',component:Prouduct_inventory},
{path:'/supplier_informstion',component:Supplier_informstion},
{path:'/supplier_supply',component:Supplier_supply},
{path:'/dealer_information',component:Dealer_information},
{path:'/dealer_sales',component:Dealer_sales},
{path:'/order_outstanding',component:Order_outstanding},
{path:'/order_complete',component:Order_complete}
]
},
// {
// path: '/about',
// name: 'About',
// // route level code-splitting
// // this generates a separate chunk (about.[hash].js) for this route
// // which is lazy-loaded when the route is visited.
// component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
// },
// {
// path: '/prouduct',
// name: 'Prouduct',
// // route level code-splitting
// // this generates a separate chunk (about.[hash].js) for this route
// // which is lazy-loaded when the route is visited.
// component: () => import(/* webpackChunkName: "about" */ '../views/Prouduct.vue')
// },
// {
// path: '/text',
// name: 'Text',
// // route level code-splitting
// // this generates a separate chunk (about.[hash].js) for this route
// // which is lazy-loaded when the route is visited.
// component: () => import(/* webpackChunkName: "about" */ '../views/Text.vue')
// }
]
const router = new VueRouter({
mode: 'history',
base: process.env.BASE_URL,
routes
})
export default router

15
src/store/index.js

@ -0,0 +1,15 @@
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
export default new Vuex.Store({
state: {
},
mutations: {
},
actions: {
},
modules: {
}
})

29
src/util/auth.js

@ -0,0 +1,29 @@
// import Cookies from 'js-cookie'
// const TokenKey = 'Admin-Token'
// const ExpiresInKey = 'Admin-Expires-In'
// export function getToken() {
// return Cookies.get(TokenKey)
// }
// export function setToken(token) {
// return Cookies.set(TokenKey, token)
// }
// export function removeToken() {
// return Cookies.remove(TokenKey)
// }
// export function getExpiresIn() {
// return Cookies.get(ExpiresInKey) || -1
// }
// export function setExpiresIn(time) {
// return Cookies.set(ExpiresInKey, time)
// }
// export function removeExpiresIn() {
// return Cookies.remove(ExpiresInKey)
// }

127
src/util/axios.js

@ -0,0 +1,127 @@
import axios from 'axios'
import { Notification, MessageBox, Message } from 'element-ui'
// import store from '@/store'
import { getToken } from '@/util/auth'
import errorCode from '@/util/errorCode'
axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
// 创建axios实例
const service = axios.create({
// axios中请求配置有baseURL选项,表示请求URL公共部分
baseURL:'http://localhost:8081' ,
// 超时
timeout: 10000
})
// request拦截器
service.interceptors.request.use(config => {
// 是否需要设置 token
const isToken = (config.headers || {}).isToken === false
if (getToken() && !isToken) {
config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
}
// get请求映射params参数
if (config.method === 'get' && config.params) {
let url = config.url + '?';
for (const propName of Object.keys(config.params)) {
const value = config.params[propName];
var part = encodeURIComponent(propName) + "=";
if (value && typeof(value) !== "undefined") {
if (typeof value === 'object') {
for (const key of Object.keys(value)) {
let params = propName + '[' + key + ']';
var subPart = encodeURIComponent(params) + "=";
url += subPart + encodeURIComponent(value[key]) + "&";
}
} else {
url += part + encodeURIComponent(value) + "&";
}
}
}
url = url.slice(0, -1);
config.params = {};
config.url = url;
}
return config
}, error => {
console.log(error)
Promise.reject(error)
})
// 响应拦截器
service.interceptors.response.use(res => {
// 未设置状态码则默认成功状态
const code = res.data.code || 200;
// 获取错误信息
const msg = errorCode[code] || res.data.msg || errorCode['default']
if (code === 401) {
// 单点登录时使用
window.location.replace(res.data.loginUrl)
} else if (code === 500) {
Message({
message: msg,
type: 'error'
})
return Promise.reject(new Error(msg))
} else if (code !== 200) {
Notification.error({
title: msg
})
return Promise.reject('error')
} else {
return res.data
}
},
error => {
console.log('err' + error)
let { message } = error;
if (message == "Network Error") {
message = "后端接口连接异常";
}
else if (message.includes("timeout")) {
message = "系统接口请求超时";
}
else if (message.includes("Request failed with status code")) {
message = "系统接口" + message.substr(message.length - 3) + "异常";
}
Message({
message: message,
type: 'error',
duration: 5 * 1000
})
return Promise.reject(error)
}
)
// 通用下载方法
export function download(url, params, filename) {
return service.post(url, params, {
transformRequest: [(params) => {
return tansParams(params)
}],
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
responseType: 'blob'
}).then((data) => {
const content = data
const blob = new Blob([content])
if ('download' in document.createElement('a')) {
const elink = document.createElement('a')
elink.download = filename
elink.style.display = 'none'
elink.href = URL.createObjectURL(blob)
document.body.appendChild(elink)
elink.click()
URL.revokeObjectURL(elink.href)
document.body.removeChild(elink)
} else {
navigator.msSaveBlob(blob, filename)
}
}).catch((r) => {
console.error(r)
})
}
export default service

92
src/util/element.js

@ -0,0 +1,92 @@
import Vue from 'vue'
import {
Button,
Form,
FormItem,
Input,
Message,
Container,
Header,
Main,
Menu,
Aside,
Submenu,
MenuItemGroup,
MenuItem,
Breadcrumb,
BreadcrumbItem,
Card,
Row,
Col,
Table,
TableColumn,
Switch,
Tooltip,
Pagination,
Dialog,
MessageBox,
Tag,
Tree,
Select,
Option,
Cascader,
Alert,
Tabs,
TabPane,
Steps,
Step,
CheckboxGroup,
Checkbox,
Upload,
DatePicker,
CheckboxButton,
Descriptions,
DescriptionsItem
} from 'element-ui'
//实现父子组件参数传递
Vue.use(Button)
Vue.use(Form)
Vue.use(FormItem)
Vue.use(Input)
Vue.use(Container)
Vue.use(Header)
Vue.use(Main)
Vue.use(Aside)
Vue.use(Menu)
Vue.use(Submenu)
Vue.use(MenuItemGroup)
Vue.use(MenuItem)
Vue.use(Breadcrumb)
Vue.use(BreadcrumbItem)
Vue.use(Card)
Vue.use(Row)
Vue.use(Col)
Vue.use(Table)
Vue.use(TableColumn)
Vue.use(Switch)
Vue.use(Tooltip)
Vue.use(Pagination)
Vue.use(Dialog)
Vue.use(Tag)
Vue.use(Tree)
Vue.use(Select)
Vue.use(Option)
Vue.use(Cascader)
Vue.use(Alert)
Vue.use(Tabs)
Vue.use(TabPane)
Vue.use(Steps)
Vue.use(Step)
Vue.use(CheckboxGroup)
Vue.use(Checkbox)
Vue.use(Upload)
Vue.use(DatePicker)
Vue.use(CheckboxButton)
Vue.use(Descriptions)
Vue.use(DescriptionsItem)
//将弹框组件挂载到Vue对象中 用户可以使用this关键字调用
Vue.prototype.$message = Message
//通过MessageBox函数定义 消息提示框
Vue.prototype.$confirm = MessageBox.confirm

6
src/util/errorCode.js

@ -0,0 +1,6 @@
export default {
'401': '认证失败,无法访问系统资源',
'403': '当前操作没有权限',
'404': '访问资源不存在',
'default': '系统未知错误,请反馈给管理员'
}

44
src/views/Dealer/Dealer_information.vue

@ -0,0 +1,44 @@
<template>
<div style="margin-top: 20px">
<el-checkbox-group v-model="prdouctselect.type" size="medium">
<el-checkbox-button v-for="type in typelist" :label="type.type" :key="type.type">{{type}}</el-checkbox-button>
</el-checkbox-group>
</div>
</template>
<script>
import {inventorytype}from '@/api/prouduct.js'
export default {
data() {
return {
prdouctselect: {},
typelist:[],
}
},
methods: {
//typelist
inventorytype(){
inventorytype().then((response)=>{
console.log(response)
this.typelist=response.data
})
}
},
created() {
this.inventorytype();
}
}
</script>
<style scoped>
</style>

22
src/views/Dealer/Dealer_sales.vue

@ -0,0 +1,22 @@
<template>
</template>
<script>
export default {
data () {
return {
};
},
methods:{
},
created() {
}
}
</script>

209
src/views/Home.vue

@ -0,0 +1,209 @@
<template>
<!-- 定义布局容器 -->
<el-container class="home-container">
<!-- 定义头标签 -->
<el-header>
<div>
<span>紫艺化妆品管理系统</span>
</div>
<el-button type="info" @click="logout">退出</el-button>
</el-header>
<!-- 定义中间区域-->
<el-container>
<!-- 当打开左侧菜单时 宽度为200, 当不打开时为默认值-->
<el-aside :width="isCollapse ? '64px' : '200px' ">
<!-- 这是左侧菜单-->
<!--定义折叠项-->
<div class="leftCollapse" @click="collspseClick">|||</div>
<!--
background-color 定义背景色
text-color="#fff" 定义文字颜色
active-text-color="#4094ff" 选中元素的颜色
unique-opened 是否只保持一个子菜单的展开
collapse 是否水平折叠收起菜单仅在 mode vertical 时可用
collapse-transition 是否开启折叠动画 默认不要展现
router 是否使用 vue-router 的模式启用该模式会在激活导航时以 index 作为 path 进行路由跳转
-->
<el-menu background-color="#2C3E50" text-color="#fff" active-text-color="#4094ff" unique-opened
:collapse="isCollapse" :collapse-transition="isCollapseTransition" router :default-active="defaultActive">
<!-- 定义一级菜单 -->
<el-submenu :index="menu.id+''" v-for="menu in menuList" :key="menu.id">
<!-- 定义一级菜单模版 -->
<template slot="title">
<!-- 定义左侧图标-->
<i :class="menuIcon[menu.id]"></i>
<!-- 定义菜单名称-->
<span>{{menu.menu}}</span>
</template>
<!-- 定义二级菜单 -->
<el-menu-item :index="childrenMenu.path" v-for="childrenMenu in menu.children" :key="childrenMenu.id"
@click="defaultActiveMenu(childrenMenu.path)">
<template slot="title">
<i class="el-icon-menu"></i>
<span>{{childrenMenu.menu}}</span>
</template>
</el-menu-item>
</el-submenu>
</el-menu>
</el-aside>
<!-- 定义主页面结构-->
<el-main>
<!-- 定义路由展现页面-->
<router-view></router-view>
</el-main>
</el-container>
</el-container>
</template>
<script>
import{getMenuList}from'../api/home.js'
export default {
//
created() {
//
this.getMenuList()
//
this.defaultActive = window.sessionStorage.getItem("activeMenu")
},
data() {
return {
//
menuList: [],
menuIcon: {
'1': 'iconfont iconuser',
'3': 'iconfont iconshangpin',
'5': 'iconfont iconicon--copy',
'7': 'iconfont iconquanxian',
'8': 'iconfont iconziyuan'
},
//
isCollapse: false,
//
isCollapseTransition: false,
//
defaultActive: ''
}
},
methods: {
logout() {
//1.session
window.sessionStorage.clear()
//2.访
this.$router.push('/login')
},
async getMenuList() {
getMenuList().then((result)=>{
console.log(result)
if(result.code !== 200)
return this.$message.error("左侧菜单查询失败")
this.menuList = result.data
})
},
//
collspseClick() {
this.isCollapse = !this.isCollapse
},
defaultActiveMenu(activeMenu){
//,sessionStory
window.sessionStorage.setItem("activeMenu",activeMenu)
this.defaultActive = activeMenu
}
}
}
</script>
<!-- 防止样式重叠 -->
<style lang="scss">
.el-header {
background-color: #2B4B6B;
display: flex;
/* 灵活的盒子容器 */
justify-content: space-between;
/* 左右对齐 */
align-items: center;
/* 文本元素居中对齐 */
color: #FFFFFF;
/* 设定字体颜色 */
padding-left: 1px;
}
.div {
display: flex;
align-items: center;
}
.span {
margin-left: 15px;
font-size: 25px;
/* 设定字体高度 */
}
.el-aside {
background-color: #2C3E50;
}
.el-menu {
border-right: none;
}
.el-main {
background-color: #E9EEF3;
color: #333;
min-height: 850px;
max-width: 1500px;
}
.home-container {
height: 100%;
width: 100%;
}
.iconfont {
margin-right: 8px;
}
/* 定义折叠项 */
.leftCollapse {
/* 设定背景色 */
background-color: #708090;
/* 定义字体大小 */
font-size: 10px;
/* 定义行高 */
line-height: 30px;
/* 定义颜色 */
color: #FFFFFF;
/* 设置居中 */
text-align: center;
/* 设定字符间距 */
letter-spacing: 4px;
/* 鼠标放上之后设置为小手 */
cursor: pointer;
}
</style>

22
src/views/Order/Order_complete.vue

@ -0,0 +1,22 @@
<template>
</template>
<script>
export default {
data () {
return {
};
},
methods:{
},
created() {
}
}
</script>

22
src/views/Order/Order_outstanding.vue

@ -0,0 +1,22 @@
<template>
</template>
<script>
export default {
data () {
return {
};
},
methods:{
},
created() {
}
}
</script>

98
src/views/Prouduct/Prouduct.vue

@ -0,0 +1,98 @@
<template>
<el-tabs v-model="editableTabsValue" type="card" editable @edit="handleTabsEdit">
<el-tab-pane
:key="item.name"
v-for="(item, index) in editableTabs"
:label="item.title"
:name="item.name"
>
<div>
<span v-if="index==0" >
<ProuductList></ProuductList></span>
<span v-else>
<ProuductAdd></ProuductAdd></span>
</div>
</el-tab-pane>
</el-tabs>
</template>
<script>
import ProuductList from '@/components/Prouduct/ProuductList.vue'
import ProuductAdd from '@/components/Prouduct/ProuductAdd.vue'
// import {onbrandslist} from '@/api/prouduct.js'
export default {
name:'Prouduct',
components:{
ProuductList,
ProuductAdd
},
data() {
return {
// brandslist:[],
editableTabsValue: '1',
editableTabs: [{
title: '产品信息',
name: '1',
content: 'Tab 1 content'
}, {
title: '产品添加',
name: '2',
content: 'Tab 2 content'
}],
tabIndex: 2
}
},
methods: {
handleTabsEdit(targetName, action) {
if (action === 'add') {
let newTabName = ++this.tabIndex + '';
this.editableTabs.push({
title: 'New Tab',
name: newTabName,
content: 'New Tab content'
});
this.editableTabsValue = newTabName;
}
if (action === 'remove') {
let tabs = this.editableTabs;
let activeName = this.editableTabsValue;
if (activeName === targetName) {
tabs.forEach((tab, index) => {
if (tab.name === targetName) {
let nextTab = tabs[index + 1] || tabs[index - 1];
if (nextTab) {
activeName = nextTab.name;
}
}
});
}
this.editableTabsValue = activeName;
this.editableTabs = tabs.filter(tab => tab.name !== targetName);
}
},
// //brandslist
// onbrandslist(){
// onbrandslist().then((response)=>{
// // console.log(response)
// this.brandslist=response.data
// })
// this.$router.push({
// name:'ProuductAdd',
// params:{
// addbrands:this.brandslist
// }
// })
// }
},
// created(){
// this.onbrandslist();
// }
}
</script>

97
src/views/Prouduct/Prouduct_inventory.vue

@ -0,0 +1,97 @@
<template>
<el-tabs v-model="editableTabsValue" type="card" editable @edit="handleTabsEdit">
<el-tab-pane
:key="item.name"
v-for="(item, index) in editableTabs"
:label="item.title"
:name="item.name"
>
<div>
<span v-if="index==0" >
<InventoryList></InventoryList></span>
<span v-else>
<InventoryAdd></InventoryAdd></span>
</div>
</el-tab-pane>
</el-tabs>
</template>
<script>
import InventoryList from '@/components/Prouduct/InventoryList'
import InventoryAdd from '@/components/Prouduct/InventoryAdd'
export default {
name:'Prouduct_inventory',
components:{
InventoryList,
InventoryAdd
},
data() {
return {
// brandslist:[],
editableTabsValue: '1',
editableTabs: [{
title: '产品库存信息',
name: '1',
content: 'Tab 1 content'
}, {
title: '产品库存添加',
name: '2',
content: 'Tab 2 content'
}],
tabIndex: 2
}
},
methods: {
handleTabsEdit(targetName, action) {
if (action === 'add') {
let newTabName = ++this.tabIndex + '';
this.editableTabs.push({
title: 'New Tab',
name: newTabName,
content: 'New Tab content'
});
this.editableTabsValue = newTabName;
}
if (action === 'remove') {
let tabs = this.editableTabs;
let activeName = this.editableTabsValue;
if (activeName === targetName) {
tabs.forEach((tab, index) => {
if (tab.name === targetName) {
let nextTab = tabs[index + 1] || tabs[index - 1];
if (nextTab) {
activeName = nextTab.name;
}
}
});
}
this.editableTabsValue = activeName;
this.editableTabs = tabs.filter(tab => tab.name !== targetName);
}
},
// //brandslist
// onbrandslist(){
// onbrandslist().then((response)=>{
// // console.log(response)
// this.brandslist=response.data
// })
// this.$router.push({
// name:'ProuductAdd',
// params:{
// addbrands:this.brandslist
// }
// })
// }
},
// created(){
// this.onbrandslist();
// }
}
</script>

97
src/views/Supplier/Supplier_informstion.vue

@ -0,0 +1,97 @@
<template>
<el-tabs v-model="editableTabsValue" type="card" editable @edit="handleTabsEdit">
<el-tab-pane
:key="item.name"
v-for="(item, index) in editableTabs"
:label="item.title"
:name="item.name"
>
<div>
<span v-if="index==0" >
<SupplierList></SupplierList></span>
<span v-else>
<SupplierAdd></SupplierAdd></span>
</div>
</el-tab-pane>
</el-tabs>
</template>
<script>
import SupplierList from '@/components/Supplier/SupplierList'
import SupplierAdd from '@/components/Supplier/SupplierAdd'
export default {
name:'Supplier_informstion',
components:{
SupplierList,
SupplierAdd
},
data() {
return {
// brandslist:[],
editableTabsValue: '1',
editableTabs: [{
title: '供应商信息',
name: '1',
content: 'Tab 1 content'
}, {
title: '供应商添加',
name: '2',
content: 'Tab 2 content'
}],
tabIndex: 2
}
},
methods: {
handleTabsEdit(targetName, action) {
if (action === 'add') {
let newTabName = ++this.tabIndex + '';
this.editableTabs.push({
title: 'New Tab',
name: newTabName,
content: 'New Tab content'
});
this.editableTabsValue = newTabName;
}
if (action === 'remove') {
let tabs = this.editableTabs;
let activeName = this.editableTabsValue;
if (activeName === targetName) {
tabs.forEach((tab, index) => {
if (tab.name === targetName) {
let nextTab = tabs[index + 1] || tabs[index - 1];
if (nextTab) {
activeName = nextTab.name;
}
}
});
}
this.editableTabsValue = activeName;
this.editableTabs = tabs.filter(tab => tab.name !== targetName);
}
},
// //brandslist
// onbrandslist(){
// onbrandslist().then((response)=>{
// // console.log(response)
// this.brandslist=response.data
// })
// this.$router.push({
// name:'ProuductAdd',
// params:{
// addbrands:this.brandslist
// }
// })
// }
},
// created(){
// this.onbrandslist();
// }
}
</script>

97
src/views/Supplier/Supplier_supply.vue

@ -0,0 +1,97 @@
<template>
<el-tabs v-model="editableTabsValue" type="card" editable @edit="handleTabsEdit">
<el-tab-pane
:key="item.name"
v-for="(item, index) in editableTabs"
:label="item.title"
:name="item.name"
>
<div>
<span v-if="index==0" >
<SupplyList></SupplyList></span>
<span v-else>
<SupplyAdd></SupplyAdd></span>
</div>
</el-tab-pane>
</el-tabs>
</template>
<script>
import SupplyAdd from '../../components/Supplier/SupplyAdd.vue'
import SupplyList from '../../components/Supplier/SupplyList.vue'
export default {
name:'Supplier_informstion',
components:{
SupplyAdd,
SupplyList
},
data() {
return {
// brandslist:[],
editableTabsValue: '1',
editableTabs: [{
title: '货物信息',
name: '1',
content: 'Tab 1 content'
}, {
title: '货物添加',
name: '2',
content: 'Tab 2 content'
}],
tabIndex: 2
}
},
methods: {
handleTabsEdit(targetName, action) {
if (action === 'add') {
let newTabName = ++this.tabIndex + '';
this.editableTabs.push({
title: 'New Tab',
name: newTabName,
content: 'New Tab content'
});
this.editableTabsValue = newTabName;
}
if (action === 'remove') {
let tabs = this.editableTabs;
let activeName = this.editableTabsValue;
if (activeName === targetName) {
tabs.forEach((tab, index) => {
if (tab.name === targetName) {
let nextTab = tabs[index + 1] || tabs[index - 1];
if (nextTab) {
activeName = nextTab.name;
}
}
});
}
this.editableTabsValue = activeName;
this.editableTabs = tabs.filter(tab => tab.name !== targetName);
}
},
// //brandslist
// onbrandslist(){
// onbrandslist().then((response)=>{
// // console.log(response)
// this.brandslist=response.data
// })
// this.$router.push({
// name:'ProuductAdd',
// params:{
// addbrands:this.brandslist
// }
// })
// }
},
// created(){
// this.onbrandslist();
// }
}
</script>

13
src/views/Welcome.vue

@ -0,0 +1,13 @@
<template>
<div>
<span>欢迎你</span>
</div>
</template>
<script>
</script>

3
vue.config.js

@ -0,0 +1,3 @@
module.exports = {
lintOnSave: false
}

24
webpack.config.js

@ -0,0 +1,24 @@
const path = require('path');
module.exports = {
mode:'development',
entry:{
main:'./src/main.js',
},
output:{
path:path.resolve(__dirname,'../dist'), //打包的路径(绝对路径)
filename:'[name].js' //按入口文件命名打包成的文件名
},
//模块
module:{
rules:[]
},
plugins:[], //插件
//服务功能配置
devServer:{
contentBase:path.resolve(__dirname,'../dist'), //基本目录结构
host:'localhost', //ip地址
compress:true, //开启服务器端压缩
port:8888 //端口
} //服务功能配置
}
Loading…
Cancel
Save