Merge pull request !15 from 赵世界/develop
This commit is contained in:
赵世界 2022-08-17 07:52:16 +00:00 committed by Gitee
commit 54f6fb5a53
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
67 changed files with 27967 additions and 1353 deletions

24073
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -16,6 +16,7 @@
"lodash": "^4.17.19",
"resolve-url-loader": "^3.1.0",
"sass": "^1.15.2",
"sass-loader": "^8.0.0"
"sass-loader": "^8.0.0",
"vue-template-compiler": "^2.7.8"
}
}

View File

@ -0,0 +1 @@
#nprogress{pointer-events:none}#nprogress .bar{background:#29d;position:fixed;z-index:1031;top:0;left:0;width:100%;height:2px}#nprogress .peg{display:block;position:absolute;right:0;width:100px;height:100%;box-shadow:0 0 10px #29d,0 0 5px #29d;opacity:1;transform:rotate(3deg) translateY(-4px)}#nprogress .spinner{display:block;position:fixed;z-index:1031;top:15px;right:15px}#nprogress .spinner-icon{width:18px;height:18px;box-sizing:border-box;border:2px solid transparent;border-top-color:#29d;border-left-color:#29d;border-radius:50%;-webkit-animation:nprogress-spinner .4s linear infinite;animation:nprogress-spinner .4s linear infinite}.nprogress-custom-parent{overflow:hidden;position:relative}.nprogress-custom-parent #nprogress .bar,.nprogress-custom-parent #nprogress .spinner{position:absolute}@-webkit-keyframes nprogress-spinner{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(1turn)}}@keyframes nprogress-spinner{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.el-upload--picture-card[data-v-736dfc22]{width:50px;height:50px}.el-form-item[data-v-736dfc22]{margin-left:60px}.addto[data-v-736dfc22]{display:inline-block;width:30px;height:30px;background-color:#00f;color:#fff;font-size:25px;text-align:center;line-height:30px;border-radius:5px;margin-top:4px}.avatar-uploader .el-upload[data-v-736dfc22]{border:1px dashed #d9d9d9;border-radius:6px;cursor:pointer;position:relative;overflow:hidden}.avatar-uploader .el-upload[data-v-736dfc22]:hover{border-color:#409eff}.avatar-uploader-icon[data-v-736dfc22]{font-size:28px;color:#8c939d;width:148px;height:148px;line-height:148px;text-align:center}.avatar[data-v-736dfc22]{width:148px;height:148px;display:block}

View File

@ -0,0 +1 @@
#nprogress{pointer-events:none}#nprogress .bar{background:#29d;position:fixed;z-index:1031;top:0;left:0;width:100%;height:2px}#nprogress .peg{display:block;position:absolute;right:0;width:100px;height:100%;box-shadow:0 0 10px #29d,0 0 5px #29d;opacity:1;transform:rotate(3deg) translateY(-4px)}#nprogress .spinner{display:block;position:fixed;z-index:1031;top:15px;right:15px}#nprogress .spinner-icon{width:18px;height:18px;box-sizing:border-box;border:2px solid transparent;border-top-color:#29d;border-left-color:#29d;border-radius:50%;-webkit-animation:nprogress-spinner .4s linear infinite;animation:nprogress-spinner .4s linear infinite}.nprogress-custom-parent{overflow:hidden;position:relative}.nprogress-custom-parent #nprogress .bar,.nprogress-custom-parent #nprogress .spinner{position:absolute}@-webkit-keyframes nprogress-spinner{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(1turn)}}@keyframes nprogress-spinner{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.loss[data-v-c458deb8]{position:relative}.table[data-v-c458deb8]{margin-top:40px;position:relative}.btn[data-v-c458deb8]{float:right}[data-v-c458deb8] .cell{display:flex;align-items:center}.commodityimg[data-v-c458deb8]{width:59px;height:59px;background:hsla(0,0%,89%,.39);opacity:1;display:block;margin-right:12px}.Img[data-v-c458deb8]{width:100%;height:100%}.confirmbtn[data-v-c458deb8]{width:114px;height:44px;border-radius:3px;margin-top:21px;margin-bottom:8px}.import-right[data-v-c458deb8]{margin-top:30px}.import-right a[data-v-c458deb8]{text-decoration:none;color:#000}[data-v-c458deb8] .btn11{padding:0;width:14px;height:14px}.page[data-v-c458deb8]{margin-top:20px}

View File

@ -0,0 +1 @@
#nprogress{pointer-events:none}#nprogress .bar{background:#29d;position:fixed;z-index:1031;top:0;left:0;width:100%;height:2px}#nprogress .peg{display:block;position:absolute;right:0;width:100px;height:100%;box-shadow:0 0 10px #29d,0 0 5px #29d;opacity:1;transform:rotate(3deg) translateY(-4px)}#nprogress .spinner{display:block;position:fixed;z-index:1031;top:15px;right:15px}#nprogress .spinner-icon{width:18px;height:18px;box-sizing:border-box;border:2px solid transparent;border-top-color:#29d;border-left-color:#29d;border-radius:50%;-webkit-animation:nprogress-spinner .4s linear infinite;animation:nprogress-spinner .4s linear infinite}.nprogress-custom-parent{overflow:hidden;position:relative}.nprogress-custom-parent #nprogress .bar,.nprogress-custom-parent #nprogress .spinner{position:absolute}@-webkit-keyframes nprogress-spinner{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(1turn)}}@keyframes nprogress-spinner{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a[data-v-28cd2abf]{text-decoration:none;color:#fff}.conent[data-v-28cd2abf]{width:100%;min-height:calc(100vh - 200px);position:relative}.btn[data-v-28cd2abf]{height:104px;border-radius:5px;display:flex;align-items:center}.btn .el-button[data-v-28cd2abf]{width:114px;height:44px;border-radius:3px}.table[data-v-28cd2abf]{margin-top:20px}.block[data-v-28cd2abf]{margin-top:30px}

2
public/dist/js/app.b4b4e137.js vendored Normal file

File diff suppressed because one or more lines are too long

1
public/dist/js/app.b4b4e137.js.map vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,4 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-61dfd850"],{"0a5a":function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return s}));const r="admin_token";function i(){return localStorage.getItem("token")}function s(){return localStorage.removeItem(r)}},"13cd":function(e,t,n){"use strict";n("28b1")},"1e4b":function(e,t,n){"use strict";n.r(t);var r=function(){var e=this,t=e._self._c;return t("div",[t("el-container",[t("el-container",[t("el-aside",{class:e.show?"width":"width1"},[t("el-menu",{attrs:{router:"","background-color":"#282c34","text-color":"#fff","default-active":e.$route.path}},e._l(e.menu,(function(n){return t("div",{key:n.id},[n.children?t("el-submenu",{attrs:{index:n.code}},[t("template",{slot:"title"},[t("span",[e._v(e._s(n.name))])]),e._l(n.children,(function(n){return t("el-menu-item",{key:n.id,attrs:{index:n.code}},[e._v(e._s(n.name))])}))],2):t("el-menu-item",{attrs:{index:n.code}},[t("span",[e._v(e._s(n.name))])])],1)})),0)],1),t("el-main",[t("div",{staticClass:"head"},[t("ul",[t("li",[t("div",{staticClass:"add",on:{click:e.add}},[e.show?t("i",{staticClass:"el-icon-s-unfold"}):t("i",{staticClass:"el-icon-s-fold"})]),t("div",{staticClass:"right"},[t("el-breadcrumb",{attrs:{"separator-class":"el-icon-arrow-right"}},e._l(e.titie,(function(n,r){return t("el-breadcrumb-item",{key:r},[e._v(e._s(n.name))])})),1)],1)]),t("li",[t("div",{staticClass:"token",on:{click:e.hanleLogout}},[e._v("退出")])])])]),t("div",{staticClass:"box-card"},[t("router-view")],1)])],1)],1)],1)},i=[],s=n("0a5a"),a=n("adb5");function o(){return Object(a["a"])({url:"/api/menus",method:"get"})}var u={mounted(){o().then(e=>{this.menu=e.data.data})},data(){return{menu:[],show:!1,levelData:[],titie:[],head:"",onindex:0,openeds:["1"]}},watch:{$route:{handler:function(e){this.titie=e.matched,this.head=e.name,this.levelData.push({name:e.name,path:e.path});const t=[],n={};for(var r=0;r<this.levelData.length;r++)n[this.levelData[r].name]||(t.push(this.levelData[r]),n[this.levelData[r].name]=!0);this.levelData=t},deep:!0,immediate:!0}},methods:{next(){this.hanletop()},hanletop(){document.getElementById("bottom").scrollIntoView({behavior:"smooth"})},hanlebottom(){document.getElementById("top").scrollIntoView({behavior:"smooth"})},hanleLogout(){Object(s["b"])(),this.$router.push({path:"/Login"})},handlerclick(e){this.$route.path!==e&&this.$router.push({path:e})},add(){this.show=!this.show},hanblDelete(e,t){var n=this.levelData[e].name;if(this.onindex=e,this.levelData.splice(this.onindex,1),t===this.head){var r,i;for(let e=0;e<this.levelData.length;e++)r=this.levelData[e].path,i=this.levelData[e].name;this.levelData.length&&i!==n&&this.$router.push({path:r})}}}},c=u,l=(n("13cd"),n("0b56")),d=Object(l["a"])(c,r,i,!1,null,"604626ee",null);t["default"]=d.exports},"28b1":function(e,t,n){},"38bc":function(e,t,n){var r,i;
/* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress
* @license MIT */(function(s,a){r=a,i="function"===typeof r?r.call(t,n,t,e):r,void 0===i||(e.exports=i)})(0,(function(){var e={version:"0.2.0"},t=e.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'<div class="bar" role="bar"><div class="peg"></div></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>'};function n(e,t,n){return e<t?t:e>n?n:e}function r(e){return 100*(-1+e)}function i(e,n,i){var s;return s="translate3d"===t.positionUsing?{transform:"translate3d("+r(e)+"%,0,0)"}:"translate"===t.positionUsing?{transform:"translate("+r(e)+"%,0)"}:{"margin-left":r(e)+"%"},s.transition="all "+n+"ms "+i,s}e.configure=function(e){var n,r;for(n in e)r=e[n],void 0!==r&&e.hasOwnProperty(n)&&(t[n]=r);return this},e.status=null,e.set=function(r){var o=e.isStarted();r=n(r,t.minimum,1),e.status=1===r?null:r;var u=e.render(!o),c=u.querySelector(t.barSelector),l=t.speed,d=t.easing;return u.offsetWidth,s((function(n){""===t.positionUsing&&(t.positionUsing=e.getPositioningCSS()),a(c,i(r,l,d)),1===r?(a(u,{transition:"none",opacity:1}),u.offsetWidth,setTimeout((function(){a(u,{transition:"all "+l+"ms linear",opacity:0}),setTimeout((function(){e.remove(),n()}),l)}),l)):setTimeout(n,l)})),this},e.isStarted=function(){return"number"===typeof e.status},e.start=function(){e.status||e.set(0);var n=function(){setTimeout((function(){e.status&&(e.trickle(),n())}),t.trickleSpeed)};return t.trickle&&n(),this},e.done=function(t){return t||e.status?e.inc(.3+.5*Math.random()).set(1):this},e.inc=function(t){var r=e.status;return r?("number"!==typeof t&&(t=(1-r)*n(Math.random()*r,.1,.95)),r=n(r+t,0,.994),e.set(r)):e.start()},e.trickle=function(){return e.inc(Math.random()*t.trickleRate)},function(){var t=0,n=0;e.promise=function(r){return r&&"resolved"!==r.state()?(0===n&&e.start(),t++,n++,r.always((function(){n--,0===n?(t=0,e.done()):e.set((t-n)/t)})),this):this}}(),e.render=function(n){if(e.isRendered())return document.getElementById("nprogress");u(document.documentElement,"nprogress-busy");var i=document.createElement("div");i.id="nprogress",i.innerHTML=t.template;var s,o=i.querySelector(t.barSelector),c=n?"-100":r(e.status||0),l=document.querySelector(t.parent);return a(o,{transition:"all 0 linear",transform:"translate3d("+c+"%,0,0)"}),t.showSpinner||(s=i.querySelector(t.spinnerSelector),s&&d(s)),l!=document.body&&u(l,"nprogress-custom-parent"),l.appendChild(i),i},e.remove=function(){c(document.documentElement,"nprogress-busy"),c(document.querySelector(t.parent),"nprogress-custom-parent");var e=document.getElementById("nprogress");e&&d(e)},e.isRendered=function(){return!!document.getElementById("nprogress")},e.getPositioningCSS=function(){var e=document.body.style,t="WebkitTransform"in e?"Webkit":"MozTransform"in e?"Moz":"msTransform"in e?"ms":"OTransform"in e?"O":"";return t+"Perspective"in e?"translate3d":t+"Transform"in e?"translate":"margin"};var s=function(){var e=[];function t(){var n=e.shift();n&&n(t)}return function(n){e.push(n),1==e.length&&t()}}(),a=function(){var e=["Webkit","O","Moz","ms"],t={};function n(e){return e.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,(function(e,t){return t.toUpperCase()}))}function r(t){var n=document.body.style;if(t in n)return t;var r,i=e.length,s=t.charAt(0).toUpperCase()+t.slice(1);while(i--)if(r=e[i]+s,r in n)return r;return t}function i(e){return e=n(e),t[e]||(t[e]=r(e))}function s(e,t,n){t=i(t),e.style[t]=n}return function(e,t){var n,r,i=arguments;if(2==i.length)for(n in t)r=t[n],void 0!==r&&t.hasOwnProperty(n)&&s(e,n,r);else s(e,i[1],i[2])}}();function o(e,t){var n="string"==typeof e?e:l(e);return n.indexOf(" "+t+" ")>=0}function u(e,t){var n=l(e),r=n+t;o(n,t)||(e.className=r.substring(1))}function c(e,t){var n,r=l(e);o(e,t)&&(n=r.replace(" "+t+" "," "),e.className=n.substring(1,n.length-1))}function l(e){return(" "+(e.className||"")+" ").replace(/\s+/gi," ")}function d(e){e&&e.parentNode&&e.parentNode.removeChild(e)}return e}))},"70e7":function(e,t,n){},adb5:function(e,t,n){"use strict";var r=n("4ff3"),i=n.n(r),s=n("0a5a"),a=n("38bc"),o=n.n(a),u=(n("70e7"),n("5422")),c=(n("a18c"),i.a.create({timeout:1e4}));c.interceptors.request.use(e=>(e.headers.Authorization="Bearer "+Object(s["a"])(),o.a.start(),e),e=>(console.log(e,"222222"),Promise.reject(e))),c.interceptors.response.use(e=>{o.a.done();const t=e.status;if(200===t||201===t)return e;Object(u["Message"])({message:"Error",type:"error"})},e=>(console.log(e),Object(u["Message"])({message:e,type:"error"}),Promise.reject(e))),t["a"]=c}}]);
//# sourceMappingURL=chunk-61dfd850.062a0fb8.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

