对接领料申请列表 和 提交领料申请

This commit is contained in:
wlikett 2023-12-21 17:57:21 +08:00
parent e570a174d0
commit 610ec741be
4 changed files with 434 additions and 353 deletions

View File

@ -61,21 +61,57 @@ export function removeAgreement(data) {
}
// 机具领料-列表
export function getLeaseAuditList(query) {
export function getLeaseAuditListAll(query) {
return request({
url: '/base/tm_task/getLeaseAuditList',
url: '/base/tm_task/getLeaseAuditListAll',
method: 'get',
params: query
})
}
// 获取 来往单位 列表
export function getUnitData(params = {}){
return request({
url: '/system/select/getUnitCbx',
method: 'post',
data: params
})
}
// 获取 工程 列表
export function getProData(params = {}){
return request({
url: '/system/select/getSectionEngineeringCbx',
method: 'post',
data: params
})
}
// 获取 设备树
export function getDeviceTypeTree(params = {}){
return request({
url: '/system/select/getDeviceTypeTree',
method: 'post',
data: params
})
}
// 根据单位id和工程id 获取 协议id
export function getAgreementInfoById(params = {}){
return request({
url:'/system/select/getAgreementInfoById',
method:'post',
data:params
})
}
export function submitLeaseApply(params = {}){
return request({
url:'/base/tm_task/submitLeaseApply',
method: 'post',
data:params
})
}

View File

@ -2,37 +2,41 @@
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
<el-form-item label="申请日期" prop="dictName">
<el-input
v-model="queryParams.dictName"
placeholder="请输入申请日期"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
<el-date-picker
v-model="queryParams.time"
type="daterange"
value-format="yyyy-MM-dd"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item label="往来单位" prop="dictName">
<el-input
v-model="queryParams.dictName"
placeholder="请输入往来单位"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
<el-select v-model="queryParams.unitId" clearable @change="GetProData" style="width: 240px" placeholder="请选择">
<el-option
v-for="item in unitList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="工程名称" prop="dictName">
<el-input
v-model="queryParams.dictName"
placeholder="请输入工程名称"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
<el-select v-model="queryParams.proId" clearable @change="GetUnitData" style="width: 240px" placeholder="请选择">
<el-option
v-for="item in proList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="关键字" prop="dictName">
<el-input
v-model="queryParams.dictName"
placeholder="请输入关键字"
clearable
:maxlength="20"
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
@ -83,17 +87,17 @@
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" align="center" type="index" />
<el-table-column label="领料单号" align="center" prop="code" :show-overflow-tooltip="true" />
<el-table-column label="领料单位" align="center" prop="dictName" :show-overflow-tooltip="true" />
<el-table-column label="领料工程" align="center" prop="dictName" :show-overflow-tooltip="true" />
<el-table-column label="协议号" align="center" prop="dictName" :show-overflow-tooltip="true" />
<el-table-column label="领料单位" align="center" prop="unitName" :show-overflow-tooltip="true" />
<el-table-column label="领料工程" align="center" prop="proName" :show-overflow-tooltip="true" />
<el-table-column label="协议号" align="center" prop="agreementCode" :show-overflow-tooltip="true" />
<el-table-column label="领料人" align="center" prop="leasePerson" :show-overflow-tooltip="true" />
<el-table-column label="联系电话" align="center" prop="dictName" :show-overflow-tooltip="true" />
<el-table-column label="申请人" align="center" prop="dictName" :show-overflow-tooltip="true" />
<el-table-column label="申请时间" align="center" prop="dictName" :show-overflow-tooltip="true" />
<el-table-column label="任务状态" align="center" prop="dictName" :show-overflow-tooltip="true" />
<el-table-column label="审批结果 " align="center" prop="dictName" :show-overflow-tooltip="true" />
<el-table-column label="备注" align="center" prop="dictName" :show-overflow-tooltip="true" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<el-table-column label="联系电话" align="center" prop="leasePhone" :show-overflow-tooltip="true" />
<el-table-column label="申请人" align="center" prop="applyFor" :show-overflow-tooltip="true" />
<el-table-column label="申请时间" align="center" prop="createTime" :show-overflow-tooltip="true" />
<el-table-column label="任务状态" align="center" prop="taskName" :show-overflow-tooltip="true" />
<el-table-column label="审批结果 " align="center" prop="examineStatus" :show-overflow-tooltip="true" />
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120px" fixed="right">
<template slot-scope="scope">
<el-button
size="mini"
@ -118,6 +122,7 @@
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
:page-sizes="[5,10,15,20,30]"
@pagination="getList"
/>
@ -166,7 +171,7 @@
<script>
import { listType, getType, delType, addType, updateType, refreshCache } from "@/api/system/dict/type";
import { getLeaseAuditList } from "@/api/claimAndRefund/receive";
import { getLeaseAuditListAll,getUnitData,getProData } from "@/api/claimAndRefund/receive";
export default {
@ -200,7 +205,13 @@ export default {
pageSize: 10,
dictName: undefined,
dictType: undefined,
status: undefined
status: undefined,
time:null, //
unitId:null, //id
proId:null, //id
types: 1, // 1 2
},
//
form: {},
@ -224,22 +235,62 @@ export default {
]
},
deptName: undefined,
unitList:[], //
proList:[], //
};
},
created() {
this.getList();
this.GetUnitData()
this.GetProData()
},
methods: {
/** 查询字典类型列表 */
getList() {
//
async getList() {
this.loading = true;
getLeaseAuditList(this.queryParams).then(response => {
this.leaseAuditList = response.data.rows;
this.total = response.data.total;
this.loading = false;
}
);
console.log( 'this.queryParams =============',this.queryParams )
const params = {
unitId:this.queryParams.unitId,
projectId:this.queryParams.proId,
keyWord:this.queryParams.dictName,
startTime:this.queryParams.time && this.queryParams.time[0],
endTime:this.queryParams.time && this.queryParams.time[1],
types:this.queryParams.types,
pageSize: this.queryParams.pageSize,
pageNum: this.queryParams.pageNum
}
const res = await getLeaseAuditListAll(params)
this.loading = false;
console.log('res ============',res)
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)
},
//
cancel() {
this.open = false;

View File

@ -1,60 +1,48 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
<el-form :model="queryParams" ref="queryForm" size="small" :rules="queryRules" :inline="true" v-show="showSearch">
<el-row>
<el-form-item label="领料单位" prop="roleName">
<el-input
v-model="queryParams.roleName"
placeholder="请输入领料单位"
clearable
style="width: 240px;"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="领料工程" prop="status">
<el-select
v-model="queryParams.status"
placeholder="领料工程"
clearable
style="width: 240px"
>
<el-form-item label="领料单位" prop="unitId">
<el-select v-model="queryParams.unitId" clearable @change="GetProData" style="width: 240px" placeholder="请选择">
<el-option
v-for="dict in dict.type.sys_normal_disable"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
v-for="item in unitList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="领料工程" prop="proId">
<el-select v-model="queryParams.proId" clearable @change="GetUnitData" style="width: 240px" placeholder="请选择">
<el-option
v-for="item in proList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="物品类型" prop="status">
<el-select
v-model="queryParams.status"
placeholder="物品类型"
clearable
style="width: 240px"
>
<el-option
v-for="dict in dict.type.sys_normal_disable"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
<el-cascader
placeholder="请输入物品类型"
:options="deviceTypeTree"
:props="deviceTypeTreeProps"
v-model="deviceType"
@change="deviceTypeChange"
ref="deviceTypeCascader"
filterable></el-cascader>
</el-form-item>
<el-form-item label="领料人" prop="roleName">
<el-input
v-model="queryParams.roleName"
v-model="queryParams.leaseApplyInfo.leasePerson"
placeholder="请输入领料人"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
</el-row>
<el-row>
<el-form-item label="领料人电话" prop="roleName">
<el-input
v-model="queryParams.roleName"
v-model="queryParams.leaseApplyInfo.phone"
placeholder="请输入领料人电话"
clearable
style="width: 240px"
@ -63,15 +51,19 @@
</el-form-item>
<el-form-item label="备注" prop="roleName">
<el-input
v-model="queryParams.roleName"
v-model="queryParams.leaseApplyInfo.remark"
placeholder="请输入备注"
clearable
rows="1"
type="textarea"
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
</el-row>
<el-row>
</el-row>
</el-form>
<el-row :gutter="10" class="mb8">
@ -82,7 +74,6 @@
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:role:add']"
>保存</el-button>
</el-col>
<el-col :span="1.5">
@ -91,9 +82,7 @@
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:role:edit']"
>领料管理</el-button>
</el-col>
<el-col :span="1.5">
@ -109,38 +98,36 @@
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="roleList" @selection-change="handleSelectionChange">
<el-table v-loading="loading" :data="queryParams.leaseApplyDetails" @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="roleName" :show-overflow-tooltip="true" />
<el-table-column label="规格型号" prop="roleKey" :show-overflow-tooltip="true" />
<el-table-column label="计量单位" prop="unitName" width="100" />
<el-table-column label="剩余计划量" prop="roleSort" align="center" width="100" />
<el-table-column label="序号" type="index" width="120" />
<el-table-column label="类型名称" prop="typeCn" width="200" :show-overflow-tooltip="true" />
<el-table-column label="规格型号" prop="guigeCn" width="200" :show-overflow-tooltip="true" />
<el-table-column label="计量单位" prop="unitCn" width="100" />
<el-table-column label="预领数量" align="center" prop="createTime" width="180">
<template slot-scope="scope">
<el-input
v-model="scope.row.roleSort"
v-model.number="scope.row.preNum"
placeholder="请输入预领数量"
type="number"
clearable
style="width: 240px"
style="width: 100%"
@keyup.enter.native="handleQuery"
/>
</template>
</el-table-column>
<el-table-column label="出库数量" prop="roleSort" width="100" />
<el-table-column label="出库状态" prop="roleSort" width="100" />
<el-table-column label="备注" align="center" prop="createTime" width="180">
<template slot-scope="scope">
<el-input
v-model="scope.row.roleSort"
v-model="scope.row.remark"
placeholder="请输入备注"
clearable
style="width: 240px"
style="width: 100%"
@keyup.enter.native="handleQuery"
/>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
<template slot-scope="scope" v-if="scope.row.roleId !== 1">
<!-- <el-button-->
<!-- size="mini"-->
@ -153,137 +140,32 @@
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:role:remove']"
@click="handleDelete({...scope.row,index:scope.$index})"
>删除</el-button>
<!-- <el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)" v-hasPermi="['system:role:edit']">-->
<!-- <el-button size="mini" type="text" icon="el-icon-d-arrow-right">更多</el-button>-->
<!-- <el-dropdown-menu slot="dropdown">-->
<!-- <el-dropdown-item command="handleDataScope" icon="el-icon-circle-check"-->
<!-- v-hasPermi="['system:role:edit']">数据权限</el-dropdown-item>-->
<!-- <el-dropdown-item command="handleAuthUser" icon="el-icon-user"-->
<!-- v-hasPermi="['system:role:edit']">分配用户</el-dropdown-item>-->
<!-- </el-dropdown-menu>-->
<!-- </el-dropdown>-->
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改角色配置对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="角色名称" prop="roleName">
<el-input v-model="form.roleName" placeholder="请输入角色名称" />
</el-form-item>
<el-form-item prop="roleKey">
<span slot="label">
<el-tooltip content="控制器中定义的权限字符,如:@PreAuthorize(`@ss.hasRole('admin')`)" placement="top">
<i class="el-icon-question"></i>
</el-tooltip>
权限字符
</span>
<el-input v-model="form.roleKey" placeholder="请输入权限字符" />
</el-form-item>
<el-form-item label="角色顺序" prop="roleSort">
<el-input-number v-model="form.roleSort" controls-position="right" :min="0" />
</el-form-item>
<el-form-item label="状态">
<el-radio-group v-model="form.status">
<el-radio
v-for="dict in dict.type.sys_normal_disable"
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
<!-- <el-form-item label="菜单权限">-->
<!-- <el-checkbox v-model="menuExpand" @change="handleCheckedTreeExpand($event, 'menu')">展开/折叠</el-checkbox>-->
<!-- <el-checkbox v-model="menuNodeAll" @change="handleCheckedTreeNodeAll($event, 'menu')">全选/全不选</el-checkbox>-->
<!-- <el-checkbox v-model="form.menuCheckStrictly" @change="handleCheckedTreeConnect($event, 'menu')">父子联动</el-checkbox>-->
<!-- <el-tree-->
<!-- class="tree-border"-->
<!-- :data="menuOptions"-->
<!-- show-checkbox-->
<!-- ref="menu"-->
<!-- node-key="id"-->
<!-- :check-strictly="!form.menuCheckStrictly"-->
<!-- empty-text="加载中,请稍候"-->
<!-- :props="defaultProps"-->
<!-- ></el-tree>-->
<!-- </el-form-item>-->
<el-form-item label="备注">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 分配角色数据权限对话框 -->
<el-dialog :title="title" :visible.sync="openDataScope" width="500px" append-to-body>
<el-form :model="form" label-width="80px">
<el-form-item label="角色名称">
<el-input v-model="form.roleName" :disabled="true" />
</el-form-item>
<el-form-item label="权限字符">
<el-input v-model="form.roleKey" :disabled="true" />
</el-form-item>
<el-form-item label="权限范围">
<el-select v-model="form.dataScope" @change="dataScopeSelectChange">
<el-option
v-for="item in dataScopeOptions"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="数据权限" v-show="form.dataScope == 2">
<el-checkbox v-model="deptExpand" @change="handleCheckedTreeExpand($event, 'dept')">展开/折叠</el-checkbox>
<el-checkbox v-model="deptNodeAll" @change="handleCheckedTreeNodeAll($event, 'dept')">全选/全不选</el-checkbox>
<el-checkbox v-model="form.deptCheckStrictly" @change="handleCheckedTreeConnect($event, 'dept')">父子联动</el-checkbox>
<el-tree
class="tree-border"
:data="deptOptions"
show-checkbox
default-expand-all
ref="dept"
node-key="id"
:check-strictly="!form.deptCheckStrictly"
empty-text="加载中,请稍候"
:props="defaultProps"
></el-tree>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitDataScope"> </el-button>
<el-button @click="cancelDataScope"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listRole, getRole, delRole, addRole, updateRole, dataScope, changeRoleStatus, deptTreeSelect } from "@/api/system/role";
import { getRole, delRole, addRole, updateRole, dataScope, changeRoleStatus, deptTreeSelect } from "@/api/system/role";
import { treeselect as menuTreeselect, roleMenuTreeselect } from "@/api/system/menu";
import { getProData, getUnitData,getDeviceTypeTree,getAgreementInfoById,submitLeaseApply } from '@/api/claimAndRefund/receive'
import { mapState } from 'vuex'
export default {
name: "Role",
dicts: ['sys_normal_disable'],
data() {
return {
//
loading: true,
loading: false,
//
ids: [],
//
@ -337,12 +219,63 @@ export default {
deptOptions: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
roleName: undefined,
roleKey: undefined,
status: undefined
types:2,
unitId:null,
proId:null,
agreementId:null, //id
companyId:'', //
createBy: '', //
taskType: 29,
taskStatus: 30,
//
leaseApplyInfo:{
leasePerson: '',
phone: '',
remark: ''
},
//
leaseApplyDetails:[]
},
//
leaseApplyDetailsItem:{
createBy: null,
companyId: null,
status: 0,
typeId: null, // 4 id
typeCn:'', //
guigeCn:'', //
unitCn:'', //
remark: '', //
preNum: 1, //
},
//
queryRules:{
unitId:[
{
required:true,message:'请选择来往单位',trigger:'change',type:'number'
}
],
proId:[
{
required:true,message:'请选择工程',trigger:'change',type:'number'
}
]
},
unitList:[], //
proList:[], //
deviceTypeTree: [], //
//
deviceTypeTreeProps: {
multiple:false,
value:'id'
},
//
deviceType: null,
//
form: {},
defaultProps: {
@ -364,18 +297,72 @@ export default {
};
},
created() {
this.getList();
this.GetUnitData()
this.GetProData()
this.GetDeviceTypeTree()
// this.getList();
},
computed:{
...mapState(['user'])
},
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;
//
async GetUnitData(){
const params = {
id:this.queryParams.proId
}
const res = await getUnitData(params)
this.unitList = res.data
this.GetAgreementInfoById()
},
//
async GetProData(){
const params = {
id:this.queryParams.unitId
}
const res = await getProData(params)
this.proList = res.data
this.GetAgreementInfoById()
},
async GetDeviceTypeTree(){
const params = {
level:4
}
const res = await getDeviceTypeTree(params)
this.deviceTypeTree = res.data
},
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
}
}
},
/** 查询角色列表 */
async getList() {
},
/** 查询菜单树结构 */
getMenuTreeselect() {
@ -416,16 +403,7 @@ export default {
});
},
//
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;
@ -489,70 +467,40 @@ export 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 = "添加角色";
/** 保存按钮操作 */
handleAdd() {
this.$refs.queryForm.validate(async (valid) => {
if(!valid){
return false
}else {
if( this.queryParams.leaseApplyDetails.length == 0 ){
this.$message.error('请添加数据');
return
}
this.queryParams.createBy = this.user.name
this.queryParams.companyId = this.user.id
const res = await submitLeaseApply(this.queryParams)
if(res.code == 200){
this.$message({
type:'success',
message: '申请成功'
})
setTimeout(() => {
this.$router.back()
},1000)
}
}
})
},
/** 修改按钮操作 */
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([]);
}
this.$router.back()
},
/** 分配数据权限操作 */
handleDataScope(row) {
this.reset();
@ -595,32 +543,51 @@ export default {
}
});
},
/** 提交按钮(数据权限) */
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('是否确认删除角色编号为"' + roleIds + '"的数据项?').then(function() {
return delRole(roleIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
this.queryParams.leaseApplyDetails.splice(row.index,1)
},
/** 导出按钮操作 */
handleExport() {
this.download('system/role/export', {
...this.queryParams
}, `role_${new Date().getTime()}.xlsx`)
},
///////
deviceTypeChange(val){
const nodes = this.$refs.deviceTypeCascader.getCheckedNodes()
console.log('this.deviceType1 =============',this.deviceType)
if(nodes[0].level != 4){
return
}
this.queryParams.leaseApplyDetails.push(
this.handelTableItemData(nodes[0])
)
// this.$refs.cascader.$refs.panel.clearCheckedNodes()
// //
// this.$refs.cascader.$refs.panel.activePath = []
this.deviceType = {}
console.log('this.deviceType2 =============',this.deviceType)
},
////
handelTableItemData(node){
const template = JSON.parse(JSON.stringify(this.leaseApplyDetailsItem))
template.createBy = this.user.name
template.companyId = this.user.id
template.typeId = node.data.id
template.unitCn = node.data.unitName
template.typeCn = node.pathLabels[2]
template.guigeCn = node.pathLabels[3]
return template
}
}
};

