优化权限流程

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" v-loading="loading"
:data="leaseAuditList" :data="leaseAuditList"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
border
> >
<!-- <el-table-column type="selection" width="55" align="center" /> --> <!-- <el-table-column type="selection" width="55" align="center" /> -->
<el-table-column <el-table-column

View File

@ -1,6 +1,14 @@
<template> <template>
<div class="app-container" id="receiveApplyAdd"> <div class="app-container" id="receiveApplyAdd">
<el-form :model="queryParams" ref="queryForm" size="small" :rules="queryRules" :inline="true" v-show="showSearch"> <el-form
:model="queryParams"
ref="queryForm"
size="small"
:rules="queryRules"
:inline="true"
v-show="showSearch"
label-width="100px"
>
<el-row> <el-row>
<el-form-item label="领料单位" prop="unitId"> <el-form-item label="领料单位" prop="unitId">
<el-select <el-select
@ -11,7 +19,12 @@
style="width: 240px" style="width: 240px"
placeholder="请选择" placeholder="请选择"
> >
<el-option v-for="item in unitList" :key="item.id" :label="item.name" :value="item.id"></el-option> <el-option
v-for="item in unitList"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="领料工程" prop="proId"> <el-form-item label="领料工程" prop="proId">
@ -23,11 +36,21 @@
style="width: 240px" style="width: 240px"
placeholder="请选择" placeholder="请选择"
> >
<el-option v-for="item in proList" :key="item.id" :label="item.name" :value="item.id"></el-option> <el-option
v-for="item in proList"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="协议号" prop="agreementCode"> <el-form-item label="协议号" prop="agreementCode">
<el-input maxlength="50" v-model="queryParams.agreementCode" disabled></el-input> <el-input
maxlength="50"
v-model="queryParams.agreementCode"
disabled
style="width: 240px"
></el-input>
</el-form-item> </el-form-item>
<el-form-item label="物品类型" prop="status"> <el-form-item label="物品类型" prop="status">
<el-cascader <el-cascader
@ -38,6 +61,7 @@
@change="deviceTypeChange" @change="deviceTypeChange"
ref="deviceTypeCascader" ref="deviceTypeCascader"
filterable filterable
style="width: 240px"
></el-cascader> ></el-cascader>
</el-form-item> </el-form-item>
<el-form-item label="领料人" prop="leasePerson"> <el-form-item label="领料人" prop="leasePerson">
@ -46,6 +70,7 @@
v-model="queryParams.leaseApplyInfo.leasePerson" v-model="queryParams.leaseApplyInfo.leasePerson"
placeholder="请输入领料人" placeholder="请输入领料人"
clearable clearable
style="width: 240px"
/> />
</el-form-item> </el-form-item>
<el-form-item label="领料人电话" prop="phone"> <el-form-item label="领料人电话" prop="phone">
@ -53,7 +78,8 @@
maxlength="11" maxlength="11"
v-model="queryParams.leaseApplyInfo.phone" v-model="queryParams.leaseApplyInfo.phone"
placeholder="请输入领料人电话" placeholder="请输入领料人电话"
clearable onkeyup="this.value = this.value.replace(/[^\d]/g,'');" clearable
onkeyup="this.value = this.value.replace(/[^\d]/g,'');"
style="width: 240px" style="width: 240px"
/> />
</el-form-item> </el-form-item>
@ -74,10 +100,24 @@
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="success" plain icon="el-icon-back" size="mini" @click="handleBack">领料申请</el-button> <el-button
type="success"
plain
icon="el-icon-back"
size="mini"
@click="handleBack"
>领料申请</el-button
>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" v-if="isEdit == 'true'" @click="handleAdd"> <el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
v-if="isEdit == 'true'"
@click="handleAdd"
>
保存 保存
</el-button> </el-button>
</el-col> </el-col>
@ -93,11 +133,23 @@
</el-col> --> </el-col> -->
</el-row> </el-row>
<el-table v-loading="loading" :data="leaseApplyDetails" @selection-change="handleSelectionChange"> <el-table
v-loading="loading"
:data="leaseApplyDetails"
@selection-change="handleSelectionChange"
>
<!-- <el-table-column type="selection" width="55" align="center" /> --> <!-- <el-table-column type="selection" width="55" align="center" /> -->
<el-table-column label="序号" type="index" width="80" /> <el-table-column label="序号" type="index" width="80" />
<el-table-column label="类型名称" prop="typeCn" :show-overflow-tooltip="true" /> <el-table-column
<el-table-column label="规格型号" prop="guigeCn" :show-overflow-tooltip="true" /> label="类型名称"
prop="typeCn"
:show-overflow-tooltip="true"
/>
<el-table-column
label="规格型号"
prop="guigeCn"
:show-overflow-tooltip="true"
/>
<el-table-column label="计量单位" prop="unitCn" /> <el-table-column label="计量单位" prop="unitCn" />
<el-table-column label="库存数量" prop="num" /> <el-table-column label="库存数量" prop="num" />
<el-table-column label="预领数量" align="center"> <el-table-column label="预领数量" align="center">
@ -115,7 +167,13 @@
</el-table-column> </el-table-column>
<el-table-column label="备注" align="center"> <el-table-column label="备注" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input maxlength="100" v-model="scope.row.remark" placeholder="请输入备注" clearable style="width: 100%" /> <el-input
maxlength="100"
v-model="scope.row.remark"
placeholder="请输入备注"
clearable
style="width: 100%"
/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -137,7 +195,9 @@
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete({ ...scope.row, index: scope.$index })" @click="
handleDelete({ ...scope.row, index: scope.$index })
"
> >
删除 删除
</el-button> </el-button>
@ -148,8 +208,19 @@
</template> </template>
<script> <script>
import { getRole, delRole, addRole, updateRole, dataScope, changeRoleStatus, deptTreeSelect } from '@/api/system/role' import {
import { treeselect as menuTreeselect, roleMenuTreeselect } from '@/api/system/menu' getRole,
delRole,
addRole,
updateRole,
dataScope,
changeRoleStatus,
deptTreeSelect,
} from '@/api/system/role'
import {
treeselect as menuTreeselect,
roleMenuTreeselect,
} from '@/api/system/menu'
import { import {
getProData, getProData,
getUnitData, getUnitData,
@ -321,9 +392,27 @@ export default {
}, },
// //
rules: { rules: {
roleName: [{ required: true, message: '角色名称不能为空', trigger: 'blur' }], roleName: [
roleKey: [{ required: true, message: '权限字符不能为空', trigger: 'blur' }], {
roleSort: [{ required: true, message: '角色顺序不能为空', trigger: 'blur' }], required: true,
message: '角色名称不能为空',
trigger: 'blur',
},
],
roleKey: [
{
required: true,
message: '权限字符不能为空',
trigger: 'blur',
},
],
roleSort: [
{
required: true,
message: '角色顺序不能为空',
trigger: 'blur',
},
],
}, },
} }
}, },
@ -422,13 +511,16 @@ export default {
} }
this.queryParams.unitId = data.unitId this.queryParams.unitId = data.unitId
this.queryParams.proId = data.proId this.queryParams.proId = data.proId
this.queryParams.leaseApplyInfo.phone = data.leaseApplyInfoList[0].phone this.queryParams.leaseApplyInfo.phone =
this.queryParams.leaseApplyInfo.leasePerson = data.leaseApplyInfoList[0].leasePerson data.leaseApplyInfoList[0].phone
this.queryParams.leaseApplyInfo.leasePerson =
data.leaseApplyInfoList[0].leasePerson
this.queryParams.agreementCode = data.agreementCode this.queryParams.agreementCode = data.agreementCode
this.queryParams.agreementId = data.agreementId this.queryParams.agreementId = data.agreementId
this.queryParams.leaseApplyInfo.remark = data.leaseApplyInfoList[0].remark this.queryParams.leaseApplyInfo.remark =
data.leaseApplyInfoList[0].remark
this.leaseApplyInfoList = data.leaseApplyInfoList this.leaseApplyInfoList = data.leaseApplyInfoList
this.leaseApplyDetails = data.leaseApplyDetails.map(item => { this.leaseApplyDetails = data.leaseApplyDetails.map((item) => {
return this.handelEchoData(item) return this.handelEchoData(item)
}) })
}, },
@ -448,19 +540,24 @@ export default {
} }
this.queryParams.unitId = data.unitId this.queryParams.unitId = data.unitId
this.queryParams.proId = data.proId this.queryParams.proId = data.proId
this.queryParams.leaseApplyInfo.phone = data.leaseApplyInfoList[0].phone this.queryParams.leaseApplyInfo.phone =
this.queryParams.leaseApplyInfo.leasePerson = data.leaseApplyInfoList[0].leasePerson data.leaseApplyInfoList[0].phone
this.queryParams.leaseApplyInfo.leasePerson =
data.leaseApplyInfoList[0].leasePerson
this.queryParams.agreementCode = data.agreementCode this.queryParams.agreementCode = data.agreementCode
this.queryParams.agreementId = data.agreementId this.queryParams.agreementId = data.agreementId
this.queryParams.leaseApplyInfo.remark = data.leaseApplyInfoList[0].remark this.queryParams.leaseApplyInfo.remark =
data.leaseApplyInfoList[0].remark
this.leaseApplyInfoList = data.leaseApplyInfoList this.leaseApplyInfoList = data.leaseApplyInfoList
this.leaseApplyDetails = data.leaseApplyDetails.map(item => { this.leaseApplyDetails = data.leaseApplyDetails.map((item) => {
return this.handelEchoData(item) return this.handelEchoData(item)
}) })
}, },
// //
handelEchoData(item) { handelEchoData(item) {
const template = JSON.parse(JSON.stringify(this.leaseApplyDetailsItem)) const template = JSON.parse(
JSON.stringify(this.leaseApplyDetailsItem),
)
template.createBy = item.createBy template.createBy = item.createBy
template.companyId = item.companyId template.companyId = item.companyId
template.typeId = item.typeId template.typeId = item.typeId
@ -529,7 +626,7 @@ export default {
/** 保存按钮操作 */ /** 保存按钮操作 */
handleAdd() { handleAdd() {
this.$refs.queryForm.validate(async valid => { this.$refs.queryForm.validate(async (valid) => {
if (!valid) { if (!valid) {
return false return false
} else { } else {
@ -539,14 +636,16 @@ export default {
return return
} }
try { try {
this.queryParams.leaseApplyDetails.forEach(item => { this.queryParams.leaseApplyDetails.forEach((item) => {
if (item.num == 0) { if (item.num == 0) {
this.$message.error('机具类型库存量为零无法领料'); this.$message.error(
throw new Error(); '机具类型库存量为零无法领料',
)
throw new Error()
} }
if (item.preNum == '') { if (item.preNum == '') {
this.$message.error('请填写预领数量') this.$message.error('请填写预领数量')
throw new Error(); throw new Error()
} }
}) })
} catch (e) { } catch (e) {
@ -557,9 +656,16 @@ export default {
let res let res
if (this.taskId) { if (this.taskId) {
this.leaseApplyInfoList.forEach(v => { this.leaseApplyInfoList.forEach((v) => {
v = Object.assign(v, this.queryParams.leaseApplyInfo) v = Object.assign(
this.$set(v, 'leaseApplyDetails', this.queryParams.leaseApplyDetails) v,
this.queryParams.leaseApplyInfo,
)
this.$set(
v,
'leaseApplyDetails',
this.queryParams.leaseApplyDetails,
)
}) })
const params = { const params = {
@ -571,7 +677,9 @@ export default {
res = await editLeaseApply(params) res = await editLeaseApply(params)
} else { } else {
// console.log(this.queryParams) // console.log(this.queryParams)
let isNum = this.queryParams.leaseApplyDetails.every(e => e.num != 0) let isNum = this.queryParams.leaseApplyDetails.every(
(e) => e.num != 0,
)
if (!isNum) { if (!isNum) {
this.$message.error('机具类型库存量为零无法领料') this.$message.error('机具类型库存量为零无法领料')
@ -584,14 +692,18 @@ export default {
type: 'success', type: 'success',
message: res.msg, message: res.msg,
}) })
this.$tab.closeOpenPage({ path: '/claimAndRefund/receive/receiveApply' }) this.$tab.closeOpenPage({
path: '/claimAndRefund/receive/receiveApply',
})
} }
} }
}) })
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleBack(row) { handleBack(row) {
this.$tab.closeOpenPage({ path: '/claimAndRefund/receive/receiveApply' }) this.$tab.closeOpenPage({
path: '/claimAndRefund/receive/receiveApply',
})
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
@ -636,7 +748,9 @@ export default {
}, },
//// ////
handelTableItemData(node) { handelTableItemData(node) {
const template = JSON.parse(JSON.stringify(this.leaseApplyDetailsItem)) const template = JSON.parse(
JSON.stringify(this.leaseApplyDetailsItem),
)
template.createBy = this.user.name template.createBy = this.user.name
console.log(node.data) console.log(node.data)
template.num = node.data.num template.num = node.data.num
@ -647,7 +761,9 @@ export default {
template.guigeCn = node.pathLabels[3] template.guigeCn = node.pathLabels[3]
if (this.taskId) { if (this.taskId) {
const index = this.leaseApplyInfoList.find(key => key.companyId == node.data.companyId) const index = this.leaseApplyInfoList.find(
(key) => key.companyId == node.data.companyId,
)
template.parenntId = index ? index.id : '' template.parenntId = index ? index.id : ''
} }

View File

@ -77,6 +77,7 @@
end-placeholder="结束日期" end-placeholder="结束日期"
type="date" type="date"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
style="width: 240px"
> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
@ -152,11 +153,19 @@
v-loading="loading" v-loading="loading"
:data="typeList" :data="typeList"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
border
> >
<!-- <el-table-column type="selection" width="55" align="center" /> --> <!-- <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"> <template scope="scope">
<span>{{ (queryParams.pageNum - 1) * 10 + scope.$index + 1 }}</span> <span>{{
(queryParams.pageNum - 1) * 10 + scope.$index + 1
}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -262,16 +271,11 @@
prop="remark" prop="remark"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
/> />
<el-table-column <el-table-column label="操作" align="center" width="180">
label="操作"
align="center"
class-name="small-padding fixed-width"
width="250"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="mini" size="mini"
plain type="text"
icon="el-icon-zoom-in" icon="el-icon-zoom-in"
@click="handleSee(scope.row, 'see')" @click="handleSee(scope.row, 'see')"
>查看</el-button >查看</el-button
@ -287,21 +291,21 @@
> --> > -->
<el-button <el-button
size="mini" size="mini"
type="info" type="text"
v-if="scope.row.taskStatus == '101'" v-if="scope.row.taskStatus == '101'"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
>驳回提交</el-button >驳回提交</el-button
> >
<el-button <el-button
size="mini" size="mini"
type="danger" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
>删除</el-button >删除</el-button
> >
<el-button <el-button
size="mini" size="mini"
type="info" type="text"
@click="handlePrint(scope.row)" @click="handlePrint(scope.row)"
>退料单</el-button >退料单</el-button
> >
@ -428,9 +432,18 @@
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
> >
<el-table-column type="selection" width="55" align="center" /> <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"> <template scope="scope">
<span>{{ (dialogQueryParams.pageNum - 1) * 10 + scope.$index + 1 }}</span> <span>{{
(dialogQueryParams.pageNum - 1) * 10 +
scope.$index +
1
}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -954,7 +967,6 @@
this.dialogQueryParams.keyWord = '' this.dialogQueryParams.keyWord = ''
this.getDialogList() this.getDialogList()
}, },
}, },
watch: { watch: {
$route: { $route: {

View File

@ -9,7 +9,6 @@
label-width="100px" label-width="100px"
v-show="showSearch" v-show="showSearch"
> >
<el-row>
<el-form-item label="退料单位" prop="unitId"> <el-form-item label="退料单位" prop="unitId">
<el-select <el-select
v-model="queryParams.unitId" v-model="queryParams.unitId"
@ -47,8 +46,8 @@
<el-form-item label="协议号" prop="agreementCode"> <el-form-item label="协议号" prop="agreementCode">
<el-input <el-input
v-model="queryParams.agreementCode" v-model="queryParams.agreementCode"
style="width: 240px"
disabled disabled
style="width: 240px"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item label="物品类型" prop="status"> <el-form-item label="物品类型" prop="status">
@ -102,8 +101,6 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
</el-row>
<el-row></el-row>
</el-form> </el-form>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
@ -143,7 +140,6 @@
<el-table <el-table
v-loading="loading" v-loading="loading"
:data="leaseApplyDetails" :data="leaseApplyDetails"
border
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
> >
<el-table-column <el-table-column
@ -156,23 +152,33 @@
<el-table-column <el-table-column
label="类型名称" label="类型名称"
prop="typeName" prop="typeName"
align="center" min-width="200"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
/> />
<el-table-column <el-table-column
label="规格型号" label="规格型号"
prop="typeCode" prop="typeCode"
align="center" min-width="200"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
/> />
<el-table-column label="计量单位" prop="unitNames" align="center" /> <el-table-column
label="计量单位"
prop="unitNames"
min-width="100"
/>
<el-table-column <el-table-column
label="当前在用量" label="当前在用量"
align="center" align="center"
prop="useNum" prop="useNum"
min-width="180"
></el-table-column> ></el-table-column>
<el-table-column label="退料数量" align="center" prop="createTime"> <el-table-column
label="退料数量"
align="center"
prop="createTime"
min-width="180"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-input <el-input
v-model.number="scope.row.num" v-model.number="scope.row.num"
@ -185,7 +191,12 @@
/> />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="备注" align="center" prop="remark"> <el-table-column
label="备注"
align="center"
prop="remark"
min-width="180"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-input <el-input
v-model="scope.row.remark" v-model="scope.row.remark"
@ -201,6 +212,7 @@
align="center" align="center"
fixed="right" fixed="right"
class-name="small-padding fixed-width" class-name="small-padding fixed-width"
width="160px"
> >
<template slot-scope="scope" v-if="scope.row.roleId !== 1"> <template slot-scope="scope" v-if="scope.row.roleId !== 1">
<!-- <el-button--> <!-- <el-button-->
@ -494,19 +506,350 @@
this.GetAgreementInfoById() this.GetAgreementInfoById()
}, },
//
async GetDeviceTypeTreeFn(agreementId) {
const params = {
agreementId: agreementId,
// this.agreementId
}
const res = await getUseTypeTreee(params)
console.log('resgetUseTypeTreee==========', res)
this.deviceTypeTree = res.data
},
// id
async GetAgreementInfoById() {
if (this.queryParams.unitId && this.queryParams.proId) {
const params = {
unitId: this.queryParams.unitId,
projectId: this.queryParams.proId,
}
const res = await getAgreementInfoById(params)
if (!(res.data && res.data.agreementId)) {
this.$message.error('当前单位和工程未上传')
this.queryParams.unitId = null
this.queryParams.proId = null
this.GetUnitData()
this.GetProData()
} else {
this.queryParams.agreementId = res.data.agreementId
this.queryParams.agreementCode = res.data.agreementCode
this.GetDeviceTypeTreeFn(res.data.agreementId)
}
}
},
//
async returnNoteByApply(Id) {
const res = await materialReturnNoteByApply({ id: Id })
const data = res.data[0]
// console.log(data)
// this.queryParams.taskId = data.taskId
this.queryParams.unitId = data.unitId
this.queryParams.proId = Number(data.proId)
this.$set(this.queryParams, 'phone', data.phone)
this.queryParams.backPerson = data.backPerson
this.queryParams.backTime = data.backTime
this.queryParams.agreementCode = data.agreementCode
this.queryParams.agreementId = data.agreementId
this.queryParams.remark = data.remark
this.leaseApplyDetails = res.data
this.GetDeviceTypeTreeFn(data.agreementId)
},
//
handelEchoData(item) {
console.log('item======', item)
const template = JSON.parse(
JSON.stringify(this.leaseApplyDetailsItem),
)
template.createBy = item.createBy
template.parentId = item.data.parentId
template.typeId = item.data.typeId
template.companyId = item.companyId
// template.typeId = item.typeId
template.unitNames = item.unitNames
template.typeCn = item.typeName
template.guigeCn = item.typeModelName
template.remark = item.remark
template.preNum = item.preNum
template.status = item.status
return template
},
/** 查询角色列表 */
async getList() {},
/** 查询菜单树结构 */
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
})
},
//
//
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()
},
//
selectable(row) {
console.log(row)
if (row.num != 0) {
return true
} else {
return false
}
},
//
handleSelectionChange(selection) {
this.queryParams.leaseApplyDetails = selection
},
//
handleCommand(command, row) {
switch (command) {
case 'handleDataScope':
this.handleDataScope(row)
break
case 'handleAuthUser':
this.handleAuthUser(row)
break
default:
break
}
},
/** 保存按钮操作 */
handleAdd() {
this.$refs.queryForm.validate(async (valid) => {
if (!valid) {
return false
} else {
let backApplyInfo = []
if (this.queryParams.leaseApplyDetails.length == 0) {
this.$message.error('请添加数据')
return
}
// const isRemark = this.queryParams.leaseApplyDetails.some(
// (item) => item.remark == '' || item.remark == undefined
// );
const isNum = this.queryParams.leaseApplyDetails.some(
(item) => item.num == '' || item.num == undefined,
)
if (isNum) {
this.$message.error('退料数量不能为空!')
return
}
this.queryParams.createBy = this.user.name
this.queryParams.companyId = this.companyId
this.queryParams.backApplyInfo = {
backPerson: this.queryParams.backPerson,
phone: this.queryParams.phone,
remark: this.queryParams.remark,
backTime: this.queryParams.backTime,
companyId: this.companyId,
}
if (this.rowId != '') {
let params = {
companyId: this.companyId,
createBy: this.createBy,
id: this.rowId,
agreementId: this.queryParams.agreementId,
backApplyInfo: this.queryParams.backApplyInfo,
backApplyDetails:
this.queryParams.leaseApplyDetails,
}
const res = await submitRefuseBackApply(params)
if (res.code == 200) {
this.$message({ type: 'success', message: res.msg })
setTimeout(() => {
this.$tab.closeOpenPage({
path: '/claimAndRefund/return/returnApply',
})
}, 1000)
}
} else {
let params = {
companyId: this.companyId,
createBy: this.createBy,
agreementId: this.queryParams.agreementId,
backApplyInfo: this.queryParams.backApplyInfo,
backApplyDetails:
this.queryParams.leaseApplyDetails,
}
const res = await submitBackApplyApi(params)
if (res.code == 200) {
this.$message({ type: 'success', message: res.msg })
setTimeout(() => {
this.$tab.closeOpenPage({
path: '/claimAndRefund/return/returnApply',
})
}, 1000)
}
}
}
})
},
/** 修改按钮操作 */
handleBack(row) {
this.$tab.closeOpenPage({
path: '/claimAndRefund/return/returnApply',
})
},
/** 分配数据权限操作 */
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()
})
}
}
})
},
/** 删除按钮操作 */
handleDelete(row) {
this.leaseApplyDetails.splice(row.index, 1)
},
/** 导出按钮操作 */
handleExport() {
this.download(
'system/role/export',
{
...this.queryParams,
},
`role_${new Date().getTime()}.xlsx`,
)
},
checkNum(row) {
let maxNum = row.useNum
if (row.num <= 1) {
row.num = 1
} else if (row.num >= maxNum) {
row.num = maxNum
}
},
/////// ///////
async deviceTypeChange(val) { async deviceTypeChange(val) {
let nodes = null; let nodes = null
// console.log("vall1211221122", this.$refs.deviceTypeCascader.getCheckedNodes().length, this.$refs.deviceTypeCascader.getCheckedNodes(), [this.$refs.deviceTypeCascader.panel.getNodeByValue(val)]) // console.log("vall1211221122", this.$refs.deviceTypeCascader.getCheckedNodes().length, this.$refs.deviceTypeCascader.getCheckedNodes(), [this.$refs.deviceTypeCascader.panel.getNodeByValue(val)])
nodes = this.$refs.deviceTypeCascader.getCheckedNodes().length > 0 ? this.$refs.deviceTypeCascader.getCheckedNodes() : [this.$refs.deviceTypeCascader.panel.getNodeByValue(val)] nodes =
console.log("nodes", nodes) this.$refs.deviceTypeCascader.getCheckedNodes().length > 0
? this.$refs.deviceTypeCascader.getCheckedNodes()
: [this.$refs.deviceTypeCascader.panel.getNodeByValue(val)]
console.log('nodes', nodes)
// const res = await getUseNumByTypeId({ typeId: nodes[0].data.typeId }) // const res = await getUseNumByTypeId({ typeId: nodes[0].data.typeId })
nodes[0].data.useNum = nodes[0].data.num nodes[0].data.useNum = nodes[0].data.num
if (nodes[0].level != 4) { if (nodes[0].level != 4) {
return return
} }
if (nodes[0].data.useNum < 1) { if (nodes[0].data.useNum < 1) {
this.$modal.msgError("所选机具类型当前无在用!"); this.$modal.msgError('所选机具类型当前无在用!')
return return
} }
for (let i = 0; i < this.leaseApplyDetails.length; i++) { for (let i = 0; i < this.leaseApplyDetails.length; i++) {
@ -515,9 +858,7 @@
break break
} }
} }
this.leaseApplyDetails.push( this.leaseApplyDetails.push(this.handelTableItemData(nodes[0]))
this.handelTableItemData(nodes[0])
)
// this.$refs.cascader.$refs.panel.clearCheckedNodes() // this.$refs.cascader.$refs.panel.clearCheckedNodes()
// // // //
// this.$refs.cascader.$refs.panel.activePath = [] // this.$refs.cascader.$refs.panel.activePath = []
@ -525,7 +866,9 @@
}, },
//// ////
handelTableItemData(node) { handelTableItemData(node) {
const template = JSON.parse(JSON.stringify(this.leaseApplyDetailsItem)) const template = JSON.parse(
JSON.stringify(this.leaseApplyDetailsItem),
)
template.createBy = this.createBy template.createBy = this.createBy
template.typeId = node.data.typeId template.typeId = node.data.typeId
template.companyId = node.data.companyId template.companyId = node.data.companyId

View File

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