Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jisu_gongdan_phone
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhanglongbao
jisu_gongdan_phone
Commits
7afcd3fa
Commit
7afcd3fa
authored
Sep 02, 2024
by
zhanglongbao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
ab3e03a7
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
38 additions
and
5 deletions
+38
-5
index.vue
src/components/create_form_data/index.vue
+7
-2
config.ts
src/components/widget/field/config.ts
+1
-0
index.vue
src/components/widget/field/order_client/index.vue
+9
-0
index.vue
src/components/widget/field/order_product/index.vue
+12
-1
index.vue
src/components/widget/index.vue
+5
-2
index.vue
src/view/code_product_detail/index.vue
+4
-0
No files found.
src/components/create_form_data/index.vue
View file @
7afcd3fa
...
...
@@ -9,6 +9,7 @@
<formContentComp
:form_detail=
"form_detail"
:modelValue=
"data"
:defaultData=
"defaultData"
@
editData=
"editData"
/>
<div
class=
"bottom bottom_button"
>
...
...
@@ -27,12 +28,15 @@ import formContentComp from "@/components/widget/index.vue";
export
interface
Props
{
form_id
:
string
;
data
?:
object
;
data
?:
object
;
// 修改初始化数据
defaultData
?:
object
;
// 默认数据(用于兼容初始化关联数据的字段,里面会弹出eidtData)
onHide
?:
()
=>
void
;
onConfirm
?:
(
data
:
object
)
=>
void
;
onEditConfirm
?:
(
data
:
object
)
=>
void
;
}
const
props
=
defineProps
<
Props
>
();
const
props
=
withDefaults
(
defineProps
<
Props
>
(),
{});
console
.
log
(
"defaultData"
,
props
);
const
show
=
ref
(
false
);
onMounted
(()
=>
{
show
.
value
=
true
;
...
...
@@ -55,6 +59,7 @@ const editData = (edit_data: any) => {
for
(
const
key
in
edit_data
)
{
data
.
value
[
key
]
=
edit_data
[
key
];
}
console
.
log
(
"data"
,
data
.
value
);
};
// 表单信息
...
...
src/components/widget/field/config.ts
View file @
7afcd3fa
...
...
@@ -6,6 +6,7 @@ export interface FieldProps {
disabled
?:
boolean
;
data
:
any
;
required
?:
boolean
;
defaultData
?:
any
;
}
// 基础字段配置
...
...
src/components/widget/field/order_client/index.vue
View file @
7afcd3fa
...
...
@@ -45,6 +45,7 @@
import
{
ref
,
onBeforeUnmount
}
from
"vue"
;
import
{
FieldProps
}
from
"../config"
;
import
{
$selectClient
}
from
"@/components/select_client/index"
;
import
{
container
}
from
"@/utils/container/index"
;
const
props
=
defineProps
<
FieldProps
>
();
const
emit
=
defineEmits
([
"edit"
]);
...
...
@@ -59,6 +60,8 @@ const change = () => {
const
client
=
ref
<
any
>
({});
const
selectClient
=
()
=>
{
if
(
container
.
qr_code
)
return
;
$selectClient
({
value
:
client
.
value
,
onConfirm
:
(
data
)
=>
{
...
...
@@ -79,6 +82,12 @@ onBeforeUnmount(() => {
const
init
=
()
=>
{
client
.
value
=
props
.
data
[
props
.
config
.
key_id
]
||
{};
const
defaultData
=
props
.
defaultData
[
props
.
config
.
key_id
];
if
(
defaultData
)
{
client
.
value
=
defaultData
;
change
();
}
};
init
();
</
script
>
...
...
src/components/widget/field/order_product/index.vue
View file @
7afcd3fa
...
...
@@ -37,17 +37,22 @@
import
{
onBeforeUnmount
,
ref
}
from
"vue"
;
import
{
FieldProps
}
from
"../config"
;
import
{
$selectProduct
}
from
"@/components/select_product/index"
;
import
{
container
}
from
"@/utils/container/index"
;
const
props
=
defineProps
<
FieldProps
>
();
const
emit
=
defineEmits
([
"edit"
]);
const
change
=
()
=>
{
emit
(
"edit"
,
{
[
props
.
config
.
key_id
]:
[
product
.
value
.
id
]
});
emit
(
"edit"
,
{
[
props
.
config
.
key_id
]:
product
.
value
.
id
?
[
product
.
value
.
id
]
:
[],
});
};
const
product
=
ref
<
any
>
({});
const
selectProduct
=
()
=>
{
if
(
container
.
qr_code
)
return
;
$selectProduct
({
value
:
product
.
value
,
onConfirm
:
async
(
data
)
=>
{
...
...
@@ -68,6 +73,12 @@ onBeforeUnmount(() => {
const
init
=
()
=>
{
product
.
value
=
props
.
data
[
props
.
config
.
key_id
]
||
{};
const
defaultData
=
props
.
defaultData
[
props
.
config
.
key_id
];
if
(
defaultData
)
{
product
.
value
=
defaultData
;
change
();
}
};
init
();
</
script
>
...
...
src/components/widget/index.vue
View file @
7afcd3fa
...
...
@@ -8,6 +8,7 @@
:config=
"it"
:disabled=
"disabled"
:data=
"modelValue"
:defaultData=
"defaultData"
@
edit=
"edit"
/>
</
template
>
</div>
...
...
@@ -18,12 +19,14 @@ import { computed } from "vue";
import
{
allFieldConfig
,
widgetKeyName
}
from
"./field/config"
;
interface
Props
{
modelValue
?:
any
;
// 数据
modelValue
?:
object
;
// 数据
form_detail
:
FormDetail
;
// 表单详情
disabled
?:
boolean
;
// 是否禁用
defaultData
?:
object
;
// 创建时默认数据(用于兼容初始化关联数据的字段,里面会弹出eidtData)
}
const
props
=
withDefaults
(
defineProps
<
Props
>
(),
{
modelValue
:
{},
modelValue
:
()
=>
({}),
defaultData
:
()
=>
({}),
});
const
emit
=
defineEmits
([
"addNewFormItem"
,
...
...
src/view/code_product_detail/index.vue
View file @
7afcd3fa
...
...
@@ -175,6 +175,10 @@ const toOrderList = () => {
const
createFormData
=
(
button
:
ButtonType
)
=>
{
$createFormData
({
form_id
:
button
.
order_form_id
,
defaultData
:
{
product_id
:
product_detail
.
value
.
product_info
,
customer_id
:
product_detail
.
value
.
customer_info
,
},
onConfirm
:
async
(
data
)
=>
{
const
msg
=
await
api
.
order
.
saveOrder
({
...
data
,
...
...
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