|
|
@@ -24,8 +24,8 @@
|
|
|
style="width:200px">
|
|
|
<Option v-for="item in warehouseList"
|
|
|
:key="item.id"
|
|
|
- :value="item.id"
|
|
|
- :label="item.title">
|
|
|
+ :value="item.type_id"
|
|
|
+ :label="item.type_title">
|
|
|
</Option>
|
|
|
</Select>
|
|
|
</FormItem>
|
|
|
@@ -55,15 +55,14 @@
|
|
|
</Option>
|
|
|
</Select>
|
|
|
</FormItem>
|
|
|
- <FormItem label='规格型号'>
|
|
|
- <Select>
|
|
|
- <Option/>
|
|
|
- </Select>
|
|
|
+ <FormItem label='规格型号'>
|
|
|
+ <Select v-model="searchData.material_detail_id" filterable multiple style="width:200px">
|
|
|
+ <Option v-for="(item,index) in material_list" :key="index" :value="item.material_detail_id" :label='`${item.long?item.long:0}*${item.width?item.width:0}*${item.high?item.high:0}`'/>
|
|
|
+ </Select>
|
|
|
</FormItem>
|
|
|
<FormItem label="显示零结存">
|
|
|
<Select v-model="searchData.state"
|
|
|
clearable
|
|
|
- multiple
|
|
|
placeholder='请选择'
|
|
|
filterable
|
|
|
style="width:200px">
|
|
|
@@ -89,7 +88,8 @@
|
|
|
<div class="warehouseList_content">
|
|
|
<Table :columns="tableColums"
|
|
|
:data="tableData"
|
|
|
- border>
|
|
|
+ border
|
|
|
+ :span-method="handleSpan">
|
|
|
</Table>
|
|
|
<div class="pageSlotStyle">
|
|
|
<Page :page-size-opts="[10, 20, 30, 40,100,1000]"
|
|
|
@@ -114,9 +114,11 @@ export default {
|
|
|
data () {
|
|
|
// 这里存放数据
|
|
|
return {
|
|
|
+ material_list:[],
|
|
|
searchData: {
|
|
|
warehouse_id: null,
|
|
|
material_type_id: null,
|
|
|
+ material_detail_id:[],
|
|
|
material_id: null,
|
|
|
state: null,
|
|
|
date: null,
|
|
|
@@ -129,51 +131,29 @@ export default {
|
|
|
title: '规格型号', align: 'center', key: 'renovation_type', minWidth: 180,
|
|
|
render: (h, params) => {
|
|
|
const { row } = params
|
|
|
- let text = `L${row.long}*W${row.width}*H${row.high}`
|
|
|
- return h('span', {}, text)
|
|
|
+ let text = `L${row.long?row.long:0}*W${row.width?row.width:0}*H${row.high?row.high:0}`
|
|
|
+ return row.warehouse_title=='合计'?h('span', {}, ''):h('span',{},text)
|
|
|
}
|
|
|
},
|
|
|
{ title: '计量单位', align: 'center', key: 'unit', minWidth: 80 },
|
|
|
- { title: '期初数量', align: 'center', key: 'before_num', minWidth: 100 },
|
|
|
+ { title: '期初数量', align: 'center', key: 'begin_num', minWidth: 100 },
|
|
|
{
|
|
|
- title: '期初单价', align: 'center', key: 'before_price', minWidth: 100,
|
|
|
- render: (h, params) => {
|
|
|
- const { row } = params
|
|
|
- let text = (Number(row.before_total_price) / Number(row.before_num)).toFixed(6)
|
|
|
- return h('span', {}, text)
|
|
|
- }
|
|
|
- },
|
|
|
- { title: '期初金额', align: 'center', key: 'before_total_price', minWidth: 100 },
|
|
|
- { title: '收入数量', align: 'center', key: 'in_num', minWidth: 100 },
|
|
|
+ title: '期初单价', align: 'center', key: 'begin_price', minWidth: 100 },
|
|
|
+ { title: '期初金额', align: 'center', key: 'begin_total_price', minWidth: 100 },
|
|
|
+ { title: '收入数量', align: 'center', key: 'order_in_num', minWidth: 100 },
|
|
|
{
|
|
|
- title: '收入单价', align: 'center', key: 'in_price', minWidth: 100,
|
|
|
- render: (h, params) => {
|
|
|
- const { row } = params
|
|
|
- let text = (Number(row.in_total_price) / Number(row.in_num)).toFixed(6)
|
|
|
- return h('span', {}, text)
|
|
|
- }
|
|
|
- },
|
|
|
- { title: '收入金额', align: 'center', key: 'in_total_price', minWidth: 100 },
|
|
|
- { title: '发出数量', align: 'center', key: 'out_num', minWidth: 100 },
|
|
|
+ title: '收入单价', align: 'center', key: 'order_in_price', minWidth: 100,},
|
|
|
+ { title: '收入金额', align: 'center', key: 'order_in_total_price', minWidth: 100 },
|
|
|
+ { title: '发出数量', align: 'center', key: 'order_out_num', minWidth: 100 },
|
|
|
{
|
|
|
- title: '发出单价', align: 'center', key: 'out_price', minWidth: 100,
|
|
|
- render: (h, params) => {
|
|
|
- const { row } = params
|
|
|
- let text = (Number(row.out_total_price) / Number(row.out_num)).toFixed(6)
|
|
|
- return h('span', {}, text)
|
|
|
- }
|
|
|
+ title: '发出单价', align: 'center', key: 'order_out_price', minWidth: 100,
|
|
|
},
|
|
|
- { title: '发出金额', align: 'center', key: 'out_total_price', minWidth: 100 },
|
|
|
- { title: '结存数量', align: 'center', key: 'after_num', minWidth: 100 },
|
|
|
+ { title: '发出金额', align: 'center', key: 'order_out_total_price', minWidth: 100 },
|
|
|
+ { title: '结存数量', align: 'center', key: 'order_finish_num', minWidth: 100 },
|
|
|
{
|
|
|
- title: '结存单价', align: 'center', key: 'after_price', minWidth: 100,
|
|
|
- render: (h, params) => {
|
|
|
- const { row } = params
|
|
|
- let text = (Number(row.after_total_price) / Number(row.after_num)).toFixed(6)
|
|
|
- return h('span', {}, text)
|
|
|
- }
|
|
|
+ title: '结存单价', align: 'center', key: 'order_finish_price', minWidth: 100,
|
|
|
},
|
|
|
- { title: '结存金额', align: 'center', key: 'after_total_price', minWidth: 100 },
|
|
|
+ { title: '结存金额', align: 'center', key: 'order_finish_total_price', minWidth: 100 },
|
|
|
// {
|
|
|
// title: '单价', align: 'center', key: '', minWidth: 100,
|
|
|
// render: (h, params) => {
|
|
|
@@ -227,9 +207,39 @@ export default {
|
|
|
this.axios('/api/material').then(res => { this.materialNameList = res.data.data })
|
|
|
},
|
|
|
methods: {
|
|
|
+ handleSpan({ row, column, rowIndex, columnIndex }){
|
|
|
+
|
|
|
+ if(row.warehouse_title == '合计'&&column.key == 'warehouse_title'){
|
|
|
+ return {
|
|
|
+ rowspan: 1,
|
|
|
+ colspan: 5
|
|
|
+ };
|
|
|
+ }else if(row.warehouse_title == '合计'&&column.key == 'material_type_title'){
|
|
|
+ return{
|
|
|
+ rowspan:0,
|
|
|
+ colspan:0
|
|
|
+ }
|
|
|
+ }else if(row.warehouse_title == '合计'&&column.key == 'material_title'){
|
|
|
+ return{
|
|
|
+ rowspan:0,
|
|
|
+ colspan:0
|
|
|
+ }
|
|
|
+ }else if(row.warehouse_title == '合计'&&column.key == 'renovation_type'){
|
|
|
+ return{
|
|
|
+ rowspan:0,
|
|
|
+ colspan:0
|
|
|
+ }
|
|
|
+ }else if(row.warehouse_title == '合计'&&column.key == 'unit'){
|
|
|
+ return{
|
|
|
+ rowspan:0,
|
|
|
+ colspan:0
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
handleSearchData () {
|
|
|
let obj = {
|
|
|
warehouse_id: this.searchData.warehouse_id ? this.searchData.warehouse_id.join(',') : null,
|
|
|
+ material_detail_id:this.searchData.material_detail_id,
|
|
|
material_type_id: this.searchData.material_type_id ? this.searchData.material_type_id.join(',') : null,
|
|
|
material_id: this.searchData.material_id ? this.searchData.material_id.join(',') : null,
|
|
|
start_time: this.searchData.date[0] ? this.func.replaceDateNoHMS(this.searchData.date[0]) : null,
|
|
|
@@ -248,9 +258,14 @@ export default {
|
|
|
},
|
|
|
getData (row) {
|
|
|
this.loading = true;
|
|
|
- this.axios('/api/warehouse_stock_out_in_list', { params: row }).then(res => {
|
|
|
+ this.axios.post('/api/warehouse_stock_out_in_list', { ...row }).then(res => {
|
|
|
this.loading = false;
|
|
|
- this.tableData = res.data;
|
|
|
+ this.material_list = res.data.material_list;
|
|
|
+ this.tableData = res.data.data;
|
|
|
+ this.tableData.push({
|
|
|
+ ...res.data.total_list,
|
|
|
+warehouse_title: "合计"
|
|
|
+ })
|
|
|
this.total = res.data.total;
|
|
|
})
|
|
|
},
|