Compare commits

..

2 Commits

2 changed files with 74 additions and 32 deletions

View File

@ -0,0 +1,9 @@
import request from '@/utils/request'
export function getHoldingLedger(query) {
return request({
url: '/base/composite/getHoldingLedger',
method: 'get',
params: query,
})
}

View File

@ -1,10 +1,10 @@
<template>
<div class="app-container" id="ledgerQuery">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="80px">
<el-form-item label="物品类型">
<el-select v-model="queryParams.type" placeholder="选择物品类型" clearable style="width: 240px">
<el-option v-for="item in typeList" :key="item.id" :label="item.type" :value="item.id"></el-option>
</el-select>
<el-form-item label="物品类型" prop="status">
<el-cascader placeholder="请输入物品类型" :options="deviceTypeTree" :props="deviceTypeTreeProps"
:show-all-levels="false" v-model="queryParams.typeId" :emitPath="true" @change="deviceTypeChange"
ref="deviceTypeCascader" filterable style="width: 240px"></el-cascader>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查询</el-button>
@ -19,38 +19,50 @@
</template>
</el-table-column>
<el-table-column label="机具名称" align="center" prop="typeName" :show-overflow-tooltip="true" />
<el-table-column
label="机具规格"
align="center"
prop="typeModelName"
:show-overflow-tooltip="true"
/>
<el-table-column label="规格型号" align="center" prop="maCode" :show-overflow-tooltip="true" />
<el-table-column label="总保有量(付)" align="center" prop="unit" :show-overflow-tooltip="true" />
<el-table-column label="在用数(付)" align="center" prop="preNum" :show-overflow-tooltip="true" />
<el-table-column
label="在库数(付)"
align="center"
prop="leasePerson"
:show-overflow-tooltip="true"
/>
<el-table-column type="expand">
<template slot-scope="scope">
<div class="nested-table-container">
<el-table :data="scope.row.wholeSetDetails" style="width: 100%">
<!-- 子表格的列 -->
<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="typeModelName" :show-overflow-tooltip="true" />
<el-table-column label="生产厂家" align="center" prop="supplier" :show-overflow-tooltip="true" />
<el-table-column label="单位" align="center" prop="unitName" :show-overflow-tooltip="true" />
<el-table-column label="总保有量(付)" align="center" prop="allNum" :show-overflow-tooltip="true" />
<el-table-column label="在用数(付)" align="center" prop="usNum" :show-overflow-tooltip="true" />
<el-table-column label="在库数(付)" align="center" prop="num" :show-overflow-tooltip="true" />
</el-table>
</div>
</template>
</el-table-column>
<el-table-column label="规格型号" align="center" prop="typeModelName" :show-overflow-tooltip="true" />
<el-table-column label="总保有量(付)" align="center" prop="allNum" :show-overflow-tooltip="true" />
<el-table-column label="在用数(付)" align="center" prop="usNum" :show-overflow-tooltip="true" />
<el-table-column label="在库数(付)" align="center" prop="num" :show-overflow-tooltip="true" />
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
:page-sizes="[5,10,15,20,30]"
@pagination="getList"
/>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
:page-sizes="[5, 10, 15, 20, 30]" @pagination="getList" />
</div>
</template>
<script>
import { getHoldingLedger } from "@/api/stquery/ledgerQuery";
import {
getDeviceTypeTree,
} from '@/api/claimAndRefund/receive'
export default {
name: 'ledgerQuery',
data() {
return {
//
deviceTypeTree: [], //
//
deviceTypeTreeProps: {
multiple: false,
value: 'id',
},
//
loading: false,
typeList: [
@ -62,14 +74,22 @@ export default {
queryParams: {
pageNum: 1,
pageSize: 10,
type: undefined,
typeId: undefined,
},
//
total: 0,
}
},
created() {
this.getList()
this.GetDeviceTypeTree()
},
methods: {
getList() {},
async getList() {
const res = await getHoldingLedger(this.queryParams)
console.log(res, 'sss');
this.leaseAuditList = res.data.rows
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
@ -78,9 +98,22 @@ export default {
/** 重置按钮操作 */
resetQuery() {
this.resetForm('queryForm')
this.queryParams.type = null
this.queryParams.typeId = null
this.handleQuery()
},
//
async GetDeviceTypeTree() {
const params = {
level: 4,
}
const res = await getDeviceTypeTree(params)
this.deviceTypeTree = res.data
},
///////
deviceTypeChange(val) {
this.queryParams.typeId = val[val.length - 1];
this.getList()
},
},
}
</script>