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
127095ce
提交
127095ce
authored
11月 08, 2022
作者:
刘旭
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
优化
上级
f3b55194
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
139 行增加
和
46 行删除
+139
-46
downPdf.vue
src/pages/order/downPdf.vue
+33
-16
orderList.vue
src/pages/order/orderList.vue
+33
-4
quotation.vue
src/pages/order/quotation.vue
+45
-14
drag-and-drop-sort.vue
src/pages/productLine/components/drag-and-drop-sort.vue
+5
-4
productLine.vue
src/pages/productLine/productLine.vue
+14
-8
useStore.ts
src/store/useStore.ts
+9
-0
没有找到文件。
src/pages/order/downPdf.vue
浏览文件 @
127095ce
...
...
@@ -57,7 +57,10 @@
item
.
unitPrice
?
(
Number
(
item
.
unitPrice
)
*
item
.
number
+
Number
(
item
.
unitPrice
)
*
item
.
number
*
0.13
Number
(
item
.
unitPrice
)
*
item
.
number
*
tax
*
0.01
).
toFixed
(
2
)
:
0
}}
...
...
@@ -98,17 +101,18 @@
import
{
ref
,
computed
}
from
'vue'
;
import
{
onLoad
,
onBackPress
}
from
'@dcloudio/uni-app'
;
import
config
from
'@/utils/config'
;
import
{
useStore
}
from
'@/store/useStore'
;
import
{
useStore
,
useCurrentStore
}
from
'@/store/useStore'
;
import
{
getOrderPdf
}
from
'@/api/cart'
;
import
{
orderDetail
,
getTax
}
from
'@/api/index'
;
let
baseUrl
=
config
.
baseUrl
;
let
store
=
useStore
();
let
currentStore
=
useCurrentStore
();
let
enclosure
=
ref
(
''
);
// pdf key值
let
detailData
=
ref
();
let
type
=
ref
();
let
orderId
=
ref
();
let
tax
=
ref
(
0
)
// 税率
let
tax
=
ref
(
0
)
;
// 税率
onLoad
((
options
:
any
)
=>
{
type
.
value
=
options
.
type
;
...
...
@@ -122,12 +126,8 @@ onLoad((options: any) => {
}
console
.
log
(
res
,
'订单详情信息'
);
});
// let data = JSON.parse(options.data);
// enclosure.value = data.orderInfo.enclosure;
// detailData.value = data.orderGoods;
// orderId.value = data.orderInfo.id;
initPdf
(
options
.
orderId
);
initTax
()
initPdf
(
options
.
orderId
);
// 查询pdf详细资料
initTax
();
// 查询税率
});
// 返回首页
...
...
@@ -139,9 +139,25 @@ let toIndex = () => {
// 生成报价
let
generateQuote
=
()
=>
{
uni
.
navigateTo
({
url
:
`./quotation?orderId=
${
orderId
.
value
}
&data=
${
JSON
.
stringify
(
detailData
.
value
)}
`
,
let
data
=
[]
as
any
;
let
flag
=
true
;
detailData
.
value
.
map
((
item
:
any
)
=>
{
if
(
typeof
item
.
unitPrice
===
'undefined'
)
{
flag
=
false
;
return
uni
.
showToast
({
title
:
`请填写
${
item
.
goodsName
}
单价`
,
icon
:
'none'
,
});
}
else
data
.
push
({
goodsName
:
item
.
goodsName
,
unitPrice
:
item
.
unitPrice
,
});
});
if
(
flag
)
uni
.
navigateTo
({
url
:
`./quotation?orderId=
${
orderId
.
value
}
&data=
${
JSON
.
stringify
(
data
)}
`
,
});
};
let
totlePirce
:
any
=
computed
(()
=>
{
...
...
@@ -157,7 +173,7 @@ let totlePirce: any = computed(() => {
});
let
taxTotlePirce
=
computed
(()
=>
{
let
taxTotlePic
=
Number
(
totlePirce
.
value
)
+
Number
(
totlePirce
.
value
)
*
0.13
;
let
taxTotlePic
=
Number
(
totlePirce
.
value
)
+
Number
(
totlePirce
.
value
)
*
tax
.
value
*
0.01
;
return
Number
(
taxTotlePic
).
toFixed
(
2
);
});
...
...
@@ -201,10 +217,7 @@ let initPdf = (orderId: number) => {
// 获取税率
let
initTax
=
()
=>
{
getTax
().
then
((
res
:
any
)
=>
{
if
(
res
.
data
.
code
===
200
)
{
tax
.
value
=
res
.
data
.
data
console
.
log
(
res
,
'tax'
);
}
if
(
res
.
data
.
code
===
200
)
tax
.
value
=
Number
(
res
.
data
.
data
.
mall_tax_rate
);
});
};
...
...
@@ -214,6 +227,10 @@ onBackPress(() => {
uni
.
reLaunch
({
url
:
'../productLine/productLine'
,
});
}
else
if
(
type
.
value
===
'profile'
)
{
uni
.
redirectTo
({
url
:
'../order/orderList?showType='
+
currentStore
.
current
,
});
}
else
{
uni
.
reLaunch
({
url
:
'../index/index'
,
...
...
src/pages/order/orderList.vue
浏览文件 @
127095ce
...
...
@@ -47,6 +47,7 @@
class=
"item"
v-for=
"(item, index) in res.goodsList"
:key=
"index"
@
tap=
"toDownPdf(res.id)"
>
<view
class=
"left"
>
<image
...
...
@@ -93,8 +94,13 @@
</view>
<view
class=
"bottom"
>
<view
class=
""
></view>
<view
class=
"evaluate btn"
@
tap=
"orderDel(res.id)"
>
删除订单
<view
style=
"display: flex; flex-direction: row;"
>
<view
class=
"evaluate btn"
@
tap=
"orderQuotation(res.id)"
>
报价单
</view>
<view
class=
"evaluate btn"
@
tap=
"orderDel(res.id)"
>
删除订单
</view>
</view>
</view>
</view>
...
...
@@ -135,13 +141,16 @@
<
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
{
useCurrentStore
}
from
'@/store/useStore'
import
config
from
'@/utils/config'
;
let
baseUrl
=
config
.
baseUrl
;
let
currentStore
=
useCurrentStore
()
let
show
=
ref
(
false
)
let
content
=
ref
(
'确认删除该订单'
)
let
content
=
ref
(
'确认删除该订单
?
'
)
let
listQuery
=
ref
({
showType
:
0
,
page
:
1
,
...
...
@@ -171,7 +180,16 @@ onLoad((options?: any) => {
getOrderList
()
})
let
toDownPdf
=
(
orderId
:
number
)
=>
{
uni
.
navigateTo
({
url
:
`/pages/order/downPdf?orderId=
${
orderId
}
&type=profile`
,
success
()
{
currentStore
.
$patch
({
current
:
current
.
value
})
}
});
}
// 价格小数
let
priceDecimal
=
computed
(()
=>
{
...
...
@@ -236,10 +254,20 @@ let animationfinish = (data: any) => {
let
orderDel
=
(
orderId
:
number
)
=>
{
show
.
value
=
true
content
.
value
=
'确认删除该订单?'
orderIds
.
value
=
orderId
}
let
orderQuotation
=
(
orderId
:
number
)
=>
{
show
.
value
=
true
content
.
value
=
'确认下载execl?'
orderIds
.
value
=
orderId
}
let
onConfirm
=
()
=>
{
// quotationOrder({orderId: orderIds.value}).then((res: any) => {
// console.log(res);
// })
orderDelete
({
orderId
:
orderIds
.
value
}).
then
((
res
:
any
)
=>
{
if
(
res
.
data
.
code
===
200
)
{
orderData
.
value
=
[]
...
...
@@ -371,6 +399,7 @@ page {
.evaluate
{
color
:
$u-type-warning-dark
;
border-color
:
$u-type-warning-dark
;
margin-right
:
8rpx
;
}
}
}
...
...
src/pages/order/quotation.vue
浏览文件 @
127095ce
...
...
@@ -59,7 +59,7 @@
<u-input
v-model=
"formData.pay"
placeholder=
"请输入付款方式"
/>
</u-form-item>
<u-form-item
label=
"保修:"
prop=
"guarantee"
>
<u-input
v-model=
"formData.guarantee"
placeholder=
"请输入保修"
/>
<u-input
type=
"number"
v-model=
"formData.guarantee"
placeholder=
"请输入保修"
/>
</u-form-item>
<u-form-item
label=
"备注:"
prop=
"remarks"
>
<u-input
type=
"textarea"
v-model=
"formData.remarks"
placeholder=
"请输入备注"
/>
...
...
@@ -71,20 +71,24 @@
<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>
</
template
>
<
script
setup
lang=
"ts"
>
import
{
ref
,
getCurrentInstance
,
ComponentInternalInstance
}
from
'vue'
;
import
{
fillQuotation
,
quotationInit
}
from
'@/api/cart'
;
import
{
fillQuotation
,
quotationInit
,
quotationOrder
}
from
'@/api/cart'
;
import
{
onLoad
,
onReady
}
from
'@dcloudio/uni-app'
;
import
config
from
'@/utils/config'
;
import
orderForm
from
'./components/orderForm.vue'
;
let
{
proxy
}
:
any
=
getCurrentInstance
()
as
ComponentInternalInstance
console
.
log
(
proxy
.
$u
.
test
.
mobile
(
'15616168157'
));
let
orderRef
=
ref
()
let
baseUrl
=
config
.
baseUrl
;
let
pickerShow
=
ref
(
false
)
let
pickerShow1
=
ref
(
false
)
let
pickerDateShow
=
ref
(
false
)
let
showModel
=
ref
(
false
)
let
content
=
ref
(
'是否下载execl?'
)
let
formData
=
ref
({
attend
:
''
,
tel
:
''
,
...
...
@@ -149,35 +153,43 @@ let rules = ref({
let
uFormRef
=
ref
();
let
quotationData
=
ref
();
let
unitPrice
=
ref
()
let
orderId
=
ref
()
onLoad
((
options
:
any
)
=>
{
console
.
log
(
options
);
initQuotation
(
options
.
orderId
);
unitPrice
.
value
=
JSON
.
parse
(
options
.
data
)
orderId
.
value
=
options
.
orderId
initQuotation
(
orderId
.
value
);
});
onReady
(()
=>
{
uFormRef
.
value
?.
setRules
(
rules
.
value
);
})
// 打开单价popup
let
fillIn
=
()
=>
{
if
(
!
quotationData
.
value
.
items
)
return
orderRef
.
value
.
form
=
quotationData
.
value
.
items
orderRef
.
value
.
show
=
true
}
//
let fillIn = () => {
//
if(!quotationData.value.items) return
//
orderRef.value.form = quotationData.value.items
//
orderRef.value.show = true
//
}
let
submit
=
()
=>
{
uFormRef
.
value
?.
validate
((
valid
:
any
,
err
:
any
)
=>
{
if
(
valid
)
{
quotationData
.
value
.
items
[
0
].
price
=
23
;
quotationData
.
value
.
items
.
forEach
((
item
:
any
,
i
:
number
)
=>
{
if
(
item
.
goodsName
==
unitPrice
.
value
[
i
].
goodsName
)
{
item
.
price
=
unitPrice
.
value
[
i
].
unitPrice
}
})
let
data
=
{
items
:
quotationData
.
value
.
items
,
quotation
:
formData
.
value
,
};
fillQuotation
(
data
).
then
((
res
:
any
)
=>
{
console
.
log
(
'点击'
);
if
(
res
.
data
.
code
===
200
)
{
console
.
log
(
res
);
initQuotationOrder
(
orderId
.
value
)
downExcel
()
}
});
}
else
{
...
...
@@ -186,6 +198,15 @@ let submit = () => {
})
};
// 下载excel
let
downExcel
=
()
=>
{
showModel
.
value
=
true
}
let
modelConfirm
=
()
=>
{
console
.
log
(
quotationData
.
value
);
}
let
onSubmit
=
(
data
:
any
)
=>
{
quotationData
.
value
.
items
=
data
orderRef
.
value
.
show
=
false
...
...
@@ -197,7 +218,7 @@ let regionConfirm = (e: any) => {
}
// 选择地区回调
let
regionConfirm1
=
(
e
:
any
)
=>
{
formData
.
value
.
quotationAttend
=
e
.
province
.
name
+
'-'
+
e
.
city
.
name
+
'-'
+
e
.
area
.
name
;
formData
.
value
.
deliveryAddr
=
e
.
province
.
name
+
'-'
+
e
.
city
.
name
+
'-'
+
e
.
area
.
name
;
}
// 选择时间回调
...
...
@@ -212,9 +233,19 @@ let initQuotation = (orderId: number) => {
if
(
res
.
data
.
code
===
200
)
{
quotationData
.
value
=
res
.
data
.
data
;
formData
.
value
=
res
.
data
.
data
.
quotation
;
initQuotationOrder
(
orderId
)
}
});
};
// 二次查询详细信息
let
initQuotationOrder
=
(
orderId
:
number
)
=>
{
quotationOrder
({
orderId
}).
then
((
res
:
any
)
=>
{
if
(
res
.
data
.
data
)
{
formData
.
value
=
res
.
data
.
data
}
})
};
</
script
>
<
style
></
style
>
src/pages/productLine/components/drag-and-drop-sort.vue
浏览文件 @
127095ce
...
...
@@ -44,6 +44,7 @@
</template>
<
script
>
import
{
useStore
}
from
'@/store/useStore'
;
export
default
{
name
:
'drag-and-drop-sort'
,
props
:
{
...
...
@@ -143,11 +144,11 @@ export default {
},
handleTap
(
index
)
{
let
that
=
this
;
console
.
log
(
that
.
controlsArray
,
index
);
if
(
index
==
that
.
controlsArray
.
length
-
1
)
return
;
for
(
let
s
in
that
.
controlsArray
)
{
if
(
s
===
index
)
return
;
that
.
controlsArray
[
s
].
show
=
false
;
}
that
.
controlsArray
.
forEach
((
item
,
i
)
=>
{
if
(
i
!==
index
)
item
.
show
=
false
;
});
that
.
controlsArray
[
index
].
show
=
true
;
// that.sheetShow = true;
that
.
sheetIndex
=
index
;
...
...
src/pages/productLine/productLine.vue
浏览文件 @
127095ce
...
...
@@ -196,18 +196,24 @@ let sheetEdit = (index: number) => {
// 产品删除
let
sheetDel
=
(
index
:
number
)
=>
{
lineList
.
value
.
splice
(
index
,
1
)
,
store
.
$patch
({
lineData
:
lineList
.
value
,
});
lineList
.
value
.
splice
(
index
,
1
)
;
store
.
$patch
({
lineData
:
lineList
.
value
,
});
};
// 产品复制
let
sheetCopy
=
(
index
:
number
)
=>
{
lineList
.
value
.
splice
(
index
,
0
,
lineList
.
value
[
index
]),
store
.
$patch
({
lineData
:
lineList
.
value
,
});
lineList
.
value
.
splice
(
index
,
0
,
lineList
.
value
[
index
]);
dragRef
.
value
.
initControlsPosition
();
console
.
log
(
lineList
.
value
);
// lineList.value.forEach((item: any, i: number) => {
// if (index + 1 == i) item.show = true;
// else item.show = false;
// });
store
.
$patch
({
lineData
:
lineList
.
value
,
});
};
// 商品加入购物车等左侧事件
...
...
src/store/useStore.ts
浏览文件 @
127095ce
...
...
@@ -11,3 +11,12 @@ export let useStore = defineStore('productLine', {
}
}
})
// 订单管理页面
export
let
useCurrentStore
=
defineStore
(
'current'
,
{
state
:
()
=>
{
return
{
current
:
0
}
}
})
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论