add:日常需求迭代

This commit is contained in:
zhangzhiqiang
2023-03-17 19:08:22 +08:00
parent 4b1ef310fc
commit c36cb73bcf
11 changed files with 209 additions and 71 deletions

View File

@@ -1,9 +1,9 @@
<template>
<el-dialog
v-loading.fullscreen.lock="fullscreenLoading"
append-to-body
title="待检入库量"
:visible.sync="dialogVisible"
v-loading.fullscreen.lock="fullscreenLoading"
destroy-on-close
:show-close="false"
fullscreen
@@ -13,39 +13,48 @@
<el-row :gutter="20">
<el-col :span="20" style="border: 1px solid white">
物料:<el-select
v-model="queryrow.material_id"
clearable
size="mini"
placeholder="请选择物料"
style="width: 200px"
class="filter-item"
@change="MyQuery"
>
<el-option
v-for="item in XLList"
:key="item.material_id"
:label="item.material_name"
:value="item.material_id"
/>
v-model="queryrow.material_id"
clearable
size="mini"
placeholder="请选择物料"
style="width: 200px"
class="filter-item"
@change="MyQuery"
>
<el-option
v-for="item in XLList"
:key="item.material_id"
:label="item.material_name"
:value="item.material_id"
/>
</el-select>
供应商:<el-input
v-model="queryrow.source_name"
size="mini"
style="width: 200px"
clearable
placeholder="模糊查询"
@change="MyQuery3"
/>
</el-col>
<el-col :span="4">
<span>
<!--左侧插槽-->
<slot name="left" />
<el-button slot="left" type="success" @click="MyQuery2">查询</el-button>
<el-button slot="left" type="info" @click="dialogVisible = false">关闭</el-button>
<el-button
slot="right"
class="filter-item"
type="success"
size="mini"
@click="downExcel"
>
</el-row>
<el-col :span="4">
<span>
<!--左侧插槽-->
<slot name="left" />
<el-button slot="left" type="success" @click="MyQuery2">查询</el-button>
<el-button slot="left" type="info" @click="dialogVisible = false">关闭</el-button>
<el-button
slot="right"
class="filter-item"
type="success"
size="mini"
@click="downExcel"
>
导出Excel
</el-button>
</span>
</el-col>
</span>
</el-col>
</el-row>
<!--表格渲染-->
<el-table
@@ -66,7 +75,7 @@
<el-table-column prop="pcsn" label="批次" min-width="100" />
<el-table-column prop="receive_qty" label="订单重量" min-width="100" :formatter="crud.formatNum2" />
<el-table-column prop="noin_qty" label="剩余重量" min-width="100" :formatter="crud.formatNum2" />
<el-table-column prop="source_name" label="供应商" min-width="100" />
<el-table-column prop="source_name" label="供应商" min-width="100" />
</el-table>
</el-dialog>
</template>
@@ -98,7 +107,7 @@ export default {
cxjList: [],
XLList: [],
fullscreenLoading: false,
queryrow: { material_id: '' },
queryrow: { material_id: '', source_name: '' },
sortable: null,
rows: []
}
@@ -151,6 +160,7 @@ export default {
},
close() {
this.queryrow.material_id = ''
this.queryrow.source_name = ''
this.tableDtl = []
this.$emit('update:dialogShow', false)
},
@@ -164,6 +174,16 @@ export default {
this.fullscreenLoading = false
})
},
MyQuery3(value) {
this.queryrow.source_name = value
this.fullscreenLoading = true
report.query2(this.queryrow).then(res => {
this.tableDtl = res
this.fullscreenLoading = false
}).catch(() => {
this.fullscreenLoading = false
})
},
getSummaries(param) {
const { columns, data } = param
const sums = []

View File

@@ -28,6 +28,19 @@
:value="item.material_id"
/>
</el-select>
供应商:<el-input
v-model="queryrow.source_name"
size="mini"
style="width: 200px"
clearable
placeholder="模糊查询"
@change="MyQuery3"
/>
<el-checkbox
v-model="queryrow.hide"
style="color: red"
@change="MyQuery4"
>隐藏在途重量为零</el-checkbox>
</el-col>
<el-col :span="4">
<span>
@@ -42,8 +55,8 @@
size="mini"
@click="downExcel"
>
导出Excel
</el-button>
导出Excel
</el-button>
</span>
</el-col>
</el-row>
@@ -67,6 +80,7 @@
<el-table-column prop="notqty" label="在途重量" min-width="100" :formatter="crud.formatNum2" />
<el-table-column prop="norigtaxprice" label="含税单价" min-width="100" :formatter="crud.formatNum2" />
<el-table-column prop="norigtaxmny" label="金额" min-width="100" :formatter="crud.formatNum2" />
<el-table-column prop="notmny" label="在途金额" min-width="100" :formatter="crud.formatNum2" />
<el-table-column prop="name" label="供应商" min-width="150" />
</el-table>
</el-dialog>
@@ -99,7 +113,7 @@ export default {
cxjList: [],
XLList: [],
fullscreenLoading: false,
queryrow: { material_id: '' },
queryrow: { material_id: '', source_name: '', hide: true },
sortable: null,
rows: []
}
@@ -152,6 +166,8 @@ export default {
},
close() {
this.queryrow.material_id = ''
this.queryrow.source_name = ''
this.queryrow.hide = true
this.tableDtl = []
this.$emit('update:dialogShow', false)
},
@@ -165,6 +181,26 @@ export default {
this.fullscreenLoading = false
})
},
MyQuery3(value) {
this.queryrow.source_name = value
this.fullscreenLoading = true
report.query3(this.queryrow).then(res => {
this.tableDtl = res
this.fullscreenLoading = false
}).catch(() => {
this.fullscreenLoading = false
})
},
MyQuery4(value) {
this.queryrow.hide = value
this.fullscreenLoading = true
report.query3(this.queryrow).then(res => {
this.tableDtl = res
this.fullscreenLoading = false
}).catch(() => {
this.fullscreenLoading = false
})
},
getSummaries(param) {
const { columns, data } = param
const sums = []
@@ -212,6 +248,18 @@ export default {
sums[index] = parseFloat(total).toFixed(3)
sums[index]
}
if (column.property === 'notmny') {
const total = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return prev + curr
} else {
return prev
}
}, 0)
sums[index] = parseFloat(total).toFixed(3)
sums[index]
}
})
return sums
},