BIN
resources/frontend/dist.zip Normal file

Binary file not shown.

View File

@ -1,5 +1,5 @@
{
"name": "hello-world",
"name": "ERP系统",
"version": "0.1.0",
"lockfileVersion": 1,
"requires": true,

View File

@ -11,7 +11,7 @@
"axios": "^0.21.1",
"core-js": "^3.6.5",
"echarts": "^5.3.2",
"element-ui": "^2.15.8",
"element-ui": "^2.15.6",
"js-cookie": "^3.0.1",
"nprogress": "^0.2.0",
"vue": "^2.6.11",

View File

@ -1,19 +1,20 @@
<template>
<div id="app">
<router-view/>
<keep-alive>
<router-view v-if="$route.meta.keepAlive" />
</keep-alive>
<router-view v-if="!$route.meta.keepAlive" />
</div>
</template>
<script>
import { getToken } from '@/util/auth'
export default {
created () {
if (!getToken()) {
this.$router.push({ name: 'logo' })
}
}
}
// import { getToken } from "@/util/auth";
export default {
// created() {
// if (!getToken()) {
// this.$router.push({ name: "Login" });
// }
// },
};
</script>
<style lang="scss">
</style>
<style lang="scss"></style>

View File

@ -0,0 +1,9 @@
<template>
<div>
<UploadExcel :on-success="handleSuccess" :before-upload="beforeUpload" />
</div>
</template>
<script>
</script>

View File

@ -1,10 +1,69 @@
import http from '@/util/http.js'
import http from "@/util/http.js";
// 商品管理列表
export function goods (data) {
export function goods(params) {
return http({
url: '/api/goods',
method: 'get',
data
})
url: "/api/goods_skus",
method: "get",
params,
});
}
// 新建商品
export function addGoods(data) {
return http({
url: "/api/goods",
method: "post",
data,
});
}
// 查看商品
export function checkGoods(id) {
return http({
url: `/api/goods_skus/${id}`,
method: "get",
});
}
// 商品列表
export function goodsList(params) {
return http({
url: "/api/goods",
method: "get",
params,
});
}
// 更新商品
export function updateGoods(id, data) {
return http({
url: `/api/goods_skus/${id}`,
method: "patch",
data,
});
}
// 上新/库存盘点/库存
export function update(data) {
return http({
url: "/api/batch/goods_skus",
method: "patch",
data,
});
}
// 单个字段更新
export function singleUpdate(id, data) {
return http({
url: `/api/single/goods_skus/${id}`,
method: "patch",
data,
});
}
// 图片上传
export function imgUpload(data, item) {
return http({
url: "/api/upload",
Headers: item,
method: "post",
data,
});
}

View File

@ -7,7 +7,7 @@
* @FilePath: /glxt/src/api/rankingData.js
*/
import http from '@/util/http.js'
import http from "@/util/http.js";
// export function rankingData(data) {
// // 传递参数
// return http({
@ -20,90 +20,88 @@ import http from '@/util/http.js'
export function postadd(params) {
// 传递id
return http({
url: '/api/admin/auth/login', // 传递id
method: 'post',
params: params
})
url: "/api/admin/auth/login", // 传递id
method: "post",
params: params,
});
}
// 列表
export function store_list(params) {
return http({
url: '/api/admin/shopGroups',
method: 'get',
params: params
})
url: "/api/admin/shopGroups",
method: "get",
params: params,
});
}
export function storeDetail(params) {
return http({
url: '/storess/show',
method: 'get',
params: params
})
url: "/storess/show",
method: "get",
params: params,
});
}
// 鲜花项目接口从这里开始
// 商品种类列表
export function goods_types(data) {
return http({
url: '/api/goods_types',
method: 'get',
data
})
url: "/api/goods_types",
method: "get",
data,
});
}
// 商品种类列表删除
export function Delgoods_types(id) {
return http({
url: `/api/goods_types/${id}`,
method: 'delete',
})
method: "delete",
});
}
// 新增种类
export function Addgoods_types(data) {
return http({
url: `/api/goods_types/`,
method: 'post',
data
})
url: "/api/goods_types/",
method: "post",
data,
});
}
// 编辑种类
export function editGoods_types(id, data) {
return http({
url: `/api/goods_types/${id}`,
method: 'patch',
data
})
method: "patch",
data,
});
}
// 商品品牌列表
export function Brand_goods_types(data) {
return http({
url: '/api/goods_brands',
method: 'get',
data
})
url: "/api/goods_brands",
method: "get",
data,
});
}
// 商品品牌列表删除
export function DelBrand_goods_types(id) {
return http({
url: `/api/goods_brands/${id}`,
method: 'delete',
})
method: "delete",
});
}
// 新增品牌
export function AddBrandgoods_types(data) {
return http({
url: '/api/goods_brands',
method: 'post',
data
})
url: "/api/goods_brands",
method: "post",
data,
});
}
// 编辑品牌
export function editBrand_types(id, data) {
return http({
url: `/api/goods_brands/${id}`,
method: 'patch',
data
})
method: "patch",
data,
});
}

11
resources/frontend/src/api/record.js vendored Normal file
View File

@ -0,0 +1,11 @@
import http from "@/util/http.js";
// 单品日志记录请求
export function recordList(params) {
return http({
url: "/api/logs",
method: "get",
params,
});
}

35
resources/frontend/src/api/role.js vendored Normal file
View File

@ -0,0 +1,35 @@
import http from "@/util/http.js";
// 角色管理页面请求
export function roleList() {
return http({
url: "/api/roles",
method: "get",
});
}
// 角色新增请求
export function roleAdd(data) {
return http({
url: "/api/roles",
method: "post",
data,
});
}
// 角色权限列表请求
export function jurisdiction() {
return http({
url: "/api/permissions",
method: "get",
});
}
// 角色权限编辑
export function jurisdictionEdit(id, data) {
return http({
url: `/api/roles/${id}/permissions`,
method: "post",
data,
});
}

34
resources/frontend/src/api/shop.js vendored Normal file
View File

@ -0,0 +1,34 @@
import http from "@/util/http.js";
// 店铺管理页面请求
// 店铺平台
export function shopListId() {
return http({
url: "/api/shop_platforms",
method: "get",
});
}
// 店铺新增
export function shopAdd(data) {
return http({
url: "/api/shops",
method: "post",
data,
});
}
// 店铺列表
export function storeList() {
return http({
url: "/api/shops",
method: "get",
});
}
// 下载商品
export function downloadGoods(id) {
return http({
url: `/api/download/${id}/goods`,
method: "get",
});
}

45
resources/frontend/src/api/user.js vendored Normal file
View File

@ -0,0 +1,45 @@
import http from "@/util/http.js";
//用户管理列表请求
// 角色列表请求
export function roleList() {
return http({
url: "/api/roles",
method: "get",
});
}
//用户列表请求
export function userList() {
return http({
url: "/api/users",
method: "get",
});
}
//用户新增请求
export function userAdd(data) {
return http({
url: "/api/users",
method: "post",
data,
});
}
// 用户管理点击编辑请求
export function userEdit(id) {
return http({
url: `/api/users/${id}`,
method: "get",
});
}
//编辑完确认请求
export function userConfirm(id, data) {
return http({
url: `/api/users/${id}`,
method: "patch",
data,
});
}

View File

@ -1,24 +1,28 @@
<template>
<div class="m-map">
<div class="search" v-if="placeSearch">
<div id="js-result" v-show="searchKey" class="result"></div>
<div class="search"
v-if="placeSearch">
<div id="js-result"
v-show="searchKey"
class="result"></div>
</div>
<div id="js-container" class="map">正在加载数据 ...</div>
<div id="js-container"
class="map">正在加载数据 ...</div>
</div>
</template>
<script>
import remoteLoad from '@/util/remoteLoad.js'
window._AMapSecurityConfig = {
securityJsCode: '4c7f32be1ae23595dd423fbdf337df3f'
securityJsCode: '4c7f32be1ae23595dd423fbdf337df3f',
}
// import { MapKey } from './config'
export default {
name: 'MapDrag',
props: {
searchKey: {
default: ''
}
default: '',
},
},
data() {
return {
@ -28,7 +32,7 @@ export default {
AMapUI: null,
AMap: null,
city: '',
geolocation: null
geolocation: null,
}
},
watch: {
@ -36,7 +40,7 @@ export default {
if (this.searchKey === '') {
this.placeSearch.clear()
}
}
},
},
async created() {
// API
@ -44,7 +48,9 @@ export default {
this.initMap()
// APIAPI
} else {
await remoteLoad('https://webapi.amap.com/maps?v=2.0&key=4b083a38fc17ad7c5e3df667931e0cf0')
await remoteLoad(
'https://webapi.amap.com/maps?v=2.0&key=4b083a38fc17ad7c5e3df667931e0cf0'
)
await remoteLoad('https://webapi.amap.com/ui/1.1/main.js')
this.initMap()
}
@ -67,7 +73,7 @@ export default {
AMapUI.loadUI(['misc/PositionPicker'], (PositionPicker) => {
const mapConfig = {
zoom: 16
zoom: 16,
}
const map = new AMap.Map('js-container', mapConfig)
//
@ -81,15 +87,23 @@ export default {
pageIndex: 1,
citylimit: false,
map: map,
panel: 'js-result'
panel: 'js-result',
// city: that.city, //
})
AMap.Event.addListener(that.placeSearch, 'listElementClick', function (e) {
AMap.Event.addListener(
that.placeSearch,
'listElementClick',
function (e) {
that.$emit('listElementClick', e)
})
AMap.Event.addListener(that.placeSearch, 'markerClick', function (e) {
}
)
AMap.Event.addListener(
that.placeSearch,
'markerClick',
function (e) {
that.$emit('listElementClick', e)
})
}
)
})
// citySearch.getLocalCity(function (status, result) {
// console.log('getLocalCity', status, result)
@ -100,29 +114,32 @@ export default {
// })
})
//
AMap.plugin(['AMap.ToolBar', 'AMap.Scale', 'AMap.Geolocation'], function () {
AMap.plugin(
['AMap.ToolBar', 'AMap.Scale', 'AMap.Geolocation'],
function () {
map.addControl(
new AMap.ToolBar({
position: 'RB'
position: 'RB',
})
)
map.addControl(
new AMap.Scale({
position: 'LB'
position: 'LB',
})
)
})
}
)
//
const positionPicker = new PositionPicker({
mode: 'dragMap', // 'dragMap''dragMarker''dragMap'
map: map //
map: map, //
})
//
positionPicker.start()
})
}
}
},
},
}
</script>

View File

@ -0,0 +1,215 @@
<!--
* @Description:头像上传组件
* @Author: czw (725551805@qq.com)
* @Date: 2022-03-03 18:50:30
* @LastEditors: czw (725551805@qq.com)
* @LastEditTime: 2022-03-14 09:14:24
* @FilePath: /glxt/src/views/home/home/index.vue
-->
<template>
<div>
<el-upload
name="image"
:action="uploadAction"
:headers="uploadHeaders"
:on-preview="handleChange"
:on-remove="beforeRemove"
:on-success="good"
:file-list="img"
:limit="number"
:before-upload="handleBeforeUpload"
:on-change="handleEditChange"
accept=".png,.jpg"
list-type="picture-card"
:class="hideUploadEdit ? 'hide' : ''"
:show-file-list="true"
>
<i class="el-icon-plus"></i>
</el-upload>
<div class="demo-image__preview" v-if="imageUrl">
<el-image
class="hidden__el-image"
ref="elImage"
:src="imageUrl"
:preview-src-list="previewSrcList"
>
</el-image>
</div>
</div>
</template>
<script>
import { getToken } from "@/util/auth";
export default {
name: "", //
components: {}, //
props: {
//
number: {
type: Number,
default: 1,
},
file: {
type: Array,
default: () => [],
},
}, //
data() {
return {
hideUploadEdit: false, //
url: "/api/upload", //
imageUrl: "", //
previewSrcList: [], //
list: [], //
img: [], //
};
},
computed: {
//
uploadAction() {
return "https://ct-upimg.yx090.com" + this.url;
},
//
uploadHeaders() {
return {
// authorization: 'Bearer' + getToken(),
"Content-Type": "multipart/form-data",
};
},
}, // data
watch: {
file: {
handler(val) {
if (val) {
// console.log(val, 'ppp')
var imges = [];
val.forEach((element) => {
imges = element.url.split(",");
this.list = imges;
});
imges.forEach((element) => {
this.img.push({ url: this.computedGetPictureSrc(element) });
});
const previewSrcList = imges.map((ele) => {
return this.computedGetPictureSrc(ele);
});
this.previewSrcList = previewSrcList;
if (val.length === this.number) {
this.hideUploadEdit = true;
}
}
},
deep: true,
immediate: true,
},
}, // data
methods: {
computedGetPictureSrc(src) {
return "https://ct-upimg.yx090.com/" + src;
},
/**
* @author: czw (725551805@qq.com)
* @description: 判断显示图片上传限制隐藏
* @param {*} file
* @param {*} fileList
* @return {*}
* @Date: 2022-03-03 21:16:54
*/
handleEditChange(file, fileList) {
if (fileList.length === this.number) {
this.hideUploadEdit = true;
}
},
/**
* @author: czw (725551805@qq.com)
* @description: 上传成功
* @param {*}
* @return {*}
* @Date: 2022-03-03 19:59:45
*/
good(file, fileList) {
this.previewSrcList.push(fileList.url);
console.log(this.previewSrcList, "------");
// file.data.forEach((element) => {
// this.list.push(element.url)
// })
this.$emit("urlimg", fileList.url);
},
/**
* @author: czw (725551805@qq.com)
* @description: 点击放大
* @param {*}
* @return {*}
* @Date: 2022-03-03 18:59:28
*/
handleChange(file) {
this.imageUrl = file.url;
this.$nextTick(() => {
this.$refs.elImage.clickHandler();
});
},
/**
* @author: czw (725551805@qq.com)
* @description:删除
* @param {*}
* @return {*}
* @Date: 2022-03-03 18:59:40
*/
beforeRemove(file, fileList) {
if (fileList.length === this.number) {
this.hideUploadEdit = true;
} else {
this.hideUploadEdit = false;
}
if (file.response) {
file.response.data.forEach((element) => {
for (var i = 0; i < this.list.length; i++) {
if (element.url === this.list[i]) {
this.list.splice(i, 1);
}
}
});
} else {
console.log(file, "iiii");
for (var i = 0; i < this.list.length; i++) {
if (file.url === this.computedGetPictureSrc(this.list[i])) {
this.list.splice(i, 1);
}
}
}
},
/**
* @author: czw (725551805@qq.com)
* @description:自动删除
* @param {*}
* @return {*}
* @Date: 2022-03-03 19:53:25
*/
handleBeforeUpload(file) {
const isLt2M = file.size / 1024 / 1024 < 2;
if (!isLt2M) {
this.$message.error("上传头像图片大小不能超过 2MB!");
return false;
}
},
}, //
};
</script>
<style lang="scss">
.demo-image__preview {
height: 0;
}
.hidden__el-image {
width: 0;
height: 0;
::v-deep .el-image__preview {
display: none;
}
}
.hide .el-upload--picture-card {
display: none;
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 316 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 560 B

View File

@ -1,12 +1,12 @@
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import '@/css/style.css'
import './router/index2'
import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css";
import "@/css/style.css";
import "./router/index2";
import axios from "axios";
// import Router from 'vue-router'
// const routerPush = Router.prototype.push
@ -14,12 +14,11 @@ import './router/index2'
// return routerPush.call(this, location).catch(error=> error)
// }
Vue.use(ElementUI)
Vue.config.productionTip = false
Vue.use(ElementUI);
Vue.config.productionTip = false;
new Vue({
router,
store,
render: h => h(App)
}).$mount('#app')
render: (h) => h(App),
}).$mount("#app");

View File

@ -1,12 +1,29 @@
import Vue from 'vue'
import VueRouter from 'vue-router'
import Vue from "vue";
import VueRouter from "vue-router";
// import axios from "axios";
Vue.use(VueRouter)
Vue.use(VueRouter);
const createRouter = () =>
new VueRouter({
scrollBehavior: () => ({ y: 0 })
})
scrollBehavior: () => ({ y: 0 }),
});
const router = createRouter()
export default router
const router = createRouter();
router.beforeEach((to, from, next) => {
// console.log(to,next);
const token = localStorage.getItem("token");
// 目标路由不是登录页并且还需要token验证还没有token那就直接给返回到登录页
if (to.name !== "Login" && !token) {
next({ name: "Login" });
} else {
// 目标路由是登录页-自然不需要token验证
// 或目标路由不需要身份验证
// 又或目标路由非登录页需要token验证但是有token
// next放行
next();
}
});
export default router;

View File

@ -1,77 +1,76 @@
/*
* @Description:
* @Author: czw (725551805@qq.com)
* @Date: 2022-02-25 10:40:17
* @LastEditors: czw (725551805@qq.com)
* @LastEditTime: 2022-03-01 20:29:32
* @FilePath: /glxt/src/router/index1.js
*/
const list = [
{
path: '/logo',
name: 'logo',
component: () => import('../views/logo.vue')
path: "/Login",
name: "Login",
component: () => import("../views/Login.vue"),
},
{
path: '/',
component: () => import('../views/index.vue'),
path: "/",
component: () => import("../views/index.vue"),
children: [
{
path: 'GOODS_LIST',
name: '商品列表',
component: () => import('../views/yingyeting/yingyeting.vue')
path: "GOODS_LIST",
name: "商品列表",
component: () => import("../views/yingyeting/yingyeting.vue"),
meta: {
keepAlive: true,
},
},
{
path: 'GOODS_TYPE',
name: '商品种类',
component: () => import('../views/home/home.vue')
path: "GOODS_TYPE",
name: "商品种类",
component: () => import("../views/home/home.vue"),
},
{
path: 'GOODS_BRAND',
name: '商品品牌',
component: () => import('../views/brand/brand.vue')
path: "GOODS_BRAND",
name: "商品品牌",
component: () => import("../views/brand/brand.vue"),
},
{
path: 'SHOP_MANAGE',
name: '店铺管理',
component: () => import('../views/store/store.vue')
path: "SHOP_MANAGE",
name: "店铺管理",
component: () => import("../views/store/store.vue"),
},
{
path: 'USER_MANAGE',
name: '用户管理',
component: () => import('../views/users/users.vue')
path: "USER_MANAGE",
name: "用户管理",
component: () => import("../views/users/users.vue"),
},
{
path: 'ROLE_MANAGE',
name: '角色管理',
component: () => import('../views/system/role.vue')
path: "ROLE_MANAGE",
name: "角色管理",
component: () => import("../views/system/role.vue"),
},
{
path: 'PERMISSION_MANAGE',
name: '权限管理',
component: () => import('../views/system/authority.vue')
path: "PERMISSION_MANAGE",
name: "权限管理",
component: () => import("../views/system/authority.vue"),
},
{
path: 'SYSTEM_LOG',
name: '商品记录',
component: () => import('../views/shuju/shuju.vue')
path: "SYSTEM_LOG",
name: "系统日志",
component: () => import("../views/shuju/shuju.vue"),
},
{
path: '/index/yingyeting/addgoods',
name: '新建商品',
component: () => import('../views/yingyeting/addgoods/addgoods.vue')
path: "GOODS_LOG",
name: "商品记录",
component: () => import("../views/shuju/record.vue"),
},
{
path: '/',
redirect: 'GOODS_LIST'
}
]
path: "ADDGOODS",
name: "新建商品",
component: () => import("../views/yingyeting/addgoods/addgoods.vue"),
},
{
path: '/',
redirect: '/index'
}
]
path: "/",
redirect: "GOODS_LIST",
},
],
},
// {
// path: "/",
// redirect: "/index",
// },
];
export default list
export default list;

View File

@ -1,13 +1,13 @@
const TokenKey = 'admin_token'
const TokenKey = "admin_token";
// 获取token
export function getToken() {
return localStorage.getItem(TokenKey)
return localStorage.getItem("token");
}
// 设置token
export function setToken(token) {
return localStorage.setItem(TokenKey, token)
return localStorage.setItem(TokenKey, token);
}
// 删除token
export function removeToken() {
return localStorage.removeItem(TokenKey)
return localStorage.removeItem(TokenKey);
}

View File

