代码提交

main
zhangdi 4 months ago
parent e6ae005812
commit 7ee3048269
  1. 15
      src/api/firstOrder/list.js
  2. 8
      src/config/website.js
  3. 34
      src/page/login/index.vue
  4. 4
      src/page/login/userlogin.vue
  5. 10
      src/router/axios.js
  6. 2
      src/styles/login.scss
  7. 766
      src/views/authority/role.vue
  8. 7
      src/views/dataAnalysis/analysis.vue
  9. 197
      src/views/demandOrder/index.vue
  10. 8
      src/views/firstOrder/components/inDialog.vue
  11. 4
      src/views/firstOrder/components/outDialog.vue
  12. 77
      src/views/firstOrder/list.vue
  13. 229
      src/views/materials/expend.vue
  14. 10
      src/views/materials/index.vue
  15. 4
      src/views/secondOrder/components/inDialog.vue
  16. 4
      src/views/secondOrder/components/outDialog.vue
  17. 3
      src/views/secondOrder/list.vue
  18. 1
      src/views/system/menu.vue
  19. 11
      vue.config.js

@ -0,0 +1,15 @@
import request from '@/router/axios';
export const getList = (current, size, params) => {
return request({
url: '/smartpark/oneForm/list',
method: 'get',
params: {
...params,
pageSize:size,
pageNum:current,
},
cryptoToken: false,
cryptoData: false
})
}

