提交到 lx 分支

lx
ACGSink 1 month ago
parent 86d919887c
commit fa465a2b62

1
.gitignore vendored

@ -0,0 +1 @@
node_modules

@ -0,0 +1 @@
registry=https://registry.npmmirror.com/

@ -0,0 +1,6 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}

@ -0,0 +1,19 @@
{
"compilerOptions": {
"target": "es5",
"module": "esnext",
"baseUrl": "./",
"moduleResolution": "node",
"paths": {
"@/*": [
"src/*"
]
},
"lib": [
"esnext",
"dom",
"dom.iterable",
"scripthost"
]
}
}

10663
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -0,0 +1,41 @@
{
"name": "supermarket-manager",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "vue-cli-service serve",
"serve": "vue-cli-service serve",
"build": "vue-cli-service build"
},
"dependencies": {
"axios.js": "1.6.3",
"core-js": "^3.8.3",
"jquery": "^3.6.4",
"js-cookie": "^3.0.1",
"qs": "^6.11.1",
"vue": "^2.6.14",
"vue-router": "^3.5.1",
"vue-vibe": "8.2.6",
"vuex": "^3.6.2"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~5.0.0",
"@vue/cli-plugin-router": "~5.0.0",
"@vue/cli-plugin-vuex": "~5.0.0",
"@vue/cli-service": "~5.0.0",
"element-ui": "^2.15.13",
"sass": "^1.32.7",
"sass-loader": "^12.0.0",
"vue-template-compiler": "^2.6.14",
"webpack": "^5.76.2"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
],
"description": "## Project setup ``` npm install ```",
"main": "babel.config.js",
"author": "",
"license": "ISC"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

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

@ -0,0 +1,22 @@
<!--
* @Description:
* @Author:
* @Date: 09-07 20:58:35
-->
<template>
<div id="app">
<router-view/>
</div>
</template>
<script>
import '@/assets/font/font.css'
export default {
}
</script>
<style>
body,html {
overflow-x: hidden;
}
</style>

@ -0,0 +1,37 @@
import {ajaxGet, ajaxPost} from "@/assets/js/common";
const apiPrefix = '/goods_management/goods'
/*列表显示*/
export function queryPageByQo(data) {
return ajaxPost(apiPrefix + "/queryPageByQo", data)
}
/*保存*/
export function save(data) {
return ajaxPost(apiPrefix + "/save", data)
}
/*上/下架业务*/
export function upOrdown(data) {
return ajaxPost(apiPrefix + "/upOrdown", data)
}
//修改
export function update(data) {
return ajaxPost(apiPrefix + "/update", data)
}
/*查询商品信息*/
export function queryGoodsById(data) {
return ajaxGet(apiPrefix + "/queryGoodsById", data)
}
export function selected_goodsAll() {
return ajaxGet(apiPrefix + "/selected_goodsAll", {})
}
export function selected_storeAll() {
return ajaxGet(apiPrefix + "/selected_storeAll", {})
}
export function returnGoods(data) {
return ajaxPost(apiPrefix + "/returnGoods", data)
}

@ -0,0 +1,23 @@
import {ajaxGet, ajaxPost} from "@/assets/js/common";
const apiPrefix = '/goods_management/goods_category'
/*保存*/
export function save(data) {
return ajaxPost(apiPrefix + "/save", data)
}
/*修改*/
export function update(data) {
return ajaxPost(apiPrefix + "/update", data)
}
/*停用*/
export function deactivate(sid) {
return ajaxPost(apiPrefix + "/deactivate", {cid:sid})
}
/*列表显示*/
export function queryPageByQo(data) {
return ajaxPost(apiPrefix + "/queryPageByQo", data)
}
export function getNormalCategoryAll(){
return ajaxGet(apiPrefix+"/normalCategoryAll")
}

@ -0,0 +1,16 @@
import {ajaxGet, ajaxPost} from "@/assets/js/common";
const apiPrefix = '/goods_management/goods_store'
/*列表显示*/
export function queryPageByQo(data) {
return ajaxPost(apiPrefix + "/queryPageByQo", data)
}
export function queryGoodsStoreById(data) {
return ajaxGet(apiPrefix + "/queryGoodsStoreById", data)
}
export function updateInventory(data) {
return ajaxPost(apiPrefix + "/updateInventory", data)
}

@ -0,0 +1,29 @@
import {ajaxGet, ajaxPost} from "@/assets/js/common";
const apiPrefix = '/goods_management/point_products'
/*列表显示*/
export function queryPageByQo(data) {
return ajaxPost(apiPrefix + "/queryPageByQo", data)
}
export function del(data) {
return ajaxGet(apiPrefix + "/del", data)
}
export function queryOptionGoods() {
return ajaxGet(apiPrefix + "/queryOptionGoods", {})
}
export function savePointGoods(data) {
return ajaxPost(apiPrefix + "/savePointGoods", data)
}
export function queryPointGoodsById(data) {
return ajaxGet(apiPrefix + "/queryPointGoodsById", data)
}
export function updatePointGoods(data) {
return ajaxPost(apiPrefix + "/updatePointGoods", data)
}

@ -0,0 +1,8 @@
import {ajaxGet, ajaxPost} from "@/assets/js/common";
const apiPrefix = '/goods_management/statistic_sale'
/*列表显示*/
export function queryPageByQo(data) {
return ajaxPost(apiPrefix + "/queryPageByQo", data)
}

@ -0,0 +1,54 @@
import {ajaxGet, ajaxPost} from "@/assets/js/common";
const apiPrefix_in = '/inventory_management/detail_store_goods_in'
const apiPrefix_out = '/inventory_management/detail_store_goods_out'
/**入库模块**/
/*入库保存*/
export function saveIn(data) {
return ajaxPost(apiPrefix_in + "/save", data)
}
/*入库列表显示*/
export function queryPageByQoIn(data) {
return ajaxPost(apiPrefix_in + "/queryPageByQo", data)
}
/*删除入库记录*/
export function delIn(data) {
return ajaxPost(apiPrefix_in + "/delIn", data)
}
/*删除出库记录*/
export function delOut(data) {
return ajaxPost(apiPrefix_out + "/delOut", data)
}
export function queryOptionsSuppliers() {
return ajaxGet(apiPrefix_in + "/queryOptionsSuppliers", {})
}
/**出库模块**/
/*出库列表显示*/
export function queryPageByQoOut(data) {
return ajaxPost(apiPrefix_out + "/queryPageByQoOut", data)
}
/*初始化选择框*/
export function initOutOptions() {
return ajaxGet(apiPrefix_out + "/initOutOptions",{})
}
/*出库选择商品导致仓库改变*/
export function changeOutGoods(data) {
return ajaxGet(apiPrefix_out + "/changeOutGoods",data)
}
/*出库选择仓库导致商品改变*/
export function changeOutStore(data) {
return ajaxGet(apiPrefix_out + "/changeOutStore",data)
}
export function queryOutGoods(data) {
return ajaxPost(apiPrefix_out + "/queryOutGoods", data)
}
export function saveOut(data) {
return ajaxPost(apiPrefix_out + "/save", data)
}

@ -0,0 +1,23 @@
import {ajaxGet, ajaxPost} from "@/assets/js/common";
const apiPrefix = '/inventory_management/detail_store_goods/notice'
export function queryPageNoticeIn(data) {
return ajaxPost(apiPrefix+ "/queryPageNoticeIn", data)
}
export function queryPageNoticeOut_shelves(data) {
return ajaxPost(apiPrefix+ "/queryPageNoticeOut_shelves", data)
}
export function saveOut_shelves(data) {
return ajaxPost(apiPrefix+ "/saveOut_shelves", data)
}
export function queryPageNoticeOut_untreated(data) {
return ajaxPost(apiPrefix+ "/queryPageNoticeOut_untreated", data)
}
export function resolveOutUntreatedForm(data) {
return ajaxPost(apiPrefix+ "/resolveOutUntreatedForm", data)
}

@ -0,0 +1,10 @@
import {ajaxGet, ajaxPost} from "@/assets/js/common";
const apiPrefix = '/inventory_management/store/storage_situation'
export function queryPageByQo(data) {
return ajaxPost(apiPrefix + "/queryPageByQo", data)
}
export function queryStoreGoodsByStoreId(data) {
return ajaxPost(apiPrefix + "/queryStoreGoodsByStoreId", data)
}

@ -0,0 +1,21 @@
import {ajaxGet, ajaxPost} from "@/assets/js/common";
const storeApiPrefix = '/inventory_management/store'
//获取仓库信息
export function storeList(data) {
return ajaxPost(storeApiPrefix + "/list", data)
}
/*保存*/
export function save(data) {
return ajaxPost(storeApiPrefix + "/save", data)
}
/*修改*/
export function update(data) {
return ajaxPost(storeApiPrefix + "/update", data)
}
/*停用*/
export function deactivate(sid) {
return ajaxPost(storeApiPrefix + "/deactivate", {sid:sid})
}

@ -0,0 +1,23 @@
import {ajaxGet, ajaxPost} from "@/assets/js/common";
const apiPrefix = '/inventory_management/supplier'
//获取供货商信息
export function queryPageSupplier(data) {
return ajaxPost(apiPrefix + "/queryPageByQo", data)
}
export function saveSupplier(data) {
return ajaxPost(apiPrefix + "/save", data)
}
export function updateSupplier(data) {
return ajaxPost(apiPrefix + "/update", data)
}
export function queryByCn(data) {
return ajaxGet(apiPrefix + "/queryByCn", data)
}
export function delSupplier(data) {
return ajaxPost(apiPrefix + "/deactivate", data)
}

@ -0,0 +1,28 @@
import {ajaxGet, ajaxPost} from "@/assets/js/common";
const apiPrefix = '/member_management/member'
/*列表显示*/
export function queryPageByQo(data) {
return ajaxPost(apiPrefix + "/queryPageByQo", data)
}
/*删除操作*/
export function delMember(data) {
return ajaxPost(apiPrefix + "/delMember", data)
}
/*保存*/
export function save(data) {
return ajaxPost(apiPrefix + "/save", data)
}
//修改
export function update(data) {
return ajaxPost(apiPrefix + "/update", data)
}
/*查询会员信息*/
export function queryMemberById(data) {
return ajaxGet(apiPrefix + "/queryMemberById", data)
}
export function queryMemberByPhone(data) {
return ajaxGet(apiPrefix + "/queryMemberByPhone", data)
}

@ -0,0 +1,7 @@
import {ajaxGet} from "@/assets/js/common";
const apiPrefix = '/personal'
export function queryInformation() {
return ajaxGet(apiPrefix + "/information", {})
}

@ -0,0 +1,20 @@
import {ajaxGet, ajaxPost} from "@/assets/js/common";
const apiPrefix = '/personnel_management/dept'
//获取仓库信息
export function listByQo(data) {
return ajaxGet(apiPrefix + "/list", data)
}
/*保存*/
export function save(data) {
return ajaxPost(apiPrefix + "/save", data)
}
/*修改*/
export function update(data) {
return ajaxPost(apiPrefix + "/update", data)
}
/*停用*/
export function deactivate(id) {
return ajaxPost(apiPrefix + "/deactivate", {id:id})
}

@ -0,0 +1,32 @@
import {ajaxGet, ajaxPost} from "@/assets/js/common";
const apiPrefix = '/personnel_management/employee'
//获取仓库信息
export function pageByQo(data) {
return ajaxPost(apiPrefix + "/list", data)
}
/*保存*/
export function save(data) {
return ajaxPost(apiPrefix + "/save", data)
}
/*修改*/
export function update(data) {
return ajaxPost(apiPrefix + "/update", data)
}
/*离职*/
export function deactivate(id) {
return ajaxPost(apiPrefix + "/deactivate", {id:id})
}
/*详情*/
export function detail(id) {
return ajaxGet(apiPrefix + "/detail", {uid:id})
}
/*修改按钮*/
export function editBtnClick(id) {
return ajaxGet(apiPrefix + "/editbtn", {uid:id})
}
/*重置密码*/
export function resetPwd(data){
return ajaxPost(apiPrefix+"/resetPwd",data)
}

@ -0,0 +1,41 @@
import {ajaxGet, ajaxJson, ajaxPost} from "@/assets/js/common";
const apiPrefix = '/sale_management/exchange_point_products_records'
export function queryPointProductBymemberId(data) {
return ajaxGet(apiPrefix + "/queryPointProductBymemberId", data)
}
export function queryMemberByGoodsId(data) {
return ajaxGet(apiPrefix + "/queryMemberByGoodsId", data)
}
export function queryPointProductByGoodsId(data) {
return ajaxGet(apiPrefix + "/queryPointProductByGoodsId", data)
}
export function saveExchangePointProductRecords(data) {
return ajaxPost(apiPrefix + "/saveExchangePointProductRecords", data)
}
export function queryOptionsMemberPhone() {
return ajaxGet(apiPrefix + "/queryOptionsMemberPhone", {})
}
export function queryPageByQoExchangePointProducts(data) {
return ajaxPost(apiPrefix + "/queryPageByQoExchangePointProducts", data)
}
export function delExchangePointProducts(data) {
return ajaxGet(apiPrefix + "/delExchangePointProducts", data)
}
export function queryOptionsPointProducts() {
return ajaxGet(apiPrefix + "/queryOptionsPointProducts", {})
}
export function queryOptionsMember() {
return ajaxGet(apiPrefix + "/queryOptionsMember", {})
}

@ -0,0 +1,23 @@
import {ajaxGet, ajaxJson, ajaxPost} from "@/assets/js/common";
const apiPrefix = '/sale_management/sale_record'
/*得到订单号*/
export function getCn() {
return ajaxGet(apiPrefix + "/getCn", {})
}
export function getOptionSaleRecordsGoods() {
return ajaxGet(apiPrefix + "/getOptionSaleRecordsGoods", {})
}
export function saveSaleRecords(data) {
return ajaxJson(apiPrefix + "/saveSaleRecords", data)
}
export function queryPageByQoSaleRecords(data) {
return ajaxPost(apiPrefix + "/queryPageByQoSaleRecords", data)
}
export function delSaleRecords(data) {
return ajaxGet(apiPrefix + "/delSaleRecords", data)
}

@ -0,0 +1,8 @@
import {ajaxPost} from "@/assets/js/common";
const menuApiPrefix = '/system/menu'
//条件分页获取菜单的信息
export function queryPageByQo(data) {
return ajaxPost(menuApiPrefix + "/queryPageByQo", data)
}

@ -0,0 +1,45 @@
import {ajaxGet, ajaxPost} from "@/assets/js/common";
const roleApiPrefix = '/system/role'
//获取角色全部信息
export function roleList(data) {
return ajaxPost(roleApiPrefix + "/list", data)
}
//停用角色
export function forbiddenRole(id) {
return ajaxPost(roleApiPrefix + "/forbiddenRole", {rid: id})
}
//修改角色信息
export function edit_role(data) {
return ajaxPost(roleApiPrefix + "/edit_role", data)
}
//创建角色
export function save_role(data) {
return ajaxPost(roleApiPrefix + "/save", data)
}
/*授权按钮*/
export function checkPermissons(rid) {
return ajaxGet(roleApiPrefix + "/checkPermissons", {rid: rid})
}
/*保存角色-权限关系*/
export function saveRolePermissons(data) {
return ajaxPost(roleApiPrefix + "/saveRolePermissons", data)
}
export function getAllRole(){
return ajaxGet(roleApiPrefix +"/all",{})
}
/*保存角色和员工的关系*/
export function saveRoleEmp(data) {
return ajaxPost(roleApiPrefix + "/saveRoleEmp", data)
}
export function queryRoleIdsByEid(eid) {
return ajaxGet(roleApiPrefix+"/queryRoleIdsByEid",{eid:eid})
}

@ -0,0 +1,27 @@
body{
margin: 0;
padding: 0;
background-color: #E9EEF3;
}
#app{
width: 100%;
height: 100%;
}
.el-header {
background-color: #6495ED;
color: #333;
border-bottom: 1px black solid;
height: 150px;
}
.el-aside {
background-color: #6495ED;
}
.el-main {
background-color: #E9EEF3;
color: #333;
text-align: center;
}

@ -0,0 +1,123 @@
@font-face {
font-family: "iconfont"; /* Project id 4215199 */
src: url('font.woff2?t=1693416579183') format('woff2'),
url('font.woff?t=1693416579183') format('woff'),
url('font.ttf?t=1693416579183') format('truetype');
}
.iconfont {
font-family: "iconfont" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-r-bottom:before {
content: "\e621";
}
.icon-r-left:before {
content: "\e622";
}
.icon-r-top:before {
content: "\e623";
}
.icon-r-no:before {
content: "\e61b";
}
.icon-r-refresh:before {
content: "\e61c";
}
.icon-r-yes:before {
content: "\e61d";
}
.icon-r-building:before {
content: "\e61e";
}
.icon-r-team:before {
content: "\e61f";
}
.icon-r-right:before {
content: "\e620";
}
.icon-r-find:before {
content: "\e610";
}
.icon-r-add:before {
content: "\e611";
}
.icon-r-edit:before {
content: "\e612";
}
.icon-r-user2:before {
content: "\e613";
}
.icon-r-delete:before {
content: "\e614";
}
.icon-r-lock:before {
content: "\e615";
}
.icon-r-paper:before {
content: "\e616";
}
.icon-r-setting:before {
content: "\e617";
}
.icon-r-list:before {
content: "\e618";
}
.icon-r-home:before {
content: "\e619";
}
.icon-r-shield:before {
content: "\e61a";
}
.icon-r-user3:before {
content: "\e60f";
}
.icon-r-mark1:before {
content: "\e609";
}
.icon-r-user1:before {
content: "\e60a";
}
.icon-r-love:before {
content: "\e60b";
}
.icon-r-mark2:before {
content: "\e60c";
}
.icon-r-mark3:before {
content: "\e60d";
}
.icon-r-mark4:before {
content: "\e60e";
}

File diff suppressed because one or more lines are too long

@ -0,0 +1,198 @@
{
"id": "4215199",
"name": "rbicon",
"font_family": "iconfont",
"css_prefix_text": "icon-",
"description": "",
"glyphs": [
{
"icon_id": "37171292",
"name": "下",
"font_class": "r-bottom",
"unicode": "e621",
"unicode_decimal": 58913
},
{
"icon_id": "37171293",
"name": "左",
"font_class": "r-left",
"unicode": "e622",
"unicode_decimal": 58914
},
{
"icon_id": "37171289",
"name": "上",
"font_class": "r-top",
"unicode": "e623",
"unicode_decimal": 58915
},
{
"icon_id": "37009521",
"name": "拒绝",
"font_class": "r-no",
"unicode": "e61b",
"unicode_decimal": 58907
},
{
"icon_id": "37009520",
"name": "刷新",
"font_class": "r-refresh",
"unicode": "e61c",
"unicode_decimal": 58908
},
{
"icon_id": "37009518",
"name": "同意",
"font_class": "r-yes",
"unicode": "e61d",
"unicode_decimal": 58909
},
{
"icon_id": "37009517",
"name": "建筑",
"font_class": "r-building",
"unicode": "e61e",
"unicode_decimal": 58910
},
{
"icon_id": "37009519",
"name": "团队",
"font_class": "r-team",
"unicode": "e61f",
"unicode_decimal": 58911
},
{
"icon_id": "37009516",
"name": "右",
"font_class": "r-right",
"unicode": "e620",
"unicode_decimal": 58912
},
{
"icon_id": "36984024",
"name": "查找",
"font_class": "r-find",
"unicode": "e610",
"unicode_decimal": 58896
},
{
"icon_id": "36984020",
"name": "新增",
"font_class": "r-add",
"unicode": "e611",
"unicode_decimal": 58897
},
{
"icon_id": "36984023",
"name": "修改",
"font_class": "r-edit",
"unicode": "e612",
"unicode_decimal": 58898
},
{
"icon_id": "36984022",
"name": "用户2",
"font_class": "r-user2",
"unicode": "e613",
"unicode_decimal": 58899
},
{
"icon_id": "36984021",
"name": "删除",
"font_class": "r-delete",
"unicode": "e614",
"unicode_decimal": 58900
},
{
"icon_id": "36984014",
"name": "锁",
"font_class": "r-lock",
"unicode": "e615",
"unicode_decimal": 58901
},
{
"icon_id": "36984016",
"name": "草纸",
"font_class": "r-paper",
"unicode": "e616",
"unicode_decimal": 58902
},
{
"icon_id": "36984015",
"name": "齿轮",
"font_class": "r-setting",
"unicode": "e617",
"unicode_decimal": 58903
},
{
"icon_id": "36984013",
"name": "列表",
"font_class": "r-list",
"unicode": "e618",
"unicode_decimal": 58904
},
{
"icon_id": "36984012",
"name": "房子",
"font_class": "r-home",
"unicode": "e619",
"unicode_decimal": 58905
},
{
"icon_id": "36984011",
"name": "盾牌",
"font_class": "r-shield",
"unicode": "e61a",
"unicode_decimal": 58906
},
{
"icon_id": "36984025",
"name": "用户3",
"font_class": "r-user3",
"unicode": "e60f",
"unicode_decimal": 58895
},
{
"icon_id": "36983993",
"name": "印章",
"font_class": "r-mark1",
"unicode": "e609",
"unicode_decimal": 58889
},
{
"icon_id": "36983994",
"name": "用户1",
"font_class": "r-user1",
"unicode": "e60a",
"unicode_decimal": 58890
},
{
"icon_id": "36983995",
"name": "爱心",
"font_class": "r-love",
"unicode": "e60b",
"unicode_decimal": 58891
},
{
"icon_id": "36983996",
"name": "水滴",
"font_class": "r-mark2",
"unicode": "e60c",
"unicode_decimal": 58892
},
{
"icon_id": "36983997",
"name": "波纹",
"font_class": "r-mark3",
"unicode": "e60d",
"unicode_decimal": 58893
},
{
"icon_id": "36983998",
"name": "阳光",
"font_class": "r-mark4",
"unicode": "e60e",
"unicode_decimal": 58894
}
]
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 708 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 632 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 459 KiB

@ -0,0 +1,26 @@
import Cookies from 'js-cookie'
import router from '../../router/index';
const TokenKey = 'token'
export function getToken() {
return Cookies.get(TokenKey)
}
export function setToken(token) {
return Cookies.set(TokenKey, token)
}
export function removeToken() {
return Cookies.remove(TokenKey)
}
export function loginEmp() {
let str = Cookies.get("employee")
if(str == undefined) {
router.push('/')
return null
}
return JSON.parse(str)
}
export function clearCookie(name) {
Cookies.remove(name)
}

@ -0,0 +1,127 @@
/*
* @Description:
* @Author:
* @Date: 04-07 20:58:35
*/
import { getToken } from "@/assets/js/auth";
import axios from "axios.js";
import { Message } from "element-ui";
import Cookies from "js-cookie";
import qs from 'qs';
const prefix_url = "http://localhost:9291"
/*刷新Cooke的存活时间*/
function refreshCookies() {
var token=getToken()
if (token){
//刷新cookie
axios({
url:prefix_url+"/checkedToken",
method:"GET",
params:{token:token}
}).then(res=>{
res=res.data
if (res.code==200){
Cookies.set("token", res.data.token, {expires: 1/48})
Cookies.set("employee", JSON.stringify(res.data.employee), {expires: 1/48})
}
}).catch((e)=>{
console.log(e)
})
}
return token;
}
/*post请求*/
export function ajaxPost(url, param) {
return axios({
url: prefix_url + url,
method: "POST",
headers:{
'token': refreshCookies() //设置token 其中K名要和后端协调好
},
data: qs.stringify(param)
}).catch((e) => {
console.log(e);
if (
e.response == undefined ||
e.response.data == undefined
) {
popup(e, "error")
} else {
popup(e.response.data, "error")
}
})
}
/*json请求*/
export function ajaxJson(url, param) {
return axios({
url: prefix_url + url,
method: "POST",
headers:{
'Content-Type':'application/json',
'token': refreshCookies() //设置token 其中K名要和后端协调好
},
data: param
}).catch((e) => {
console.log(e);
if (
e.response == undefined ||
e.response.data == undefined
) {
popup(e, "error")
} else {
popup(e.response.data, "error")
}
})
}
/*GET请求*/
export function ajaxGet(url, param) {
return axios({
url: prefix_url + url,
method: "GET",
headers: {
'token': refreshCookies() //设置token 其中K名要和后端协调好
},
params:param
}).catch((e) => {
console.log(e);
if (
e.response == undefined ||
e.response.data == undefined
) {
popup(e, "error")
} else {
popup(e.response.data, "error")
}
})
}
/*给用户弹出相应的提示*/
export function popup(msg, type) {
switch (type) {
case "warning":
Message.warning(msg);
break;
case "error":
Message.error({message: msg, duration: 5000, showClose: true});
break;
case "info":
Message.info(msg);
break;
default:
Message.success(msg);
}
}
require("vue-vibe")

@ -0,0 +1,24 @@
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
//ElementUI相关
import ElementUI from 'element-ui'
//ElementUI相关
import 'element-ui/lib/theme-chalk/index.css'
import '@/assets/css/globel.css'
import qs from 'qs';
import axios from 'axios.js'
Vue.prototype.qs = qs;
Vue.prototype.$axios = axios
//ElementUI相关
Vue.use(ElementUI)
Vue.config.productionTip = false
new Vue({
router,
store,
render: h => h(App)
}).$mount('#app')

@ -0,0 +1,151 @@
import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)
const routes = [
{
path: '/',
name: 'login',
component: () => import('../views/Login.vue'),
},
{
path: '/index',
name: 'index',
redirect:'/home',
component: () => import('../views/index.vue'),
children: [
{
path: '/home',
name: '/home',
component: () => import('../views/Home.vue')
},
{
path: '/personal/edit_pwd',
name: '/personal/edit_pwd',
component: () => import('../views/personal/Edit_pwd.vue')
},
{
path: '/personal/information',
name: '/personal/information',
component: () => import('../views/personal/Information.vue')
},
{
path: '/system/role/list',
name: '/system/role/list',
component: () => import('../views/system/role/List.vue')
},
{
path: '/system/menu/list',
name: '/system/menu/list',
component: () => import('../views/system/menu/List.vue')
},
{
path: '/inventory_management/store/list',
name: '/inventory_management/store/list',
component: () => import('../views/inventory_management/store/List.vue')
},
{
path: '/inventory_management/detail_store_goods_in/list',
name: '/inventory_management/detail_store_goods_in/list',
component: () => import('../views/inventory_management/detail_store_goods_in/List.vue')
},
{
path: '/inventory_management/detail_store_goods_out/list',
name: '/inventory_management/detail_store_goods_out/list',
component: () => import('../views/inventory_management/detail_store_goods_out/List.vue')
},
{
path: '/inventory_management/supplier/list',
name: '/inventory_management/supplier/list',
component: () => import('../views/inventory_management/supplier/List.vue')
},
{
path: '/inventory_management/detail_store_goods_in/notice/list',
name: '/inventory_management/detail_store_goods_in/notice/list',
component: () => import('../views/inventory_management/detail_store_goods_in/notice/List.vue')
},
{
path: '/inventory_management/detail_store_goods_out/notice/list',
name: '/inventory_management/detail_store_goods_out/notice/list',
component: () => import('../views/inventory_management/detail_store_goods_out/notice/List.vue')
},
{
path: '/inventory_management/store/storage_situation',
name: '/inventory_management/store/storage_situation',
component: () => import('../views/inventory_management/store/StorageSituation.vue')
},
{
path: '/goods_management/goods_category/list',
name: '/goods_management/goods_category/list',
component: () => import('../views/goods_management/goods_category/List.vue')
},
{
path: '/goods_management/goods/list',
name: '/goods_management/goods/list',
component: () => import('../views/goods_management/goods/List.vue')
},
{
path: '/goods_management/goods_store/list',
name: '/goods_management/goods_store/list',
component: () => import('../views/goods_management/goods_store/List.vue')
},
{
path: '/goods_management/statistic_sale/list',
name: '/goods_management/statistic_sale/list',
component: () => import('../views/goods_management/statistic_sale/List.vue')
},
{
path: '/goods_management/point_products/list',
name: '/goods_management/point_products/list',
component: () => import('../views/goods_management/point_products/List.vue')
},
{
path: '/personnel_management/dept/list',
name: '/personnel_management/dept/list',
component: () => import('../views/personnel_management/dept/List.vue')
},
{
path: '/personnel_management/employee/list',
name: '/personnel_management/employee/list',
component: () => import('../views/personnel_management/employee/List.vue')
},
{
path: '/member_management/member/list',
name: '/member_management/member/list',
component: () => import('../views/member_management/member/List.vue')
},
{
path: '/sale_management/sale_cmd/list',
name: '/sale_management/sale_cmd/list',
component: () => import('../views/sale_management/sale_cmd/List.vue')
},
{
path: '/sale_management/sale_records/list',
name: '/sale_management/sale_records/list',
component: () => import('../views/sale_management/sale_records/List.vue')
},
{
path: '/sale_management/exchange_point_products_records/list',
name: '/sale_management/exchange_point_products_records/list',
component: () => import('../views/sale_management/exchange_point_products_records/List.vue')
},
]
},
]
import 'vue-vibe'
const router = new VueRouter({
mode: "history",
routes
})
export default router

@ -0,0 +1,18 @@
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
export default new Vuex.Store({
state: {
BaseApi: "http://localhost:9291"
},
getters: {
},
mutations: {
},
actions: {
},
modules: {
}
})

@ -0,0 +1,41 @@
<!--
* @Description:
* @Author:
* @Date: 09-12 00:42:31
-->
<template>
<div>
<el-breadcrumb separator="/">
<el-breadcrumb-item>首页</el-breadcrumb-item>
</el-breadcrumb><br />
<div id="home_bg">
<h1 style="color: white;font-size: 28px;">欢迎访问超市管理系统</h1>
</div>
</div>
</template>
<script>
export default {
data() {
return {
};
},
methods: {
},
mounted() {
},
};
</script>
<style>
#home_bg {
top: 0;
left: 0;
overflow-y: auto;
height: 80vh;
background: url("../assets/img/13.jpg") center top / cover no-repeat;
}
</style>

