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
1
Merge Requests
1
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
d9a58476
Commit
d9a58476
authored
Mar 19, 2026
by
董晓奇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(10)发货单生成后自动生成发货质检单,仓库进行检查(给仓库培训,不合格后进行不合格处理,现在后台没报检按钮
parent
6a55618c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
421 additions
and
305 deletions
+421
-305
xjrsoft-vue3/src/api/ckgl/xsck/index.ts
+18
-16
xjrsoft-vue3/src/views/ckgl/xsck/components/Form.vue
+121
-45
xjrsoft-vue3/src/views/ckgl/xsck/components/XsckModal.vue
+42
-45
xjrsoft-vue3/src/views/ckgl/xsck/components/config.ts
+15
-0
xjrsoft-vue3/src/views/ckgl/xsck/index.vue
+225
-199
No files found.
xjrsoft-vue3/src/api/ckgl/xsck/index.ts
View file @
d9a58476
import
{
MesWarehouseSaleoutPageModel
,
MesWarehouseSaleoutPageParams
,
MesWarehouseSaleoutPageResult
}
from
'./model/XsckModel'
;
import
{
MesWarehouseSaleoutPageModel
,
MesWarehouseSaleoutPageParams
,
MesWarehouseSaleoutPageResult
,
}
from
'./model/XsckModel'
;
import
{
defHttp
}
from
'/@/utils/http/axios'
;
import
{
ErrorMessageMode
}
from
'/#/axios'
;
...
...
@@ -8,16 +11,16 @@ enum Api {
List
=
'/ckgl/xsck/list'
,
Info
=
'/ckgl/xsck/info'
,
MesWarehouseSaleout
=
'/ckgl/xsck'
,
Export
=
'/ckgl/xsck/export'
,
}
/**
* @description: 查询MesWarehouseSaleout分页列表
*/
export
async
function
getMesWarehouseSaleoutPage
(
params
:
MesWarehouseSaleoutPageParams
,
mode
:
ErrorMessageMode
=
'modal'
)
{
export
async
function
getMesWarehouseSaleoutPage
(
params
:
MesWarehouseSaleoutPageParams
,
mode
:
ErrorMessageMode
=
'modal'
,
)
{
return
defHttp
.
get
<
MesWarehouseSaleoutPageResult
>
(
{
url
:
Api
.
Page
,
...
...
@@ -47,7 +50,10 @@ export async function getMesWarehouseSaleout(id: String, mode: ErrorMessageMode
/**
* @description: 新增MesWarehouseSaleout
*/
export
async
function
addMesWarehouseSaleout
(
mesWarehouseSaleout
:
Recordable
,
mode
:
ErrorMessageMode
=
'modal'
)
{
export
async
function
addMesWarehouseSaleout
(
mesWarehouseSaleout
:
Recordable
,
mode
:
ErrorMessageMode
=
'modal'
,
)
{
return
defHttp
.
post
<
boolean
>
(
{
url
:
Api
.
MesWarehouseSaleout
,
...
...
@@ -62,7 +68,10 @@ export async function addMesWarehouseSaleout(mesWarehouseSaleout: Recordable, mo
/**
* @description: 更新MesWarehouseSaleout
*/
export
async
function
updateMesWarehouseSaleout
(
mesWarehouseSaleout
:
Recordable
,
mode
:
ErrorMessageMode
=
'modal'
)
{
export
async
function
updateMesWarehouseSaleout
(
mesWarehouseSaleout
:
Recordable
,
mode
:
ErrorMessageMode
=
'modal'
,
)
{
return
defHttp
.
put
<
boolean
>
(
{
url
:
Api
.
MesWarehouseSaleout
,
...
...
@@ -89,15 +98,10 @@ export async function deleteMesWarehouseSaleout(ids: string[], mode: ErrorMessag
);
}
/**
* @description: 导出MesWarehouseSaleout
*/
export
async
function
exportMesWarehouseSaleout
(
params
?:
object
,
mode
:
ErrorMessageMode
=
'modal'
)
{
export
async
function
exportMesWarehouseSaleout
(
params
?:
object
,
mode
:
ErrorMessageMode
=
'modal'
)
{
return
defHttp
.
download
(
{
url
:
Api
.
Export
,
...
...
@@ -110,5 +114,3 @@ export async function exportMesWarehouseSaleout(
},
);
}
xjrsoft-vue3/src/views/ckgl/xsck/components/Form.vue
View file @
d9a58476
<
template
>
<div
class=
"pt-4"
>
<SimpleForm
ref=
"systemFormRef"
:formProps=
"data.formDataProps"
:formModel=
"state.formModel"
:isWorkFlow=
"props.fromPage
!=
FromPageType.MENU"
:isCamelCase=
"true"
:isWorkFlow=
"props.fromPage
!=
FromPageType.MENU"
:isCamelCase=
"true"
@
model-change=
"handleChange"
/>
</div>
...
...
@@ -15,21 +14,30 @@
import
{
reactive
,
ref
,
onMounted
,
nextTick
,
watch
}
from
'vue'
;
import
{
formProps
,
formEventConfigs
}
from
'./config'
;
import
SimpleForm
from
'/@/components/SimpleForm/src/SimpleForm.vue'
;
import
{
addMesWarehouseSaleout
,
getMesWarehouseSaleout
,
updateMesWarehouseSaleout
}
from
'/@/api/ckgl/xsck'
;
import
{
cloneDeep
,
isString
}
from
'lodash-es'
;
import
{
addMesWarehouseSaleout
,
getMesWarehouseSaleout
,
updateMesWarehouseSaleout
,
}
from
'/@/api/ckgl/xsck'
;
import
{
cloneDeep
,
isString
}
from
'lodash-es'
;
import
{
FormDataProps
}
from
'/@/components/Designer/src/types'
;
import
{
usePermission
}
from
'/@/hooks/web/usePermission'
;
import
CustomButtonModal
from
'/@/components/Form/src/components/CustomButtonModal.vue'
;
import
{
FromPageType
}
from
'/@/enums/workflowEnum'
;
import
{
createFormEvent
,
getFormDataEvent
,
loadFormEvent
,
submitFormEvent
,}
from
'/@/hooks/web/useFormEvent'
;
import
{
createFormEvent
,
getFormDataEvent
,
loadFormEvent
,
submitFormEvent
,
}
from
'/@/hooks/web/useFormEvent'
;
import
{
changeWorkFlowForm
,
changeSchemaDisabled
}
from
'/@/hooks/web/useWorkFlowForm'
;
import
{
WorkFlowFormParams
}
from
'/@/model/workflow/bpmnConfig'
;
import
{
useRouter
}
from
'vue-router'
;
const
{
filterFormSchemaAuth
}
=
usePermission
();
const
RowKey
=
'id'
;
const
emits
=
defineEmits
([
'changeUploadComponentIds'
,
'loadingCompleted'
,
'update:value'
]);
const
emits
=
defineEmits
([
'changeUploadComponentIds'
,
'loadingCompleted'
,
'update:value'
]);
const
props
=
defineProps
({
fromPage
:
{
type
:
Number
,
...
...
@@ -42,34 +50,52 @@
});
const
state
=
reactive
({
formModel
:
{},
formInfo
:
{
formId
:
''
,
formName
:
''
}
formInfo
:
{
formId
:
''
,
formName
:
''
},
});
const
{
currentRoute
}
=
useRouter
();
watch
(
()
=>
state
.
formModel
,
(
val
)
=>
{
(
val
)
=>
{
emits
(
'update:value'
,
val
);
},
{
deep
:
true
,
},
);
onMounted
(
async
()
=>
{
try
{
if
(
props
.
fromPage
==
FromPageType
.
MENU
)
{
setMenuPermission
();
if
(
currentRoute
.
value
.
meta
){
state
.
formInfo
.
formName
=
currentRoute
.
value
.
meta
.
title
&&
isString
(
currentRoute
.
value
.
meta
.
title
)?
currentRoute
.
value
.
meta
.
title
:
''
;
state
.
formInfo
.
formId
=
currentRoute
.
value
.
meta
.
formId
&&
isString
(
currentRoute
.
value
.
meta
.
formId
)?
currentRoute
.
value
.
meta
.
formId
:
''
;
if
(
currentRoute
.
value
.
meta
)
{
state
.
formInfo
.
formName
=
currentRoute
.
value
.
meta
.
title
&&
isString
(
currentRoute
.
value
.
meta
.
title
)
?
currentRoute
.
value
.
meta
.
title
:
''
;
state
.
formInfo
.
formId
=
currentRoute
.
value
.
meta
.
formId
&&
isString
(
currentRoute
.
value
.
meta
.
formId
)
?
currentRoute
.
value
.
meta
.
formId
:
''
;
}
await
createFormEvent
(
formEventConfigs
,
state
.
formModel
,
await
createFormEvent
(
formEventConfigs
,
state
.
formModel
,
systemFormRef
.
value
,
formProps
.
schemas
,
true
,
state
.
formInfo
.
formName
,
state
.
formInfo
.
formId
);
//表单事件:初始化表单
formProps
.
schemas
,
true
,
state
.
formInfo
.
formName
,
state
.
formInfo
.
formId
,
);
//表单事件:初始化表单
await
nextTick
();
await
loadFormEvent
(
formEventConfigs
,
state
.
formModel
,
await
loadFormEvent
(
formEventConfigs
,
state
.
formModel
,
systemFormRef
.
value
,
formProps
.
schemas
,
true
,
state
.
formInfo
.
formName
,
state
.
formInfo
.
formId
);
//表单事件:加载表单
formProps
.
schemas
,
true
,
state
.
formInfo
.
formName
,
state
.
formInfo
.
formId
,
);
//表单事件:加载表单
}
else
if
(
props
.
fromPage
==
FromPageType
.
FLOW
)
{
emits
(
'loadingCompleted'
);
//告诉系统表单已经加载完毕
// loadingCompleted后 工作流页面直接利用Ref调用setWorkFlowForm方法
...
...
@@ -78,15 +104,28 @@
}
else
if
(
props
.
fromPage
==
FromPageType
.
DESKTOP
)
{
// 桌面设计 表单事件需要执行
emits
(
'loadingCompleted'
);
//告诉系统表单已经加载完毕
await
createFormEvent
(
formEventConfigs
,
state
.
formModel
,
await
createFormEvent
(
formEventConfigs
,
state
.
formModel
,
systemFormRef
.
value
,
formProps
.
schemas
,
true
,
state
.
formInfo
.
formName
,
state
.
formInfo
.
formId
);
//表单事件:初始化表单
await
loadFormEvent
(
formEventConfigs
,
state
.
formModel
,
formProps
.
schemas
,
true
,
state
.
formInfo
.
formName
,
state
.
formInfo
.
formId
,
);
//表单事件:初始化表单
await
loadFormEvent
(
formEventConfigs
,
state
.
formModel
,
systemFormRef
.
value
,
formProps
.
schemas
,
true
,
state
.
formInfo
.
formName
,
state
.
formInfo
.
formId
);
//表单事件:加载表单
formProps
.
schemas
,
true
,
state
.
formInfo
.
formName
,
state
.
formInfo
.
formId
,
);
//表单事件:加载表单
}
}
catch
(
error
)
{}
});
// 根据菜单页面权限,设置表单属性(必填,禁用,显示)
function
setMenuPermission
()
{
data
.
formDataProps
.
schemas
=
filterFormSchemaAuth
(
data
.
formDataProps
.
schemas
!
);
...
...
@@ -106,20 +145,26 @@
}
finally
{
}
return
values
;
}
}
// 根据行唯一ID查询行数据,并设置表单数据 【编辑】
async
function
setFormDataFromId
(
rowId
)
{
try
{
const
record
=
await
getMesWarehouseSaleout
(
rowId
);
const
record
=
await
getMesWarehouseSaleout
(
rowId
);
setFieldsValue
(
record
);
state
.
formModel
=
record
;
await
getFormDataEvent
(
formEventConfigs
,
state
.
formModel
,
await
getFormDataEvent
(
formEventConfigs
,
state
.
formModel
,
systemFormRef
.
value
,
formProps
.
schemas
,
true
,
state
.
formInfo
.
formName
,
state
.
formInfo
.
formId
);
//表单事件:获取表单数据
}
catch
(
error
)
{
}
formProps
.
schemas
,
true
,
state
.
formInfo
.
formName
,
state
.
formInfo
.
formId
,
);
//表单事件:获取表单数据
}
catch
(
error
)
{}
}
// 辅助返回表单数据
async
function
getFieldsValue
()
{
let
values
=
[];
...
...
@@ -135,47 +180,66 @@
}
return
values
;
}
// 辅助设置表单数据
function
setFieldsValue
(
record
)
{
systemFormRef
.
value
.
setFieldsValue
(
record
);
}
// 重置表单数据
async
function
resetFields
()
{
await
systemFormRef
.
value
.
resetFields
();
}
// 设置表单数据全部为Disabled 【查看】
async
function
setDisabledForm
(
)
{
async
function
setDisabledForm
()
{
data
.
formDataProps
.
schemas
=
changeSchemaDisabled
(
cloneDeep
(
data
.
formDataProps
.
schemas
));
}
// 获取行键值
function
getRowKey
()
{
return
RowKey
;
}
// 更新api表单数据
async
function
update
({
values
,
rowId
})
{
try
{
values
[
RowKey
]
=
rowId
;
state
.
formModel
=
values
;
let
saveVal
=
await
updateMesWarehouseSaleout
(
values
);
await
submitFormEvent
(
formEventConfigs
,
state
.
formModel
,
await
submitFormEvent
(
formEventConfigs
,
state
.
formModel
,
systemFormRef
.
value
,
formProps
.
schemas
,
true
,
state
.
formInfo
.
formName
,
state
.
formInfo
.
formId
);
//表单事件:提交表单
formProps
.
schemas
,
true
,
state
.
formInfo
.
formName
,
state
.
formInfo
.
formId
,
);
//表单事件:提交表单
return
saveVal
;
}
catch
(
error
)
{}
}
// 新增api表单数据
async
function
add
(
values
)
{
try
{
state
.
formModel
=
values
;
let
saveVal
=
await
addMesWarehouseSaleout
(
values
);
await
submitFormEvent
(
formEventConfigs
,
state
.
formModel
,
await
submitFormEvent
(
formEventConfigs
,
state
.
formModel
,
systemFormRef
.
value
,
formProps
.
schemas
,
true
,
state
.
formInfo
.
formName
,
state
.
formInfo
.
formId
);
//表单事件:提交表单
formProps
.
schemas
,
true
,
state
.
formInfo
.
formName
,
state
.
formInfo
.
formId
,
);
//表单事件:提交表单
return
saveVal
;
}
catch
(
error
)
{}
}
// 根据工作流页面权限,设置表单属性(必填,禁用,显示)
async
function
setWorkFlowForm
(
obj
:
WorkFlowFormParams
)
{
async
function
setWorkFlowForm
(
obj
:
WorkFlowFormParams
)
{
try
{
if
(
obj
.
formId
)
state
.
formInfo
.
formId
=
obj
.
formId
;
if
(
obj
.
formName
)
state
.
formInfo
.
formName
=
obj
.
formName
;
...
...
@@ -189,23 +253,38 @@
state
.
formModel
=
formModels
;
setFieldsValue
(
formModels
);
}
catch
(
error
)
{}
await
createFormEvent
(
formEventConfigs
,
state
.
formModel
,
await
createFormEvent
(
formEventConfigs
,
state
.
formModel
,
systemFormRef
.
value
,
formProps
.
schemas
,
true
,
state
.
formInfo
.
formName
,
state
.
formInfo
.
formId
);
//表单事件:初始化表单
await
loadFormEvent
(
formEventConfigs
,
state
.
formModel
,
formProps
.
schemas
,
true
,
state
.
formInfo
.
formName
,
state
.
formInfo
.
formId
,
);
//表单事件:初始化表单
await
loadFormEvent
(
formEventConfigs
,
state
.
formModel
,
systemFormRef
.
value
,
formProps
.
schemas
,
true
,
state
.
formInfo
.
formName
,
state
.
formInfo
.
formId
);
//表单事件:加载表单
formProps
.
schemas
,
true
,
state
.
formInfo
.
formName
,
state
.
formInfo
.
formId
,
);
//表单事件:加载表单
}
function
handleChange
(
val
)
{
function
handleChange
(
val
)
{
emits
(
'update:value'
,
val
);
}
async
function
sendMessageForAllIframe
()
{
async
function
sendMessageForAllIframe
()
{
try
{
if
(
systemFormRef
.
value
&&
systemFormRef
.
value
.
sendMessageForAllIframe
)
{
systemFormRef
.
value
.
sendMessageForAllIframe
();
}
}
catch
(
error
)
{}
}
defineExpose
({
setFieldsValue
,
resetFields
,
...
...
@@ -218,8 +297,6 @@
setWorkFlowForm
,
getRowKey
,
getFieldsValue
,
sendMessageForAllIframe
sendMessageForAllIframe
,
});
</
script
>
\ No newline at end of file
xjrsoft-vue3/src/views/ckgl/xsck/components/XsckModal.vue
View file @
d9a58476
<
template
>
<BasicModal
:height=
"1080"
v-bind=
"$attrs"
@
register=
"registerModal"
:title=
"getTitle"
@
ok=
"handleSubmit"
@
cancel=
"handleClose"
>
<ModalForm
ref=
"formRef"
v-model:value=
"state.formModel"
:fromPage=
"FromPageType.MENU"
/>
<template
#
footer
v-if=
" !state.isView"
>
<BasicModal
:height=
"1080"
v-bind=
"$attrs"
@
register=
"registerModal"
:title=
"getTitle"
@
ok=
"handleSubmit"
@
cancel=
"handleClose"
>
<ModalForm
ref=
"formRef"
v-model:value=
"state.formModel"
:fromPage=
"FromPageType.MENU"
/>
<template
#
footer
v-if=
"!state.isView"
>
<template
v-for=
"(item, index) in sortBy(formButtons, 'index')"
:key=
"item.key"
>
<template
v-if=
"item.isShow"
>
<template
v-if=
"item.isShow"
>
<CustomButtonModal
v-if=
"item.type == CustomButtonModalType.Modal"
:info=
"item"
/>
<a-button
:type=
"item.style"
...
...
@@ -22,29 +23,28 @@
</
template
>
</template>
</template>
</BasicModal>
</BasicModal>
</template>
<
script
lang=
"ts"
setup
>
import
{
ref
,
computed
,
reactive
,
provide
,
Ref
}
from
'vue'
;
import
{
ref
,
computed
,
reactive
,
provide
,
Ref
}
from
'vue'
;
import
{
BasicModal
,
useModalInner
}
from
'/@/components/Modal'
;
import
{
CustomButtonModalType
}
from
'/@/enums/userEnum'
;
import
CustomButtonModal
from
'/@/components/Form/src/components/CustomButtonModal.vue'
;
import
{
CustomButtonModalType
}
from
'/@/enums/userEnum'
;
import
CustomButtonModal
from
'/@/components/Form/src/components/CustomButtonModal.vue'
;
import
{
useMessage
}
from
'/@/hooks/web/useMessage'
;
import
{
useI18n
}
from
'/@/hooks/web/useI18n'
;
import
{
formProps
,
formButtons
}
from
'./config'
;
import
{
formProps
,
formButtons
}
from
'./config'
;
import
ModalForm
from
'./Form.vue'
;
import
{
FromPageType
}
from
'/@/enums/workflowEnum'
;
import
{
sortBy
}
from
'lodash-es'
;
import
{
executeCurFormEvent
}
from
'/@/utils/event/data'
;
import
{
sortBy
}
from
'lodash-es'
;
import
{
executeCurFormEvent
}
from
'/@/utils/event/data'
;
const
emit
=
defineEmits
([
'success'
,
'register'
]);
const
{
notification
}
=
useMessage
();
const
formRef
=
ref
();
const
isCopy
=
ref
<
boolean
>
(
false
)
const
isCopy
=
ref
<
boolean
>
(
false
)
;
const
state
=
reactive
({
formModel
:
{},
isUpdate
:
true
,
...
...
@@ -55,40 +55,41 @@
const
{
t
}
=
useI18n
();
const
[
registerModal
,
{
setModalProps
,
closeModal
}]
=
useModalInner
(
async
(
data
)
=>
{
await
handleInner
(
data
);
await
handleInner
(
data
);
});
const
getTitle
=
computed
(()
=>
(
state
.
isView
?
'查看'
:
state
.
isUpdate
?
'编辑'
:
isCopy
.
value
?
'复制数据'
:
'新增'
));
const
getTitle
=
computed
(()
=>
state
.
isView
?
'查看'
:
state
.
isUpdate
?
'编辑'
:
isCopy
.
value
?
'复制数据'
:
'新增'
,
);
async
function
handleInner
(
data
){
async
function
handleInner
(
data
)
{
state
.
isUpdate
=
!!
data
?.
isUpdate
;
state
.
isView
=
!!
data
?.
isView
;
isCopy
.
value
=
!!
data
?.
isCopy
;
setModalProps
({
destroyOnClose
:
true
,
maskClosable
:
false
,
showCancelBtn
:
false
,
showOkBtn
:
false
,
canFullscreen
:
true
,
width
:
1980
,
footer
:
state
.
isView
?
null
:
undefined
,
defaultFullscreen
:
true
,
width
:
1980
,
footer
:
state
.
isView
?
null
:
undefined
,
defaultFullscreen
:
true
,
});
if
(
state
.
isUpdate
||
state
.
isView
||
isCopy
.
value
)
{
state
.
rowId
=
data
.
id
;
if
(
state
.
isView
)
{
await
formRef
.
value
.
setDisabledForm
();
}
await
formRef
.
value
.
setFormDataFromId
(
state
.
rowId
);
}
else
{
formRef
.
value
.
resetFields
();
}
}
async
function
saveModal
()
{
let
saveSuccess
=
false
;
try
{
...
...
@@ -117,9 +118,9 @@
async
function
handleSubmit
()
{
try
{
const
saveSuccess
=
await
saveModal
();
setModalProps
({
confirmLoading
:
true
});
if
(
saveSuccess
)
{
if
(
!
state
.
isUpdate
||
isCopy
.
value
)
{
//false 新增
...
...
@@ -133,34 +134,31 @@
description
:
t
(
'修改成功!'
),
});
//提示消息
}
closeModal
();
formRef
.
value
.
resetFields
();
emit
(
'success'
);
}
}
finally
{
setModalProps
({
confirmLoading
:
false
});
}
}
function
customClick
(
item
)
{
if
(
item
.
key
==
'confirm'
)
{
handleSubmit
();
}
else
if
(
item
.
key
==
'cancel'
&&
props
.
formType
!==
'normal'
)
{
}
else
if
(
item
.
key
==
'cancel'
)
{
handleClose
();
closeModal
();
closeModal
();
}
else
if
(
item
.
key
==
'reset'
)
{
formRef
.
value
.
resetFields
();
}
else
{
executeCurFormEvent
(
item
.
event
,
state
.
formModel
,
true
);
}
}
}
function
handleClose
()
{
formRef
.
value
.
resetFields
();
}
</
script
>
\ No newline at end of file
xjrsoft-vue3/src/views/ckgl/xsck/components/config.ts
View file @
d9a58476
...
...
@@ -329,6 +329,21 @@ export const columns: BasicColumn[] = [
styleConfig
:
undefined
,
listStyle
:
''
,
},
{
resizable
:
true
,
dataIndex
:
'p30'
,
title
:
'推质检状态'
,
componentType
:
'select'
,
fixed
:
false
,
sorter
:
true
,
styleConfig
:
undefined
,
listStyle
:
''
,
// 保持空字符串,避免进入 listStyle 分支
customRender
:
({
text
})
=>
{
const
map
=
{
0
:
'未推送'
,
1
:
'已推送'
};
return
map
[
text
]
!==
undefined
?
map
[
text
]
:
text
;
},
},
];
//表头合并配置
export
const
headerMergingData
=
[];
...
...
xjrsoft-vue3/src/views/ckgl/xsck/index.vue
View file @
d9a58476
<
template
>
<ResizePageWrapper
:hasLeft=
"false"
>
<template
#
resizeRight
>
<BasicTable
@
register=
"registerTable"
isMenuTable
ref=
"tableRef"
>
<ResizePageWrapper
:hasLeft=
"false"
>
<template
#
resizeRight
>
<BasicTable
@
register=
"registerTable"
isMenuTable
ref=
"tableRef"
>
<template
#
toolbar
>
<template
v-for=
"button in tableButtonConfig"
:key=
"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 }}
</a-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'"
>
<
template
#
icon
><Icon
:icon=
"button.icon"
/></
template
>
<a-button
v-else
:type=
"button.buttonType === 'danger' ? 'default' : button.buttonType || 'primary'"
:danger=
"button.buttonType === 'danger'"
>
<
template
#
icon
>
<Icon
:icon=
"button.icon"
/>
</
template
>
{{ button.name }}
</a-button>
</template>
</template>
<
template
#
bodyCell=
"{ column, record }"
>
<template
v-if=
"column.dataIndex === 'action'"
>
<TableAction
<TableAction
:actions=
"getLessActions(record)"
:dropDownActions=
"getMoreActions(record)"
/>
</
template
>
<
template
v-else-if=
"column.dataIndex && column?.listStyle"
>
<span
:style=
"executeListStyle(getValue(record, column, 'style'), column?.listStyle)"
>
{{
getValue
(
record
,
column
,
'value'
)
}}
</span>
</
template
>
</template>
</BasicTable>
</template>
<XsckModal
@
register=
"registerModal"
@
success=
"handleFormSuccess"
@
cancel=
"handleFormCancel"
/>
<ImportModal
@
register=
"registerImportModal"
importUrl=
"/ckgl/xsck/import"
@
success=
"handleImportSuccess"
/>
<ExportModal
</template>
<XsckModal
@
register=
"registerModal"
@
success=
"handleFormSuccess"
@
cancel=
"handleFormCancel"
/>
<ImportModal
@
register=
"registerImportModal"
importUrl=
"/ckgl/xsck/import"
@
success=
"handleImportSuccess"
/>
<ExportModal
v-if=
"visibleExport"
@
close=
"visibleExport = false"
:columns=
"columns"
@
success=
"handleExportSuccess"
/>
</ResizePageWrapper>
</ResizePageWrapper>
</template>
<
script
lang=
"ts"
setup
>
import
{
ref
,
computed
,
provide
,
Ref
,
createVNode
,
}
from
'vue'
;
import
{
ref
,
computed
,
provide
,
Ref
,
createVNode
}
from
'vue'
;
import
{
Modal
}
from
'ant-design-vue'
;
import
{
ExclamationCircleOutlined
}
from
'@ant-design/icons-vue'
;
import
{
BasicTable
,
useTable
,
TableAction
,
ActionItem
}
from
'/@/components/Table'
;
import
{
getMesWarehouseSaleoutPage
,
deleteMesWarehouseSaleout
,
exportMesWarehouseSaleout
}
from
'/@/api/ckgl/xsck'
;
import
{
getMesWarehouseSaleoutPage
,
deleteMesWarehouseSaleout
,
exportMesWarehouseSaleout
,
}
from
'/@/api/ckgl/xsck'
;
import
{
ResizePageWrapper
}
from
'/@/components/Page'
;
import
{
useMessage
}
from
'/@/hooks/web/useMessage'
;
import
{
useI18n
}
from
'/@/hooks/web/useI18n'
;
import
{
usePermission
}
from
'/@/hooks/web/usePermission'
;
import
CustomButtonModal
from
'/@/components/Form/src/components/CustomButtonModal.vue'
;
import
{
executeListStyle
,
getValue
}
from
'/@/hooks/web/useListStyle'
;
//列表样式配置
import
CustomButtonModal
from
'/@/components/Form/src/components/CustomButtonModal.vue'
;
import
{
executeListStyle
,
getValue
}
from
'/@/hooks/web/useListStyle'
;
//列表样式配置
import
{
useRouter
}
from
'vue-router'
;
import
{
useModal
}
from
'/@/components/Modal'
;
import
XsckModal
from
'./components/XsckModal.vue'
;
import
{
ImportModal
}
from
'/@/components/Import'
;
import
{
downloadByData
}
from
'/@/utils/file/download'
;
import
ExportModal
from
'/@/views/form/template/components/ExportModal.vue'
;
import
{
searchFormSchema
,
columns
}
from
'./components/config'
;
import
{
searchFormSchema
,
columns
}
from
'./components/config'
;
import
Icon
from
'/@/components/Icon/index'
;
const
listSpliceNum
=
ref
(
3
);
//操作列最先展示几个
import
{
useConcurrentLock
}
from
'/@/hooks/web/useConcurrentLock'
;
import
{
defHttp
}
from
'/@/utils/http/axios'
;
const
listSpliceNum
=
ref
(
3
);
//操作列最先展示几个
const
pageParamsInfo
=
ref
<
any
>
({});
const
{
enableLockeData
,
handleOpenFormEnableLockeData
,
handleCloseFormEnableLocke
,
handleHasEnableLocke
}
=
useConcurrentLock
();
const
{
enableLockeData
,
handleOpenFormEnableLockeData
,
handleCloseFormEnableLocke
,
handleHasEnableLocke
,
}
=
useConcurrentLock
();
const
{
notification
}
=
useMessage
();
const
{
t
}
=
useI18n
();
...
...
@@ -132,18 +100,73 @@
const
filterColumns
=
filterColumnAuth
(
columns
);
const
tableRef
=
ref
();
const
visibleExport
=
ref
(
false
);
//展示在列表内的按钮
const
actionButtons
=
ref
<
string
[]
>
([
"view"
,
"edit"
,
"delete"
]);
const
buttonConfigs
=
computed
(()
=>
{
const
list
=
[{
"buttonId"
:
"2010591769687232512"
,
"name"
:
"查看"
,
"code"
:
"view"
,
"icon"
:
"ant-design:eye-outlined"
,
"isDefault"
:
true
,
"isUse"
:
true
},{
"buttonId"
:
"2010591769687232513"
,
"name"
:
"新增"
,
"code"
:
"add"
,
"icon"
:
"ant-design:plus-outlined"
,
"isDefault"
:
true
,
"isUse"
:
true
},{
"buttonId"
:
"2010591769687232514"
,
"name"
:
"编辑"
,
"code"
:
"edit"
,
"icon"
:
"ant-design:form-outlined"
,
"isDefault"
:
true
,
"isUse"
:
true
,
"isEnableLock"
:
true
},{
"buttonId"
:
"2010591769687232515"
,
"name"
:
"快速导入"
,
"code"
:
"import"
,
"icon"
:
"ant-design:import-outlined"
,
"isDefault"
:
true
,
"isUse"
:
true
},{
"buttonId"
:
"2010591769687232516"
,
"name"
:
"快速导出"
,
"code"
:
"export"
,
"icon"
:
"ant-design:export-outlined"
,
"isDefault"
:
true
,
"isUse"
:
true
},{
"buttonId"
:
"2010591769687232517"
,
"name"
:
"删除"
,
"code"
:
"delete"
,
"icon"
:
"ant-design:delete-outlined"
,
"isDefault"
:
true
,
"isUse"
:
true
}]
const
actionButtons
=
ref
<
string
[]
>
([
'view'
,
'edit'
,
'delete'
]);
const
buttonConfigs
=
computed
(()
=>
{
const
list
=
[
{
buttonId
:
'2010591769687232512'
,
name
:
'查看'
,
code
:
'view'
,
icon
:
'ant-design:eye-outlined'
,
isDefault
:
true
,
isUse
:
true
,
},
{
buttonId
:
'2010591769687232513'
,
name
:
'新增'
,
code
:
'add'
,
icon
:
'ant-design:plus-outlined'
,
isDefault
:
true
,
isUse
:
true
,
},
{
buttonId
:
'2010591769687232518'
,
name
:
'推质检'
,
code
:
'gen'
,
icon
:
'ant-design:plus-outlined'
,
isDefault
:
true
,
isUse
:
true
,
},
{
buttonId
:
'2010591769687232514'
,
name
:
'编辑'
,
code
:
'edit'
,
icon
:
'ant-design:form-outlined'
,
isDefault
:
true
,
isUse
:
true
,
isEnableLock
:
true
,
},
{
buttonId
:
'2010591769687232515'
,
name
:
'快速导入'
,
code
:
'import'
,
icon
:
'ant-design:import-outlined'
,
isDefault
:
true
,
isUse
:
true
,
},
{
buttonId
:
'2010591769687232516'
,
name
:
'快速导出'
,
code
:
'export'
,
icon
:
'ant-design:export-outlined'
,
isDefault
:
true
,
isUse
:
true
,
},
{
buttonId
:
'2010591769687232517'
,
name
:
'删除'
,
code
:
'delete'
,
icon
:
'ant-design:delete-outlined'
,
isDefault
:
true
,
isUse
:
true
,
},
];
return
filterButtonAuth
(
list
);
})
})
;
const
tableButtonConfig
=
computed
(()
=>
{
return
buttonConfigs
.
value
?.
filter
((
x
)
=>
!
actionButtons
.
value
.
includes
(
x
.
code
));
...
...
@@ -153,27 +176,26 @@
return
buttonConfigs
.
value
?.
filter
((
x
)
=>
actionButtons
.
value
.
includes
(
x
.
code
));
});
const
btnEvent
=
{
view
:
handleView
,
add
:
handleAdd
,
edit
:
handleEdit
,
import
:
handleImport
,
export
:
handleExport
,
delete
:
handleDelete
,}
const
btnEvent
=
{
view
:
handleView
,
add
:
handleAdd
,
edit
:
handleEdit
,
import
:
handleImport
,
export
:
handleExport
,
delete
:
handleDelete
,
gen
:
handleTuizhijian
,
};
const
{
currentRoute
}
=
useRouter
();
const
formIdComputedRef
=
computed
(()
=>
currentRoute
.
value
.
meta
.
formId
as
string
);
provide
<
Ref
<
string
>>
(
'currentFormId'
,
formIdComputedRef
);
const
[
registerModal
,
{
openModal
}]
=
useModal
();
const
[
registerImportModal
,
{
openModal
:
openImportModal
}]
=
useModal
();
const
[
registerTable
,
{
reload
,
}]
=
useTable
({
const
[
registerTable
,
{
reload
}]
=
useTable
({
title
:
'Xsck列表'
,
api
:
getMesWarehouseSaleoutPage
,
rowKey
:
'id'
,
...
...
@@ -181,30 +203,27 @@
pagination
:
{
pageSize
:
10
,
},
rowSelection
:
{
type
:
'checkbox'
,
},
formConfig
:
{
labelWidth
:
100
,
schemas
:
searchFormSchema
,
fieldMapToTime
:
[[
'djrq'
,
[
'djrqStart'
,
'djrqEnd'
],
'YYYY-MM-DD HH:mm:ss '
,
true
],
[
'shrq'
,
[
'shrqStart'
,
'shrqEnd'
],
'YYYY-MM-DD HH:mm:ss '
,
true
],],
fieldMapToTime
:
[
[
'djrq'
,
[
'djrqStart'
,
'djrqEnd'
],
'YYYY-MM-DD HH:mm:ss '
,
true
],
[
'shrq'
,
[
'shrqStart'
,
'shrqEnd'
],
'YYYY-MM-DD HH:mm:ss '
,
true
],
],
showResetButton
:
false
,
},
bordered
:
false
,
beforeFetch
:
(
params
)
=>
{
pageParamsInfo
.
value
=
{
...
params
,
FormId
:
formIdComputedRef
.
value
,
PK
:
'id'
}
bordered
:
false
,
beforeFetch
:
(
params
)
=>
{
pageParamsInfo
.
value
=
{
...
params
,
FormId
:
formIdComputedRef
.
value
,
PK
:
'id'
};
return
pageParamsInfo
.
value
;
},
afterFetch
:
(
res
)
=>
{
},
afterFetch
:
(
res
)
=>
{},
useSearchForm
:
true
,
showTableSetting
:
true
,
striped
:
false
,
actionColumn
:
{
width
:
195
,
...
...
@@ -216,60 +235,80 @@
size
:
false
,
},
customRow
,
isAdvancedQuery
:
false
,
isAdvancedQuery
:
false
,
querySelectOption
:
JSON
.
stringify
(
searchFormSchema
),
objectId
:
formIdComputedRef
.
value
,
////系统表单formId,自定义表单releaseId的id值
});
function
buttonClick
(
code
)
{
btnEvent
[
code
]();
}
function
handleAdd
()
{
openModal
(
true
,
{
isUpdate
:
false
,
});
}
openModal
(
true
,
{
isUpdate
:
false
});
}
// 推质检方法
// index.vue
async
function
handleTuizhijian
()
{
const
selectedRowKeys
=
tableRef
.
value
?.
getSelectRowKeys
();
if
(
!
selectedRowKeys
||
selectedRowKeys
.
length
===
0
)
{
notification
.
warning
({
message
:
'提示'
,
description
:
'请至少选择一条记录'
,
});
return
;
}
const
dataSource
=
tableRef
.
value
?.
getDataSource
()
||
[];
const
selectedRecords
=
dataSource
.
filter
((
record
)
=>
selectedRowKeys
.
includes
(
record
.
id
));
const
hasPushed
=
selectedRecords
.
some
((
record
)
=>
record
.
p30
===
'1'
||
record
.
p30
===
1
);
if
(
hasPushed
)
{
notification
.
warning
({
message
:
'提示'
,
description
:
'已推送单据禁止再次推送'
,
});
return
;
}
try
{
await
defHttp
.
post
({
url
:
'/ckgl/xsck/gen'
,
data
:
selectedRowKeys
,
});
notification
.
success
({
message
:
'成功'
,
description
:
'已推送至质检'
,
});
// 刷新列表,更新状态
reload
();
}
catch
(
error
)
{
console
.
error
(
'推质检失败'
,
error
);
}
}
async
function
handleEdit
(
record
:
Recordable
)
{
let
field
=
'id'
;
try
{
try
{
let
hasIn
=
handleHasEnableLocke
(
buttonConfigs
.
value
,
'edit'
);
if
(
hasIn
)
{
let
res
=
await
handleOpenFormEnableLockeData
(
record
[
field
],
formIdComputedRef
.
value
,
);
if
(
hasIn
)
{
let
res
=
await
handleOpenFormEnableLockeData
(
record
[
field
],
formIdComputedRef
.
value
);
if
(
res
!==
null
)
{
return
;
}
}
let
info
=
{
id
:
record
[
field
],
isUpdate
:
true
,
};
openModal
(
true
,
info
);
}
catch
(
error
)
{}
}
let
info
=
{
id
:
record
[
field
],
isUpdate
:
true
,
};
openModal
(
true
,
info
);
}
catch
(
error
)
{}
}
function
handleDelete
(
record
:
Recordable
)
{
deleteList
([
record
.
id
]);
deleteList
([
record
.
id
]);
}
function
deleteList
(
ids
)
{
Modal
.
confirm
({
title
:
'提示信息'
,
...
...
@@ -289,55 +328,49 @@
onCancel
()
{},
});
}
function
customRow
(
record
:
Recordable
)
{
return
{
ondblclick
:
()
=>
{
if
(
record
.
isCanEdit
&&
hasPermission
(
"xsck:edit"
))
{
if
(
record
.
isCanEdit
&&
hasPermission
(
'xsck:edit'
))
{
handleEdit
(
record
);
}
},
};
}
function
handleSuccess
()
{
reload
();
}
function
handleFormSuccess
()
{
function
handleFormSuccess
()
{
handleSuccess
();
handleCloseFormEnableLocke
(
buttonConfigs
.
value
,
'edit'
);
}
function
handleFormCancel
()
{
handleCloseFormEnableLocke
(
buttonConfigs
.
value
,
'edit'
);
}
function
handleView
(
record
:
Recordable
)
{
let
info
=
{
let
info
=
{
isView
:
true
,
id
:
record
.
id
,
}
id
:
record
.
id
,
}
;
openModal
(
true
,
info
);
openModal
(
true
,
info
);
}
async
function
handleExport
()
{
visibleExport
.
value
=
true
;
}
async
function
handleExportSuccess
(
cols
)
{
const
res
=
await
exportMesWarehouseSaleout
({
isTemplate
:
false
,
columns
:
cols
.
toString
(),
...
pageParamsInfo
.
value
});
const
res
=
await
exportMesWarehouseSaleout
({
isTemplate
:
false
,
columns
:
cols
.
toString
(),
...
pageParamsInfo
.
value
,
});
visibleExport
.
value
=
false
;
downloadByData
(
res
.
data
,
...
...
@@ -346,36 +379,38 @@
);
reload
();
}
function
handleImport
()
{
openImportModal
(
true
,
{
title
:
'快速导入'
,
downLoadUrl
:
'/ckgl/xsck/export'
,
downLoadUrl
:
'/ckgl/xsck/export'
,
});
}
function
handleImportSuccess
(){
reload
()
function
handleImportSuccess
()
{
reload
();
}
function
getLessActions
(
record
:
Recordable
)
{
let
list
=
getActions
(
record
);
return
list
.
slice
(
0
,
listSpliceNum
.
value
);
}
function
getMoreActions
(
record
:
Recordable
)
{
let
list
=
getActions
(
record
);
return
list
.
slice
(
listSpliceNum
.
value
);
}
function
getActions
(
record
:
Recordable
):
ActionItem
[]
{
function
getActions
(
record
:
Recordable
):
ActionItem
[]
{
record
.
isCanEdit
=
false
;
let
actionsList
:
ActionItem
[]
=
[];
let
actionsList
:
ActionItem
[]
=
[];
actionButtonConfig
.
value
?.
map
((
button
)
=>
{
if
(
!
record
?.
workflowData
?.
processId
)
{
if
(
!
record
?.
workflowData
?.
processId
)
{
record
.
isCanEdit
=
true
;
actionsList
.
push
({
...
button
,
auth
:
`xsck:
${
button
.
code
}
`
,
label
:
button
?.
name
,
color
:
button
.
code
===
'delete'
?
'error'
:
undefined
,
...
...
@@ -384,34 +419,26 @@
}
else
{
if
(
!
[
'edit'
,
'delete'
].
includes
(
button
.
code
))
{
actionsList
.
push
({
auth
:
`xsck:
${
button
.
code
}
`
,
label
:
button
?.
name
,
onClick
:
btnEvent
[
button
.
code
]?.
bind
(
null
,
record
),
});
}
}
}
});
return
actionsList
;
}
</
script
>
<
style
lang=
"less"
scoped
>
:deep
(
.ant-table-selection-col
)
{
width
:
50px
;
}
.show
{
.show
{
display
:
flex
;
}
.hide
{
.hide
{
display
:
none
!important
;
}
</
style
>
\ No newline at end of file
</
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