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 @@
...
@@ -9,6 +9,7 @@
<formContentComp
<formContentComp
:form_detail=
"form_detail"
:form_detail=
"form_detail"
:modelValue=
"data"
:modelValue=
"data"
:defaultData=
"defaultData"
@
editData=
"editData"
/>
@
editData=
"editData"
/>
<div
class=
"bottom bottom_button"
>
<div
class=
"bottom bottom_button"
>
...
@@ -27,12 +28,15 @@ import formContentComp from "@/components/widget/index.vue";
...
@@ -27,12 +28,15 @@ import formContentComp from "@/components/widget/index.vue";
export
interface
Props
{
export
interface
Props
{
form_id
:
string
;
form_id
:
string
;
data
?:
object
;
data
?:
object
;
// 修改初始化数据
defaultData
?:
object
;
// 默认数据(用于兼容初始化关联数据的字段,里面会弹出eidtData)
onHide
?:
()
=>
void
;
onHide
?:
()
=>
void
;
onConfirm
?:
(
data
:
object
)
=>
void
;
onConfirm
?:
(
data
:
object
)
=>
void
;
onEditConfirm
?:
(
data
:
object
)
=>
void
;
onEditConfirm
?:
(
data
:
object
)
=>
void
;
}
}
const
props
=
defineProps
<
Props
>
();
const
props
=
withDefaults
(
defineProps
<
Props
>
(),
{});
console
.
log
(
"defaultData"
,
props
);
const
show
=
ref
(
false
);
const
show
=
ref
(
false
);
onMounted
(()
=>
{
onMounted
(()
=>
{
show
.
value
=
true
;
show
.
value
=
true
;
...
@@ -55,6 +59,7 @@ const editData = (edit_data: any) => {
...
@@ -55,6 +59,7 @@ const editData = (edit_data: any) => {
for
(
const
key
in
edit_data
)
{
for
(
const
key
in
edit_data
)
{
data
.
value
[
key
]
=
edit_data
[
key
];
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 {
...
@@ -6,6 +6,7 @@ export interface FieldProps {
disabled
?:
boolean
;
disabled
?:
boolean
;
data
:
any
;
data
:
any
;
required
?:
boolean
;
required
?:
boolean
;
defaultData
?:
any
;
}
}
// 基础字段配置
// 基础字段配置
...
...
src/components/widget/field/order_client/index.vue
View file @
7afcd3fa
...
@@ -45,6 +45,7 @@
...
@@ -45,6 +45,7 @@
import
{
ref
,
onBeforeUnmount
}
from
"vue"
;
import
{
ref
,
onBeforeUnmount
}
from
"vue"
;
import
{
FieldProps
}
from
"../config"
;
import
{
FieldProps
}
from
"../config"
;
import
{
$selectClient
}
from
"@/components/select_client/index"
;
import
{
$selectClient
}
from
"@/components/select_client/index"
;
import
{
container
}
from
"@/utils/container/index"
;
const
props
=
defineProps
<
FieldProps
>
();
const
props
=
defineProps
<
FieldProps
>
();
const
emit
=
defineEmits
([
"edit"
]);
const
emit
=
defineEmits
([
"edit"
]);
...
@@ -59,6 +60,8 @@ const change = () => {
...
@@ -59,6 +60,8 @@ const change = () => {
const
client
=
ref
<
any
>
({});
const
client
=
ref
<
any
>
({});
const
selectClient
=
()
=>
{
const
selectClient
=
()
=>
{
if
(
container
.
qr_code
)
return
;
$selectClient
({
$selectClient
({
value
:
client
.
value
,
value
:
client
.
value
,
onConfirm
:
(
data
)
=>
{
onConfirm
:
(
data
)
=>
{
...
@@ -79,6 +82,12 @@ onBeforeUnmount(() => {
...
@@ -79,6 +82,12 @@ onBeforeUnmount(() => {
const
init
=
()
=>
{
const
init
=
()
=>
{
client
.
value
=
props
.
data
[
props
.
config
.
key_id
]
||
{};
client
.
value
=
props
.
data
[
props
.
config
.
key_id
]
||
{};
const
defaultData
=
props
.
defaultData
[
props
.
config
.
key_id
];
if
(
defaultData
)
{
client
.
value
=
defaultData
;
change
();
}
};
};
init
();
init
();
</
script
>
</
script
>
...
...
src/components/widget/field/order_product/index.vue
View file @
7afcd3fa
...
@@ -37,17 +37,22 @@
...
@@ -37,17 +37,22 @@
import
{
onBeforeUnmount
,
ref
}
from
"vue"
;
import
{
onBeforeUnmount
,
ref
}
from
"vue"
;
import
{
FieldProps
}
from
"../config"
;
import
{
FieldProps
}
from
"../config"
;
import
{
$selectProduct
}
from
"@/components/select_product/index"
;
import
{
$selectProduct
}
from
"@/components/select_product/index"
;
import
{
container
}
from
"@/utils/container/index"
;
const
props
=
defineProps
<
FieldProps
>
();
const
props
=
defineProps
<
FieldProps
>
();
const
emit
=
defineEmits
([
"edit"
]);
const
emit
=
defineEmits
([
"edit"
]);
const
change
=
()
=>
{
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
product
=
ref
<
any
>
({});
const
selectProduct
=
()
=>
{
const
selectProduct
=
()
=>
{
if
(
container
.
qr_code
)
return
;
$selectProduct
({
$selectProduct
({
value
:
product
.
value
,
value
:
product
.
value
,
onConfirm
:
async
(
data
)
=>
{
onConfirm
:
async
(
data
)
=>
{
...
@@ -68,6 +73,12 @@ onBeforeUnmount(() => {
...
@@ -68,6 +73,12 @@ onBeforeUnmount(() => {
const
init
=
()
=>
{
const
init
=
()
=>
{
product
.
value
=
props
.
data
[
props
.
config
.
key_id
]
||
{};
product
.
value
=
props
.
data
[
props
.
config
.
key_id
]
||
{};
const
defaultData
=
props
.
defaultData
[
props
.
config
.
key_id
];
if
(
defaultData
)
{
product
.
value
=
defaultData
;
change
();
}
};
};
init
();
init
();
</
script
>
</
script
>
...
...
src/components/widget/index.vue
View file @
7afcd3fa
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
:config=
"it"
:config=
"it"
:disabled=
"disabled"
:disabled=
"disabled"
:data=
"modelValue"
:data=
"modelValue"
:defaultData=
"defaultData"
@
edit=
"edit"
/>
@
edit=
"edit"
/>
</
template
>
</
template
>
</div>
</div>
...
@@ -18,12 +19,14 @@ import { computed } from "vue";
...
@@ -18,12 +19,14 @@ import { computed } from "vue";
import
{
allFieldConfig
,
widgetKeyName
}
from
"./field/config"
;
import
{
allFieldConfig
,
widgetKeyName
}
from
"./field/config"
;
interface
Props
{
interface
Props
{
modelValue
?:
any
;
// 数据
modelValue
?:
object
;
// 数据
form_detail
:
FormDetail
;
// 表单详情
form_detail
:
FormDetail
;
// 表单详情
disabled
?:
boolean
;
// 是否禁用
disabled
?:
boolean
;
// 是否禁用
defaultData
?:
object
;
// 创建时默认数据(用于兼容初始化关联数据的字段,里面会弹出eidtData)
}
}
const
props
=
withDefaults
(
defineProps
<
Props
>
(),
{
const
props
=
withDefaults
(
defineProps
<
Props
>
(),
{
modelValue
:
{},
modelValue
:
()
=>
({}),
defaultData
:
()
=>
({}),
});
});
const
emit
=
defineEmits
([
const
emit
=
defineEmits
([
"addNewFormItem"
,
"addNewFormItem"
,
...
...
src/view/code_product_detail/index.vue
View file @
7afcd3fa
...
@@ -175,6 +175,10 @@ const toOrderList = () => {
...
@@ -175,6 +175,10 @@ const toOrderList = () => {
const
createFormData
=
(
button
:
ButtonType
)
=>
{
const
createFormData
=
(
button
:
ButtonType
)
=>
{
$createFormData
({
$createFormData
({
form_id
:
button
.
order_form_id
,
form_id
:
button
.
order_form_id
,
defaultData
:
{
product_id
:
product_detail
.
value
.
product_info
,
customer_id
:
product_detail
.
value
.
customer_info
,
},
onConfirm
:
async
(
data
)
=>
{
onConfirm
:
async
(
data
)
=>
{
const
msg
=
await
api
.
order
.
saveOrder
({
const
msg
=
await
api
.
order
.
saveOrder
({
...
data
,
...
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