@ -0,0 +1,144 @@
<template>
<div id="login">
<div class="loginForm">
<el-form :model="loginForm" ref="loginForm" class="demo-ruleForm">
<br />
<i class="iconfont icon-r-building" style="font-size: 36px">
<b style="font-size: 28px"> 超市管理系统 </b> </i><br /><br />
<el-form-item prop="username">
<el-row>
<el-col :span="5" style="text-align: right">
<i class="iconfont icon-r-user1" style="font-size: 28px; color: grey">
</i>
</el-col>
<el-col :span="19" style="text-align: left; padding-left: 10px">
<el-input v-model="loginForm.username" placeholder="账号"></el-input>
</el-col>
</el-row>
</el-form-item>
<el-form-item prop="password">
<el-row>
<el-col :span="5" style="text-align: right">
<i class="iconfont icon-r-lock" style="font-size: 28px; color: grey">
</i>
</el-col>
<el-col :span="19" style="text-align: left; padding-left: 10px">
<el-input type="password" v-model="loginForm.password" placeholder="密码"></el-input>
</el-col>
</el-row>
</el-form-item>
<el-form-item>
<el-row>
<el-col :span="24" style="text-align: center;padding-left: 45px;">
<el-button type="primary" @click="submitForm('loginForm')">
登录</el-button>
</el-col>
</el-row>
</el-form-item>
</el-form>
</div>
</div>
</template>
<style>
#login {
position: fixed;
top: 0;
left: 0;
width: 100%;
overflow-y: hidden;
height: 100%;
background: url("../assets/img/01.jpg") center top / cover no-repeat;
}
.loginForm {
background-color: white;
width: 400px;
height: 280px;
margin: 150px auto;
text-align: center;
padding-top: 10px;
border-color: #555555;
border-style: solid;
border-radius: 15px;
}
.loginForm input {
width: 260px;
}
h3 {
margin: 10px 0;
}
.loginForm button {
margin-right: 40px;
}
</style>
<script>
import { ajaxPost, popup } from "@/assets/js/common";
import Cookies from "js-cookie";
export default {
data() {
return {
loginForm: {
username: "",
password: "",
},
rules: {
username: [
{
required: true,
message: "账号不能为空",
trigger: "blur",
},
],
password: [
{
required: true,
message: "密码不能为空",
trigger: "blur",
},
{
min: 6,
max: 8,
message: "密码长度为5-8位",
trigger: "blur",
},
],
},
};
},
methods: {
submitForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
ajaxPost("/login", this.loginForm).then((res) => {
res = res.data;
if (res.code == 200) {
Cookies.set("token", res.data.token, {
expires: 1 / 48,
});
Cookies.set(
"employee",
JSON.stringify(res.data.employee),
{ expires: 1 / 48 }
);
popup("登录成功,请稍等...");
this.$router.push("/index");
} else {
popup(res.msg, "warning");
}
});
} else {
popup("账号或密码格式不正确!", "error");
}
});
},
resetForm(formName) {
this.$refs[formName].resetFields();
},
},
};
</script>

@ -0,0 +1,859 @@
<template>
<div>
<el-breadcrumb separator="/">
<el-breadcrumb-item>首页</el-breadcrumb-item>
<el-breadcrumb-item>商品管理</el-breadcrumb-item>
<el-breadcrumb-item>商品信息</el-breadcrumb-item> </el-breadcrumb
><br />
<el-row>
<el-col :span="6" style="text-align: left; padding-right: 10px">
<el-input placeholder="商品编号" v-model="searchForm.id" />
</el-col>
<el-col :span="6" style="text-align: left; padding-right: 10px">
<el-input placeholder="商品名称" v-model="searchForm.name" />
</el-col>
<el-col :span="6" style="text-align: left; padding-right: 10px">
<el-input
placeholder="商品售价"
v-model="searchForm.sellPrice"
/>
</el-col>
<el-col :span="6">
<el-select
v-model="searchForm.categoryId"
placeholder="商品分类"
filterable
@change="$forceUpdate()"
clearable
>
<el-option
v-for="item in options_category"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-col>
</el-row>
<br />
<el-row>
<el-col :span="6" style="text-align: left; padding-right: 10px">
<el-select
v-model="searchForm.state"
placeholder="请选择状态"
clearable
>
<el-option
v-for="item in options_state"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-col>
<el-col :span="18">
<span>时间</span>
<el-date-picker
v-model="searchForm.operateStartTime"
type="date"
placeholder="起始时间"
>
</el-date-picker>
-
<el-date-picker
v-model="searchForm.operateEndTime"
type="date"
placeholder="结束时间"
>
</el-date-picker>
</el-col>
</el-row>
<br />
<el-row>
<el-col :span="24" style="text-align: left">
<el-button
type="primary"
@click="submitSearchForm"
>
搜索</el-button
>
<el-button
type="success"
@click="newVisable = true"
>
创建商品
</el-button>
</el-col>
</el-row>
<br />
<div class="table">
<el-table :data="tableData" style="width: 100%" size="medium">
<el-table-column type="index" label="序号"> </el-table-column>
<el-table-column prop="coverUrl" label="封面">
<template v-slot="scope">
<img
height="60px"
:src="BaseApi + scope.row.coverUrl"
/>
</template>
</el-table-column>
<el-table-column prop="id" label="编号"> </el-table-column>
<el-table-column prop="name" label="名称"> </el-table-column>
<el-table-column prop="sellPrice" label="售价">
</el-table-column>
<el-table-column prop="purchashPrice" label="成本价">
</el-table-column>
<el-table-column prop="residueNum" label="在售数量">
</el-table-column>
<el-table-column prop="categoryName" label="类型">
</el-table-column>
<el-table-column prop="state" label="状态">
<template v-slot="scope">
<el-tag
size="mini"
type="success"
v-if="scope.row.state == '0'"
>上架</el-tag
>
<el-tag size="mini" type="danger" v-else></el-tag>
</template>
</el-table-column>
<el-table-column prop="residueStoreNum" label="库存量">
<template v-slot="scope">
{{
scope.row.residueStoreNum
? scope.row.residueStoreNum
: 0
}}
</template>
</el-table-column>
<el-table-column prop="updateby" label="操作者">
</el-table-column>
<el-table-column
prop="updateTime"
:show-overflow-tooltip="true"
label="操作时间"
>
</el-table-column>
<el-table-column
prop="info"
:show-overflow-tooltip="true"
label="备注"
>
</el-table-column>
<el-table-column width="420" fixed="right" label="操作">
<template v-slot="scope">
<el-button
type="success"
@click="editBtn(scope.row.id)"
>
修改</el-button
>
<el-button
type="danger"
@click="returnBtn(scope.row.id)"
>
退还</el-button
>
<el-button
v-if="scope.row.state == '0'"
type="warning"
@click="
upOrdown(
scope.row.id,
scope.row.state,
scope.row.residueNum
)
"
>
下架
</el-button>
<el-button
v-if="scope.row.state == '1'"
type="warning"
@click="upOrdown(scope.row.id, scope.row.state)"
>
上架
</el-button>
</template>
</el-table-column>
</el-table>
<div style="margin: 10px 0 15px 0">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="searchForm.currentPage"
:page-sizes="[5, 10, 20, 50]"
:page-size="searchForm.pageSize"
layout="total,sizes, prev, pager, next,jumper"
:total="searchForm.total"
>
</el-pagination>
</div>
</div>
<!--创建商品表单弹出-->
<el-dialog
title="创建商品"
:visible.sync="newVisable"
@close="dialog_imgClose"
width="50%"
>
<el-form
:model="newForm"
:rules="rules"
ref="newForm"
label-width="100px"
class="demo-ruleForm"
>
<el-form-item label="商品图:">
<!-- action="http://localhost:9291/goods_management/goods/uploadImg"-->
<el-upload
class="avatar-uploader"
action="http://localhost:9291/goods_management/goods/uploadImg"
:show-file-list="false"
:on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload"
>
<img
v-if="imageUrl"
:src="BaseApi + imageUrl"
class="avatar"
/>
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</el-form-item>
<el-form-item label="商品名:" prop="name">
<el-input
v-model="newForm.name"
placeholder="如:农夫山泉"
></el-input>
</el-form-item>
<el-form-item label="成本价:" prop="purchashPrice">
<el-input
v-model="newForm.purchashPrice"
placeholder="如9.9"
></el-input>
</el-form-item>
<el-form-item label="销售价格:">
<el-input
v-model="newForm.sellPrice"
placeholder="如9.9"
></el-input>
</el-form-item>
<el-form-item label="描述:">
<el-input
type="textarea"
placeholder="如:农夫山泉是矿泉水"
v-model="newForm.info"
></el-input>
</el-form-item>
<el-form-item label="分类:">
<el-select
v-model="newForm.categoryId"
placeholder="请选择分类"
filterable
@change="$forceUpdate()"
clearable
>
<el-option
v-for="item in options_category"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submitNewForm('newForm')"
> 提交</el-button
>
<el-button @click="saveCancel('newForm')" > 取消</el-button>
</el-form-item>
</el-form>
</el-dialog>
<!--修改表单-->
<el-dialog
title="修改商品信息"
:visible.sync="dialogVisible"
@close="dialog_imgClose"
width="50%"
>
<el-form
:model="editForm"
:rules="rules"
ref="editForm"
label-width="100px"
class="demo-ruleForm"
>
<!-- action="http://localhost:9291/goods_management/goods/uploadImg"-->
<el-upload
class="avatar-uploader"
action="http://localhost:9291/goods_management/goods/uploadImg"
:show-file-list="false"
:on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload"
>
<img
v-if="imageUrl"
:src="BaseApi + imageUrl"
class="avatar"
/>
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
<el-form-item label="商品名:" prop="name">
<el-input
v-model="editForm.name"
placeholder="如:农夫山泉"
></el-input>
</el-form-item>
<el-form-item label="成本价:" prop="purchashPrice">
<el-input
v-model="editForm.purchashPrice"
placeholder="如9.9"
></el-input>
</el-form-item>
<el-form-item label="销售价格:">
<el-input
v-model="editForm.sellPrice"
placeholder="如9.9"
></el-input>
</el-form-item>
<el-form-item label="描述:">
<el-input
type="textarea"
placeholder="如:农夫山泉是矿泉水"
v-model="editForm.info"
></el-input>
</el-form-item>
<el-form-item style="width: 40%" label="分类:">
<el-select
v-model="editForm.categoryId"
placeholder="请选择分类"
filterable
@change="$forceUpdate()"
clearable
>
<el-option
v-for="item in options_category"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type="primary"
@click="submitEditForm('editForm')"
> 提交</el-button
>
<el-button @click="resetEditForm('editForm')"
> 关闭</el-button
>
</el-form-item>
</el-form>
</el-dialog>
<!--退还表单-->
<el-dialog
title="退还商品入库信息"
:visible.sync="returnVisible"
width="60%"
>
<el-form
:model="returnForm"
:rules="rules"
ref="returnForm"
label-width="100px"
class="demo-ruleForm"
>
<el-row>
<el-col :span="12">
<el-form-item label="商品名:">
<el-input
readonly
v-model="returnForm.goodsName"
placeholder="如:农夫山泉"
></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="仓库:" prop="storeId">
<el-select
v-model="returnForm.storeId"
placeholder="请选择仓库"
filterable
clearable
>
<el-option
v-for="item in options_store"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="数量:" prop="goodsNum">
<el-input
type="number"
@change="
() => {
if (
this.goodsNum_max <
this.returnForm.goodsNum
) {
this.returnForm.goodsNum =
this.goodsNum_max;
}
if (this.returnForm.goodsNum < 1) {
this.returnForm.goodsNum = 1;
}
}
"
min="1"
:max="goodsNum_max"
v-model="returnForm.goodsNum"
placeholder="如1"
></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="类型:" prop="state">
<el-select
v-model="returnForm.state"
@change="$forceUpdate"
placeholder="请选择类型"
clearable
>
<el-option label="过期" value="1"></el-option>
<el-option label="入库" value="0"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="描述:">
<el-input
type="textarea"
placeholder="如:该商品正执行下架操作"
v-model="returnForm.info"
></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="日期:" prop="createTime">
<el-date-picker
size="mini"
value-format="yyyy-MM-dd"
v-model="returnForm.createTime"
type="date"
placeholder="退还日期"
>
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-form-item style="width: 80%">
<el-button
type="primary"
@click="submitReturnForm('returnForm')"
>
确定</el-button
>
<el-button @click="resetReturnForm('returnForm')"
> 关闭</el-button
>
</el-form-item>
</el-form>
</el-dialog>
</div>
</template>
<script>
import { popup } from "@/assets/js/common";
import {
queryPageByQo,
save,
update,
upOrdown,
queryGoodsById,
selected_storeAll,
returnGoods,
} from "@/api/goods_management/goods/goodsApi";
import { getNormalCategoryAll } from "@/api/goods_management/goods_category/goodsCategoryApi";
export default {
data() {
return {
BaseApi: this.$store.state.BaseApi,
/*搜索*/
options_category: [],
options_state: [
{ label: "上架", value: "0" },
{ label: "下架", value: "1" },
],
goodsNum_max: "",
options_store: [],
newVisable: false,
dialogVisible: false,
returnVisible: false,
returnForm: {
goodsId: "",
goodsNum: "",
goodsName: "",
createTime: "",
info: "",
storeId: "",
},
newForm: {},
editForm: {
id: "",
name: "",
info: "",
categoryId: "",
sellPrice: "",
purchashPrice: "",
state: "",
coverUrl: "",
},
imageUrl: "",
/*表格*/
tableData: [],
searchForm: {
total: 0,
currentPage: 1,
pageSize: 5,
state: "0",
},
rules: {
name: [
{
required: true,
message: "商品名不能为空",
trigger: "blur",
},
],
purchashPrice: [
{
required: true,
message: "成本价不能为空",
trigger: "blur",
},
],
storeId: [
{
required: true,
message: "仓库编号不能为空",
trigger: "blur",
},
],
createTime: [
{
required: true,
message: "退还日期不能为空",
trigger: "blur",
},
],
state: [
{
required: true,
message: "退还类型不能为空",
trigger: "blur",
},
],
goodsNum: [
{
required: true,
message: "退还数量不能为空",
trigger: "blur",
},
],
},
};
},
methods: {
normalCategoryAll() {
getNormalCategoryAll().then((res) => {
res = res.data;
if (res.code == 200) {
this.options_category = res.data;
}
});
},
normalStoreAll() {
selected_storeAll().then((res) => {
res = res.data;
if (res.code == 200) {
this.options_store = res.data;
}
});
},
dialog_imgClose() {
this.imageUrl = "";
},
init() {
if (
this.searchForm.operateStartTime >
this.searchForm.operateEndTime
) {
popup("结束时间不能小于开始时间", "warning");
return;
}
queryPageByQo(this.searchForm).then((res) => {
res = res.data;
if (res.code == 200) {
this.tableData = res.data.records;
this.searchForm.total = res.data.total;
this.searchForm.pageSize = res.data.size;
this.searchForm.currentPage = res.data.current;
} else {
popup(res.msg, "error");
}
});
},
/*分页*/
handleSizeChange(val) {
this.searchForm.pageSize = val;
this.init();
console.log(`每页 ${val}`);
},
handleCurrentChange(val) {
this.searchForm.currentPage = val;
this.init();
console.log(`当前页: ${val}`);
},
submitSearchForm() {
this.init();
},
/*创建新的商品*/
saveCancel(formName) {
this.newForm = {};
this.$refs[formName].resetFields();
this.newVisable = false;
},
/*上传头像*/
handleAvatarSuccess(res) {
this.imageUrl = res.url;
},
beforeAvatarUpload(file) {
const isJPG =
file.type === "image/jpeg" || file.type === "image/png";
const isLt2M = file.size / 1024 / 1024 < 3;
if (!isJPG) {
this.$message.error("上传头像图片只能是 JPG或PNG 格式!");
}
if (!isLt2M) {
this.$message.error("上传头像图片大小不能超过 3MB!");
}
return isJPG && isLt2M;
},
submitNewForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
this.newForm.coverUrl = this.imageUrl;
save(this.newForm).then((res) => {
res = res.data;
if (res.code == 200) {
popup("操作成功");
this.newForm = {};
this.imageUrl = "";
this.newVisable = false;
this.init();
} else {
popup(res.msg, "error");
}
});
}
});
},
/*上/下架业务*/
upOrdown(gid, state, residueNum) {
if (state == "0") {
if (residueNum) {
popup("请先将该商品从货架上退还给仓库", "warning");
return;
}
}
this.$confirm(
"确定要将该商品" + (state == "0" ? "下架" : "上架") + "",
"警示",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
.then(() => {
upOrdown({ gid: gid, state: state }).then((res) => {
res = res.data;
if (res.code == 200) {
if (state == "0") {
popup("下架成功");
} else {
popup("上架成功");
}
this.init();
} else {
popup(res.msg, "error");
}
});
})
.catch(() => {
this.$message({
type: "info",
message: "已取消操作",
});
});
},
resetReturnForm(formName) {
this.$refs[formName].resetFields();
this.returnVisible = false;
this.returnForm = {};
},
/*修改*/
submitEditForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
this.editForm.coverUrl = this.imageUrl;
update(this.editForm).then((res) => {
res = res.data;
if (res.code == 200) {
popup("操作成功");
this.editForm = {};
this.imageUrl = "";
this.dialogVisible = false;
this.init();
} else {
popup(res.msg, "error");
}
});
}
});
},
resetEditForm(formName) {
this.$refs[formName].resetFields();
this.editForm = {};
this.dialogVisible = false;
},
editBtn(id) {
queryGoodsById({ id: id }).then((res) => {
res = res.data;
if (res.code == 200) {
this.editForm = {
id: res.data.id,
name: res.data.name,
info: res.data.info,
categoryId: res.data.categoryId,
sellPrice: res.data.sellPrice,
purchashPrice: res.data.purchashPrice,
state: res.data.state,
coverUrl: res.data.coverUrl,
};
this.imageUrl = this.editForm.coverUrl
? this.editForm.coverUrl
: "";
this.dialogVisible = true;
} else {
popup(res.msg, "warning");
}
});
},
returnBtn(id) {
this.returnForm = {
goodsId: "",
goodsNum: "",
goodsName: "",
createTime: "",
info: "",
storeId: "",
};
queryGoodsById({ id: id }).then((res) => {
res = res.data;
if (res.code == 200) {
this.returnForm.goodsId = res.data.id;
this.returnForm.goodsName = res.data.name;
this.returnForm.goodsNum = res.data.residueNum;
if (this.returnForm.goodsNum == 0) {
popup("货架上没有商品", "warning");
return;
}
this.goodsNum_max = res.data.residueNum;
this.returnVisible = true;
} else {
popup(res.msg, "warning");
}
});
},
submitReturnForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
returnGoods(this.returnForm).then((res) => {
res = res.data;
if (res.code == 200) {
popup("退还成功");
this.returnVisible = false;
this.init();
} else {
popup(res.msg, "error");
}
});
}
});
},
},
mounted() {
this.init();
this.normalCategoryAll();
this.normalStoreAll();
},
};
</script>
<style>
.searchForm {
height: 134px;
}
.table {
height: 320px;
}
.pageUtils {
position: absolute;
width: 84%;
margin: 2px auto;
height: 43px;
}
.searchForm {
display: inline-block;
margin: 0 auto;
height: 51px;
line-height: 51px;
}
.searchForm .column {
display: inline-block;
margin: 0 auto;
margin-right: 2px;
line-height: 48px;
height: 51px;
}
</style>

@ -0,0 +1,353 @@
<template>
<div>
<el-breadcrumb separator="/">
<el-breadcrumb-item>首页</el-breadcrumb-item>
<el-breadcrumb-item>商品管理</el-breadcrumb-item>
<el-breadcrumb-item>分类管理</el-breadcrumb-item> </el-breadcrumb
><br />
<el-row>
<el-col :span="8" style="text-align: left; padding-right: 10px">
<el-input placeholder="分类名称" v-model="searchForm.name" />
</el-col>
<el-col :span="8">
<el-select
v-model="searchForm.state"
placeholder="状态"
clearable
>
<el-option label="正常" value="0"></el-option>
<el-option label="停用" value="-1"></el-option>
</el-select>
</el-col>
</el-row>
<br />
<el-row>
<el-col :span="24" style="text-align: left">
<el-button
type="primary"
@click="submitSearchForm"
>
搜索</el-button
>
<el-button
type="success"
@click="newVisable = true"
>
创建分类
</el-button>
</el-col>
</el-row>
<br />
<div class="table">
<el-table :data="tableData" style="width: 100%" size="medium">
<el-table-column type="index" label-width="100px" label="序号">
</el-table-column>
<el-table-column prop="name" label-width="100px" label="名称">
</el-table-column>
<el-table-column
prop="info"
label-width="100px"
:show-overflow-tooltip="true"
label="描述"
>
</el-table-column>
<el-table-column prop="state" label-width="100px" label="状态">
<template v-slot="scope">
<el-tag type="success" v-if="scope.row.state == '0'"
>正常</el-tag
>
<el-tag type="danger" v-else></el-tag>
</template>
</el-table-column>
<el-table-column label="操作" width="260" fixed="right">
<template v-slot="scope">
<el-button
type="success"
@click="editbtn(scope.row)"
>
修改</el-button
>
<el-button
type="danger"
@click="forbidden(scope.row.id)"
>
停用</el-button
>
</template>
</el-table-column>
</el-table>
<div style="margin: 10px 0 15px 0">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="searchForm.currentPage"
:page-sizes="[5, 10, 20, 50]"
:page-size="searchForm.pageSize"
layout="total,sizes, prev, pager, next,jumper"
:total="searchForm.total"
>
</el-pagination>
</div>
</div>
<!--创建弹出框-->
<el-dialog title="创建商品分类" :visible.sync="newVisable" width="50%">
<el-form
:model="newForm"
:rules="rules"
ref="newForm"
label-width="100px"
class="demo-ruleForm"
>
<el-form-item label="名称:" prop="name">
<el-input v-model="newForm.name"></el-input>
</el-form-item>
<el-form-item label="描述:">
<el-input type="textarea" v-model="newForm.info"></el-input>
</el-form-item>
<el-form-item>
<el-button
type="primary"
@click="submitNewForm('newForm')"
>
提交</el-button
>
<el-button @click="saveCancel"
> 取消</el-button
>
</el-form-item>
</el-form>
</el-dialog>
<!--修改描述/状态弹出框-->
<el-dialog
title="分类信息修改"
:visible.sync="dialogVisible"
width="50%"
>
<el-form
:model="editForm"
:rules="rules"
ref="editForm"
label-width="100px"
class="demo-ruleForm"
>
<el-form-item label="名称:" prop="name">
<el-input v-model="editForm.name"></el-input>
</el-form-item>
<el-form-item label="描述:">
<el-input
type="textarea"
v-model="editForm.info"
></el-input>
</el-form-item>
<el-form-item label="状态:" prop="state">
<el-select
v-model="editForm.state"
clearable
@change="$forceUpdate()"
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>
<el-button
type="primary"
@click="submitEditForm('editForm')"
>
提交</el-button
>
<el-button
@click="resetEditForm('editForm')"
>
重置</el-button
>
</el-form-item>
</el-form>
</el-dialog>
</div>
</template>
<script>
import { popup } from "@/assets/js/common";
import {
deactivate,
queryPageByQo,
save,
update,
} from "@/api/goods_management/goods_category/goodsCategoryApi";
export default {
data() {
return {
/*搜索*/
newVisable: false,
dialogVisible: false,
options: [
{ label: "正常", value: "0" },
{ label: "停用", value: "-1" },
],
/*表格*/
tableData: [],
searchForm: {
total: 0,
currentPage: 1,
pageSize: 5,
},
editForm: {},
newForm: {},
rules: {
name: [
{
required: true,
message: "名称不能为空",
trigger: "blur",
},
],
state: [
{
required: true,
message: "状态不能为空",
trigger: "blur",
},
],
},
};
},
methods: {
init() {
queryPageByQo(this.searchForm).then((res) => {
res = res.data;
if (res.code == 200) {
console.log(res.data);
this.tableData = res.data.records;
this.searchForm.total = res.data.total;
this.searchForm.pageSize = res.data.size;
this.searchForm.currentPage = res.data.current;
} else {
popup(res.msg, "error");
}
});
},
submitSearchForm() {
this.init();
},
/*分页*/
handleSizeChange(val) {
this.searchForm.pageSize = val;
this.init();
console.log(`每页 ${val}`);
},
handleCurrentChange(val) {
this.searchForm.currentPage = val;
this.init();
console.log(`当前页: ${val}`);
},
submitNewForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
save(this.newForm).then((res) => {
res = res.data;
if (res.code == 200) {
popup("操作成功");
this.newForm = {};
this.newVisable = false;
this.init();
} else {
popup(res.msg, "error");
}
});
}
});
},
saveCancel() {
this.newVisable = false;
this.$refs["newForm"].resetFields();
},
/*修改信息业务*/
editbtn(row) {
this.editForm = { ...row };
this.dialogVisible = true;
},
submitEditForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
update(this.editForm).then((res) => {
res = res.data;
if (res.code == 200) {
popup("操作成功");
this.editForm = {};
this.dialogVisible = false;
this.init();
} else {
popup(res.msg, "error");
}
});
}
});
},
resetEditForm(formName) {
this.$refs[formName].resetFields();
},
/*停用业务*/
forbidden(sid) {
deactivate(sid).then((res) => {
res = res.data;
if (res.code == 200) {
popup("操作成功");
this.searchForm.currentPage = 1;
} else {
popup(res.msg, "error");
}
this.init();
});
},
},
mounted() {
this.init();
},
};
</script>
<style>
.searchForm {
height: 134px;
}
.table {
height: 320px;
}
.pageUtils {
position: absolute;
width: 84%;
margin: 2px auto;
height: 43px;
}
.searchForm {
display: inline-block;
margin: 0 auto;
height: 51px;
line-height: 51px;
}
.searchForm .column {
display: inline-block;
margin: 0 auto;
margin-right: 2px;
line-height: 48px;
height: 51px;
}
</style>

@ -0,0 +1,286 @@
<template>
<div>
<el-breadcrumb separator="/">
<el-breadcrumb-item>首页</el-breadcrumb-item>
<el-breadcrumb-item>商品管理</el-breadcrumb-item>
<el-breadcrumb-item>商品库存</el-breadcrumb-item> </el-breadcrumb
><br />
<el-row>
<el-col :span="8" style="text-align: left; padding-right: 10px">
<el-input placeholder="商品名称" v-model="searchForm.name" />
</el-col>
</el-row>
<br />
<el-row>
<el-col :span="24" style="text-align: left; padding-right: 10px">
<el-button
type="primary"
@click="submitSearchForm"
>
搜索</el-button
>
</el-col>
</el-row>
<br />
<div class="table">
<el-table :data="tableData" style="width: 100%" size="medium">
<el-table-column width="200" prop="id" label="编号">
</el-table-column>
<el-table-column prop="coverUrl" label="封面">
<template v-slot="scope">
<img
height="60px"
:src="BaseApi + scope.row.coverUrl"
/>
</template>
</el-table-column>
<el-table-column prop="name" label="商品名"> </el-table-column>
<el-table-column prop="inventory" label="基本库存量">
</el-table-column>
<el-table-column prop="shelves" label="货架基本数量">
</el-table-column>
<el-table-column label="操作" width="200" fixed="right">
<template v-slot="scope">
<el-button
type="success"
@click="editBtn(scope.row.id)"
>
<i
class="iconfont icon-r-edit"
>
</i>
修改库存量</el-button
>
</template>
</el-table-column>
</el-table>
<div style="margin: 10px 0 15px 0">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="searchForm.currentPage"
:page-sizes="[5, 10, 20, 50]"
:page-size="searchForm.pageSize"
layout="total,sizes, prev, pager, next,jumper"
:total="searchForm.total"
>
</el-pagination>
</div>
</div>
<!--修改库存量-->
<el-dialog
title="修改商品库存量"
:visible.sync="editVisible"
width="60%"
>
<el-form
:model="editForm"
:rules="rules"
ref="editForm"
label-width="150px"
class="demo-ruleForm"
>
<el-form-item style="width: 60%" label="商品名:">
<el-input
disabled
v-model="editForm.name"
placeholder="如:农夫山泉"
></el-input>
</el-form-item>
<el-form-item
label="基本库存量:"
style="width: 60%"
prop="inventory"
>
<el-input
type="number"
@change="
() => {
if (editForm.inventory <= 0) {
editForm.inventory = 1;
}
}
"
v-model="editForm.inventory"
placeholder="如10"
></el-input>
</el-form-item>
<el-form-item
label="货架基本数量:"
style="width: 60%"
prop="shelves"
>
<el-input
type="number"
@change="
() => {
if (editForm.shelves <= 0) {
editForm.shelves = 1;
}
}
"
v-model="editForm.shelves"
placeholder="如10"
></el-input>
</el-form-item>
<el-form-item style="width: 60%">
<el-button
type="primary"
@click="submitEditForm('editForm')"
>
提交</el-button
>
<el-button @click="closeEdit('editForm')"
> 关闭</el-button>
</el-form-item>
</el-form>
</el-dialog>
</div>
</template>
<script>
import { popup } from "@/assets/js/common";
import {
queryGoodsStoreById,
queryPageByQo,
updateInventory,
} from "@/api/goods_management/goods_store/goodsStoreApi";
export default {
data() {
return {
BaseApi: this.$store.state.BaseApi,
editVisible: false,
/*表格*/
tableData: [],
editForm: {},
searchForm: {
total: 0,
currentPage: 1,
pageSize: 5,
state: "0",
},
rules: {
inventory: [
{
required: true,
message: "库存量不能为空",
trigger: "blur",
},
],
shelves: [
{
required: true,
message: "货架数量不能为空",
trigger: "blur",
},
],
},
};
},
methods: {
init() {
queryPageByQo(this.searchForm).then((res) => {
res = res.data;
if (res.code == 200) {
console.log(res.data);
this.tableData = res.data.records;
this.searchForm.total = res.data.total;
this.searchForm.pageSize = res.data.size;
this.searchForm.currentPage = res.data.current;
} else {
popup(res.msg, "error");
}
});
},
/*分页*/
handleSizeChange(val) {
this.searchForm.pageSize = val;
this.init();
console.log(`每页 ${val}`);
},
handleCurrentChange(val) {
this.searchForm.currentPage = val;
this.init();
console.log(`当前页: ${val}`);
},
submitSearchForm() {
this.init();
},
editBtn(id) {
queryGoodsStoreById({ id: id }).then((res) => {
res = res.data;
if (res.code == 200) {
this.editForm = { ...res.data };
this.editVisible = true;
} else {
popup(res.msg, "error");
}
});
},
submitEditForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
updateInventory(this.editForm).then((res) => {
res = res.data;
if (res.code == 200) {
popup("更新成功");
this.editForm = {};
this.editVisible = false;
this.init();
} else {
popup(res.msg, "error");
}
});
}
});
},
closeEdit(formName) {
this.$refs[formName].resetFields();
this.editForm = {};
this.editVisible = false;
},
},
mounted() {
this.init();
},
};
</script>
<style>
.searchForm {
height: 134px;
}
.table {
height: 320px;
}
.pageUtils {
position: absolute;
width: 84%;
margin: 2px auto;
height: 43px;
}
.searchForm {
display: inline-block;
margin: 0 auto;
height: 51px;
line-height: 51px;
}
.searchForm .column {
display: inline-block;
margin: 0 auto;
margin-right: 2px;
line-height: 48px;
height: 51px;
}
</style>

@ -0,0 +1,523 @@
<template>
<div>
<el-breadcrumb separator="/">
<el-breadcrumb-item>首页</el-breadcrumb-item>
<el-breadcrumb-item>商品管理</el-breadcrumb-item>
<el-breadcrumb-item>积分商品</el-breadcrumb-item> </el-breadcrumb
><br />
<el-row>
<el-col :span="8" style="text-align: left; padding-right: 10px">
<el-input placeholder="商品名称" v-model="searchForm.name" />
</el-col>
</el-row>
<br />
<el-row>
<el-col :span="24" style="text-align: left; padding-right: 10px">
<el-button
type="primary"
@click="subSearchForm"
>
搜索</el-button
>
<el-button
type="success"
@click="newBtn"
>
创建积分商品</el-button
>
</el-col>
</el-row>
<br />
<div class="table">
<el-table :data="tableData" style="width: 100%" size="medium">
<el-table-column type="index" width="200" label="序号">
</el-table-column>
<el-table-column
prop="coverUrl"
:show-overflow-tooltip="true"
label="封面"
>
<template v-slot="scope">
<img
height="60px"
:src="BaseApi + scope.row.coverUrl"
/>
</template>
</el-table-column>
<el-table-column
prop="goodsName"
:show-overflow-tooltip="true"
label="商品名"
>
</el-table-column>
<el-table-column
prop="integral"
:show-overflow-tooltip="true"
label="积分"
>
</el-table-column>
<el-table-column
prop="updateby"
:show-overflow-tooltip="true"
label="操作者"
>
</el-table-column>
<el-table-column width="260" fixed="right" label="操作">
<template v-slot="scope">
<el-button
type="success"
@click="editBtn(scope.row.goodsId)"
>
修改</el-button
>
<el-button
type="danger"
@click="delBtn(scope.row.goodsId)"
>
删除</el-button
>
</template>
</el-table-column>
</el-table>
<div style="margin: 10px 0 15px 0">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="searchForm.currentPage"
:page-sizes="[5, 10, 20, 50]"
:page-size="searchForm.pageSize"
layout="total,sizes, prev, pager, next,jumper"
:total="searchForm.total"
>
</el-pagination>
</div>
</div>
<!--创建-->
<el-dialog title="创建积分商品" :visible.sync="newVisable" width="50%">
<el-form
:model="newForm"
:rules="rules"
ref="newForm"
class="demo-ruleForm"
>
<el-form-item
v-if="selectGoodsVisiable"
label="商品"
prop="goodsId"
>
<el-select
v-model="newForm.goodsId"
placeholder="请选择商品"
filterable
@change="$forceUpdate()"
clearable
>
<el-option
v-for="item in options_goods"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item v-else label="商品" prop="goodsId">
<el-select
disabled
v-model="newForm.goodsId"
placeholder="请选择商品"
filterable
@change="$forceUpdate()"
clearable
>
<el-option
v-for="item in options_goods"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item v-if="!selectGoodsVisiable" label="图片:">
<img
style="width: 100px"
:src="BaseApi + newForm.coverUrl"
alt="商品图片"
/>
</el-form-item>
<el-form-item
v-if="!selectGoodsVisiable"
label="积分:"
prop="integral"
>
<el-input
@change="
() => {
if (this.newForm.integral < 0) {
this.newForm.integral = 0;
}
}
"
type="number"
v-model="newForm.integral"
placeholder="如3000"
/>
</el-form-item>
<el-form-item v-if="selectGoodsVisiable">
<el-button
type="primary"
@click="confirmGoods('newForm')"
>
确定</el-button
>
<el-button
@click="closeGoods('newForm')"
> 关闭</el-button
>
</el-form-item>
<el-form-item v-else>
<el-button
type="primary"
@click="submitNewForm('newForm')"
>
确定</el-button
>
<el-button
@click="cancel('newForm')"
> 取消</el-button
>
</el-form-item>
</el-form>
</el-dialog>
<!--修改-->
<el-dialog title="修改积分商品" :visible.sync="editVisable" width="50%">
<el-form
:model="editForm"
:rules="rules"
ref="editForm"
class="demo-ruleForm"
>
<el-form-item label="商品" prop="goodsId">
<el-select
disabled
v-model="editForm.goodsId"
placeholder="请选择商品"
filterable
@change="$forceUpdate()"
clearable
>
<el-option
v-for="item in options_goods1"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="图片:">
<img
style="width: 100px"
:src="BaseApi + editForm.coverUrl"
alt="商品图片"
/>
</el-form-item>
<el-form-item label="积分:" prop="integral">
<el-input
@change="
() => {
if (this.editForm.integral < 0) {
this.editForm.integral = 0;
}
}
"
type="number"
v-model="editForm.integral"
placeholder="如3000"
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
@click="submitEditForm('editForm')"
>
确定</el-button
>
<el-button
@click="cancelEdit('editForm')"
> 取消</el-button
>
</el-form-item>
</el-form>
</el-dialog>
</div>
</template>
<script>
import { popup } from "@/assets/js/common";
import {
del,
queryOptionGoods,
queryPageByQo,
queryPointGoodsById,
savePointGoods,
updatePointGoods,
} from "@/api/goods_management/point_products/pointProductApi";
import {
queryGoodsById,
selected_goodsAll,
} from "@/api/goods_management/goods/goodsApi";
export default {
data() {
return {
BaseApi: this.$store.state.BaseApi,
tableData: [],
searchForm: {
pageSize: 5,
},
selectGoodsVisiable: true,
newVisable: false,
editVisable: false,
newForm: {
goodsId: "",
goodsName: "",
integral: "",
coverUrl: "",
},
editForm: {
goodsId: "",
goodsName: "",
integral: "",
coverUrl: "",
},
options_goods: [],
options_goods1: [],
rules: {
goodsId: [
{
required: true,
message: "商品编号不能为空",
trigger: "blur",
},
],
integral: [
{
required: true,
message: "积分不能为空",
trigger: "blur",
},
],
},
};
},
methods: {
queryOptionGoods() {
queryOptionGoods().then((res) => {
res = res.data;
if (res.code == 200) {
this.options_goods = res.data;
} else {
popup(res.msg, "error");
}
});
},
newBtn() {
if (this.options_goods.length == 0) {
popup("没有可以添加的积分商品", "warning");
return;
}
this.newVisable = true;
this.selectGoodsVisable = true;
},
closeGoods(formName) {
this.$refs[formName].resetFields();
this.newVisable = false;
},
confirmGoods(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
queryGoodsById({ id: this.newForm.goodsId }).then((res) => {
res = res.data;
if (res.code == 200) {
this.newForm.coverUrl = res.data.coverUrl;
this.newForm.goodsName = res.data.name;
this.selectGoodsVisiable = false;
} else {
popup(res.msg, "error");
}
});
}
});
},
submitNewForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
savePointGoods(this.newForm).then((res) => {
res = res.data;
if (res.code == 200) {
popup("创建成功");
this.newVisable = false;
this.selectGoodsVisiable = true;
this.newForm = {};
this.init();
} else {
popup(res.msg, "error");
}
});
}
});
},
submitEditForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
updatePointGoods(this.editForm).then((res) => {
res = res.data;
if (res.code == 200) {
popup("创建成功");
this.editVisable = false;
this.init();
} else {
popup(res.msg, "error");
}
});
}
});
},
cancel(formName) {
this.$refs[formName].resetFields();
this.selectGoodsVisiable = true;
},
cancelEdit(formName) {
this.$refs[formName].resetFields();
this.editVisable = false;
this.editForm = {};
},
subSearchForm() {
this.init();
},
init() {
(this.editForm = {
goodsId: "",
goodsName: "",
integral: "",
coverUrl: "",
}),
this.queryOptionGoods();
queryPageByQo(this.searchForm).then((res) => {
res = res.data;
if (res.code == 200) {
this.tableData = res.data.records;
this.searchForm.total = res.data.total;
this.searchForm.pageSize = res.data.size;
this.searchForm.currentPage = res.data.current;
} else {
popup(res.msg, "error");
}
});
},
/*分页*/
handleSizeChange(val) {
this.searchForm.pageSize = val;
this.init();
console.log(`每页 ${val}`);
},
handleCurrentChange(val) {
this.searchForm.currentPage = val;
this.init();
console.log(`当前页: ${val}`);
},
submitSearchForm() {
this.init();
},
delBtn(cn) {
this.$confirm("确定要删除这条记录" + "", "警示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
del({ id: cn }).then((res) => {
res = res.data;
if (res.code == 200) {
popup("删除成功");
this.init();
} else {
popup(res.msg, "warning");
}
});
})
.catch(() => {
this.$message({
type: "info",
message: "已取消操作",
});
});
},
editBtn(cn) {
queryPointGoodsById({ goodsId: cn }).then((res) => {
res = res.data;
if (res.code == 200) {
this.editVisable = true;
this.editForm.goodsId = res.data.goodsId;
this.editForm.goodsName = res.data.goodsName;
this.editForm.integral = res.data.integral;
this.editForm.coverUrl = res.data.coverUrl;
} else {
popup(res.msg, "error");
}
});
},
},
mounted() {
this.init();
selected_goodsAll().then((res) => {
res = res.data;
if (res.code == 200) {
this.options_goods1 = res.data;
} else {
popup(res.msg, "error");
}
});
},
};
</script>
<style>
.table {
height: 320px;
}
.pageUtils {
position: absolute;
width: 84%;
margin: 2px auto;
height: 43px;
}
.search {
display: inline-block;
margin: 0 auto;
height: 51px;
line-height: 51px;
}
.search .column {
display: inline-block;
margin: 0 auto;
margin-right: 2px;
line-height: 48px;
height: 51px;
}
</style>

@ -0,0 +1,181 @@
<template>
<div>
<el-breadcrumb separator="/">
<el-breadcrumb-item>首页</el-breadcrumb-item>
<el-breadcrumb-item>商品管理 </el-breadcrumb-item>
<el-breadcrumb-item>销量统计</el-breadcrumb-item> </el-breadcrumb
><br />
<el-row>
<el-col :span="8">
<el-input v-model="searchForm.name" placeholder="商品名称" />
</el-col>
<el-col :span="16">
<i class="iconfont icon-r-add" style="font-size: 28px">
<b>
总销量<span style="color: #fc4316"
>{{
totalSalesVolume ? totalSalesVolume : 0
}}</span
>
</b>
</i>
</el-col>
</el-row>
<br />
<el-row>
<el-col :span="24" style="text-align: left">
<el-button
type="primary"
@click="submitSearchForm"
>
搜索</el-button
>
</el-col>
</el-row>
<br />
<div class="table">
<el-table :data="tableData" style="width: 100%" size="medium">
<el-table-column type="index" width="200" label="序号">
</el-table-column>
<el-table-column
prop="coverUrl"
:show-overflow-tooltip="true"
label="封面"
>
<template v-slot="scope">
<img width="60px" :src="BaseApi + scope.row.coverUrl" />
</template>
</el-table-column>
<el-table-column
prop="goodsName"
:show-overflow-tooltip="true"
label="商品名"
>
</el-table-column>
<el-table-column
prop="salesVolume"
:show-overflow-tooltip="true"
label="销量"
>
</el-table-column>
<el-table-column
prop="percentage"
:show-overflow-tooltip="true"
label="销售量占比"
>
<template v-slot="scope">
<el-progress
width="50"
type="dashboard"
:percentage="scope.row.percentage"
:color="customColorMethod"
></el-progress>
</template>
</el-table-column>
</el-table>
<div style="margin: 10px 0 15px 0">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="searchForm.currentPage"
:page-sizes="[5, 10, 20, 50]"
:page-size="searchForm.pageSize"
layout="total,sizes, prev, pager, next,jumper"
:total="searchForm.total"
>
</el-pagination>
</div>
</div>
</div>
</template>
<script>
import { popup } from "@/assets/js/common";
import { queryPageByQo } from "@/api/goods_management/statistic/statisticSaleApi";
export default {
data() {
return {
BaseApi: this.$store.state.BaseApi,
tableData: [],
totalSalesVolume: "", //
searchForm: {
pageSize: 5,
},
options_goods: [],
};
},
methods: {
/*分页*/
init() {
/*查询商品信息*/
queryPageByQo(this.searchForm).then((res) => {
res = res.data;
if (res.code == 200) {
this.totalSalesVolume = res.data.total;
this.tableData = res.data.vos.records;
this.searchForm.total = res.data.vos.total;
this.searchForm.pageSize = res.data.vos.size;
this.searchForm.currentPage = res.data.vos.current;
} else {
popup(res.msg, "error");
}
});
},
handleSizeChange(val) {
this.searchForm.pageSize = val;
this.init();
console.log(`每页 ${val}`);
},
handleCurrentChange(val) {
this.searchForm.currentPage = val;
this.init();
console.log(`当前页: ${val}`);
},
submitSearchForm() {
this.init();
},
customColorMethod(percentage) {
if (percentage < 30) {
return "#f56c6c";
} else if (percentage < 70) {
return "#e6a23c";
} else {
return "#67c23a";
}
},
},
mounted() {
this.init();
},
};
</script>
<style>
.table {
height: 320px;
}
.pageUtils {
position: absolute;
width: 84%;
margin: 2px auto;
height: 43px;
}
.search {
display: inline-block;
margin: 0 auto;
height: 51px;
line-height: 51px;
}
.search .column {
display: inline-block;
margin: 0 auto;
margin-right: 2px;
line-height: 48px;
height: 51px;
}
</style>

