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
1641e427
提交
1641e427
authored
11月 10, 2022
作者:
刘旭
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
完成推送功能
上级
127095ce
显示空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
72 行增加
和
28 行删除
+72
-28
cart.ts
src/api/cart.ts
+6
-0
index.ts
src/api/index.ts
+3
-0
downPdf.vue
src/pages/order/downPdf.vue
+1
-1
orderList.vue
src/pages/order/orderList.vue
+35
-10
quotation.vue
src/pages/order/quotation.vue
+25
-15
drag-and-drop-sort.vue
src/pages/productLine/components/drag-and-drop-sort.vue
+1
-1
request.ts
src/utils/request.ts
+1
-1
没有找到文件。
src/api/cart.ts
浏览文件 @
1641e427
...
...
@@ -21,6 +21,9 @@ export const getOrderPdf = (data: any) => request('/wx/order/orderPdfSource', 'G
// 报价-准备报价
export
const
quotationInit
=
(
data
:
any
)
=>
request
(
'/wx/quotation/init'
,
'GET'
,
data
);
// 报价-重新准备
export
const
quotationInitAgain
=
(
data
:
any
)
=>
request
(
'/wx/quotation/init_again'
,
'GET'
,
data
);
// 报价单-订单查询
export
const
quotationOrder
=
(
data
:
any
)
=>
request
(
'/wx/quotation/order'
,
'GET'
,
data
);
...
...
@@ -35,3 +38,6 @@ export const deleteQuotation = (data: any) => request('/wx/quotation/delete', 'D
// 报价单-详细
export
const
quotationDetail
=
(
data
:
any
)
=>
request
(
'/wx/quotation/detail'
,
'POST'
,
data
);
// 报价单-execl下载
export
const
quotationDownload
=
(
data
:
any
)
=>
request
(
'/wx/quotation/download'
,
'GET'
,
data
);
src/api/index.ts
浏览文件 @
1641e427
...
...
@@ -47,3 +47,6 @@ export const collectAddordelete = (data: any) => request('/wx/collect/addordelet
// 添加或取消收藏
export
const
getTax
=
()
=>
request
(
'/wx/config/tax'
,
'GET'
);
// 推送订单
export
const
pushOrder
=
(
data
:
any
)
=>
request
(
'/wx/order/push'
,
'GET'
,
data
)
src/pages/order/downPdf.vue
浏览文件 @
1641e427
...
...
@@ -102,7 +102,7 @@ import { ref, computed } from 'vue';
import
{
onLoad
,
onBackPress
}
from
'@dcloudio/uni-app'
;
import
config
from
'@/utils/config'
;
import
{
useStore
,
useCurrentStore
}
from
'@/store/useStore'
;
import
{
getOrderPdf
}
from
'@/api/cart'
;
import
{
getOrderPdf
,
quotationOrder
}
from
'@/api/cart'
;
import
{
orderDetail
,
getTax
}
from
'@/api/index'
;
let
baseUrl
=
config
.
baseUrl
;
...
...
src/pages/order/orderList.vue
浏览文件 @
1641e427
...
...
@@ -95,8 +95,12 @@
<view
class=
"bottom"
>
<view
class=
""
></view>
<view
style=
"display: flex; flex-direction: row;"
>
<view
class=
"evaluate btn"
@
tap=
"orderQuotation(res.id)"
>
报价单
<view
v-if=
"current == 1"
class=
"evaluate btn"
@
tap=
"orderQuotation(res.id)"
>
推送订单
</view>
<view
class=
"evaluate btn"
@
tap=
"orderDel(res.id)"
>
删除订单
...
...
@@ -140,9 +144,8 @@
<
script
setup
lang=
"ts"
>
import
{
ref
,
computed
}
from
'vue'
import
{
getOrderData
,
orderDelete
}
from
'@/api/index'
import
{
quotationOrder
}
from
'@/api/cart'
import
{
onLoad
}
from
'@dcloudio/uni-app'
import
{
getOrderData
,
orderDelete
,
pushOrder
}
from
'@/api/index'
import
{
onLoad
,
onShow
}
from
'@dcloudio/uni-app'
import
{
useCurrentStore
}
from
'@/store/useStore'
import
config
from
'@/utils/config'
;
...
...
@@ -174,12 +177,14 @@ let orderIds = ref(0) //删除的订单id
onLoad
((
options
?:
any
)
=>
{
if
(
options
)
{
current
.
value
=
options
.
showType
console
.
log
(
current
.
value
);
swiperCurrent
.
value
=
options
.
showType
listQuery
.
value
.
showType
=
options
.
showType
}
getOrderList
()
})
// 跳转到订单详情
let
toDownPdf
=
(
orderId
:
number
)
=>
{
uni
.
navigateTo
({
url
:
`/pages/order/downPdf?orderId=
${
orderId
}
&type=profile`
,
...
...
@@ -252,32 +257,52 @@ let animationfinish = (data: any) => {
current
.
value
=
currentNum
;
}
// 删除订单
let
orderDel
=
(
orderId
:
number
)
=>
{
show
.
value
=
true
content
.
value
=
'确认删除该订单?'
orderIds
.
value
=
orderId
}
// 推送订单
let
orderQuotation
=
(
orderId
:
number
)
=>
{
show
.
value
=
true
content
.
value
=
'确认
下载execl?
'
content
.
value
=
'确认
将状态推送到待生产?
'
orderIds
.
value
=
orderId
}
// 确认操作
let
onConfirm
=
()
=>
{
// quotationOrder({orderId: orderIds.value}).then((res: any) => {
// console.log(res);
// })
if
(
content
.
value
==
'确认删除该订单?'
)
{
orderDelete
({
orderId
:
orderIds
.
value
}).
then
((
res
:
any
)
=>
{
if
(
res
.
data
.
code
===
200
)
{
orderData
.
value
=
[]
listQuery
.
value
.
page
=
1
getOrderList
()
uni
.
showToast
({
title
:
'删除成功'
,
icon
:
'none'
})
}
})
}
else
{
pushOrder
({
orderId
:
orderIds
.
value
}).
then
((
res
:
any
)
=>
{
console
.
log
(
res
);
if
(
res
.
data
.
code
===
200
)
{
orderData
.
value
=
[]
listQuery
.
value
.
page
=
1
getOrderList
()
uni
.
showToast
({
title
:
'推送成功'
,
icon
:
'none'
})
}
})
}
}
// 页面数据
// 页面数据
let
getOrderList
=
()
=>
{
status
.
value
=
'loading'
;
getOrderData
(
listQuery
.
value
).
then
((
res
:
any
)
=>
{
...
...
src/pages/order/quotation.vue
浏览文件 @
1641e427
...
...
@@ -4,7 +4,7 @@
<u-form-item
label=
"发货人:"
prop=
"attend"
>
<u-input
v-model=
"formData.attend"
placeholder=
"请输入发货人"
/>
</u-form-item>
<u-form-item
label=
"发货联系
人
:"
prop=
"tel"
>
<u-form-item
label=
"发货联系
电话
:"
prop=
"tel"
>
<u-input
v-model=
"formData.tel"
placeholder=
"请输入发货联系人"
/>
</u-form-item>
<!--
<u-form-item
label=
"单价:"
prop=
"price"
>
...
...
@@ -33,7 +33,7 @@
<u-form-item
label=
"收货email:"
prop=
"quotationEmail"
>
<u-input
v-model=
"formData.quotationEmail"
placeholder=
"请输入收货email"
/>
</u-form-item>
<u-form-item
label=
"收货联系
人
:"
prop=
"toCust"
>
<u-form-item
label=
"收货联系
电话
:"
prop=
"toCust"
>
<u-input
v-model=
"formData.quotationTel"
placeholder=
"请输入收货联系人"
/>
</u-form-item>
<u-form-item
label=
"交货日期:"
prop=
"deliveryDate"
>
...
...
@@ -71,7 +71,12 @@
<u-picker
mode=
"region"
v-model=
"pickerShow1"
@
confirm=
"regionConfirm1"
></u-picker>
<u-picker
mode=
"time"
v-model=
"pickerDateShow"
@
confirm=
"dateConfirm"
></u-picker>
<order-form
ref=
"orderRef"
@
onSubmit=
"onSubmit"
/>
<u-modal
v-model=
"showModel"
:content=
"content"
@
confirm=
"modelConfirm"
></u-modal>
<u-modal
v-model=
"showModel"
:content=
"content"
@
confirm=
"modelConfirm"
showCancelButton
></u-modal>
</
template
>
<
script
setup
lang=
"ts"
>
...
...
@@ -162,6 +167,7 @@ onLoad((options: any) => {
initQuotation
(
orderId
.
value
);
});
// 引入校验
onReady
(()
=>
{
uFormRef
.
value
?.
setRules
(
rules
.
value
);
})
...
...
@@ -186,11 +192,7 @@ let submit = () => {
quotation
:
formData
.
value
,
};
fillQuotation
(
data
).
then
((
res
:
any
)
=>
{
console
.
log
(
'点击'
);
if
(
res
.
data
.
code
===
200
)
{
initQuotationOrder
(
orderId
.
value
)
downExcel
()
}
if
(
res
.
data
.
code
===
200
)
showModel
.
value
=
true
});
}
else
{
console
.
log
(
err
);
...
...
@@ -198,13 +200,21 @@ let submit = () => {
})
};
// 下载excel
let
downExcel
=
()
=>
{
showModel
.
value
=
true
}
// 确认下载xlsx
let
modelConfirm
=
()
=>
{
console
.
log
(
quotationData
.
value
);
uni
.
downloadFile
({
url
:
baseUrl
+
'/wx/quotation/download?orderId='
+
orderId
.
value
,
header
:
{
'Authorization'
:
uni
.
getStorageSync
(
'token'
),
'Content-Type'
:
'application/octet-stream;charset=UTF-8'
},
success
:
(
res
:
any
)
=>
{
let
downloadElement
=
document
.
createElement
(
'a'
);
downloadElement
.
href
=
res
.
tempFilePath
;
downloadElement
.
download
=
orderId
.
value
+
'.xlsx'
;
//下载后文件名
document
.
body
.
appendChild
(
downloadElement
);
downloadElement
.
click
();
//点击下载
document
.
body
.
removeChild
(
downloadElement
);
//下载完成移除元素
window
.
URL
.
revokeObjectURL
(
res
.
tempFilePath
);
//释放掉blob对象
}
})
}
let
onSubmit
=
(
data
:
any
)
=>
{
...
...
@@ -223,7 +233,6 @@ let regionConfirm1 = (e: any) => {
// 选择时间回调
let
dateConfirm
=
(
e
:
any
)
=>
{
console
.
log
(
e
);
formData
.
value
.
deliveryDate
=
e
.
year
+
'-'
+
e
.
month
+
'-'
+
e
.
day
}
...
...
@@ -232,6 +241,7 @@ let initQuotation = (orderId: number) => {
quotationInit
({
orderId
}).
then
((
res
:
any
)
=>
{
if
(
res
.
data
.
code
===
200
)
{
quotationData
.
value
=
res
.
data
.
data
;
console
.
log
(
quotationData
.
value
);
formData
.
value
=
res
.
data
.
data
.
quotation
;
initQuotationOrder
(
orderId
)
}
...
...
src/pages/productLine/components/drag-and-drop-sort.vue
浏览文件 @
1641e427
...
...
@@ -144,7 +144,7 @@ export default {
},
handleTap
(
index
)
{
let
that
=
this
;
console
.
log
(
that
.
controlsArray
,
index
);
//
console.log(that.controlsArray, index);
if
(
index
==
that
.
controlsArray
.
length
-
1
)
return
;
that
.
controlsArray
.
forEach
((
item
,
i
)
=>
{
if
(
i
!==
index
)
item
.
show
=
false
;
...
...
src/utils/request.ts
浏览文件 @
1641e427
...
...
@@ -57,7 +57,7 @@ function request(url: string, method: 'GET' | 'POST' | 'PUT' | 'DELETE', data?:
console
.
log
(
'token'
,
res
);
uni
.
clearStorage
();
}
else
{
console
.
log
(
res
.
data
,
'非200错误'
);
console
.
log
(
res
,
'非200错误'
);
//其余异样
reject
(
res
);
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论