@ -6,60 +6,62 @@
* @LastEditTime: 2022-03-13 11:05:08
* @FilePath: /glxt/src/util/http.js
*/
import axios from 'axios'
import { getToken } from '@/util/auth'
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'
import { Message } from 'element-ui'
import router from '@/router'
import axios from "axios";
import { getToken } from "@/util/auth";
import NProgress from "nprogress";
import "nprogress/nprogress.css";
import { Message } from "element-ui";
import router from "@/router";
var instance = axios.create({
timeout: 10000
})
timeout: 10000,
});
instance.interceptors.request.use(
config => {
(config) => {
// config.headers['content-type'] = 'application/json'
// config.headers['Shop-Id'] = localStorage.getItem('shopId') || 1
// 在发送请求之前做些什么
// config.headers.Authorization = 'Bearer' + getToken() // 请求头
// config.headers.Authorization = "Bearer" + getToken(); // 请求头
// config.headers['content-type'] = 'application/json'
config.headers.Authorization = 'Bearer ' + getToken() // 请求头
NProgress.start()
console.log(config, '1111') // for debug
config.headers.Authorization = "Bearer " + getToken(); // 请求头
NProgress.start();
// console.log(config, '1111') // for debug
return config
return config;
},
error => {
(error) => {
// 对请求错误做些什么
console.log(error, '222222') // for debug
return Promise.reject(error)
console.log(error, "222222"); // for debug
return Promise.reject(error);
}
)
);
// 添加响应拦截器
instance.interceptors.response.use(
response => {
NProgress.done()
const res = response.status
(response) => {
NProgress.done();
const res = response.status;
// 对响应数据做点什么
console.log(response, '33333') // for debug
// console.log(response, '33333') // for debug
if (res === 200 || res === 201) {
return response
return response;
} else {
Message({
message: 'Error',
type: 'error'
})
message: "Error",
type: "error",
});
}
},
error => {
(error) => {
console.log(error);
// 对响应错误做点什么
console.log(error, '44444') // for debug
Message({
message: error,
type: "error",
});
// console.log(error, "44444"); // for debug
// if (error.response.status === 401) {
// Message({
// message: '账户登录过期,请重新登录',
@ -75,8 +77,8 @@ instance.interceptors.response.use(
// })
// }
return Promise.reject(error)
return Promise.reject(error);
}
)
);
export default instance
export default instance;

View File

@ -0,0 +1,188 @@
<template>
<div class="backimg">
<div class="sign">
<span class="title">Hi 欢迎使用</span>
<p class="manage">
<img src="../css/img/养花人2_画板 1 副本 15.png" alt="" /><span
>ERP管理系统</span
>
</p>
<p class="title-1">登录</p>
<input type="text" placeholder="请输入用户名" v-model="form.name" />
<br />
<input type="password" placeholder="请输入密码" v-model="form.password" />
<br />
<el-checkbox v-model="checked">记住密码</el-checkbox>
<br />
<el-button type="primary" @click="Login()">登录</el-button>
</div>
</div>
</template>
<script>
import axios from "axios";
export default {
data() {
return {
checked: false, //
form: {
//
name: "",
password: "",
},
};
},
mounted() {
this.getCookie();
},
methods: {
Login() {
// cookie
if (this.checked === true) {
this.setCookie(this.form.name, this.form.password, true, 7);
} else {
this.clearCookie();
}
//
if (this.form.name === "" || this.form.password === "") {
this.$message({
message: "账号或密码不能为空",
type: "error",
});
} else {
// let token = localStorage.getItem("token");
axios.post("/api/auth/login", this.form).then((res) => {
let data = res.data;
console.log(data);
if (data.error) {
this.$message({
message: "账号或密码错误,请重新输入",
type: "error",
});
this.form.name = "";
this.form.password = "";
this.checked = false;
}
if (data.token) {
this.form = {};
localStorage.setItem("token", data.token);
this.$message({
message: "成功登录,欢迎来到后台管理系统",
type: "success",
});
this.$router.push("/GOODS_LIST");
}
});
}
},
// cookie
setCookie(c_name, c_pwd, c_state, exdays) {
const exdate = new Date();
exdate.setTime(exdate.getTime() + 24 * 60 * 60 * 1000 * exdays); //
window.document.cookie =
"name" + "=" + c_name + ";path=/;expires=" + exdate.toGMTString();
window.document.cookie =
"password" + "=" + c_pwd + ";path=/;expires=" + exdate.toGMTString();
window.document.cookie =
"state" + "=" + c_state + ";path=/;expires=" + exdate.toGMTString();
},
// cookie
getCookie() {
if (document.cookie.length > 0) {
const arr = document.cookie.split("; ");
for (let i = 0; i < arr.length; i++) {
const arr2 = arr[i].split("=");
// console.log(arr[2]);
if (arr2[0] === "name") {
this.form.name = arr2[1];
} else if (arr2[0] === "password") {
this.form.password = arr2[1];
} else if (arr2[0] === "state") {
this.checked = Boolean(arr2[1]);
}
}
}
},
// cookie
clearCookie: function () {
this.setCookie("", "", false, -1);
},
},
};
</script>
<style lang="scss" scoped>
.backimg {
width: 100%;
height: 1080px;
background-image: url("./../css/img/组 32.png");
background-repeat: no-repeat;
background-size: 100%;
position: relative;
}
.sign {
width: 400px;
height: 500px;
position: absolute;
top: 270px;
right: 300px;
input {
width: 400px;
height: 51px;
border: 2px solid #bcbcbc;
opacity: 1;
border-radius: 5px;
margin-bottom: 25px;
}
.title {
width: 125px;
height: 23px;
font-size: 22px;
font-family: "BigruixianBlackGBV1.0";
font-weight: 400;
line-height: 23px;
color: #2b53ec;
opacity: 1;
}
.manage {
margin-top: 19px;
margin-bottom: 50px;
img {
margin-right: 20px;
}
span {
width: 340px;
height: 57px;
font-size: 54px;
font-family: "BigruixianBlackGBV1.0";
font-weight: 400;
line-height: 57px;
color: #2b53ec;
opacity: 1;
}
}
.title-1 {
width: 70px;
height: 35px;
font-size: 35px;
font-family: Source Han Sans CN;
font-weight: 500;
line-height: 60px;
color: #393939;
opacity: 1;
margin-bottom: 35px;
}
.el-button {
width: 400px;
height: 58px;
background: rgba(43, 83, 236);
border-radius: 5px;
margin-top: 40px;
}
.el-checkbox {
color: rgba(43, 83, 236);
}
}
</style>

View File

@ -1,73 +1,80 @@
<template>
<div>
<el-card>
<el-button type="primary"
@click="handAdd">新增</el-button>
<el-table ref="multipleTable"
<div class="conent">
<!-- 新增按钮 -->
<div class="btn">
<el-button type="primary" @click="handAdd">新增</el-button>
</div>
<!-- 列表 -->
<div class="table">
<el-table
ref="multipleTable"
:data="tableData"
tooltip-effect="dark"
style="width: 100%"
@selection-change="handleSelectionChange">
<el-table-column type="selection"
width="55">
</el-table-column>
<el-table-column prop="name"
label="商品种类">
</el-table-column>
<el-table-column prop=""
label="操作">
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55"> </el-table-column>
<el-table-column prop="name" label="商品品牌"> </el-table-column>
<el-table-column prop="" label="操作">
<template slot-scope="scope">
<el-button type="primary"
@click="handEdit(scope.row.id,scope.row)">编辑</el-button>
<el-button type="danger"
@click="handdel(scope.row.id)">删除</el-button>
<el-button type="primary" @click="handEdit(scope.row.id, scope.row)"
>编辑</el-button
>
<el-button type="danger" @click="handdel(scope.row.id)"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
</el-card>
<el-pagination @size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="page"
:page-sizes="[10, 20, 30, 40]"
:page-size="per_page"
:total="total"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 新增种类对话框 -->
<el-dialog title="新增种类"
:visible.sync="dialogFormVisible">
</div>
<!-- 新增品牌对话框 -->
<el-dialog
title="新增品牌"
:visible.sync="dialogFormVisible"
:close-on-click-modal="false"
>
<el-form :model="form">
<el-form-item label="商品种类"
:label-width="formLabelWidth">
<el-input v-model="form.kindName"
autocomplete="off"></el-input>
<el-form-item label="商品品牌" :label-width="formLabelWidth">
<el-input v-model="form.kindName"></el-input>
</el-form-item>
</el-form>
<div slot="footer"
class="dialog-footer">
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false"> </el-button>
<el-button type="primary"
@click="addSubmit"> </el-button>
<el-button type="primary" @click="addSubmit"> </el-button>
</div>
</el-dialog>
<!-- 编辑 -->
<el-dialog title="编辑"
:visible.sync="dialogFormVisible1">
<el-dialog
title="编辑"
:visible.sync="dialogFormVisible1"
:close-on-click-modal="false"
>
<el-form :model="form1">
<el-form-item label="编辑种类"
:label-width="formLabelWidth1">
<el-input v-model="form1.kindName1"
autocomplete="off"></el-input>
<el-form-item label="编辑品牌" :label-width="formLabelWidth1">
<el-input v-model="form1.kindName1"></el-input>
</el-form-item>
</el-form>
<div slot="footer"
class="dialog-footer">
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible1 = false"> </el-button>
<el-button type="primary"
@click="EditSubmit"> </el-button>
<el-button type="primary" @click="EditSubmit"> </el-button>
</div>
</el-dialog>
<!-- 分页功能 -->
<div class="block">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="current_page"
:page-sizes="[15, 50, 100]"
:page-size="per_page"
layout="total, sizes, prev, pager, next, jumper"
:total="Paginationdata.total"
>
</el-pagination>
</div>
</div>
</template>
@ -77,72 +84,77 @@ import {
DelBrand_goods_types,
AddBrandgoods_types,
editBrand_types,
} from '../../api/rankingData'
} from "../../api/rankingData";
import axios from "axios";
export default {
data() {
return {
id: '', //id
page: 1,
per_page: 15,
id: "", //id
tableData: [],
multipleSelection: [],
currentPage4: 4,
dialogFormVisible: false,
dialogFormVisible1: false,
form: {
kindName: '', //
kindName: "", //
},
form1: {
kindName1: '', //
kindName1: "", //
},
formLabelWidth: '120px',
formLabelWidth1: '120px',
formLabelWidth: "120px",
formLabelWidth1: "120px",
newKind: [],
}
Paginationdata: {}, //
current_page: 1, //
per_page: 15, //
};
},
created() {
this.getGoods_types()
this.getGoods_types();
},
methods: {
//
handleSelectionChange(val) {
console.log(val)
this.multipleSelection = val
console.log(val);
this.multipleSelection = val;
},
//
//
handleSizeChange(val) {
console.log(`每页 ${val}`)
//
this.per_page = val;
this.getGoods_types();
},
handleCurrentChange(val) {
console.log(`当前页: ${val}`)
//
this.current_page = val;
this.getGoods_types();
},
//
handAdd() {
this.form.kindName = ''
this.dialogFormVisible = true
this.form.kindName = "";
this.dialogFormVisible = true;
},
//
addSubmit() {
var string
string = this.form.kindName.replace(/\s/g, ',').split(',')
console.log(string, 'lkkkk')
var string;
string = this.form.kindName.replace(/\s/g, ",").split(",");
console.log(string, "lkkkk");
AddBrandgoods_types({
names: string,
}).then((res) => {
this.$message({
type: 'success',
message: '添加成功',
})
this.getGoods_types()
})
this.dialogFormVisible = false
type: "success",
message: "添加成功",
});
this.getGoods_types();
});
this.dialogFormVisible = false;
},
//
handEdit(id, item) {
this.id = id
console.log('item', item)
this.form1.kindName1 = item.name
this.dialogFormVisible1 = true
this.id = id;
// console.log("item", item);
this.form1.kindName1 = item.name;
this.dialogFormVisible1 = true;
},
//
EditSubmit() {
@ -150,50 +162,73 @@ export default {
name: this.form1.kindName1,
}).then((res) => {
this.$message({
type: 'success',
message: '编辑成功',
})
this.getGoods_types()
})
this.dialogFormVisible1 = false
type: "success",
message: "编辑成功",
});
this.getGoods_types();
});
this.dialogFormVisible1 = false;
},
//
handdel(id) {
this.$confirm('确定删除此条商品种类吗?', '确认删除', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
this.$confirm("确定删除此条商品品牌吗?", "确认删除", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
DelBrand_goods_types(id).then((res) => {
this.getGoods_types()
})
this.getGoods_types();
});
this.$message({
type: 'success',
message: '删除成功!',
})
type: "success",
message: "删除成功!",
});
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消删除',
})
})
type: "info",
message: "已取消删除",
});
});
},
//
getGoods_types() {
Brand_goods_types({
page: this.page,
let page = {
page: this.current_page,
per_page: this.per_page,
}).then((res) => {
console.log('res=>>>>>>>>', res)
this.tableData = res.data.data
this.total = res.data.data.length
})
};
Brand_goods_types(page).then((res) => {
this.tableData = res.data.data;
this.Paginationdata = res.data.meta;
});
},
},
}
};
</script>
<style>
<style lang="scss" scoped>
.conent {
width: 100%;
min-height: calc(100vh - 200px);
position: relative;
}
.btn {
height: 104px;
border-radius: 5px;
display: flex;
align-items: center;
.el-button {
width: 114px;
height: 44px;
border-radius: 3px;
}
}
.table {
margin-top: 20px;
}
.block {
margin-top: 30px;
}
</style>

View File

@ -1,72 +1,81 @@
<template>
<div>
<el-card>
<el-button type="primary"
@click="handAdd">新增</el-button>
<el-table ref="multipleTable"
<div class="conent">
<!-- 新增按钮 -->
<div class="btn">
<el-button type="primary" @click="handAdd">新增</el-button>
</div>
<!-- 列表 -->
<div class="table">
<el-table
ref="multipleTable"
:data="tableData"
tooltip-effect="dark"
style="width: 100%"
@selection-change="handleSelectionChange">
<el-table-column type="selection"
width="55">
</el-table-column>
<el-table-column prop="name"
label="商品种类">
</el-table-column>
<el-table-column prop=""
label="操作">
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55"> </el-table-column>
<el-table-column prop="name" label="商品种类"> </el-table-column>
<el-table-column prop="" label="操作">
<template slot-scope="scope">
<el-button type="primary"
@click="handEdit(scope.row.id,scope.row)">编辑</el-button>
<el-button type="danger"
@click="handdel(scope.row.id)">删除</el-button>
<el-button type="primary" @click="handEdit(scope.row.id, scope.row)"
>编辑</el-button
>
<el-button type="danger" @click="handdel(scope.row.id)"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
</el-card>
<el-pagination @size-change="handleSizeChange"
</div>
<!-- 新增种类对话框 -->
<el-dialog
title="新增"
:visible.sync="dialogFormVisible"
:close-on-click-modal="false"
>
<el-form :model="form">
<el-form-item label="商品种类" :label-width="formLabelWidth">
<el-input v-model="form.kindName" autocomplete="off"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false"> </el-button>
<el-button type="primary" @click="addSubmit"> </el-button>
</div>
</el-dialog>
<!-- 编辑 -->
<el-dialog
title="编辑"
:visible.sync="dialogFormVisible1"
:close-on-click-modal="false"
>
<el-form :model="form1">
<el-form-item label="编辑种类" :label-width="formLabelWidth1">
<el-input v-model="form1.kindName1" autocomplete="off"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible1 = false"> </el-button>
<el-button type="primary" @click="EditSubmit"> </el-button>
</div>
</el-dialog>
<!-- 分页功能 -->
<div class="block">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="page"
:current-page="current_page"
:page-sizes="[15, 50, 100]"
:page-size="per_page"
layout="total, sizes, prev, pager, next, jumper"
:total="total">
:total="Paginationdata.total"
>
</el-pagination>
<!-- 新增种类对话框 -->
<el-dialog title="新增"
:visible.sync="dialogFormVisible">
<el-form :model="form">
<el-form-item label="商品种类"
:label-width="formLabelWidth">
<el-input v-model="form.kindName"
autocomplete="off"></el-input>
</el-form-item>
</el-form>
<div slot="footer"
class="dialog-footer">
<el-button @click="dialogFormVisible = false"> </el-button>
<el-button type="primary"
@click="addSubmit"> </el-button>
</div>
</el-dialog>
<!-- 编辑 -->
<el-dialog title="编辑"
:visible.sync="dialogFormVisible1">
<el-form :model="form1">
<el-form-item label="编辑种类"
:label-width="formLabelWidth1">
<el-input v-model="form1.kindName1"
autocomplete="off"></el-input>
</el-form-item>
</el-form>
<div slot="footer"
class="dialog-footer">
<el-button @click="dialogFormVisible1 = false"> </el-button>
<el-button type="primary"
@click="EditSubmit"> </el-button>
</div>
</el-dialog>
</div>
</template>
@ -76,78 +85,78 @@ import {
Delgoods_types,
Addgoods_types,
editGoods_types,
} from '../../api/rankingData'
} from "../../api/rankingData";
import axios from "axios";
export default {
data() {
return {
id: '', //id
page: 1, //
per_page: 10, //
total: 1,
id: "", //id
tableData: [],
multipleSelection: [],
currentPage4: 4,
dialogFormVisible: false,
dialogFormVisible1: false,
form: {
kindName: '', //
kindName: "", //
},
form1: {
kindName1: '', //
kindName1: "", //
},
formLabelWidth: '120px',
formLabelWidth1: '120px',
formLabelWidth: "120px",
formLabelWidth1: "120px",
newKind: [],
}
Paginationdata: {}, //
current_page: 1, //
per_page: 15, //
};
},
created() {
this.getGoods_types()
this.getGoods_types();
},
methods: {
//
handleSelectionChange(val) {
console.log(val)
this.multipleSelection = val
console.log(val);
this.multipleSelection = val;
},
//
//
handleSizeChange(val) {
console.log(`每页 ${val}`)
this.per_page = val
this.page = 1
this.getGoods_types()
//
this.per_page = val;
this.getGoods_types();
},
handleCurrentChange(val) {
console.log(`当前页: ${val}`)
this.page = val
this.getGoods_types()
//
this.current_page = val;
this.getGoods_types();
},
//
handAdd() {
this.form.kindName = ''
this.dialogFormVisible = true
this.form.kindName = "";
this.dialogFormVisible = true;
},
//
addSubmit() {
var string
string = this.form.kindName.replace(/\s/g, ',').split(',')
console.log(string, 'lkkkk')
var string;
string = this.form.kindName.replace(/\s/g, ",").split(",");
console.log(string, "lkkkk");
Addgoods_types({
names: string,
}).then((res) => {
this.$message({
type: 'success',
message: '添加成功',
})
this.getGoods_types()
})
this.dialogFormVisible = false
type: "success",
message: "添加成功",
});
this.getGoods_types();
});
this.dialogFormVisible = false;
},
//
handEdit(id, item) {
this.id = id
console.log('item', item)
this.form1.kindName1 = item.name
this.dialogFormVisible1 = true
this.id = id;
// console.log("item", item);
this.form1.kindName1 = item.name;
this.dialogFormVisible1 = true;
},
//
EditSubmit() {
@ -155,52 +164,72 @@ export default {
name: this.form1.kindName1,
}).then((res) => {
this.$message({
type: 'success',
message: '编辑成功',
})
this.getGoods_types()
})
this.dialogFormVisible1 = false
type: "success",
message: "编辑成功",
});
this.getGoods_types();
});
this.dialogFormVisible1 = false;
},
//
handdel(id) {
this.$confirm('确定删除此条商品种类吗?', '确认删除', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
this.$confirm("确定删除此条商品种类吗?", "确认删除", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
Delgoods_types(id).then((res) => {
this.getGoods_types()
})
this.getGoods_types();
});
this.$message({
type: 'success',
message: '删除成功!',
})
type: "success",
message: "删除成功!",
});
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消删除',
})
})
type: "info",
message: "已取消删除",
});
});
},
//
getGoods_types() {
goods_types({
page: this.page,
let page = {
page: this.current_page,
per_page: this.per_page,
}).then((res) => {
console.log('res=>>>>>>>>', res)
this.tableData = res.data.data
this.total = res.data.data.length
this.page = res.meta.current_page
this.per_page = res.meta.per_page
})
};
goods_types(page).then((res) => {
this.tableData = res.data.data;
this.Paginationdata = res.data.meta;
});
},
},
}
};
</script>
<style lang="scss" scoped>
.conent {
width: 100%;
min-height: calc(100vh - 200px);
position: relative;
}
.btn {
height: 104px;
border-radius: 5px;
display: flex;
align-items: center;
.el-button {
width: 114px;
height: 44px;
border-radius: 3px;
}
}
.table {
margin-top: 20px;
}
<style>
.block {
margin-top: 30px;
}
</style>

