Browse Source

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

hella_online_20240829
chenfang 4 months ago
parent
commit
5ecec40d3b
  1. 172
      src/components/SearchTable/src/SearchTable.vue
  2. 32
      src/components/Table/src/Table.vue
  3. 686
      src/components/TableForm/src/TableForm.vue
  4. 2
      src/components/XButton/src/ButtonBase.vue
  5. 4
      src/views/wms/basicDataManage/strategySetting/strategy/arrivalInspectionStrategy/AddForm.vue
  6. 4
      src/views/wms/basicDataManage/strategySetting/strategy/batchStrategy/AddForm.vue
  7. 4
      src/views/wms/basicDataManage/strategySetting/strategy/downShelfStrategy/AddForm.vue
  8. 4
      src/views/wms/basicDataManage/strategySetting/strategy/inspectStrategy/AddForm.vue
  9. 4
      src/views/wms/basicDataManage/strategySetting/strategy/manageAccuracyStrategy/AddForm.vue
  10. 4
      src/views/wms/basicDataManage/strategySetting/strategy/purchaseReceiptStrategy/AddForm.vue
  11. 4
      src/views/wms/basicDataManage/strategySetting/strategy/repairMaterialStrategy/AddForm.vue
  12. 4
      src/views/wms/basicDataManage/strategySetting/strategy/storageCapacityStrategy/AddForm.vue
  13. 4
      src/views/wms/basicDataManage/strategySetting/strategy/supplieDeliveryStrategy/AddForm.vue
  14. 4
      src/views/wms/basicDataManage/strategySetting/strategy/upShelfStrategy/AddForm.vue
  15. 4
      src/views/wms/basicDataManage/strategySetting/strategy/utensilCapacityStrategy/AddForm.vue
  16. 4
      src/views/wms/basicDataManage/strategySetting/strategy/warehouseStorageStrategy/AddForm.vue
  17. 4
      src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue
  18. 4
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue
  19. 5
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts

172
src/components/SearchTable/src/SearchTable.vue