View File

@@ -12,16 +12,16 @@
label-suffix=":"
>
<el-form-item label="统计日期">
<el-date-picker
v-model="query.createTime"
type="daterange"
value-format="yyyy-MM-dd HH:mm:ss"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="['00:00:00', '23:59:59']"
@input="onInput()"
@change="mytoQuery"
/>
<el-date-picker
v-model="query.createTime"
type="daterange"
value-format="yyyy-MM-dd HH:mm:ss"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="['00:00:00', '23:59:59']"
@input="onInput()"
@change="mytoQuery"
/>
</el-form-item>
<el-form-item label="所属组织">
<el-select
@@ -69,7 +69,9 @@
</el-table-column>
</template>
</el-table>
<div ref="topScroll" class="top-scroll" @scroll="handleScrollTop">
<div class="top-scroll-content" :style="{ width: topScrollWidth }" />
</div>
<el-table
ref="dtl_table"
v-loading="crud.loading"
@@ -94,13 +96,24 @@
</div>
</template>
<style>
/*顶部滚动条*/
.top-scroll {
overflow-x: auto;
overflow-y: hidden;
}
.top-scroll .top-scroll-content {
background-color: #fff;
height: 15px;
}
.el-table .warning-row {
background: oldlace;
}
.el-table .success-row {
background: #f0f9eb;
}
.el-table__body-wrapper {
display: block;
}
</style>
<script>
import report from '@/api/wms/statistics/report'
@@ -140,6 +153,7 @@ export default {
},
data() {
return {
topScrollWidth: 10,
cols: [],
cols2: [],
dtlList: [],
@@ -163,6 +177,12 @@ export default {
this.crud.query.createTime = [new Date(), new Date().daysLater(30)]
},
methods: {
handleScrollTop() {
if (this.$refs.topScroll) {
var scrollLeft = this.$refs.topScroll.scrollLeft
this.$refs.dtl_table.bodyWrapper.scrollTo(scrollLeft, 0)
}
},
// 钩子在获取表格数据之前执行false 则代表不获取数据
[CRUD.HOOK.beforeRefresh]() {
report.getHeader().then(res => {
@@ -179,6 +199,12 @@ export default {
const data = this.crud.query
report.materPlanDtlQuery(data).then(res => {
this.dtlList = res.content
this.topScrollWidth = this.$refs.dtl_table.bodyWrapper.scrollWidth + 'px'
this.tableDom = this.$refs.dtl_table.bodyWrapper
this.tableDom.addEventListener('scroll', () => {
var scrollLeft = this.tableDom.scrollLeft
this.$refs.topScroll.scrollTo(scrollLeft, 0)
})
})
crudInspectionsheetmst.getStatus().then(res => {
this.statusList = res