View File

@ -7,34 +7,25 @@
* @FilePath: /glxt/src/views/home/home/cesi.vue
-->
<template>
<div >
</div>
<div></div>
</template>
<script>
export default {
data() {
return {
}
return {};
},
created () {
},
mounted () {
},
created() {},
mounted() {},
methods: {
//
preventRepeatClick() {
this.isDisabled = true
this.isDisabled = true;
setTimeout(() => {
this.isDisabled = false
}, 1000)
}
}
}
this.isDisabled = false;
}, 1000);
},
},
};
</script>

View File

@ -14,7 +14,7 @@
:headers="uploadHeaders"
:on-preview="handleChange"
:on-remove="beforeRemove"
:on-success='good'
:on-success="good"
:file-list="img"
:limit="number"
:before-upload="handleBeforeUpload"
@ -22,12 +22,12 @@
accept=".png,.jpg"
list-type="picture-card"
:class="hideUploadEdit ? 'hide' : ''"
:show-file-list='true'
:show-file-list="true"
>
<i class="el-icon-plus"></i>
</el-upload>
<div class="demo-image__preview" v-if='imageUrl'>
<div class="demo-image__preview" v-if="imageUrl">
<el-image
class="hidden__el-image"
ref="elImage"
@ -38,81 +38,77 @@
</div>
{{ list }}
</div>
</template>
<script>
import {  getToken } from '@/util/auth'
export default {
name: '', //
import { getToken } from "@/util/auth";
export default {
name: "", //
components: {}, //
props: {
//
number: {
type: Number,
default: 1
default: 1,
},
file: {
type: Array,
default: () => []
}
default: () => [],
},
}, //
data () {
return {
data() {
return {
hideUploadEdit: false, //
url: '/qiniuupload', //
imageUrl: '', //
url: "/qiniuupload", //
imageUrl: "", //
previewSrcList: [], //
list: [], //
img: [] //
}
img: [], //
};
},
computed: {
// 
uploadAction () {
return 'https://dev.zonmind.com/home' + this.url
uploadAction() {
return "https://dev.zonmind.com/home" + this.url;
},
// 
uploadHeaders () {
return {
authorization: 'Bearer' + getToken()
}
}
uploadHeaders() {
return {
authorization: "Bearer" + getToken(),
};
},
}, // data
watch: {
file: {
handler(val) {
if (val) {
console.log(val, 'ppp')
var imges = []
// console.log(val, "ppp");
var imges = [];
val.forEach((element) => {
imges = element.url.split(',')
this.list = imges
})
imges.forEach(element => {
this.img.push({ url: this.computedGetPictureSrc(element) })
})
imges = element.url.split(",");
this.list = imges;
});
imges.forEach((element) => {
this.img.push({ url: this.computedGetPictureSrc(element) });
});
const previewSrcList = imges.map((ele) => {
return this.computedGetPictureSrc(ele)
})
this.previewSrcList = previewSrcList
return this.computedGetPictureSrc(ele);
});
this.previewSrcList = previewSrcList;
if (val.length === this.number) {
this.hideUploadEdit = true
this.hideUploadEdit = true;
}
}
},
deep: true,
immediate: true
}
immediate: true,
},
}, // data
created() {}, // -(访this)
mounted() {}, // -(访DOM)
methods: {
computedGetPictureSrc(src) {
return 'https://devcdn.zonmind.com' + src
return "https://devcdn.zonmind.com" + src;
},
/**
* @author: czw (725551805@qq.com)
@ -124,7 +120,7 @@ export default {
*/
handleEditChange(file, fileList) {
if (fileList.length === this.number) {
this.hideUploadEdit = true
this.hideUploadEdit = true;
}
},
/**
@ -135,12 +131,12 @@ export default {
* @Date: 2022-03-03 19:59:45
*/
good(file, fileList) {
this.previewSrcList.push(fileList.url)
file.data.forEach(element => {
this.list.push(element.url)
})
this.previewSrcList.push(fileList.url);
file.data.forEach((element) => {
this.list.push(element.url);
});
this.$emit('urlimg', this.list)
this.$emit("urlimg", this.list);
},
/**
* @author: czw (725551805@qq.com)
@ -150,10 +146,10 @@ export default {
* @Date: 2022-03-03 18:59:28
*/
handleChange(file) {
this.imageUrl = file.url
this.imageUrl = file.url;
this.$nextTick(() => {
this.$refs.elImage.clickHandler()
})
this.$refs.elImage.clickHandler();
});
},
/**
* @author: czw (725551805@qq.com)
@ -164,23 +160,23 @@ export default {
*/
beforeRemove(file, fileList) {
if (fileList.length === this.number) {
this.hideUploadEdit = true
this.hideUploadEdit = true;
} else {
this.hideUploadEdit = false
this.hideUploadEdit = false;
}
if (file.response) {
file.response.data.forEach(element => {
file.response.data.forEach((element) => {
for (var i = 0; i < this.list.length; i++) {
if (element.url === this.list[i]) {
this.list.splice(i, 1)
this.list.splice(i, 1);
}
}
})
});
} else {
console.log(file, 'iiii')
console.log(file, "iiii");
for (var i = 0; i < this.list.length; i++) {
if (file.url === this.computedGetPictureSrc(this.list[i])) {
this.list.splice(i, 1)
this.list.splice(i, 1);
}
}
}
@ -193,15 +189,14 @@ export default {
* @Date: 2022-03-03 19:53:25
*/
handleBeforeUpload(file) {
const isLt2M = file.size / 1024 / 1024 < 2
const isLt2M = file.size / 1024 / 1024 < 2;
if (!isLt2M) {
this.$message.error('上传头像图片大小不能超过 2MB!')
return false
}
}
} //
this.$message.error("上传头像图片大小不能超过 2MB!");
return false;
}
},
}, //
};
</script>
<style lang="scss">

View File

@ -3,24 +3,26 @@
<el-container>
<el-container>
<el-aside :class="show ? 'width' : 'width1'">
<el-menu router
background-color='#282c34'
text-color='#fff'
:default-active='$route.path'>
<div v-for="item in menu"
:key="item.id">
<el-menu-item :index="item.code"
v-if="!item.children">
<el-menu
router
background-color="#282c34"
text-color="#fff"
:default-active="$route.path"
>
<div v-for="item in menu" :key="item.id">
<el-menu-item :index="item.code" v-if="!item.children">
<span>{{ item.name }}</span>
</el-menu-item>
<el-submenu v-else
:index="item.code">
<el-submenu v-else :index="item.code">
<template slot="title">
<span>{{ item.name }}</span>
</template>
<el-menu-item :index="items.code"
<el-menu-item
:index="items.code"
:key="items.id"
v-for="items in item.children">{{items.name}}</el-menu-item>
v-for="items in item.children"
>{{ items.name }}</el-menu-item
>
</el-submenu>
</div>
</el-menu>
@ -29,58 +31,55 @@
<div class="head">
<ul>
<li>
<div @click="add"
class="add">
<i class="el-icon-s-unfold"
v-if="show"></i>
<i class="el-icon-s-fold"
v-else></i>
<div @click="add" class="add">
<i class="el-icon-s-unfold" v-if="show"></i>
<i class="el-icon-s-fold" v-else></i>
</div>
<div class="right">
<el-breadcrumb separator-class="el-icon-arrow-right">
<el-breadcrumb-item v-for="(item , index) in titie"
:key="index">{{item.name}}</el-breadcrumb-item>
<el-breadcrumb-item
v-for="(item, index) in titie"
:key="index"
>{{ item.name }}</el-breadcrumb-item
>
</el-breadcrumb>
</div>
</li>
<li>
<div class="token"
@click="hanleLogout">
退出
</div>
<div class="token" @click="hanleLogout">退出</div>
</li>
</ul>
</div>
<div class="table"
v-if="levelData.length">
<!-- <div class="table" v-if="levelData.length">
<ul>
<li> <i class="el-icon-arrow-left"
@click="hanlebottom"></i></li>
<li><i class="el-icon-arrow-left" @click="hanlebottom"></i></li>
<li>
<div class="Navigation"
v-if="levelData.length"
id="Navigation">
<div class="Navigation" v-if="levelData.length" id="Navigation">
<div id="top"></div>
<div v-for="(item , index) in levelData"
<div
v-for="(item, index) in levelData"
:key="index"
class="tab">
<span :class="head===item.name?'red':''"
@click="handlerclick(item.path)">{{item.name}}</span>
<div class="closure"
class="tab"
>
<span
:class="head === item.name ? 'red' : ''"
@click="handlerclick(item.path)"
>{{ item.name }}</span
>
<div
class="closure"
:class="head === item.name ? 'red_1' : ''"
@click="hanblDelete(index,item.name)">
@click="hanblDelete(index, item.name)"
>
<i class="el-icon-close"></i>
</div>
</div>
<div id="bottom"></div>
</div>
</li>
<li><i class="el-icon-arrow-right"
@click="hanletop"></i></li>
<li><i class="el-icon-arrow-right" @click="hanletop"></i></li>
</ul>
</div>
</div> -->
<div class="box-card">
<router-view></router-view>
</div>
@ -90,13 +89,13 @@
</div>
</template>
<script>
import { removeToken } from '@/util/auth'
import { getMenu } from '../api/menu.js'
import { removeToken } from "@/util/auth";
import { getMenu } from "../api/menu.js";
export default {
mounted() {
getMenu().then((res) => {
this.menu = res.data.data
})
this.menu = res.data.data;
});
},
data() {
return {
@ -104,28 +103,30 @@ export default {
show: false, //
levelData: [], // table
titie: [], // 线
head: '', // name
head: "", // name
onindex: 0, //
}
openeds: ["1"],
};
},
watch: {
// table
$route: {
handler: function (val) {
console.log(val, 99999)
this.titie = val.matched
this.head = val.name
this.levelData.push({ name: val.name, path: val.path })
const newArr = []
const obj = {}
// console.log("0.0", val);
this.titie = val.matched;
this.head = val.name;
this.levelData.push({ name: val.name, path: val.path });
const newArr = [];
const obj = {};
for (var i = 0; i < this.levelData.length; i++) {
if (!obj[this.levelData[i].name]) {
newArr.push(this.levelData[i])
obj[this.levelData[i].name] = true
newArr.push(this.levelData[i]);
obj[this.levelData[i].name] = true;
}
}
this.levelData = newArr
this.levelData = newArr;
// console.log("table", this.levelData);
},
deep: true,
immediate: true,
@ -140,7 +141,7 @@ export default {
* @Date: 2022-03-02 19:50:50
*/
next() {
this.hanletop()
this.hanletop();
},
/**
* @author: czw (725551805@qq.com)
@ -150,7 +151,7 @@ export default {
* @Date: 2022-03-02 19:51:03
*/
hanletop() {
document.getElementById('bottom').scrollIntoView({ behavior: 'smooth' })
document.getElementById("bottom").scrollIntoView({ behavior: "smooth" });
},
/**
* @author: czw (725551805@qq.com)
@ -160,7 +161,7 @@ export default {
* @Date: 2022-03-02 19:51:07
*/
hanlebottom() {
document.getElementById('top').scrollIntoView({ behavior: 'smooth' })
document.getElementById("top").scrollIntoView({ behavior: "smooth" });
},
/**
* @author: czw (725551805@qq.com)
@ -170,8 +171,8 @@ export default {
* @Date: 2022-03-02 09:41:37
*/
hanleLogout() {
removeToken()
this.$router.push({ path: '/logo' })
removeToken();
this.$router.push({ path: "/Login" });
},
/**
* @author: czw (725551805@qq.com)
@ -182,7 +183,7 @@ export default {
*/
handlerclick(e) {
if (this.$route.path !== e) {
this.$router.push({ path: e })
this.$router.push({ path: e });
}
},
/**
@ -193,7 +194,7 @@ export default {
* @Date: 2022-03-01 22:25:47
*/
add() {
this.show = !this.show
this.show = !this.show;
},
/**
* @author: czw (725551805@qq.com)
@ -203,26 +204,26 @@ export default {
* @Date: 2022-03-01 16:53:49
*/
hanblDelete(index, titie) {
var list = this.levelData[index].name
var list = this.levelData[index].name;
this.onindex = index
this.levelData.splice(this.onindex, 1)
this.onindex = index;
this.levelData.splice(this.onindex, 1);
if (titie === this.head) {
var item
var name
var item;
var name;
for (let i = 0; i < this.levelData.length; i++) {
item = this.levelData[i].path
name = this.levelData[i].name
item = this.levelData[i].path;
name = this.levelData[i].name;
}
if (this.levelData.length) {
if (name !== list) {
this.$router.push({ path: item })
this.$router.push({ path: item });
}
}
}
},
},
}
};
</script>
<style scoped lang="scss">
.table {

View File

@ -1,74 +0,0 @@
<!--
* @Description:
* @Author: czw (725551805@qq.com)
* @Date: 2021-11-18 10:47:16
* @LastEditors: czw (725551805@qq.com)
* @LastEditTime: 2022-02-23 12:23:56
* @FilePath: /glxt/src/views/logo.vue
-->
<template>
<div class="page">
<el-form ref="form"
:model="form"
label-width="80px">
<el-form-item label="账号">
<el-input v-model="form.add"
autocomplete='on'
type='text'></el-input>
</el-form-item>
<el-form-item label="密码">
<el-input v-model="form.app"
autocomplete='on'
type='password'></el-input>
</el-form-item>
<el-form-item label="密码">
<el-button type="primary"
@click="onSubmit">登录</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
import { setToken } from '@/util/auth'
import { postadd } from '@/api/rankingData'
export default {
name: '', //
components: {}, //
props: {}, //
data() {
return {
form: {
add: '',
app: '',
},
}
},
computed: {}, // data
watch: {}, // data
created() {}, // -(访this)
mounted() {}, // -(访DOM)
methods: {
onSubmit() {
const params = {
username: this.form.add,
password: this.form.app,
}
// postadd(params).then((res) => {
// // if (res.data.code === 200) {
// // }
setToken('w1rr6IsxZIud46dIrGIivNAroFpqN52sSpXhk3azpPq2ZTbUXhgKTOLheoRm')
// const token = res.data.access_token
// setToken(token)
// console.log(token, 'denglucheng')
// this.$router.push({ path: '/index' })
// })
this.$router.push({ path: '/index' })
},
}, //
}
</script>
<style lang="scss" scoped></style>

View File

@ -0,0 +1,210 @@
<template>
<div>
<!-- 筛选框 -->
<el-card class="box-card">
<div class="goods" style="margin: 20px">
<el-form ref="form" :inline="true" :model="form">
<el-form-item label="查询类别:">
<el-select v-model="form.targetField" placeholder="全部">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="操作用户">
<el-select v-model="form.userId" placeholder="输入操作用户">
<el-option
v-for="item in options1"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="操作时间:">
<el-date-picker
v-model="value1"
type="datetimerange"
range-separator="-"
start-placeholder="起"
end-placeholder="止"
value-format="yyyy-MM-dd HH:mm:ss"
>
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="query()">查询</el-button>
</el-form-item>
</el-form>
</div>
</el-card>
<!-- 表格 -->
<el-card style="margin-top: 30px" class="box-card">
<el-table :data="tableData" style="width: 100%" border>
<el-table-column prop="id" label="序号" width="70"> </el-table-column>
<el-table-column prop="created_at" label="时间" width="200">
</el-table-column>
<el-table-column prop="target_field" label="类别" width="100">
</el-table-column>
<el-table-column prop="before_update" label="操作前" :resizable="ture">
</el-table-column>
<el-table-column prop="after_update" label="操作后" :resizable="ture">
</el-table-column>
<el-table-column prop="user.name" label="操作人" width="100">
</el-table-column>
</el-table>
</el-card>
<!-- 分页功能 -->
<div class="block">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="current_page"
:page-sizes="[15, 50, 100]"
:page-size="per_page"
layout="total, sizes, prev, pager, next, jumper"
:total="Paginationdata.total"
>
</el-pagination>
</div>
</div>
</template>
<script>
import { userList } from "../../api/user";
import { recordList } from "../../api/record";
export default {
data() {
return {
options: [
{
value: "cost",
label: "成本",
},
{
value: "stock",
label: "库存",
},
{
value: "inventory",
label: "库存盘点",
},
{
value: "status",
label: "状态",
},
{
value: "set",
label: "设置",
},
], //
options1: [], //
form: {
targetField: "",
userId: "",
},
value1: "", //
tableData: [], //
Paginationdata: {}, //
current_page: 1, //
per_page: 15, //
moudule: "goods",
};
},
methods: {
//
getList() {
let queryData = {
userId: this.form.userId,
target_field: this.form.targetField,
moudule: this.moudule,
target_id: this.$route.query.id,
startTime: this.value1[0],
endTime: this.value1[1],
page: this.current_page,
per_page: this.per_page,
};
recordList(queryData).then((res) => {
console.log(1111, res);
this.tableData = res.data.data;
this.Paginationdata = res.data.meta;
});
},
//
handleSizeChange(val) {
//
this.per_page = val;
this.getList();
},
handleCurrentChange(val) {
//
this.current_page = val;
this.getList();
},
//
getUser() {
userList().then((res) => {
this.options1 = res.data.data;
console.log("我是用户", this.options1);
});
},
//
query() {
console.log(this.form.userId, this.form.targetField);
let queryData = {
userId: this.form.userId,
target_field: this.form.targetField,
page: this.current_page,
per_page: this.per_page,
moudule: this.moudule,
target_id: this.$route.query.id,
startTime: this.value1[0],
endTime: this.value1[1],
};
//
const newObj = filterParams(queryData);
function filterParams(obj) {
const _newPar = {};
for (const key in obj) {
// 0
if (
(obj[key] === 0 || obj[key]) &&
obj[key].toString().replace(/(^\s*)|(\s*$)/g, "") !== ""
) {
//
_newPar[key] = obj[key];
}
}
//
return _newPar;
}
recordList(newObj).then((res) => {
this.tableData = res.data.data;
this.Paginationdata = res.data.meta;
});
},
},
mounted() {
this.getList();
this.getUser();
},
};
</script>
<style>
.block {
margin-top: 30px;
}
</style>

View File

@ -1,164 +1,163 @@
<template>
<div>
<!-- 筛选框 -->
<el-card class="box-card">
<div class="goods"
style="margin:20px">
<el-form ref="form"
:inline="true"
:model="form">
<div class="goods" style="margin: 20px">
<el-form ref="form" :inline="true" :model="form">
<el-form-item label="查询类别:">
<el-select v-model="form.name1"
placeholder="全部">
<el-option v-for="item in options"
<el-select v-model="form.name1" placeholder="全部">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="操作用户">
<el-select v-model="form.name2"
placeholder="输入操作用户">
<el-option v-for="item in options"
<el-select v-model="form.name2" placeholder="输入操作用户">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="操作时间:">
<el-date-picker v-model="value1"
<el-date-picker
v-model="value1"
type="datetimerange"
range-separator="至"
start-placeholder="起"
end-placeholder="止"
align="right">
>
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary">查询</el-button>
</el-form-item>
</el-form>
</div>
</el-card>
<el-card style="margin-top:30px"
class="box-card">
<div>
<span></span>
<span>历史记录</span>
<span>共800条</span>
<span>玫瑰花</span>
</div>
<el-table :data="tableData"
style="width: 100%">
<el-table-column prop="date"
label="序号"
width="180">
</el-table-column>
<el-table-column prop="name"
label="时间"
width="180">
</el-table-column>
<el-table-column prop="address"
label="类别">
</el-table-column>
<el-table-column prop="address"
label="操作前">
</el-table-column>
<el-table-column prop="address"
label="操作后">
</el-table-column>
<el-table-column prop="address"
label="操作人">
</el-table-column>
<!-- 表格 -->
<el-card style="margin-top: 30px" class="box-card">
<el-table :data="tableData" style="width: 100%">
<el-table-column prop="id" label="序号"> </el-table-column>
<el-table-column prop="created_at" label="时间"> </el-table-column>
<el-table-column prop="target_field" label="类别"> </el-table-column>
<el-table-column prop="before_update" label="操作前"> </el-table-column>
<el-table-column prop="after_update" label="操作后"> </el-table-column>
<el-table-column prop="user.name" label="操作人"> </el-table-column>
</el-table>
</el-card>
<el-pagination @size-change="handleSizeChange"
<!-- 分页功能 -->
<div class="block">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage4"
:page-sizes="[100, 200, 300, 400]"
:page-size="100"
:current-page="current_page"
:page-sizes="[15, 50, 100]"
:page-size="per_page"
layout="total, sizes, prev, pager, next, jumper"
:total="400">
:total="Paginationdata.total"
>
</el-pagination>
</div>
</div>
</template>
<script>
import axios from "axios";
export default {
data() {
return {
options: [
{
value: '选项1',
label: '黄金糕',
value: "选项1",
label: "黄金糕",
},
{
value: '选项2',
label: '双皮奶',
value: "选项2",
label: "双皮奶",
},
{
value: '选项3',
label: '蚵仔煎',
value: "选项3",
label: "蚵仔煎",
},
{
value: '选项4',
label: '龙须面',
value: "选项4",
label: "龙须面",
},
{
value: '选项5',
label: '北京烤鸭',
value: "选项5",
label: "北京烤鸭",
},
],
tableData: [
{
date: '2016-05-02',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄',
},
{
date: '2016-05-04',
name: '王小虎',
address: '上海市普陀区金沙江路 1517 弄',
},
{
date: '2016-05-01',
name: '王小虎',
address: '上海市普陀区金沙江路 1519 弄',
},
{
date: '2016-05-03',
name: '王小虎',
address: '上海市普陀区金沙江路 1516 弄',
},
],
currentPage4: 4,
form: {
name1: '',
name2: '',
name3: '',
name4: '',
name5: '',
name6: '',
name1: "",
name2: "",
name3: "",
name4: "",
name5: "",
name6: "",
},
input: '',
value1: '',
}
input: "",
value1: "",
tableData: [], //
Paginationdata: {}, //
current_page: 1, //
per_page: 15, //
};
},
methods: {
//
getList() {
let token = localStorage.getItem("token");
let data = {
page: this.current_page,
per_page: this.per_page,
};
axios
.get("/api/logs", {
headers: {
Authorization: `Bearer ${token}`,
},
})
.then((res) => {
console.log(res);
this.tableData = res.data.data;
this.Paginationdata = res.data.meta;
});
},
//
handleSizeChange(val) {
console.log(`每页 ${val}`)
//
this.per_page = val;
// console.log(1111, val);
this.getList();
},
handleCurrentChange(val) {
console.log(`当前页: ${val}`)
//
this.current_page = val;
// console.log(2222, val);
this.getList();
},
},
}
mounted() {
this.getList();
},
};
</script>
<style>
.block {
margin-top: 30px;
}
</style>

View File