@ -0,0 +1,204 @@
<template>
<el-container>
<el-header style="height: 80px">
<el-row>
<el-col :span="12" style="margin-top: 20px">
<i style="color: white; font-size: 32px" class="iconfont icon-r-building">
<b style="font-size: 26px"> 超市管理系统</b></i>
</el-col>
<el-col :span="12" style="text-align: right; margin-top: 15px; cursor: pointer">
<el-dropdown>
<el-avatar :size="50" shape="square" :src="BaseApi + circleUrl"></el-avatar>
<b style="
font-size: 24px;
color: white;
margin-top: -10px;
">
{{ isAdmin ? "管理员 " : "用户 " }}
{{ loginName }}</b>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="informationBtn">个人资料完善</el-dropdown-item>
<el-dropdown-item @click.native="empExit">退出</el-dropdown-item>
<el-dropdown-item @click.native="logoutVisable = true">注销</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</el-col>
</el-row>
</el-header>
<!--注销账户-->
<el-dialog title="注销账户" :visible.sync="logoutVisable" width="70%">
<el-form :model="logoutform" :rules="rules" ref="logoutform" label-width="100px" class="demo-ruleForm">
<el-form-item label="内容" prop="content">
<el-input v-model="logoutform.content" placeholder="请填写“本人确定注销”"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="logoutSubmit('logoutform')"> </el-button>
<el-button @click="logoutCel('logoutform')"> </el-button>
</el-form-item>
</el-form>
</el-dialog>
<el-container>
<el-aside width="200px" style="overflow-y: hidden;min-height: 900px;">
<el-menu background-color="#6495ED" text-color="white" :router="true" :unique-opened="true"
active-text-color="#FFDEAD">
<el-submenu v-for="item in menu_catalogs" :key="item.id" :index="item.id + ''">
<template slot="title">
<i :class="item.icon" style="font-size: 28px; color: white">
</i>
<b style="font-size: 21px;"> {{ item.label }}</b>
</template>
<el-menu-item-group>
<el-menu-item v-for="c in item.children" :key="c.id" :index="c.purl">
<i :class="c.icon" style="font-size: 24px"> </i>
<b> {{ c.label }}</b>
</el-menu-item>
</el-menu-item-group>
</el-submenu>
</el-menu>
</el-aside>
<el-main>
<router-view />
</el-main>
</el-container>
</el-container>
</template>
<script>
import { clearCookie, loginEmp } from "@/assets/js/auth";
import { ajaxGet, ajaxPost, popup } from "@/assets/js/common";
import Cookies from "js-cookie";
export default {
data() {
return {
BaseApi: this.$store.state.BaseApi,
logoutVisable: false,
loginName: "",
isAdmin: "",
logoutform: {},
circleUrl: loginEmp().headImg,
menu_catalogs: [],
rules: {
content: [
{
required: true,
message: "内容不能为空",
trigger: "blur",
},
],
},
};
},
methods: {
init() {
this.isAdmin = loginEmp().isAdmin;
this.loginName = loginEmp().nickName;
ajaxGet("/empMenu", {}).then((res) => {
res = res.data;
if (res.code == 200) {
this.menu_catalogs = res.data;
}
});
},
/*个人资料*/
informationBtn() {
this.$router.push("/personal/information");
popup("请完善个人的资料");
},
/*账户退出*/
empExit() {
this.$confirm("确定要退出系统?", "警示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
ajaxGet("/exit", this.pwdForm).then((res) => {
res = res.data;
if (res.code == 200) {
popup("成功退出系统...");
clearCookie("employee");
clearCookie("token");
this.$router.push("/");
} else {
popup(res.msg, "error");
}
});
})
.catch(() => {
this.$message({
type: "info",
message: "已取消操作",
});
});
},
/*注销账户*/
logoutCel(formName) {
this.$refs[formName].resetFields();
this.logoutform = {};
this.logoutVisable = false;
},
logoutSubmit(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
ajaxPost("/logout", {
content: this.logoutform.content,
}).then((res) => {
res = res.data;
if (res.code == 200) {
popup("注销成功");
clearCookie("employee");
clearCookie("token");
this.logoutVisable = false;
this.$router.push("/");
} else {
popup(res.msg, "error");
}
});
}
});
},
},
mounted() {
this.init();
},
};
</script>
<style>
.avatar {
display: inline-block;
width: 200px;
float: right;
}
.personalFul {
background-color: #ffffff;
position: absolute;
z-index: 999999;
top: 58px;
right: 20px;
width: 151px;
}
/* .personalFul ul > li {
margin: 1px auto;
padding: 0px;
height: 20px;
color: #ffffff;
background-color: #6495ED;
list-style-type: none;
} */
.personalFul ul>li:hover {
background-color: #fc4316;
}
.el-menu-item i {
color: white;
}
.el-submenu__title i {
color: white;
}
</style>

@ -0,0 +1,597 @@
<template>
<div id="detail_store_goods_in">
<el-breadcrumb separator="/">
<el-breadcrumb-item>首页</el-breadcrumb-item>
<el-breadcrumb-item>库存管理 </el-breadcrumb-item>
<el-breadcrumb-item>入库明细</el-breadcrumb-item> </el-breadcrumb
><br />
<el-row>
<el-col :span="3" style="text-align: left;padding-right: 10px;">
<el-input placeholder="入库编号" v-model="searchForm.cn"/>
</el-col>
<el-col :span="3">
<el-input placeholder="商品名称" v-model="searchForm.goodsName"/>
</el-col>
<el-col :span="16">
<span>入库时间</span>
<el-date-picker
value-format="yyyy-MM-dd"
v-model="searchForm.startCreateTime"
type="date"
placeholder="起始时间">
</el-date-picker>
-
<el-date-picker
v-model="searchForm.endCreateTime"
value-format="yyyy-MM-dd"
type="date"
placeholder="结束时间">
</el-date-picker>
</el-col>
<el-col :span="2" >
<el-select
v-model="searchForm.state1"
@change="$forceUpdate()"
placeholder="请选择状态" clearable>
<el-option label="正常" value="0"></el-option>
<el-option label="删除" value="1"></el-option>
</el-select>
</el-col>
</el-row>
<br />
<el-row>
<el-col :span="24" style="text-align: left">
<el-button
type="primary"
@click="submitSearchForm"
>
搜索</el-button
>
<el-button
type="warning"
@click="goodsInBtn"
>
商品入库
</el-button>
</el-col>
</el-row>
<br />
<div class="table">
<el-table
:data="tableData"
style="width: 100%;"
size="medium">
<el-table-column
prop="cn"
width="200"
label="编号">
</el-table-column>
<el-table-column
prop="goodsName"
:show-overflow-tooltip="true"
label="商品名">
</el-table-column>
<el-table-column
prop="goodsPrice"
label="单价">
</el-table-column>
<el-table-column
prop="goodsNum"
label="入库数量">
</el-table-column>
<el-table-column
prop="expiryTime"
:show-overflow-tooltip="true"
label="过期日期">
</el-table-column>
<el-table-column
prop="expiryTime"
:show-overflow-tooltip="true"
label="是否过期">
<template v-slot="scope">
<el-tag type="danger" v-if="new Date()>Date.parse(scope.row.expiryTime)"></el-tag>
<el-tag type="success" v-else></el-tag>
</template>
</el-table-column>
<el-table-column
prop="createTime"
:show-overflow-tooltip="true"
label="入库时间">
</el-table-column>
<el-table-column
prop="storeName"
:show-overflow-tooltip="true"
label="存储仓库">
</el-table-column>
<el-table-column
prop="supplierName"
:show-overflow-tooltip="true"
label="供货商">
</el-table-column>
<el-table-column
prop="createby"
:show-overflow-tooltip="true"
label="录入者">
</el-table-column>
<el-table-column
prop="state"
label="类型">
<template v-slot="scope">
<el-tag type="success" v-if="scope.row.state=='0'"></el-tag>
<el-tag type="danger" v-if="scope.row.state=='1'"></el-tag>
<el-tag type="danger" v-if="scope.row.state=='2'"></el-tag>
</template>
</el-table-column>
<el-table-column
prop="state1"
label="状态">
<template v-slot="scope">
<el-tag type="success" v-if="scope.row.state1=='0'"></el-tag>
<el-tag type="danger" v-else-if="scope.row.state1=='2'">未处理</el-tag>
<el-tag type="danger" v-else></el-tag>
</template>
</el-table-column>
<el-table-column
prop="info"
:show-overflow-tooltip="true"
label="备注">
</el-table-column>
<el-table-column
width="140"
fixed="right"
label="操作">
<template v-slot="scope">
<el-button type="danger" v-if="scope.row.state1=='0'"
@click="del(scope.row.cn)" >
删除
</el-button>
</template>
</el-table-column>
</el-table>
<div style="margin: 10px 0 15px 0;">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="searchForm.currentPage"
:page-sizes="[5, 10, 20, 50]"
:page-size="searchForm.pageSize"
layout="total,sizes, prev, pager, next,jumper"
:total="searchForm.total">
</el-pagination>
</div>
</div>
<!--商品入库表单-->
<el-dialog
title="商品入库"
:visible.sync="goodsInVisable"
width="50%">
<el-form v-if="selectGoodsVisable" :model="selectGoods" :rules="rules" ref="selectGoods" label-width="100px"
class="demo-ruleForm">
<el-form-item label="商品:" prop="goodsId">
<el-select v-model="selectGoods.goodsId"
placeholder="请选择商品"
filterable
@change="$forceUpdate()"
clearable>
<el-option
v-for="item in options_goods"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="仓库:" prop="storeId">
<el-select v-model="selectGoods.storeId"
placeholder="请选择存储仓库"
filterable
@change="$forceUpdate()"
clearable>
<el-option
v-for="item in options_store"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="success" @click="selectedGoods('selectGoods')" >
确定</el-button>
<el-button @click="closeSelectedGoods('selectGoods')" >
关闭</el-button>
</el-form-item>
</el-form>
<el-form v-if="newVisable" :model="newForm" :rules="rules" ref="newForm" label-width="100px"
class="demo-ruleForm">
<el-row>
<el-col :span="12">
<el-form-item label="商品名称:">
<el-input disabled v-model="newForm.goodsName" placeholder="如:农夫山泉"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="商品数量:" prop="goodsNum">
<el-input v-model="newForm.goodsNum" placeholder="如1"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="供货商:" prop="supplierId">
<el-select v-model="newForm.supplierId"
placeholder="请选择供货商"
filterable
@change="$forceUpdate()"
clearable>
<el-option
v-for="item in options_suppliers"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="商品价格:" prop="goodsPrice">
<el-input v-model="newForm.goodsPrice" placeholder="如1.0"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="生产日期:" prop="birthTime">
<el-date-picker
size="mini"
style="width: 140px"
value-format="yyyy-MM-dd"
v-model="newForm.birthTime"
type="date"
placeholder="生产日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="过期日期:" prop="expiryTime">
<el-date-picker
size="mini"
style="width: 140px"
value-format="yyyy-MM-dd"
v-model="newForm.expiryTime"
type="date"
placeholder="过期日期">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="备注:">
<el-input type="textarea" v-model="newForm.info" placeholder="如:农夫山泉入库"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item>
<el-button type="warning" @click="submitNewForm('newForm')" >
入库</el-button>
<el-button @click="saveCancel('newForm')" >
取消</el-button>
</el-form-item>
</el-form>
</el-dialog>
</div>
</template>
<script>
import {
queryGoodsById,
selected_goodsAll,
} from "@/api/goods_management/goods/goodsApi";
import { popup } from "@/assets/js/common";
import {
delIn,
queryOptionsSuppliers,
queryPageByQoIn,
saveIn,
} from "@/api/inventory_management/detail_store_goods/detail_store_goodsApi";
import { storeList } from "@/api/inventory_management/store/storeApi";
export default {
data() {
return {
newVisable: false,
goodsInVisable: false,
selectGoodsVisable: true,
options_suppliers: [],
searchForm: {
pageSize: 5
},
tableData: [],
newForm: {
cn: "",
goodsId: "",
goodsNum: "",
goodsName: "",
goodsPrice: "",
supplierId: "",
info: "",
expiryTime: "",
birthTime: "",
storeId: "",
},
options_goods: [],
options_store: [],
rules: {
supplierId: [
{
required: true,
message: "供应商不能为空",
trigger: "blur",
},
],
goodsId: [
{
required: true,
message: "商品编号不能为空",
trigger: "blur",
},
],
storeId: [
{
required: true,
message: "仓库编号不能为空",
trigger: "blur",
},
],
goodsNum: [
{
required: true,
message: "商品数量不能为空",
trigger: "blur",
},
],
goodsPrice: [
{
required: true,
message: "商品价格不能为空",
trigger: "blur",
},
],
expiryTime: [
{
required: true,
message: "过期时间不能为空",
trigger: "blur",
},
],
birthTime: [
{
required: true,
message: "生产时间不能为空",
trigger: "blur",
},
],
},
selectGoods: {},
};
},
methods: {
init() {
this.newVisable = false;
this.selectGoodsVisable = true;
if (
this.searchForm.startCreateTime > this.searchForm.endCreateTime
) {
popup("结束时间不能小于开始时间", "warning");
return;
}
queryPageByQoIn(this.searchForm).then((res) => {
res = res.data;
if (res.code == 200) {
this.tableData = res.data.records;
this.searchForm.total = res.data.total;
this.searchForm.pageSize = res.data.size;
this.searchForm.currentPage = res.data.current;
} else {
popup(res.msg, "error");
}
});
},
closeSelectedGoods(formName) {
this.$refs[formName].resetFields();
this.goodsInVisable = false;
this.newVisable = false;
this.selectGoodsVisable = true;
},
/*分页*/
handleSizeChange(val) {
this.searchForm.pageSize = val;
this.init();
console.log(`每页 ${val}`);
},
handleCurrentChange(val) {
this.searchForm.currentPage = val;
this.init();
console.log(`当前页: ${val}`);
},
submitSearchForm() {
this.init();
},
goodsInBtn() {
this.selectGoods = {};
this.goodsInVisable = true;
this.newForm = {
cn: "",
goodsId: "",
goodsNum: "",
goodsName: "",
goodsPrice: "",
supplierId: "",
info: "",
expiryTime: "",
birthTime: "",
storeId: "",
};
},
detailStoreGoodsIn_goodsAll() {
selected_goodsAll().then((res) => {
res = res.data;
if (res.code == 200) {
this.options_goods = res.data;
} else {
popup(res.msg, "error");
}
});
},
detailStoreGoodsIn_suppliers() {
queryOptionsSuppliers().then((res) => {
res = res.data;
if (res.code == 200) {
this.options_suppliers = res.data;
} else {
popup(res.msg, "error");
}
});
},
detailStoreGoodsIn_storeAll() {
storeList({ state: "0" }).then((res) => {
res = res.data;
if (res.code == 200) {
for (var item of res.data) {
this.options_store.push({
id: item.id,
name: item.name,
});
}
} else {
popup(res.msg, "error");
}
});
},
selectedGoods(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
queryGoodsById({ id: this.selectGoods.goodsId }).then(
(res) => {
res = res.data;
if (res.code == 200) {
this.selectGoodsVisable = false;
this.newVisable = true;
this.newForm.storeId = this.selectGoods.storeId;
this.selectGoods = {
storeId: "",
goodsId: "",
};
this.newForm.goodsId = res.data.id;
this.newForm.goodsName = res.data.name;
this.newForm.goodsPrice =
res.data.purchashPrice;
} else {
popup(res.msg, "error");
}
}
);
}
});
},
submitNewForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
if (this.newForm.birthTime >= this.newForm.expiryTime) {
popup("生成日期不能大于或等于过期日期", "warning");
this.newForm.birthTime = "";
this.newForm.expiryTime = "";
return;
}
saveIn(this.newForm).then((res) => {
res = res.data;
if (res.code == 200) {
popup("入库成功");
this.init();
} else {
popup(res.msg, "error");
}
});
}
});
},
saveCancel(formName) {
this.$refs[formName].resetFields();
this.newVisable = false;
this.selectGoodsVisable = true;
},
del(cn) {
this.$confirm("确定删除这条记录?", "警示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
delIn({ cn: cn }).then((res) => {
res = res.data;
if (res.code == 200) {
popup("操作成功");
this.searchForm.state1 = "0";
this.init();
} else {
popup(res.msg, "error");
}
});
})
.catch(() => {
this.$message({
type: "info",
message: "已取消操作",
});
});
},
},
mounted() {
this.searchForm.state1 = "0";
this.detailStoreGoodsIn_goodsAll();
this.detailStoreGoodsIn_storeAll();
this.detailStoreGoodsIn_suppliers();
this.init();
},
};
</script>
<style>
.searchForm {
height: 134px;
}
.table {
height: 320px;
}
.pageUtils {
position: absolute;
width: 84%;
margin: 2px auto;
height: 43px;
}
.searchForm {
display: inline-block;
margin: 0 auto;
height: 51px;
line-height: 51px;
}
.searchForm .column {
display: inline-block;
margin: 0 auto;
margin-right: 2px;
line-height: 48px;
height: 51px;
}
</style>

@ -0,0 +1,410 @@
<template>
<div>
<div class="searchForm">
<div class="column">
<span>商品名</span>
<el-input style="height: 21px;width: 300px" placeholder="请输入商品名" v-model="searchForm.name"/>
</div>
<div class="column">
<el-button type="success" @click="submitSearchForm"></el-button>
</div>
</div>
<div class="table">
<el-table
:data="tableData"
style="width: 100%;"
size="medium">
<el-table-column
width="200"
type="index"
label="序号">
</el-table-column>
<el-table-column
prop="coverUrl"
label="封面">
<template v-slot="scope">
<img height="60px" :src="scope.row.coverUrl">
</template>
</el-table-column>
<el-table-column
prop="name"
label="商品名">
</el-table-column>
<el-table-column
prop="purchashPrice"
label="进货单价">
</el-table-column>
<el-table-column
prop="goodsNum"
label="入库数量">
</el-table-column>
<el-table-column>
<template v-slot="scope">
<el-button type="success"
@click="goodsInBtn(scope.row)" plain>入库
</el-button>
</template>
</el-table-column>
</el-table>
<div style="margin: 10px 0 15px 0;">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="searchForm.currentPage"
:page-sizes="[5, 10, 20, 50]"
:page-size="searchForm.pageSize"
layout="total,sizes, prev, pager, next,jumper"
:total="searchForm.total">
</el-pagination>
</div>
</div>
<!--商品入库表单-->
<el-dialog
title="商品入库"
:visible.sync="goodsInVisable"
width="50%">
<el-form v-if="selectGoodsVisable" :model="selectGoods" :rules="rules" ref="selectGoods" label-width="100px"
class="demo-ruleForm">
<el-form-item style="width:40%" label="商品:" prop="goodsId">
<el-select disabled v-model="selectGoods.goodsId"
placeholder="请选择商品"
filterable
@change="$forceUpdate()"
clearable>
<el-option
v-for="item in options_goods"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item style="width:40%" label="仓库:" prop="storeId">
<el-select v-model="selectGoods.storeId"
placeholder="请选择存储仓库"
filterable
@change="$forceUpdate()"
clearable>
<el-option
v-for="item in options_store"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item style="width:40%">
<el-button type="success" @click="selectedGoods('selectGoods')" plain>确定</el-button>
<el-button type="warning" @click="closeSelectedGoods('selectGoods')" plain> 关闭</el-button>
</el-form-item>
</el-form>
<el-form size="mini" v-if="newVisable" :model="newForm" :rules="rules" ref="newForm" label-width="100px"
class="demo-ruleForm">
<el-row>
<el-col :span="12">
<el-form-item style="width: 60%" label="商品名:">
<el-input readonly v-model="newForm.goodsName" placeholder="如:农夫山泉"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item style="width: 60%" label="商品数量:" prop="goodsNum">
<el-input v-model="newForm.goodsNum" :placeholder="'如:'+newGoodsNum"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item style="width: 60%" label="供货商:" prop="supplierId">
<el-select v-model="newForm.supplierId"
placeholder="请选择供货商"
filterable
@change="$forceUpdate()"
clearable>
<el-option
v-for="item in options_suppliers"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item style="width: 60%" label="商品价格:" prop="goodsPrice">
<el-input v-model="newForm.goodsPrice" placeholder="如1.0"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item style="width: 60%" label="生产日期:" prop="birthTime">
<el-date-picker
size="mini"
style="width: 140px"
value-format="yyyy-MM-dd"
v-model="newForm.birthTime"
type="date"
placeholder="生产日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item style="width: 60%" label="过期日期:" prop="expiryTime">
<el-date-picker
size="mini"
style="width: 140px"
value-format="yyyy-MM-dd"
v-model="newForm.expiryTime"
type="date"
placeholder="过期日期">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item style="width: 82%" label="备注:">
<el-input type="textarea" v-model="newForm.info" placeholder="如:农夫山泉入库"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item>
<el-button type="primary" @click="submitNewForm('newForm')"></el-button>
<el-button @click="saveCancel('newForm')" > 取消</el-button>
</el-form-item>
</el-form>
</el-dialog>
</div>
</template>
<script>
import {popup} from "@/assets/js/common";
import {
queryGoodsStoreById,
queryPageByQo,
updateInventory
} from "@/api/goods_management/goods_store/goodsStoreApi";
import {queryPageNoticeIn} from "@/api/inventory_management/notice/noticeApi";
import {queryGoodsById, selected_goodsAll} from "@/api/goods_management/goods/goodsApi";
import {queryOptionsSuppliers, saveIn} from "@/api/inventory_management/detail_store_goods/detail_store_goodsApi";
import {storeList} from "@/api/inventory_management/store/storeApi";
export default {
data() {
return {
newVisable: false,
goodsInVisable: false,
selectGoodsVisable: true,
newGoodsNum:'',
newForm: {
cn: '',
goodsId: '',
goodsNum: '',
goodsName: '',
goodsPrice: '',
info: '',
expiryTime: '',
birthTime: '',
storeId: ''
},
/*表格*/
tableData: [],
searchForm: {
total: 0,
currentPage: 1,
pageSize: 10,
state: '0'
},
options_goods: [],
options_store: [],
options_suppliers:[],
selectGoods: {},
rules: {
supplierId:[
{required: true, message: '供应商不能为空', trigger: 'blur'},
],
goodsId: [
{required: true, message: '商品编号不能为空', trigger: 'blur'},
],
storeId: [
{required: true, message: '仓库编号不能为空', trigger: 'blur'},
],
goodsNum: [
{required: true, message: '商品数量不能为空', trigger: 'blur'},
],
goodsPrice: [
{required: true, message: '商品价格不能为空', trigger: 'blur'},
],
expiryTime: [
{required: true, message: '过期时间不能为空', trigger: 'blur'},
],
birthTime: [
{required: true, message: '生产时间不能为空', trigger: 'blur'},
],
},
}
},
methods: {
init() {
queryPageNoticeIn(this.searchForm).then(res => {
res = res.data
if (res.code == 200) {
console.log(res.data)
this.tableData = res.data.records
this.searchForm.total = res.data.total
this.searchForm.pageSize = res.data.size
this.searchForm.currentPage = res.data.current
} else {
popup(res.msg, "error")
}
})
},
/*分页*/
handleSizeChange(val) {
this.searchForm.pageSize = val
this.init()
console.log(`每页 ${val}`);
},
handleCurrentChange(val) {
this.searchForm.currentPage = val
this.init()
console.log(`当前页: ${val}`);
},
submitSearchForm() {
this.init()
},
detailStoreGoodsIn_goodsAll() {
selected_goodsAll().then(res => {
res = res.data
if (res.code == 200) {
this.options_goods = res.data
} else {
popup(res.msg, 'error')
}
})
},
detailStoreGoodsIn_suppliers(){
queryOptionsSuppliers().then(res=>{
res=res.data
if (res.code==200){
this.options_suppliers=res.data
}else {
popup(res.msg,"error")
}
}
)
},
detailStoreGoodsIn_storeAll() {
storeList({state: '0'}).then(res => {
res = res.data
if (res.code == 200) {
for (var item of res.data) {
this.options_store.push({id: item.id, name: item.name})
}
} else {
popup(res.msg, "error")
}
})
},
selectedGoods(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
queryGoodsById({id: this.selectGoods.goodsId}).then(res => {
res = res.data
if (res.code == 200) {
this.selectGoodsVisable = false
this.newVisable = true
this.newForm.storeId = this.selectGoods.storeId
this.newForm.goodsId = res.data.id
this.newForm.goodsName = res.data.name
this.newForm.goodsPrice = res.data.purchashPrice
} else {
popup(res.msg, "error")
}
})
}
})
},
closeSelectedGoods(formName){
this.$refs[formName].resetFields()
this.goodsInVisable=false
this.newVisable = false
this.selectGoodsVisable = true
this.selectGoods={}
},
submitNewForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
saveIn(this.newForm).then(res => {
res = res.data
if (res.code == 200) {
popup("入库成功")
this.goodsInVisable=false
this.selectGoodsVisable = true
this.newVisable = false
this.init()
} else {
popup(res.msg, "error")
}
})
}
})
},
saveCancel(formName) {
this.$refs[formName].resetFields()
this.newVisable = false
this.selectGoodsVisable = true
},
goodsInBtn(row) {
this.selectGoods.goodsId=row.id
this.newGoodsNum=row.goodsNum
this.goodsInVisable = true
},
},
mounted() {
this.searchForm.state1 = '0'
this.detailStoreGoodsIn_goodsAll()
this.detailStoreGoodsIn_storeAll()
this.detailStoreGoodsIn_suppliers()
this.init()
}
}
</script>
<style>
.searchForm {
height: 134px;
}
.table {
height: 320px;
}
.pageUtils {
position: absolute;
width: 84%;
margin: 2px auto;
height: 43px;
}
.searchForm {
display: inline-block;
margin: 0 auto;
height: 51px;
line-height: 51px;
}
.searchForm .column {
display: inline-block;
margin: 0 auto;
margin-right: 2px;
line-height: 48px;
height: 51px;
}
</style>

