Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
weiqiao-vue
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
金民
weiqiao-vue
Commits
4559c117
Commit
4559c117
authored
Feb 05, 2026
by
胡鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
盈亏 生成单据
parent
6ea9755b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
119 additions
and
88 deletions
+119
-88
xjrsoft-vue3/src/views/ckgl/kcyk/index.vue
+119
-88
No files found.
xjrsoft-vue3/src/views/ckgl/kcyk/index.vue
View file @
4559c117
<
template
>
<
template
>
<ResizePageWrapper
:hasLeft=
"false"
>
<ResizePageWrapper
:hasLeft=
"false"
>
<template
#
resizeRight
>
<template
#
resizeRight
>
<BasicTable
@
register=
"registerTable"
isMenuTable
ref=
"tableRef"
:row-selection=
"
{ selectedRowKeys: selectedKeys, onChange: onSelectChange }"
<BasicTable
@
register=
"registerTable"
isMenuTable
ref=
"tableRef"
:row-selection=
"
{ selectedRowKeys: selectedKeys, onChange: onSelectChange }">
>
<template
#
toolbar
>
<template
#
toolbar
>
<template
v-for=
"button in tableButtonConfig"
:key=
"button.code"
>
<template
v-for=
"button in tableButtonConfig"
:key=
"button.code"
>
<a-button
v-if=
"button.isDefault"
type=
"primary"
@
click=
"buttonClick(button.code)"
>
<a-button
v-if=
"button.isDefault"
type=
"primary"
@
click=
"buttonClick(button.code)"
>
<template
#
icon
><Icon
:icon=
"button.icon"
/></
template
>
<template
#
icon
>
<Icon
:icon=
"button.icon"
/>
</
template
>
{{ button.name }}
{{ button.name }}
</a-button>
</a-button>
<CustomButtonModal
v-else-if=
"button.buttonType == 'modal'"
:info=
"button"
/>
<CustomButtonModal
v-else-if=
"button.buttonType == 'modal'"
:info=
"button"
/>
<a-button
v-else
:type=
"button.buttonType === 'danger' ? 'default' : button.buttonType || 'primary'"
:danger=
"button.buttonType === 'danger'"
>
<a-button
v-else
:type=
"button.buttonType === 'danger' ? 'default' : button.buttonType || 'primary'"
<
template
#
icon
><Icon
:icon=
"button.icon"
/></
template
>
:danger=
"button.buttonType === 'danger'"
>
<
template
#
icon
>
<Icon
:icon=
"button.icon"
/>
</
template
>
{{ button.name }}
{{ button.name }}
</a-button>
</a-button>
</template>
</template>
...
@@ -29,10 +32,7 @@
...
@@ -29,10 +32,7 @@
<template
v-if=
"column.dataIndex === 'action'"
>
<template
v-if=
"column.dataIndex === 'action'"
>
<TableAction
<TableAction
:actions=
"getLessActions(record)"
:dropDownActions=
"getMoreActions(record)"
/>
:actions=
"getLessActions(record)"
:dropDownActions=
"getMoreActions(record)"
/>
</
template
>
</
template
>
<
template
v-else-if=
"column.dataIndex && column?.listStyle"
>
<
template
v-else-if=
"column.dataIndex && column?.listStyle"
>
...
@@ -49,39 +49,41 @@
...
@@ -49,39 +49,41 @@
<KcykModal
@
register=
"registerModal"
@
success=
"handleFormSuccess"
@
cancel=
"handleFormCancel"
/>
<KcykModal
@
register=
"registerModal"
@
success=
"handleFormSuccess"
@
cancel=
"handleFormCancel"
/>
</ResizePageWrapper>
</ResizePageWrapper>
</template>
</template>
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
import
{
ref
,
computed
,
provide
,
Ref
,
import
{
ref
,
computed
,
provide
,
Ref
,
}
from
'vue'
;
}
from
'vue'
;
import
{
getAppEnvConfig
}
from
'/@/utils/env'
;
import
{
BasicTable
,
useTable
,
TableAction
,
ActionItem
}
from
'/@/components/Table'
;
import
{
getToken
}
from
'/@/utils/auth'
;
import
{
getMesWarehouseProfitandlossPage
,
deleteMesWarehouseProfitandloss
}
from
'/@/api/ckgl/kcyk'
;
import
{
BasicTable
,
useTable
,
TableAction
,
ActionItem
}
from
'/@/components/Table'
;
import
{
ResizePageWrapper
}
from
'/@/components/Page'
;
import
{
getMesWarehouseProfitandlossPage
,
deleteMesWarehouseProfitandloss
}
from
'/@/api/ckgl/kcyk'
;
import
{
useMessage
}
from
'/@/hooks/web/useMessage'
;
import
{
ResizePageWrapper
}
from
'/@/components/Page'
;
import
{
useI18n
}
from
'/@/hooks/web/useI18n'
;
import
{
useMessage
}
from
'/@/hooks/web/useMessage'
;
import
{
usePermission
}
from
'/@/hooks/web/usePermission'
;
import
{
useI18n
}
from
'/@/hooks/web/useI18n'
;
import
CustomButtonModal
from
'/@/components/Form/src/components/CustomButtonModal.vue'
;
import
{
usePermission
}
from
'/@/hooks/web/usePermission'
;
import
{
executeListStyle
,
getValue
}
from
'/@/hooks/web/useListStyle'
;
//列表样式配置
import
CustomButtonModal
from
'/@/components/Form/src/components/CustomButtonModal.vue'
;
import
{
useRouter
}
from
'vue-router'
;
import
{
executeListStyle
,
getValue
}
from
'/@/hooks/web/useListStyle'
;
//列表样式配置
import
{
useRouter
}
from
'vue-router'
;
import
{
useModal
}
from
'/@/components/Modal'
;
import
{
useModal
}
from
'/@/components/Modal'
;
import
KcykModal
from
'./components/KcykModal.vue'
;
import
KcykModal
from
'./components/KcykModal.vue'
;
...
@@ -89,9 +91,9 @@
...
@@ -89,9 +91,9 @@
import
{
searchFormSchema
,
columns
}
from
'./components/config'
;
import
{
searchFormSchema
,
columns
}
from
'./components/config'
;
import
Icon
from
'/@/components/Icon/index'
;
import
Icon
from
'/@/components/Icon/index'
;
...
@@ -102,70 +104,104 @@
...
@@ -102,70 +104,104 @@
const
listSpliceNum
=
ref
(
3
);
//操作列最先展示几个
const
listSpliceNum
=
ref
(
3
);
//操作列最先展示几个
import
{
useConcurrentLock
}
from
'/@/hooks/web/useConcurrentLock'
;
import
{
useConcurrentLock
}
from
'/@/hooks/web/useConcurrentLock'
;
import
{
log
}
from
'console'
;
const
pageParamsInfo
=
ref
<
any
>
({});
const
pageParamsInfo
=
ref
<
any
>
({});
const
{
enableLockeData
,
handleOpenFormEnableLockeData
,
handleCloseFormEnableLocke
,
handleHasEnableLocke
}
=
const
{
enableLockeData
,
handleOpenFormEnableLockeData
,
handleCloseFormEnableLocke
,
handleHasEnableLocke
}
=
useConcurrentLock
();
useConcurrentLock
();
const
{
notification
}
=
useMessage
();
const
{
notification
}
=
useMessage
();
const
{
t
}
=
useI18n
();
const
{
t
}
=
useI18n
();
defineEmits
([
'register'
]);
defineEmits
([
'register'
]);
const
{
filterColumnAuth
,
filterButtonAuth
,
hasPermission
}
=
usePermission
();
const
{
filterColumnAuth
,
filterButtonAuth
,
hasPermission
}
=
usePermission
();
const
filterColumns
=
filterColumnAuth
(
columns
);
const
filterColumns
=
filterColumnAuth
(
columns
);
const
tableRef
=
ref
();
const
tableRef
=
ref
();
//展示在列表内的按钮
//展示在列表内的按钮
const
actionButtons
=
ref
<
string
[]
>
([
"create"
]);
const
actionButtons
=
ref
<
string
[]
>
([
"create"
]);
const
buttonConfigs
=
computed
(()
=>
{
const
buttonConfigs
=
computed
(()
=>
{
const
list
=
[{
"buttonId"
:
"2016441785685393408"
,
"name"
:
"生成单据"
,
"code"
:
"create"
,
"icon"
:
"ant-design:download-outlined"
,
"isDefault"
:
false
,
"isUse"
:
true
,
"setting"
:[],
"showType"
:
"inline"
,
"buttonType"
:
"primary"
}]
const
list
=
[{
"buttonId"
:
"2016441785685393408"
,
"name"
:
"生成单据"
,
"code"
:
"create"
,
"icon"
:
"ant-design:download-outlined"
,
"isDefault"
:
false
,
"isUse"
:
true
,
"setting"
:
[],
"showType"
:
"inline"
,
"buttonType"
:
"primary"
}]
return
filterButtonAuth
(
list
);
return
filterButtonAuth
(
list
);
})
})
const
tableButtonConfig
=
computed
(()
=>
{
const
tableButtonConfig
=
computed
(()
=>
{
return
buttonConfigs
.
value
?.
filter
((
x
)
=>
!
actionButtons
.
value
.
includes
(
x
.
code
));
return
buttonConfigs
.
value
?.
filter
((
x
)
=>
!
actionButtons
.
value
.
includes
(
x
.
code
));
});
});
const
actionButtonConfig
=
computed
(()
=>
{
const
actionButtonConfig
=
computed
(()
=>
{
return
buttonConfigs
.
value
?.
filter
((
x
)
=>
actionButtons
.
value
.
includes
(
x
.
code
));
return
buttonConfigs
.
value
?.
filter
((
x
)
=>
actionButtons
.
value
.
includes
(
x
.
code
));
});
// 调用生成单据接口
const
btnEvent
=
{
create
:
async
(
record
)
=>
{
try
{
const
response
=
await
fetch
(
getAppEnvConfig
().
VITE_GLOB_API_URL
+
'/ckgl/kcyk/addslip'
,
{
method
:
'POST'
,
headers
:
{
'Content-Type'
:
'application/json'
,
'Authorization'
:
`Bearer
${
getToken
()}
`
},
body
:
JSON
.
stringify
(
record
)
});
});
if
(
response
.
ok
)
{
const
btnEvent
=
{}
notification
.
success
({
message
:
'成功'
,
description
:
'生成单据成功'
});
// 刷新列表
reload
();
}
else
{
const
error
=
await
response
.
json
();
notification
.
error
({
message
:
'失败'
,
description
:
error
.
message
||
'生成单据失败'
});
}
}
catch
(
error
)
{
notification
.
error
({
message
:
'错误'
,
description
:
'生成单据时发生错误'
});
console
.
error
(
'生成单据失败:'
,
error
);
}
}
}
const
{
currentRoute
}
=
useRouter
();
const
{
currentRoute
}
=
useRouter
();
const
formIdComputedRef
=
computed
(()
=>
currentRoute
.
value
.
meta
.
formId
as
string
);
const
formIdComputedRef
=
computed
(()
=>
currentRoute
.
value
.
meta
.
formId
as
string
);
provide
<
Ref
<
string
>>
(
'currentFormId'
,
formIdComputedRef
);
provide
<
Ref
<
string
>>
(
'currentFormId'
,
formIdComputedRef
);
const
selectedKeys
=
ref
<
string
[]
>
([]);
const
selectedKeys
=
ref
<
string
[]
>
([]);
const
selectedRowsData
=
ref
<
any
[]
>
([]);
const
selectedRowsData
=
ref
<
any
[]
>
([]);
const
[
registerModal
,
{
openModal
}]
=
useModal
();
const
[
registerModal
,
{
openModal
}]
=
useModal
();
const
[
registerTable
,
{
reload
,
}]
=
useTable
({
const
[
registerTable
,
{
reload
,
}]
=
useTable
({
title
:
'Kcyk列表'
,
title
:
'Kcyk列表'
,
api
:
getMesWarehouseProfitandlossPage
,
api
:
getMesWarehouseProfitandlossPage
,
rowKey
:
'id'
,
rowKey
:
'id'
,
...
@@ -179,9 +215,9 @@
...
@@ -179,9 +215,9 @@
fieldMapToTime
:
[],
fieldMapToTime
:
[],
showResetButton
:
false
,
showResetButton
:
false
,
},
},
bordered
:
false
,
bordered
:
false
,
beforeFetch
:
(
params
)
=>
{
beforeFetch
:
(
params
)
=>
{
pageParamsInfo
.
value
=
{...
params
,
FormId
:
formIdComputedRef
.
value
,
PK
:
'id'
}
pageParamsInfo
.
value
=
{
...
params
,
FormId
:
formIdComputedRef
.
value
,
PK
:
'id'
}
return
pageParamsInfo
.
value
;
return
pageParamsInfo
.
value
;
},
},
afterFetch
:
(
res
)
=>
{
afterFetch
:
(
res
)
=>
{
...
@@ -212,15 +248,15 @@
...
@@ -212,15 +248,15 @@
isAdvancedQuery
:
false
,
isAdvancedQuery
:
false
,
querySelectOption
:
JSON
.
stringify
(
searchFormSchema
),
querySelectOption
:
JSON
.
stringify
(
searchFormSchema
),
objectId
:
formIdComputedRef
.
value
,
////系统表单formId,自定义表单releaseId的id值
objectId
:
formIdComputedRef
.
value
,
////系统表单formId,自定义表单releaseId的id值
});
});
function
buttonClick
(
code
)
{
function
buttonClick
(
code
)
{
btnEvent
[
code
]();
btnEvent
[
code
]();
}
}
...
@@ -232,12 +268,12 @@
...
@@ -232,12 +268,12 @@
function
onSelectChange
(
selectedRowKeys
:
[],
selectedRows
)
{
function
onSelectChange
(
selectedRowKeys
:
[],
selectedRows
)
{
selectedKeys
.
value
=
selectedRowKeys
;
selectedKeys
.
value
=
selectedRowKeys
;
selectedRowsData
.
value
=
selectedRows
;
selectedRowsData
.
value
=
selectedRows
;
}
}
function
customRow
(
record
:
Recordable
)
{
function
customRow
(
record
:
Recordable
)
{
console
.
log
(
record
);
console
.
log
(
record
);
// 强制根据盈亏状态设置行背景色
// 强制根据盈亏状态设置行背景色
let
rowStyle
=
{};
let
rowStyle
=
{};
...
@@ -270,40 +306,40 @@
...
@@ -270,40 +306,40 @@
}
}
},
},
};
};
}
}
function
handleSuccess
()
{
function
handleSuccess
()
{
selectedKeys
.
value
=
[];
selectedKeys
.
value
=
[];
selectedRowsData
.
value
=
[];
selectedRowsData
.
value
=
[];
reload
();
reload
();
}
}
function
handleFormSuccess
()
{
function
handleFormSuccess
()
{
handleSuccess
();
handleSuccess
();
handleCloseFormEnableLocke
(
buttonConfigs
.
value
,
'edit'
);
handleCloseFormEnableLocke
(
buttonConfigs
.
value
,
'edit'
);
}
}
function
handleFormCancel
()
{
function
handleFormCancel
()
{
handleCloseFormEnableLocke
(
buttonConfigs
.
value
,
'edit'
);
handleCloseFormEnableLocke
(
buttonConfigs
.
value
,
'edit'
);
}
}
function
getLessActions
(
record
:
Recordable
)
{
function
getLessActions
(
record
:
Recordable
)
{
let
list
=
getActions
(
record
);
let
list
=
getActions
(
record
);
return
list
.
slice
(
0
,
listSpliceNum
.
value
);
return
list
.
slice
(
0
,
listSpliceNum
.
value
);
}
}
function
getMoreActions
(
record
:
Recordable
)
{
function
getMoreActions
(
record
:
Recordable
)
{
let
list
=
getActions
(
record
);
let
list
=
getActions
(
record
);
return
list
.
slice
(
listSpliceNum
.
value
);
return
list
.
slice
(
listSpliceNum
.
value
);
}
}
function
getActions
(
record
:
Recordable
):
ActionItem
[]
{
function
getActions
(
record
:
Recordable
):
ActionItem
[]
{
record
.
isCanEdit
=
false
;
record
.
isCanEdit
=
false
;
let
actionsList
:
ActionItem
[]
=
[];
let
actionsList
:
ActionItem
[]
=
[];
...
@@ -330,25 +366,20 @@
...
@@ -330,25 +366,20 @@
}
}
});
});
return
actionsList
;
return
actionsList
;
}
}
</
script
>
</
script
>
<
style
lang=
"less"
scoped
>
<
style
lang=
"less"
scoped
>
:deep
(
.ant-table-selection-col
)
{
:deep
(
.ant-table-selection-col
)
{
width
:
50px
;
width
:
50px
;
}
}
.show
{
.show
{
display
:
flex
;
display
:
flex
;
}
}
.hide
{
.hide
{
display
:
none
!important
;
display
:
none
!important
;
}
}
</
style
>
</
style
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment