代码提交

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

@ -8,45 +8,19 @@
<div class="login-time">
{{time}}
</div>
<p class="title">{{ $t('login.info') }}</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="">-->
<p class="title">低值耐用品信息化平台</p>
</div>
<div class="login-border">
<div class="login-main">
<h4 class="login-title">
{{ $t('login.title') }}{{website.title}}
{{ $t('login.title') }}
<!-- <top-lang></top-lang> -->
</h4>
<userLogin v-if="activeName==='user'"></userLogin>
<codeLogin v-else-if="activeName==='code'"></codeLogin>
<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>

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

@ -47,7 +47,14 @@ axios.interceptors.request.use(config => {
isErrorShown = false;
//地址为已经配置状态则不添加前缀
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
config.headers['Blade-Requested-With'] = 'BladeHttpRequest';
@ -95,6 +102,7 @@ axios.interceptors.request.use(config => {
//http response拦截
axios.interceptors.response.use(res => {
// console.log('响应拦截',res)
//关闭 progress bar
NProgress.done();
//获取配置信息

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

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

@ -1,7 +1,7 @@
<template>
<basic-container>
<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-col :span="6">
<el-form-item label="日期">
@ -53,8 +53,11 @@
</template>
<script>
import * as echarts from "echarts";
import {mapGetters} from "vuex";
export default {
computed: {
...mapGetters(["userInfo", "permission"]),
},
data() {
return {
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>
</template>
</el-table-column>
<el-table-column prop="str6" label="需求数量" >
</el-table-column>
<!-- <el-table-column prop="str6" label="需求数量" >
</el-table-column> -->
<el-table-column prop="str8" label="单价" >
</el-table-column>
<!-- <el-table-column prop="str9" label="需求部门" width="100">
</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">
<el-button type="text" @click="putIn(scope.row)" v-if="scope.row.status == 1">入库</el-button>
<span v-else>已入库</span>
</template>
</el-table-column>
</el-table-column> -->
</el-table>
<div class="form-title">入库账目表格</div>
<el-table :data="sizeForm.inAccountsTableData" border style="width: 100%">

@ -108,12 +108,12 @@
<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">
<el-button type="text" @click="putIn(scope.row)" v-if="scope.row.status == 1">出库</el-button>
<span v-if="scope.row.status == 0">已出库</span>
</template>
</el-table-column>
</el-table-column> -->
</el-table>
<div class="form-title">出库账目表格</div>
<el-table :data="sizeForm.inAccountsTableData" border style="width: 100%">

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

@ -1,26 +1,63 @@
<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">
<el-button v-if="scope.row.status=='未归还'" type="text" size="small" @click.stop="handleReturn(scope.row)">归还
</el-button>
</template>
</avue-crud>
</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">
<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"
:append-to-body="true">
<el-dialog
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-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 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>
<span slot="footer" class="dialog-footer">
@ -43,10 +80,10 @@ export default {
page: {
pageSize: 10,
currentPage: 1,
total: 0
total: 0,
},
option: {
height: 'auto',
height: "auto",
calcHeight: 30,
tip: false,
searchShow: true,
@ -74,14 +111,17 @@ export default {
label: "部门",
prop: "str8",
search: true,
type: 'select',
dicData: [{
label: '部门一',
value: 0
}, {
label: '部门二',
value: 1
}]
type: "select",
dicData: [
{
label: "部门一",
value: 0,
},
{
label: "部门二",
value: 1,
},
],
},
{
label: "名称",
@ -111,43 +151,45 @@ export default {
{
label: "金额",
prop: "pice",
},{
},
{
label: "状态",
prop: "status",
},{
},
{
label: "归还时间",
prop: "time",
}
]
},
],
},
data: [],
dialogReturnVisible: false,
returnInfo: {},
returnForm: {
count: 0,
rmark: '',
rmark: "",
},
dialogScrapVisible:false,
dialogScrapVisible: false,
scrapInfo: {},
scrapForm: {
count: 0,
rmark: '',
rmark: "",
},
dialogLogVisible: false,
activeName: 'first',
activeName: "first",
tableData: [],
ckTable: [
{str1: '3', str2: '2025-04-09', str3: '部门一'},
{str1: '37', str2: '2025-04-03', str3: '部门一'}
{ 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: '部门二'},
{ 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: '部门三'},
{ str1: "9", str2: "2025-03-19", str3: "部门三" },
{ str1: "19", str2: "2025-03-19", str3: "部门三" },
],
};
},
@ -158,43 +200,46 @@ export default {
addBtn: false,
viewBtn: false,
delBtn: false,
editBtn: false
editBtn: false,
};
},
ids() {
let ids = [];
this.selectionList.forEach(ele => {
this.selectionList.forEach((ele) => {
ids.push(ele.id);
});
return ids.join(",");
}
},
},
mounted() {
this.tableData = this.ckTable
this.tableData = this.ckTable;
},
methods: {
handleLog() {
this.dialogLogVisible = true
this.dialogLogVisible = true;
},
handleTabClick(tab, event) {
console.log(tab, event);
if(this.activeName=='first'){
this.tableData = this.ckTable
if (this.activeName == "first") {
this.tableData = this.ckTable;
}
if(this.activeName=='second'){
this.tableData = this.rkTable
if (this.activeName == "second") {
this.tableData = this.rkTable;
}
if(this.activeName=='third'){
this.tableData = this.bfTable
if (this.activeName == "third") {
this.tableData = this.bfTable;
}
},
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) {
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() {
@ -226,57 +271,59 @@ export default {
},
onLoad(page, params = {}) {
this.loading = true;
this.data.push({
no: '00100001',
name: '物品1',
xh: '1',
lb: '耐用品',
unit: '11',
number: '1',
dj: '11',
pice: '11',
status:'未归还',
str8:'部门一'
}, {
no: '00100002',
name: '物品2',
xh: '2',
lb: '耐用品',
unit: '22',
number: '1',
dj: '11',
pice: '22',
status:'已归还',
time:'2024-01-04',
str8:'部门二'
})
this.loading = false
this.data.push(
{
no: "00100001",
name: "物品1",
xh: "1",
lb: "耐用品",
unit: "11",
number: "1",
dj: "11",
pice: "11",
status: "未归还",
str8: "部门一",
},
{
no: "00100002",
name: "物品2",
xh: "2",
lb: "耐用品",
unit: "22",
number: "1",
dj: "11",
pice: "22",
status: "已归还",
time: "2024-01-04",
str8: "部门二",
}
);
this.loading = false;
},
//
handleReturn(row) {
this.dialogReturnVisible = true
this.returnInfo = JSON.parse(JSON.stringify(row))
this.dialogReturnVisible = true;
this.returnInfo = JSON.parse(JSON.stringify(row));
},
returnSave() {
this.dialogReturnVisible = false
this.dialogReturnVisible = false;
this.$message({
type: "success",
message: "归还成功"
message: "归还成功",
});
},
//
handleScrap(row){
this.dialogScrapVisible = true
this.scrapInfo = JSON.parse(JSON.stringify(row))
handleScrap(row) {
this.dialogScrapVisible = true;
this.scrapInfo = JSON.parse(JSON.stringify(row));
},
scrapSave(){
this.dialogScrapVisible = false
scrapSave() {
this.dialogScrapVisible = false;
this.$message({
type: "success",
message: "报废成功"
message: "报废成功",
});
}
}
},
},
};
</script>

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

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

@ -147,7 +147,7 @@
</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">
<el-button
type="text"
@ -157,7 +157,7 @@
>
<span v-if="scope.row.status == 0">已出库</span>
</template>
</el-table-column>
</el-table-column> -->
</el-table>
<div class="form-title">出库账目表格</div>
<el-table :data="sizeForm.inAccountsTableData" border style="width: 100%">

@ -8,8 +8,7 @@
<template slot-scope="scope" slot="menu">
<!-- <el-button type="text" size="small" @click.stop="handleReturn(scope.row)">归还
</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>

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

@ -34,6 +34,17 @@ module.exports = {
pathRewrite: {
'^/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