Commit 99112f72 authored by CenXinYi's avatar CenXinYi

实现出入库记录根据操作时间进行排序功能

Signed-off-by: 's avatarCenXinYi <2810162984@qq.com>
parent ee44182c
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
:data="allTableArguments.List" :data="allTableArguments.List"
style="width: 100%;" style="width: 100%;"
@selection-change="handleSelectionChange(row)" @selection-change="handleSelectionChange(row)"
@sort-change="changeTableSort"
> >
<el-table-column type="index" label="序号" width="50" /> <el-table-column type="index" label="序号" width="50" />
...@@ -101,6 +102,9 @@ export default { ...@@ -101,6 +102,9 @@ export default {
} }
}, },
methods: { methods: {
changeTableSort(val) {
this.$emit('change-table-sort', val)
},
handleSelectionChange(row) { handleSelectionChange(row) {
this.$emit('handle-selection-change', row) this.$emit('handle-selection-change', row)
}, },
......
...@@ -115,6 +115,7 @@ ...@@ -115,6 +115,7 @@
:key="queryParams.rows" :key="queryParams.rows"
:all-table-arguments="allTableArguments" :all-table-arguments="allTableArguments"
@handle-detail="handleDetail" @handle-detail="handleDetail"
@change-table-sort="changeTableSort"
/> />
</transition> </transition>
<!--TODO: 分页组件--> <!--TODO: 分页组件-->
...@@ -280,6 +281,10 @@ export default { ...@@ -280,6 +281,10 @@ export default {
rows: 10 rows: 10
}, },
queryEntity: { queryEntity: {
// TODO: 0表示倒序排序,1表示顺序排序
tableSortMark: 0,
entity: { entity: {
// TODO: 设备编码 // TODO: 设备编码
pn: '', pn: '',
...@@ -354,6 +359,7 @@ export default { ...@@ -354,6 +359,7 @@ export default {
{ {
time: true, time: true,
prop: 'createDate', prop: 'createDate',
sortable: 'custom',
label: '操作时间', label: '操作时间',
align: 'center' align: 'center'
}, },
...@@ -426,6 +432,7 @@ export default { ...@@ -426,6 +432,7 @@ export default {
/** TODO:查询工序库的出入库记录列表 */ /** TODO:查询工序库的出入库记录列表 */
getList() { getList() {
this.loading = true this.loading = true
console.log('66666')
listLog(this.queryParams, this.addDateRange(this.queryEntity, this.dateRange)).then(response => { listLog(this.queryParams, this.addDateRange(this.queryEntity, this.dateRange)).then(response => {
this.inventoryRecordList = response.rows this.inventoryRecordList = response.rows
this.total = response.total this.total = response.total
...@@ -478,6 +485,18 @@ export default { ...@@ -478,6 +485,18 @@ export default {
this.activateAbandonedState = false this.activateAbandonedState = false
this.singleLogIdAndFqYs = {} this.singleLogIdAndFqYs = {}
}, },
/* TODO: 进行排序 */
changeTableSort: function(val) {
console.log('column', val)
// TODO:按照降序排序
if (val.order === 'descending') {
this.queryEntity.tableSortMark = 0
} else {
// TODO:按照升序排序
this.queryEntity.tableSortMark = 1
}
this.getList()
},
/* TODO: 获取详情信息*/ /* TODO: 获取详情信息*/
handleDetail: function(row) { handleDetail: function(row) {
/* TODO: 如果库状态为‘废弃’,即为‘4’时,则可以进入 */ /* TODO: 如果库状态为‘废弃’,即为‘4’时,则可以进入 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment