Browse Source

Merge branch 'master_hella' of http://dev.ccwin-in.com:3000/sfms3.0/sfms3.0-ui into master_hella

master_hella_20240701
songguoqiang 5 months ago
parent
commit
7e8a2b213d
  1. 48
      src/components/SearchTable/src/SearchTable.vue
  2. 40
      src/components/Table/src/Table.vue
  3. 3
      src/locales/en-US.ts
  4. 3
      src/locales/zh-CN.ts
  5. 40
      src/utils/disposition/defaultButtons.ts
  6. 3
      src/views/wms/inventoryjobManage/inventoryinitial/inventoryinitRecordMain/index.vue
  7. 1
      src/views/wms/purchasereceiptManage/sparereceipt/sparereceiptRequestMain/sparereceiptRequestMain.data.ts

48
src/components/SearchTable/src/SearchTable.vue

@ -10,6 +10,7 @@
:HeadButttondata="HeadButttondata"
:routeName="routeName"
@searchFormClick="searchFormClick"
@buttonBaseClick="buttonBaseClick"
:allSchemas="allSchemasRef"
/>
<ContentWrap>
@ -26,6 +27,7 @@
v-model:sort="tableObjectRef.sort"
:searchTableSelectionsList="searchTableSelectionsList"
:selection="true"
:selectionTotal="multipleBol"
:reserveSelection="true"
row-key="id"
/>
@ -53,10 +55,18 @@ routeName.value = route.name
const searchDialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const multipleBol = ref(false)
//
const HeadButttondata = ref([
const HeadButttondata = ref(multipleBol.value?
[
defaultButtons.defaultWhenPageBtn(null), //
defaultButtons.defaultUnselectPageBtn(null), //
defaultButtons.defaultDeselectAllBtn(null), //
defaultButtons.defaultFilterBtn(null), //
]:[
defaultButtons.defaultFilterBtn(null) //
])
/** 打开弹窗 */
@ -71,28 +81,39 @@ const searchFieldRef = ref()
const typeRef = ref()
const rowRef = ref()
const allSchemasRef = ref()
const multipleBol = ref(false)
const searchConditionRef = ref()
const searchTableSelectionsList = ref()//
const openData = (titleName: any, tableObject:any ,allSchemas: any,multiple: any) => {
dialogWidth.value = '80%'
HeadButttondata.value = [
multipleBol.value = multiple
HeadButttondata.value = multiple?[
defaultButtons.defaultWhenPageBtn(null), //
defaultButtons.defaultUnselectPageBtn(null), //
defaultButtons.defaultDeselectAllBtn(null), //
defaultButtons.defaultFilterBtn(null), //
]:[
defaultButtons.defaultFilterBtn(null), //
]
dialogTitle.value = t(`ts.${titleName}`).replace('ts.','')
tableObjectRef.value = tableObject
searchDialogVisible.value = true
multipleBol.value = multiple
allSchemasRef.value = allSchemas
searchSchema.value = allSchemas.searchSchema
tableColumns.value = allSchemas.tableColumns
}
const open = (titleName: any, allSchemas: any,getApiPage: any, formField: any, searchField: any,multiple: any, type: any, row: any, searchCondition:any , isCountRequestRe:any,isConcatDetailSchemas=false,detailSchemas: any, searchTableSelections:any) => {
dialogWidth.value = '80%'
HeadButttondata.value = [
multipleBol.value = multiple
HeadButttondata.value = multiple?[
defaultButtons.defaultWhenPageBtn(null), //
defaultButtons.defaultUnselectPageBtn(null), //
defaultButtons.defaultDeselectAllBtn(null), //
defaultButtons.defaultFilterBtn(null), //
]
]:
[
defaultButtons.defaultFilterBtn(null), //
]
searchDialogVisible.value = true
formFieldRef.value = formField
searchFieldRef.value = searchField
@ -108,7 +129,6 @@ const open = (titleName: any, allSchemas: any,getApiPage: any, formField: any, s
getPage.value = getApiPage
typeRef.value = type
rowRef.value = row
multipleBol.value = multiple
// dialogTitle.value = t('action.' + type)
dialogTitle.value = t(`ts.${titleName}`).replace('ts.','')
searchTableSelectionsList.value = searchTableSelections
@ -175,6 +195,20 @@ const searchFormClick = (searchData) => {
}
getListRef.value() //
}
const buttonBaseClick = (val, item) => {
//
if (val == 'DeselectAll') {
//
searchTableRef.value.clearSelection()
} else if (val == 'UnselectPage') {
//
searchTableRef.value.togglePageSelection()
} else if (val == 'WhenPage') {
//
searchTableRef.value.toggleAllSelection(true)
}
}
defineExpose({ open,openData,hiddenFilterButton ,changeDialogWidth}) // open

40
src/components/Table/src/Table.vue

@ -21,6 +21,8 @@ export default defineComponent({
currentPage: propTypes.number.def(1),
//
selection: propTypes.bool.def(false),
//
selectionTotal: propTypes.bool.def(false),
// schemashowOverflowTooltip,
showOverflowTooltip: propTypes.bool.def(true),
//
@ -115,12 +117,36 @@ export default defineComponent({
const selections = ref<Recordable[]>([])
const sortRef = ref()
//
const selectRow = ()=>{
emit('getSelectionRows', currentPageRef.value,elTableRef.value?.getSelectionRows())
}
const selectAll = (val)=>{
//
const selectAll = ()=>{
emit('getSelectionRows', currentPageRef.value,elTableRef.value?.getSelectionRows())
}
//
const togglePageSelection = ()=>{
unref(getProps).data.forEach(row=>{
elTableRef.value!.toggleRowSelection(row)
})
}
// /
const toggleAllSelection = (isAll)=>{
if(isAll){
//
if(elTableRef.value?.getSelectionRows().length<unref(getProps).data.length){
elTableRef.value!.toggleAllSelection()
}
}
}
//
const clearSelection = ()=>{
console.log('clearSelection')
elTableRef.value!.clearSelection()
}
const selectionChange = (selection: Recordable[]) => {
selections.value = selection
}
@ -134,7 +160,11 @@ export default defineComponent({
setProps,
setColumn,
selections,
toggleRowSelection
toggleRowSelection,
selectAll,
toggleAllSelection,
togglePageSelection,
clearSelection
})
const pagination = computed(() => {
@ -358,13 +388,15 @@ export default defineComponent({
append: () => getSlot(slots, 'append')
}}
</ElTable>
{unref(getProps).selectionTotal ? (
<div class="mt-5px">已选{selections.value.length}条数据</div>
):undefined}
{unref(getProps).pagination ? (
// update by Pagination
<ElPagination
v-model:pageSize={pageSizeRef.value}
v-model:currentPage={currentPageRef.value}
class="float-right mb-15px mt-15px"
class="float-right mt-15px"
{...unref(pagination)}
></ElPagination>
) : undefined}

3
src/locales/en-US.ts

@ -864,6 +864,9 @@ export default {
:'Export',
:'Refresh',
:'Filter',
:'As Page',
:'Unselect Page',
:'Deselect All',
:'Settings',
:'Confirm',
'确 定':'Confirm',

3
src/locales/zh-CN.ts

@ -864,6 +864,9 @@ export default {
:'导出',
:'刷新',
:'筛选',
:'选择当页',
:'反选当页',
:'取消全选',
:'设置',
:'确定',
'确 定':'确 定',

40
src/utils/disposition/defaultButtons.ts

@ -159,7 +159,45 @@ export function defaultSearchResetBtn(option:any) {
hasPermi: ''
})
}
// 选择当页
export function defaultWhenPageBtn(option:any) {
return __defaultBtnOption(option,{
label: t(`ts.选择当页`).replace('ts.', ''),
name: 'WhenPage',
hide: false,
type: 'primary',
color: '',
float:'right',
link: false, // 文本展现按钮
hasPermi: ''
})
}
// 反选当页
export function defaultUnselectPageBtn(option:any) {
return __defaultBtnOption(option,{
label: t(`ts.反选当页`).replace('ts.', ''),
name: 'UnselectPage',
hide: false,
type: 'primary',
color: '',
float:'right',
link: false, // 文本展现按钮
hasPermi: ''
})
}
// 取消全选
export function defaultDeselectAllBtn(option:any) {
return __defaultBtnOption(option,{
label: t(`ts.取消全选`).replace('ts.', ''),
name: 'DeselectAll',
hide: false,
type: 'primary',
color: '',
float:'right',
link: false, // 文本展现按钮
hasPermi: ''
})
}
// form表单-保存按钮
export function formSaveBtn(option:any) {
return __defaultBtnOption(option,{

3
src/views/wms/inventoryjobManage/inventoryinitial/inventoryinitRecordMain/index.vue

@ -221,6 +221,9 @@ const handleSelectionPoint = async ()=>{
const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken())
window.open(src.value+'&asn_number='+res.cgLabel)
}
if(!res.cgLabel&&!res.zzLabel){
message.error('包装不存在,无法打印')
}
}).catch(err => {
console.log(err)
getLoading?.close()

1
src/views/wms/purchasereceiptManage/sparereceipt/sparereceiptRequestMain/sparereceiptRequestMain.data.ts

@ -796,6 +796,7 @@ export const PurchasereceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]
},
sortTableDefault:9,
tableForm: {
disabled:true,
type: 'InputNumber',
min: 1,
precision: 6

Loading…
Cancel
Save