@ -5,12 +5,12 @@ export default {
title: "saber", title: "saber",
logo: "X", logo: "X",
key: 'saber',//配置主键,目前用于存储 key: 'saber',//配置主键,目前用于存储
indexTitle: '微服务平台', indexTitle: '低值耐用品信息化平台',
clientId: 'saber', // 客户端id clientId: 'saber', // 客户端id
clientSecret: 'saber_secret', // 客户端密钥 clientSecret: 'saber_secret', // 客户端密钥
tenantMode: true, // 是否开启租户模式 tenantMode: false, // 是否开启租户模式
tenantId: "000000", // 管理组租户编号 tenantId: "000000", // 管理组租户编号
captchaMode: true, // 是否开启验证码模式 captchaMode: false, // 是否开启验证码模式
switchMode: false, // 是否开启登录切换角色部门 switchMode: false, // 是否开启登录切换角色部门
lockPage: '/lock', lockPage: '/lock',
tokenTime: 3000, tokenTime: 3000,
@ -48,7 +48,7 @@ export default {
publicKey: publicKey:
'04bab0a6e83fd3134503206093f0cb4d1cb55a608e5ba2ea67e8aa53030c3bab6cb6c864a5b5251b62f8717029c6277e8f8a2a3e9ecb4c474b03a8faa00a118933', '04bab0a6e83fd3134503206093f0cb4d1cb55a608e5ba2ea67e8aa53030c3bab6cb6c864a5b5251b62f8717029c6277e8f8a2a3e9ecb4c474b03a8faa00a118933',
// 第三方系统授权地址 // 第三方系统授权地址
authUrl: 'http://localhost/blade-auth/oauth/render', authUrl: 'http://192.168.0.110:1888/blade-auth/oauth/render',
// 单点登录系统认证 // 单点登录系统认证
ssoMode: false, // 是否开启单点登录功能 ssoMode: false, // 是否开启单点登录功能
ssoBaseUrl: 'http://localhost:8100', // 单点登录系统地址(cloud端口为8100,boot端口为80) ssoBaseUrl: 'http://localhost:8100', // 单点登录系统地址(cloud端口为8100,boot端口为80)

@ -8,45 +8,19 @@
<div class="login-time"> <div class="login-time">
{{time}} {{time}}
</div> </div>
<p class="title">{{ $t('login.info') }}</p> <p class="title">低值耐用品信息化平台</p>
<!-- <div style="font-size: 15px">
<span>----------------------------------------------</span>
<br>
<span>管理租户编号000000</span>
<br>
<span>超级管理员账号: admin / admin</span>
<br>
<span>人事账号: hr / hr</span>
<br>
<span>经理账号: manager / manager</span>
<br>
<span>老板账号: boss / boss</span>
<br>
<span>----------------------------------------------</span>
<br>
<span>普通租户编号详见租户管理模块</span>
<br>
<span>租户管理员账号: admin / admin</span>
<br>
<span>----------------------------------------------</span>
</div> -->
<!--<img class="img" src="/img/logo.png" alt="">-->
</div> </div>
<div class="login-border"> <div class="login-border">
<div class="login-main"> <div class="login-main">
<h4 class="login-title"> <h4 class="login-title">
{{ $t('login.title') }}{{website.title}} {{ $t('login.title') }}
<!-- <top-lang></top-lang> --> <!-- <top-lang></top-lang> -->
</h4> </h4>
<userLogin v-if="activeName==='user'"></userLogin> <userLogin v-if="activeName==='user'"></userLogin>
<codeLogin v-else-if="activeName==='code'"></codeLogin> <codeLogin v-else-if="activeName==='code'"></codeLogin>
<thirdLogin v-else-if="activeName==='third'"></thirdLogin> <thirdLogin v-else-if="activeName==='third'"></thirdLogin>
<!-- <div class="login-menu">
<a href="#" @click.stop="activeName='user'">{{ $t('login.userLogin') }}</a>
<a href="#" @click.stop="activeName='code'">{{ $t('login.phoneLogin') }}</a>
<a href="#" @click.stop="activeName='third'">{{ $t('login.thirdLogin') }}</a>
<a :href="website.oauth2.ssoBaseUrl + website.oauth2.ssoAuthUrl + website.oauth2.redirectUri">{{ $t('login.ssoLogin') }}</a>
</div> -->
</div> </div>
</div> </div>

@ -59,12 +59,12 @@
@click.native.prevent="handleLogin" @click.native.prevent="handleLogin"
:class="this.registerMode ? 'login-submit' : 'btn-submit'">{{$t('login.submit')}} :class="this.registerMode ? 'login-submit' : 'btn-submit'">{{$t('login.submit')}}
</el-button> </el-button>
<el-button type="danger" <!-- <el-button type="danger"
size="small" size="small"
v-if="this.registerMode" v-if="this.registerMode"
@click.native.prevent="handleRegister" @click.native.prevent="handleRegister"
class="register-submit">{{ $t('login.register') }} class="register-submit">{{ $t('login.register') }}
</el-button> </el-button> -->
</el-form-item> </el-form-item>
<el-dialog title="用户信息选择" <el-dialog title="用户信息选择"
append-to-body append-to-body

@ -47,7 +47,14 @@ axios.interceptors.request.use(config => {
isErrorShown = false; isErrorShown = false;
//地址为已经配置状态则不添加前缀 //地址为已经配置状态则不添加前缀
if (!isURL(config.url) && !config.url.startsWith(baseUrl)) { if (!isURL(config.url) && !config.url.startsWith(baseUrl)) {
config.url = baseUrl + config.url;
if(config.url.indexOf('smartpark')>0){
config.url = config.url;
}else{
config.url = baseUrl + config.url;
}
console.log(99999,config.url.indexOf('smartpark')>0,baseUrl,config.url)
} }
//安全请求header //安全请求header
config.headers['Blade-Requested-With'] = 'BladeHttpRequest'; config.headers['Blade-Requested-With'] = 'BladeHttpRequest';
@ -95,6 +102,7 @@ axios.interceptors.request.use(config => {
//http response拦截 //http response拦截
axios.interceptors.response.use(res => { axios.interceptors.response.use(res => {
// console.log('响应拦截',res)
//关闭 progress bar //关闭 progress bar
NProgress.done(); NProgress.done();
//获取配置信息 //获取配置信息

@ -125,7 +125,7 @@
} }
.login-submit { .login-submit {
width: 60%; width: 100%;
height: 45px; height: 45px;
border: 1px solid #409EFF; border: 1px solid #409EFF;
background: none; background: none;

@ -1,89 +1,101 @@
<template> <template>
<basic-container> <basic-container>
<avue-crud :option="option" <avue-crud
:table-loading="loading" :option="option"
:data="data" :table-loading="loading"
ref="crud" :data="data"
v-model="form" ref="crud"
:permission="permissionList" v-model="form"
:before-open="beforeOpen" :permission="permissionList"
@row-del="rowDel" :before-open="beforeOpen"
@row-update="rowUpdate" @row-del="rowDel"
@row-save="rowSave" @row-update="rowUpdate"
@search-change="searchChange" @row-save="rowSave"
@search-reset="searchReset" @search-change="searchChange"
@selection-change="selectionChange" @search-reset="searchReset"
@current-change="currentChange" @selection-change="selectionChange"
@size-change="sizeChange" @current-change="currentChange"
@refresh-change="refreshChange" @size-change="sizeChange"
@on-load="onLoad"> @refresh-change="refreshChange"
@on-load="onLoad"
>
<template slot="menuLeft"> <template slot="menuLeft">
<el-button type="danger" <el-button
size="small" type="danger"
icon="el-icon-delete" size="small"
v-if="permission.role_delete" icon="el-icon-delete"
plain v-if="permission.role_delete"
@click="handleDelete"> plain
@click="handleDelete"
>
</el-button> </el-button>
<el-button size="small" <el-button
icon="el-icon-setting" size="small"
@click="handleRole" icon="el-icon-setting"
v-if="userInfo.role_name.includes('admin')" @click="handleRole"
plain>权限设置 v-if="userInfo.role_name.includes('admin')"
plain
>权限设置
</el-button> </el-button>
</template> </template>
<template slot-scope="{row}" slot="menu"> <template slot-scope="{ row }" slot="menu">
<el-button <el-button
type="text" type="text"
icon="el-icon-setting" icon="el-icon-setting"
size="small" size="small"
v-if="userInfo.role_name.includes('admin')" v-if="userInfo.role_name.includes('admin')"
plain plain
style="border: 0;background-color: transparent !important;" style="border: 0; background-color: transparent !important"
@click.stop="handleRowRole(row)" @click.stop="handleRowRole(row)"
>权限设置 >权限设置
</el-button> </el-button>
</template> </template>
</avue-crud> </avue-crud>
<el-dialog title="角色权限配置" <el-dialog
append-to-body title="角色权限配置"
:visible.sync="box" append-to-body
width="345px"> :visible.sync="box"
width="345px"
>
<el-tabs type="border-card"> <el-tabs type="border-card">
<el-tab-pane label="菜单权限"> <el-tab-pane label="菜单权限">
<el-tree :data="menuGrantList" <el-tree
show-checkbox :data="menuGrantList"
node-key="id" show-checkbox
ref="treeMenu" node-key="id"
:default-checked-keys="menuTreeObj" ref="treeMenu"
:props="props"> :default-checked-keys="menuTreeObj"
:props="props"
>
</el-tree> </el-tree>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="数据权限"> <el-tab-pane label="数据权限">
<el-tree :data="dataScopeGrantList" <el-tree
show-checkbox :data="dataScopeGrantList"
node-key="id" show-checkbox
ref="treeDataScope" node-key="id"
:default-checked-keys="dataScopeTreeObj" ref="treeDataScope"
:props="props"> :default-checked-keys="dataScopeTreeObj"
:props="props"
>
</el-tree> </el-tree>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="接口权限"> <el-tab-pane label="接口权限">
<el-tree :data="apiScopeGrantList" <el-tree
show-checkbox :data="apiScopeGrantList"
node-key="id" show-checkbox
ref="treeApiScope" node-key="id"
:default-checked-keys="apiScopeTreeObj" ref="treeApiScope"
:props="props"> :default-checked-keys="apiScopeTreeObj"
:props="props"
>
</el-tree> </el-tree>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
<span slot="footer" <span slot="footer" class="dialog-footer">
class="dialog-footer">
<el-button @click="box = false"> </el-button> <el-button @click="box = false"> </el-button>
<el-button type="primary" <el-button type="primary" @click="submit"> </el-button>
@click="submit"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
</basic-container> </basic-container>
@ -99,353 +111,365 @@ import {
grant, grant,
grantTree, grantTree,
remove, remove,
update update,
} from "@/api/system/role"; } from "@/api/system/role";
import {mapGetters} from "vuex"; import { mapGetters } from "vuex";
import website from '@/config/website'; import website from "@/config/website";
import {validatenull} from "@/util/validate"; import { validatenull } from "@/util/validate";
export default { export default {
data() { data() {
return { return {
form: {}, form: {},
box: false, box: false,
props: { props: {
label: "title", label: "title",
value: "key" value: "key",
}, },
menuGrantList: [], menuGrantList: [],
dataScopeGrantList: [], dataScopeGrantList: [],
apiScopeGrantList: [], apiScopeGrantList: [],
apiGrantList: [], apiGrantList: [],
menuTreeObj: [], menuTreeObj: [],
dataScopeTreeObj: [], dataScopeTreeObj: [],
apiScopeTreeObj: [], apiScopeTreeObj: [],
selectionList: [], selectionList: [],
query: {}, query: {},
loading: true, loading: true,
page: { page: {
pageSize: 10, pageSize: 10,
currentPage: 1, currentPage: 1,
total: 0 total: 0,
}, },
option: { option: {
tip: false, height: "auto",
simplePage: true, calcHeight: 30,
searchShow: true, tip: false,
searchMenuSpan: 6, simplePage: true,
tree: true, searchShow: true,
border: true, searchMenuSpan: 6,
index: true, tree: true,
selection: true, border: true,
viewBtn: true, index: true,
labelWidth: 120, selection: true,
searchLabelWidth: 120, viewBtn: true,
menuWidth: 350, labelWidth: 120,
dialogWidth: 600, searchLabelWidth: 120,
dialogClickModal: false, menuWidth: 350,
column: [ dialogWidth: 600,
{ dialogClickModal: false,
label: "上级角色", column: [
prop: "parentId", {
dicData: [], label: "上级角色",
type: "tree", prop: "parentId",
hide: true, dicData: [],
span: 24, type: "tree",
props: { hide: true,
label: "title" span: 24,
}, props: {
rules: [ label: "title",
{
required: false,
message: "请选择上级角色",
trigger: "click"
}
]
},
{
label: "角色名称",
prop: "roleName",
search: true,
span: 24,
rules: [
{
required: true,
message: "请输入角色名称",
trigger: "blur"
}
]
}, },
{ rules: [
label: "所属租户", {
prop: "tenantId", required: false,
type: "tree", message: "请选择上级角色",
dicUrl: "/api/blade-system/tenant/select", trigger: "click",
addDisplay: false,
editDisplay: false,
viewDisplay: website.tenantMode,
span: 24,
props: {
label: "tenantName",
value: "tenantId"
}, },
hide: !website.tenantMode, ],
search: website.tenantMode, },
rules: [{ {
label: "角色名称",
prop: "roleName",
search: true,
span: 24,
rules: [
{
required: true, required: true,
message: "请输入所属租户", message: "请输入角色名称",
trigger: "click" trigger: "blur",
}] },
}, ],
{ },
label: "角色别名", {
labelTip: '用于权限校验与标注的属性,可手动录入也可点击现有别名快速录入', label: "所属租户",
prop: "roleAlias", prop: "tenantId",
search: true, type: "tree",
span: 24, dicUrl: "/api/blade-system/tenant/select",
rules: [ addDisplay: false,
{ editDisplay: false,
required: true, viewDisplay: website.tenantMode,
message: "请输入角色别名", span: 24,
trigger: "blur" props: {
} label: "tenantName",
] value: "tenantId",
}, },
{ hide: !website.tenantMode,
label: '现有别名', search: website.tenantMode,
labelTip: '当前系统已存在的角色别名,点击可快速录入', rules: [
prop: 'currentAlias', {
type: 'radio', required: true,
dicData: [], message: "请输入所属租户",
props: { trigger: "click",
label: 'roleName', },
value: 'roleAlias', ],
},
{
label: "角色别名",
labelTip:
"用于权限校验与标注的属性,可手动录入也可点击现有别名快速录入",
prop: "roleAlias",
search: true,
span: 24,
rules: [
{
required: true,
message: "请输入角色别名",
trigger: "blur",
}, },
hide: true, ],
span: 24, },
{
label: "现有别名",
labelTip: "当前系统已存在的角色别名,点击可快速录入",
prop: "currentAlias",
type: "radio",
dicData: [],
props: {
label: "roleName",
value: "roleAlias",
}, },
{ hide: true,
label: "角色排序", span: 24,
prop: "sort", },
type: "number", {
span: 24, label: "角色排序",
rules: [ prop: "sort",
{ type: "number",
required: true, span: 24,
message: "请输入角色排序", rules: [
trigger: "blur" {
} required: true,
] message: "请输入角色排序",
} trigger: "blur",
] },
}, ],
data: [] },
],
},
data: [],
};
},
computed: {
...mapGetters(["userInfo", "permission"]),
permissionList() {
return {
addBtn: this.vaildData(this.permission.role_add, false),
viewBtn: this.vaildData(this.permission.role_view, false),
delBtn: this.vaildData(this.permission.role_delete, false),
editBtn: this.vaildData(this.permission.role_edit, false),
}; };
}, },
computed: { ids() {
...mapGetters(["userInfo", "permission"]), let ids = [];
permissionList() { this.selectionList.forEach((ele) => {
return { ids.push(ele.id);
addBtn: this.vaildData(this.permission.role_add, false), });
viewBtn: this.vaildData(this.permission.role_view, false), return ids.join(",");
delBtn: this.vaildData(this.permission.role_delete, false), },
editBtn: this.vaildData(this.permission.role_edit, false) idsArray() {
}; let ids = [];
}, this.selectionList.forEach((ele) => {
ids() { ids.push(ele.id);
let ids = []; });
this.selectionList.forEach(ele => { return ids;
ids.push(ele.id); },
},
}); watch: {
return ids.join(","); "form.currentAlias"() {
}, const alias = this.form.currentAlias;
idsArray() { if (!validatenull(alias)) {
let ids = []; this.form.roleAlias = alias;
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
return ids;
} }
}, },
watch: { },
'form.currentAlias'() { methods: {
const alias = this.form.currentAlias; initData(roleId) {
if (!validatenull(alias)) { getRoleTreeById(roleId).then((res) => {
this.form.roleAlias = alias; const column = this.findObject(this.option.column, "parentId");
} column.dicData = res.data.data;
}, });
}, },
methods: { submit() {
initData(roleId){ const menuList = this.$refs.treeMenu.getCheckedKeys();
getRoleTreeById(roleId).then(res => { const dataScopeList = this.$refs.treeDataScope.getCheckedKeys();
const column = this.findObject(this.option.column, "parentId"); const apiScopeList = this.$refs.treeApiScope.getCheckedKeys();
column.dicData = res.data.data; grant(this.idsArray, menuList, dataScopeList, apiScopeList).then(() => {
this.box = false;
this.$message({
type: "success",
message: "操作成功!",
}); });
}, this.selectionList = [];
submit() { this.onLoad(this.page);
const menuList = this.$refs.treeMenu.getCheckedKeys(); });
const dataScopeList = this.$refs.treeDataScope.getCheckedKeys(); },
const apiScopeList = this.$refs.treeApiScope.getCheckedKeys(); rowSave(row, done, loading) {
grant(this.idsArray, menuList, dataScopeList, apiScopeList).then(() => { add(row).then(
this.box = false; () => {
this.$message({
type: "success",
message: "操作成功!"
});
this.selectionList = [];
this.onLoad(this.page);
});
},
rowSave(row, done, loading) {
add(row).then(() => {
this.onLoad(this.page); this.onLoad(this.page);
this.$message({ this.$message({
type: "success", type: "success",
message: "操作成功!" message: "操作成功!",
}); });
done(); done();
}, error => { },
(error) => {
window.console.log(error); window.console.log(error);
loading(); loading();
}); }
}, );
rowUpdate(row, index, done, loading) { },
update(row).then(() => { rowUpdate(row, index, done, loading) {
update(row).then(
() => {
this.onLoad(this.page); this.onLoad(this.page);
this.$message({ this.$message({
type: "success", type: "success",
message: "操作成功!" message: "操作成功!",
}); });
done(); done();
}, error => { },
(error) => {
window.console.log(error); window.console.log(error);
loading(); loading();
}); }
}, );
rowDel(row) { },
this.$confirm("确定将选择数据删除?", { rowDel(row) {
confirmButtonText: "确定", this.$confirm("确定将选择数据删除?", {
cancelButtonText: "取消", confirmButtonText: "确定",
type: "warning" cancelButtonText: "取消",
type: "warning",
})
.then(() => {
return remove(row.id);
}) })
.then(() => { .then(() => {
return remove(row.id); this.onLoad(this.page);
}) this.$message({
.then(() => { type: "success",
this.onLoad(this.page); message: "操作成功!",
this.$message({
type: "success",
message: "操作成功!"
});
}); });
}, });
},
searchReset() { searchReset() {
this.query = {}; this.query = {};
this.onLoad(this.page); this.onLoad(this.page);
}, },
searchChange(params, done) { searchChange(params, done) {
this.query = params; this.query = params;
this.page.currentPage = 1; this.page.currentPage = 1;
this.onLoad(this.page, params); this.onLoad(this.page, params);
done(); done();
}, },
selectionChange(list) { selectionChange(list) {
this.selectionList = list; this.selectionList = list;
}, },
selectionClear() { selectionClear() {
this.selectionList = []; this.selectionList = [];
this.$refs.crud.toggleSelection(); this.$refs.crud.toggleSelection();
}, },
beforeOpen(done, type) { beforeOpen(done, type) {
if (["add", "edit"].includes(type)) { if (["add", "edit"].includes(type)) {
this.initData(this.form.id); this.initData(this.form.id);
} }
getRoleAlias().then(res => { getRoleAlias().then((res) => {
const column = this.findObject(this.option.column, 'currentAlias'); const column = this.findObject(this.option.column, "currentAlias");
column.dicData = res.data.data; column.dicData = res.data.data;
});
done();
},
handleRole() {
if (this.selectionList.length !== 1) {
this.$message.warning("只能选择一条数据");
return;
}
this.menuTreeObj = [];
this.dataScopeTreeObj = [];
this.apiScopeTreeObj = [];
grantTree().then((res) => {
this.menuGrantList = res.data.data.menu;
this.dataScopeGrantList = res.data.data.dataScope;
this.apiScopeGrantList = res.data.data.apiScope;
getRole(this.ids).then((res) => {
this.menuTreeObj = res.data.data.menu;
this.dataScopeTreeObj = res.data.data.dataScope;
this.apiScopeTreeObj = res.data.data.apiScope;
this.box = true;
}); });
done(); });
}, },
handleRole() { handleRowRole(row) {
if (this.selectionList.length !== 1) { this.menuTreeObj = [];
this.$message.warning("只能选择一条数据"); this.dataScopeTreeObj = [];
return; this.apiScopeTreeObj = [];
} grantTree().then((res) => {
this.menuTreeObj = []; this.menuGrantList = res.data.data.menu;
this.dataScopeTreeObj = []; this.dataScopeGrantList = res.data.data.dataScope;
this.apiScopeTreeObj = []; this.apiScopeGrantList = res.data.data.apiScope;
grantTree() getRole(row.id).then((res) => {
.then(res => { this.menuTreeObj = res.data.data.menu;
this.menuGrantList = res.data.data.menu; this.dataScopeTreeObj = res.data.data.dataScope;
this.dataScopeGrantList = res.data.data.dataScope; this.apiScopeTreeObj = res.data.data.apiScope;
this.apiScopeGrantList = res.data.data.apiScope; this.selectionList.push(row);
getRole(this.ids).then(res => { this.box = true;
this.menuTreeObj = res.data.data.menu; });
this.dataScopeTreeObj = res.data.data.dataScope; });
this.apiScopeTreeObj = res.data.data.apiScope; },
this.box = true; handleDelete() {
}); if (this.selectionList.length === 0) {
}); this.$message.warning("请选择至少一条数据");
}, return;
handleRowRole(row) { }
this.menuTreeObj = []; this.$confirm("确定将选择数据删除?", {
this.dataScopeTreeObj = []; confirmButtonText: "确定",
this.apiScopeTreeObj = []; cancelButtonText: "取消",
grantTree() type: "warning",
.then(res => { })
this.menuGrantList = res.data.data.menu; .then(() => {
this.dataScopeGrantList = res.data.data.dataScope; return remove(this.ids);
this.apiScopeGrantList = res.data.data.apiScope;
getRole(row.id).then(res => {
this.menuTreeObj = res.data.data.menu;
this.dataScopeTreeObj = res.data.data.dataScope;
this.apiScopeTreeObj = res.data.data.apiScope;
this.selectionList.push(row);
this.box = true;
});
});
},
handleDelete() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
return;
}
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}) })
.then(() => { .then(() => {
return remove(this.ids); this.onLoad(this.page);
}) this.$message({
.then(() => { type: "success",
this.onLoad(this.page); message: "操作成功!",
this.$message({
type: "success",
message: "操作成功!"
});
this.$refs.crud.toggleSelection();
}); });
}, this.$refs.crud.toggleSelection();
currentChange(currentPage) {
this.page.currentPage = currentPage;
},
sizeChange(pageSize) {
this.page.pageSize = pageSize;
},
refreshChange() {
this.onLoad(this.page, this.query);
},
onLoad(page, params = {}) {
this.loading = true;
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
this.data = res.data.data;
this.loading = false;
this.selectionClear();
}); });
} },
} currentChange(currentPage) {
}; this.page.currentPage = currentPage;
},
sizeChange(pageSize) {
this.page.pageSize = pageSize;
},
refreshChange() {
this.onLoad(this.page, this.query);
},
onLoad(page, params = {}) {
this.loading = true;
getList(
page.currentPage,
page.pageSize,
Object.assign(params, this.query)
).then((res) => {
this.data = res.data.data;
this.loading = false;
this.selectionClear();
});
},
},
};
</script> </script>

@ -1,7 +1,7 @@
<template> <template>
<basic-container> <basic-container>
<el-row :gutter=24> <el-row :gutter=24>
<el-row :gutter=24> <el-row :gutter=24 v-if="this.permission.departmentSearch" >
<el-form ref="form" :model="form" label-width="80px"> <el-form ref="form" :model="form" label-width="80px">
<!-- <el-col :span="6"> <!-- <el-col :span="6">
<el-form-item label="日期"> <el-form-item label="日期">
@ -53,8 +53,11 @@
</template> </template>
<script> <script>
import * as echarts from "echarts"; import * as echarts from "echarts";
import {mapGetters} from "vuex";
export default { export default {
computed: {
...mapGetters(["userInfo", "permission"]),
},
data() { data() {
return { return {
options: [{ options: [{

@ -0,0 +1,197 @@
<template>
<div>
<basic-container>
<avue-crud :option="option" :table-loading="loading" :data="data" ref="crud" v-model="form" :page.sync="page"
:permission="permissionList" @row-del="rowDel" @search-change="searchChange" @search-reset="searchReset"
@selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
@refresh-change="refreshChange" @on-load="onLoad">
<template slot-scope="scope" slot="menu">
</template>
</avue-crud>
</basic-container>
</div>
</template>
<script>
import { getList, remove } from "@/api/report/report";
import { mapGetters } from "vuex";
export default {
data() {
return {
form: {},
selectionList: [],
query: {},
loading: true,
page: {
pageSize: 10,
currentPage: 1,
total: 0
},
option: {
height: 'auto',
calcHeight: 30,
tip: false,
searchShow: true,
searchMenuSpan: 6,
border: true,
index: true,
selection: true,
viewBtn: true,
dialogClickModal: false,
menu: false,
selection: false,
printBtn: false,
refreshBtn: false,
gridBtn: false,
gridBackgroundImage: false,
gridSpan: false,
filterBtn: false,
columnBtn: false,
column: [
{
label: "需求单号",
prop: "no",
search: true,
},
{
label: "需求时间",
prop: "name",
},
{
label: "物品名称",
prop: "number",
},
{
label: "型号",
prop: "number",
},
{
label: "数量",
prop: "number",
},
{
label: "金额",
prop: "pice",
}
]
},
data: [],
dialogLogVisible: false,
activeName: 'first',
tableData: [],
ckTable: [
{str1: '3', str2: '2025-04-09', str3: '部门一'},
{str1: '37', str2: '2025-04-03', str3: '部门一'}
],
rkTable: [
{str1: '5',str2: '2025-03-19',str3: '部门二'},
{str1: '12',str2: '2025-03-19',str3: '部门二'},
],
bfTable: [
{str1: '9',str2: '2025-03-19',str3: '部门三'},
{str1: '19',str2: '2025-03-19',str3: '部门三'},
],
};
},
computed: {
...mapGetters(["userInfo", "permission"]),
permissionList() {
return {
addBtn: false,
viewBtn: false,
delBtn: false,
editBtn: false
};
},
ids() {
let ids = [];
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
return ids.join(",");
}
},
mounted() {
this.tableData = this.ckTable
},
methods: {
handleLog() {
this.dialogLogVisible = true
},
handleTabClick(tab, event) {
console.log(tab, event);
if(this.activeName=='first'){
this.tableData = this.ckTable
}
if(this.activeName=='second'){
this.tableData = this.rkTable
}
if(this.activeName=='third'){
this.tableData = this.bfTable
}
},
searchReset() {
this.query = {};
this.onLoad(this.page);
},
searchChange(params, done) {
this.query = params;
this.page.currentPage = 1;
this.onLoad(this.page, params);
done();
},
selectionChange(list) {
this.selectionList = list;
},
selectionClear() {
this.selectionList = [];
this.$refs.crud.toggleSelection();
},
currentChange(currentPage) {
this.page.currentPage = currentPage;
},
sizeChange(pageSize) {
this.page.pageSize = pageSize;
},
refreshChange() {
this.onLoad(this.page, this.query);
},
onLoad(page, params = {}) {
this.loading = true;
this.data.push({
no: '00100001',
name: '物品1',
xh: '1',
lb: '易耗品',
unit: '11',
number: '1',
dj: '11',
pice: '11'
}, {
no: '00100002',
name: '物品2',
xh: '2',
lb: '耐用品',
unit: '22',
number: '2',
dj: '11',
pice: '22'
})
this.loading = false
// getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
// const data = res.data.data;
// this.page.total = data.total;
// this.data = data.records;
// this.loading = false;
// this.selectionClear();
// });
}
}
};
</script>
<style></style>

@ -93,20 +93,20 @@
:disabled="(scope.row.status != 1)||(allDisabled)" ></el-input-number> :disabled="(scope.row.status != 1)||(allDisabled)" ></el-input-number>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="str6" label="需求数量" > <!-- <el-table-column prop="str6" label="需求数量" >
</el-table-column> </el-table-column> -->
<el-table-column prop="str8" label="单价" > <el-table-column prop="str8" label="单价" >
</el-table-column> </el-table-column>
<!-- <el-table-column prop="str9" label="需求部门" width="100"> <!-- <el-table-column prop="str9" label="需求部门" width="100">
</el-table-column> --> </el-table-column> -->
<el-table-column prop="status" label="入库情况" v-if="!allDisabled"> <!-- <el-table-column prop="status" label="入库情况" v-if="!allDisabled">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="putIn(scope.row)" v-if="scope.row.status == 1">入库</el-button> <el-button type="text" @click="putIn(scope.row)" v-if="scope.row.status == 1">入库</el-button>
<span v-else>已入库</span> <span v-else>已入库</span>
</template> </template>
</el-table-column> </el-table-column> -->
</el-table> </el-table>
<div class="form-title">入库账目表格</div> <div class="form-title">入库账目表格</div>
<el-table :data="sizeForm.inAccountsTableData" border style="width: 100%"> <el-table :data="sizeForm.inAccountsTableData" border style="width: 100%">

@ -108,12 +108,12 @@
<el-table-column prop="str8" label="单价" width="100"> <el-table-column prop="str8" label="单价" width="100">
</el-table-column> </el-table-column>
<el-table-column prop="status" label="出库情况"> <!-- <el-table-column prop="status" label="出库情况">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="putIn(scope.row)" v-if="scope.row.status == 1">出库</el-button> <el-button type="text" @click="putIn(scope.row)" v-if="scope.row.status == 1">出库</el-button>
<span v-if="scope.row.status == 0">已出库</span> <span v-if="scope.row.status == 0">已出库</span>
</template> </template>
</el-table-column> </el-table-column> -->
</el-table> </el-table>
<div class="form-title">出库账目表格</div> <div class="form-title">出库账目表格</div>
<el-table :data="sizeForm.inAccountsTableData" border style="width: 100%"> <el-table :data="sizeForm.inAccountsTableData" border style="width: 100%">

@ -17,7 +17,7 @@
<el-tabs v-model="activeName" @tab-click="handleTabClick"> <el-tabs v-model="activeName" @tab-click="handleTabClick">
<el-tab-pane label="入库" name="first"></el-tab-pane> <el-tab-pane label="入库" name="first"></el-tab-pane>
<el-tab-pane label="出库" name="second"></el-tab-pane> <el-tab-pane label="出库" name="second"></el-tab-pane>
<el-tab-pane label="报废" name="third"></el-tab-pane> <!-- <el-tab-pane label="报废" name="third"></el-tab-pane> -->
</el-tabs> </el-tabs>
<el-table :data="tableData" style="width: 100%"> <el-table :data="tableData" style="width: 100%">
<el-table-column type="index" width="50"> <el-table-column type="index" width="50">
@ -39,7 +39,9 @@
</template> </template>
<script> <script>
import { getList, remove } from "@/api/report/report"; // import { getList, remove } from "@/api/report/report";
import { getList } from "@/api/firstOrder/list";
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
export default { export default {
@ -77,28 +79,28 @@ export default {
column: [ column: [
{ {
label: "存货编号", label: "存货编号",
prop: "no", prop: "stockCode",
}, },
{ {
label: "存货名称", label: "存货名称",
prop: "name", prop: "stockName",
search: true, search: true,
}, },
{ {
label: "规格型号", label: "规格型号",
prop: "xh", prop: "model",
}, },
{ {
label: "类别", label: "类别",
prop: "lb", prop: "materialType",
search: true, search: true,
type: 'select', type: 'select',
dicData: [{ dicData: [{
label: '易耗品', label: '易耗品',
value: 0 value: 1
}, { }, {
label: '耐用品', label: '耐用品',
value: 1 value: 2
}] }]
}, },
{ {
@ -107,15 +109,15 @@ export default {
}, },
{ {
label: "数量", label: "数量",
prop: "number", prop: "num",
}, },
{ {
label: "单价", label: "单价",
prop: "dj", prop: "unitPrice",
}, },
{ {
label: "金额", label: "金额",
prop: "pice", prop: "amount",
} }
] ]
}, },
@ -205,33 +207,34 @@ export default {
}, },
onLoad(page, params = {}) { onLoad(page, params = {}) {
this.loading = true; this.loading = true;
this.data.push({ // this.data.push({
no: '00100001', // no: '00100001',
name: '物品1', // name: '1',
xh: '1', // xh: '1',
lb: '易耗品', // lb: '',
unit: '11', // unit: '11',
number: '1', // number: '1',
dj: '11', // dj: '11',
pice: '11' // pice: '11'
}, { // }, {
no: '00100002', // no: '00100002',
name: '物品2', // name: '2',
xh: '2', // xh: '2',
lb: '耐用品', // lb: '',
unit: '22', // unit: '22',
number: '2', // number: '2',
dj: '11', // dj: '11',
pice: '22' // pice: '22'
}) // })
this.loading = false this.loading = false
// getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
// const data = res.data.data; console.log(898989,res.data.result)
// this.page.total = data.total; // const data = res.data.data;
// this.data = data.records; this.data = res.data.result.list;
// this.loading = false; this.loading = false;
// this.selectionClear(); this.page.total = res.data.result.total;
// }); // this.selectionClear();
});
} }
} }
}; };

@ -1,26 +1,63 @@
<template> <template>
<div> <div>
<basic-container> <basic-container>
<avue-crud :option="option" :table-loading="loading" :data="data" ref="crud" v-model="form" :page.sync="page" <avue-crud
:permission="permissionList" @row-del="rowDel" @search-change="searchChange" @search-reset="searchReset" :option="option"
@selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange" :table-loading="loading"
@refresh-change="refreshChange" @on-load="onLoad"> :data="data"
<template slot-scope="scope" slot="menu"> ref="crud"
<el-button v-if="scope.row.status=='未归还'" type="text" size="small" @click.stop="handleReturn(scope.row)">归还 v-model="form"
</el-button> :page.sync="page"
</template> :permission="permissionList"
@row-del="rowDel"
</avue-crud> @search-change="searchChange"
</basic-container> @search-reset="searchReset"
@selection-change="selectionChange"
@current-change="currentChange"
@size-change="sizeChange"
@refresh-change="refreshChange"
@on-load="onLoad"
>
<template slot-scope="scope" slot="menu">
<el-button
v-if="scope.row.status == '未归还'"
type="text"
size="small"
@click.stop="handleReturn(scope.row)"
>归还
</el-button>
<el-button
type="text"
size="small"
@click.stop="handleScrap(scope.row)"
v-if="scope.row.status == '未归还'"
>报废
</el-button>
</template>
</avue-crud>
</basic-container>
<!-- 归还 --> <!-- 归还 -->
<el-dialog title="归还" :visible.sync="dialogReturnVisible" width="30%" :close-on-click-modal="false" <el-dialog
:append-to-body="true"> title="归还"
:visible.sync="dialogReturnVisible"
width="30%"
:close-on-click-modal="false"
:append-to-body="true"
>
<el-form ref="form" :model="returnForm" label-width="100px"> <el-form ref="form" :model="returnForm" label-width="100px">
<el-form-item label="归还数量"> <el-form-item label="归还数量">
<el-input-number v-model="returnForm.count" :min="1"></el-input-number> <el-input-number
v-model="returnForm.count"
:min="1"
></el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="归还理由"> <el-form-item label="归还理由">
<el-input v-model="returnForm.rmark" type="textarea" :rows="3" placeholder="请输入内容"></el-input> <el-input
v-model="returnForm.rmark"
type="textarea"
:rows="3"
placeholder="请输入内容"
></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
@ -43,10 +80,10 @@ export default {
page: { page: {
pageSize: 10, pageSize: 10,
currentPage: 1, currentPage: 1,
total: 0 total: 0,
}, },
option: { option: {
height: 'auto', height: "auto",
calcHeight: 30, calcHeight: 30,
tip: false, tip: false,
searchShow: true, searchShow: true,
@ -74,14 +111,17 @@ export default {
label: "部门", label: "部门",
prop: "str8", prop: "str8",
search: true, search: true,
type: 'select', type: "select",
dicData: [{ dicData: [
label: '部门一', {
value: 0 label: "部门一",
}, { value: 0,
label: '部门二', },
value: 1 {
}] label: "部门二",
value: 1,
},
],
}, },
{ {
label: "名称", label: "名称",
@ -111,43 +151,45 @@ export default {
{ {
label: "金额", label: "金额",
prop: "pice", prop: "pice",
},{ },
{
label: "状态", label: "状态",
prop: "status", prop: "status",
},{ },
{
label: "归还时间", label: "归还时间",
prop: "time", prop: "time",
} },
] ],
}, },
data: [], data: [],
dialogReturnVisible: false, dialogReturnVisible: false,
returnInfo: {}, returnInfo: {},
returnForm: { returnForm: {
count: 0, count: 0,
rmark: '', rmark: "",
}, },
dialogScrapVisible:false, dialogScrapVisible: false,
scrapInfo: {}, scrapInfo: {},
scrapForm: { scrapForm: {
count: 0, count: 0,
rmark: '', rmark: "",
}, },
dialogLogVisible: false, dialogLogVisible: false,
activeName: 'first', activeName: "first",
tableData: [], tableData: [],
ckTable: [ ckTable: [
{str1: '3', str2: '2025-04-09', str3: '部门一'}, { str1: "3", str2: "2025-04-09", str3: "部门一" },
{str1: '37', str2: '2025-04-03', str3: '部门一'} { str1: "37", str2: "2025-04-03", str3: "部门一" },
], ],
rkTable: [ rkTable: [
{str1: '5',str2: '2025-03-19',str3: '部门二'}, { str1: "5", str2: "2025-03-19", str3: "部门二" },
{str1: '12',str2: '2025-03-19',str3: '部门二'}, { str1: "12", str2: "2025-03-19", str3: "部门二" },
], ],
bfTable: [ bfTable: [
{str1: '9',str2: '2025-03-19',str3: '部门三'}, { str1: "9", str2: "2025-03-19", str3: "部门三" },
{str1: '19',str2: '2025-03-19',str3: '部门三'}, { str1: "19", str2: "2025-03-19", str3: "部门三" },
], ],
}; };
}, },
@ -158,43 +200,46 @@ export default {
addBtn: false, addBtn: false,
viewBtn: false, viewBtn: false,
delBtn: false, delBtn: false,
editBtn: false editBtn: false,
}; };
}, },
ids() { ids() {
let ids = []; let ids = [];
this.selectionList.forEach(ele => { this.selectionList.forEach((ele) => {
ids.push(ele.id); ids.push(ele.id);
}); });
return ids.join(","); return ids.join(",");
} },
}, },
mounted() { mounted() {
this.tableData = this.ckTable this.tableData = this.ckTable;
}, },
methods: { methods: {
handleLog() { handleLog() {
this.dialogLogVisible = true this.dialogLogVisible = true;
}, },
handleTabClick(tab, event) { handleTabClick(tab, event) {
console.log(tab, event); console.log(tab, event);
if(this.activeName=='first'){ if (this.activeName == "first") {
this.tableData = this.ckTable this.tableData = this.ckTable;
} }
if(this.activeName=='second'){ if (this.activeName == "second") {
this.tableData = this.rkTable this.tableData = this.rkTable;
} }
if(this.activeName=='third'){ if (this.activeName == "third") {
this.tableData = this.bfTable this.tableData = this.bfTable;
} }
}, },
handlePreview(name) { handlePreview(name) {
this.$router.push({ path: `/myiframe/urlPath?name=preview-${name}&src=${this.website.design.reportUrl}/preview?_u=blade-${name}` }); this.$router.push({
path: `/myiframe/urlPath?name=preview-${name}&src=${this.website.design.reportUrl}/preview?_u=blade-${name}`,
});
}, },
handleDesign(name) { handleDesign(name) {
this.$router.push({ path: `/myiframe/urlPath?name=designer-${name}&src=${this.website.design.reportUrl}/designer?_u=blade-${name}` }); this.$router.push({
path: `/myiframe/urlPath?name=designer-${name}&src=${this.website.design.reportUrl}/designer?_u=blade-${name}`,
});
}, },
searchReset() { searchReset() {
@ -226,57 +271,59 @@ export default {
}, },
onLoad(page, params = {}) { onLoad(page, params = {}) {
this.loading = true; this.loading = true;
this.data.push({ this.data.push(
no: '00100001', {
name: '物品1', no: "00100001",
xh: '1', name: "物品1",
lb: '耐用品', xh: "1",
unit: '11', lb: "耐用品",
number: '1', unit: "11",
dj: '11', number: "1",
pice: '11', dj: "11",
status:'未归还', pice: "11",
str8:'部门一' status: "未归还",
}, { str8: "部门一",
no: '00100002', },
name: '物品2', {
xh: '2', no: "00100002",
lb: '耐用品', name: "物品2",
unit: '22', xh: "2",
number: '1', lb: "耐用品",
dj: '11', unit: "22",
pice: '22', number: "1",
status:'已归还', dj: "11",
time:'2024-01-04', pice: "22",
str8:'部门二' status: "已归还",
}) time: "2024-01-04",
this.loading = false str8: "部门二",
}
);
this.loading = false;
}, },
// //
handleReturn(row) { handleReturn(row) {
this.dialogReturnVisible = true this.dialogReturnVisible = true;
this.returnInfo = JSON.parse(JSON.stringify(row)) this.returnInfo = JSON.parse(JSON.stringify(row));
}, },
returnSave() { returnSave() {
this.dialogReturnVisible = false this.dialogReturnVisible = false;
this.$message({ this.$message({
type: "success", type: "success",
message: "归还成功" message: "归还成功",
}); });
}, },
// //
handleScrap(row){ handleScrap(row) {
this.dialogScrapVisible = true this.dialogScrapVisible = true;
this.scrapInfo = JSON.parse(JSON.stringify(row)) this.scrapInfo = JSON.parse(JSON.stringify(row));
}, },
scrapSave(){ scrapSave() {
this.dialogScrapVisible = false this.dialogScrapVisible = false;
this.$message({ this.$message({
type: "success", type: "success",
message: "报废成功" message: "报废成功",
}); });
} },
} },
}; };
</script> </script>