@ -0,0 +1,652 @@
<template>
<div id="detail_store_goods_out">
<el-breadcrumb separator="/">
<el-breadcrumb-item>首页</el-breadcrumb-item>
<el-breadcrumb-item>库存管理 </el-breadcrumb-item>
<el-breadcrumb-item>出库明细</el-breadcrumb-item> </el-breadcrumb
><br />
<el-row>
<el-col :span="4" style="padding-right: 10px;">
<el-input
placeholder="出库编号"
v-model="searchForm.cn"
/>
</el-col>
<el-col :span="4">
<el-input
placeholder="商品名称"
v-model="searchForm.goodsName"
/>
</el-col>
<el-col :span="16">
<span>出库时间</span>
<el-date-picker
value-format="yyyy-MM-dd"
v-model="searchForm.startCreateTime"
type="date"
placeholder="起始时间"
>
</el-date-picker>
-
<el-date-picker
v-model="searchForm.endCreateTime"
value-format="yyyy-MM-dd"
type="date"
placeholder="结束时间"
>
</el-date-picker>
</el-col>
</el-row>
<br>
<el-row>
<el-col :span="4" style="padding-right: 10px;">
<el-select
v-model="searchForm.state"
@change="$forceUpdate()"
placeholder="类型"
clearable
>
<el-option label="出库" value="0"></el-option>
<el-option label="过期" value="1"></el-option>
<el-option label="下架" value="2"></el-option>
</el-select>
</el-col>
<el-col :span="4">
<el-select
v-model="searchForm.state1"
@change="$forceUpdate()"
placeholder="请选择状态"
clearable
>
<el-option label="正常" value="0"></el-option>
<el-option label="删除" value="1"></el-option>
</el-select>
</el-col>
</el-row>
<br />
<el-row>
<el-col :span="24" style="text-align: left">
<el-button
type="primary"
@click="submitSearchForm"
>
搜索</el-button
>
<el-button
type="warning"
@click="goodsOutBtn"
>
商品出库
</el-button>
</el-col>
</el-row>
<br />
<div class="table">
<el-table :data="tableData" style="width: 100%" size="medium">
<el-table-column prop="cn" width="200" label="编号">
</el-table-column>
<el-table-column
prop="goodsName"
:show-overflow-tooltip="true"
label="商品名"
>
</el-table-column>
<el-table-column
prop="storeName"
:show-overflow-tooltip="true"
label="仓库"
>
</el-table-column>
<el-table-column prop="goodsNum" label="商品数量">
</el-table-column>
<el-table-column prop="state" label="类型">
<template v-slot="scope">
<el-tag
type="danger"
v-if="scope.row.state == '2'"
>下架</el-tag
>
<el-tag
type="danger"
v-else-if="scope.row.state == '1'"
>过期</el-tag
>
<el-tag type="warning" v-else
>出库</el-tag
>
</template>
</el-table-column>
<el-table-column prop="state1" label="状态">
<template v-slot="scope">
<el-tag
type="success"
v-if="scope.row.state1 == '0'"
>正常</el-tag
>
<el-tag type="danger" v-else></el-tag>
</template>
</el-table-column>
<el-table-column prop="createby" label="出库者">
</el-table-column>
<el-table-column
prop="createTime"
:show-overflow-tooltip="true"
label="出库时间"
>
</el-table-column>
<el-table-column
prop="info"
:show-overflow-tooltip="true"
label="备注"
>
</el-table-column>
<el-table-column width="140" label="操作" fixed="right">
<template v-slot="scope">
<el-button
type="danger"
@click="del(scope.row.cn)"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<div style="margin: 10px 0 15px 0">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="searchForm.currentPage"
:page-sizes="[5, 10, 20, 50]"
:page-size="searchForm.pageSize"
layout="total,sizes, prev, pager, next,jumper"
:total="searchForm.total"
>
</el-pagination>
</div>
</div>
<!--商品出库-->
<el-dialog title="商品出库" :visible.sync="goodsOutVisable" width="50%">
<el-form
v-if="selectGoodsVisable"
:model="selectGoods"
:rules="rules"
ref="selectGoods"
label-width="100px"
class="demo-ruleForm"
>
<el-form-item label="商品:" prop="goodsId">
<el-select
@change="changeGoods"
v-model="selectGoods.goodsId"
placeholder="请选择商品"
filterable
clearable
>
<el-option
v-for="item in options_goods"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="仓库:" prop="storeId">
<el-select
v-model="selectGoods.storeId"
@change="changeStore"
placeholder="请选择仓库"
filterable
clearable
>
<el-option
v-for="item in options_store"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="类型:" prop="state">
<el-select
v-model="selectGoods.state"
@change="$forceUpdate()"
filterable
placeholder="请选择类型"
clearable
>
<el-option label="出库" value="0"></el-option>
<el-option label="过期" value="1"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type="success"
@click="selectedGoods('selectGoods')"
>
确定
</el-button
>
<el-button
type="warning"
@click="closeSelectedGoods('selectGoods')"
>
关闭</el-button
>
</el-form-item>
</el-form>
<el-form
v-if="newVisable"
:model="newForm"
:rules="rules"
ref="newForm"
label-width="100px"
class="demo-ruleForm"
>
<el-row>
<el-col :span="12">
<el-form-item label="商品名:">
<el-input
readonly
v-model="newForm.goodsName"
placeholder="如:农夫山泉"
></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="类型:"
prop="state"
>
<el-select
disabled
v-model="newForm.state"
filterable
@change="$forceUpdate()"
placeholder="请选择类型"
clearable
>
<el-option label="出库" value="0"></el-option>
<el-option label="过期" value="1"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item
label="商品数量:"
prop="goodsNum"
>
<el-input
type="number"
@change="
() => {
if (
this.goodsNum_max <
this.newForm.goodsNum
) {
this.newForm.goodsNum =
this.goodsNum_max;
}
if (this.newForm.goodsNum < 1) {
this.newForm.goodsNum = 1;
}
}
"
min="1"
:max="goodsNum_max"
v-model="newForm.goodsNum"
placeholder="如1"
></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="仓库:"
prop="storeId"
>
<el-select
disabled
v-model="newForm.storeId"
@change="changeStore"
placeholder="请选择仓库"
filterable
clearable
>
<el-option
v-for="item in options_store"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item
label="出库日期:"
prop="createTime"
>
<el-date-picker
size="mini"
style="width: 140px"
value-format="yyyy-MM-dd"
v-model="newForm.createTime"
type="date"
placeholder="出库日期"
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注:">
<el-input
type="textarea"
v-model="newForm.info"
placeholder="如:某商品因什么原因出库"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item>
<el-button type="warning" @click="submitNewForm('newForm')"
>
<i class="iconfont icon-r-left" ></i>
出库</el-button
>
<el-button @click="saveCancel('newForm')" > 取消</el-button>
</el-form-item>
</el-form>
</el-dialog>
</div>
</template>
<script>
import {
changeOutGoods,
changeOutStore,
delIn,
delOut,
initOptions,
initOutOptions,
queryOutGoods,
queryPageByQoOut,
saveIn,
saveOut,
} from "@/api/inventory_management/detail_store_goods/detail_store_goodsApi";
import { popup } from "@/assets/js/common";
import {
queryGoodsById,
selected_goodsAll,
} from "@/api/goods_management/goods/goodsApi";
import { storeList } from "@/api/inventory_management/store/storeApi";
export default {
data() {
return {
goodsOutVisable: false,
selectGoodsVisable: true,
newVisable: false,
searchForm: {
pageSize: 5
},
tableData: [],
options_store: [],
goodsNum_max: "",
newForm: {
goodsId: "",
goodsNum: "",
goodsName: "",
info: "",
createTime: "",
storeId: "",
state: "",
},
rules: {
goodsId: [
{
required: true,
message: "商品编号不能为空",
trigger: "blur",
},
],
storeId: [
{
required: true,
message: "仓库编号不能为空",
trigger: "blur",
},
],
state: [
{
required: true,
message: "类型不能为空",
trigger: "blur",
},
],
goodsNum: [
{
required: true,
message: "出库数量不能为空",
trigger: "blur",
},
],
createTime: [
{
required: true,
message: "出库日期不能为空",
trigger: "blur",
},
],
},
options_goods: [],
selectGoods: {},
};
},
methods: {
changeGoods() {
this.$forceUpdate();
changeOutGoods({ gid: this.selectGoods.goodsId }).then((res) => {
res = res.data;
if (res.code == 200) {
this.options_store = res.data;
}
});
},
changeStore() {
this.$forceUpdate();
changeOutStore({ storeId: this.selectGoods.storeId }).then(
(res) => {
res = res.data;
if (res.code == 200) {
this.options_goods = res.data;
}
}
);
},
initOptions() {
initOutOptions().then((res) => {
res = res.data;
if (res.code == 200) {
this.options_goods = res.data.goods;
this.options_store = res.data.stores;
} else {
popup(res.msg, "error");
}
});
},
init() {
if (
this.searchForm.startCreateTime > this.searchForm.endCreateTime
) {
popup("结束时间不能小于开始时间", "warning");
return;
}
queryPageByQoOut(this.searchForm).then((res) => {
res = res.data;
if (res.code == 200) {
this.tableData = res.data.records;
this.searchForm.total = res.data.total;
this.searchForm.pageSize = res.data.size;
this.searchForm.currentPage = res.data.current;
} else {
popup(res.msg, "error");
}
});
},
del(cn) {
this.$confirm("确定删除这条记录?", "警示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
delOut({ cn: cn }).then((res) => {
res = res.data;
if (res.code == 200) {
popup("操作成功");
this.searchForm.state1 = "0";
this.init();
} else {
popup(res.msg, "error");
}
});
})
.catch(() => {
this.$message({
type: "info",
message: "已取消操作",
});
});
},
/*分页*/
handleSizeChange(val) {
this.searchForm.pageSize = val;
this.init();
console.log(`每页 ${val}`);
},
handleCurrentChange(val) {
this.searchForm.currentPage = val;
this.init();
console.log(`当前页: ${val}`);
},
submitSearchForm() {
this.init();
},
goodsOutBtn() {
this.selectGoods.state = "0";
this.goodsOutVisable = true;
this.selectGoodsVisable = true;
this.newVisable = false;
this.newForm = {
goodsId: "",
goodsNum: "",
goodsName: "",
info: "",
createTime: "",
storeId: "",
state: "",
};
},
selectedGoods(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
queryOutGoods(this.selectGoods).then((res) => {
res = res.data;
if (res.code == 200) {
this.selectGoodsVisable = false;
this.newVisable = true;
this.newForm.goodsNum = res.data.goodsNum;
this.goodsNum_max = res.data.goodsNum;
this.newForm.goodsName = res.data.goodsName;
this.newForm.state = this.selectGoods.state;
this.newForm.storeId = this.selectGoods.storeId;
this.newForm.goodsId = this.selectGoods.goodsId;
this.selectGoods = {};
} else {
popup(res.msg, "error");
}
});
}
});
},
closeSelectedGoods(formName) {
this.$refs[formName].resetFields();
this.selectGoods = {};
this.goodsOutVisable = false;
},
submitNewForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
saveOut(this.newForm).then((res) => {
res = res.data;
if (res.code == 200) {
popup("出库成功");
this.searchForm.state1 = "0";
this.goodsOutVisable = false;
this.newVisable = false;
this.selectGoodsVisable = true;
this.init();
} else {
popup(res.msg, "error");
}
});
}
});
},
saveCancel(formName) {
this.$refs[formName].resetFields();
this.newVisable = false;
this.selectGoodsVisable = true;
},
},
mounted() {
this.searchForm.state1 = "0";
this.initOptions();
this.init();
},
};
</script>
<style>
.searchForm {
height: 134px;
}
.table {
height: 320px;
}
.pageUtils {
position: absolute;
width: 84%;
margin: 2px auto;
height: 43px;
}
.searchForm {
display: inline-block;
margin: 0 auto;
height: 51px;
line-height: 51px;
}
.searchForm .column {
display: inline-block;
margin: 0 auto;
margin-right: 2px;
line-height: 48px;
height: 51px;
}
</style>

@ -0,0 +1,676 @@
<template>
<div id="detail_store_goods_in">
<div class="noticeOut">
<h1>查看出库商品面板</h1>
<div class="btns">
<el-button @click="outGoodsBtn" style="width: 200px;height: 100px;background-color: #c09dff">出库货架商品
</el-button>
<el-button @click="outUntreated" style="width: 200px;height: 100px;background-color: #c09dff">过期/下架商品
</el-button>
</div>
</div>
<!--商品上货架-->
<el-dialog
:fullscreen="true"
:visible.sync="visable1">
<div class="searchForm">
<div class="column">
<span>商品名</span>
<el-input style="height: 21px;width: 300px" placeholder="请输入商品名" v-model="searchForm.name"/>
</div>
<div class="column">
<el-button type="success" @click="submitSearchForm"></el-button>
<el-button type="primary" @click="visable1=false"> </el-button>
</div>
</div>
<div class="table">
<el-table
:data="tableData"
style="width: 100%;"
size="medium">
<el-table-column
width="200"
type="index"
label="序号">
</el-table-column>
<el-table-column
prop="coverUrl"
label="封面">
<template v-slot="scope">
<img height="60px" :src="scope.row.coverUrl">
</template>
</el-table-column>
<el-table-column
prop="name"
label="商品名">
</el-table-column>
<el-table-column
prop="goodsNum"
label="出货数量">
</el-table-column>
<el-table-column
width="100px"
label="操作">
<template v-slot="scope">
<el-button type="warning"
@click="outGoodsBtn1(scope.row)" plain>出货
</el-button>
</template>
</el-table-column>
</el-table>
<div style="margin: 10px 0 15px 0;">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="searchForm.currentPage"
:page-sizes="[5, 10, 20, 50]"
:page-size="searchForm.pageSize"
layout="total,sizes, prev, pager, next,jumper"
:total="searchForm.total">
</el-pagination>
</div>
</div>
</el-dialog>
<!--商品出库-->
<el-dialog
title="商品出库"
:visible.sync="goodsOutVisable"
width="50%">
<el-form v-if="selectGoodsVisable" :model="selectGoods" :rules="rules" ref="selectGoods" label-width="100px"
class="demo-ruleForm">
<el-form-item style="width:40%" label="商品:" prop="goodsId">
<el-select disabled v-model="selectGoods.goodsId"
placeholder="请选择商品"
filterable
clearable>
<el-option
v-for="item in options_goods"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item style="width:40%" label="仓库:" prop="storeId">
<el-select v-model="selectGoods.storeId"
@change="$forceUpdate"
placeholder="请选择仓库"
filterable
clearable>
<el-option
v-for="item in options_store"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item style="width:40%" label="类型:" prop="state">
<el-select
v-model="selectGoods.state"
@change="$forceUpdate()"
filterable
placeholder="请选择类型" clearable>
<el-option label="出库" value="0"></el-option>
</el-select>
</el-form-item>
<el-form-item style="width:40%">
<el-button type="success" @click="selectedGoods('selectGoods')" plain>确定</el-button>
<el-button type="warning" @click="closeSelectedGoods('selectGoods')" plain> 关闭</el-button>
</el-form-item>
</el-form>
<el-form size="mini" v-if="newVisable" :model="newForm" :rules="rules" ref="newForm" label-width="100px"
class="demo-ruleForm">
<el-row>
<el-col :span="12">
<el-form-item style="width: 60%" label="商品名:">
<el-input readonly v-model="newForm.goodsName" placeholder="如:农夫山泉"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item style="width:60%" label="类型:" prop="state">
<el-select disabled
v-model="newForm.state"
filterable
@change="$forceUpdate()"
placeholder="请选择类型" clearable>
<el-option label="出库" value="0"></el-option>
<el-option label="过期" value="1"></el-option>
<el-option label="下架" value="2"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item style="width: 60%" label="商品数量:" prop="goodsNum">
<el-input type="number" @change="()=>{
if(this.goodsNum_max<this.newForm.goodsNum){
this.newForm.goodsNum=this.goodsNum_max
}
if(this.newForm.goodsNum<1){
this.newForm.goodsNum=1
}
}" min="1" :max="goodsNum_max" v-model="newForm.goodsNum" placeholder="1"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item style="width:60%" label="仓库:" prop="storeId">
<el-select disabled v-model="newForm.storeId"
placeholder="请选择仓库"
filterable
clearable>
<el-option
v-for="item in options_store"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item style="width: 60%" label="出库日期:" prop="createTime">
<el-date-picker
size="mini"
style="width: 140px"
value-format="yyyy-MM-dd"
v-model="newForm.createTime"
type="date"
placeholder="出库日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item style="width: 60%" label="备注:">
<el-input type="textarea" v-model="newForm.info" placeholder="如:某商品因什么原因出库"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item>
<el-button type="primary" @click="submitNewForm('newForm')"></el-button>
<el-button @click="saveCancel('newForm')" > 取消</el-button>
</el-form-item>
</el-form>
</el-dialog>
<!--商品过期/下架列表显示-->
<el-dialog
:fullscreen="true"
:visible.sync="visable2">
<div class="searchForm">
<div class="column">
<span>商品名</span>
<el-input style="height: 21px;width: 300px" placeholder="请输入商品名" v-model="searchForm1.name"/>
</div>
<div class="column">
<span>类型</span>
<el-select style="width: 120px"
v-model="searchForm1.state"
@change="$forceUpdate()"
placeholder="请选择类型" clearable>
<el-option label="过期" value="1"></el-option>
<el-option label="下架" value="2"></el-option>
</el-select>
</div>
<div class="column">
<el-button type="success" @click="submitSearchForm1"></el-button>
<el-button type="primary" @click="visable2=false"> </el-button>
</div>
</div>
<div class="table">
<el-table
:data="tableData1"
style="width: 100%;"
size="medium">
<el-table-column
width="200"
type="index"
label="序号">
</el-table-column>
<el-table-column
prop="coverUrl"
label="封面">
<template v-slot="scope">
<img height="60px" :src="scope.row.coverUrl">
</template>
</el-table-column>
<el-table-column
prop="goodsName"
label="商品名">
</el-table-column>
<el-table-column
prop="storeName"
label="仓库">
</el-table-column>
<el-table-column
prop="untreatedNum"
label="处理数量">
</el-table-column>
<el-table-column
prop="state"
label="类型">
<template v-slot="scope">
<el-tag type="warning" v-if="scope.row.state=='1'"></el-tag>
<el-tag type="danger" v-if="scope.row.state=='2'"></el-tag>
</template>
</el-table-column>
<el-table-column
prop="createTime"
label="通知时间">
</el-table-column>
<el-table-column
width="100px"
label="操作">
<template v-slot="scope">
<el-button type="warning"
@click="outUntreatedBtn(scope.row)" plain>处理
</el-button>
</template>
</el-table-column>
</el-table>
<div style="margin: 10px 0 15px 0;">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="searchForm1.currentPage"
:page-sizes="[5, 10, 20, 50]"
:page-size="searchForm1.pageSize"
layout="total,sizes, prev, pager, next,jumper"
:total="searchForm1.total">
</el-pagination>
</div>
</div>
</el-dialog>
<!--处理表单填写-->
<el-dialog
title="过期/下架商品处理表单"
:visible.sync="visable3"
width="50%">
<el-form v-if="" :model="outUntreatedForm" :rules="rules" ref="outUntreatedForm" label-width="100px"
class="demo-ruleForm">
<el-row>
<el-col :span="24">
<el-form-item style="width: 60%">
<img height="200px" :src="outUntreatedForm.coverUrl" alt="商品图片"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item style="width: 60%" label="商品名称:">
<el-input readonly v-model="outUntreatedForm.goodsName" placeholder="商品名称"/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item style="width: 60%" label="商品数量:" prop="untreatedNum">
<el-input
@change="()=>{
if (outUntreatedForm.untreatedNum<=0){
outUntreatedForm.untreatedNum=1
}
if (outUntreatedForm.untreatedNum>untreatedNum){
outUntreatedForm.untreatedNum=untreatedNum
}
}"
:placeholder="'如:'+untreatedNum"
type="number" min="1" :max="untreatedNum" v-model="outUntreatedForm.untreatedNum"/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item style="width: 60%" label="仓库:">
<el-input readonly v-model="outUntreatedForm.storeName" placeholder="仓库"/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item style="width: 40%" label="类型:">
<el-select disabled
v-model="outUntreatedForm.state"
@change="$forceUpdate()"
placeholder="请选择类型" clearable>
<el-option label="过期" value="1"></el-option>
<el-option label="下架" value="2"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item style="width: 60%">
<el-button type="success" @click="submitOutUntreatedForm('outUntreatedForm')"></el-button>
<el-button type="primary" @click="closeOutUntreatedForm('outUntreatedForm')"> </el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-dialog>
</div>
</template>
<script>
import {popup} from "@/assets/js/common";
import {
queryPageNoticeOut_shelves,
queryPageNoticeOut_untreated, resolveOutUntreatedForm,
saveOut_shelves
} from "@/api/inventory_management/notice/noticeApi";
import {
changeOutGoods,
changeOutStore,
initOutOptions, queryOutGoods, saveOut
} from "@/api/inventory_management/detail_store_goods/detail_store_goodsApi";
export default {
data() {
return {
visable1: false,
visable2: false,
visable3: false,
untreatedNum: '',
outUntreatedForm: {},
goodsOutVisable: false,
newVisable: false,
selectGoodsVisable: true,
selectGoods: {},
options_goods: [],
options_store: [],
/*表格*/
tableData: [],
searchForm: {
total: 0,
currentPage: 1,
pageSize: 5,
state: '0'
},
searchForm1: {
total: 0,
currentPage: 1,
pageSize: 5,
},
tableData1: [],
newForm: {
goodsId: '',
goodsNum: '',
goodsName: '',
info: '',
createTime: '',
storeId: '',
state: ''
},
rules: {
goodsId: [
{required: true, message: '商品编号不能为空', trigger: 'blur'},
],
storeId: [
{required: true, message: '仓库编号不能为空', trigger: 'blur'},
],
state: [
{required: true, message: '类型不能为空', trigger: 'blur'},
],
goodsNum: [
{required: true, message: '出库数量不能为空', trigger: 'blur'},
],
untreatedNum:[
{required: true, message: '处理数量不能为空', trigger: 'blur'},
],
createTime: [
{required: true, message: '出库日期不能为空', trigger: 'blur'},
]
},
}
},
methods: {
outGoodsBtn() {
this.init()
this.visable1 = true
},
closeOutUntreatedForm(formName) {
this.$refs[formName].resetFields()
this.visable3 = false
this.outUntreatedForm = {}
},
outGoodsBtn1(row) {
this.selectGoods.goodsId = row.id
var flag = false;
for (var item of this.options_goods) {
if (item.id == this.selectGoods.goodsId) {
flag = true;
}
}
if (!flag) {
popup("库存中没有该商品的库存", "error")
return;
}
changeOutGoods({gid: this.selectGoods.goodsId}).then(res => {
res = res.data
if (res.code == 200) {
this.options_store = res.data
}
})
this.goodsOutVisable = true
this.selectGoodsVisable = true
this.newVisable = false
this.selectGoods.state = '0'
this.goodsNum_max = row.goodsNum
this.newForm = {
goodsId: '',
goodsNum: row.goodsNum,
goodsName: '',
info: '',
createTime: '',
storeId: '',
state: ''
}
},
outUntreatedBtn(param) {
this.outUntreatedForm = {...param}
this.untreatedNum = param.untreatedNum
this.visable3 = true
},
submitOutUntreatedForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
resolveOutUntreatedForm(this.outUntreatedForm).then(res => {
res = res.data
if (res.code == 200) {
popup("处理成功")
this.visable3 = false
this.outUntreatedForm = {}
this.init1()
} else {
popup(res.msg, "error")
}
}
)
}
})
},
outUntreated() {
this.init1()
this.visable2 = true
},
changeGoods() {
this.$forceUpdate()
changeOutGoods({gid: this.selectGoods.goodsId}).then(res => {
res = res.data
if (res.code == 200) {
this.options_store = res.data
}
})
},
initOptions() {
initOutOptions().then(res => {
res = res.data
if (res.code == 200) {
this.options_goods = res.data.goods
this.options_store = res.data.stores
} else {
popup(res.msg, "error")
}
})
},
init() {
queryPageNoticeOut_shelves(this.searchForm).then(res => {
res = res.data
if (res.code == 200) {
this.tableData = res.data.records
this.searchForm.total = res.data.total
this.searchForm.pageSize = res.data.size
this.searchForm.currentPage = res.data.current
} else {
popup(res.msg, "error")
}
})
},
/*分页*/
handleSizeChange(val) {
this.searchForm.pageSize = val
this.init()
console.log(`每页 ${val}`);
},
handleCurrentChange(val) {
this.searchForm.currentPage = val
this.init()
console.log(`当前页: ${val}`);
},
submitSearchForm() {
this.init()
},
/*过期、下架分页*/
init1() {
queryPageNoticeOut_untreated(this.searchForm1).then(res => {
res = res.data
if (res.code == 200) {
this.tableData1 = res.data.records
this.searchForm1.total = res.data.total
this.searchForm1.pageSize = res.data.size
this.searchForm1.currentPage = res.data.current
} else {
popup(res.msg, "error")
}
})
},
handleSizeChange1(val) {
this.searchForm1.pageSize = val
this.init1()
console.log(`每页 ${val}`);
},
handleCurrentChange1(val) {
this.searchForm1.currentPage = val
this.init1()
console.log(`当前页: ${val}`);
},
submitSearchForm1() {
this.init1()
},
selectedGoods(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
queryOutGoods(this.selectGoods).then(res => {
res = res.data
if (res.code == 200) {
this.selectGoodsVisable = false
this.newVisable = true
this.newForm.goodsName = res.data.goodsName
this.newForm.state = this.selectGoods.state
this.newForm.storeId = this.selectGoods.storeId
this.newForm.goodsId = this.selectGoods.goodsId
// this.selectGoods = {}
} else {
popup(res.msg, "error")
}
})
}
})
},
closeSelectedGoods(formName) {
this.$refs[formName].resetFields()
this.selectGoods = {}
this.goodsOutVisable = false
},
submitNewForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
saveOut_shelves(this.newForm).then(res => {
res = res.data
if (res.code == 200) {
popup("出库成功")
this.searchForm.state1 = '0'
this.goodsOutVisable = false
this.selectGoods = {}
this.init()
} else {
popup(res.msg, "error")
}
})
}
})
},
saveCancel(formName) {
this.$refs[formName].resetFields()
this.newVisable = false
this.selectGoodsVisable = true
}
},
mounted() {
this.initOptions()
}
}
</script>
<style>
#detail_store_goods_in .noticeOut {
height: 660px;
background-color: #bfdcf6;
}
#detail_store_goods_in .noticeOut h1, .btns {
width: 100%;
}
.searchForm {
height: 134px;
}
.table {
height: 320px;
}
.pageUtils {
position: absolute;
width: 84%;
margin: 2px auto;
height: 43px;
}
.searchForm {
display: inline-block;
margin: 0 auto;
height: 51px;
line-height: 51px;
}
.searchForm .column {
display: inline-block;
margin: 0 auto;
margin-right: 2px;
line-height: 48px;
height: 51px;
}
</style>

