优化权限流程

This commit is contained in:
BianLzhaoMin 2024-05-08 16:50:01 +08:00
parent 1272ccda12
commit 3db5bbb1f0
5 changed files with 1952 additions and 1484 deletions

View File

@ -126,6 +126,7 @@
v-loading="loading"
:data="leaseAuditList"
@selection-change="handleSelectionChange"
border
>
<!-- <el-table-column type="selection" width="55" align="center" /> -->
<el-table-column

File diff suppressed because it is too large Load Diff

View File

@ -77,6 +77,7 @@
end-placeholder="结束日期"
type="date"
value-format="yyyy-MM-dd"
style="width: 240px"
>
</el-date-picker>
</el-form-item>
@ -152,11 +153,19 @@
v-loading="loading"
:data="typeList"
@selection-change="handleSelectionChange"
border
>
<!-- <el-table-column type="selection" width="55" align="center" /> -->
<el-table-column label="序号" align="center" width="80" type="index">
<el-table-column
label="序号"
align="center"
width="80"
type="index"
>
<template scope="scope">
<span>{{ (queryParams.pageNum - 1) * 10 + scope.$index + 1 }}</span>
<span>{{
(queryParams.pageNum - 1) * 10 + scope.$index + 1
}}</span>
</template>
</el-table-column>
<el-table-column
@ -262,16 +271,11 @@
prop="remark"
:show-overflow-tooltip="true"
/>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
width="250"
>
<el-table-column label="操作" align="center" width="180">
<template slot-scope="scope">
<el-button
size="mini"
plain
type="text"
icon="el-icon-zoom-in"
@click="handleSee(scope.row, 'see')"
>查看</el-button
@ -287,21 +291,21 @@
> -->
<el-button
size="mini"
type="info"
type="text"
v-if="scope.row.taskStatus == '101'"
@click="handleUpdate(scope.row)"
>驳回提交</el-button
>
<el-button
size="mini"
type="danger"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除</el-button
>
<el-button
size="mini"
type="info"
type="text"
@click="handlePrint(scope.row)"
>退料单</el-button
>
@ -428,9 +432,18 @@
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" align="center" width="80" type="index">
<el-table-column
label="序号"
align="center"
width="80"
type="index"
>
<template scope="scope">
<span>{{ (dialogQueryParams.pageNum - 1) * 10 + scope.$index + 1 }}</span>
<span>{{
(dialogQueryParams.pageNum - 1) * 10 +
scope.$index +
1
}}</span>
</template>
</el-table-column>
<el-table-column
@ -550,471 +563,470 @@
</template>
<script>
import { listPartTypeApi } from '@/api/repairTest/repair'
import {
ApiGetBackApplyList,
getViewByApply,
backApplyDelApi,
submitBackApplyApi,
} from '@/api/claimAndRefund/return.js'
import { getInfo, h } from '@/api/login'
import {
getUnitData,
getProData,
getAgreementInfoById,
// getUseNumByTypeId
} from '@/api/claimAndRefund/receive.js'
import dialogForm from './dialogForm.vue'
import Tree from './tree.vue'
// 10:42startTime,endTime typeId
// http://localhost/claimAndRefund/return/returnApply
export default {
name: '',
dicts: ['sys_normal_disable'],
components: { dialogForm, Tree },
data() {
return {
fullscreenLoading: false,
type: '',
isShowOneFlag: false,
priKey: '',
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
typeList: [],
//
title: '',
//
open: false,
//
dateRange: [],
deptList: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
keyWord: '', //
unitId: '', //id
lotId: '', //id
taskStatus: '', //
typeId: '', //
time: '',
agreementCode: '', //
startTime: '',
endTime: '',
proId: '',
},
dialogQueryParams: {
pageNum: 1,
pageSize: 10,
},
//
form: {},
//
rules: {
dictName: [
{
required: true,
message: '字典名称不能为空',
trigger: 'blur',
},
],
dictType: [
{
required: true,
message: '字典类型不能为空',
trigger: 'blur',
},
],
},
openOne: false,
openTwo: false,
openTextOne: '',
openTextTwo: '',
openTextThree: '',
companyId: '',
deptOptions: [],
unitList: [],
proList: [],
taskStatusList: [
import { listPartTypeApi } from '@/api/repairTest/repair'
import {
ApiGetBackApplyList,
getViewByApply,
backApplyDelApi,
submitBackApplyApi,
} from '@/api/claimAndRefund/return.js'
import { getInfo, h } from '@/api/login'
import {
getUnitData,
getProData,
getAgreementInfoById,
// getUseNumByTypeId
} from '@/api/claimAndRefund/receive.js'
import dialogForm from './dialogForm.vue'
import Tree from './tree.vue'
// 10:42startTime,endTime typeId
// http://localhost/claimAndRefund/return/returnApply
export default {
name: '',
dicts: ['sys_normal_disable'],
components: { dialogForm, Tree },
data() {
return {
fullscreenLoading: false,
type: '',
isShowOneFlag: false,
priKey: '',
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
typeList: [],
//
title: '',
//
open: false,
//
dateRange: [],
deptList: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
keyWord: '', //
unitId: '', //id
lotId: '', //id
taskStatus: '', //
typeId: '', //
time: '',
agreementCode: '', //
startTime: '',
endTime: '',
proId: '',
},
dialogQueryParams: {
pageNum: 1,
pageSize: 10,
},
//
form: {},
//
rules: {
dictName: [
{
name: '待退料审核',
id: '37',
},
{
name: '退料审核通过',
id: '38',
},
{
name: '退料核查中',
id: '39',
},
{
name: '退料完成',
id: '40',
},
{
name: '退料审核驳回',
id: '101',
required: true,
message: '字典名称不能为空',
trigger: 'blur',
},
],
rowObj: {},
loadingType: '',
loadingTotal: 0,
loadingList: [],
dictType: [
{
required: true,
message: '字典类型不能为空',
trigger: 'blur',
},
],
},
openOne: false,
openTwo: false,
openTextOne: '',
openTextTwo: '',
openTextThree: '',
companyId: '',
deptOptions: [],
unitList: [],
proList: [],
taskStatusList: [
{
name: '待退料审核',
id: '37',
},
{
name: '退料审核通过',
id: '38',
},
{
name: '退料核查中',
id: '39',
},
{
name: '退料完成',
id: '40',
},
{
name: '退料审核驳回',
id: '101',
},
],
rowObj: {},
loadingType: '',
loadingTotal: 0,
loadingList: [],
}
},
created() {
// this.getList();
this.initSelectData()
this.InitIGetInfo()
this.getTree()
},
methods: {
getTree() {
listPartTypeApi().then((response) => {
// console.log('🚀 ~ listPartTypeApi ~ response:', response);
this.deptList = response.data
})
},
selectDrop(value) {
this.queryParams.typeId = value
},
/** 查询字典类型列表 startTime,结束日期endTime */
async getList() {
this.loading = true
if (this.queryParams.time && this.queryParams.time.length > 0) {
this.queryParams.startTime = this.queryParams.time[0]
this.queryParams.endTime = this.queryParams.time[1]
}
},
created() {
// this.getList();
this.initSelectData()
this.InitIGetInfo()
this.getTree()
},
methods: {
getTree() {
listPartTypeApi().then((response) => {
// console.log('🚀 ~ listPartTypeApi ~ response:', response);
this.deptList = response.data
})
},
selectDrop(value) {
this.queryParams.typeId = value
},
/** 查询字典类型列表 startTime,结束日期endTime */
async getList() {
this.loading = true
if (this.queryParams.time && this.queryParams.time.length > 0) {
this.queryParams.startTime = this.queryParams.time[0]
this.queryParams.endTime = this.queryParams.time[1]
try {
let params = {
companyId: this.companyId,
...this.queryParams,
}
try {
const res = await ApiGetBackApplyList(params)
this.typeList = res.data.rows
this.total = res.data.total
this.loading = false
} catch (error) {}
},
//
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 = null
// this.resetForm("queryForm");
this.$refs.queryForm.resetFields()
this.$refs.mychildSon.inputValue = ''
this.initSelectData()
this.handleQuery()
},
/** 新增按钮操作 */
handleAdd() {
// this.reset();
// // this.open = true;
// // this.title = "";
this.$tab.closeOpenPage('/claimAndRefund/return/returnApplyAdd')
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.dictId)
this.single = selection.length != 1
this.multiple = !selection.length
},
/** 修改按钮操作 */
handleUpdate(row) {
this.$tab.closeOpenPage({
path: '/claimAndRefund/return/returnApplyAdd',
query: {
Id: row.id,
isEdit: true,
},
})
},
// 退
handleUpdateOrder() {
this.title = '查看'
this.isShowOneFlag = true
},
//
handleSubmit() {
this.title = '确认操作'
this.openTextOne = '确认提交申请么?'
this.openTextTwo = '确认提交申请么?'
this.openOne = true
},
submitOpenOneForm() {
this.openTextThree = '提交成功!'
this.openTwo = true
},
/** 提交按钮 */
submitForm: function () {
this.$refs['queryForm1'].validate((valid) => {
if (valid) {
let backApplyInfo = []
for (let i = 0; i < this.loadingList.length; i++) {
this.loadingList[i].companyId = this.companyId
}
backApplyInfo.push({
backPerson: '张三',
phone: '1234578988',
remark: '1425备注',
backTime: '2023-12-14',
// backPerson: this.dialogQueryParams.backPerson,
// phone: this.dialogQueryParams.phone,
// remark: this.dialogQueryParams.remark,
// backTime: this.dialogQueryParams.backTime,
companyId: this.companyId,
})
let params = {
companyId: this.companyId,
...this.queryParams,
agreementId: this.rowObj.agreementId,
backApplyInfo: JSON.stringify(backApplyInfo),
backApplyDetails: JSON.stringify(this.loadingList),
}
const res = await ApiGetBackApplyList(params)
this.typeList = res.data.rows
this.total = res.data.total
this.loading = false
} catch (error) {}
},
//
cancel() {
this.open = false
this.reset()
},
//
reset() {
this.form = {
dictId: undefined,
dictName: undefined,
dictType: undefined,
status: '0',
remark: undefined,
console.log('param----', params)
submitBackApplyApi(params).then((res) => {})
// 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();
// });
// }
} else {
}
this.resetForm('form')
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams.time = null
// this.resetForm("queryForm");
this.$refs.queryForm.resetFields()
this.$refs.mychildSon.inputValue = ''
this.initSelectData()
this.handleQuery()
},
/** 新增按钮操作 */
handleAdd() {
// this.reset();
// // this.open = true;
// // this.title = "";
this.$tab.closeOpenPage('/claimAndRefund/return/returnApplyAdd')
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.dictId)
this.single = selection.length != 1
this.multiple = !selection.length
},
/** 修改按钮操作 */
handleUpdate(row) {
this.$tab.closeOpenPage({
path: '/claimAndRefund/return/returnApplyAdd',
query: {
Id: row.id,
isEdit: true,
},
})
},
/** 删除按钮操作 */
handleDelete(row) {
let param = {
id: row.id + '',
}
this.$modal
.confirm('是否确认删除所选择的数据项?')
.then(() => {
return backApplyDelApi(param)
})
},
// 退
handleUpdateOrder() {
this.title = '查看'
this.isShowOneFlag = true
},
//
handleSubmit() {
this.title = '确认操作'
this.openTextOne = '确认提交申请么?'
this.openTextTwo = '确认提交申请么?'
this.openOne = true
},
submitOpenOneForm() {
this.openTextThree = '提交成功!'
this.openTwo = true
},
/** 提交按钮 */
submitForm: function () {
this.$refs['queryForm1'].validate((valid) => {
if (valid) {
let backApplyInfo = []
for (let i = 0; i < this.loadingList.length; i++) {
this.loadingList[i].companyId = this.companyId
}
backApplyInfo.push({
backPerson: '张三',
phone: '1234578988',
remark: '1425备注',
backTime: '2023-12-14',
// backPerson: this.dialogQueryParams.backPerson,
// phone: this.dialogQueryParams.phone,
// remark: this.dialogQueryParams.remark,
// backTime: this.dialogQueryParams.backTime,
companyId: this.companyId,
})
let params = {
companyId: this.companyId,
agreementId: this.rowObj.agreementId,
backApplyInfo: JSON.stringify(backApplyInfo),
backApplyDetails: JSON.stringify(this.loadingList),
}
console.log('param----', params)
submitBackApplyApi(params).then((res) => {})
// 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();
// });
// }
} else {
}
.then(() => {
this.getList()
// this.$modal.msgSuccess('');
this.$message.success('操作成功!')
})
},
/** 删除按钮操作 */
handleDelete(row) {
let param = {
id: row.id + '',
}
this.$modal
.confirm('是否确认删除所选择的数据项?')
.then(() => {
return backApplyDelApi(param)
})
.then(() => {
this.getList()
// this.$modal.msgSuccess('');
this.$message.success('操作成功!')
})
.catch(() => {
// this.$modal.msgError('');
})
},
handlePrint(row) {
this.isShowOneFlag = true
this.rowObj = row
},
.catch(() => {
// this.$modal.msgError('');
})
},
handlePrint(row) {
this.isShowOneFlag = true
this.rowObj = row
},
handleSee(row, type) {
this.dialogQueryParams.unitName = row.unitName
this.dialogQueryParams.lotName = row.lotName
this.dialogQueryParams.agreementCode = row.agreementCode
this.dialogQueryParams.backPerson = row.backPerson
this.dialogQueryParams.phone = row.phone
this.dialogQueryParams.backTime = row.backTime + ''
this.$set(this.dialogQueryParams, 'keyWord', '')
this.loadingType = type
this.rowObj = row
this.open = true
this.getDialogList()
},
handlUpdate(row, type) {
this.loadingType = type
this.rowObj = row
this.open = true
this.getDialogList()
},
handleSee(row, type) {
this.dialogQueryParams.unitName = row.unitName
this.dialogQueryParams.lotName = row.lotName
this.dialogQueryParams.agreementCode = row.agreementCode
this.dialogQueryParams.backPerson = row.backPerson
this.dialogQueryParams.phone = row.phone
this.dialogQueryParams.backTime = row.backTime + ''
this.$set(this.dialogQueryParams, 'keyWord', '')
this.loadingType = type
this.rowObj = row
this.open = true
this.getDialogList()
},
handlUpdate(row, type) {
this.loadingType = type
this.rowObj = row
this.open = true
this.getDialogList()
},
/** 导出按钮操作 */
handleExport() {
this.download(
'material/backApply/export',
{
...this.queryParams,
},
`退料申请单_${new Date().getTime()}.xlsx`,
)
},
getDialogList() {
let params = {
id: this.rowObj.id,
agreementId: this.rowObj.agreementId,
keyWord: this.dialogQueryParams.keyWord,
pageNum: this.dialogQueryParams.pageNum,
pageSize: this.dialogQueryParams.pageSize,
}
getViewByApply(params).then((res) => {
console.log(res)
this.loadingList = res.data.rows
/* this.loadingList.forEach(item=>{
/** 导出按钮操作 */
handleExport() {
this.download(
'material/backApply/export',
{
...this.queryParams,
},
`退料申请单_${new Date().getTime()}.xlsx`,
)
},
getDialogList() {
let params = {
id: this.rowObj.id,
agreementId: this.rowObj.agreementId,
keyWord: this.dialogQueryParams.keyWord,
pageNum: this.dialogQueryParams.pageNum,
pageSize: this.dialogQueryParams.pageSize,
}
getViewByApply(params).then((res) => {
console.log(res)
this.loadingList = res.data.rows
/* this.loadingList.forEach(item=>{
getUseNumByTypeId({ typeId:item.typeId }).then(res=>{
item.useNum = res.data
})
})*/
this.loadingTotal = res.data.total
})
},
InitIGetInfo() {
getInfo().then((res) => {
this.companyId = res.user.companyId
this.getList()
})
},
handleNodeClick(ev) {
console.log(ev)
},
initSelectData() {
this.GetUnitData()
this.GetProData()
},
//
async GetUnitData() {
const params = {}
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
},
// ID
async InitGetAgreementInfoById() {
const { unitId, proId } = this.queryParams
if (!unitId || !proId) {
return
}
const params = {
unitId: unitId,
projectId: proId,
}
const res = await getAgreementInfoById(params)
// this.proList = res.data
this.queryParams.agreementCode = res.data.agreementCode
},
getAgreementByUnitAndProId() {
this.InitGetAgreementInfoById()
},
getAgreementByProId() {
this.InitGetAgreementInfoById()
},
getAgreementByUnit() {
this.GetProData()
},
handleQuery1() {
this.getDialogList()
},
resetQuery1() {
this.dialogQueryParams.keyWord = ''
this.getDialogList()
},
this.loadingTotal = res.data.total
})
},
watch: {
$route: {
handler(to) {
if (to.query.keyWord) {
this.queryParams.keyWord = to.query.keyWord
}
},
deep: true,
immediate: true,
},
InitIGetInfo() {
getInfo().then((res) => {
this.companyId = res.user.companyId
this.getList()
})
},
}
handleNodeClick(ev) {
console.log(ev)
},
initSelectData() {
this.GetUnitData()
this.GetProData()
},
//
async GetUnitData() {
const params = {}
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
},
// ID
async InitGetAgreementInfoById() {
const { unitId, proId } = this.queryParams
if (!unitId || !proId) {
return
}
const params = {
unitId: unitId,
projectId: proId,
}
const res = await getAgreementInfoById(params)
// this.proList = res.data
this.queryParams.agreementCode = res.data.agreementCode
},
getAgreementByUnitAndProId() {
this.InitGetAgreementInfoById()
},
getAgreementByProId() {
this.InitGetAgreementInfoById()
},
getAgreementByUnit() {
this.GetProData()
},
handleQuery1() {
this.getDialogList()
},
resetQuery1() {
this.dialogQueryParams.keyWord = ''
this.getDialogList()
},
},
watch: {
$route: {
handler(to) {
if (to.query.keyWord) {
this.queryParams.keyWord = to.query.keyWord
}
},
deep: true,
immediate: true,
},
},
}
</script>
<style lang="scss" scoped>
.submit_box {
.submit_box {
display: flex;
justify-content: flex-start;
align-items: center;
.submit_box_title {
display: flex;
justify-content: flex-start;
align-items: center;
flex-direction: column;
margin-left: 15px;
.submit_box_title {
display: flex;
flex-direction: column;
margin-left: 15px;
:first-child {
font-size: 14px;
font-weight: 600;
}
:last-child {
margin-top: 6px;
font-size: 12px;
}
}
}
.submit_box_two {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
margin-left: 30%;
.submit_box_title {
display: flex;
flex-direction: column;
margin-left: 10px;
font-size: 18px;
:first-child {
font-size: 14px;
font-weight: 600;
}
}
::v-deep.el-table .fixed-width .el-button--mini {
width: 60px !important;
margin-bottom: 10px;
:last-child {
margin-top: 6px;
font-size: 12px;
}
}
.dialog-footer {
}
.submit_box_two {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
margin-left: 30%;
.submit_box_title {
display: flex;
justify-content: flex-end;
align-items: center;
flex-direction: column;
margin-left: 10px;
font-size: 18px;
font-weight: 600;
}
}
::v-deep.el-table .fixed-width .el-button--mini {
width: 60px !important;
margin-bottom: 10px;
}
.dialog-footer {
display: flex;
justify-content: flex-end;
align-items: center;
}
</style>

File diff suppressed because it is too large Load Diff

View File

@ -153,6 +153,7 @@
v-loading="loading"
:data="typeList"
@selection-change="handleSelectionChange"
border
>
<el-table-column
type="selection"
@ -271,23 +272,18 @@
prop="remark"
:show-overflow-tooltip="true"
/>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
width="250"
>
<el-table-column label="操作" align="center" width="180">
<template slot-scope="scope">
<el-button
size="mini"
plain
type="text"
icon="el-icon-zoom-in"
@click="handleSee(scope.row, 'see')"
>查看</el-button
>
<el-button
size="mini"
type="primary"
type="text"
icon="el-icon-edit"
v-if="scope.row.applyStatus == '0'"
v-hasPermi="['receive:examine:nbry-jjfgs']"
@ -297,7 +293,7 @@
</el-button>
<el-button
size="mini"
type="primary"
type="text"
icon="el-icon-edit"
v-if="scope.row.applyStatus == '0'"
v-hasPermi="['receive:examine:nbry-sbfgs']"
@ -307,7 +303,7 @@
</el-button>
<el-button
size="mini"
type="info"
type="text"
@click="handlePrint(scope.row)"
>退料单</el-button
>