@ -1,57 +1,204 @@
<template>
<el-table :data="tableData"
border
style="width: 100%">
<el-table-column prop="date"
label="日期"
width="180">
<div class="conent">
<!-- 新增按钮 -->
<div class="btn">
<el-button type="primary" @click="handAdd">新增</el-button>
</div>
<div class="table">
<el-table :data="tableData" style="width: 100%">
<el-table-column prop="id" label="ID" width="180"> </el-table-column>
<el-table-column prop="name" label="店铺名称" width="180">
</el-table-column>
<el-table-column prop="name"
label="姓名"
width="180">
</el-table-column>
<el-table-column prop="address"
label="地址">
<el-table-column prop="plat_id" label="所属平台"></el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button type="danger" v-if="scope.row.status === '未授权'"
><a
:href="scope.row.authUrl"
target="_blank"
rel="noopener noreferrer"
>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a
></el-button
>
<div v-if="scope.row.status === '重新授权'">
<el-button type="danger" target="_blank"
><a :href="scope.row.authUrl" rel="noopener noreferrer"
>重新授权</a
></el-button
>
<el-button @click="download(scope.row)">下载商品</el-button>
</div>
<div v-if="scope.row.status === '无需授权'">
<el-button type="success">{{ scope.row.status }}</el-button>
<el-button @click="download(scope.row)">下载商品</el-button>
</div>
</template>
</el-table-column>
</el-table>
</div>
<!-- 新增店铺 -->
<el-dialog
title="新增店铺"
:visible.sync="dialogFormVisible"
:close-on-click-modal="false"
>
<el-form :model="form">
<el-form-item label="店铺名称">
<el-input v-model="form.name" placeholder="输入店铺名称"></el-input>
</el-form-item>
<el-form-item label="店铺平台">
<el-select v-model="form.plat_id" placeholder="输入店铺平台">
<el-option
v-for="(item, index) in storeId"
:key="index"
:label="item"
:value="index"
>
</el-option>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false"> </el-button>
<el-button type="primary" @click="addSubmit"> </el-button>
</div>
</el-dialog>
<!-- 分页功能 -->
<div class="block">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="current_page"
:page-sizes="[15, 50, 100]"
:page-size="per_page"
layout="total, sizes, prev, pager, next, jumper"
:total="Paginationdata.total"
>
</el-pagination>
</div>
</div>
</template>
<script>
import { shopListId, shopAdd, storeList, downloadGoods } from "../../api/shop";
export default {
name: 'GlxtStore',
data() {
return {
tableData: [
{
date: '2016-05-02',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄',
dialogFormVisible: false,
form: {
name: "",
plat_id: "",
},
{
date: '2016-05-04',
name: '王小虎',
address: '上海市普陀区金沙江路 1517 弄',
storeId: [], // id
tableData: [],
Paginationdata: {}, //
current_page: 1, //
per_page: 15, //
};
},
{
date: '2016-05-01',
name: '王小虎',
address: '上海市普陀区金沙江路 1519 弄',
mounted() {
//
this.getStoreList();
},
{
date: '2016-05-03',
name: '王小虎',
address: '上海市普陀区金沙江路 1516 弄',
},
],
}
methods: {
//
handAdd() {
this.form.name = "";
this.form.plat_id = "";
this.dialogFormVisible = true;
this.getshop();
},
mounted() {},
methods: {},
//
addSubmit() {
const datas = this.form;
shopAdd(datas).then((res) => {
if (res.status == 200) {
this.$message({
type: "success",
message: "添加成功",
});
}
this.getStoreList();
});
this.dialogFormVisible = false;
},
//
getStoreList() {
let page = {
page: this.current_page,
per_page: this.per_page,
};
storeList(page).then((res) => {
this.tableData = res.data.data;
this.Paginationdata = res.data.meta;
console.log(111111, this.tableData);
});
},
//
handleSizeChange(val) {
//
this.per_page = val;
// console.log(1111, val);
this.getStoreList();
},
handleCurrentChange(val) {
//
this.current_page = val;
// console.log(2222, val);
this.getStoreList();
},
//
getshop() {
shopListId().then((res) => {
this.storeId = res.data.data;
});
},
//
download(row) {
// console.log(row);
downloadGoods(row.id).then((res) => {
console.log(res);
});
},
},
};
</script>
<style lang="scss" scoped>
a {
text-decoration: none;
color: white;
}
.conent {
width: 100%;
min-height: calc(100vh - 200px);
position: relative;
}
.btn {
height: 104px;
border-radius: 5px;
display: flex;
align-items: center;
.el-button {
width: 114px;
height: 44px;
border-radius: 3px;
}
}
.table {
margin-top: 20px;
}
.block {
margin-top: 30px;
}
</style>

View File

@ -1,22 +1,19 @@
<template>
<div>
</div>
<div>权限管理已废弃</div>
</template>
<script>
export default {
name: 'GlxtAuthority',
name: "GlxtAuthority",
data() {
return {}
return {};
},
mounted() {},
methods: {},
}
};
</script>
<style lang="scss" scoped>
</style>
<style lang="scss" scoped></style>

View File

@ -1,22 +1,211 @@
<template>
<div>
<div class="conent">
<!-- 新增按钮 -->
<div class="btn">
<el-button type="primary" @click="dialogVisible2 = true">新增</el-button>
</div>
<!-- 点击新增弹出表单 -->
<div class="from">
<el-dialog
title="新增角色"
:visible.sync="dialogVisible2"
width="30%"
:close-on-click-modal="false"
>
<div>
<el-form label-width="80px">
<el-form-item label="角色名称">
<el-input v-model="newrole"></el-input>
</el-form-item>
<div class="from-btn">
<el-button type="danger" @click="dialogVisible2 = false"
>取消</el-button
>
<el-button @click="onSubmit">确认</el-button>
</div>
</el-form>
</div>
</el-dialog>
</div>
<!-- 角色表单 -->
<div class="table">
<el-table :data="tableList" style="width: 100%">
<el-table-column prop="id" label="ID"> </el-table-column>
<el-table-column prop="name" label="角色名称"> </el-table-column>
<el-table-column label="权限内容">
<template slot-scope="scope">
<span v-for="item in scope.row.permissions" :key="item.id"
>{{ item.name }}&nbsp;&nbsp;</span
>
</template>
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button @click="onEdit(scope.row)">编辑</el-button>
</template>
</el-table-column>
</el-table>
</div>
<!-- 点击编辑弹出权限框 -->
<el-dialog
title="编辑权限"
:visible.sync="dialogVisible"
width="30%"
:close-on-click-modal="false"
>
<el-tree
v-if="isShowtree"
:data="Role_Permission"
show-checkbox
:default-expand-all="false"
node-key="id"
ref="tree"
highlight-current
:props="defaultProps"
:default-checked-keys="chekedKeys"
v-model="permissionIds"
>
</el-tree>
<span slot="footer" class="dialog-footer">
<el-button @click="cancel()"> </el-button>
<el-button type="primary" @click="getCheckedKeys()"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import {
roleList,
roleAdd,
jurisdiction,
jurisdictionEdit,
} from "../../api/role.js";
export default {
name: 'GlxtRole',
data() {
return {}
return {
id: "", //id
tableList: [], //
rolePermissions: [],
newrole: "", //input
dialogVisible: false, //
dialogVisible2: false, //
permissionIds: [], //ID
allpermissionIds: {}, //id
Role_Permission: [], //
defaultProps: {
children: "children",
label: "name",
},
isShowtree: false,
chekedKeys: [],
};
},
mounted() {},
mounted() {
this.getroleList();
this.getJurisdiction();
},
methods: {
//
getroleList() {
roleList().then((res) => {
this.tableList = res.data.data;
console.log("我是角色权限", this.tableList);
});
},
methods: {},
//
getJurisdiction() {
jurisdiction().then((res) => {
this.Role_Permission = res.data.data;
console.log("我是所有权限", this.Role_Permission);
});
},
//
onSubmit() {
let roleName = {
name: this.newrole,
};
roleAdd(roleName).then((res) => {
this.dialogVisible2 = false;
this.getroleList();
if (res.status == 201) {
this.$message({
message: "角色添加成功!",
type: "success",
});
}
});
},
//
onEdit(row) {
this.id = row.id;
console.log(row);
let arr = row.permissions.map((item) => {
return item.id;
});
this.chekedKeys = arr;
this.dialogVisible = true;
this.isShowtree = true;
},
//
cancel() {
this.dialogVisible = false;
this.isShowtree = false;
},
//
getCheckedKeys() {
let id = this.id; //ID
this.permissionIds = this.$refs.tree.getCheckedKeys(); //ID
this.allpermissionIds = {
permissionIds: this.permissionIds,
};
jurisdictionEdit(id, this.allpermissionIds).then((res) => {
if (res.status === 200) {
this.dialogVisible = false;
this.getroleList();
this.$message({
message: "权限修改成功!",
type: "success",
});
}
});
},
},
};
</script>
<style lang="scss" scoped>
.conent {
width: 100%;
min-height: calc(100vh - 200px);
}
.btn {
height: 104px;
border-radius: 5px;
display: flex;
align-items: center;
.el-button {
width: 114px;
height: 44px;
border-radius: 3px;
}
}
.table {
margin-top: 20px;
}
.from-btn {
display: flex;
justify-content: space-around;
align-content: center;
}
</style>

View File

@ -1,22 +1,291 @@
<template>
<div>
<div class="conent">
<!-- 新增按钮 -->
<div class="btn">
<el-button type="primary" @click="dialogVisible = true">新增</el-button>
</div>
<!-- 点击新增弹出表单 -->
<div class="from">
<el-dialog
title="新增用户"
:visible.sync="dialogVisible"
width="30%"
:close-on-click-modal="false"
>
<div>
<el-form label-width="80px">
<el-form-item label="姓名">
<el-input v-model="from.name"></el-input>
</el-form-item>
<el-form-item label="密码">
<el-input v-model="from.password"></el-input>
</el-form-item>
<el-form-item label="确认密码">
<el-input v-model="from.password_confirmation"></el-input>
</el-form-item>
<el-form-item label="角色">
<!-- <el-input v-model="from.role_name"></el-input> -->
<template>
<el-select v-model="value" placeholder="请选择">
<el-option
v-for="item in roleOptions"
:key="item.value"
:label="item.name"
:value="item.name"
>
</el-option>
</el-select>
</template>
</el-form-item>
<div class="from-btn">
<el-button type="danger" @click="dialogVisible = false"
>取消</el-button
>
<el-button @click="onSubmit">确认</el-button>
</div>
</el-form>
</div>
</el-dialog>
</div>
<!-- 点击编辑弹出表单信息 -->
<div class="edit_from">
<el-dialog
title="编辑"
:visible.sync="editVisible"
width="30%"
:close-on-click-modal="false"
>
<div>
<el-form label-width="80px">
<el-form-item label="ID">
<el-input v-model="edit_from.id"></el-input>
</el-form-item>
<el-form-item label="姓名">
<el-input v-model="edit_from.name"></el-input>
</el-form-item>
<el-form-item label="邮箱">
<el-input v-model="edit_from.email"></el-input>
</el-form-item>
<el-form-item label="角色">
<template>
<el-select v-model="edit_from.role_name" placeholder="请选择">
<el-option
v-for="item in roleOptions"
:key="item.value"
:label="item.name"
:value="item.name"
>
</el-option>
</el-select>
</template>
</el-form-item>
<el-form-item label="密码">
<el-input v-model="edit_from.password"></el-input>
</el-form-item>
<el-form-item label="密码确认">
<el-input v-model="edit_from.password_confirmation"></el-input>
</el-form-item>
<div class="from-btn">
<el-button type="danger" @click="editVisible = false"
>取消</el-button
>
<el-button @click="onEdit()">确认</el-button>
</div>
</el-form>
</div>
</el-dialog>
</div>
<!-- 用户列表 -->
<div class="table">
<template>
<el-table :data="tableList" style="width: 100%">
<el-table-column prop="id" label="ID"></el-table-column>
<el-table-column prop="name" label="姓名"></el-table-column>
<el-table-column label="角色">
<template slot-scope="scope">{{
scope.row.roles[0].name
}}</template>
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button @click="openEdit(scope.row)">编辑</el-button>
<!-- <el-button type="danger">删除</el-button> -->
</template>
</el-table-column>
</el-table>
</template>
</div>
<!-- 分页功能 -->
<div class="block">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="current_page"
:page-sizes="[15, 50, 100]"
:page-size="per_page"
layout="total, sizes, prev, pager, next, jumper"
:total="Paginationdata.total"
>
</el-pagination>
</div>
</div>
</template>
<script>
import {
userList,
userAdd,
userEdit,
userConfirm,
roleList,
} from "../../api/user";
export default {
name: 'GlxtUsers',
data() {
return {}
return {
id: "",
dialogVisible: false, //
editVisible: false, //
tableList: [], //
from: {
//
name: "",
password: "",
password_confirmation: "",
role_name: "",
},
edit_from: {
//
created_at: "",
deleted_at: null,
email: "",
id: "",
name: "",
password: "",
password_confirmation: "",
role_name: "",
},
Paginationdata: {}, //
current_page: 1, //
per_page: 15, //
roleOptions: [], //
value: "", //
};
},
mounted() {},
mounted() {
this.getList(); //
this.getrole(); //
},
methods: {
//
getrole() {
roleList().then((res) => {
this.roleOptions = res.data.data;
console.log(this.roleOptions);
});
},
methods: {},
}
//
getList() {
let page = {
page: this.current_page,
per_page: this.per_page,
};
userList(page).then((res) => {
this.tableList = res.data.data;
this.Paginationdata = res.data.meta;
});
},
//
onSubmit() {
this.from.role_name = this.value;
let from = this.from;
userAdd(from).then((res) => {
this.tableList = [...this.tableList, res.data.data];
this.dialogVisible = false;
this.getList();
this.from = {};
this.$message({
message: "账号添加成功!",
type: "success",
});
});
},
//
openEdit(e) {
this.editVisible = true;
let id = e.id;
this.id = e.id;
// id
userEdit(id).then((res) => {
this.edit_from = res.data.data;
console.log(this.edit_from);
});
},
//
onEdit() {
userConfirm(this.id, this.edit_from).then((res) => {
this.tableList = [...this.tableList, res.data.data];
this.editVisible = false;
this.getList();
this.$message({
message: "账号修改成功!",
type: "success",
});
});
this.editVisible = false;
},
//
handleSizeChange(val) {
//
this.per_page = val;
this.getList();
},
handleCurrentChange(val) {
//
this.current_page = val;
this.getList();
},
},
};
</script>
<style lang="scss" scoped>
.conent {
width: 100%;
min-height: calc(100vh - 200px);
position: relative;
}
.btn {
height: 104px;
border-radius: 5px;
display: flex;
align-items: center;
.el-button {
width: 114px;
height: 44px;
border-radius: 3px;
}
}
.table {
margin-top: 20px;
}
.from-btn {
display: flex;
justify-content: space-around;
align-content: center;
}
.block {
margin-top: 30px;
}
</style>

View File

