|
|
|
@ -0,0 +1,128 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div class="stock">
|
|
|
|
|
<vue-scroll :ops="listScroll" style="height:19rem" v-if="!showLoading && stockData.length > 0"
|
|
|
|
|
class="score-list-div">
|
|
|
|
|
<!--:expandIcon="expandIcon"-->
|
|
|
|
|
<a-table
|
|
|
|
|
class="stockAtable"
|
|
|
|
|
:columns="columns"
|
|
|
|
|
:data-source="stockData"
|
|
|
|
|
|
|
|
|
|
rowKey="name"
|
|
|
|
|
/>
|
|
|
|
|
</vue-scroll>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<script>
|
|
|
|
|
import {Table, Icon} from 'ant-design-vue';
|
|
|
|
|
import InterConfig from '../officeCar/interConfig';
|
|
|
|
|
export default{
|
|
|
|
|
data(){
|
|
|
|
|
return {
|
|
|
|
|
listScroll: this.StaticParams.scrollOption,
|
|
|
|
|
showLoading: true,
|
|
|
|
|
columns: [
|
|
|
|
|
{title: '类别编码', dataIndex: 'supplies_code', width: 100, key: 'supplies_code',},
|
|
|
|
|
{title: '物品(分类)', dataIndex: 'name', width: 120, key: 'name',},
|
|
|
|
|
{title: '计量单位', dataIndex: 'measurement_unit', width: 100, key: 'measurement_unit',},
|
|
|
|
|
{title: '现余库存', dataIndex: 'current_stock', width: 100, key: 'current_stock',},
|
|
|
|
|
// {
|
|
|
|
|
// title: '累计总量',
|
|
|
|
|
// dataIndex: 'cumulative_stock',
|
|
|
|
|
// width: 150,
|
|
|
|
|
// key: 'cumulative_stock',
|
|
|
|
|
// align: 'center'
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// title: '存放位置',
|
|
|
|
|
// dataIndex: 'storage_location',
|
|
|
|
|
// width: 150,
|
|
|
|
|
// key: 'storage_location',
|
|
|
|
|
// align: 'center'
|
|
|
|
|
// },
|
|
|
|
|
// {title: '领用详情', dataIndex: 'is_use', width: 150, key: 'is_use', align: 'center'},
|
|
|
|
|
// {title: '入库详情', dataIndex: 'is_deleted', width: 150, key: 'is_deleted', align: 'center'},
|
|
|
|
|
// {title: '调整详情', dataIndex: 'supplies_type', width: 150, key: 'supplies_type', align: 'center'},
|
|
|
|
|
// {title: '操作', dataIndex: 'used_times', width: 150, key: 'used_times', align: 'center'},
|
|
|
|
|
],
|
|
|
|
|
// supplies_code: '',
|
|
|
|
|
// name: '',
|
|
|
|
|
// measurement_unit: '',
|
|
|
|
|
// current_stock: '',
|
|
|
|
|
// cumulative_stock: '',
|
|
|
|
|
// storage_location: '',
|
|
|
|
|
// is_use: '',
|
|
|
|
|
// is_deleted: '',
|
|
|
|
|
// supplies_type: '',
|
|
|
|
|
// used_times: ''
|
|
|
|
|
stockData: [],
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
components: {
|
|
|
|
|
ATable: Table,
|
|
|
|
|
AIcon: Icon
|
|
|
|
|
},
|
|
|
|
|
created(){
|
|
|
|
|
this.getStockData()
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
expandIcon(props){
|
|
|
|
|
console.log('propppppppppppppppppppppps', props)
|
|
|
|
|
// if (!props.expanded&&props.record.children.length!=0) {
|
|
|
|
|
// return '<a-icon type="caret-right" @click="(e)=>{props.onExpand(props.record, e)}"/>'
|
|
|
|
|
// } else {
|
|
|
|
|
// return '<a-icon type="caret-down" />'
|
|
|
|
|
// }
|
|
|
|
|
},
|
|
|
|
|
getStockData(){
|
|
|
|
|
let param = {
|
|
|
|
|
org_id: this.BaseConfig.person_info_my.bureau_id,
|
|
|
|
|
person_id: this.BaseConfig.userInfo.person_id,
|
|
|
|
|
list_or_child: 2,
|
|
|
|
|
// org_id //机构id,必填
|
|
|
|
|
//person_id //当前登录人员ID,必填
|
|
|
|
|
// parent_id int //父ID,非必填
|
|
|
|
|
//supplies_type //1表示只查分类,不传或传其他则查全部,非必填
|
|
|
|
|
//list_or_child//默认1表示list形式,2表示children形式,非必填
|
|
|
|
|
//is_use//1表示可领用,2全部,不传查全部,非必填
|
|
|
|
|
}
|
|
|
|
|
this.InterfaceConfig.callInterface([{
|
|
|
|
|
url: InterConfig.getStock.url,
|
|
|
|
|
params: param,
|
|
|
|
|
method: InterConfig.getStock.method,
|
|
|
|
|
isTestLogin: InterConfig.getStock.isTestLogin,
|
|
|
|
|
}], (result) => {
|
|
|
|
|
//console.log('即时库存数据', result)
|
|
|
|
|
if (result[0].data.code === 2000) {
|
|
|
|
|
this.showLoading = false
|
|
|
|
|
const {list, msg} = result[0].data.data
|
|
|
|
|
this.stockData = list
|
|
|
|
|
//console.log('111111', this.stockData)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
.stock {
|
|
|
|
|
width: 96%;
|
|
|
|
|
min-height: 19rem;
|
|
|
|
|
margin: 10px;
|
|
|
|
|
.score-list-div {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 15rem;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
}
|
|
|
|
|
.stockAtable {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
/*overflow-y: scroll;*/
|
|
|
|
|
/*overflow-x: scroll;*/
|
|
|
|
|
border: 1px solid #1a5cd7;
|
|
|
|
|
border-radius: 10px;
|
|
|
|
|
background-color: #e9e9e9;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|