@ -0,0 +1,265 @@
<template>
<div>
<el-breadcrumb separator="/">
<el-breadcrumb-item>首页</el-breadcrumb-item>
<el-breadcrumb-item>库存管理 </el-breadcrumb-item>
<el-breadcrumb-item>仓库管理</el-breadcrumb-item> </el-breadcrumb
><br />
<el-row>
<el-col :span="8" style="text-align: left;padding-right: 10px;">
<el-input placeholder="仓库名称" v-model="searchForm.name"/>
</el-col>
<el-col :span="8">
<el-select v-model="searchForm.state" placeholder="请选择状态" clearable>
<el-option label="正常" value="0"></el-option>
<el-option label="停用" value="-1"></el-option>
</el-select>
</el-col>
</el-row>
<br />
<el-row>
<el-col :span="24" style="text-align: left">
<el-button
type="primary"
@click="subSearchForm"
>
搜索</el-button
>
<el-button
type="success"
@click="newVisable = true"
>
创建仓库
</el-button>
</el-col>
</el-row>
<br />
<el-table
:data="tableData"
style="width: 100%">
<el-table-column
type="index"
label="序号"
width="180">
</el-table-column>
<el-table-column
prop="name"
label="名称"
width="180">
</el-table-column>
<el-table-column
prop="address"
label="地址"
width="180">
</el-table-column>
<el-table-column
prop="info"
:show-overflow-tooltip="true"
label="描述">
</el-table-column>
<el-table-column
prop="state"
label="状态">
<template v-slot="scope">
<el-tag v-if="scope.row.state=='0'" type="success"></el-tag>
<el-tag v-else type="danger">停用</el-tag>
</template>
</el-table-column>
<el-table-column width="260" fixed="right"
label="操作">
<template v-slot="scope">
<el-button type="success" @click="editStore(scope.row)">
修改
</el-button>
<el-button type="danger" @click="forbidden(scope.row.id)">
停用
</el-button>
</template>
</el-table-column>
</el-table>
<!--修改仓库弹出框-->
<el-dialog
title="仓库信息修改"
:visible.sync="dialogVisible"
width="50%">
<el-form v-model="editForm" label-width="100px" class="demo-ruleForm">
<el-form-item label="名称:">
<el-input v-model="editForm.name"></el-input>
</el-form-item>
<el-form-item label="地址:">
<el-input type="text" v-model="editForm.address"></el-input>
</el-form-item>
<el-form-item label="描述:">
<el-input type="text" v-model="editForm.info"></el-input>
</el-form-item>
<el-form-item label="状态:">
<el-select v-model="editForm.state"
clearable
@change="$forceUpdate()"
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>
<el-button type="primary" @click="submitEditForm" >
提交
</el-button>
<el-button @click="editCancel" > 取消</el-button>
</el-form-item>
</el-form>
</el-dialog>
<!--创建仓库弹出框-->
<el-dialog
title="创建仓库"
:visible.sync="newVisable"
width="50%">
<el-form :model="newForm" :rules="rules" ref="newForm" label-width="100px" class="demo-ruleForm">
<el-form-item label="名称:" prop="name">
<el-input v-model="newForm.name"></el-input>
</el-form-item>
<el-form-item label="地址:" prop="address">
<el-input type="text" v-model="newForm.address"></el-input>
</el-form-item>
<el-form-item label="描述:">
<el-input type="text" v-model="newForm.info"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submitNewForm('newForm')" >
提交</el-button>
<el-button @click="saveCancel" > 取消</el-button>
</el-form-item>
</el-form>
</el-dialog>
</div>
</template>
<script>
import {deactivate, save, storeList, update} from "@/api/inventory_management/store/storeApi";
import {popup} from "@/assets/js/common";
export default {
data() {
return {
tableData: [],
newStoreVisable: false,
dialogVisible: false,
editForm: {},
searchForm:{},
newVisable: false,
newForm:{},
options: [
{label: '正常', value: '0'},
{label: '停用', value: '-1'}
],
rules: {
name:[
{required: true, message: '名称不能为空', trigger: 'blur'},
],
address:[
{required: true, message: '地名不能为空', trigger: 'blur'},
],
}
}
},
methods: {
subSearchForm(){
this.init()
},
init() {
storeList(this.searchForm).then(res => {
if (res.data.code == 200) {
this.tableData = res.data.data
} else {
popup(res.data.msg, "error")
}
})
},
editStore(row) {
this.editForm = {...row}
this.dialogVisible = true
},
forbidden(sid) {
deactivate(sid).then(res => {
res = res.data
if (res.code == 200) {
popup("操作成功")
} else {
popup(res.msg, "error")
}
this.init()
})
},
submitEditForm() {
update(this.editForm).then(res => {
res = res.data
if (res.code == 200) {
popup("操作成功")
this.init()
this.dialogVisible=false
} else {
popup(res.msg, "error")
}
})
},
editCancel() {
this.dialogVisible = false
this.editForm = {}
popup("已取消操作", "info")
},
submitNewForm(formName){
this.$refs[formName].validate((valid) => {
if (valid) {
save(this.newForm).then(res=>{
res=res.data
if (res.code==200){
popup("操作成功")
this.newForm={}
this.newVisable=false
this.init()
}else {
popup(res.msg, "error")
}
})
}
});
},
saveCancel(){
this.newVisable=false
this.$refs["newForm"].resetFields()
}
},
mounted() {
this.init()
}
}
</script>
<style>
.search {
display: inline-block;
margin: 0 auto;
height: 51px;
line-height: 51px;
}
.search .column {
display: inline-block;
margin: 0 auto;
margin-right: 2px;
line-height: 48px;
height: 51px;
}
</style>

@ -0,0 +1,316 @@
<template>
<div>
<el-breadcrumb separator="/">
<el-breadcrumb-item>首页</el-breadcrumb-item>
<el-breadcrumb-item>库存管理 </el-breadcrumb-item>
<el-breadcrumb-item>库存统计</el-breadcrumb-item> </el-breadcrumb
><br />
<el-row>
<el-col :span="8">
<el-input placeholder="仓库名称" v-model="searchForm.name" />
</el-col>
<el-col :span="16">
<i class="iconfont icon-r-add" style="font-size: 28px">
<b>
总存储量<span style="color: #fc4316"
>{{ totalStoreNum ? totalStoreNum : 0 }}</span
>
</b>
</i>
</el-col>
</el-row>
<br />
<el-row>
<el-col :span="24" style="text-align: left">
<el-button
type="primary"
@click="submitSearchForm"
>
搜索</el-button
>
</el-col>
</el-row>
<br />
<div class="table">
<el-table :data="tableData" style="width: 100%" size="medium">
<el-table-column type="index" width="200" label="序号">
</el-table-column>
<el-table-column
prop="storeName"
:show-overflow-tooltip="true"
label="仓库名"
>
</el-table-column>
<el-table-column
prop="residueNum"
:show-overflow-tooltip="true"
label="存货数量"
>
</el-table-column>
<el-table-column label="操作">
<template v-slot="scope">
<el-button
type="primary"
@click="detailStoreBtn(scope.row)"
>
存储明细</el-button
>
</template>
</el-table-column>
</el-table>
<div style="margin: 10px 0 15px 0">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="searchForm.currentPage"
:page-sizes="[5, 10, 20, 50]"
:page-size="searchForm.pageSize"
layout="total,sizes, prev, pager, next,jumper"
:total="searchForm.total"
>
</el-pagination>
</div>
</div>
<el-dialog
title="仓库存储明细"
:visible.sync="detailStoreVisible"
width="95%"
height="100%"
>
<el-row>
<el-col :span="8" style="text-align: right;">
<el-select
v-model="searchDetailForm.id"
placeholder="请选择商品"
filterable
@change="$forceUpdate()"
clearable
>
<el-option
v-for="item in options_storeGoods"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-col>
<el-col :span="8">
<el-button type="success" @click="submitDetailSearchForm"
>
搜索</el-button
>
<el-button @click="closeDetailStoreVisible"
>
关闭</el-button
>
</el-col>
<el-col :span="8">
<i class="iconfont icon-r-add" style="font-size: 28px">
<b>
总存储量<span style="color: #fc4316"
>{{ totalStoreNum1 ? totalStoreNum1 : 0 }}</span
>
</b>
</i>
</el-col>
</el-row>
<br>
<div class="table" style="overflow: auto;height: 300px;">
<el-table :data="tableData1" style="width: 100%" size="medium" >
<el-table-column type="index" width="200" label="序号">
</el-table-column>
<el-table-column
prop="goodsName"
:show-overflow-tooltip="true"
label="商品名"
>
</el-table-column>
<el-table-column
prop="residueNum"
:show-overflow-tooltip="true"
label="商品数量"
>
</el-table-column>
<el-table-column
prop="percentage"
:show-overflow-tooltip="true"
label="占总存储量"
>
<template v-slot="scope">
<el-progress
type="circle"
width="70"
:percentage="scope.row.percentage"
:color="customColorMethod"
></el-progress>
</template>
</el-table-column>
</el-table>
<div style="margin: 10px 0 15px 0">
<el-pagination
@size-change="handleSizeChange1"
@current-change="handleCurrentChange1"
:current-page.sync="searchDetailForm.currentPage"
:page-sizes="[5, 10, 20, 50]"
:page-size="searchDetailForm.pageSize"
layout="total,sizes, prev, pager, next,jumper"
:total="searchDetailForm.total"
>
</el-pagination>
</div>
</div>
</el-dialog>
</div>
</template>
<script>
import { popup } from "@/assets/js/common";
import {
queryPageByQo,
queryStoreGoodsByStoreId,
} from "@/api/inventory_management/storage_situation/storageSituationApi";
export default {
data() {
return {
/*表格*/
tableData: [],
tableData1: [],
totalStoreNum: "",
totalStoreNum1: "",
searchForm: {
total: 0,
currentPage: 1,
pageSize: 5,
},
searchDetailForm: {
total: 0,
currentPage: 1,
pageSize: 10,
},
options_storeGoods: [],
detailStoreVisible: false,
};
},
methods: {
init() {
queryPageByQo(this.searchForm).then((res) => {
res = res.data;
if (res.code == 200) {
this.totalStoreNum = res.data.totalStoreNum;
this.tableData = res.data.page.records;
this.searchForm.total = res.data.page.total;
this.searchForm.pageSize = res.data.page.size;
this.searchForm.currentPage = res.data.page.current;
} else {
popup(res.msg, "error");
}
});
},
/*分页*/
handleSizeChange(val) {
this.searchForm.pageSize = val;
this.init();
console.log(`每页 ${val}`);
},
handleCurrentChange(val) {
this.searchForm.currentPage = val;
this.init();
console.log(`当前页: ${val}`);
},
submitSearchForm() {
this.init();
},
init1() {
queryStoreGoodsByStoreId(this.searchDetailForm).then((res) => {
res = res.data;
if (res.code == 200) {
this.options_storeGoods = res.data.optionsStoreGoods;
this.totalStoreNum1 = res.data.totalStoreNum1;
this.tableData1 = res.data.vos.records;
this.searchDetailForm.total = res.data.vos.total;
this.searchDetailForm.pageSize = res.data.vos.size;
this.searchDetailForm.currentPage = res.data.vos.current;
this.detailStoreVisible = true;
} else {
popup(res.msg, "error");
}
});
},
detailStoreBtn(row) {
this.options_storeGoods = [];
this.totalStoreNum1 = "";
this.searchDetailForm.storeId = row.storeId;
this.init1();
},
handleSizeChange1(val) {
this.searchDetailForm.pageSize = val;
this.init1();
console.log(`每页 ${val}`);
},
handleCurrentChange1(val) {
this.searchDetailForm.currentPage = val;
this.init1();
console.log(`当前页: ${val}`);
},
submitDetailSearchForm() {
this.init1();
},
customColorMethod(percentage) {
if (percentage < 30) {
return "#f56c6c";
} else if (percentage < 70) {
return "#e6a23c";
} else {
return "#67c23a";
}
},
closeDetailStoreVisible() {
this.searchDetailForm = {
total: 0,
currentPage: 1,
pageSize: 10,
};
this.detailStoreVisible = false;
},
},
mounted() {
this.init();
},
};
</script>
<style>
.searchForm {
height: 134px;
}
.table {
height: 320px;
}
.pageUtils {
position: absolute;
width: 84%;
margin: 2px auto;
height: 43px;
}
.searchForm {
display: inline-block;
margin: 0 auto;
height: 51px;
line-height: 51px;
}
.searchForm .column {
display: inline-block;
margin: 0 auto;
margin-right: 2px;
line-height: 48px;
height: 51px;
}
</style>

@ -0,0 +1,405 @@
<template>
<div>
<el-breadcrumb separator="/">
<el-breadcrumb-item>首页</el-breadcrumb-item>
<el-breadcrumb-item>库存管理 </el-breadcrumb-item>
<el-breadcrumb-item>供货商信息</el-breadcrumb-item> </el-breadcrumb
><br />
<el-row>
<el-col :span="8" style="text-align: left; padding-right: 10px">
<el-input placeholder="供货商名称" v-model="searchForm.name" />
</el-col>
<el-col :span="8" style="text-align: left; padding-right: 10px">
<el-input placeholder="地址" v-model="searchForm.address" />
</el-col>
<el-col :span="8">
<el-input placeholder="描述" v-model="searchForm.info" />
</el-col>
</el-row>
<br />
<el-row>
<el-col :span="24" style="text-align: left">
<el-button
type="primary"
@click="subSearchForm"
>
搜索</el-button
>
<el-button
type="success"
@click="newVisable = true"
>
创建供货商
</el-button>
</el-col>
</el-row>
<br />
<div class="table">
<el-table :data="tableData" style="width: 100%" size="medium">
<el-table-column type="index" width="200" label="序号">
</el-table-column>
<el-table-column
prop="name"
:show-overflow-tooltip="true"
label="名称"
>
</el-table-column>
<el-table-column
prop="address"
:show-overflow-tooltip="true"
label="地址"
>
</el-table-column>
<el-table-column
prop="tel"
:show-overflow-tooltip="true"
label="联系电话"
>
</el-table-column>
<el-table-column
prop="info"
:show-overflow-tooltip="true"
label="备注"
>
</el-table-column>
<el-table-column width="260" fixed="right" label="操作">
<template v-slot="scope">
<el-button
type="warning"
@click="editBtn(scope.row.cn)"
>
修改</el-button
>
<el-button
type="danger"
@click="delBtn(scope.row.cn)"
>
删除</el-button
>
</template>
</el-table-column>
</el-table>
<div style="margin: 10px 0 15px 0">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="searchForm.currentPage"
:page-sizes="[5, 10, 20, 50]"
:page-size="searchForm.pageSize"
layout="total,sizes, prev, pager, next,jumper"
:total="searchForm.total"
>
</el-pagination>
</div>
</div>
<!--创建弹出框-->
<el-dialog
title="创建供货商信息"
:visible.sync="newVisable"
width="50%"
>
<el-form
:model="newForm"
:rules="rules"
ref="newForm"
label-width="100px"
class="demo-ruleForm"
>
<el-form-item label="名称:" prop="name">
<el-input
v-model="newForm.name"
placeholder="供应商名称"
></el-input>
</el-form-item>
<el-form-item label="地址:" prop="address">
<el-input
type="text"
v-model="newForm.address"
placeholder="供应商地址"
></el-input>
</el-form-item>
<el-form-item label="电话:" prop="tel">
<el-input
type="text"
v-model="newForm.tel"
placeholder="联系电话"
></el-input>
</el-form-item>
<el-form-item label="描述:">
<el-input
type="textarea"
v-model="newForm.info"
placeholder="供应商的简单描述"
></el-input>
</el-form-item>
<el-form-item>
<el-button
type="primary"
@click="submitNewForm('newForm')"
>
提交</el-button
>
<el-button
@click="
() => {
this.$refs['newForm'].resetFields();
newForm = {};
newVisable = false;
}
"
> 关闭</el-button
>
</el-form-item>
</el-form>
</el-dialog>
<!--修改弹出框-->
<el-dialog
title="修改供货商信息"
:visible.sync="editVisable"
width="50%"
>
<el-form
:model="editForm"
:rules="rules"
ref="editForm"
label-width="100px"
class="demo-ruleForm"
>
<el-form-item label="名称:" prop="name">
<el-input
v-model="editForm.name"
placeholder="供应商名称"
></el-input>
</el-form-item>
<el-form-item label="地址:" prop="address">
<el-input
type="text"
v-model="editForm.address"
placeholder="供应商地址"
></el-input>
</el-form-item>
<el-form-item label="电话:" prop="tel">
<el-input
type="text"
v-model="editForm.tel"
placeholder="联系电话"
></el-input>
</el-form-item>
<el-form-item label="描述:">
<el-input
type="textarea"
v-model="editForm.info"
placeholder="供应商的简单描述"
></el-input>
</el-form-item>
<el-form-item>
<el-button
type="primary"
@click="submitEditForm('editForm')"
>
提交</el-button
>
<el-button
@click="
() => {
this.$refs['editForm'].resetFields();
editForm = {};
editVisable = false;
}
"
> 关闭</el-button
>
</el-form-item>
</el-form>
</el-dialog>
</div>
</template>
<script>
import { popup } from "@/assets/js/common";
import {
delSupplier,
queryByCn,
queryPageSupplier,
saveSupplier,
updateSupplier,
} from "@/api/inventory_management/supplier/supplierApi";
export default {
data() {
return {
tableData: [],
editVisable: false,
editForm: {},
searchForm: {
pageSize: 5,
},
newVisable: false,
newForm: {},
rules: {
name: [
{
required: true,
message: "供货商名称不能为空",
trigger: "blur",
},
],
address: [
{
required: true,
message: "供货商地址不能为空",
trigger: "blur",
},
],
tel: [
{
required: true,
message: "供货商联系电话不能为空",
trigger: "blur",
},
],
},
};
},
methods: {
subSearchForm() {
this.init();
},
init() {
queryPageSupplier(this.searchForm).then((res) => {
res = res.data;
if (res.code == 200) {
this.tableData = res.data.records;
this.searchForm.total = res.data.total;
this.searchForm.pageSize = res.data.size;
this.searchForm.currentPage = res.data.current;
} else {
popup(res.msg, "error");
}
});
},
/*分页*/
handleSizeChange(val) {
this.searchForm.pageSize = val;
this.init();
console.log(`每页 ${val}`);
},
handleCurrentChange(val) {
this.searchForm.currentPage = val;
this.init();
console.log(`当前页: ${val}`);
},
submitSearchForm() {
this.init();
},
submitNewForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
saveSupplier(this.newForm).then((res) => {
res = res.data;
if (res.code == 200) {
popup("添加成功");
this.newVisable = false;
this.newForm = {};
this.init();
} else {
popup(res.msg, "error");
}
});
}
});
},
delBtn(cn) {
this.$confirm("确定要删除这条记录" + "", "警示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
delSupplier({ cn: cn }).then((res) => {
res = res.data;
if (res.code == 200) {
popup("删除成功");
this.init();
} else {
popup(res.msg, "warning");
}
});
})
.catch(() => {
this.$message({
type: "info",
message: "已取消操作",
});
});
},
editBtn(cn) {
queryByCn({ cn: cn }).then((res) => {
res = res.data;
if (res.code == 200) {
this.editForm = { ...res.data };
this.editVisable = true;
} else {
popup(res.msg, "error");
}
});
},
submitEditForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
updateSupplier(this.editForm).then((res) => {
res = res.data;
if (res.code == 200) {
popup("修改成功");
this.editVisable = false;
this.editForm = {};
this.init();
} else {
popup(res.msg, "error");
}
});
}
});
},
},
mounted() {
this.init();
},
};
</script>
<style>
.table {
height: 320px;
}
.pageUtils {
position: absolute;
width: 84%;
margin: 2px auto;
height: 43px;
}
.search {
display: inline-block;
margin: 0 auto;
height: 51px;
line-height: 51px;
}
.search .column {
display: inline-block;
margin: 0 auto;
margin-right: 2px;
line-height: 48px;
height: 51px;
}
</style>