@ -1,199 +1,560 @@
<template>
<div>
<el-card class="box-card">
<div class="goods"
style="margin:20px">
<div class="add-item-info"
style="margin-bottom:10px;margin-left:52px">
<span style="font-size:14px;">商品图片</span>
<el-upload class="upload"
action="/api/admin/upload"
list-type="picture-card"
:on-success="uploadGalleryItem"
:on-remove="removeGalleryItem"
:file-list="gallery">
<img v-if="imageUrl"
:src="imageUrl"
class="avatar">
<i v-else
class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</div>
<el-form ref="form"
:inline="true"
:model="form">
<div class="goods" style="margin: 20px">
<div
class="add-item-info"
style="margin-bottom: 10px; margin-left: 52px"
>
<div>
<el-form-item label="商品名称:">
<el-select v-model="form.name1"
placeholder="商品名称">
<el-option v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
<div style="font-size: 14px">商品列表</div>
<el-select v-model="lid" placeholder="选择商品" @change="onchange">
<el-option
v-for="item in goodschoose"
:key="item.id"
:label="item.title"
:value="item.id"
>
</el-option>
</el-select>
</div>
<span style="font-size: 14px"
>商品图片
<el-upload
class="avatar-uploader"
action="#"
:limit="1"
:auto-upload="false"
:show-file-list="true"
list-type="picture-card"
:on-change="handleAvatarSuccess"
>
<img v-if="imageUrl" :src="imageUrl" class="avatar" />
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</span>
</div>
<!-- 编辑按钮进入显示 -->
<el-form ref="form" :inline="true" :model="form" v-if="goodsData != ''">
<div>
<el-form-item label="商品名称:">
<el-input
placeholder="商品名称"
v-model="goodsData.goods.title"
></el-input>
</el-form-item>
<el-form-item label="商品编码:">
<el-input
placeholder="商品编码"
v-model="goodsData.goods.goods_code"
></el-input>
</el-form-item>
<el-form-item label="商品种类:">
<el-select v-model="form.name2"
placeholder="商品种类">
<el-option v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
<el-select
v-model="goodsData.goods.type_id"
placeholder="商品种类"
>
<el-option
v-for="item in cate"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="商品品牌:">
<el-select v-model="form.name3"
placeholder="商品品牌">
<el-option v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
<el-select
v-model="goodsData.goods.brand_id"
placeholder="商品品牌"
>
<el-option
v-for="item in brand"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
</div>
<div v-for="(item,i) in specifyList">
<span style="margin-right:-15px">{{i+1}}.</span>
<div>
<!-- <span style="margin-right: -15px">{{ i + 1 }}.</span> -->
<el-form-item label="商品规格:">
<el-select v-model="specifyList[i].specify"
placeholder="商品规格">
<!-- <el-option v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option> -->
</el-select>
<el-input
placeholder="商品规格"
v-model="goodsData.title"
></el-input>
</el-form-item>
<span class="addto"
@click="handleAdd()">+</span>
<el-form-item label="商品编码:">
<el-select v-model="specifyList[i].code"
placeholder="商品编码">
<!-- <el-option v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option> -->
</el-select>
<el-form-item label="规格编码:">
<el-input v-model="goodsData.sku_code" placeholder="商品编码">
</el-input>
</el-form-item>
<el-form-item label="商品状态:">
<el-select v-model="specifyList[i].state"
placeholder="在售(默认)">
<!-- <el-option v-for="item in options"
:key="item.value"
<el-select
v-model="goodsData.goods.reserve"
placeholder="下架(默认)"
>
<el-option
v-for="item in options"
:key="item.id"
:label="item.label"
:value="item.value">
</el-option> -->
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<div>
<el-form-item label="商品数量:">
<el-select v-model="specifyList[i].number"
placeholder="商品数量">
<!-- <el-option v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option> -->
</el-select>
<el-input v-model="goodsData.num" placeholder="商品数量">
</el-input>
</el-form-item>
<el-form-item label="商品成本:">
<el-select v-model="specifyList[i].cost"
placeholder="商品成本">
<!-- <el-option v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option> -->
</el-select>
<el-input v-model="goodsData.cost" placeholder="商品成本">
</el-input>
</el-form-item>
<el-button type="primary"
@click="handleDelete(i)">删除</el-button>
</div>
</div>
<div class="btn">
<el-form-item>
<el-button type="primary">保存</el-button>
<el-button plain>取消</el-button>
<el-button type="primary" @click="Edititem()">保存</el-button>
<el-button plain @click="cancel()">取消</el-button>
</el-form-item>
</div>
</el-form>
<!-- 新建商品进入显示 -->
<el-form ref="form" :inline="true" :model="form" v-if="goodsData == ''">
<div>
<el-form-item label="商品名称:">
<el-input
placeholder="商品名称"
v-model="form.title"
:disabled="true"
v-if="isShow"
></el-input>
<el-input
placeholder="商品名称"
v-model="form.title"
v-else
></el-input>
</el-form-item>
<el-form-item label="商品编码:">
<el-input
placeholder="商品编码"
v-model="form.goods_code"
:disabled="true"
v-if="isShow"
></el-input>
<el-input
placeholder="商品编码"
v-model="form.goods_code"
v-else
></el-input>
</el-form-item>
<el-form-item label="商品种类:">
<el-select
v-model="form.type_id"
placeholder="商品种类"
v-if="isShow"
:disabled="true"
>
<el-option
v-for="item in cate"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
<el-select v-model="form.type_id" placeholder="商品种类" v-else>
<el-option
v-for="item in cate"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="商品品牌:">
<el-select
v-model="form.brand_id"
placeholder="商品品牌"
v-if="isShow"
:disabled="true"
>
<el-option
v-for="item in brand"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
<el-select v-model="form.brand_id" placeholder="商品品牌" v-else>
<el-option
v-for="item in brand"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
</div>
<div v-for="(item, i) in skus" :key="i">
<span style="margin-right: -15px">{{ i + 1 }}.</span>
<el-form-item label="商品规格:">
<el-input
placeholder="商品规格"
v-model="skus[i].title"
></el-input>
</el-form-item>
<span class="addto" @click="handleAdd()">+</span>
<el-form-item label="规格编码:">
<el-input v-model="skus[i].sku_code" placeholder="商品编码">
</el-input>
</el-form-item>
<el-form-item label="商品状态:">
<el-select v-model="skus[i].status" placeholder="下架(默认)">
<el-option
v-for="item in options"
:key="item.id"
:label="item.label"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<div>
<el-form-item label="商品数量:">
<el-input v-model="skus[i].num" placeholder="商品数量">
</el-input>
</el-form-item>
<el-form-item label="商品成本:">
<el-input v-model="skus[i].cost" placeholder="商品成本">
</el-input>
</el-form-item>
<el-button type="primary" @click="handleDelete(i)"
>删除</el-button
>
</div>
</div>
<div class="btn">
<el-form-item>
<el-button type="primary" @click="handleSave()">保存</el-button>
<el-button plain @click="cancel()">取消</el-button>
</el-form-item>
</div>
</el-form>
</div>
</el-card>
</div>
</template>
<script>
// import UploadTem from "../../../components/upload/index.vue";
import {
addGoods,
checkGoods,
goodsList,
updateGoods,
imgUpload,
} from "../../../api/goods.js";
import { goods_types, Brand_goods_types } from "../../../api/rankingData.js";
export default {
// components: {
// UploadTem,
// },
data() {
return {
gallery: '',
imageUrl: '',
specifyList: [
imgs: [],
gallery: "",
imageUrl: "",
lid: "", // id
gid: "", // id
brand: [], //
cate: [], //
goodschoose: [], //
goodsID: "", //id
goodsData: [], //
//
skus: [
{
specify: '',
code: '',
state: '',
number: '',
cost: '',
},
], //
form: {
name1: '',
name2: '',
name3: '',
name4: '',
name5: '',
name6: '',
},
options: [
{
value: '选项1',
label: '黄金糕',
},
{
value: '选项2',
label: '双皮奶',
},
{
value: '选项3',
label: '蚵仔煎',
},
{
value: '选项4',
label: '龙须面',
},
{
value: '选项5',
label: '北京烤鸭',
title: "",
sku_code: "",
status: "0",
num: "0",
cost: "0",
},
],
//
form: {
goods_id: "",
title: "",
img_url: "",
type_id: "",
brand_id: "",
goods_code: "",
},
//
options: [
{
id: "0",
label: "下架",
},
{
id: "1",
label: "在售",
},
{
id: "2",
label: "预警",
},
],
file: [],
isShow: false,
URL: "",
};
},
watch: {
lid: {
handler(newVal, oldVal) {
if (newVal) {
this.goodschoose.forEach((item) => {
if (item.id == newVal) {
this.form = { ...item };
}
});
}
},
deep: true, //
immediate: true, //
},
},
methods: {
//
handleAvatarSuccess(res, files) {
let formData = new FormData();
files.forEach((file) => {
formData.append("uploadFile", file.raw); //
});
let requestConfig = {
headers: {
"Content-Type": "multipart/form-data",
},
};
imgUpload(formData, requestConfig).then((res) => {
console.log(res);
this.form.img_url = res.data.resource;
console.log(this.form.img_url);
});
},
//
handleUpdate() {
this.gid = this.$route.query;
if (this.gid.id) {
checkGoods(this.gid.id).then((res) => {
console.log(res.data.data, "oooppuu");
const data = res.data.data;
const sku = this.skus[0];
const list = {};
Object.keys(data).map((key) => {
Object.keys(sku).map((i) => {
if (key == i) {
list[i] = data[key];
}
});
});
});
}
},
//
handleList() {
goodsList().then((res) => {
this.goodschoose = res.data.data;
this.goodschoose = [
{
title: "",
id: "",
},
...this.goodschoose,
];
});
},
//
handleSave() {
const goods = this.form;
const skus = this.skus;
const updata = {
...goods,
goods_id: this.lid,
skus: skus,
};
addGoods(updata).then((res) => {
if (res.statusText === "OK") {
this.$message({
message: "商品添加成功!",
type: "success",
});
this.updateForm();
this.$router.push("/GOODS_LIST");
}
});
},
//
updateForm() {
this.form = {
title: "",
img_url: "abc.jpg",
type_id: "",
brand_id: "",
goods_code: "",
};
this.skus = [
{
title: "",
sku_code: "",
status: "",
num: "",
cost: "",
},
];
},
//
handleAdd() {
this.specifyList.push({
specify: '',
code: '',
state: '',
number: '',
cost: '',
})
this.skus.push({
title: "",
sku_code: "",
status: "0",
num: "",
cost: "",
});
console.log(this.skus);
},
//
handleDelete(index) {
this.specifyList.splice(index, 1)
this.skus.splice(index, 1);
},
uploadGalleryItem() {},
removeGalleryItem() {},
hanleurlimg(val) {
console.log(val, "=+++++++++");
},
//
successUpload(file, fileList) {
console.log(file, fileList, 5555);
},
errorUpload(file, fileList) {
console.log(file, fileList, 5555);
},
//
getgoodsidData() {
let id = this.bigID;
checkGoods(id).then((res) => {
this.goodsData = res.data.data;
});
},
//
removeUpload() {},
//
Edititem() {
let id = this.bigID;
// console.log("ID", id);
// console.log("goodsid", this.goodsData.goods_id);
let goods = {
title: this.goodsData.goods.title,
img_url: this.goodsData.goods.img_url,
type_id: this.goodsData.goods.type_id,
brand_id: this.goodsData.goods.brand_id,
goods_code: this.goodsData.goods.goods_code,
};
let sku = {
title: this.goodsData.title,
sku_code: this.goodsData.sku_code,
status: this.goodsData.status,
num: this.goodsData.num,
cost: this.goodsData.cost,
};
if (sku.status == "下架") {
sku.status = 0;
} else if (sku.status == "在售") {
sku.status = 1;
} else if (sku.status == "预警") {
sku.status = 2;
}
let updateData = {
goods_id: this.goodsData.goods_id,
goods,
sku,
};
updateGoods(id, updateData).then((res) => {
this.$router.push("/GOODS_LIST");
this.$message({
message: "商品编辑成功!",
type: "success",
});
});
},
//
cancel() {
this.$router.push("/GOODS_LIST");
},
onchange(value) {
console.log(value);
if (value !== "") {
this.isShow = true;
}
if (value === "") {
this.isShow = false;
this.form = {};
}
},
},
created() {
this.goodsID = sessionStorage.getItem("商品ID");
this.bigID = sessionStorage.getItem("ID");
this.getgoodsidData();
},
mounted() {
this.gid = this.$route.query;
//
goods_types().then((res) => {
this.cate = res.data.data;
});
//
Brand_goods_types().then((res) => {
this.brand = res.data.data;
});
this.handleList();
this.handleUpdate();
},
beforeDestroy() {
sessionStorage.removeItem("商品ID"); //ID
sessionStorage.removeItem("ID"); //ID
},
};
</script>
<style scoped>
@ -206,15 +567,39 @@ export default {
}
.addto {
display: inline-block;
width: 28px;
height: 28px;
width: 30px;
height: 30px;
background-color: blue;
color: #fff;
font-size: 25px;
text-align: center;
line-height: 28px;
line-height: 30px;
border-radius: 5px;
margin-top: 4px;
}
/* .btn {
/* 分割 */
.avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
.avatar-uploader .el-upload:hover {
border-color: #409eff;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 148px;
height: 148px;
line-height: 148px;
text-align: center;
} */
}
.avatar {
width: 148px;
height: 148px;
display: block;
}
</style>

File diff suppressed because it is too large Load Diff

View File

@ -1,22 +1,24 @@
module.exports = {
lintOnSave: false,
publicPath: './', // 配置打包之后的相对路径
publicPath: "./", // 配置打包之后的相对路径
devServer: {
open: true, // 设置浏览器自动打开项目
port: 8080, // 开发服务器运行端口号
overlay: {
warnings: false,
errors: true
errors: true,
},
proxy: { // 配置代理
'/api': {
proxy: {
// 配置代理
"/api": {
// target: 'http://doc.ii090.com/mock/267/',
target: 'http://erp.staging.miaoxuan66.cn',
target: "http://erp.staging.miaoxuan66.cn",
changeOrigin: true, // 开启代理
pathRewrite: { // 重命名
'^/api': 'api'
}
}
}
}
}
pathRewrite: {
// 重命名
"^/api": "api",
},
},
},
},
};

1
resources/node_modules/.package_versions.json generated vendored Normal file
View File

@ -0,0 +1 @@
{}