@ -1,5 +1,5 @@
<template> <template>
<Dialog :title="dialogTitle" v-model="searchDialogVisible" :width="dialogWidth" > <Dialog :title="dialogTitle" v-model="searchDialogVisible" :width="dialogWidth">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<ContentWrap v-if="searchQuery"> <ContentWrap v-if="searchQuery">
<Search :schema="searchSchema" @search="setSearchParamsRef" @reset="setSearchParamsRef" /> <Search :schema="searchSchema" @search="setSearchParamsRef" @reset="setSearchParamsRef" />
@ -14,7 +14,8 @@
:allSchemas="allSchemasRef" :allSchemas="allSchemasRef"
/> />
<ContentWrap> <ContentWrap>
<Table v-clientSearchTable <Table
v-clientSearchTable
ref="searchTableRef" ref="searchTableRef"
:columns="tableColumns" :columns="tableColumns"
:data="tableObjectRef.tableList" :data="tableObjectRef.tableList"
@ -30,13 +31,14 @@
:selectionTotal="multipleBol" :selectionTotal="multipleBol"
:reserveSelection="true" :reserveSelection="true"
row-key="id" row-key="id"
@rowClick="rowClick"
/> />
</ContentWrap> </ContentWrap>
<template #footer> <template #footer>
<div class="flex items-center"> <div class="flex items-center">
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button> <el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="searchDialogVisible = false"> </el-button> <el-button @click="searchDialogVisible = false"> </el-button>
<slot name="actions"></slot> <slot name="actions"></slot>
</div> </div>
</template> </template>
@ -45,7 +47,7 @@
<script setup lang="ts"> <script setup lang="ts">
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
const props = defineProps({ const props = defineProps({
showSearchTableQueryFields:{ showSearchTableQueryFields: {
type: Array, type: Array,
required: false, required: false,
default: [] default: []
@ -63,23 +65,25 @@ const dialogTitle = ref('') // 弹窗的标题
const formLoading = ref(false) // 12 const formLoading = ref(false) // 12
const multipleBol = ref(false) const multipleBol = ref(false)
// //
const HeadButttondata = ref(multipleBol.value? const HeadButttondata = ref(
[ multipleBol.value
defaultButtons.defaultWhenPageBtn(null), // ? [
defaultButtons.defaultUnselectPageBtn(null), // defaultButtons.defaultWhenPageBtn(null), //
// defaultButtons.defaultDeselectAllBtn(null), // defaultButtons.defaultUnselectPageBtn(null), //
defaultButtons.defaultFilterBtn(null), // // defaultButtons.defaultDeselectAllBtn(null), //
]:[ defaultButtons.defaultFilterBtn(null) //
defaultButtons.defaultFilterBtn(null) // ]
]) : [
defaultButtons.defaultFilterBtn(null) //
]
)
/** 打开弹窗 */ /** 打开弹窗 */
const getListRef = ref() const getListRef = ref()
const setSearchParamsRef = ref() const setSearchParamsRef = ref()
const tableObjectRef = ref() const tableObjectRef = ref()
const getPage:any = ref() const getPage: any = ref()
const searchSchema = ref() const searchSchema = ref()
const tableColumns = ref() const tableColumns = ref()
const formFieldRef = ref() const formFieldRef = ref()
@ -88,67 +92,88 @@ const typeRef = ref()
const rowRef = ref() const rowRef = ref()
const allSchemasRef = ref() const allSchemasRef = ref()
const searchConditionRef = ref() const searchConditionRef = ref()
const searchTableSelectionsList = ref()// const searchTableSelectionsList = ref() //
const searchQuery = ref(false) const searchQuery = ref(false)
const openData = (titleName: any, tableObject:any ,allSchemas: any,multiple: any) => { const openData = (titleName: any, tableObject: any, allSchemas: any, multiple: any) => {
dialogWidth.value = '80%' dialogWidth.value = '80%'
multipleBol.value = multiple multipleBol.value = multiple
HeadButttondata.value = multiple?[ HeadButttondata.value = multiple
defaultButtons.defaultWhenPageBtn(null), // ? [
defaultButtons.defaultUnselectPageBtn(null), // defaultButtons.defaultWhenPageBtn(null), //
// defaultButtons.defaultDeselectAllBtn(null), // defaultButtons.defaultUnselectPageBtn(null), //
defaultButtons.defaultFilterBtn(null), // // defaultButtons.defaultDeselectAllBtn(null), //
]:[ defaultButtons.defaultFilterBtn(null) //
defaultButtons.defaultFilterBtn(null), // ]
] : [
dialogTitle.value = t(`ts.${titleName}`).replace('ts.','') defaultButtons.defaultFilterBtn(null) //
]
dialogTitle.value = t(`ts.${titleName}`).replace('ts.', '')
tableObjectRef.value = tableObject tableObjectRef.value = tableObject
searchDialogVisible.value = true searchDialogVisible.value = true
allSchemasRef.value = allSchemas allSchemasRef.value = allSchemas
searchSchema.value = allSchemas.searchSchema searchSchema.value = allSchemas.searchSchema
tableColumns.value = allSchemas.tableColumns 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) => { const open = (
searchQuery.value = props.showSearchTableQueryFields.find(item=>item==formField)?true:false 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
) => {
searchQuery.value = props.showSearchTableQueryFields.find((item) => item == formField)
? true
: false
dialogWidth.value = '80%' dialogWidth.value = '80%'
multipleBol.value = multiple multipleBol.value = multiple
HeadButttondata.value = multiple?[ HeadButttondata.value = multiple
defaultButtons.defaultWhenPageBtn(null), // ? [
defaultButtons.defaultUnselectPageBtn(null), // defaultButtons.defaultWhenPageBtn(null), //
// defaultButtons.defaultDeselectAllBtn(null), // defaultButtons.defaultUnselectPageBtn(null), //
defaultButtons.defaultFilterBtn(null), // // defaultButtons.defaultDeselectAllBtn(null), //
]: defaultButtons.defaultFilterBtn(null) //
[ ]
defaultButtons.defaultFilterBtn(null), // : [
] defaultButtons.defaultFilterBtn(null) //
]
searchDialogVisible.value = true searchDialogVisible.value = true
formFieldRef.value = formField formFieldRef.value = formField
searchFieldRef.value = searchField searchFieldRef.value = searchField
allSchemasRef.value = allSchemas allSchemasRef.value = allSchemas
searchSchema.value = allSchemas.searchSchema searchSchema.value = allSchemas.searchSchema
if(isConcatDetailSchemas){ if (isConcatDetailSchemas) {
// //
console.log('detailSchemas',detailSchemas) console.log('detailSchemas', detailSchemas)
tableColumns.value = [...allSchemas?.tableColumns,...detailSchemas?.tableMainColumns].filter(item => (item.field !== 'action')) tableColumns.value = [...allSchemas?.tableColumns, ...detailSchemas?.tableMainColumns].filter(
}else{ (item) => item.field !== 'action'
tableColumns.value = allSchemas?.tableColumns.filter(item => (item.field !== 'action')) )
} else {
tableColumns.value = allSchemas?.tableColumns.filter((item) => item.field !== 'action')
} }
getPage.value = getApiPage getPage.value = getApiPage
typeRef.value = type typeRef.value = type
rowRef.value = row rowRef.value = row
// dialogTitle.value = t('action.' + type) // dialogTitle.value = t('action.' + type)
dialogTitle.value = t(`ts.${titleName}`).replace('ts.','') dialogTitle.value = t(`ts.${titleName}`).replace('ts.', '')
searchTableSelectionsList.value = searchTableSelections searchTableSelectionsList.value = searchTableSelections
const {tableObject, tableMethods } = useTable({ const { tableObject, tableMethods } = useTable({
getListApi: getPage.value // getListApi: getPage.value //
}) })
tableObjectRef.value = tableObject tableObjectRef.value = tableObject
searchConditionRef.value = searchCondition searchConditionRef.value = searchCondition
if (searchCondition) tableObjectRef.value.params = searchCondition; if (searchCondition) tableObjectRef.value.params = searchCondition
// //
const { getList , setSearchParams } = tableMethods const { getList, setSearchParams } = tableMethods
setSearchParamsRef.value = setSearchParams setSearchParamsRef.value = setSearchParams
getListRef.value = getList getListRef.value = getList
getList() getList()
@ -157,7 +182,7 @@ const dialogWidth = ref('80%')
const changeDialogWidth = (width: any) => { const changeDialogWidth = (width: any) => {
dialogWidth.value = width dialogWidth.value = width
} }
const hiddenFilterButton = ()=>{ const hiddenFilterButton = () => {
HeadButttondata.value = [] HeadButttondata.value = []
} }
@ -166,34 +191,34 @@ const searchFormClick = (searchData) => {
console.log(99, rowRef.value) console.log(99, rowRef.value)
console.log(100, searchData) console.log(100, searchData)
console.log(101, searchConditionRef.value) console.log(101, searchConditionRef.value)
// 20240104 searchData.filters // 20240104 searchData.filters
// 20240321 searchData // 20240321 searchData
if (searchData.filters) { if (searchData.filters) {
if (searchConditionRef.value.filters) { if (searchConditionRef.value.filters) {
Object.keys(searchConditionRef.value.filters).forEach(key => { Object.keys(searchConditionRef.value.filters).forEach((key) => {
searchData.filters.push(searchConditionRef.value.filters[key]) searchData.filters.push(searchConditionRef.value.filters[key])
}); })
} else { } else {
Object.keys(searchConditionRef.value).forEach(key => { Object.keys(searchConditionRef.value).forEach((key) => {
searchData.filters.push({ searchData.filters.push({
action: "==", action: '==',
column: key, column: key,
value: searchConditionRef.value[key] value: searchConditionRef.value[key]
}) })
}); })
} }
} else { } else {
if (searchConditionRef.value.filters) { if (searchConditionRef.value.filters) {
searchData.filters = searchConditionRef.value.filters searchData.filters = searchConditionRef.value.filters
} else { } else {
searchData.filters = [] searchData.filters = []
Object.keys(searchConditionRef.value).forEach(key => { Object.keys(searchConditionRef.value).forEach((key) => {
searchData.filters.push({ searchData.filters.push({
action: "==", action: '==',
column: key, column: key,
value: searchConditionRef.value[key] value: searchConditionRef.value[key]
}) })
}); })
} }
} }
tableObjectRef.value.params = { tableObjectRef.value.params = {
@ -203,7 +228,7 @@ const searchFormClick = (searchData) => {
getListRef.value() // getListRef.value() //
} }
const buttonBaseClick = (val, item) => { const buttonBaseClick = (val, item) => {
// //
if (val == 'DeselectAll') { if (val == 'DeselectAll') {
// //
searchTableRef.value.clearSelection() searchTableRef.value.clearSelection()
@ -216,8 +241,7 @@ const buttonBaseClick = (val, item) => {
} }
} }
defineExpose({ open, openData, hiddenFilterButton, changeDialogWidth }) // open
defineExpose({ open,openData,hiddenFilterButton ,changeDialogWidth}) // open
// Table ref // Table ref
const searchTableRef = ref() const searchTableRef = ref()
@ -229,29 +253,47 @@ const submitForm = async () => {
formLoading.value = true formLoading.value = true
const selections = searchTableRef.value.selections const selections = searchTableRef.value.selections
// //
if(!multipleBol.value){ if (!multipleBol.value) {
if(selections.length > 1 || selections.length == 0) { if (selections.length > 1 || selections.length == 0) {
message.warning('请选择一条数据!') message.warning('请选择一条数据!')
formLoading.value = false formLoading.value = false
return return
} }
// //
}else{ } else {
if(selections.length == 0) { if (selections.length == 0) {
message.warning('至少选择一条数据!') message.warning('至少选择一条数据!')
formLoading.value = false formLoading.value = false
return return
} }
} }
try { try {
searchDialogVisible.value = false searchDialogVisible.value = false
// //
emit('searchTableSuccess', formFieldRef.value, searchFieldRef.value, selections, typeRef.value, rowRef.value) emit(
'searchTableSuccess',
formFieldRef.value,
searchFieldRef.value,
selections,
typeRef.value,
rowRef.value
)
} finally { } finally {
formLoading.value = false formLoading.value = false
} }
} }
const rowClick = (row: any, column: any, event: Event) => {
const selected = searchTableRef.value?.elTableRef
?.getSelectionRows()
.some((item) => item.id === row.id)
if (!selected) {
searchTableRef.value?.elTableRef?.toggleRowSelection(row, true)
} else {
//
searchTableRef.value?.elTableRef?.toggleRowSelection(row, false)
}
}
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
</style> </style>

32
src/components/Table/src/Table.vue

@ -63,7 +63,7 @@ export default defineComponent({
searchTableSelectionsList:[],// searchTableSelectionsList:[],//
selectionColor: propTypes.bool.def(false), selectionColor: propTypes.bool.def(false),
}, },
emits: ['update:pageSize', 'update:currentPage', 'register', 'update:sort','getSelectionRows'], emits: ['update:pageSize', 'update:currentPage', 'register', 'update:sort','getSelectionRows','rowClick'],
setup(props, { attrs, slots, emit, expose }) { setup(props, { attrs, slots, emit, expose }) {
const elTableRef = ref<ComponentRef<typeof ElTable>>() const elTableRef = ref<ComponentRef<typeof ElTable>>()
@ -120,12 +120,24 @@ export default defineComponent({
const sortRef = ref() const sortRef = ref()
// //
const selectRow = ()=>{ const selectRow = ()=>{
console.log(currentPageRef.value,elTableRef.value?.getSelectionRows())
emit('getSelectionRows', currentPageRef.value,elTableRef.value?.getSelectionRows()) emit('getSelectionRows', currentPageRef.value,elTableRef.value?.getSelectionRows())
} }
// //
const selectAll = ()=>{ const selectAll = ()=>{
emit('getSelectionRows', currentPageRef.value,elTableRef.value?.getSelectionRows()) emit('getSelectionRows', currentPageRef.value,elTableRef.value?.getSelectionRows())
} }
const rowClick = (row: any, column: any, event: Event)=>{
// const selected = elTableRef.value?.getSelectionRows().some(item => item.id === row.id)
// if (!selected) {
// elTableRef.value?.toggleRowSelection(row, true);
// } else {
// //
// elTableRef.value?.toggleRowSelection(row, false);
// }
// console.log(elTableRef.value?.getSelectionRows())
emit('rowClick',row,column,event)
}
// //
const togglePageSelection = ()=>{ const togglePageSelection = ()=>{
unref(getProps).data.forEach(row=>{ unref(getProps).data.forEach(row=>{
@ -165,7 +177,8 @@ export default defineComponent({
selectAll, selectAll,
toggleAllSelection, toggleAllSelection,
togglePageSelection, togglePageSelection,
clearSelection clearSelection,
elTableRef
}) })
const pagination = computed(() => { const pagination = computed(() => {
@ -388,6 +401,7 @@ export default defineComponent({
onSelect-all={selectAll} onSelect-all={selectAll}
onSelection-change={selectionChange} onSelection-change={selectionChange}
onSort-change={sortChange} onSort-change={sortChange}
onRow-click={rowClick}
{...unref(getBindValue)} {...unref(getBindValue)}
> >
{{ {{
@ -397,7 +411,7 @@ export default defineComponent({
}} }}
</ElTable> </ElTable>
{unref(getProps).selectionTotal ? ( {unref(getProps).selectionTotal ? (
<div class="mt-5px">已选{selections.value.length}条数据</div> <div class="mt-15px float-left" style='height:32px;line-height:32px'>已选{selections.value.length}条数据</div>
):undefined} ):undefined}
{unref(getProps).pagination ? ( {unref(getProps).pagination ? (
// update by Pagination // update by Pagination
@ -416,18 +430,17 @@ export default defineComponent({
</script> </script>
<style lang="scss"> <style lang="scss">
.expandTable .el-table .tableHeader{ .expandTable .el-table .tableHeader {
--el-table-header-bg-color: #f5f5f5; --el-table-header-bg-color: #f5f5f5;
} }
.expandTable .el-table .tableRow{ .expandTable .el-table .tableRow {
--el-table-tr-bg-color: #f5f5f5; --el-table-tr-bg-color: #f5f5f5;
--el-bg-color:#f5f5f5; --el-bg-color: #f5f5f5;
} }
.el-table .selectionRow{ .el-table .selectionRow {
--el-table-tr-bg-color: var(--el-color-primary-light-9); --el-table-tr-bg-color: var(--el-color-primary-light-9);
} }
</style> </style>
<style lang="scss" scoped> <style lang="scss" scoped>
:deep(.el-button.is-text) { :deep(.el-button.is-text) {
@ -439,5 +452,4 @@ export default defineComponent({
padding: 8px 4px; padding: 8px 4px;
margin-left: 0; margin-left: 0;
} }
</style> </style>

686
src/components/TableForm/src/TableForm.vue

@ -1,341 +1,420 @@
<!-- 附件组件 --> <!-- 附件组件 -->
<template> <template>
<div class="table-form"> <div class="table-form">
<el-table class="multipleTableComponents" <el-table
ref="TableBaseComponents_Ref" class="multipleTableComponents"
v-loading="tableLoading" ref="TableBaseComponents_Ref"
v-loading="tableLoading"
:data="showTableData()" :data="showTableData()"
:max-height="maxHeight" :max-height="maxHeight"
row-key="id" row-key="id"
:border="border" :border="border"
@selection-change="tableSelectionChange" @selection-change="tableSelectionChange"
@sort-change="tableSortChange" @sort-change="tableSortChange"
@row-click="handleTableSelect" @row-click="handleTableSelect"
> >
<!-- 删除按钮多选 --> <!-- 删除按钮多选 -->
<el-table-column fixed="left" type="selection" width="50" v-if="isShowReduceButtonSelection" :reserve-selection="true" /> <el-table-column
fixed="left"
type="selection"
width="50"
v-if="isShowReduceButtonSelection"
:reserve-selection="true"
/>
<!-- 删除按钮 --> <!-- 删除按钮 -->
<el-table-column <el-table-column
fixed="left" fixed="left"
:width="50" :width="50"
v-else-if="isShowReduceButton" v-else-if="isShowReduceButton"
v-slot="{ row, $index }" v-slot="{ row, $index }"
> >
<Icon icon="ep:remove" color="#757575" :size="26" style="cursor: pointer;margin-top: -16px;" @click="handleDeleteTable (row, $index)" /> <Icon
icon="ep:remove"
color="#757575"
:size="26"
style="cursor: pointer; margin-top: -16px"
@click.stop="handleDeleteTable(row, $index)"
/>
</el-table-column> </el-table-column>
<!-- 多选 --> <!-- 多选 -->
<el-table-column <el-table-column
fixed="left" fixed="left"
v-if="selectionTable" v-if="selectionTable"
:reserve-selection="true" :reserve-selection="true"
type="selection" type="selection"
:width="50" :width="50"
/> />
<!-- 序号 --> <!-- 序号 -->
<el-table-column <el-table-column
type="index" type="index"
fixed="left" fixed="left"
:label="t(`ts.序号`)" :label="t(`ts.序号`)"
width="80" width="80"
:align="'center'" :align="'center'"
v-if="isShowIndex" v-if="isShowIndex"
/> />
<el-table-column <el-table-column
v-slot="{ row, $index }" v-slot="{ row, $index }"
v-for="(headerItem) in tableFields.filter(item=>(!item.hidden))" v-for="headerItem in tableFields.filter((item) => !item.hidden)"
:key="headerItem" :key="headerItem"
:fixed="headerItem.tableForm?.fixed" :fixed="headerItem.tableForm?.fixed"
:label="t(`ts.${headerItem.label}`).replace('ts.','')" :prop="headerItem.field" :label="t(`ts.${headerItem.label}`).replace('ts.', '')"
:align="headerItem?.tableForm?.align || 'center'" :prop="headerItem.field"
:align="headerItem?.tableForm?.align || 'center'"
:sortable="headerItem?.tableForm?.sortable || false" :sortable="headerItem?.tableForm?.sortable || false"
:width="headerItem?.tableForm?.width || '200px'" :width="headerItem?.tableForm?.width || '200px'"
:min-width="headerItem?.tableForm?.minWidth || 'auto'"> :min-width="headerItem?.tableForm?.minWidth || 'auto'"
<el-form >
ref="TableBaseForm_Ref" <el-form
:model="row" ref="TableBaseForm_Ref"
style="width: 100%;" :model="row"
style="width: 100%"
:rules="tableFormRules" :rules="tableFormRules"
:class="tableFormRules ? '' : 'noRulesForm'"> :class="tableFormRules ? '' : 'noRulesForm'"
@click.stop=""
>
<!-- 字符串输入框 --> <!-- 字符串输入框 -->
<el-form-item <el-form-item
v-if="!headerItem?.tableForm?.type || headerItem?.tableForm?.type == 'InputString'" v-if="!headerItem?.tableForm?.type || headerItem?.tableForm?.type == 'InputString'"
:prop="headerItem.field" style="display: flex;align-items: center;"> :prop="headerItem.field"
<el-input :key="headerItem.field+$index" style="display: flex; align-items: center"
>
<el-input
:key="headerItem.field + $index"
v-model="row[headerItem.field]" v-model="row[headerItem.field]"
clearable clearable
:type="headerItem?.tableForm?.inputType" :type="headerItem?.tableForm?.inputType"
:placeholder="t(`ts.${headerItem?.tableForm?.placeholder || '请输入' + headerItem.label}`).replace('ts.','')" :placeholder="
:disabled="disabledInput(headerItem,row)" t(
style="flex:1" `ts.${headerItem?.tableForm?.placeholder || '请输入' + headerItem.label}`
@blur="inputStringBlur(headerItem, row[headerItem.field], row,index)" ).replace('ts.', '')
"
:disabled="disabledInput(headerItem, row)"
style="flex: 1"
@blur.stop="inputStringBlur(headerItem, row[headerItem.field], row, index)"
/>
<Icon
icon="ep:circle-close"
v-if="
headerItem?.tableForm?.isInpuFocusShow &&
headerItem?.tableForm?.disabled &&
headerItem?.tableForm?.clearable
"
style="position: absolute; right: 50px; cursor: pointer"
@click.stop="clearInput(headerItem.field, row, index)"
/> />
<Icon icon="ep:circle-close" v-if="headerItem?.tableForm?.isInpuFocusShow && headerItem?.tableForm?.disabled&& headerItem?.tableForm?.clearable" style='position:absolute;right:50px;cursor: pointer;' @click="clearInput(headerItem.field,row,index)"/> <el-button
<el-button :key="headerItem.field+$index+'button'" v-if="headerItem?.tableForm?.isInpuFocusShow" @click="inpuFocus(headerItem,row,index)"><Icon icon="ep:search" size="14"/></el-button> :key="headerItem.field + $index + 'button'"
v-if="headerItem?.tableForm?.isInpuFocusShow"
@click.stop="inpuFocus(headerItem, row, index)"
><Icon icon="ep:search" size="14"
/></el-button>
</el-form-item> </el-form-item>
<el-form-item v-if="headerItem?.tableForm?.type == 'slot'"> <el-form-item v-if="headerItem?.tableForm?.type == 'slot'">
<slot :row="row"></slot> <slot :row="row"></slot>
</el-form-item> </el-form-item>
<!-- 金额输入框 --> <!-- 金额输入框 -->
<el-form-item <el-form-item v-if="headerItem?.tableForm?.type == 'number'" :prop="headerItem.field" >
v-if="headerItem?.tableForm?.type == 'number'" <el-input
:prop="headerItem.field"> :key="headerItem.field + $index"
<el-input :key="headerItem.field+$index" v-model="row[headerItem.field]"
v-model="row[headerItem.field]" clearable
clearable type="number"
type="number" :placeholder="headerItem?.tableForm?.placeholder || '请输入' + headerItem.label"
:placeholder="headerItem?.tableForm?.placeholder || '请输入' + headerItem.label" :disabled="itemIsDisabled(headerItem, row)"
:disabled="itemIsDisabled(headerItem, row)" style="width: 100%"
style="width: 100%;" @input.stop="row[headerItem.field] = row[headerItem.field].replace(/[^\d\.-]/g, '')"
@input="row[headerItem.field] = row[headerItem.field].replace(/[^\d\.-]/g, '')" @click.stop=""
/> @focus.stop=""
</el-form-item> />
</el-form-item>
<!-- 数字输入框 --> <!-- 数字输入框 -->
<el-form-item <el-form-item
v-if="headerItem?.tableForm?.type == 'InputNumber'" v-if="headerItem?.tableForm?.type == 'InputNumber'"
:prop="headerItem.field"> :prop="headerItem.field"
<el-input-number >
style="width: 100%;" <el-input-number
:key="headerItem.field+$index" style="width: 100%"
v-model="row[headerItem.field]" :key="headerItem.field + $index"
v-model="row[headerItem.field]"
:max="headerItem?.tableForm?.max" :max="headerItem?.tableForm?.max"
:min="headerItem?.tableForm?.min" :min="headerItem?.tableForm?.min"
:precision="headerItem?.tableForm?.precision" :precision="headerItem?.tableForm?.precision"
:disabled="itemIsDisabled(headerItem, row)" :disabled="itemIsDisabled(headerItem, row)"
@change="(e)=>{inputNumberChange(headerItem.field, $index, row, e)}" @change.stop="
(e) => {
inputNumberChange(headerItem.field, $index, row, e)
}
"
/> />
</el-form-item> </el-form-item>
<!-- 下拉框 --> <!-- 下拉框 -->
<el-form-item <el-form-item v-if="headerItem?.tableForm?.type == 'Select'" :prop="headerItem.field">
v-if="headerItem?.tableForm?.type == 'Select'" <el-select
:prop="headerItem.field"> :key="headerItem.field + $index"
<el-select :key="headerItem.field+$index" v-model="row[headerItem.field]"
v-model="row[headerItem.field]"
:clearable="headerItem?.tableForm.clearable || true" :clearable="headerItem?.tableForm.clearable || true"
:multiple="headerItem?.tableForm.multiple" :multiple="headerItem?.tableForm.multiple"
:size="headerItem?.tableForm.size" :size="headerItem?.tableForm.size"
:collapse-tags ="headerItem?.tableForm.collapseTags" :collapse-tags="headerItem?.tableForm.collapseTags"
:collapse-tags-tooltip ="headerItem?.tableForm.collapseTagsTooltip" :collapse-tags-tooltip="headerItem?.tableForm.collapseTagsTooltip"
:multiple-limit ="headerItem?.tableForm.multipleLimit" :multiple-limit="headerItem?.tableForm.multipleLimit"
:disabled="itemIsDisabled(headerItem, row)" :disabled="itemIsDisabled(headerItem, row)"
:filterable="headerItem?.tableForm.filterable" :filterable="headerItem?.tableForm.filterable"
:allow-create="headerItem?.tableForm.allowCreate" :allow-create="headerItem?.tableForm.allowCreate"
style="width: 100%" style="width: 100%"
:placeholder="headerItem?.tableForm?.placeholder || '请选择' + headerItem.label" :placeholder="headerItem?.tableForm?.placeholder || '请选择' + headerItem.label"
@change="formSelectChange(headerItem.field, $event,row)" @change.stop="formSelectChange(headerItem.field, $event, row)"
@blur="tableFormSelectOnBlur(headerItem.field, $event,row, $index)"> @blur.stop="tableFormSelectOnBlur(headerItem.field, $event, row, $index)"
<el-option >
v-for="op in initSelectOptions(headerItem)" <el-option
:label="t(`ts.${op.label}`).replace('ts.','')" v-for="op in initSelectOptions(headerItem)"
:label="t(`ts.${op.label}`).replace('ts.', '')"
:value="op.value" :value="op.value"
:key="op.value" /> :key="op.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- 下拉框 --> <!-- 下拉框 -->
<el-form-item <el-form-item
v-if="headerItem?.tableForm?.type == 'SelectGroup'" v-if="headerItem?.tableForm?.type == 'SelectGroup'"
:prop="headerItem.field"> :prop="headerItem.field"
<el-select :key="headerItem.field+$index" >
v-model="row[headerItem.field]" <el-select
:key="headerItem.field + $index"
v-model="row[headerItem.field]"
:clearable="headerItem?.tableForm.clearable || true" :clearable="headerItem?.tableForm.clearable || true"
:multiple="headerItem?.tableForm.multiple" :multiple="headerItem?.tableForm.multiple"
:size="headerItem?.tableForm.size" :size="headerItem?.tableForm.size"
:collapse-tags ="headerItem?.tableForm.collapseTags" :collapse-tags="headerItem?.tableForm.collapseTags"
:collapse-tags-tooltip ="headerItem?.tableForm.collapseTagsTooltip" :collapse-tags-tooltip="headerItem?.tableForm.collapseTagsTooltip"
:multiple-limit ="headerItem?.tableForm.multipleLimit" :multiple-limit="headerItem?.tableForm.multipleLimit"
:disabled="itemIsDisabled(headerItem, row)" :disabled="itemIsDisabled(headerItem, row)"
:filterable="headerItem?.tableForm.filterable" :filterable="headerItem?.tableForm.filterable"
:allow-create="headerItem?.tableForm.allowCreate" :allow-create="headerItem?.tableForm.allowCreate"
style="width: 100%" style="width: 100%"
:placeholder="headerItem?.tableForm?.placeholder || '请选择' + headerItem.label" :placeholder="headerItem?.tableForm?.placeholder || '请选择' + headerItem.label"
@change="formSelectChange(headerItem.field, $event,row)" @change.stop="formSelectChange(headerItem.field, $event, row)"
@blur="tableFormSelectOnBlur(headerItem.field, $event,row, $index)"> @blur.stop="tableFormSelectOnBlur(headerItem.field, $event, row, $index)"
<el-option-group >
v-for="group in initSelectOptions(headerItem)" <el-option-group
:key="group.type" v-for="group in initSelectOptions(headerItem)"
:label="t(`ts.${group.name}`).replace('ts.','')" :key="group.type"
> :label="t(`ts.${group.name}`).replace('ts.', '')"
<el-option >
v-for="item in group.options" <el-option
:key="item.value" v-for="item in group.options"
:label="t(`ts.${item.label}`).replace('ts.','')" :key="item.value"
:value="item.value" :label="t(`ts.${item.label}`).replace('ts.', '')"
/> :value="item.value"
</el-option-group> />
</el-option-group>
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- 时间选择器 --> <!-- 时间选择器 -->
<el-form-item <el-form-item v-if="headerItem?.tableForm?.type == 'FormTime'" :prop="headerItem.field">
v-if="headerItem?.tableForm?.type == 'FormTime'" <el-time-picker
:prop="headerItem.field"> :key="headerItem.field + $index"
<el-time-picker :key="headerItem.field+$index" v-model="row[headerItem.field]"
v-model="row[headerItem.field]"
:clearable="true" :clearable="true"
:placeholder="headerItem?.tableForm?.placeholder || '选择时间'" :placeholder="headerItem?.tableForm?.placeholder || '选择时间'"
style="width: 100%" :disabled="itemIsDisabled(headerItem, row)" style="width: 100%"
:disabled="itemIsDisabled(headerItem, row)"
:format="headerItem?.tableForm?.format || 'HH:mm:ss'" :format="headerItem?.tableForm?.format || 'HH:mm:ss'"
:value-format="headerItem?.tableForm?.valueFormat || 'HH:mm:ss'" /> :value-format="headerItem?.tableForm?.valueFormat || 'HH:mm:ss'"
/>
</el-form-item> </el-form-item>
<!-- 日期选择器 --> <!-- 日期选择器 -->
<el-form-item <el-form-item v-if="headerItem?.tableForm?.type == 'FormDate'" :prop="headerItem.field">
v-if="headerItem?.tableForm?.type == 'FormDate'"
:prop="headerItem.field">
<el-date-picker <el-date-picker
:key="headerItem.field+$index" :key="headerItem.field + $index"
v-model="row[headerItem.field]" v-model="row[headerItem.field]"
:clearable="true" :clearable="true"
style="width: 100%" style="width: 100%"
:disabled="itemIsDisabled(headerItem, row)" :disabled="itemIsDisabled(headerItem, row)"
:placeholder="headerItem?.tableForm?.placeholder || '选择日期'" :placeholder="headerItem?.tableForm?.placeholder || '选择日期'"
:format="headerItem?.tableForm?.format || 'YYYY-MM-DD'" :format="headerItem?.tableForm?.format || 'YYYY-MM-DD'"
:value-format="headerItem?.tableForm?.valueFormat || 'YYYY-MM-DD'" :value-format="headerItem?.tableForm?.valueFormat || 'YYYY-MM-DD'"
@change="formFormDateChange(headerItem.field, $event,row, $index)" /> @change.stop="formFormDateChange(headerItem.field, $event, row, $index)"
/>
</el-form-item> </el-form-item>
<!-- 日期时间选择器 --> <!-- 日期时间选择器 -->
<el-form-item <el-form-item
v-if="headerItem?.tableForm?.type == 'FormDateTime'" v-if="headerItem?.tableForm?.type == 'FormDateTime'"
:prop="headerItem.field"> :prop="headerItem.field"
<el-date-picker >
:key="headerItem.field+$index" <el-date-picker
:key="headerItem.field + $index"
type="datetime" type="datetime"
:clearable="true" :clearable="true"
v-model="row[headerItem.field]" v-model="row[headerItem.field]"
:placeholder="headerItem?.tableForm?.placeholder || '选择日期时间'" :placeholder="headerItem?.tableForm?.placeholder || '选择日期时间'"
style="width: 100%" style="width: 100%"
:format="headerItem?.tableForm?.format || 'YYYY-MM-DD HH:mm:ss'" :format="headerItem?.tableForm?.format || 'YYYY-MM-DD HH:mm:ss'"
:value-format="headerItem?.tableForm?.valueFormat || 'YYYY-MM-DDTHH:mm:ss'" :value-format="headerItem?.tableForm?.valueFormat || 'YYYY-MM-DDTHH:mm:ss'"
:disabled="itemIsDisabled(headerItem, row)" /> :disabled="itemIsDisabled(headerItem, row)"
/>
</el-form-item> </el-form-item>
<!--开始时间结束时间选择器 (原类型datetimerange已弃用 使用type+timeType结合方式)--> <!--开始时间结束时间选择器 (原类型datetimerange已弃用 使用type+timeType结合方式)-->
<el-form-item <el-form-item
v-if="headerItem?.tableForm?.type == 'FormTimerange'" v-if="headerItem?.tableForm?.type == 'FormTimerange'"
:prop="headerItem.field"> :prop="headerItem.field"
<el-date-picker :key="headerItem.field+$index" >
<el-date-picker
:key="headerItem.field + $index"
v-model="row[headerItem.field]" v-model="row[headerItem.field]"
:clearable="true" :clearable="true"
:disabled="itemIsDisabled(headerItem, row)" :disabled="itemIsDisabled(headerItem, row)"
:type="headerItem?.tableForm?.timeType || 'datetimerange'" :type="headerItem?.tableForm?.timeType || 'datetimerange'"
range-separator="至" range-separator="至"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
:format="headerItem?.tableForm?.format || 'YYYY-MM-DD HH:mm:ss'" :format="headerItem?.tableForm?.format || 'YYYY-MM-DD HH:mm:ss'"
:value-format="headerItem?.tableForm?.valueFormat || 'YYYY-MM-DDTHH:mm:ss'" /> :value-format="headerItem?.tableForm?.valueFormat || 'YYYY-MM-DDTHH:mm:ss'"
/>
</el-form-item> </el-form-item>
<!-- Switch 开关 --> <!-- Switch 开关 -->
<el-form-item <el-form-item v-if="headerItem?.tableForm?.type == 'Switch'" :prop="headerItem.field">
v-if="headerItem?.tableForm?.type == 'Switch'" <el-switch
:prop="headerItem.field"> :key="headerItem.field + $index"
<el-switch :key="headerItem.field+$index" v-model="row[headerItem.field]"
v-model="row[headerItem.field]"
:disabled="itemIsDisabled(headerItem, row)" :disabled="itemIsDisabled(headerItem, row)"
:loading="headerItem?.tableForm?.loading" :loading="headerItem?.tableForm?.loading"
:size="headerItem?.tableForm?.size" :size="headerItem?.tableForm?.size"
:active-icon="headerItem?.tableForm?.activeIcon" :active-icon="headerItem?.tableForm?.activeIcon"
:inactive-icon="headerItem?.tableForm?.inactiveIcon" :inactive-icon="headerItem?.tableForm?.inactiveIcon"
:active-text="headerItem?.tableForm?.activeText" :active-text="headerItem?.tableForm?.activeText"
:inactive-text="headerItem?.tableForm?.inactiveText" :inactive-text="headerItem?.tableForm?.inactiveText"
:active-value="headerItem?.tableForm?.activeValue" :active-value="headerItem?.tableForm?.activeValue"
:inactive-value="headerItem?.tableForm?.inactiveValue" :inactive-value="headerItem?.tableForm?.inactiveValue"
:active-color="headerItem?.tableForm?.inactiveColor" :active-color="headerItem?.tableForm?.inactiveColor"
:inactive-color="headerItem?.tableForm?.inactiveColor" /> :inactive-color="headerItem?.tableForm?.inactiveColor"
/>
</el-form-item> </el-form-item>
<!-- Radio 单选--> <!-- Radio 单选-->
<el-form-item <el-form-item v-if="headerItem?.tableForm?.type == 'Radio'" :prop="headerItem.field">
v-if="headerItem?.tableForm?.type == 'Radio'" <el-radio-group
:prop="headerItem.field"> :key="headerItem.field + $index"
<el-radio-group :key="headerItem.field+$index" v-model="row[headerItem.field]"
v-model="row[headerItem.field]"
:size="headerItem?.tableForm?.size" :size="headerItem?.tableForm?.size"
:disabled="itemIsDisabled(headerItem, row)" :disabled="itemIsDisabled(headerItem, row)"
:text-color="headerItem?.tableForm?.textColor" :text-color="headerItem?.tableForm?.textColor"
:fill="headerItem?.tableForm?.fill" :fill="headerItem?.tableForm?.fill"
:name="headerItem?.tableForm?.name" :name="headerItem?.tableForm?.name"
:id="headerItem?.tableForm?.id"> :id="headerItem?.tableForm?.id"
<el-radio >
v-for="(item, index) in initSelectOptions(headerItem)" <el-radio
:key="index" v-for="(item, index) in initSelectOptions(headerItem)"
:label="t(`ts.${item.value}`).replace('ts.','')" :key="index"
:size="headerItem?.tableForm?.size" :label="t(`ts.${item.value}`).replace('ts.', '')"
:size="headerItem?.tableForm?.size"
:disabled="itemIsDisabled(headerItem, row)" :disabled="itemIsDisabled(headerItem, row)"
:border="headerItem?.tableForm?.border"> :border="headerItem?.tableForm?.border"
>
{{ item.label }} {{ item.label }}
</el-radio> </el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<!-- Checkbox 多选--> <!-- Checkbox 多选-->
<el-form-item <el-form-item v-if="headerItem?.tableForm?.type == 'Checkbox'" :prop="headerItem.field">
v-if="headerItem?.tableForm?.type == 'Checkbox'" <el-checkbox-group
:prop="headerItem.field"> :key="headerItem.field + $index"
<el-checkbox-group :key="headerItem.field+$index" v-model="row[headerItem.field]"
v-model="row[headerItem.field]"
:disabled="itemIsDisabled(headerItem, row)" :disabled="itemIsDisabled(headerItem, row)"
:size="headerItem?.tableForm?.size" :size="headerItem?.tableForm?.size"
:min="headerItem?.tableForm?.min" :min="headerItem?.tableForm?.min"
:max="headerItem?.tableForm?.max" :max="headerItem?.tableForm?.max"
:text-color="headerItem?.tableForm?.textColor" :text-color="headerItem?.tableForm?.textColor"
:fill="headerItem?.tableForm?.fill"> :fill="headerItem?.tableForm?.fill"
<el-checkbox >
v-for="(item, index) in initSelectOptions(headerItem)" <el-checkbox
:key="index" v-for="(item, index) in initSelectOptions(headerItem)"
:label="t(`ts.${item.value}`).replace('ts.','')" :key="index"
:disabled="itemIsDisabled(headerItem, row)" :label="t(`ts.${item.value}`).replace('ts.', '')"
:true-label="t(`ts.${headerItem?.tableForm?.trueLabel}`).replace('ts.','')" :disabled="itemIsDisabled(headerItem, row)"
:false-label="t(`ts.${headerItem?.tableForm?.falseLabel}`).replace('ts.','')" :true-label="t(`ts.${headerItem?.tableForm?.trueLabel}`).replace('ts.', '')"
:false-label="t(`ts.${headerItem?.tableForm?.falseLabel}`).replace('ts.', '')"
:border="headerItem?.tableForm?.border" :border="headerItem?.tableForm?.border"
:size="headerItem?.tableForm?.size" :size="headerItem?.tableForm?.size"
:name="headerItem?.tableForm?.name" :name="headerItem?.tableForm?.name"
:checked="headerItem?.tableForm?.checked"> :checked="headerItem?.tableForm?.checked"
>
{{ item.label }} {{ item.label }}
</el-checkbox> </el-checkbox>
</el-checkbox-group> </el-checkbox-group>
</el-form-item> </el-form-item>
<!-- table表添加操作列 --> <!-- table表添加操作列 -->
<!-- <el-form-item> --> <!-- <el-form-item> -->
<div v-if="headerItem?.tableForm?.type == 'action'" :key="headerItem.field+$index"> <div v-if="headerItem?.tableForm?.type == 'action'" :key="headerItem.field + $index">
<el-button <el-button
v-for="(itemButton, indexButton) in headerItem?.tableForm?.buttonText.split('|')" v-for="(itemButton, indexButton) in headerItem?.tableForm?.buttonText.split('|')"
:key="indexButton" :key="indexButton"
type="text" type="text"
style="padding-top: 0px;align-items:unsafe;" style="padding-top: 0px; align-items: unsafe"
@click="buttonOperationClick(row, headerItem?.tableForm?.buttonName.split('|')[indexButton], $index)" @click.stop="
>{{itemButton}}</el-button> buttonOperationClick(
</div> row,
headerItem?.tableForm?.buttonName.split('|')[indexButton],
$index
)
"
>{{ itemButton }}</el-button
>
</div>
<!-- </el-form-item> --> <!-- </el-form-item> -->
</el-form> </el-form>
</el-table-column> </el-table-column>
<!-- 删除按钮 --> <!-- 删除按钮 -->
<el-table-column <el-table-column
fixed="right" fixed="right"
:label="t('ts.操作')" :label="t('ts.操作')"
align="center" align="center"
:width="60" :width="60"
v-if="isShowReduceButtonSelection" v-if="isShowReduceButtonSelection"
v-slot="{ row, $index }" v-slot="{ row, $index }"
> >
<ButtonBase :Butttondata="[defaultButtons.mainListDeleteBtn(),]" @button-base-click="handleDeleteTable (row, $index)" /> <ButtonBase
:Butttondata="[defaultButtons.mainListDeleteBtn()]"
@button-base-click="handleDeleteTable(row, $index)"
/>
</el-table-column> </el-table-column>
</el-table> </el-table>
<!-- :page-sizes="[ 10,20, 30, 50, 100]" sizes--> <!-- :page-sizes="[ 10,20, 30, 50, 100]" sizes-->
<el-pagination v-show="tableData.length>10" style="margin-top:10px" <el-pagination
v-model:current-page="currentPage" v-show="tableData.length > 10"
v-model:page-size="pageSize" style="margin-top: 10px"
:small="true" v-model:current-page="currentPage"
:background="false" v-model:page-size="pageSize"
layout="total, prev, pager, next, jumper" :small="true"
:total="tableData.length" :background="false"
/> layout="total, prev, pager, next, jumper"
<div class="button flex" v-if="isShowButton||isShowReduceButtonSelection"> :total="tableData.length"
<div class="p-12px" v-if="isShowButton" @click="handleAddTable"> />
<Icon icon="ep:circle-plus" color="#409eff" size="26" style="cursor: pointer;" /> <div class="button flex" v-if="isShowButton || isShowReduceButtonSelection">
<div>{{t('ts.添加明细')}}</div> <div class="p-12px" v-if="isShowButton" @click.stop="handleAddTable">
<Icon icon="ep:circle-plus" color="#409eff" size="26" style="cursor: pointer" />
<div>{{ t('ts.添加明细') }}</div>
</div> </div>
<div class="p-12px" v-if="isShowReduceButtonSelection" @click="handleSelectionDelete"> <div class="p-12px" v-if="isShowReduceButtonSelection" @click.stop="handleSelectionDelete">
<Icon icon="ep:delete" color="#409eff" size="26" style="cursor: pointer;" /> <Icon icon="ep:delete" color="#409eff" size="26" style="cursor: pointer" />
<div>{{t('ts.批量删除')}}</div> <div>{{ t('ts.批量删除') }}</div>
</div> </div>
<div class="p-12px" v-if="routeName == 'PurchaseMain'||routeName == 'ProductionMain'||routeName == 'ZZBJDeliverPlanMain'||routeName == 'DeliverPlanMain'||routeName == 'DeliverRequestMain'||routeName == 'ZZBJDeliverRequestMain'||routeName == 'UnplannedreceiptRequestMain'"> <div
<el-input v-model="keyWord" style="width: 240px" placeholder="回车自动添加"/> class="p-12px"
<el-button type="primary" style="margin-left: 10px" @click="batchAdd">{{t('批量添加')}}</el-button> v-if="
routeName == 'PurchaseMain' ||
routeName == 'ProductionMain' ||
routeName == 'ZZBJDeliverPlanMain' ||
routeName == 'DeliverPlanMain' ||
routeName == 'DeliverRequestMain' ||
routeName == 'ZZBJDeliverRequestMain' ||
routeName == 'UnplannedreceiptRequestMain'
"
>
<el-input v-model="keyWord" style="width: 240px" placeholder="回车自动添加" />
<el-button type="primary" style="margin-left: 10px" @click.stop="batchAdd">{{
t('批量添加')
}}</el-button>
</div> </div>
</div> </div>
</div> </div>
@ -349,46 +428,46 @@ const props = defineProps({
// //
isShowButton: { isShowButton: {
type: Boolean, type: Boolean,
default: true, default: true
}, },
// :custom="headerItem.sortable?headerItem.sortable:false" // :custom="headerItem.sortable?headerItem.sortable:false"
selectionTable: { selectionTable: {
type: Boolean, type: Boolean,
default: false, default: false
}, },
// //
isShowIndex: { isShowIndex: {
type: Boolean, type: Boolean,
default: false, default: false
}, },
// -- // --
isShowReduceButtonSelection:{ isShowReduceButtonSelection: {
type: Boolean, type: Boolean,
default: false, default: false
}, },
// //
isShowReduceButton:{ isShowReduceButton: {
type: Boolean, type: Boolean,
default: true, default: true
}, },
// //
tableLoading: { tableLoading: {
type: Boolean, type: Boolean,
default: false, default: false
}, },
// //
tableData: { tableData: {
type: Array, type: Array,
default: () => { default: () => {
return [] return []
}, }
}, },
// //
tableFields: { tableFields: {
type: Array, type: Array,
default: () => { default: () => {
return [] return []
}, }
}, },
// table // table
height: { height: {
@ -396,7 +475,7 @@ const props = defineProps({
default: () => { default: () => {
return '200' return '200'
} }
}, },
maxHeight: { maxHeight: {
type: [Number, String], type: [Number, String],
default: () => { default: () => {
@ -406,7 +485,7 @@ const props = defineProps({
// //
border: { border: {
type: Boolean, type: Boolean,
default: false, default: false
}, },
// tablerules // tablerules
tableFormRules: { tableFormRules: {
@ -418,7 +497,7 @@ const props = defineProps({
type: String, type: String,
required: false, required: false,
default: '' default: ''
}, }
}) })
// //
const emit = defineEmits([ const emit = defineEmits([
@ -444,16 +523,16 @@ const initSelectOptions = (item) => {
return item.dictType ? getStrDictOptions(item.dictType) : item.tableForm.initOptions return item.dictType ? getStrDictOptions(item.dictType) : item.tableForm.initOptions
} }
// //
const formSelectChange = (field, val,row) => { const formSelectChange = (field, val, row) => {
emit('formSelectChange', field, val,row) emit('formSelectChange', field, val, row)
} }
// //
const formFormDateChange = (field, val,row, index) => { const formFormDateChange = (field, val, row, index) => {
emit('formFormDateChange', field, val,row, index) emit('formFormDateChange', field, val, row, index)
} }
// //
const tableFormSelectOnBlur = (field, val,row,index) => { const tableFormSelectOnBlur = (field, val, row, index) => {
emit('tableFormSelectOnBlur', field, val,row,index) emit('tableFormSelectOnBlur', field, val, row, index)
} }
// - // -
const inputNumberChange = (field, index, row, e) => { const inputNumberChange = (field, index, row, e) => {
@ -465,18 +544,18 @@ const deleteTableData = ref([])
// selection // selection
const tableSelectionChange = (val) => { const tableSelectionChange = (val) => {
if(props.isShowReduceButtonSelection){ if (props.isShowReduceButtonSelection) {
// //
deleteTableData.value = val deleteTableData.value = val
}else{ } else {
emit('tableSelectionChange', val) emit('tableSelectionChange', val)
} }
} }
const handleSelectionDelete = ()=>{ const handleSelectionDelete = () => {
emit('tableSelectionDelete', deleteTableData.value) emit('tableSelectionDelete', deleteTableData.value)
nextTick(()=>{ nextTick(() => {
deleteTableData.value.forEach(row=>{ deleteTableData.value.forEach((row) => {
TableBaseComponents_Ref.value!.toggleRowSelection(row,false) TableBaseComponents_Ref.value!.toggleRowSelection(row, false)
}) })
}) })
} }
@ -491,12 +570,25 @@ const tableSortChange = (column, prop, order) => {
// //
const handleTableSelect = (row, column, event) => { const handleTableSelect = (row, column, event) => {
const selected = TableBaseComponents_Ref.value
?.getSelectionRows()
.some((item) => item.id === row.id)
if (!selected) {
TableBaseComponents_Ref.value?.toggleRowSelection(row, true)
} else {
//
TableBaseComponents_Ref.value?.toggleRowSelection(row, false)
}
emit('handleTableSelect', row, column, event) emit('handleTableSelect', row, column, event)
} }
// item // item
const itemIsDisabled = (colum, row) => { const itemIsDisabled = (colum, row) => {
return Boolean(colum.tableForm?.disabled) || Boolean(row.disabled) || Boolean(row['disabled_' + colum.field]) return (
Boolean(colum.tableForm?.disabled) ||
Boolean(row.disabled) ||
Boolean(row['disabled_' + colum.field])
)
} }
// const { t } = useI18n() // // const { t } = useI18n() //
@ -506,25 +598,27 @@ const TableBaseComponents_Ref = ref()
const TableBaseForm_Ref = ref() const TableBaseForm_Ref = ref()
/** /**
* 验证表单是否符合rules * 验证表单是否符合rules
* @param {*} success 如果验证成功走的方法 * @param {*} success 如果验证成功走的方法
* @param {*} error 如果验证不成功走的方法 * @param {*} error 如果验证不成功走的方法
*/ */
const validateForm = () => { const validateForm = () => {
console.log(TableBaseForm_Ref.value) console.log(TableBaseForm_Ref.value)
let _lists = TableBaseForm_Ref.value?.map(v => v.validate()) let _lists = TableBaseForm_Ref.value?.map((v) => v.validate())
return Promise.all(_lists).then(() => { return Promise.all(_lists)
return true .then(() => {
}).catch(() => { return true
return false })
}) .catch(() => {
return false
})
} }
// //
const handleDeleteTable = (row, index) => { const handleDeleteTable = (row, index) => {
emit('handleDeleteTable', row, index) emit('handleDeleteTable', row, index)
nextTick(()=>{ nextTick(() => {
TableBaseComponents_Ref.value!.toggleRowSelection(row,false) TableBaseComponents_Ref.value!.toggleRowSelection(row, false)
}) })
} }
// //
@ -532,59 +626,67 @@ const handleAddTable = () => {
emit('handleAddTable') emit('handleAddTable')
} }
// //
const inpuFocus = (headerItem, row, index)=>{ const inpuFocus = (headerItem, row, index) => {
if(headerItem?.tableForm?.isInpuFocusShow){ if (headerItem?.tableForm?.isInpuFocusShow) {
emit('inpuFocus', headerItem, row, index) emit('inpuFocus', headerItem, row, index)
} }
} }
// input // input
const inputStringBlur = (headerItem, val,row,index) => { const inputStringBlur = (headerItem, val, row, index) => {
emit('inputStringBlur', headerItem, val,row,index) emit('inputStringBlur', headerItem, val, row, index)
} }
const clearInput= (field, row, index) => { const clearInput = (field, row, index) => {
emit('clearInput',field, row, index) emit('clearInput', field, row, index)
} }
//table //table
const buttonOperationClick = (row, label, index)=> { const buttonOperationClick = (row, label, index) => {
emit("buttonOperationClick", row, label, index); emit('buttonOperationClick', row, label, index)
} }
const currentPage =ref(1) const currentPage = ref(1)
const pageSize = ref(10) const pageSize = ref(10)
const showTableData = ()=>{ const showTableData = () => {
if(props.tableData.length>10){ if (props.tableData.length > 10) {
return props.tableData.slice((currentPage.value-1)*pageSize.value,currentPage.value*pageSize.value) return props.tableData.slice(
}else{ (currentPage.value - 1) * pageSize.value,
currentPage.value * pageSize.value
)
} else {
return props.tableData return props.tableData
} }
} }
const keyWord = ref('') const keyWord = ref('')
console.log(9999,props.tableFields) console.log(9999, props.tableFields)
const batchAdd = ()=>{ const batchAdd = () => {
console.log(keyWord.value) console.log(keyWord.value)
let field = '' let field = ''
const itemCodeFields = props.tableFields.find(item=>item.field == 'itemCode') const itemCodeFields = props.tableFields.find((item) => item.field == 'itemCode')
const supplierFields = props.tableFields.find(item=>item.field == 'supplierCode') const supplierFields = props.tableFields.find((item) => item.field == 'supplierCode')
if(itemCodeFields){ if (itemCodeFields) {
field = itemCodeFields.field field = itemCodeFields.field
}else { } else {
if(itemCodeFields){ if (itemCodeFields) {
field = supplierFields.field field = supplierFields.field
} }
} }
console.log(field) console.log(field)
emit('batchAdd',keyWord.value) emit('batchAdd', keyWord.value)
} }
const disabledInput=(headerItem,row)=>{ const disabledInput = (headerItem, row) => {
if(headerItem.tableForm?.isInpuFocusShow){ if (headerItem.tableForm?.isInpuFocusShow) {
if(headerItem.tableForm?.enterSearch){ if (headerItem.tableForm?.enterSearch) {
return false return false
}else{ } else {
return true return true
} }
}else{ } else {
return headerItem?.tableForm?.disabled || Boolean(row.disabled) || Boolean(row['disabled_' + headerItem.field]) ||false return (
headerItem?.tableForm?.disabled ||
Boolean(row.disabled) ||
Boolean(row['disabled_' + headerItem.field]) ||
false
)
} }
} }
@ -594,13 +696,12 @@ defineExpose({
validateForm, validateForm,
keyWord keyWord
}) })
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
::v-deep(.el-table__body){ ::v-deep(.el-table__body) {
padding:10px 0px padding: 10px 0px;
} }
::v-deep(.el-table--default .el-table__cell) { ::v-deep(.el-table--default .el-table__cell) {
padding: 2px 0px; padding: 2px 0px;
@ -623,20 +724,23 @@ defineExpose({
display: block; display: block;
} }
.table-form ::v-deep(.is-horizontal) {
height: 12px !important;
display: block !important;
}
.button { .button {
>div { > div {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
cursor: pointer; cursor: pointer;
>div { > div {
margin-left: 6px; margin-left: 6px;
text-decoration: underline; text-decoration: underline;
color: #409eff; color: #409eff;
} }
} }
} }
</style> </style>

2
src/components/XButton/src/ButtonBase.vue

@ -8,7 +8,7 @@
:disabled="item.disabled" :disabled="item.disabled"
v-hasPermi="[item.hasPermi] || []" v-hasPermi="[item.hasPermi] || []"
v-if="item.name != 'set'" v-if="item.name != 'set'"
@click="buttonBaseClick(item.name, item, $event)" @click.stop="buttonBaseClick(item.name, item, $event)"
> >
<Icon v-if="item.icon" :icon="item.icon" class="mr-1px" /> <Icon v-if="item.icon" :icon="item.icon" class="mr-1px" />
<span :style="{width:item.width+'px'||'auto'}" :class="[item.width?'ellipsis':'']">{{ item.label }}</span> <span :style="{width:item.width+'px'||'auto'}" :class="[item.width?'ellipsis':'']">{{ item.label }}</span>

4
src/views/wms/basicDataManage/strategySetting/strategy/arrivalInspectionStrategy/AddForm.vue

@ -1,7 +1,7 @@
<!-- 到货验货任务拆分策略弹出层 --> <!-- 到货验货任务拆分策略弹出层 -->
<template> <template>
<Dialog :title="dialogTitle" v-model="dialogVisible" style="width: 700px"> <Dialog :title="dialogTitle" v-model="dialogVisible" width="700px">
<div class="p-20px m--10px" style="max-height: 50vh; overflow-y: auto"> <div class="p-20px m--10px" style="max-height: 80vh; overflow-y: auto">
<!-- 规则 --> <!-- 规则 -->
<el-form <el-form
ref="formRef" ref="formRef"

4
src/views/wms/basicDataManage/strategySetting/strategy/batchStrategy/AddForm.vue

@ -1,7 +1,7 @@
<!-- 批次策略弹窗 --> <!-- 批次策略弹窗 -->
<template> <template>
<Dialog :title="dialogTitle" v-model="dialogVisible" style="width: 800px"> <Dialog :title="dialogTitle" v-model="dialogVisible" width="800px">
<div class="p-20px m--10px" style="max-height: 50vh; overflow-y: auto"> <div class="p-20px m--10px" style="max-height: 80vh; overflow-y: auto">
<el-form <el-form
ref="formRef" ref="formRef"
:model="formData" :model="formData"

4
src/views/wms/basicDataManage/strategySetting/strategy/downShelfStrategy/AddForm.vue

@ -1,7 +1,7 @@
<!-- 下架策略弹窗 --> <!-- 下架策略弹窗 -->
<template> <template>
<Dialog :title="dialogTitle" v-model="dialogVisible" style="width: 700px"> <Dialog :title="dialogTitle" v-model="dialogVisible" width="700px">
<div class="p-20px m--10px" style="max-height: 50vh; overflow-y: auto"> <div class="p-20px m--10px" style="max-height: 80vh; overflow-y: auto">
<el-form <el-form
ref="formRef" ref="formRef"
:model="formData" :model="formData"

4
src/views/wms/basicDataManage/strategySetting/strategy/inspectStrategy/AddForm.vue

@ -1,8 +1,8 @@
<!-- 检验策略弹窗 --> <!-- 检验策略弹窗 -->
<template> <template>
<Dialog :title="dialogTitle" v-model="dialogVisible" style="width: 800px"> <Dialog :title="dialogTitle" v-model="dialogVisible" width="800px" >
<div class="p-20px m--10px" style="max-height: 50vh; overflow-y: auto"> <div class="p-20px m--10px" style="max-height: 80vh; overflow-y: auto">
<el-form <el-form
ref="formRef" ref="formRef"
:model="formData" :model="formData"

4
src/views/wms/basicDataManage/strategySetting/strategy/manageAccuracyStrategy/AddForm.vue

@ -1,7 +1,7 @@
<!-- 管理精度策略弹窗 --> <!-- 管理精度策略弹窗 -->
<template> <template>
<Dialog :title="dialogTitle" v-model="dialogVisible" style="width: 700px"> <Dialog :title="dialogTitle" v-model="dialogVisible" width="700px">
<div class="p-20px m--10px" style="max-height: 50vh; overflow-y: auto"> <div class="p-20px m--10px" style="max-height: 80vh; overflow-y: auto">
<el-form <el-form
ref="formRef" ref="formRef"
:model="formData" :model="formData"

4
src/views/wms/basicDataManage/strategySetting/strategy/purchaseReceiptStrategy/AddForm.vue

@ -1,8 +1,8 @@
<!-- 采购收货任务拆分策略弹出层 --> <!-- 采购收货任务拆分策略弹出层 -->
<template> <template>
<Dialog :title="dialogTitle" v-model="dialogVisible" style="width: 700px"> <Dialog :title="dialogTitle" v-model="dialogVisible" width="700px">
<div class="p-20px m--10px" style="max-height: 50vh; overflow-y: auto"> <div class="p-20px m--10px" style="max-height: 80vh; overflow-y: auto">
<!-- 规则 --> <!-- 规则 -->
<el-form <el-form
ref="formRef" ref="formRef"

4
src/views/wms/basicDataManage/strategySetting/strategy/repairMaterialStrategy/AddForm.vue

@ -1,7 +1,7 @@
<!-- 补料策略弹窗 --> <!-- 补料策略弹窗 -->
<template> <template>
<Dialog :title="dialogTitle" v-model="dialogVisible" style="width: 700px"> <Dialog :title="dialogTitle" v-model="dialogVisible" width="700px">
<div class="p-20px m--10px" style="max-height: 50vh; overflow-y: auto"> <div class="p-20px m--10px" style="max-height: 80vh; overflow-y: auto">
<el-form <el-form
ref="formRef" ref="formRef"
:model="formData" :model="formData"

4
src/views/wms/basicDataManage/strategySetting/strategy/storageCapacityStrategy/AddForm.vue

@ -1,7 +1,7 @@
<!-- 存储容量策略弹窗 --> <!-- 存储容量策略弹窗 -->
<template> <template>
<Dialog :title="dialogTitle" v-model="dialogVisible" style="width: 700px"> <Dialog :title="dialogTitle" v-model="dialogVisible" width="700px">
<div class="p-20px m--10px" style="max-height: 50vh; overflow-y: auto"> <div class="p-20px m--10px" style="max-height: 80vh; overflow-y: auto">
<el-form <el-form
ref="formRef" ref="formRef"
:model="formData" :model="formData"

4
src/views/wms/basicDataManage/strategySetting/strategy/supplieDeliveryStrategy/AddForm.vue

@ -1,8 +1,8 @@
<!-- 采购计划策略弹出层 --> <!-- 采购计划策略弹出层 -->
<template> <template>
<Dialog :title="dialogTitle" v-model="dialogVisible" style="width: 800px"> <Dialog :title="dialogTitle" v-model="dialogVisible" width="800px">
<div class="p-20px m--10px" style="max-height: 50vh; overflow-y: auto"> <div class="p-20px m--10px" style="max-height: 80vh; overflow-y: auto">
<el-form <el-form
ref="formRef" ref="formRef"
:model="formData" :model="formData"

4
src/views/wms/basicDataManage/strategySetting/strategy/upShelfStrategy/AddForm.vue

@ -1,7 +1,7 @@
<!-- 上架策略弹窗 --> <!-- 上架策略弹窗 -->
<template> <template>
<Dialog :title="dialogTitle" v-model="dialogVisible" style="width: 700px"> <Dialog :title="dialogTitle" v-model="dialogVisible" width="700px">
<div class="p-20px m--10px" style="max-height: 50vh; overflow-y: auto"> <div class="p-20px m--10px" style="max-height: 80vh; overflow-y: auto">
<el-form <el-form
ref="formRef" ref="formRef"
:model="formData" :model="formData"

4
src/views/wms/basicDataManage/strategySetting/strategy/utensilCapacityStrategy/AddForm.vue

@ -1,7 +1,7 @@
<!-- 器具容量策略弹窗 --> <!-- 器具容量策略弹窗 -->
<template> <template>
<Dialog :title="dialogTitle" v-model="dialogVisible" style="width: 700px"> <Dialog :title="dialogTitle" v-model="dialogVisible" width="700px">
<div class="p-20px m--10px" style="max-height: 50vh; overflow-y: auto"> <div class="p-20px m--10px" style="max-height: 80vh; overflow-y: auto">
<el-form <el-form
ref="formRef" ref="formRef"
:model="formData" :model="formData"

4
src/views/wms/basicDataManage/strategySetting/strategy/warehouseStorageStrategy/AddForm.vue

@ -1,7 +1,7 @@
<!-- 库位存储策略弹窗弹窗 --> <!-- 库位存储策略弹窗弹窗 -->
<template> <template>
<Dialog :title="dialogTitle" v-model="dialogVisible" style="width: 700px"> <Dialog :title="dialogTitle" v-model="dialogVisible" width="700px">
<div class="p-20px m--10px" style="max-height: 50vh; overflow-y: auto"> <div class="p-20px m--10px" style="max-height: 80vh; overflow-y: auto">
<el-form <el-form
ref="formRef" ref="formRef"
:model="formData" :model="formData"

4
src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue

@ -127,7 +127,7 @@
:isShowFooterButtton="false" :isShowFooterButtton="false"
/> />
<!-- 标签打印 --> <!-- 标签打印 -->
<SearchTable style="width:905px" ref="searchTableRef" @searchTableSuccess="searchTableSuccess1" /> <SearchTable width="905px" ref="searchTableRef" @searchTableSuccess="searchTableSuccess1" />
<el-dialog <el-dialog
v-model="showQualityReport" v-model="showQualityReport"
:title="t('质检明细')" :title="t('质检明细')"
@ -459,7 +459,7 @@ const labelPrint = async (row) => {
tableObject.loading = false tableObject.loading = false
const tableColumns = SupplierdeliverRequestPackage.allSchemas.tableFormColumns const tableColumns = SupplierdeliverRequestPackage.allSchemas.tableFormColumns
tableColumns.forEach((item) => { tableColumns.forEach((item) => {
item.width = item.table?.width || 150 item.width = item.table?.width
}) })
searchTableRef.value.openData("标签信息",tableObjectPrint,{tableColumns},true) searchTableRef.value.openData("标签信息",tableObjectPrint,{tableColumns},true)
} }

4
src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue

@ -154,7 +154,7 @@
</BasicForm> </BasicForm>
<!-- 标签打印 --> <!-- 标签打印 -->
<SearchTable style="width:905px" ref="searchTableRef" @searchTableSuccess="searchTableSuccess1" > <SearchTable width="905px" ref="searchTableRef" @searchTableSuccess="searchTableSuccess1" >
<!-- <template #actions> <!-- <template #actions>
<el-button type="primary" @click="printAllClick">打印全部</el-button> <el-button type="primary" @click="printAllClick">打印全部</el-button>
</template> --> </template> -->
@ -894,7 +894,7 @@ const labelPrint = async (row) => {
tableObject.loading = false tableObject.loading = false
const tableColumns = SupplierdeliverRequestPackage.allSchemas.tableFormColumns const tableColumns = SupplierdeliverRequestPackage.allSchemas.tableFormColumns
tableColumns.forEach((item) => { tableColumns.forEach((item) => {
item.width = item.table?.width || 150 item.width = item.table?.width
}) })
searchTableRef.value.openData(t('ts.标签信息'),tableObjectPrint,{tableColumns},true) searchTableRef.value.openData(t('ts.标签信息'),tableObjectPrint,{tableColumns},true)
} }

5
src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts

@ -1694,7 +1694,6 @@ export const SupplierdeliverRequestPackage = useCrudSchemas(reactive<CrudSchema[
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
table: { table: {
width: 180,
fixed: 'left' fixed: 'left'
}, },
}, },
@ -1704,7 +1703,6 @@ export const SupplierdeliverRequestPackage = useCrudSchemas(reactive<CrudSchema[
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
table: { table: {
width: 150,
}, },
}, },
{ {
@ -1713,7 +1711,6 @@ export const SupplierdeliverRequestPackage = useCrudSchemas(reactive<CrudSchema[
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
table: { table: {
width: 150,
}, },
}, },
{ {
@ -1721,7 +1718,6 @@ export const SupplierdeliverRequestPackage = useCrudSchemas(reactive<CrudSchema[
field: 'qty', field: 'qty',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150,
}, },
}, },
{ {
@ -1734,7 +1730,6 @@ export const SupplierdeliverRequestPackage = useCrudSchemas(reactive<CrudSchema[
component: 'SelectV2' component: 'SelectV2'
}, },
table: { table: {
width: 150,
}, },
}, },

Loading…
Cancel
Save