@ -0,0 +1,632 @@
<template>
<div id="employee_index">
<el-breadcrumb separator="/">
<el-breadcrumb-item>首页</el-breadcrumb-item>
<el-breadcrumb-item>会员管理</el-breadcrumb-item>
<el-breadcrumb-item>会员信息</el-breadcrumb-item> </el-breadcrumb
><br />
<el-row>
<el-col :span="8" style="text-align: left; padding-right: 10px">
<el-input placeholder="姓名" v-model="searchForm.name" />
</el-col>
<el-col :span="8" style="text-align: left; padding-right: 10px">
<el-input placeholder="手机号码" v-model="searchForm.phone" />
</el-col>
<el-col :span="8">
<el-select
v-model="searchForm.state"
@change="$forceUpdate()"
placeholder="状态"
clearable
>
<el-option label="正常" value="0"></el-option>
<el-option label="删除" value="1"></el-option>
</el-select>
</el-col>
</el-row>
<br />
<el-row>
<el-col :span="24" style="text-align: left">
<el-button
type="primary"
@click="submitSearchForm"
>
搜索</el-button
>
<el-button
type="success"
@click="newVisable = true"
>
录入会员
</el-button>
</el-col>
</el-row>
<br />
<!--表格数据-->
<div class="table">
<el-table :data="tableData" style="width: 100%" size="medium">
<el-table-column prop="phone" label="手机号"> </el-table-column>
<el-table-column prop="name" label="姓名"> </el-table-column>
<el-table-column
prop="email"
:show-overflow-tooltip="true"
label="邮箱"
>
</el-table-column>
<el-table-column prop="integral" label="积分">
</el-table-column>
<el-table-column prop="state" label="状态">
<template v-slot="scope">
<el-tag v-if="scope.row.state == '0'" type="success"
>正常</el-tag
>
<el-tag v-else type="danger">删除</el-tag>
</template>
</el-table-column>
<el-table-column
prop="info"
:show-overflow-tooltip="true"
label="备注"
>
</el-table-column>
<el-table-column label="操作" width="420" fixed="right">
<template v-slot="scope">
<el-button
v-if="scope.row.state == '0'"
type="warning"
@click="exchangeProductsBtn(scope.row.id)"
>
兑换积分
</el-button>
<el-button
type="success"
@click="editBtn(scope.row.id)"
>
修改</el-button
>
<el-button
type="danger"
@click="delBtn(scope.row.id)"
>
删除</el-button
>
</template>
</el-table-column>
</el-table>
<div style="margin: 10px 0 15px 0">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="searchForm.currentPage"
:page-sizes="[5, 10, 20, 50]"
:page-size="searchForm.pageSize"
layout="total,sizes, prev, pager, next,jumper"
:total="searchForm.total"
>
</el-pagination>
</div>
</div>
<!--录入-->
<el-dialog
title="录入会员"
:visible.sync="newVisable"
label-width="200"
width="50%"
>
<el-form
:model="newForm"
:rules="rules"
ref="newForm"
label-width="100px"
class="demo-ruleForm"
>
<el-form-item label="号码:" prop="phone">
<el-input
max="11"
placeholder="请输入手机号"
v-model="newForm.phone"
></el-input>
</el-form-item>
<el-form-item label="姓名:" prop="name">
<el-input
v-model="newForm.name"
placeholder="请输入姓名"
></el-input>
</el-form-item>
<el-form-item label="邮箱:">
<el-input
v-model="newForm.email"
placeholder="如xxx@qq.com"
></el-input>
</el-form-item>
<el-form-item label="备注:">
<el-input
type="textarea"
v-model="newForm.info"
placeholder="如:新会员"
></el-input>
</el-form-item>
<el-form-item>
<el-button
type="primary"
@click="submitNewForm('newForm')"
>
提交</el-button
>
<el-button
@click="saveCancel('newForm')"
>
取消</el-button
>
</el-form-item>
</el-form>
</el-dialog>
<!--修改-->
<el-dialog
title="修改会员"
:visible.sync="editVisable"
size="mini"
label-width="200"
width="50%"
>
<el-form
:model="editForm"
:rules="rules"
ref="editForm"
label-width="100px"
class="demo-ruleForm"
>
<el-form-item label="号码:" prop="phone">
<el-input
max="11"
placeholder="请输入手机号"
v-model="editForm.phone"
></el-input>
</el-form-item>
<el-form-item label="姓名:" prop="name">
<el-input
v-model="editForm.name"
placeholder="请输入姓名"
></el-input>
</el-form-item>
<el-form-item label="邮箱:">
<el-input
v-model="editForm.email"
placeholder="如xxx@qq.com"
></el-input>
</el-form-item>
<el-form-item label="积分:">
<el-input
v-model="editForm.integral"
placeholder="如10"
></el-input>
</el-form-item>
<el-form-item label="备注:">
<el-input
type="textarea"
v-model="editForm.info"
placeholder="如:新会员"
></el-input>
</el-form-item>
<el-form-item label="状态:" prop="state">
<el-select
v-model="editForm.state"
placeholder="请选择状态"
filterable
@change="$forceUpdate()"
clearable
>
<el-option label="正常" value="0"></el-option>
<el-option label="删除" value="1"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type="primary"
@click="submitEditForm('editForm')"
>
提交</el-button
>
<el-button
type="info"
@click="resetEditForm('editForm')"
>
关闭</el-button
>
</el-form-item>
</el-form>
</el-dialog>
<!--积分商品-->
<el-dialog
title="兑换积分商品"
:visible.sync="pointProductsVisable"
label-width="200"
width="40%"
>
<el-form
:model="pointProductsForm"
:rules="rules"
ref="pointProductsForm"
class="demo-ruleForm"
>
<el-form-item v-if="pointProductsForm.goodsId">
<img
width="100px"
:src="BaseApi + pointProductsForm.coverUrl"
alt="商品图片"
/>
</el-form-item>
<el-form-item label="积分商品:" prop="goodsId">
<el-select
@change="
queryPointProductByGoodsId(
pointProductsForm.goodsId
)
"
v-model="pointProductsForm.goodsId"
placeholder="请选择积分商品"
filterable
clearable
>
<el-option
v-for="item in options_pointProducts"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item
v-if="pointProductsForm.goodsId"
label="所需积分:"
>
<el-input
disabled
type="number"
v-model="pointProductsForm.integral"
placeholder="所需积分"
/>
</el-form-item>
<el-form-item>
<el-button
v-if="pointProductsForm.goodsId"
type="warning"
@click="submitPointProductsForm('pointProductsForm')"
>
兑换
</el-button>
<el-button
type="info"
@click="closePointProductsForm"
>
关闭</el-button
>
</el-form-item>
</el-form>
</el-dialog>
</div>
</template>
<script>
import { popup } from "@/assets/js/common";
import {
delMember,
queryPageByQo,
save,
update,
queryMemberById,
} from "@/api/member_management/member/memberApi";
import {
queryPointProductByGoodsId,
queryPointProductBymemberId,
saveExchangePointProductRecords,
} from "@/api/sale_management/exchange_point_products/exchangePointProductsApi";
export default {
data() {
return {
BaseApi: this.$store.state.BaseApi,
newVisable: false,
editVisable: false,
searchForm: {
pageSize: 5,
},
tableData: [],
newForm: {},
editForm: {},
rules: {
name: [
{
required: true,
message: "名称不能为空",
trigger: "blur",
},
],
phone: [
{
required: true,
message: "手机号不能为空",
trigger: "blur",
},
],
state: [
{
required: true,
message: "状态不能为空",
trigger: "blur",
},
],
goodsId: [
{
required: true,
message: "商品不能为空",
trigger: "blur",
},
],
},
options_pointProducts: [],
pointProductsForm: {
goodsId: "",
coverUrl: "",
integral: "",
},
pointProductsVisable: false,
};
},
methods: {
init() {
queryPageByQo(this.searchForm).then((res) => {
res = res.data;
if (res.code == 200) {
console.log(res.data);
this.tableData = res.data.records;
this.searchForm.total = res.data.total;
this.searchForm.pageSize = res.data.size;
this.searchForm.currentPage = res.data.current;
} else {
popup(res.msg, "error");
}
});
},
/*分页*/
handleSizeChange(val) {
this.searchForm.pageSize = val;
this.init();
console.log(`每页 ${val}`);
},
handleCurrentChange(val) {
this.searchForm.currentPage = val;
this.init();
console.log(`当前页: ${val}`);
},
submitSearchForm() {
this.init();
},
saveCancel(formName) {
this.newForm = {};
this.$refs[formName].resetFields();
this.newVisable = false;
},
submitNewForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
save(this.newForm).then((res) => {
res = res.data;
if (res.code == 200) {
popup("操作成功");
this.newForm = {};
this.newVisable = false;
this.init();
} else {
popup(res.msg, "error");
}
});
}
});
},
editBtn(id) {
queryMemberById({ id: id }).then((res) => {
res = res.data;
if (res.code == 200) {
this.editForm = { ...res.data };
this.editVisable = true;
} else {
popup(res.msg, "error");
}
});
},
submitEditForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
update(this.editForm).then((res) => {
res = res.data;
if (res.code == 200) {
popup("操作成功");
this.editForm = {};
this.editVisable = false;
this.init();
} else {
popup(res.msg, "error");
}
});
}
});
},
resetEditForm(formName) {
this.editForm = {};
this.$refs[formName].resetFields();
this.editVisable = false;
},
delBtn(id) {
this.$confirm("确定删除该会员?", "警示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
delMember({ id: id }).then((res) => {
res = res.data;
if (res.code == 200) {
popup("操作成功");
this.searchForm.state = "0";
this.init();
} else {
popup(res.msg, "error");
}
});
})
.catch(() => {
this.$message({
type: "info",
message: "已取消操作",
});
});
},
/*兑换积分商品*/
exchangeProductsBtn(id) {
(this.pointProductsForm = {
memberId: this.pointProductsForm.memberId,
goodsId: "",
coverUrl: "",
integral: "",
}),
queryPointProductBymemberId({ memberId: id }).then((res) => {
res = res.data;
if (res.code == 200) {
this.options_pointProducts = res.data;
if (!this.options_pointProducts.length) {
popup("该会员积分数无法兑换任何商品", "warning");
return;
}
this.pointProductsForm.memberId = id;
this.pointProductsVisable = true;
} else {
popup(res.msg, "error");
}
});
},
submitPointProductsForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
saveExchangePointProductRecords(
this.pointProductsForm
).then((res) => {
res = res.data;
if (res.code == 200) {
popup("兑换成功");
this.pointProductsForm = {};
this.pointProductsVisable = false;
this.init();
} else {
popup(res.msg, "error");
}
});
}
});
},
closePointProductsForm() {
this.options_pointProducts = [];
this.pointProductsForm = {};
this.pointProductsVisable = false;
},
queryPointProductByGoodsId(goodsId) {
queryPointProductByGoodsId({ goodsId: goodsId }).then((res) => {
res = res.data;
if (res.code == 200) {
if (!res.data) {
this.pointProductsForm = {
memberId: this.pointProductsForm.memberId,
goodsId: "",
coverUrl: "",
integral: "",
};
return;
}
this.pointProductsForm.integral = res.data.integral;
this.pointProductsForm.coverUrl = res.data.coverUrl;
} else {
popup(res.msg, "error");
this.pointProductsForm.goodsId = "";
}
});
},
},
mounted() {
/*初始化表格数据*/
this.searchForm.state = "0";
this.init();
},
};
</script>
<style>
.searchForm {
height: 134px;
}
.table {
height: 320px;
}
.pageUtils {
position: absolute;
width: 84%;
margin: 2px auto;
height: 43px;
}
.searchForm {
display: inline-block;
margin: 0 auto;
height: 51px;
line-height: 51px;
}
.searchForm .column {
display: inline-block;
margin: 0 auto;
margin-right: 2px;
line-height: 48px;
height: 51px;
}
.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: 178px;
height: 178px;
line-height: 178px;
text-align: center;
}
.avatar {
width: 178px;
height: 178px;
display: block;
}
</style>

@ -0,0 +1,154 @@
<!--
* @Description:
* @Author:
* @Date: 09-07 20:58:35
-->
<template>
<div>
<el-breadcrumb separator="/">
<el-breadcrumb-item>首页</el-breadcrumb-item>
<el-breadcrumb-item>个人中心 </el-breadcrumb-item>
<el-breadcrumb-item>密码修改</el-breadcrumb-item> </el-breadcrumb
><br />
<div id="edit_pwd">
<el-form
:model="pwdForm"
:rules="rules"
ref="pwdForm"
label-width="100px"
class="demo-ruleForm"
>
<i class="iconfont icon-r-lock" style="font-size: 32px">
<b style="font-size: 28px">密码修改</b></i
>
<br />
<br />
<el-form-item label="账号">
<el-input disabled v-model="pwdForm.username"></el-input>
</el-form-item>
<el-form-item label="旧密码" prop="oldPwd">
<el-input
type="password"
v-model="pwdForm.oldPwd"
></el-input>
</el-form-item>
<el-form-item label="新密码" prop="newPwd">
<el-input
type="password"
v-model="pwdForm.newPwd"
></el-input>
</el-form-item>
<el-form-item>
<el-button
type="primary"
@click="submitForm('pwdForm')"
>
确定</el-button
>
<el-button
@click="resetForm('pwdForm')"
>
重置</el-button
>
</el-form-item>
</el-form>
</div>
</div>
</template>
<script>
import { loginEmp, removeToken } from "@/assets/js/auth";
import Cookies from "js-cookie";
import { ajaxPost, popup } from "@/assets/js/common";
export default {
data() {
return {
pwdForm: {},
rules: {
newPwd: [
{
required: true,
message: "新密码不能为空",
trigger: "blur",
},
{
min: 6,
max: 8,
message: "新密码长度为6-8位",
trigger: "blur",
},
],
oldPwd: [
{
required: true,
message: "旧密码不能为空",
trigger: "blur",
},
{
min: 6,
max: 8,
message: "旧密码长度为6-8位",
trigger: "blur",
},
],
},
};
},
methods: {
init() {
this.pwdForm.username = loginEmp().username;
},
resetForm(formName) {
this.$refs[formName].resetFields();
},
submitForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
this.$confirm("确定修改密码?", "警示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
ajaxPost("/personal/edit_pwd", this.pwdForm).then(
(res) => {
res = res.data;
if (res.code == 200) {
popup("密码修改成功,请重新登录...");
this.pwdForm = {
username: this.pwdForm.username,
};
Cookies.remove("employee");
removeToken();
this.$router.push("/");
} else {
popup(res.msg, "error");
}
}
);
})
.catch(() => {
this.$message({
type: "info",
message: "已取消操作",
});
});
}
});
},
},
created() {
this.init();
},
};
</script>
<style>
#edit_pwd {
width: 50%;
margin: 50px auto;
background-color: #ffffff;
padding: 20px;
}
</style>

@ -0,0 +1,275 @@
<template>
<div id="information">
<el-breadcrumb separator="/">
<el-breadcrumb-item>首页</el-breadcrumb-item>
<el-breadcrumb-item>个人中心 </el-breadcrumb-item>
<el-breadcrumb-item>个人资料</el-breadcrumb-item> </el-breadcrumb
><br />
<i class="iconfont icon-r-paper" style="font-size: 32px">
<b style="font-size: 28px">完善个人资料</b></i
>
<br />
<br />
<el-form
:model="informationForm"
:rules="rules"
ref="informationForm"
label-width="100px"
class="demo-ruleForm"
>
<el-row>
<el-col :span="12">
<el-form-item style="width: 40%">
<el-upload
class="avatar-uploader"
action="http://localhost:9291/personnel_management/employee/uploadImg"
:show-file-list="false"
:on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload"
>
<img
v-if="imageUrl"
:src="BaseApi + imageUrl"
class="avatar"
/>
<i
v-else
class="el-icon-plus avatar-uploader-icon"
></i>
</el-upload>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item
style="width: 40%"
label="电话号码:"
prop="username"
>
<el-input
max="11"
v-model="informationForm.username"
></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
style="width: 40%"
label="姓名:"
prop="nickName"
>
<el-input
v-model="informationForm.nickName"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item
style="width: 40%"
label="身份证号:"
prop="idCard"
>
<el-input
v-model="informationForm.idCard"
></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item style="width: 40%" label="年龄:">
<el-input
type="number"
min="18"
max="70"
v-model="informationForm.age"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item
style="width: 40%"
label="所属部门:"
>
<el-select
disabled
style="width: 200px"
v-model="informationForm.deptId"
placeholder="请选择部门"
filterable
@change="$forceUpdate()"
clearable
>
<el-option
v-for="item in options"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item style="width: 40%" label="住址:">
<el-input
type="text"
v-model="informationForm.address"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item style="width: 40%" label="备注:">
<el-input
type="textarea"
cols="50"
rows="3"
v-model="informationForm.info"
></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item style="width: 40%" label="性别:">
<el-select
style="width: 200px"
v-model="informationForm.sex"
@change="$forceUpdate()"
placeholder="请选择性别"
clearable
>
<el-option label="女" value="0"></el-option>
<el-option label="男" value="1"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-form-item>
<el-button
type="primary"
@click="submitInformationForm('informationForm')"
>
提交</el-button
>
<el-button
@click="resetForm('informationForm')"
>
重置</el-button
>
</el-form-item>
</el-form>
</div>
</template>
<script>
import { listByQo } from "@/api/personnel_management/department/deptApi";
import { popup } from "@/assets/js/common";
import { queryInformation } from "@/api/personal/personApi";
import { update } from "@/api/personnel_management/employee/empApi";
import { loginEmp } from "@/assets/js/auth";
export default {
data() {
return {
BaseApi: this.$store.state.BaseApi,
loginEid: loginEmp().id,
informationForm: {},
imageUrl: "",
options: [],
rules: {
username: [
{
required: true,
message: "手机号不能为空",
trigger: "blur",
},
],
nickName: [
{
required: true,
message: "姓名不能为空",
trigger: "blur",
},
],
idCard: [
{
required: true,
message: "身份证号不能为空",
trigger: "blur",
},
],
},
};
},
methods: {
deptAll() {
listByQo({}).then((res) => {
res = res.data;
if (res.code == 200) {
this.options = res.data;
} else {
popup(res.msg, "error");
}
});
},
init() {
queryInformation().then((res) => {
res = res.data;
if (res.code == 200) {
this.informationForm = { ...res.data };
this.imageUrl = this.informationForm.headImg;
} else {
popup(res.msg, "error");
}
});
},
submitInformationForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
update(this.informationForm).then((res) => {
res = res.data;
if (res.code == 200) {
popup("更新成功");
} else {
popup(res.msg, "error");
}
this.init();
});
}
});
},
resetForm(formName) {
this.$refs[formName].resetFields();
this.init();
},
/*上传头像*/
handleAvatarSuccess(res) {
this.informationForm.headImg = res.url;
this.imageUrl = res.url;
},
beforeAvatarUpload(file) {
const isJPG =
file.type === "image/jpeg" || file.type === "image/png";
const isLt2M = file.size / 1024 / 1024 < 3;
if (!isJPG) {
this.$message.error("上传头像图片只能是 JPG或PNG 格式!");
}
if (!isLt2M) {
this.$message.error("上传头像图片大小不能超过 3MB!");
}
return isJPG && isLt2M;
},
},
mounted() {
this.imageUrl = "";
this.deptAll();
this.init();
},
};
</script>

@ -0,0 +1,254 @@
<template>
<div id="dept_list">
<el-breadcrumb separator="/">
<el-breadcrumb-item
>首页</el-breadcrumb-item
>
<el-breadcrumb-item
>人事管理
</el-breadcrumb-item>
<el-breadcrumb-item
>部门管理</el-breadcrumb-item
> </el-breadcrumb
><br />
<el-row>
<el-col :span="7">
<el-input placeholder="部门名称" v-model="searchForm.name"/>
</el-col>
<el-col :span="7">
<el-select v-model="searchForm.state" placeholder="请选择状态" clearable>
<el-option label="正常" value="0"></el-option>
<el-option label="停用" value="-1"></el-option>
</el-select>
</el-col>
</el-row>
<br />
<el-row>
<el-col :span="24" style="text-align: left">
<el-button
type="primary"
@click="subSearchForm"
>
搜索</el-button
>
<el-button type="success" @click="newVisable=true"
>
创建部门
</el-button>
</el-col>
</el-row>
<br />
<el-table
:data="tableData"
style="width: 100%">
<el-table-column
type="index"
label="序号"
width="180">
</el-table-column>
<el-table-column
prop="name"
label="名称"
width="180">
</el-table-column>
<el-table-column
prop="info"
label="描述">
</el-table-column>
<el-table-column
prop="state"
label="状态">
<template v-slot="scope">
<el-tag v-if="scope.row.state=='0'" type="success" style="font-size: 14px;">
<i class="iconfont icon-r-yes" style="font-size: 14px;"> </i> 正常</el-tag>
<el-tag v-else type="danger" style="font-size: 14px;">
<i class="iconfont icon-r-no" style="font-size: 14px;"> </i> 停用</el-tag>
</template>
</el-table-column>
<el-table-column
label="操作" width="260" fixed="right">
<template v-slot="scope">
<el-button type="success" @click="edit(scope.row)" >
修改</el-button>
<el-button type="danger" @click="forbidden(scope.row.id)" >
停用</el-button>
</template>
</el-table-column>
</el-table>
<!--修改描述/状态弹出框-->
<el-dialog
title="部门修改"
:visible.sync="dialogVisible"
width="50%">
<el-form v-model="editForm" label-width="100px" class="demo-ruleForm">
<el-form-item label="名称:">
<el-input disabled v-model="editForm.name"></el-input>
</el-form-item>
<el-form-item label="描述:">
<el-input type="text" v-model="editForm.info"></el-input>
</el-form-item>
<el-form-item label="状态:">
<el-select v-model="editForm.state"
clearable
@change="$forceUpdate()"
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>
<el-button type="primary" @click="submitEditForm" >
提交</el-button>
<el-button @click="canCelEdit" >
关闭</el-button>
</el-form-item>
</el-form>
</el-dialog>
<!--创建弹出框-->
<el-dialog
title="创建部门"
:visible.sync="newVisable"
width="50%">
<el-form :model="newForm" :rules="rules" ref="newForm" label-width="100px" class="demo-ruleForm">
<el-form-item label="名称:" prop="name">
<el-input v-model="newForm.name"></el-input>
</el-form-item>
<el-form-item label="描述:">
<el-input type="text" v-model="newForm.info"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submitNewForm('newForm')"> </el-button>
<el-button @click="resetNewForm('newForm')"> </el-button>
</el-form-item>
</el-form>
</el-dialog>
</div>
</template>
<script>
import { popup} from "@/assets/js/common";
import {deactivate, listByQo, save, update} from "@/api/personnel_management/department/deptApi";
export default {
data() {
return {
tableData: [],
editForm: {},
editRow:{},
dialogVisible: false,
newVisable:false,
newForm:{},
searchForm: {},
options: [
{label: '正常', value: '0'},
{label: '停用', value: '-1'}
],
rules: {
name:[
{required: true, message: '名称不能为空', trigger: 'blur'},
]
}
}
},
methods: {
init() {
listByQo(this.searchForm).then(res => {
if (res.data.code == 200) {
this.tableData = res.data.data
}else {
popup(res.data.msg,"error")
}
})
},
forbidden(id) {
deactivate(id).then(res => {
res = res.data
if (res.code == 200) {
popup("操作成功")
} else {
popup(res.msg, "error")
}
this.init()
})
},
/*弹出修改表单*/
edit(row) {
this.editForm= {...row}
this.dialogVisible = true
},
/*条件搜索*/
subSearchForm() {
this.init()
},
/*对接后端修改接口*/
submitEditForm() {
update(this.editForm).then(res=>{
res=res.data
if (res.code==200){
popup("操作成功")
this.dialogVisible=false
this.init()
}else {
popup(res.msg, "error")
}
})
},
/*修改重置按钮*/
canCelEdit(){
this.dialogVisible=false
this.editForm={}
},
/*创建新角色*/
submitNewForm(formName){
this.$refs[formName].validate((valid) => {
if (valid) {
console.log(this.newForm)
save(this.newForm).then(res=>{
res=res.data
if (res.code==200){
popup("操作成功")
this.newVisable=false
this.newForm={}
this.init()
}else {
popup(res.msg, "error")
}
})
}
});
},
resetNewForm(formname){
this.$refs[formname].resetFields()
},
},
created() {
this.init()
}
}
</script>
<style>
.search {
display: inline-block;
margin: 0 auto;
height: 51px;
line-height: 51px;
}
.search .column {
display: inline-block;
margin: 0 auto;
margin-right: 2px;
line-height: 48px;
height: 51px;
}
</style>

File diff suppressed because it is too large Load Diff

@ -0,0 +1,246 @@
<template>
<div id="sale_records">
<el-breadcrumb separator="/">
<el-breadcrumb-item
>首页</el-breadcrumb-item
>
<el-breadcrumb-item
>销售管理
</el-breadcrumb-item>
<el-breadcrumb-item
>积分兑换记录</el-breadcrumb-item
> </el-breadcrumb
><br />
<el-row>
<el-col :span="7">
<el-input
placeholder="兑换订单编号"
v-model="searchForm.cn"
/>
</el-col>
<el-col :span="7">
<el-select
v-model="searchForm.memberId"
placeholder="请选择会员账号"
filterable
@change="$forceUpdate()"
clearable
>
<el-option
v-for="item in options_memberPhone"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-col>
<el-col :span="10">
<span>兑换时间</span>
<el-date-picker
style="width: 140px"
v-model="searchForm.startTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="起始时间"
>
</el-date-picker>
-
<el-date-picker
v-model="searchForm.endTime"
style="width: 140px"
value-format="yyyy-MM-dd"
type="date"
placeholder="结束时间"
>
</el-date-picker>
</el-col>
</el-row>
<br />
<el-row>
<el-col :span="24" style="text-align: left">
<el-button
type="success"
@click="submitSearchForm"
>
搜索</el-button
>
</el-col>
</el-row>
<br />
<div class="table">
<el-table :data="tableData" style="width: 100%" size="medium">
<el-table-column prop="cn" width="200" label="编号">
</el-table-column>
<el-table-column prop="goodsCoverUrl" label="商品封面">
<template v-slot="scope">
<img
:src="BaseApi + scope.row.goodsCoverUrl"
alt="兑换商品图片"
height="50px"
/>
</template>
</el-table-column>
<el-table-column prop="goodsName" label="商品">
</el-table-column>
<el-table-column prop="integral" label="积分">
</el-table-column>
<el-table-column
width="200"
prop="memberPhone"
label="会员账号"
>
</el-table-column>
<el-table-column prop="updateTime" width="200" label="兑换时间">
</el-table-column>
<el-table-column prop="updateby" label="操作者">
</el-table-column>
<el-table-column width="140" fixed="right" label="操作">
<template v-slot="scope">
<el-button
type="danger"
@click="del(scope.row.cn)"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<div style="margin: 10px 0 15px 0;">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="searchForm.currentPage"
:page-sizes="[5, 10, 20, 50]"
:page-size="searchForm.pageSize"
layout="total,sizes, prev, pager, next,jumper"
:total="searchForm.total"
>
</el-pagination>
</div>
</div>
</div>
</template>
<script>
import { popup } from "@/assets/js/common";
import {
delExchangePointProducts,
queryOptionsMemberPhone,
queryPageByQoExchangePointProducts,
} from "@/api/sale_management/exchange_point_products/exchangePointProductsApi";
export default {
data() {
return {
BaseApi: this.$store.state.BaseApi,
searchForm: {
pageSize: 5,
},
tableData: [],
options_memberPhone: [],
};
},
methods: {
queryOptionsMemberPhone() {
queryOptionsMemberPhone().then((res) => {
res = res.data;
if (res.code == 200) {
this.options_memberPhone = res.data;
} else {
popup(res.msg, "error");
}
});
},
init() {
if (this.searchForm.startTime > this.searchForm.endTime) {
popup("结束时间不能小于开始时间", "warning");
return;
}
queryPageByQoExchangePointProducts(this.searchForm).then((res) => {
res = res.data;
if (res.code == 200) {
this.tableData = res.data.records;
this.searchForm.total = res.data.total;
this.searchForm.pageSize = res.data.size;
this.searchForm.currentPage = res.data.current;
} else {
popup(res.msg, "error");
}
});
},
del(cn) {
this.$confirm("确定删除这条记录?", "警示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
delExchangePointProducts({ cn: cn }).then((res) => {
res = res.data;
if (res.code == 200) {
popup("操作成功");
this.init();
} else {
popup(res.msg, "error");
}
});
})
.catch(() => {
this.$message({
type: "info",
message: "已取消操作",
});
});
},
/*分页*/
handleSizeChange(val) {
this.searchForm.pageSize = val;
this.init();
},
handleCurrentChange(val) {
this.searchForm.currentPage = val;
this.init();
},
submitSearchForm() {
this.init();
},
},
mounted() {
this.init();
this.queryOptionsMemberPhone();
},
};
</script>
<style>
.searchForm {
height: 134px;
}
.table {
height: 320px;
}
.pageUtils {
position: absolute;
width: 84%;
margin: 2px auto;
height: 43px;
}
.searchForm {
display: inline-block;
margin: 0 auto;
height: 51px;
line-height: 51px;
}
.searchForm .column {
display: inline-block;
margin: 0 auto;
margin-right: 2px;
line-height: 48px;
height: 51px;
}
</style>

File diff suppressed because it is too large Load Diff

@ -0,0 +1,483 @@
<template>
<div id="sale_records">
<el-breadcrumb separator="/">
<el-breadcrumb-item
>首页</el-breadcrumb-item
>
<el-breadcrumb-item
>销售管理</el-breadcrumb-item
>
<el-breadcrumb-item>销售记录</el-breadcrumb-item>
</el-breadcrumb>
<br />
<el-row>
<el-col :span="4">
<el-input
style="height: 21px; width: 130px"
placeholder="销售编号"
v-model="searchForm.cn"
/>
</el-col>
<el-col :span="10">
<span>销售时间</span>
<el-date-picker
style="width: 140px"
v-model="searchForm.startSellTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="起始时间"
>
</el-date-picker>
-
<el-date-picker
v-model="searchForm.endSellTime"
style="width: 140px"
value-format="yyyy-MM-dd"
type="date"
placeholder="结束时间"
>
</el-date-picker>
</el-col>
<el-col :span="4">
<el-select
style="width: 120px"
v-model="searchForm.type"
@change="$forceUpdate()"
placeholder="顾客类型"
clearable
>
<el-option label="非会员顾客" value="0"></el-option>
<el-option label="会员" value="1"></el-option>
</el-select>
</el-col>
<el-col :span="4">
<el-select
style="width: 120px"
v-model="searchForm.sellway"
@change="$forceUpdate()"
placeholder="支付方式"
clearable
>
<el-option label="支付宝" value="0"></el-option>
<el-option label="微信" value="1"></el-option>
<el-option label="现金" value="2"></el-option>
<el-option label="银行卡" value="3"></el-option>
</el-select>
</el-col>
</el-row>
<br>
<el-row>
<el-col :span="24" style="text-align: left;">
<el-button type="success" @click="submitSearchForm"
>
搜索</el-button
>
</el-col>
</el-row>
<br />
<div class="table">
<el-table :data="tableData" style="width: 100%" size="medium">
<el-table-column prop="cn" width="200" label="编号">
</el-table-column>
<el-table-column prop="sellTotal" label="销售数量">
</el-table-column>
<el-table-column prop="sellTotalmoney" label="销售总额">
<template v-slot="scope">
{{ parseFloat(scope.row.sellTotalmoney).toFixed(2) }}
</template>
</el-table-column>
<el-table-column
prop="sellTime"
:show-overflow-tooltip="true"
label="销售时间"
>
</el-table-column>
<el-table-column prop="type" label="顾客类型" width="120">
<template v-slot="scope">
<el-tag
effect="dark"
type="warning"
style="font-size: 14px;"
v-if="scope.row.type == '1'"
>
<i class="iconfont icon-r-mark1"></i>
会员</el-tag
>
<el-tag effect="dark" type="info" v-else
>非会员</el-tag
>
</template>
</el-table-column>
<el-table-column prop="sellby" label="销售员">
</el-table-column>
<el-table-column prop="sellway" label="支付方式">
<template v-slot="scope">
<el-tag
effect="dark"
type="primary"
v-if="scope.row.sellway == '0'"
>支付宝</el-tag
>
<el-tag
effect="dark"
type="success"
v-else-if="scope.row.sellway == '1'"
>微信</el-tag
>
<el-tag
effect="dark"
type="warning"
v-else-if="scope.row.sellway == '3'"
>银行卡</el-tag
>
<el-tag effect="dark" type="danger" v-else></el-tag>
</template>
</el-table-column>
<el-table-column
prop="info"
:show-overflow-tooltip="true"
label="备注"
>
</el-table-column>
<el-table-column width="260" label="操作" fixed="right">
<template v-slot="scope">
<el-button
type="success"
@click="detailBtn(scope.row)"
>
明细
</el-button>
<el-button
type="danger"
@click="del(scope.row.cn)"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<div style="margin: 10px 0 15px 0;">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="searchForm.currentPage"
:page-sizes="[5, 10, 20, 50]"
:page-size="searchForm.pageSize"
layout="total,sizes, prev, pager, next,jumper"
:total="searchForm.total"
>
</el-pagination>
</div>
</div>
<el-dialog
title="销售订单明细"
:visible.sync="detailSaleRecordsVisable"
width="80%"
>
<el-form
:model="saleRecordForm"
label-width="100px"
class="demo-ruleForm"
>
<el-row>
<el-col :span="12">
<el-form-item style="width: 60%" label="销售编号:">
<el-input
disabled
readonly
v-model="saleRecordForm.cn"
placeholder="如:销售编号"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item
style="width: 80%"
label="支付方式:"
prop="sellway"
>
<el-radio
disabled
type="radio"
v-model="saleRecordForm.sellway"
label="0"
>支付宝</el-radio
>
<el-radio
disabled
type="radio"
v-model="saleRecordForm.sellway"
label="1"
>微信</el-radio
>
<el-radio
disabled
type="radio"
v-model="saleRecordForm.sellway"
label="2"
>现金</el-radio
>
<el-radio
disabled
type="radio"
v-model="saleRecordForm.sellway"
label="3"
>银行卡</el-radio
>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item style="width: 60%" label="顾客类型:">
<el-radio
disabled
type="radio"
v-model="saleRecordForm.type"
label="1"
>会员</el-radio
>
<el-radio
disabled
type="radio"
v-model="saleRecordForm.type"
label="0"
>非会员</el-radio
>
</el-form-item>
</el-col>
<el-col :span="12" v-if="saleRecordForm.type == '1'">
<el-form-item
style="width: 60%"
label="会员账号:"
prop="memberPhone"
>
<el-input
readonly
v-model="saleRecordForm.memberPhone"
placeholder="如:电话号码"
></el-input>
</el-form-item>
</el-col>
</el-row>
<hr>
<el-row>
<el-col :span="24">
<el-table
:data="saleRecordForm.detailSaleRecords"
style="width: 100%"
size="medium"
>
<el-table-column prop="goodsId" label="商品编号">
</el-table-column>
<el-table-column prop="goodsName" label="商品名">
</el-table-column>
<el-table-column prop="goodsNum" label="数量">
<template v-slot="scope">
<el-button type="info" disabled>-</el-button>
<el-input
disabled
style="width: 80px"
type="number"
min="1"
v-model="scope.row.goodsNum"
></el-input>
<el-button type="info" disabled>+</el-button>
</template>
</el-table-column>
<el-table-column prop="goodsPrice" label="商品单价(元)">
</el-table-column>
</el-table>
</el-col>
</el-row>
<hr>
<el-row>
<el-col :span="24">
<el-form-item style="width: 100%" label="备注:">
<el-input
disabled
readonly
type="textarea"
v-model="saleRecordForm.info"
placeholder="如订单1"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<div v-if="saleRecordForm.detailSaleRecords.length > 0">
订单号{{ saleRecordForm.cn }}&nbsp;&nbsp;
商品总数{{
saleRecordForm.sellTotal
? saleRecordForm.sellTotal
: 0
}}&nbsp;&nbsp; 消费{{
saleRecordForm.sellTotalmoney
? parseFloat(
saleRecordForm.sellTotalmoney
).toFixed(2)
: 0
}}&nbsp;&nbsp;
<span v-if="saleRecordForm.sellway"
>支付方式{{
saleRecordForm.sellway == "0"
? "支付宝"
: saleRecordForm.sellway == "1"
? "微信"
: saleRecordForm.sellway == "2"
? "现金"
: "银行卡"
}}&nbsp;&nbsp;</span
><br>
<span v-if="saleRecordForm.type == '1'"
>会员享受9折&nbsp;&nbsp;</span
>
<span v-if="saleRecordForm.sellTime"
>消费时间{{
saleRecordForm.sellTime
}}&nbsp;&nbsp; 操作者编号{{
saleRecordForm.eid
}}</span
>
</div>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item>
<el-button
type="info"
@click="detailSaleRecordsVisable = false"
> 关闭</el-button
>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-dialog>
</div>
</template>
<script>
import { popup } from "@/assets/js/common";
import {
delSaleRecords,
queryPageByQoSaleRecords,
} from "@/api/sale_management/saleRecordsApi";
export default {
data() {
return {
detailSaleRecordsVisable: false,
searchForm: {
pageSize: 5
},
tableData: [],
saleRecordForm: {
cn: "",
sellway: "",
info: "",
sellTotal: "",
sellTotalmoney: "",
type: "0",
detailSaleRecords: [],
},
};
},
methods: {
init() {
if (this.searchForm.startSellTime > this.searchForm.endSellTime) {
popup("结束时间不能小于开始时间", "warning");
return;
}
queryPageByQoSaleRecords(this.searchForm).then((res) => {
res = res.data;
if (res.code == 200) {
this.tableData = res.data.records;
this.searchForm.total = res.data.total;
this.searchForm.pageSize = res.data.size;
this.searchForm.currentPage = res.data.current;
} else {
popup(res.msg, "error");
}
});
},
del(cn) {
this.$confirm("确定删除这条记录?", "警示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
delSaleRecords({ cn: cn }).then((res) => {
res = res.data;
if (res.code == 200) {
popup("操作成功");
this.init();
} else {
popup(res.msg, "error");
}
});
})
.catch(() => {
this.$message({
type: "info",
message: "已取消操作",
});
});
},
detailBtn(row) {
this.saleRecordForm = {
cn: "",
sellway: "",
info: "",
sellTotal: "",
sellTotalmoney: "",
type: "0",
detailSaleRecords: [],
};
this.saleRecordForm = { ...row };
this.detailSaleRecordsVisable = true;
},
/*分页*/
handleSizeChange(val) {
this.searchForm.pageSize = val;
this.init();
console.log(`每页 ${val}`);
},
handleCurrentChange(val) {
this.searchForm.currentPage = val;
this.init();
console.log(`当前页: ${val}`);
},
submitSearchForm() {
this.init();
},
},
mounted() {
this.init();
},
};
</script>
<style>
.searchForm {
height: 134px;
}
.table {
height: 320px;
}
.pageUtils {
position: absolute;
width: 84%;
margin: 2px auto;
height: 43px;
}
</style>

@ -0,0 +1,209 @@
<template>
<div>
<el-breadcrumb separator="/">
<el-breadcrumb-item>首页</el-breadcrumb-item>
<el-breadcrumb-item>系统管理</el-breadcrumb-item>
<el-breadcrumb-item>菜单管理</el-breadcrumb-item> </el-breadcrumb
><br />
<el-row>
<el-col :span="8" style="text-align: left; padding-right: 10px">
<el-input placeholder="菜单名称" v-model="searchForm.name" />
</el-col>
</el-row>
<br />
<el-row>
<el-col :span="24" style="text-align: left">
<el-button
type="primary"
@click="submitSearchForm"
>
搜索</el-button
>
<el-button
type="info"
@click="resetSearchForm"
>
重置
</el-button>
</el-col>
</el-row>
<br />
<div class="table">
<el-table
:data="tableData"
style="width: 100%"
size="medium"
row-key="id"
border
:tree-props="{ children: 'children' }"
>
<el-table-column prop="label" label="菜单名"> </el-table-column>
<el-table-column
width="150"
prop="flag"
:show-overflow-tooltip="true"
label="标识符"
>
<template v-slot="scope">
<el-tag type="info">{{
scope.row.flag ? scope.row.flag : "暂定"
}}</el-tag>
</template>
</el-table-column>
<el-table-column prop="type" label="类型">
<template v-slot="scope">
<el-tag v-if="scope.row.type == 0"
>目录</el-tag
>
<el-tag
v-else-if="scope.row.type == 1"
type="success"
>菜单</el-tag
>
<el-tag v-else type="warning"
>按钮</el-tag
>
</template>
</el-table-column>
<el-table-column prop="icon" label="图标">
<template v-slot="scope">
<i :class="scope.row.icon"></i>
</template>
</el-table-column>
<el-table-column
prop="info"
:show-overflow-tooltip="true"
label="描述"
>
<template v-slot="scope">
<el-tag type="info">{{
scope.row.info ? scope.row.info : "无"
}}</el-tag>
</template>
</el-table-column>
<el-table-column
prop="component"
:show-overflow-tooltip="true"
label="组件路径"
>
<template v-slot="scope">
<el-tag type="info">{{
scope.row.component ? scope.row.component : "暂定"
}}</el-tag>
</template>
</el-table-column>
<el-table-column prop="state" label="状态">
<template v-slot="scope">
<el-tag
type="success"
v-if="scope.row.state == 0"
>正常</el-tag
>
<el-tag type="danger" v-else></el-tag>
</template>
</el-table-column>
</el-table>
<div style="margin: 10px 0 15px 0">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="searchForm.currentPage"
:page-sizes="[5, 10, 20, 50]"
:page-size="searchForm.pageSize"
layout="total,sizes, prev, pager, next,jumper"
:total="searchForm.total"
>
</el-pagination>
</div>
</div>
</div>
</template>
<script>
import { queryPageByQo } from "@/api/system/menu/menuApi";
import { popup } from "@/assets/js/common";
export default {
data() {
return {
/*搜索*/
/*表格*/
tableData: [],
searchForm: {
total: 0,
currentPage: 1,
pageSize: 5,
},
};
},
methods: {
init() {
queryPageByQo(this.searchForm).then((res) => {
res = res.data;
if (res.code == 200) {
console.log(res.data);
this.tableData = res.data.records;
this.searchForm.total = res.data.total;
this.searchForm.pageSize = res.data.size;
this.searchForm.currentPage = res.data.current;
} else {
popup(res.msg, "error");
}
});
},
submitSearchForm() {
this.init();
},
resetSearchForm() {
this.searchForm.name = "";
},
/*分页*/
handleSizeChange(val) {
this.searchForm.pageSize = val;
this.init();
console.log(`每页 ${val}`);
},
handleCurrentChange(val) {
this.searchForm.currentPage = val;
this.init();
console.log(`当前页: ${val}`);
},
},
mounted() {
this.init();
},
};
</script>
<style>
.searchForm {
height: 134px;
}
.table {
height: 320px;
}
.pageUtils {
position: absolute;
width: 84%;
margin: 2px auto;
height: 43px;
}
.searchForm {
display: inline-block;
margin: 0 auto;
height: 51px;
line-height: 51px;
}
.searchForm .column {
display: inline-block;
margin: 0 auto;
margin-right: 2px;
line-height: 48px;
height: 51px;
}
</style>

@ -0,0 +1,416 @@
<template>
<div id="role_list">
<el-breadcrumb separator="/">
<el-breadcrumb-item>首页</el-breadcrumb-item>
<el-breadcrumb-item>系统管理</el-breadcrumb-item>
<el-breadcrumb-item>角色管理</el-breadcrumb-item> </el-breadcrumb
><br />
<el-row>
<el-col :span="8" style="text-align: left; padding-right: 10px">
<el-input
placeholder="角色名称"
v-model="roleSearchForm.name"
/>
</el-col>
<el-col :span="8">
<el-select
@change="$forceUpdate"
v-model="roleSearchForm.state"
placeholder="状态"
clearable
>
<el-option label="正常" value="0"></el-option>
<el-option label="停用" value="-1"></el-option>
</el-select>
</el-col>
</el-row>
<br />
<el-row>
<el-col :span="24" style="text-align: left">
<el-button
type="primary"
@click="subSearchForm('ruleForm')"
>
搜索</el-button
>
<el-button
type="success"
@click="newRoleVisable = true"
>
创建角色
</el-button>
</el-col>
</el-row>
<br />
<el-table :data="tableData" style="width: 100%">
<el-table-column type="index" label="序号" width="180">
</el-table-column>
<el-table-column prop="name" label="名称" width="180">
</el-table-column>
<el-table-column prop="info" label="描述"> </el-table-column>
<el-table-column prop="state" label="状态">
<template v-slot="scope">
<el-tag v-if="scope.row.state == '0'" type="success"
>正常</el-tag
>
<el-tag v-else type="danger">停用</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" width="420" fixed="right">
<template v-slot="scope">
<el-button
type="success"
@click="editRole(scope.row)"
>
修改</el-button
>
<el-button
v-if="scope.row.state == '0'"
type="danger"
@click="forbidden(scope.row.id)"
>
停用</el-button
>
<el-button
type="warning"
@click="checkPermissons(scope.row.id)"
>
授权</el-button
>
</template>
</el-table-column>
</el-table>
<!--修改描述/状态弹出框-->
<el-dialog
title="角色信息修改"
:visible.sync="dialogVisible"
width="50%"
>
<el-form
v-model="editRoleForm"
label-width="100px"
class="demo-ruleForm"
>
<el-form-item label="名称:">
<el-input disabled v-model="editRoleForm.name"></el-input>
</el-form-item>
<el-form-item label="描述:">
<el-input
type="text"
v-model="editRoleForm.info"
></el-input>
</el-form-item>
<el-form-item label="状态:">
<el-select
v-model="editRoleForm.state"
clearable
@change="$forceUpdate()"
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>
<el-button
type="primary"
@click="submitEditForm"
>
提交</el-button
>
<el-button @click="resetEditForm" >
重置</el-button
>
</el-form-item>
</el-form>
</el-dialog>
<!--创建角色弹出框-->
<el-dialog title="创建角色" :visible.sync="newRoleVisable" width="50%">
<el-form
:model="newRoleForm"
:rules="rules"
ref="newRoleForm"
label-width="100px"
class="demo-ruleForm"
>
<el-form-item label="名称:" prop="name">
<el-input v-model="newRoleForm.name"></el-input>
</el-form-item>
<el-form-item label="描述:">
<el-input type="text" v-model="newRoleForm.info"></el-input>
</el-form-item>
<el-form-item>
<el-button
type="primary"
@click="submitNewForm('newRoleForm')"
>
创建角色</el-button
>
<el-button @click="resetNewForm" >
重置</el-button
>
</el-form-item>
</el-form>
</el-dialog>
<!--职能分配框-->
<el-dialog
title="权限分配"
:visible.sync="distributionFulVisable"
width="50%"
>
<el-form
:model="distributionFulForm"
label-width="100px"
class="demo-ruleForm"
>
<el-form-item>
<el-input
placeholder="输入关键字进行过滤"
v-model="filterText"
>
</el-input>
<el-tree
:data="fuloptions"
class="filter-tree"
show-checkbox
node-key="value"
:default-checked-keys="default_checked_mid"
default-expand-all
:filter-node-method="filterNode"
ref="tree"
:props="props"
></el-tree>
</el-form-item>
<el-form-item>
<el-button
type="primary"
@click="submitDistributionFulForm"
>
提交</el-button
>
<el-button
@click="celDistributionFul"
> 取消</el-button
>
</el-form-item>
</el-form>
</el-dialog>
</div>
</template>
<script>
import {
forbiddenRole,
roleList,
edit_role,
save_role,
checkPermissons,
saveRolePermissons,
} from "@/api/system/role/roleApi";
import { ajaxPost, popup } from "@/assets/js/common";
export default {
data() {
return {
tableData: [],
editRoleForm: {},
editRoleRow: {},
dialogVisible: false,
newRoleVisable: false,
distributionFulVisable: false,
newRoleForm: {},
roleSearchForm: {},
distributionFulForm: {},
options: [
{ label: "正常", value: "0" },
{ label: "停用", value: "-1" },
],
/*职能分配*/
props: { multiple: true },
fuloptions: [],
default_checked_mid: [],
filterText: "",
rules: {
name: [
{
required: true,
message: "名称不能为空",
trigger: "blur",
},
],
},
};
},
watch: {
filterText(val) {
this.$refs.tree.filter(val);
},
},
methods: {
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
init() {
roleList(this.roleSearchForm).then((res) => {
res = res.data;
if ((res.code = 200)) {
this.tableData = res.data;
} else {
popup(res.msg, "error");
}
});
},
forbidden(id) {
forbiddenRole(id).then((res) => {
res = res.data;
if (res.code == 200) {
this.roleSearchForm.state = "0";
this.init();
popup("操作成功");
} else {
popup(res.msg, "error");
}
});
},
/*弹出修改表单*/
editRole(row) {
this.editRoleForm = { ...row };
this.editRoleRow = { ...row };
this.dialogVisible = true;
},
/*条件搜索*/
subSearchForm() {
this.init();
},
/*对接后端修改角色接口*/
submitEditForm() {
if (
this.editRoleForm.info == this.editRoleRow.info &&
this.editRoleForm.state == this.editRoleRow.state
) {
popup("您没有更改内容", "warning");
return;
}
edit_role(this.editRoleForm).then((res) => {
res = res.data;
if (res.code == 200) {
popup("操作成功");
this.editRoleForm = {};
this.editRoleRow = {};
this.dialogVisible = false;
this.roleSearchForm.state = "0";
this.init();
} else {
popup(res.msg, "error");
}
});
},
/*修改角色重置按钮*/
resetEditForm() {
this.editRoleForm = { ...this.editRoleRow };
},
/*创建新角色*/
submitNewForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
console.log(this.newRoleForm);
save_role(this.newRoleForm).then((res) => {
res = res.data;
if (res.code == 200) {
popup("操作成功");
this.newRoleForm = {};
this.newRoleVisable = false;
this.init();
} else {
popup(res.msg, "error");
}
});
}
});
},
resetNewForm() {
this.newRoleForm = {};
},
/*职能分配*/
/*授权按钮*/
checkPermissons(rid) {
this.distributionFulForm.rid = rid;
this.default_checked_mid = [];
checkPermissons(rid).then((res) => {
res = res.data;
if (res.code == 200) {
this.fuloptions = res.data.menus;
this.default_checked_mid = res.data.menuIds.sort(
(x, y) => x - y
);
console.log(typeof this.default_checked_mid);
console.log(this.default_checked_mid);
} else {
popup(res.msg, "error");
}
});
this.distributionFulVisable = true;
},
submitDistributionFulForm() {
var keys = this.$refs.tree.getCheckedKeys();
var v = JSON.stringify(keys).replace("[", "").replace("]", "");
this.distributionFulForm.menuIds = v;
console.log(this.distributionFulForm.menuIds);
saveRolePermissons(this.distributionFulForm).then((res) => {
res = res.data;
if (res.code == 200) {
popup("操作成功");
this.distributionFulVisable = false;
this.distributionFulForm = {};
this.default_checked_mid = [];
this.fuloptions = [];
} else {
popup(res.msg, "error");
}
});
this.distributionFulVisable = false;
},
celDistributionFul() {
this.default_checked_mid = [];
this.fuloptions = [];
this.distributionFulForm = {};
this.distributionFulVisable = false;
},
},
created() {
this.init();
},
};
</script>
<style>
.search {
display: inline-block;
margin: 0 auto;
height: 51px;
line-height: 51px;
}
.search .column {
display: inline-block;
margin: 0 auto;
margin-right: 2px;
line-height: 48px;
height: 51px;
}
</style>

@ -0,0 +1,17 @@
const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
transpileDependencies: true
})
module.exports = {
devServer: {
host: "localhost",
port: 9292,
client: {
overlay: false
}
},
}
Loading…
Cancel
Save