View File

@ -2,35 +2,38 @@
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
<el-form-item label="申请日期" prop="dictName">
<el-input
v-model="queryParams.dictName"
placeholder="请输入申请日期"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
<el-date-picker
v-model="queryParams.time"
type="daterange"
value-format="yyyy-MM-dd"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item label="往来单位" prop="dictName">
<el-input
v-model="queryParams.dictName"
placeholder="请输入往来单位"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
<el-select v-model="queryParams.unitId" clearable @change="GetProData" style="width: 240px" placeholder="请选择">
<el-option
v-for="item in unitList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="工程名称" prop="dictName">
<el-input
v-model="queryParams.dictName"
placeholder="请输入工程名称"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
<el-select v-model="queryParams.proId" clearable @change="GetUnitData" style="width: 240px" placeholder="请选择">
<el-option
v-for="item in proList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="关键字" prop="dictName">
<el-input
v-model="queryParams.dictName"
v-model="queryParams.keyword"
placeholder="请输入关键字"
clearable
style="width: 240px"
@ -79,7 +82,7 @@
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="typeList" @selection-change="handleSelectionChange">
<el-table v-loading="loading" :data="leaseAuditList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" align="center" prop="dictId" />
<el-table-column label="领料单号" align="center" prop="dictName" :show-overflow-tooltip="true" />
@ -174,7 +177,7 @@
<script>
import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus, deptTreeSelect } from "@/api/system/user";
import { listType, getType, delType, addType, updateType, refreshCache } from "@/api/system/dict/type";
import { getLeaseAuditListAll,getUnitData,getProData } from "@/api/claimAndRefund/receive";
export default {
name: "Dict",
dicts: ['sys_normal_disable'],
@ -202,12 +205,23 @@ export default {
dateRange: [],
//
queryParams: {
time:[],
unitId:null,
proId:null,
keyword:'',
types:2,
pageNum: 1,
pageSize: 10,
dictName: undefined,
dictType: undefined,
status: undefined
},
unitList:[],
proList: [],
leaseAuditList:[],
//
form: {},
//
@ -237,14 +251,27 @@ export default {
},
methods: {
/** 查询字典类型列表 */
getList() {
async getList() {
this.loading = true;
listType(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.typeList = response.rows;
this.total = response.total;
this.loading = false;
}
);
console.log( 'this.queryParams =============',this.queryParams )
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,
pageSize: this.queryParams.pageSize,
pageNum: this.queryParams.pageNum
}
const res = await getLeaseAuditListAll(params)
this.loading = false;
console.log('res ============',res)
this.leaseAuditList = res.data.rows;
this.total = res.data.total;
},
//
cancel() {