@ -57,12 +57,12 @@ export default {
prop: "name", prop: "name",
search: true, search: true,
}, },
// {
// label: "",
// prop: "ge",
// },
{ {
label: "规格", label: "规格/型号",
prop: "ge",
},
{
label: "型号",
prop: "xh", prop: "xh",
}, },
{ {

@ -130,7 +130,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="str8" label="单价" width="100"> </el-table-column> <el-table-column prop="str8" label="单价" width="100"> </el-table-column>
<el-table-column prop="str9" label="需求部门" width="100"> </el-table-column> <el-table-column prop="str9" label="需求部门" width="100"> </el-table-column>
<el-table-column prop="status" label="入库情况"> <!-- <el-table-column prop="status" label="入库情况">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
type="text" type="text"
@ -140,7 +140,7 @@
> >
<span v-else>已入库</span> <span v-else>已入库</span>
</template> </template>
</el-table-column> </el-table-column>-->
</el-table> </el-table>
<div class="form-title">入库账目表格</div> <div class="form-title">入库账目表格</div>
<el-table :data="sizeForm.inAccountsTableData" border style="width: 100%"> <el-table :data="sizeForm.inAccountsTableData" border style="width: 100%">

@ -147,7 +147,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="str8" label="单价" width="100"> </el-table-column> <el-table-column prop="str8" label="单价" width="100"> </el-table-column>
<el-table-column prop="status" label="出库情况"> <!-- <el-table-column prop="status" label="出库情况">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
type="text" type="text"
@ -157,7 +157,7 @@
> >
<span v-if="scope.row.status == 0">已出库</span> <span v-if="scope.row.status == 0">已出库</span>
</template> </template>
</el-table-column> </el-table-column> -->
</el-table> </el-table>
<div class="form-title">出库账目表格</div> <div class="form-title">出库账目表格</div>
<el-table :data="sizeForm.inAccountsTableData" border style="width: 100%"> <el-table :data="sizeForm.inAccountsTableData" border style="width: 100%">

@ -8,8 +8,7 @@
<template slot-scope="scope" slot="menu"> <template slot-scope="scope" slot="menu">
<!-- <el-button type="text" size="small" @click.stop="handleReturn(scope.row)">归还 <!-- <el-button type="text" size="small" @click.stop="handleReturn(scope.row)">归还
</el-button> --> </el-button> -->
<el-button type="text" size="small" @click.stop="handleScrap(scope.row)">报废
</el-button>
<el-button type="text" size="small" @click.stop="handleLog(scope.row)">记录 <el-button type="text" size="small" @click.stop="handleLog(scope.row)">记录
</el-button> </el-button>

@ -69,6 +69,7 @@
total: 0, total: 0,
}, },
option: { option: {
height: "auto",
lazy: true, lazy: true,
tip: false, tip: false,
simplePage: true, simplePage: true,

@ -34,6 +34,17 @@ module.exports = {
pathRewrite: { pathRewrite: {
'^/api': '/' '^/api': '/'
} }
},
'/smartpark': {
//本地服务接口地址
// target: 'http://192.168.1.4:8088',
target: 'http://192.168.0.120:8081',
//远程演示服务地址,可用于直接启动项目
// target: 'https://saber.bladex.cn/api',
ws: true,
pathRewrite: {
'^/smartpark/': '/'
}
} }
} }
} }

Loading…
Cancel
Save