Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yongxinda-h5
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
刘旭
yongxinda-h5
Commits
1ade6f18
提交
1ade6f18
authored
12月 13, 2022
作者:
刘旭
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
完成添加客户校验
上级
9851f5d7
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
125 行增加
和
83 行删除
+125
-83
pages.json
src/pages.json
+6
-0
quotation.vue
src/pages/order/quotation.vue
+4
-3
addConsignee.vue
src/pages/profile/addConsignee.vue
+104
-0
consignee.vue
src/pages/profile/consignee.vue
+11
-80
没有找到文件。
src/pages.json
浏览文件 @
1ade6f18
...
@@ -149,6 +149,12 @@
...
@@ -149,6 +149,12 @@
"navigationBarTitleText"
:
"客户"
,
"navigationBarTitleText"
:
"客户"
,
"navigationBarBackgroundColor"
:
"#fff"
"navigationBarBackgroundColor"
:
"#fff"
}
}
},
,
{
"path"
:
"pages/profile/addConsignee"
,
"style"
:
{
"navigationBarTitleText"
:
"添加客户"
,
"navigationBarBackgroundColor"
:
"#fff"
}
},
{
},
{
"path"
:
"pages/order/editQuotation"
,
"path"
:
"pages/order/editQuotation"
,
"style"
:
{
"style"
:
{
...
...
src/pages/order/quotation.vue
浏览文件 @
1ade6f18
...
@@ -173,7 +173,7 @@
...
@@ -173,7 +173,7 @@
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
ref
,
getCurrentInstance
,
ComponentInternalInstance
,
computed
,
nextTick
}
from
'vue'
;
import
{
ref
,
getCurrentInstance
,
ComponentInternalInstance
,
computed
,
nextTick
}
from
'vue'
;
import
{
fillQuotation
,
quotationInit
,
quotationOrder
}
from
'@/api/cart'
;
import
{
fillQuotation
,
quotationInit
}
from
'@/api/cart'
;
import
{
onLoad
,
onReady
}
from
'@dcloudio/uni-app'
;
import
{
onLoad
,
onReady
}
from
'@dcloudio/uni-app'
;
import
{
orderDetail
,
getTax
}
from
'@/api/index'
;
import
{
orderDetail
,
getTax
}
from
'@/api/index'
;
import
{
getProductLineIndex
}
from
'@/api/productLine'
;
import
{
getProductLineIndex
}
from
'@/api/productLine'
;
...
@@ -205,7 +205,8 @@ let formData = ref({
...
@@ -205,7 +205,8 @@ let formData = ref({
remarks
:
''
,
remarks
:
''
,
noOrder
:
''
,
noOrder
:
''
,
guarantee
:
''
,
guarantee
:
''
,
deliveryTime
:
''
deliveryTime
:
''
,
deliverGoodsAddr
:
''
});
// 报价单数据
});
// 报价单数据
let
detailData
=
ref
()
let
detailData
=
ref
()
...
@@ -301,7 +302,7 @@ uni.$on('updateAddress', (data: any) => {
...
@@ -301,7 +302,7 @@ uni.$on('updateAddress', (data: any) => {
formData
.
value
.
addr
=
data
.
addr
.
province
+
formData
.
value
.
addr
=
data
.
addr
.
province
+
data
.
addr
.
city
+
data
.
addr
.
county
+
data
.
addr
.
addressDetail
data
.
addr
.
city
+
data
.
addr
.
county
+
data
.
addr
.
addressDetail
}
}
console
.
log
(
data
.
addr
);
//
console.log(data.addr);
})
})
// 引入校验
// 引入校验
...
...
src/pages/profile/addConsignee.vue
0 → 100644
浏览文件 @
1ade6f18
<
template
>
<!-- 添加客户名称 -->
<!--
<u-popup
v-model=
"show"
mode=
"center"
length=
"90%"
>
-->
<view
style=
"padding: 40rpx; background-color: #fff;"
>
<!--
<h4
style=
"width: 100%; text-align: center; font-size: 30rpx; margin-bottom: 20rpx;"
>
添加客户
</h4>
-->
<u-form
:model=
"formData"
ref=
"formRef"
label-width=
"145"
>
<u-form-item
label=
"名称"
prop=
"customerName"
>
<u-input
v-model=
"formData.customerName"
placeholder=
"请输入名称"
/>
</u-form-item>
<u-form-item
label=
"编码"
prop=
"customerCode"
>
<u-input
v-model=
"formData.customerCode"
placeholder=
"请输入编码"
/>
</u-form-item>
<u-form-item
label=
"邮箱"
prop=
"contactsEmail"
>
<u-input
v-model=
"formData.contactsEmail"
placeholder=
"请输入邮箱"
/>
</u-form-item>
<u-form-item
label=
"选择地址"
prop=
"registerAddress"
>
<u-input
v-model=
"formData.registerAddress"
:disabled=
"true"
placeholder=
"请选择"
@
tap=
"showRegion = true"
/>
</u-form-item>
<u-form-item
label=
"详细地址"
prop=
"detailedAddress"
:border-bottom=
"false"
>
<u-input
type=
"textarea"
v-model=
"formData.detailedAddress"
placeholder=
"请输入详细地址"
/>
</u-form-item>
</u-form>
<u-button
type=
"error"
@
tap=
"saveConsignee"
>
保存
</u-button>
</view>
<!--
</u-popup>
-->
<u-picker
mode=
"region"
v-model=
"showRegion"
@
confirm=
"confirm"
/>
</
template
>
<
script
lang=
"ts"
setup
>
import
{
ref
,
getCurrentInstance
,
ComponentInternalInstance
}
from
'vue'
import
{
onReady
}
from
'@dcloudio/uni-app'
import
{
addConsignee
}
from
'@/api/profile'
;
let
formRef
=
ref
();
// let show = ref(false);
let
showRegion
=
ref
(
false
);
let
{
proxy
}:
any
=
getCurrentInstance
()
as
ComponentInternalInstance
;
let
formData
=
ref
({
customerName
:
''
,
// 客户名称
customerCode
:
''
,
// 客户编码
contactsEmail
:
''
,
// 客户邮箱
registerAddress
:
''
,
// 注册地址(省市区)
detailedAddress
:
''
,
// 详细地址
});
let
rules
=
ref
({
customerName
:
[{
required
:
true
,
message
:
'请输入名称'
,
trigger
:
'blur'
}],
customerCode
:
[{
required
:
true
,
message
:
'请输入编码'
,
trigger
:
'blur'
}],
contactsEmail
:
[
{
required
:
true
,
message
:
'请输入email'
,
trigger
:
'blur'
},
{
validator
:
(
rule
,
value
:
any
,
callback
)
=>
{
return
proxy
.
$u
.
test
.
email
(
value
);
},
message
:
'email不正确'
,
trigger
:
'blur'
,
},
],
registerAddress
:
[{
required
:
true
,
message
:
'请选择地址'
,
trigger
:
[
'blur'
,
'change'
]
}],
detailedAddress
:
[{
required
:
true
,
message
:
'请输入详细地址'
,
trigger
:
'blur'
}],
});
// 引入校验
onReady
(()
=>
{
formRef
.
value
?.
setRules
(
rules
.
value
);
})
// 设置地区
let
confirm
=
(
data
:
any
)
=>
{
formData
.
value
.
registerAddress
=
data
.
province
.
name
+
data
.
city
.
name
+
data
.
area
.
name
;
};
// 保存客户
let
saveConsignee
=
()
=>
{
console
.
log
(
formRef
.
value
);
formRef
.
value
.
validate
((
valid
:
boolean
,
err
:
any
)
=>
{
if
(
valid
)
{
addConsignee
(
formData
.
value
).
then
((
res
:
any
)
=>
{
if
(
res
.
data
.
code
===
200
)
{
uni
.
showToast
({
title
:
'保存成功'
,
icon
:
'none'
,
});
uni
.
navigateBack
()
}
});
}
else
console
.
log
(
err
);
})
};
</
script
>
<
style
></
style
>
src/pages/profile/consignee.vue
浏览文件 @
1ade6f18
...
@@ -20,91 +20,22 @@
...
@@ -20,91 +20,22 @@
</u-table>
</u-table>
<!--
<u-empty
v-else
text=
"数据为空"
mode=
"list"
></u-empty>
-->
<!--
<u-empty
v-else
text=
"数据为空"
mode=
"list"
></u-empty>
-->
</view>
</view>
<!--
<add-consignee
ref=
"addConsigneeRef"
/>
-->
<!-- 添加客户名称 -->
<u-popup
v-model=
"show"
mode=
"center"
length=
"90%"
>
<view
style=
"padding: 40rpx;"
>
<h4
style=
"width: 100%; text-align: center; font-size: 30rpx;"
>
添加客户
</h4>
<u-form
:model=
"form"
ref=
"uForm"
label-width=
"145"
>
<u-form-item
label=
"名称"
>
<u-input
v-model=
"form.customerName"
placeholder=
"请输入名称"
/>
</u-form-item>
<u-form-item
label=
"编码"
>
<u-input
v-model=
"form.customerCode"
placeholder=
"请输入编码"
/>
</u-form-item>
<u-form-item
label=
"邮箱"
>
<u-input
v-model=
"form.contactsEmail"
placeholder=
"请输入邮箱"
/>
</u-form-item>
<u-form-item
label=
"选择地址"
>
<u-input
v-model=
"form.registerAddress"
:disabled=
"true"
placeholder=
"请选择"
@
tap=
"selectRegion"
/>
</u-form-item>
<u-form-item
label=
"详细地址"
:border-bottom=
"false"
>
<u-input
type=
"textarea"
v-model=
"form.detailedAddress"
placeholder=
"请输入详细地址"
/>
</u-form-item>
</u-form>
<u-button
type=
"error"
@
tap=
"saveConsignee"
>
保存
</u-button>
</view>
</u-popup>
<u-picker
mode=
"region"
ref=
"uPicker"
v-model=
"showRegion"
@
confirm=
"confirm"
/>
</
template
>
</
template
>
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
ref
}
from
'vue'
;
import
{
ref
}
from
'vue'
;
import
{
consigneeList
,
addConsignee
}
from
'@/api/profile'
;
import
{
consigneeList
}
from
'@/api/profile'
;
import
{
onReady
}
from
'@dcloudio/uni-app'
;
import
{
onShow
}
from
'@dcloudio/uni-app'
;
// import addConsignee from './addConsignee.vue';
// let addConsigneeRef = ref();
let
consigneeData
=
ref
();
let
consigneeData
=
ref
();
let
show
=
ref
(
false
);
let
showRegion
=
ref
(
false
);
let
form
=
ref
({
customerName
:
''
,
// 客户名称
customerCode
:
''
,
// 客户编码
contactsEmail
:
''
,
// 客户邮箱
registerAddress
:
''
,
// 注册地址(省市区)
detailedAddress
:
''
,
// 详细地址
});
let
selectRegion
=
()
=>
{
showRegion
.
value
=
true
;
};
// 设置地区
let
confirm
=
(
data
:
any
)
=>
{
form
.
value
.
registerAddress
=
data
.
province
.
name
+
data
.
city
.
name
+
data
.
area
.
name
;
};
// 添加客户
let
showAdd
=
()
=>
{
let
showAdd
=
()
=>
{
show
.
value
=
true
;
uni
.
navigateTo
({
form
.
value
=
{
url
:
'./addConsignee'
,
customerName
:
''
,
// 客户名称
customerCode
:
''
,
// 客户编码
contactsEmail
:
''
,
// 客户邮箱
registerAddress
:
''
,
// 注册地址(省市区)
detailedAddress
:
''
,
// 详细地址
};
};
let
saveConsignee
=
()
=>
{
addConsignee
(
form
.
value
).
then
((
res
:
any
)
=>
{
if
(
res
.
data
.
code
===
200
)
{
uni
.
showToast
({
title
:
'保存成功'
,
icon
:
'none'
,
});
show
.
value
=
false
;
init
();
}
});
});
};
};
...
@@ -116,9 +47,9 @@ let init = () => {
...
@@ -116,9 +47,9 @@ let init = () => {
});
});
};
};
init
();
onShow
(()
=>
{
init
();
onReady
(()
=>
{
});
});
</
script
>
</
script
>
<
style
scoped
lang=
"scss"
></
style
>
<
style
scoped
lang=
"scss"
></
style
>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论