yufei_wang
2 months ago
2 changed files with 197 additions and 0 deletions
@ -0,0 +1,112 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import * as ItembasicApi from '@/api/wms/itembasic' |
|||
import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data' |
|||
/** |
|||
* @returns {Array} 库存余额 |
|||
*/ |
|||
|
|||
|
|||
export const BalanceSummarySearch = useCrudSchemas( |
|||
reactive<CrudSchema[]>([ |
|||
{ |
|||
label: '物料代码', |
|||
field: 'itemCode', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
isSearch: true, |
|||
search: { |
|||
componentProps: { |
|||
enterSearch: true, //可输入回车
|
|||
isSearchList: true, // 开启查询弹窗
|
|||
searchListPlaceholder: '请选择物料代码', // 输入框占位文本
|
|||
searchField: 'code', // 查询弹窗赋值字段
|
|||
searchTitle: '物料基础信息', // 查询弹窗标题
|
|||
searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类
|
|||
searchPage: ItembasicApi.getItembasicPage, // 查询弹窗所需分页方法
|
|||
searchCondition: [{ |
|||
key: 'available', |
|||
value: 'TRUE', |
|||
isMainValue: false |
|||
}], |
|||
verificationParams: [{ |
|||
key: 'code', |
|||
action: '==', |
|||
value: '', |
|||
isMainValue: false, |
|||
isSearch: 'true', |
|||
isFormModel: true |
|||
}], // 失去焦点校验参数
|
|||
} |
|||
} |
|||
},{ |
|||
label: '物料描述', |
|||
field: 'desc1', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
isSearch: true, |
|||
search: { |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
} |
|||
} |
|||
]) |
|||
) |
|||
|
|||
export const BalanceSummary = useCrudSchemas( |
|||
reactive<CrudSchema[]>([ |
|||
{ |
|||
label: ' ', |
|||
field: 'name', |
|||
sort: 'custom', |
|||
}, |
|||
{ |
|||
label: '总数', |
|||
field: 'num1', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '合格数', |
|||
field: 'num2', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
isSearch: true |
|||
}, |
|||
{ |
|||
label: '待检数', |
|||
field: 'num2', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
isSearch: true |
|||
}, |
|||
{ |
|||
label: '隔离数', |
|||
field: 'num2', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
isSearch: true |
|||
}, |
|||
{ |
|||
label: '不合格数', |
|||
field: 'num2', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
isSearch: true |
|||
} |
|||
]) |
|||
) |
@ -0,0 +1,85 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search :schema="BalanceSummarySearch.allSchemas.searchSchema" @search="searchList" @reset="searchList" @searchTableSuccess="searchQueryTableSuccess"/> |
|||
</ContentWrap> |
|||
<el-table |
|||
:data="tableData" |
|||
style="width: 100%" |
|||
row-key="id" |
|||
border |
|||
lazy |
|||
:load="load" |
|||
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }" |
|||
> |
|||
<el-table-column v-for="column in tableColumns" :prop="column['field']" :label="column['label']" :width="column['width']" :fixed="column['fixed']" :align="column['align']||'center'"/> |
|||
</el-table> |
|||
</template> |
|||
<script setup lang="ts"> |
|||
import { BalanceSummary,BalanceSummarySearch } from './balanceSummary.data' |
|||
const tableColumns = ref(BalanceSummary.allSchemas.tableColumns) |
|||
console.log('tableColumns',tableColumns) |
|||
const tableData= ref([ |
|||
{ |
|||
id: 1, |
|||
date: '2016-05-02', |
|||
name: 'wangxiaohu', |
|||
num: 1, |
|||
}, |
|||
{ |
|||
id: 2, |
|||
date: '2016-05-04', |
|||
name: 'wangxiaohu', |
|||
num: 2, |
|||
}, |
|||
{ |
|||
id: 3, |
|||
date: '2016-05-01', |
|||
name: 'wangxiaohu', |
|||
hasChildren: true, |
|||
num: 3, |
|||
}, |
|||
{ |
|||
id: 4, |
|||
date: '2016-05-03', |
|||
name: 'wangxiaohu', |
|||
num: 4, |
|||
}, |
|||
]) |
|||
const load = ( row, treeNode,resolve) => { |
|||
console.log('load',row, treeNode,resolve) |
|||
setTimeout(() => { |
|||
resolve([ |
|||
{ |
|||
id: Math.random(), |
|||
date: '2016-05-01', |
|||
name: 'wangxiaohu', |
|||
num: 5, |
|||
}, |
|||
{ |
|||
id: Math.random(), |
|||
date: '2016-05-01', |
|||
name: 'wangxiaohu', |
|||
num: 6, |
|||
hasChildren: true, |
|||
}, |
|||
]) |
|||
}, 1000) |
|||
} |
|||
|
|||
const searchList = (model)=>{ |
|||
console.log('searchList',model) |
|||
|
|||
} |
|||
|
|||
const searchQueryTableSuccess = (formField, searchField, val, formRef, type, row ) => { |
|||
console.log('searchQueryTableSuccess',formField, searchField, val, formRef, type, row ) |
|||
nextTick(() => { |
|||
const setV = {} |
|||
setV[formField] = val[0][searchField] |
|||
setV['desc1'] = val[0]['desc1'] |
|||
formRef.setValues(setV) |
|||
}) |
|||
} |
|||
</script> |
|||
<style lang="scss" scoped></style> |
Loading…
Reference in new issue