页面优化

This commit is contained in:
BianLzhaoMin 2024-05-06 15:21:37 +08:00
parent 3501c258f7
commit 83f78e85c8
5 changed files with 1040 additions and 1076 deletions

View File

@ -306,222 +306,221 @@
</template>
<script>
import {
listType,
getType,
delType,
addType,
updateType,
refreshCache,
} from '@/api/system/dict/type'
import {
getLeaseAuditListAll,
getUnitData,
getProData,
deleteTask,
} from '@/api/claimAndRefund/receive'
import {
listType,
getType,
delType,
addType,
updateType,
refreshCache,
} from '@/api/system/dict/type'
import {
getLeaseAuditListAll,
getUnitData,
getProData,
deleteTask,
} from '@/api/claimAndRefund/receive'
export default {
// name: "ReceiveApply",
dicts: ['sys_normal_disable'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
leaseAuditList: [],
//
dateRange: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
dictName: undefined,
dictType: undefined,
status: undefined,
export default {
// name: "ReceiveApply",
dicts: ['sys_normal_disable'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
leaseAuditList: [],
//
dateRange: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
dictName: undefined,
dictType: undefined,
status: undefined,
time: null, //
unitId: null, //id
proId: null, //id
time: null, //
unitId: null, //id
proId: null, //id
types: 1, // 1 2
keyWord: '',
},
unitList: [], //
proList: [], //
types: 1, // 1 2
keyWord: '',
},
unitList: [], //
proList: [], //
}
},
created() {
this.getList()
this.GetUnitData()
this.GetProData()
},
methods: {
//
async getList() {
this.loading = true
const params = {
unitId: this.queryParams.unitId,
projectId: this.queryParams.proId,
keyWord: this.queryParams.keyWord,
startTime: this.queryParams.time && this.queryParams.time[0],
endTime: this.queryParams.time && this.queryParams.time[1],
types: this.queryParams.types,
souceBy: 0,
pageSize: this.queryParams.pageSize,
pageNum: this.queryParams.pageNum,
}
const res = await getLeaseAuditListAll(params)
this.loading = false
this.leaseAuditList = res.data.rows
this.total = res.data.total
},
created() {
//
async GetUnitData() {
const params = {
id: this.queryParams.proId,
}
const res = await getUnitData(params)
this.unitList = res.data
console.log('GetUnitData ======================', res)
},
//
async GetProData() {
const params = {
id: this.queryParams.unitId,
}
const res = await getProData(params)
this.proList = res.data
console.log('GetProData ======================', res)
},
//
reset() {
this.form = {
dictId: undefined,
dictName: undefined,
dictType: undefined,
status: '0',
remark: undefined,
}
this.resetForm('form')
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams.time = []
this.queryParams.unitId = ''
this.queryParams.proId = ''
this.resetForm('queryForm')
this.GetUnitData()
this.GetProData()
this.handleQuery()
},
methods: {
//
async getList() {
this.loading = true
const params = {
unitId: this.queryParams.unitId,
projectId: this.queryParams.proId,
keyWord: this.queryParams.keyWord,
startTime:
this.queryParams.time && this.queryParams.time[0],
endTime: this.queryParams.time && this.queryParams.time[1],
types: this.queryParams.types,
souceBy: 0,
pageSize: this.queryParams.pageSize,
pageNum: this.queryParams.pageNum,
}
const res = await getLeaseAuditListAll(params)
this.loading = false
this.leaseAuditList = res.data.rows
this.total = res.data.total
},
//
async GetUnitData() {
const params = {
id: this.queryParams.proId,
}
const res = await getUnitData(params)
this.unitList = res.data
console.log('GetUnitData ======================', res)
},
//
async GetProData() {
const params = {
id: this.queryParams.unitId,
}
const res = await getProData(params)
this.proList = res.data
console.log('GetProData ======================', res)
},
//
reset() {
this.form = {
dictId: undefined,
dictName: undefined,
dictType: undefined,
status: '0',
remark: undefined,
}
this.resetForm('form')
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams.time = []
this.queryParams.unitId = ''
this.queryParams.proId = ''
this.resetForm('queryForm')
this.GetUnitData()
this.GetProData()
this.handleQuery()
},
/** 新增按钮操作 */
handleAdd() {
this.$tab.closeOpenPage({
path: '/claimAndRefund/receive/receiveApplyAdd',
query: {
isEdit: true,
},
})
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.dictId)
this.single = selection.length != 1
this.multiple = !selection.length
},
handleView(row) {
this.$tab.closeOpenPage({
path: '/claimAndRefund/receive/receiveApplyAdd',
query: {
taskId: row.taskId,
isEdit: false,
},
})
},
/** 修改按钮操作 */
handleUpdate(row) {
this.$tab.closeOpenPage({
path: '/claimAndRefund/receive/receiveApplyAdd',
query: {
taskId: row.taskId,
isEdit: true,
},
})
},
/** 驳回按钮操作 */
handleUpdate2(row) {
this.$tab.closeOpenPage({
path: '/claimAndRefund/receive/receiveApplyAdd',
query: {
taskId: row.taskId,
isEdit: true,
isBack: true,
},
})
},
/** 删除按钮操作 */
async handleDelete(row) {
this.$confirm('此操作将永久删除该领料任务, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(async () => {
const res = await deleteTask(row.taskId)
if (res.code == 200) {
this.$message({
type: 'success',
message: '删除成功',
})
this.getList()
}
})
},
/** 导出按钮操作 */
handleExport() {
this.download(
'base/tm_task/applyExport',
{
...this.queryParams,
},
`领料申请单_${new Date().getTime()}.xlsx`,
)
},
/** 刷新缓存按钮操作 */
handleRefreshCache() {
refreshCache().then(() => {
this.$modal.msgSuccess('刷新成功')
this.$store.dispatch('dict/cleanDict')
})
},
/** 新增按钮操作 */
handleAdd() {
this.$tab.closeOpenPage({
path: '/claimAndRefund/receive/receiveApplyAdd',
query: {
isEdit: true,
},
})
},
}
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.dictId)
this.single = selection.length != 1
this.multiple = !selection.length
},
handleView(row) {
this.$tab.closeOpenPage({
path: '/claimAndRefund/receive/receiveApplyAdd',
query: {
taskId: row.taskId,
isEdit: false,
},
})
},
/** 修改按钮操作 */
handleUpdate(row) {
this.$tab.closeOpenPage({
path: '/claimAndRefund/receive/receiveApplyAdd',
query: {
taskId: row.taskId,
isEdit: true,
},
})
},
/** 驳回按钮操作 */
handleUpdate2(row) {
this.$tab.closeOpenPage({
path: '/claimAndRefund/receive/receiveApplyAdd',
query: {
taskId: row.taskId,
isEdit: true,
isBack: true,
},
})
},
/** 删除按钮操作 */
async handleDelete(row) {
this.$confirm('此操作将永久删除该领料任务, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(async () => {
const res = await deleteTask(row.taskId)
if (res.code == 200) {
this.$message({
type: 'success',
message: '删除成功',
})
this.getList()
}
})
},
/** 导出按钮操作 */
handleExport() {
this.download(
'base/tm_task/applyExport',
{
...this.queryParams,
},
`领料申请单_${new Date().getTime()}.xlsx`,
)
},
/** 刷新缓存按钮操作 */
handleRefreshCache() {
refreshCache().then(() => {
this.$modal.msgSuccess('刷新成功')
this.$store.dispatch('dict/cleanDict')
})
},
},
}
</script>
<style lang="scss" scoped>
::v-deep.el-table .fixed-width .el-button--mini {
width: 60px !important;
margin-bottom: 10px;
}
::v-deep.el-table .fixed-width .el-button--mini {
width: 60px !important;
margin-bottom: 10px;
}
</style>

View File

@ -434,358 +434,354 @@
</template>
<script>
import {
listType,
getType,
delType,
addType,
updateType,
refreshCache,
} from '@/api/system/dict/type'
import {
getLeaseManageListAll,
getUnitData,
getProData,
getLeaseListAll,
} from '@/api/claimAndRefund/receive'
import { getInfo } from '@/api/login'
import vueEasyPrint from 'vue-easy-print'
export default {
// name: "ReceiveManage",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
typeList: [],
//
title: '',
//
open: false,
//
dateRange: [],
//
queryParams: {
time: [],
unitId: null,
proId: null,
keyword: '',
types: 2,
import {
listType,
getType,
delType,
addType,
updateType,
refreshCache,
} from '@/api/system/dict/type'
import {
getLeaseManageListAll,
getUnitData,
getProData,
getLeaseListAll,
} from '@/api/claimAndRefund/receive'
import { getInfo } from '@/api/login'
import vueEasyPrint from 'vue-easy-print'
export default {
// name: "ReceiveManage",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
typeList: [],
//
title: '',
//
open: false,
//
dateRange: [],
//
queryParams: {
time: [],
unitId: null,
proId: null,
keyword: '',
types: 2,
pageNum: 1,
pageSize: 10,
dictName: undefined,
dictType: undefined,
status: undefined,
},
user: {},
unitList: [],
proList: [],
leaseAuditList: [],
showJJExamineBtn: false, //-
showSBExamineBtn: false, //-
//
form: {},
//
rules: {
dictName: [
{
required: true,
message: '字典名称不能为空',
trigger: 'blur',
},
],
dictType: [
{
required: true,
message: '字典类型不能为空',
trigger: 'blur',
},
],
},
peopleOpen: false,
noticeOpen: false,
nform: {
notice: '',
},
nrules: {
notice: [
{
required: true,
message: '通知内容不能为空',
trigger: 'blur',
},
],
},
deptName: undefined,
pageNum: 1,
pageSize: 10,
dictName: undefined,
dictType: undefined,
status: undefined,
},
user: {},
unitList: [],
proList: [],
leaseAuditList: [],
showJJExamineBtn: false, //-
showSBExamineBtn: false, //-
//
form: {},
//
rules: {
dictName: [
{
required: true,
message: '字典名称不能为空',
trigger: 'blur',
},
],
dictType: [
{
required: true,
message: '字典类型不能为空',
trigger: 'blur',
},
],
},
peopleOpen: false,
noticeOpen: false,
nform: {
notice: '',
},
nrules: {
notice: [
{
required: true,
message: '通知内容不能为空',
trigger: 'blur',
},
],
},
deptName: undefined,
//
leaseApplyDetails: [],
//
leaseApplyData: {},
}
//
leaseApplyDetails: [],
//
leaseApplyData: {},
}
},
created() {
this.GetUserInfo()
// this.getList();
this.GetUnitData()
this.GetProData()
},
components: { vueEasyPrint },
methods: {
//
async GetUserInfo() {
const res = await getInfo()
this.user = res.user
// console.log(this.user)
this.getList()
},
created() {
this.GetUserInfo()
// this.getList();
/** 查询列表 */
async getList() {
this.loading = true
const params = {
unitId: this.queryParams.unitId,
projectId: this.queryParams.proId,
keyWord: this.queryParams.keyword,
startTime: this.queryParams.time && this.queryParams.time[0],
endTime: this.queryParams.time && this.queryParams.time[1],
types: this.queryParams.types,
souceBy: 0,
pageSize: this.queryParams.pageSize,
pageNum: this.queryParams.pageNum,
}
const res = await getLeaseManageListAll(params)
this.loading = false
console.log('getList ============', res)
this.leaseAuditList = res.data.rows
// this.leaseAuditList.forEach((item,index)=>{
// console.log(item.leaseApplyInfoList)
// if(item.leaseApplyInfoList.length>0){
// // item.showExamineBtn = true;
// if(item.leaseApplyInfoList[0].status=="0"||item.leaseApplyInfoList[0].status=="5"||item.leaseApplyInfoList[0].status=="7"||item.leaseApplyInfoList[0].status=="8"){
// item.showExamineBtn = true;
// }
// }
// })
console.log(this.leaseAuditList)
this.total = res.data.total
},
//
async GetUnitData() {
const params = {
id: this.queryParams.proId,
}
const res = await getUnitData(params)
this.unitList = res.data
},
//
async GetProData() {
const params = {
id: this.queryParams.unitId,
}
const res = await getProData(params)
this.proList = res.data
},
//
cancel() {
this.open = false
this.reset()
},
//
reset() {
this.form = {
dictId: undefined,
dictName: undefined,
dictType: undefined,
status: '0',
remark: undefined,
}
this.resetForm('form')
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams.time = []
this.resetForm('queryForm')
this.GetUnitData()
this.GetProData()
this.handleQuery()
},
components: { vueEasyPrint },
methods: {
//
async GetUserInfo() {
const res = await getInfo()
this.user = res.user
// console.log(this.user)
this.getList()
},
/** 查询列表 */
async getList() {
this.loading = true
const params = {
unitId: this.queryParams.unitId,
projectId: this.queryParams.proId,
keyWord: this.queryParams.keyword,
startTime:
this.queryParams.time && this.queryParams.time[0],
endTime: this.queryParams.time && this.queryParams.time[1],
types: this.queryParams.types,
souceBy: 0,
pageSize: this.queryParams.pageSize,
pageNum: this.queryParams.pageNum,
}
const res = await getLeaseManageListAll(params)
this.loading = false
console.log('getList ============', res)
this.leaseAuditList = res.data.rows
// this.leaseAuditList.forEach((item,index)=>{
// console.log(item.leaseApplyInfoList)
// if(item.leaseApplyInfoList.length>0){
// // item.showExamineBtn = true;
// if(item.leaseApplyInfoList[0].status=="0"||item.leaseApplyInfoList[0].status=="5"||item.leaseApplyInfoList[0].status=="7"||item.leaseApplyInfoList[0].status=="8"){
// item.showExamineBtn = true;
// }
// }
// })
console.log(this.leaseAuditList)
this.total = res.data.total
},
//
async GetUnitData() {
const params = {
id: this.queryParams.proId,
}
const res = await getUnitData(params)
this.unitList = res.data
},
//
async GetProData() {
const params = {
id: this.queryParams.unitId,
}
const res = await getProData(params)
this.proList = res.data
},
//
cancel() {
this.open = false
this.reset()
},
//
reset() {
this.form = {
dictId: undefined,
dictName: undefined,
dictType: undefined,
status: '0',
remark: undefined,
}
this.resetForm('form')
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams.time = []
this.resetForm('queryForm')
this.GetUnitData()
this.GetProData()
this.handleQuery()
},
handleNotice() {
this.noticeOpen = true
},
/** 新增按钮操作 */
handleAdd() {
// this.$tab.closeOpenPage("/claimAndRefund/receive/receiveManageAdd");
// this.reset();
// this.open = true;
// this.title = "";
},
handleExamine(row, type) {
this.$tab.closeOpenPage({
path: '/claimAndRefund/receive/receiveExamine',
query: {
taskId: row.taskId,
},
})
},
handleView(row) {
this.$tab.closeOpenPage({
path: '/claimAndRefund/receive/receiveExamine?isView=true',
query: {
taskId: row.taskId,
},
})
},
//
async openLld(row) {
this.open = true
const res = await getLeaseListAll({ taskId: row.taskId })
this.leaseApplyDetails = res.rows[0].leaseApplyDetails
this.leaseApplyData = res.rows[0]
console.log(
'this.leaseApplyData ============',
this.leaseApplyData,
)
},
//
print() {
this.$refs.remarksPrintRef.print()
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.dictId)
this.single = selection.length != 1
this.multiple = !selection.length
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
const dictId = row.dictId || this.ids
getType(dictId).then((response) => {
this.form = response.data
this.open = true
this.title = '验收'
})
},
/** 提交按钮 */
submitForm: function () {
this.$refs['form'].validate((valid) => {
if (valid) {
if (this.form.dictId != undefined) {
updateType(this.form).then((response) => {
this.$modal.msgSuccess('修改成功')
this.open = false
this.getList()
})
} else {
addType(this.form).then((response) => {
this.$modal.msgSuccess('新增成功')
this.open = false
this.getList()
})
}
}
})
},
/** 删除按钮操作 */
handleDelete(row) {
const dictIds = row.dictId || this.ids
this.$modal
.confirm('是否确认删除所选择的数据项?')
.then(function () {
return delType(dictIds)
})
.then(() => {
this.getList()
this.$modal.msgSuccess('删除成功')
})
.catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
this.download(
'base/tm_task/applyExport',
{
...this.queryParams,
},
`领料审批单_${new Date().getTime()}.xlsx`,
)
},
/** 刷新缓存按钮操作 */
handleRefreshCache() {
refreshCache().then(() => {
this.$modal.msgSuccess('刷新成功')
this.$store.dispatch('dict/cleanDict')
})
},
handleNotice() {
this.noticeOpen = true
},
watch: {
$route: {
handler(to) {
if (to.query.keyWord) {
this.queryParams.keyWord = to.query.keyWord
}
/** 新增按钮操作 */
handleAdd() {
// this.$tab.closeOpenPage("/claimAndRefund/receive/receiveManageAdd");
// this.reset();
// this.open = true;
// this.title = "";
},
handleExamine(row, type) {
this.$tab.closeOpenPage({
path: '/claimAndRefund/receive/receiveExamine',
query: {
taskId: row.taskId,
},
deep: true,
immediate: true,
},
})
},
}
handleView(row) {
this.$tab.closeOpenPage({
path: '/claimAndRefund/receive/receiveExamine?isView=true',
query: {
taskId: row.taskId,
},
})
},
//
async openLld(row) {
this.open = true
const res = await getLeaseListAll({ taskId: row.taskId })
this.leaseApplyDetails = res.rows[0].leaseApplyDetails
this.leaseApplyData = res.rows[0]
console.log('this.leaseApplyData ============', this.leaseApplyData)
},
//
print() {
this.$refs.remarksPrintRef.print()
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.dictId)
this.single = selection.length != 1
this.multiple = !selection.length
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
const dictId = row.dictId || this.ids
getType(dictId).then((response) => {
this.form = response.data
this.open = true
this.title = '验收'
})
},
/** 提交按钮 */
submitForm: function () {
this.$refs['form'].validate((valid) => {
if (valid) {
if (this.form.dictId != undefined) {
updateType(this.form).then((response) => {
this.$modal.msgSuccess('修改成功')
this.open = false
this.getList()
})
} else {
addType(this.form).then((response) => {
this.$modal.msgSuccess('新增成功')
this.open = false
this.getList()
})
}
}
})
},
/** 删除按钮操作 */
handleDelete(row) {
const dictIds = row.dictId || this.ids
this.$modal
.confirm('是否确认删除所选择的数据项?')
.then(function () {
return delType(dictIds)
})
.then(() => {
this.getList()
this.$modal.msgSuccess('删除成功')
})
.catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
this.download(
'base/tm_task/applyExport',
{
...this.queryParams,
},
`领料审批单_${new Date().getTime()}.xlsx`,
)
},
/** 刷新缓存按钮操作 */
handleRefreshCache() {
refreshCache().then(() => {
this.$modal.msgSuccess('刷新成功')
this.$store.dispatch('dict/cleanDict')
})
},
},
watch: {
$route: {
handler(to) {
if (to.query.keyWord) {
this.queryParams.keyWord = to.query.keyWord
}
},
deep: true,
immediate: true,
},
},
}
</script>
<style lang="scss" scoped>
.print {
.title {
text-align: center;
font-weight: 600;
font-size: 16px;
}
.info {
margin-top: 10px;
display: flex;
flex-wrap: wrap;
.print {
.title {
text-align: center;
font-weight: 600;
font-size: 16px;
}
.info {
margin-top: 10px;
display: flex;
flex-wrap: wrap;
.item {
width: 50%;
flex-shrink: 0;
margin-bottom: 5px;
font-size: 14px;
}
}
.fillIn {
margin-top: 15px;
display: flex;
justify-content: space-between;
.item {
width: 50%;
flex-shrink: 0;
margin-bottom: 5px;
font-size: 14px;
}
}
::v-deep.el-table .fixed-width .el-button--mini {
width: 60px !important;
margin-bottom: 10px;
.fillIn {
margin-top: 15px;
display: flex;
justify-content: space-between;
}
}
::v-deep.el-table .fixed-width .el-button--mini {
width: 60px !important;
margin-bottom: 10px;
}
</style>

View File

@ -1,43 +1,25 @@
<template>
<div class="app-container" id="newDevicesCode">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="80px"
>
<el-form-item label="关键字" prop="keyWord">
<el-input
v-model="queryParams.keyWord"
placeholder="请输入关键字"
clearable
maxlength="50"
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<div class="app-container" id="newDevicesCode">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
<el-form-item label="关键字" prop="keyWord">
<el-input
v-model="queryParams.keyWord"
placeholder="请输入关键字"
clearable
maxlength="50"
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button
icon="el-icon-refresh"
size="mini"
@click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<!-- <el-col :span="1.5">
<el-row :gutter="10" class="mb8">
<!-- <el-col :span="1.5">
<el-button
type="primary"
plain
@ -46,85 +28,34 @@
@click="handleAdd"
>新增</el-button>
</el-col>-->
<el-col :span="1.5">
<el-button
type="success"
plain
size="mini"
icon="el-icon-back"
@click="jumpList"
>新购验收管理</el-button
>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain size="mini" icon="el-icon-back" @click="jumpList">新购验收管理</el-button>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="typeList"
@selection-change="handleSelectionChange"
>
<!-- <el-table-column type="selection" width="55" align="center" /> -->
<el-table-column label="序号" align="center" type="index" />
<el-table-column
label="机具类型名称"
align="center"
prop="typeName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="规格型号"
align="center"
prop="specificationType"
:show-overflow-tooltip="true"
/>
<el-table-column
label="采购时间"
align="center"
prop="purchaseTime"
:show-overflow-tooltip="true"
/>
<el-table-column
label="采购数量"
align="center"
prop="purchaseNum"
:show-overflow-tooltip="true"
/>
<el-table-column
label="验收数量"
align="center"
prop="checkNum"
:show-overflow-tooltip="true"
/>
<el-table-column
label="绑定数量"
align="center"
prop="bindNum"
:show-overflow-tooltip="true"
>
<template slot-scope="scope">
<span v-if="scope.row.bindNum > 0">{{
scope.row.bindNum
}}</span>
<span v-else>0</span>
</template>
</el-table-column>
<el-table-column
label="是否为固定资产"
align="center"
prop="fixCode"
:show-overflow-tooltip="true"
>
<template slot-scope="scope">
<span v-if="scope.row.fixCode == '0'"></span>
<span v-if="scope.row.fixCode == '1'"></span>
</template>
</el-table-column>
<!-- <el-table-column label="编码类型" align="center" prop="codeType" :show-overflow-tooltip="true" />
<el-table v-loading="loading" :data="typeList" @selection-change="handleSelectionChange">
<!-- <el-table-column type="selection" width="55" align="center" /> -->
<el-table-column label="序号" align="center" type="index" />
<el-table-column label="机具类型名称" align="center" prop="typeName" :show-overflow-tooltip="true" />
<el-table-column label="规格型号" align="center" prop="specificationType" :show-overflow-tooltip="true" />
<el-table-column label="采购时间" align="center" prop="purchaseTime" :show-overflow-tooltip="true" />
<el-table-column label="采购数量" align="center" prop="purchaseNum" :show-overflow-tooltip="true" />
<el-table-column label="验收数量" align="center" prop="checkNum" :show-overflow-tooltip="true" />
<el-table-column label="绑定数量" align="center" prop="bindNum" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span v-if="scope.row.bindNum > 0">{{ scope.row.bindNum }}</span>
<span v-else>0</span>
</template>
</el-table-column>
<el-table-column label="是否为固定资产" align="center" prop="fixCode" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span v-if="scope.row.fixCode == '0'"></span>
<span v-if="scope.row.fixCode == '1'"></span>
</template>
</el-table-column>
<!-- <el-table-column label="编码类型" align="center" prop="codeType" :show-overflow-tooltip="true" />
<el-table-column label="二维码" align="center" prop="dictName" :show-overflow-tooltip="true" />-->
<el-table-column label="状态" align="center" prop="status" width="180">
<template slot-scope="scope">
@ -270,9 +201,9 @@ import {
getBindCodeDetails
} from '@/api/store/newBuy'
import { getTypeList } from '@/api/store/warehousing'
import { getListByMaType } from '@/api/store/tools'
import { number } from 'echarts'
import { getTypeList } from '@/api/store/warehousing'
import { getListByMaType } from '@/api/store/tools'
import { number } from 'echarts'
export default {
name: 'NewDevicesCode',
@ -475,11 +406,51 @@ export default {
assetsCode: '',
fixCode: this.form.fixCode,
}
},
mounted() {
const taskId = this.$route.query && this.$route.query.taskId
this.taskId = taskId
// console.log(this.taskId)
this.codeList.push(obj)
}
} else {
this.$modal.msgError('编码后缀范围输入格式不正确')
}
}
},
/** 提交按钮 */
submitForm: function () {
// console.log(this.codeList)
if (this.form.fixCode == 0) {
if (this.hasDuplicateField(this.codeList, 'assetsCode')) {
this.$modal.msgError('固定资产编码不能为空')
return false
}
}
if (this.codeList.length == 0) {
this.$modal.msgError('无新增编码绑定')
} else {
const maCodeSet = new Set()
let hasDuplicates = false
for (const item of this.codeList) {
const maCode = item.maCode
if (maCodeSet.has(maCode)) {
hasDuplicates = true
break
}
maCodeSet.add(maCode)
}
console.log('codeList:', this.codeList)
if (hasDuplicates) {
this.$modal.msgError('编码绑定失败,存在重复编码,请重新输入')
return //
}
editPurchaseMacode(this.codeList).then(response => {
console.log(this.codeList)
if (response.data && response.data.length > 0) {
this.codeList = response.data
this.$modal.msgError('编码绑定失败,存在重复编码,请重新输入')
} else {
this.$modal.msgSuccess('编码绑定成功')
this.open = false
this.getList()
}
})
@ -542,13 +513,13 @@ export default {
</script>
<style scoped>
.redColor {
color: red;
}
.redColor {
color: red;
}
</style>
<style lang="scss" scoped>
::v-deep.el-table .fixed-width .el-button--mini {
width: 60px !important;
margin-bottom: 10px;
}
::v-deep.el-table .fixed-width .el-button--mini {
width: 60px !important;
margin-bottom: 10px;
}
</style>

View File

@ -124,23 +124,35 @@
<el-table
v-loading="loading"
:data="roleList"
border
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="角色编号" prop="roleId" width="120" />
<el-table-column
label="角色编号"
prop="roleId"
width="120"
align="center"
/>
<el-table-column
align="center"
label="角色名称"
prop="roleName"
:show-overflow-tooltip="true"
width="150"
/>
<el-table-column
align="center"
label="权限字符"
prop="roleKey"
:show-overflow-tooltip="true"
width="150"
/>
<el-table-column label="显示顺序" prop="roleSort" width="100" />
<el-table-column
align="center"
label="显示顺序"
prop="roleSort"
width="100"
/>
<el-table-column label="状态" align="center" width="100">
<template slot-scope="scope">
<el-switch
@ -161,11 +173,7 @@
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<el-table-column label="操作" align="center">
<template slot-scope="scope" v-if="scope.row.roleId !== 1">
<el-button
size="mini"
@ -384,407 +392,397 @@
</template>
<script>
import {
listRole,
getRole,
delRole,
addRole,
updateRole,
dataScope,
changeRoleStatus,
deptTreeSelect,
} from '@/api/system/role'
import {
treeselect as menuTreeselect,
roleMenuTreeselect,
} from '@/api/system/menu'
import {
listRole,
getRole,
delRole,
addRole,
updateRole,
dataScope,
changeRoleStatus,
deptTreeSelect,
} from '@/api/system/role'
import {
treeselect as menuTreeselect,
roleMenuTreeselect,
} from '@/api/system/menu'
export default {
name: 'Role',
dicts: ['sys_normal_disable'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
roleList: [],
//
title: '',
//
open: false,
//
openDataScope: false,
menuExpand: false,
menuNodeAll: false,
deptExpand: true,
deptNodeAll: false,
//
dateRange: [],
//
dataScopeOptions: [
export default {
name: 'Role',
dicts: ['sys_normal_disable'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
roleList: [],
//
title: '',
//
open: false,
//
openDataScope: false,
menuExpand: false,
menuNodeAll: false,
deptExpand: true,
deptNodeAll: false,
//
dateRange: [],
//
dataScopeOptions: [
{
value: '1',
label: '全部数据权限',
},
{
value: '2',
label: '自定数据权限',
},
{
value: '3',
label: '本部门数据权限',
},
{
value: '4',
label: '本部门及以下数据权限',
},
{
value: '5',
label: '仅本人数据权限',
},
],
//
menuOptions: [],
//
deptOptions: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
roleName: undefined,
roleKey: undefined,
status: undefined,
dataCondition: [],
},
//
form: {},
defaultProps: {
children: 'children',
label: 'label',
},
//
rules: {
roleName: [
{
value: '1',
label: '全部数据权限',
},
{
value: '2',
label: '自定数据权限',
},
{
value: '3',
label: '本部门数据权限',
},
{
value: '4',
label: '本部门及以下数据权限',
},
{
value: '5',
label: '仅本人数据权限',
required: true,
message: '角色名称不能为空',
trigger: 'blur',
},
],
//
menuOptions: [],
//
deptOptions: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
roleName: undefined,
roleKey: undefined,
status: undefined,
dataCondition: [],
},
//
form: {},
defaultProps: {
children: 'children',
label: 'label',
},
//
rules: {
roleName: [
{
required: true,
message: '角色名称不能为空',
trigger: 'blur',
},
],
roleKey: [
{
required: true,
message: '权限字符不能为空',
trigger: 'blur',
},
],
roleSort: [
{
required: true,
message: '角色顺序不能为空',
trigger: 'blur',
},
],
},
}
},
created() {
this.getList()
},
methods: {
/** 查询角色列表 */
getList() {
this.loading = true
listRole(
this.addDateRange(this.queryParams, this.dateRange),
).then((response) => {
roleKey: [
{
required: true,
message: '权限字符不能为空',
trigger: 'blur',
},
],
roleSort: [
{
required: true,
message: '角色顺序不能为空',
trigger: 'blur',
},
],
},
}
},
created() {
this.getList()
},
methods: {
/** 查询角色列表 */
getList() {
this.loading = true
listRole(this.addDateRange(this.queryParams, this.dateRange)).then(
(response) => {
this.roleList = response.rows
this.total = response.total
this.loading = false
})
},
/** 查询菜单树结构 */
getMenuTreeselect() {
menuTreeselect().then((response) => {
this.menuOptions = response.data
})
},
//
getMenuAllCheckedKeys() {
//
let checkedKeys = this.$refs.menu.getCheckedKeys()
//
let halfCheckedKeys = this.$refs.menu.getHalfCheckedKeys()
checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys)
return checkedKeys
},
//
getDeptAllCheckedKeys() {
//
let checkedKeys = this.$refs.dept.getCheckedKeys()
//
let halfCheckedKeys = this.$refs.dept.getHalfCheckedKeys()
checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys)
return checkedKeys
},
/** 根据角色ID查询菜单树结构 */
getRoleMenuTreeselect(roleId) {
return roleMenuTreeselect(roleId).then((response) => {
this.menuOptions = response.menus
return response
})
},
/** 根据角色ID查询部门树结构 */
getDeptTree(roleId) {
return deptTreeSelect(roleId).then((response) => {
this.deptOptions = response.depts
return response
})
},
//
handleStatusChange(row) {
let text = row.status === '0' ? '启用' : '停用'
this.$modal
.confirm(
'确认要"' + text + '""' + row.roleName + '"角色吗?',
)
.then(function () {
return changeRoleStatus(row.roleId, row.status)
})
.then(() => {
this.$modal.msgSuccess(text + '成功')
})
.catch(function () {
row.status = row.status === '0' ? '1' : '0'
})
},
//
cancel() {
this.open = false
this.reset()
},
//
cancelDataScope() {
this.openDataScope = false
this.reset()
},
//
reset() {
if (this.$refs.menu != undefined) {
this.$refs.menu.setCheckedKeys([])
}
;(this.menuExpand = false),
(this.menuNodeAll = false),
(this.deptExpand = true),
(this.deptNodeAll = false),
(this.form = {
roleId: undefined,
roleName: undefined,
roleKey: undefined,
roleSort: 0,
status: '0',
menuIds: [],
deptIds: [],
menuCheckStrictly: true,
deptCheckStrictly: true,
remark: undefined,
})
this.resetForm('form')
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = []
this.resetForm('queryForm')
this.handleQuery()
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.roleId)
this.queryParams.dataCondition = selection.map(
(item) => item.roleId,
)
this.single = selection.length != 1
this.multiple = !selection.length
},
//
handleCommand(command, row) {
switch (command) {
case 'handleDataScope':
this.handleDataScope(row)
break
case 'handleAuthUser':
this.handleAuthUser(row)
break
default:
break
}
},
// /
handleCheckedTreeExpand(value, type) {
if (type == 'menu') {
let treeList = this.menuOptions
for (let i = 0; i < treeList.length; i++) {
this.$refs.menu.store.nodesMap[
treeList[i].id
].expanded = value
}
} else if (type == 'dept') {
let treeList = this.deptOptions
for (let i = 0; i < treeList.length; i++) {
this.$refs.dept.store.nodesMap[
treeList[i].id
].expanded = value
}
}
},
// /
handleCheckedTreeNodeAll(value, type) {
if (type == 'menu') {
this.$refs.menu.setCheckedNodes(
value ? this.menuOptions : [],
)
} else if (type == 'dept') {
this.$refs.dept.setCheckedNodes(
value ? this.deptOptions : [],
)
}
},
//
handleCheckedTreeConnect(value, type) {
if (type == 'menu') {
this.form.menuCheckStrictly = value ? true : false
} else if (type == 'dept') {
this.form.deptCheckStrictly = value ? true : false
}
},
/** 新增按钮操作 */
handleAdd() {
this.reset()
this.getMenuTreeselect()
this.open = true
this.title = '添加角色'
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
const roleId = row.roleId || this.ids
const roleMenu = this.getRoleMenuTreeselect(roleId)
getRole(roleId).then((response) => {
this.form = response.data
this.open = true
this.$nextTick(() => {
roleMenu.then((res) => {
let checkedKeys = res.checkedKeys
checkedKeys.forEach((v) => {
this.$nextTick(() => {
this.$refs.menu.setChecked(v, true, false)
})
})
})
})
this.title = '修改角色'
})
},
/** 选择角色权限范围触发 */
dataScopeSelectChange(value) {
if (value !== '2') {
this.$refs.dept.setCheckedKeys([])
}
},
/** 分配数据权限操作 */
handleDataScope(row) {
this.reset()
const deptTreeSelect = this.getDeptTree(row.roleId)
getRole(row.roleId).then((response) => {
this.form = response.data
this.openDataScope = true
this.$nextTick(() => {
deptTreeSelect.then((res) => {
this.$refs.dept.setCheckedKeys(res.checkedKeys)
})
})
this.title = '分配数据权限'
})
},
/** 分配用户操作 */
handleAuthUser: function (row) {
const roleId = row.roleId
this.$router.push('/system/role-auth/user/' + roleId)
},
/** 提交按钮 */
submitForm: function () {
this.$refs['form'].validate((valid) => {
if (valid) {
if (this.form.roleId != undefined) {
this.form.menuIds = this.getMenuAllCheckedKeys()
updateRole(this.form).then((response) => {
this.$modal.msgSuccess('修改成功')
this.open = false
this.getList()
})
} else {
this.form.menuIds = this.getMenuAllCheckedKeys()
addRole(this.form).then((response) => {
this.$modal.msgSuccess('新增成功')
this.open = false
this.getList()
})
}
}
})
},
/** 提交按钮(数据权限) */
submitDataScope: function () {
if (this.form.roleId != undefined) {
this.form.deptIds = this.getDeptAllCheckedKeys()
dataScope(this.form).then((response) => {
this.$modal.msgSuccess('修改成功')
this.openDataScope = false
this.getList()
})
}
},
/** 删除按钮操作 */
handleDelete(row) {
const roleIds = row.roleId || this.ids
this.$modal
.confirm(
'是否确认删除所选择的数据项?',
)
.then(function () {
return delRole(roleIds)
})
.then(() => {
this.getList()
this.$modal.msgSuccess('删除成功')
})
.catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
this.download(
'system/role/export',
{
...this.queryParams,
},
`role_${new Date().getTime()}.xlsx`,
)
},
},
)
},
}
/** 查询菜单树结构 */
getMenuTreeselect() {
menuTreeselect().then((response) => {
this.menuOptions = response.data
})
},
//
getMenuAllCheckedKeys() {
//
let checkedKeys = this.$refs.menu.getCheckedKeys()
//
let halfCheckedKeys = this.$refs.menu.getHalfCheckedKeys()
checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys)
return checkedKeys
},
//
getDeptAllCheckedKeys() {
//
let checkedKeys = this.$refs.dept.getCheckedKeys()
//
let halfCheckedKeys = this.$refs.dept.getHalfCheckedKeys()
checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys)
return checkedKeys
},
/** 根据角色ID查询菜单树结构 */
getRoleMenuTreeselect(roleId) {
return roleMenuTreeselect(roleId).then((response) => {
this.menuOptions = response.menus
return response
})
},
/** 根据角色ID查询部门树结构 */
getDeptTree(roleId) {
return deptTreeSelect(roleId).then((response) => {
this.deptOptions = response.depts
return response
})
},
//
handleStatusChange(row) {
let text = row.status === '0' ? '启用' : '停用'
this.$modal
.confirm('确认要"' + text + '""' + row.roleName + '"角色吗?')
.then(function () {
return changeRoleStatus(row.roleId, row.status)
})
.then(() => {
this.$modal.msgSuccess(text + '成功')
})
.catch(function () {
row.status = row.status === '0' ? '1' : '0'
})
},
//
cancel() {
this.open = false
this.reset()
},
//
cancelDataScope() {
this.openDataScope = false
this.reset()
},
//
reset() {
if (this.$refs.menu != undefined) {
this.$refs.menu.setCheckedKeys([])
}
;(this.menuExpand = false),
(this.menuNodeAll = false),
(this.deptExpand = true),
(this.deptNodeAll = false),
(this.form = {
roleId: undefined,
roleName: undefined,
roleKey: undefined,
roleSort: 0,
status: '0',
menuIds: [],
deptIds: [],
menuCheckStrictly: true,
deptCheckStrictly: true,
remark: undefined,
})
this.resetForm('form')
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = []
this.resetForm('queryForm')
this.handleQuery()
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.roleId)
this.queryParams.dataCondition = selection.map(
(item) => item.roleId,
)
this.single = selection.length != 1
this.multiple = !selection.length
},
//
handleCommand(command, row) {
switch (command) {
case 'handleDataScope':
this.handleDataScope(row)
break
case 'handleAuthUser':
this.handleAuthUser(row)
break
default:
break
}
},
// /
handleCheckedTreeExpand(value, type) {
if (type == 'menu') {
let treeList = this.menuOptions
for (let i = 0; i < treeList.length; i++) {
this.$refs.menu.store.nodesMap[treeList[i].id].expanded =
value
}
} else if (type == 'dept') {
let treeList = this.deptOptions
for (let i = 0; i < treeList.length; i++) {
this.$refs.dept.store.nodesMap[treeList[i].id].expanded =
value
}
}
},
// /
handleCheckedTreeNodeAll(value, type) {
if (type == 'menu') {
this.$refs.menu.setCheckedNodes(value ? this.menuOptions : [])
} else if (type == 'dept') {
this.$refs.dept.setCheckedNodes(value ? this.deptOptions : [])
}
},
//
handleCheckedTreeConnect(value, type) {
if (type == 'menu') {
this.form.menuCheckStrictly = value ? true : false
} else if (type == 'dept') {
this.form.deptCheckStrictly = value ? true : false
}
},
/** 新增按钮操作 */
handleAdd() {
this.reset()
this.getMenuTreeselect()
this.open = true
this.title = '添加角色'
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
const roleId = row.roleId || this.ids
const roleMenu = this.getRoleMenuTreeselect(roleId)
getRole(roleId).then((response) => {
this.form = response.data
this.open = true
this.$nextTick(() => {
roleMenu.then((res) => {
let checkedKeys = res.checkedKeys
checkedKeys.forEach((v) => {
this.$nextTick(() => {
this.$refs.menu.setChecked(v, true, false)
})
})
})
})
this.title = '修改角色'
})
},
/** 选择角色权限范围触发 */
dataScopeSelectChange(value) {
if (value !== '2') {
this.$refs.dept.setCheckedKeys([])
}
},
/** 分配数据权限操作 */
handleDataScope(row) {
this.reset()
const deptTreeSelect = this.getDeptTree(row.roleId)
getRole(row.roleId).then((response) => {
this.form = response.data
this.openDataScope = true
this.$nextTick(() => {
deptTreeSelect.then((res) => {
this.$refs.dept.setCheckedKeys(res.checkedKeys)
})
})
this.title = '分配数据权限'
})
},
/** 分配用户操作 */
handleAuthUser: function (row) {
const roleId = row.roleId
this.$router.push('/system/role-auth/user/' + roleId)
},
/** 提交按钮 */
submitForm: function () {
this.$refs['form'].validate((valid) => {
if (valid) {
if (this.form.roleId != undefined) {
this.form.menuIds = this.getMenuAllCheckedKeys()
updateRole(this.form).then((response) => {
this.$modal.msgSuccess('修改成功')
this.open = false
this.getList()
})
} else {
this.form.menuIds = this.getMenuAllCheckedKeys()
addRole(this.form).then((response) => {
this.$modal.msgSuccess('新增成功')
this.open = false
this.getList()
})
}
}
})
},
/** 提交按钮(数据权限) */
submitDataScope: function () {
if (this.form.roleId != undefined) {
this.form.deptIds = this.getDeptAllCheckedKeys()
dataScope(this.form).then((response) => {
this.$modal.msgSuccess('修改成功')
this.openDataScope = false
this.getList()
})
}
},
/** 删除按钮操作 */
handleDelete(row) {
const roleIds = row.roleId || this.ids
this.$modal
.confirm('是否确认删除所选择的数据项?')
.then(function () {
return delRole(roleIds)
})
.then(() => {
this.getList()
this.$modal.msgSuccess('删除成功')
})
.catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
this.download(
'system/role/export',
{
...this.queryParams,
},
`role_${new Date().getTime()}.xlsx`,
)
},
},
}
</script>

View File

@ -38,7 +38,7 @@ module.exports = {
[process.env.VUE_APP_BASE_API]: {
// target: `http://112.29.103.165:21626`, //线上环境-重庆
// target: `http://112.29.103.165:21624`,//线上环境-宁夏 打包前放开数据大屏的路由
target: `http://192.168.0.14:21624`, //测试环境
// target: `http://192.168.0.14:21624`, //测试环境
// target: `http://1.12.248.179:23028`,//线上环境-南网
// target: `https://test-cc.zhgkxt.com`,//线上环境-南网
// target: `https://z.csgmall.com.cn`,
@ -46,7 +46,7 @@ module.exports = {
// target: `http://10.40.92.8:8080`, //超
// target: `http://10.40.92.81:8080`, //韩/
// target: `http://10.40.92.74:8080`,//旭/
// target: `http://10.40.92.153:8080`, //帅
target: `http://10.40.92.140:28080`, //帅
// target: `http://10.40.92.14:28080`, //福
//******** 注意事项 ********* */