Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-purchase
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
1
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 5999eb06
authored
Apr 06, 2023
by
前端
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
commit
1 parent
395aa1e9
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
1076 additions
and
274 deletions
package-lock.json
package.json
src/api/modules/order.js
src/api/modules/product.js
src/api/modules/purchaseShopping.js
src/api/modules/sysBase.js
src/assets/css/public.scss
src/config/index.js
src/main.js
src/setup/qiankun.js
src/views/purchaseOrder/add.vue
src/views/purchaseOrder/components/goodsDetailCom.vue
src/views/purchaseOrder/components/shoppingCartCom.vue
src/views/purchaseOrder/index.vue
package-lock.json
View file @
5999eb0
...
...
@@ -6443,9 +6443,9 @@
}
},
"glsx-common"
:
{
"version"
:
"
1.4.9
"
,
"resolved"
:
"https://registry.npmjs.org/glsx-common/-/glsx-common-
1.4.9
.tgz"
,
"integrity"
:
"sha512-
RQWGOGEXUPNmHkZn7n+eukkXp6L/mOfsgMo4gFtrt80ZDxGaznHMg7Isi4+IrEdvVdzp8Cju0eiCTddnZfdsJg
=="
,
"version"
:
"
2.0.8
"
,
"resolved"
:
"https://registry.npmjs.org/glsx-common/-/glsx-common-
2.0.8
.tgz"
,
"integrity"
:
"sha512-
hKt/SNFu+NslOHWvDLxmRwUkINBrnATTYIkOj+jmcx5RqfXIbMgEipzFGbCICWMlYYoecwRiJ6341sstPCCHLQ
=="
,
"requires"
:
{
"axios"
:
"^0.21.3"
,
"md5"
:
"^2.3.0"
,
...
...
@@ -6465,6 +6465,19 @@
"vue"
:
"^2.6.11"
,
"vue-amap"
:
"^0.5.10"
,
"vuedraggable"
:
"^2.24.3"
},
"dependencies"
:
{
"glsx-common"
:
{
"version"
:
"1.4.9"
,
"resolved"
:
"https://registry.npmjs.org/glsx-common/-/glsx-common-1.4.9.tgz"
,
"integrity"
:
"sha512-RQWGOGEXUPNmHkZn7n+eukkXp6L/mOfsgMo4gFtrt80ZDxGaznHMg7Isi4+IrEdvVdzp8Cju0eiCTddnZfdsJg=="
,
"requires"
:
{
"axios"
:
"^0.21.3"
,
"md5"
:
"^2.3.0"
,
"qs"
:
"^6.10.1"
,
"sha1"
:
"^1.1.1"
}
}
}
},
"gopd"
:
{
...
...
package.json
View file @
5999eb0
...
...
@@ -13,7 +13,7 @@
"dayjs"
:
"^1.10.7"
,
"el-tree-transfer"
:
"^2.2.6"
,
"element-ui"
:
"^2.4.5"
,
"glsx-common"
:
"^
1.4.6
"
,
"glsx-common"
:
"^
2.0.8
"
,
"glsx-components"
:
"^1.2.5"
,
"vue"
:
"^2.6.10"
,
"vue-router"
:
"^3.1.3"
,
...
...
src/api/modules/order.js
deleted
100644 → 0
View file @
395aa1e
import
{
http
}
from
'@/main'
const
defaultPath
=
'scrm.api.shopmall.'
const
getListApi
=
params
=>
{
params
.
method
=
`
${
defaultPath
}
orderGoodsComment.page`
return
http
({
url
:
'rop-scrm-shopmall/router'
,
method
:
'GET'
,
data
:
params
,
sign
:
true
})
}
const
deleteZoneApi
=
params
=>
{
params
.
method
=
`
${
defaultPath
}
zoneInfo.delete`
return
http
({
url
:
'rop-scrm-shopmall/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
,
returnAll
:
true
})
}
const
getZoneInfoApi
=
params
=>
{
params
.
method
=
`
${
defaultPath
}
zoneInfo.getById`
return
http
({
url
:
'rop-scrm-shopmall/router'
,
method
:
'GET'
,
data
:
params
,
sign
:
true
})
}
const
insertZoneApi
=
params
=>
{
params
.
method
=
`
${
defaultPath
}
zoneInfo.insertOrUpdate`
return
http
({
url
:
'rop-scrm-shopmall/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
,
returnAll
:
true
})
}
export
default
{
getListApi
,
deleteZoneApi
,
getZoneInfoApi
,
insertZoneApi
}
src/api/modules/product.js
View file @
5999eb0
...
...
@@ -2,72 +2,40 @@ import { http } from '@/main'
const
path
=
'dj.api.'
const
path2
=
'dj.smartcarlife.api.'
export
function
getList
(
data
)
{
data
.
method
=
`
${
path
}
goodsinfo.page`
return
http
(
data
)
}
export
function
getType
(
data
)
{
data
.
method
=
`
${
path
}
goods.type.list`
return
http
(
data
)
}
// 添加产品
export
function
addGoods
(
data
)
{
data
.
method
=
`
${
path
}
goodsinfo.add`
return
http
(
data
,
"post"
)
}
// 编辑产品
export
function
editGoods
(
data
)
{
data
.
method
=
`
${
path
}
goodsinfo.update`
return
http
(
data
,
"post"
)
}
// 判断产品是否可删除
export
function
checkDeleteGoods
(
data
)
{
data
.
method
=
`
${
path2
}
goodsinfo.checkDeleteable`
return
http
(
data
,
"post"
)
}
// 删除产品
export
function
deleteGoods
(
data
)
{
data
.
method
=
`
${
path2
}
goodsinfo.delete`
return
http
(
data
,
"post"
)
}
// 导出产品
export
function
exportGoodsList
(
data
)
{
data
.
method
=
`
${
path
}
goodsinfo.export`
return
http
(
data
,
"post"
)
// 获取素材详情
const
getProductInfo
=
(
params
)
=>
{
params
.
method
=
`scrm.api.boutiquecoupon.rop.router.twoCityTale`
params
.
routerMethod
=
`
${
path
}
goodsinfo.get.byId`
return
http
({
url
:
'rop-scrm-boutiquecoupon/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
})
}
// 获取场景下类目
export
function
getProductTypeBySceneId
(
data
)
{
data
.
method
=
`
${
path
}
goodsCategoryConfiguration.queryGoodsCategoryBySceneId`
return
http
(
data
,
"post"
)
}
// 获取品牌方/供应方
export
function
getBrandSupplyMerchant
(
data
)
{
data
.
method
=
`
${
path
}
goods.type.queryGoodsRelatedParty`
return
http
(
data
,
"post"
)
}
// 新增供应方
export
function
addBrandSupplyMerchant
(
data
)
{
data
.
method
=
`
${
path
}
goods.type.addGoodsRelatedParty`
return
http
(
data
,
"post"
)
}
// 编辑/删除供应方
export
function
editBrandSupplyMerchant
(
data
)
{
data
.
method
=
`
${
path
}
goods.type.editGoodsRelatedParty`
return
http
(
data
,
"post"
)
}
// 获取素材详情
export
function
getProductInfo
(
data
)
{
data
.
method
=
`
${
path
}
goodsinfo.get.byId`
return
http
(
data
,
"post"
)
}
const
getProductTypeBySceneId
=
(
params
)
=>
{
params
.
method
=
`scrm.api.boutiquecoupon.rop.router.twoCityTale`
params
.
routerMethod
=
`
${
path
}
goodsCategoryConfiguration.queryGoodsCategoryBySceneId`
return
http
({
url
:
'rop-scrm-boutiquecoupon/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
})
}
// 查询产品列表
const
getGoodsList
=
(
params
)
=>
{
params
.
method
=
`scrm.api.boutiquecoupon.rop.router.twoCityTale`
params
.
routerMethod
=
`
${
path
}
goodsinfo.list`
return
http
({
url
:
'rop-scrm-boutiquecoupon/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
})
}
export
default
{
getGoodsList
,
getProductInfo
,
getProductTypeBySceneId
}
src/api/modules/purchaseShopping.js
View file @
5999eb0
...
...
@@ -5,9 +5,10 @@ const path2 = 'dj.api.goodsInfo.'
const
path3
=
'dj.api.smartcarlife.'
// 分页查询采购订单
const
getPurchaseOrderList
=
(
params
)
=>
{
params
.
method
=
`
${
path
}
purchaseOrder.page`
params
.
method
=
`scrm.api.boutiquecoupon.rop.router.twoCityTale`
params
.
routerMethod
=
`
${
path
}
purchaseOrder.page`
return
http
({
url
:
'rop-
dj-smartcarlife
/router'
,
url
:
'rop-
scrm-boutiquecoupon
/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
...
...
@@ -15,9 +16,10 @@ const getPurchaseOrderList = (params) => {
}
// 采购订单取消/审核
const
purchaseOrderCancelOrCheck
=
(
params
)
=>
{
params
.
method
=
`
${
path
}
purchaseOrder.cancelOrCheck`
params
.
method
=
`scrm.api.boutiquecoupon.rop.router.twoCityTale`
params
.
routerMethod
=
`
${
path
}
purchaseOrder.cancelOrCheck`
return
http
({
url
:
'rop-
dj-smartcarlife
/router'
,
url
:
'rop-
scrm-boutiquecoupon
/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
,
...
...
@@ -26,9 +28,10 @@ const purchaseOrderCancelOrCheck = (params) => {
}
// 查看采购订单
const
purchaseOrderDetail
=
(
params
)
=>
{
params
.
method
=
`
${
path
}
purchaseOrder.view`
params
.
method
=
`scrm.api.boutiquecoupon.rop.router.twoCityTale`
params
.
routerMethod
=
`
${
path
}
purchaseOrder.view`
return
http
({
url
:
'rop-
dj-smartcarlife
/router'
,
url
:
'rop-
scrm-boutiquecoupon
/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
...
...
@@ -36,9 +39,10 @@ const purchaseOrderDetail=(params)=> {
}
// 分页查询采购商城素材信息
const
listWithPagePurchaseInfo
=
(
params
)
=>
{
params
.
method
=
`
${
path2
}
listWithPage.purchaseInfo`
params
.
method
=
`scrm.api.boutiquecoupon.rop.router.twoCityTale`
params
.
routerMethod
=
`
${
path2
}
listWithPage.purchaseInfo`
return
http
({
url
:
'rop-
dj-smartcarlife
/router'
,
url
:
'rop-
scrm-boutiquecoupon
/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
...
...
@@ -47,9 +51,10 @@ const listWithPagePurchaseInfo=(params)=> {
// 获取当前登录园区店商户收货地址
const
addressGet
=
(
params
=
{})
=>
{
params
.
method
=
`
${
path
}
yqMerchantDeliveryAddress.get`
params
.
method
=
`scrm.api.boutiquecoupon.rop.router.twoCityTale`
params
.
routerMethod
=
`
${
path
}
yqMerchantDeliveryAddress.get`
return
http
({
url
:
'rop-
dj-smartcarlife
/router'
,
url
:
'rop-
scrm-boutiquecoupon
/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
...
...
@@ -59,9 +64,10 @@ const addressGet=(params = {}) =>{
// 保存园区店商户收货地址
const
addressSave
=
(
params
)
=>
{
params
.
method
=
`
${
path
}
yqMerchantDeliveryAddress.save`
params
.
method
=
`scrm.api.boutiquecoupon.rop.router.twoCityTale`
params
.
routerMethod
=
`
${
path
}
yqMerchantDeliveryAddress.save`
return
http
({
url
:
'rop-
dj-smartcarlife
/router'
,
url
:
'rop-
scrm-boutiquecoupon
/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
...
...
@@ -69,33 +75,60 @@ const addressSave=(params)=> {
}
// 按商品类目分组获取购物车列表
export
function
listGroupByGoodsType
(
data
)
{
data
.
method
=
`
${
path
}
purchaseShoppingCar.listGroupByGoodsType`
return
http
(
data
)
const
listGroupByGoodsType
=
(
params
)
=>
{
params
.
method
=
`scrm.api.boutiquecoupon.rop.router.twoCityTale`
params
.
routerMethod
=
`
${
path
}
purchaseShoppingCar.listGroupByGoodsType`
return
http
({
url
:
'rop-scrm-boutiquecoupon/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
})
}
// 添加到购物车
export
function
shoppingCarAdd
(
data
)
{
data
.
method
=
`
${
path
}
purchaseShoppingCar.add`
return
http
(
data
)
}
// 更新购物车商品选中标识
const
updateSelectedFlag
=
(
params
)
=>
{
params
.
method
=
`scrm.api.boutiquecoupon.rop.router.twoCityTale`
params
.
routerMethod
=
`
${
path
}
purchaseShoppingCar.updateSelectedFlag`
return
http
({
url
:
'rop-scrm-boutiquecoupon/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
})
}
// 移除购物车商品
export
function
shoppingCarRemove
(
data
)
{
data
.
method
=
`
${
path
}
purchaseShoppingCar.remove`
return
http
(
data
)
const
shoppingCarRemove
=
(
params
)
=>
{
params
.
method
=
`scrm.api.boutiquecoupon.rop.router.twoCityTale`
params
.
routerMethod
=
`
${
path
}
purchaseShoppingCar.remove`
return
http
({
url
:
'rop-scrm-boutiquecoupon/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
})
}
// 修改购物车商品数量
export
function
shoppingCarUpdateNumber
(
data
)
{
data
.
method
=
`
${
path
}
purchaseShoppingCar.updateNumber`
return
http
(
data
)
// 添加到购物车
const
shoppingCarAdd
=
(
params
)
=>
{
params
.
method
=
`scrm.api.boutiquecoupon.rop.router.twoCityTale`
params
.
routerMethod
=
`
${
path
}
purchaseShoppingCar.add`
return
http
({
url
:
'rop-scrm-boutiquecoupon/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
})
}
// 更新购物车商品选中标识
export
function
updateSelectedFlag
(
data
)
{
data
.
method
=
`
${
path
}
purchaseShoppingCar.updateSelectedFlag`
return
http
(
data
)
// 修改购物车商品数量
export
function
shoppingCarUpdateNumber
(
params
)
{
params
.
method
=
`scrm.api.boutiquecoupon.rop.router.twoCityTale`
params
.
routerMethod
=
`
${
path
}
purchaseShoppingCar.updateNumber`
return
http
(
params
)
}
...
...
@@ -103,33 +136,33 @@ export function updateSelectedFlag(data) {
// 添加采购订单
export
function
purchaseOrderAdd
(
data
)
{
data
.
method
=
`
${
path
}
purchaseOrder.add`
return
http
(
data
,
"post"
)
}
// export function purchaseOrderAdd(data) {
// params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
// data.routerMethod = `${path}purchaseOrder.add`
// return http(data, "post")
// }
// 采购订单入库
export
function
purchaseOrderPutIn
(
data
)
{
data
.
method
=
`
${
path
}
purchaseOrder.putIn`
return
http
(
data
)
}
// 获取下单/入库门店
export
function
getMerchantList
(
data
)
{
data
.
method
=
`
${
path3
}
permission.yqMerchant.list`
return
http
(
data
,
"post"
)
}
// export function getMerchantList(data) {
// params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
// data.routerMethod = `${path3}permission.yqMerchant.list`
// return http(data, "post")
// }
// 确认发货
export
function
purchaseOrderConfirmDelivery
(
data
)
{
data
.
method
=
`
${
path
}
purchaseOrder.confirmDelivery`
return
http
(
data
)
}
// export function purchaseOrderConfirmDelivery(data) {
// params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
// data.routerMethod = `${path}purchaseOrder.confirmDelivery`
// return http(data)
// }
export
default
{
getPurchaseOrderList
,
purchaseOrderCancelOrCheck
,
purchaseOrderDetail
,
listWithPagePurchaseInfo
,
addressGet
,
addressSave
}
\ No newline at end of file
export
default
{
shoppingCarAdd
,
shoppingCarRemove
,
updateSelectedFlag
,
listGroupByGoodsType
,
getPurchaseOrderList
,
purchaseOrderCancelOrCheck
,
purchaseOrderDetail
,
listWithPagePurchaseInfo
,
addressGet
,
addressSave
}
\ No newline at end of file
src/api/modules/sysBase.js
View file @
5999eb0
/*
* @Author: limin
* @Date: 2019-08-26 18:02:55
* @Last Modified by: chenwq
* @Last Modified time: 2021-06-07 16:30:53
*/
import
{
http
}
from
'@/main'
// import RequestMethods from "./request.methods"
// export const BASE_DATA_URL = "fims.configuration.from.conftype"
import
{
http
,
http_common
}
from
'@/main'
const
path
=
"dj.api."
const
defaultPath
=
'scrm.api.carlife.'
// // 获取商品分类列表
// export function getProductType(data) {
// data.method = `${path}goods.type.list`
// return request(data)
// }
// 获取不同场景的商品分类
const
getGoodsCategoryConfiguration
=
(
params
)
=>
{
params
.
method
=
`scrm.api.boutiquecoupon.rop.router.twoCityTale`
params
.
currentPage
=
1
params
.
pageSize
=
999999
params
.
m
ethod
=
`
${
path
}
goodsCategoryConfiguration.page`
params
.
routerM
ethod
=
`
${
path
}
goodsCategoryConfiguration.page`
return
http
({
url
:
'rop-
dj-smartcarlife
/router'
,
url
:
'rop-
scrm-boutiquecoupon
/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
})
}
// // 获取渠道列表
// export function getChannelType(data) {
// data.method = `${path}channel.type.list`
// return request(data)
// }
// // 图片上传
// export function uploadImg(data) {
// data.method = `${path}common.uploadImg`
// return request(data, RequestMethods.POST, ["file"])
// }
// // 图片识别
// export function imgRecognitionApi(data) {
// data.method = `${path}common.ocr.recognition`
// return request(data, RequestMethods.POST)
// }
// // 银行列表
// export function getBankListApi(data) {
// data.method = `${path}yseBankInfo.bankList`
// return request(data, RequestMethods.POST)
// }
// // 银行列表-支行
// export function getYseBankListApi(data) {
// data.method = `${path}yseBankInfo.listWithPage`
// return request(data, RequestMethods.POST)
// }
// // 给指定号码发送验证码
// export function sendToSmsCodeApi(data) {
// data.method = `${path}smartcarlife.sms.sendSmsCode`
// return request(data, RequestMethods.POST)
// }
// // 获取配置列表
// export function commonConfigApi(data) {
// data.method = `${path}common.config.list`
// return request(data, RequestMethods.POST)
// }
// // Excel异步导出
// export function asyncExportExcel(data) {
// data.method = `${path}common.async.exportExcel`
// return request(data, RequestMethods.POST)
// }
// // 获取Excel异步导出查询导出结果
// export function exportExcel(data) {
// data.method = `${path}common.query.async.exportExcel`
// return request(data, RequestMethods.POST)
// }
// // 视频上传
// export function uploadVideo(data) {
// data.method = `${path}smartcarlife.common.uploadVideo`
// return request(data, RequestMethods.POST, ["file"])
// }
// 视频上传
const
uploadVideo
=
params
=>
{
params
.
method
=
`
${
defaultPath
}
common.uploadVideo`
return
http
({
url
:
'rop-scrm-carlife/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
,
noSignAttr
:
[
'file'
]
})
}
// // 类目列表获取
// export function queryFeeCategoryByType(data) {
// data.method = `${path}smartcarlife.feeCategory.queryFeeCategoryByType`
// return request(data, RequestMethods.POST)
// }
const
uploadImg
=
params
=>
{
params
.
method
=
'glsx.accounts.biz.common.pictureUpload'
return
http_common
({
url
:
'/router?method=glsx.accounts.biz.common.pictureUpload'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
,
noSignAttr
:
[
'file'
]
})
}
// // 2.0场景 素材可选的服务项目
// export function getProductServiceItems(data) {
// data.method = `dj.api.smartcarlife.vd.item.list.single`
// return request(data)
// }
export
default
{
getGoodsCategoryConfiguration
}
export
default
{
getGoodsCategoryConfiguration
,
uploadImg
,
uploadVideo
}
src/assets/css/public.scss
View file @
5999eb0
...
...
@@ -23,4 +23,12 @@ html {
}
.pointer
{
cursor
:
pointer
;
}
.carIcon
{
display
:
inline-block
;
width
:
22px
;
height
:
22px
;
background
:
url(../../images/shoppingCarIcon.webp)
no-repeat
;
background-size
:
100%
100%
;
margin-right
:
4px
;
}
\ No newline at end of file
src/config/index.js
View file @
5999eb0
...
...
@@ -9,22 +9,21 @@
// 根据环境引入不同配置 process.env.VUE_APP_ENV
// let request = require('@/http/request.js')
let
cfg
=
require
(
'./conf.js'
)
import
{
Http
}
from
'glsx-common'
import
{
Http
,
utils
}
from
'glsx-common'
let
timeout
=
30000
//超时时间
export
const
fetchConfig
=
function
(
isEnv
=
true
)
{
// console.log(1111111)
// if (isEnv) {
// let { request } = cfg
// Object.assign(request, { timeout })
// return Promise.resolve(cfg)
//
let { request } = cfg
//
Object.assign(request, { timeout })
//
return Promise.resolve(cfg)
// }
//return window.fetch('https://', {}).then(res => res.json())
// request({ url: 'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config/oss_commodity_center', method: 'get' }
)
return
new
Http
().
get
(
'http://192.168.3.171:7300/mock/6423df03079be3540abbb69e/purchase/config'
)
let
params
=
{
moduleName
:
'purchase'
,
mockUrl
:
'https://oss-config.test.glsx.com.cn/mock/616d28231072f92988f059fb/purchase/config'
,
env
:
'test'
,
httpOptions
:
{
Headers
:
{
refererurl
:
location
.
href
},
request
:
{
timeout
:
30000
}
}
}
return
utils
.
getConfig
(
params
)
// return new Http().get('https://oss-config.test.glsx.com.cn/mock/616d28231072f92988f059fb/home/config')
// return new Http({ Headers: { refererurl: location.href }, request: { timeout: 30000 } }).get('http://config-center-backend.test.glsx.com/glsxAdmin/config?moduleUrl=home').then(res => res
)
}
export
const
config
=
{
install
(
vue
,
cfg
)
{
vue
.
prototype
.
$config
=
cfg
}
}
}
\ No newline at end of file
src/main.js
View file @
5999eb0
...
...
@@ -20,6 +20,7 @@ Vue.config.productionTip = false
Vue
.
prototype
.
$apis
=
apis
Vue
.
prototype
.
$$
=
optionalChaining
Vue
.
prototype
.
size
=
'small'
Vue
.
prototype
.
$EventBus
=
new
Vue
()
start
()
export
{
bootstrap
,
mount
,
unmount
}
from
'@/setup'
export
const
http
=
params
=>
Vue
.
prototype
.
$http
(
params
)
...
...
src/setup/qiankun.js
View file @
5999eb0
...
...
@@ -19,7 +19,7 @@ export async function bootstrap({ history, common, messenger, globalState }) {
Vue
.
prototype
.
$common
=
common
Vue
.
prototype
.
$message
=
message
Vue
.
prototype
.
$messageBox
=
messageBox
Vue
.
prototype
.
$http
=
new
common
.
Http
({
response
,
request
,
sign
,
secret
,
alert
:
message
.
error
,
headers
:
{
token
:
'b9f2cc80-19f7-4b55-bf90-3b32214aaff1'
}
})
Vue
.
prototype
.
$http
=
new
common
.
Http
({
response
,
request
,
sign
,
secret
,
alert
:
message
.
error
,
headers
:
{
token
:
globalState
.
session
.
token
}
})
Vue
.
prototype
.
$http_common
=
new
common
.
Http
({
response
,
signWay
:
"md5"
,
request
:
request_common
,
sign
:
sign_common
,
secret
,
alert
:
ElementUI
.
Message
.
error
,
headers
:
{
TGT
:
globalState
.
session
.
token
}
})
// Vue.prototype.$setGlobalState = globalState.actions.setGlobalState
Vue
.
use
(
GLButton
,
{
permissions
:
globalState
.
permissions
||
[
'1-1-1-1'
,
'2-1-1-1'
,
'3-1-1-1'
]
})
...
...
src/views/purchaseOrder/add.vue
View file @
5999eb0
...
...
@@ -56,23 +56,23 @@
</div>
</div>
<!-- 购物车组件 -->
<
!--
<shoppingCartCom
ref=
"shoppingCartCom"
:address-info=
"addressInfo"
@
editAddress=
"orderFrom"
/>
--
>
<
shoppingCartCom
ref=
"shoppingCartCom"
:address-info=
"addressInfo"
@
editAddress=
"orderFrom"
/
>
<addressCom
:visible
.
sync=
"addressComVisible"
@
handleConfirmAddress=
"addressGet"
:address-info=
"addressInfo"
/>
<
!--
<goodsDetailCom
:visible
.
sync=
"goodsDetailComVisible"
:goods-id=
"selectItem.id"
/>
--
>
<
goodsDetailCom
:visible
.
sync=
"goodsDetailComVisible"
:goods-id=
"selectItem.id"
/
>
</div>
</
template
>
<
script
>
//
import shoppingCartCom from './components/shoppingCartCom'
import
shoppingCartCom
from
'./components/shoppingCartCom'
import
addressCom
from
'./components/addressCom'
//
import goodsDetailCom from './components/goodsDetailCom'
import
goodsDetailCom
from
'./components/goodsDetailCom'
export
default
{
name
:
'PurchasingMall'
,
components
:
{
//
shoppingCartCom,
shoppingCartCom
,
addressCom
,
//
goodsDetailCom
goodsDetailCom
},
data
()
{
return
{
...
...
@@ -128,7 +128,6 @@ export default {
this
.
listWithPagePurchaseInfo
()
},
handleDetail
(
item
,
index
)
{
console
.
log
(
'index'
,
index
)
this
.
selectItem
=
item
this
.
goodsDetailComVisible
=
true
const
list
=
this
.
$common
.
utils
.
deepClone
(
this
.
purchaseList
)
...
...
@@ -192,11 +191,9 @@ export default {
updatedDate
:
1678093448000
,
deletedFlag
:
'N'
}
console
.
log
(
this
.
addressInfo
,
' this.addressInfo'
)
console
.
log
(
this
.
$$
(
this
.
addressInfo
,
'contactPhone'
))
if
(
this
.
showOrderCom
)
{
this
.
showOrderCom
=
false
//
this.$refs.shoppingCartCom.validateGoodsNumber()
this
.
$refs
.
shoppingCartCom
.
validateGoodsNumber
()
}
})
.
catch
(
err
=>
{
...
...
src/views/purchaseOrder/components/goodsDetailCom.vue
View file @
5999eb0
<
template
>
<!--
<div>
商品详情
</div>
-->
<GLDialog
:visible
.
sync=
"dialogShow"
title=
"产品详情"
:close-on-click-modal=
"false"
@
onOk=
"handleSubmit"
@
onCancel=
"handleDetailClose"
>
<div
class=
"detail-content"
>
<!-- 商品详情 -->
<div
class=
"goodsInfoCom"
>
<div
class=
"goodsInfoCom__left"
>
<img
:src=
"goodsInfo.thumbUrl"
alt=
""
/>
</div>
<div
class=
"goodsInfoCom__right"
>
<p
class=
"title two-line-ellipsis"
>
{{
goodsInfo
.
goodsName
}}
</p>
<div
class=
"priceCon"
>
<span
class=
"price"
>
价格:
<span
class=
"priceNum"
>
¥
{{
handleItemInfo
.
purchasePrice
}}
</span>
</span>
<span
class=
"turnover"
>
成交量:
<span
class=
"num"
>
{{
goodsInfo
.
purchaseOrderCount
||
0
}}
笔
</span>
</span>
</div>
<div
class=
"skuCon"
>
<div
class=
"label"
>
规格:
</div>
<div
class=
"itemCon"
>
<div
class=
"skuItem one-line-ellipsis pointer"
:class=
"
{ active: index === selectIndex }"
v-for="(item, index) in goodsInfo.upgradeGoodsList"
:key="index"
@click="
selectIndex = index
setHandleItemInfo(item)
"
>
{{
item
.
upgradeGoodsName
}}
</div>
</div>
</div>
<div
class=
"munCom"
>
<div
class=
"label"
>
数量:
</div>
<div
class=
"munItem"
>
<el-input-number
v-model=
"handleItemInfo.goodsNumber"
:min=
"1"
:max=
"9999"
></el-input-number>
</div>
<div
class=
"tips"
>
<!-- goodsItem.goodsType == 1 -->
{{
membraneTypeList
.
includes
(
goodsInfo
.
goodsType
)
?
`卷(1卷=${goodsInfo.convertedValue || 30
}
米)`
:
'件'
}}
<
/div
>
<
/div
>
<
el
-
button
class
=
"carBtn"
icon
=
"carIcon"
type
=
"primary"
@
click
=
"updateCarShopping"
>
加入购物车
<
/el-button
>
<
/div
>
<!--
<
i
class
=
"carIcon"
><
/i> --
>
<
/div
>
<
h3
>
产品详情
<
/h3
>
<
div
class
=
"goodsDescList"
>
<
div
class
=
"goodsDescItem"
v
-
for
=
"(item, index) in goodsInfo.goodsDescList"
:
key
=
"index"
>
<
img
:
src
=
"item.content"
v
-
if
=
"item.resType == 1"
class
=
"productDetailsImg"
alt
=
""
/>
<!--
<
div
class
=
"goodsDescItem__title"
>
{{
item
.
title
}}
<
/div> --
>
<
div
v
-
if
=
"item.resType == 2"
class
=
"goodsDescItem__content"
v
-
html
=
"item.content"
><
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/GLDialog
>
<
/template
>
<
script
>
import
{
membraneTypeList
}
from
'@/utils/constants.js'
export
default
{
name
:
'GoodsDetailCom'
,
props
:
{
visible
:
{
type
:
Boolean
,
default
:
false
}
,
selectItemInfo
:
{
type
:
Object
,
default
:
()
=>
{
}
}
,
goodsId
:
{
type
:
[
String
,
Number
]
// required: true
// default: '24'
}
}
,
data
()
{
return
{
// dialogShow: false,
membraneTypeList
,
goodsInfo
:
{
}
,
selectIndex
:
0
,
handleItemInfo
:
{
goodsNumber
:
1
,
upgradeGoodsId
:
''
,
purchasePrice
:
0
}
}
}
,
computed
:
{
dialogShow
:
{
get
()
{
return
this
.
visible
}
,
set
(
val
)
{
this
.
$emit
(
'update:visible'
,
val
)
}
}
// selectItemInfo()
{
// // this.goodsInfo[]
// if (this.goodsInfo.upgradeGoodsList.length)
{
// let item = this.goodsInfo.upgradeGoodsList[this.selectIndex]
// return
{
// goodsNumber: this.goodsInfo.num,
// upgradeGoodsId: item.id
//
}
//
}
// // return this.selectItemInfo
//
}
}
,
watch
:
{
visible
(
val
)
{
if
(
val
)
{
this
.
getGoodsDetail
()
}
}
}
,
methods
:
{
getGoodsDetail
()
{
this
.
$apis
.
product
.
getProductInfo
({
id
:
this
.
goodsId
}
).
then
(
res
=>
{
this
.
goodsInfo
=
res
// 调试用
// for (let index = 0; index < 12; index++)
{
// this.goodsInfo.upgradeGoodsList[index] = this.goodsInfo.upgradeGoodsList[0]
//
}
// 默认选中第一个
const
item
=
this
.
goodsInfo
.
upgradeGoodsList
[
0
]
// console.log(item)
item
&&
this
.
setHandleItemInfo
(
item
)
}
)
}
,
setHandleItemInfo
(
item
)
{
console
.
log
(
item
)
const
{
id
,
purchasePrice
}
=
item
this
.
handleItemInfo
=
Object
.
assign
(
this
.
handleItemInfo
,
{
upgradeGoodsId
:
id
,
purchasePrice
}
)
}
,
handleDetailClose
()
{
this
.
dialogShow
=
false
}
,
updateCarShopping
()
{
const
params
=
{
goodsNumber
:
this
.
handleItemInfo
.
goodsNumber
,
upgradeGoodsId
:
this
.
handleItemInfo
.
upgradeGoodsId
}
// 判断是否有值
params
.
upgradeGoodsId
&&
this
.
$apis
.
purchaseShopping
.
shoppingCarAdd
(
params
).
then
(
res
=>
{
// console.log(res)
this
.
$message
.
success
(
'加入购物车成功'
)
this
.
$EventBus
.
$emit
(
'updateCarShopping'
)
this
.
dialogShow
=
false
}
)
// this.$message.success('加入购物车成功')
// this.$EventBus.$emit('updateCarShopping')
}
}
}
<
/script
>
<
style
lang
=
"scss"
scoped
>
.
goodsInfoCom
{
display
:
flex
;
.
goodsInfoCom__left
{
width
:
400
px
;
height
:
400
px
;
img
{
width
:
100
%
;
height
:
100
%
;
}
}
.
goodsInfoCom__right
{
flex
:
1
;
margin
-
left
:
20
px
;
.
title
{
margin
:
0
;
font
-
weight
:
600
;
font
-
size
:
20
px
;
color
:
#
333333
;
}
.
priceCon
{
box
-
sizing
:
border
-
box
;
width
:
100
%
;
height
:
65
px
;
display
:
flex
;
align
-
items
:
center
;
justify
-
content
:
space
-
between
;
padding
:
0
10
px
;
margin
:
16
px
0
20
px
;
background
:
#
f2f5fb
;
border
-
radius
:
2
px
;
color
:
#
666666
;
.
price
{
display
:
flex
;
align
-
items
:
center
;
margin
-
left
:
8
px
;
}
.
num
{
margin
-
left
:
8
px
;
}
.
priceNum
{
font
-
weight
:
600
;
font
-
size
:
30
px
;
color
:
#
ee3040
;
}
}
.
skuCon
{
display
:
flex
;
// flex-wrap: wrap;
// align-items: center;
.
itemCon
{
flex
:
1
;
display
:
flex
;
flex
-
wrap
:
wrap
;
justify
-
content
:
space
-
between
;
}
.
skuItem
{
box
-
sizing
:
border
-
box
;
width
:
234
px
;
height
:
36
px
;
background
:
#
ffffff
;
border
:
1
px
solid
#
e7edf9
;
border
-
radius
:
2
px
;
color
:
#
333333
;
text
-
align
:
center
;
line
-
height
:
36
px
;
padding
:
0
10
px
;
margin
-
bottom
:
16
px
;
&
.
active
{
border
:
1
px
solid
#
185
efe
;
}
}
}
.
label
{
box
-
sizing
:
border
-
box
;
width
:
60
px
;
height
:
36
px
;
text
-
align
:
center
;
padding
-
left
:
18
px
;
line
-
height
:
36
px
;
color
:
#
666666
;
}
}
}
.
productDetailsImg
{
max
-
width
:
fit
-
content
;
}
.
munCom
{
display
:
flex
;
margin
-
bottom
:
20
px
;
.
tips
{
height
:
36
px
;
line
-
height
:
36
px
;
margin
-
left
:
8
px
;
font
-
size
:
12
px
;
color
:
#
666666
;
}
}
.
carBtn
{
display
:
flex
;
align
-
items
:
center
;
}
<
/style
>
src/views/purchaseOrder/components/shoppingCartCom.vue
View file @
5999eb0
<
template
>
<div
class=
"shopCarCon"
>
<el-button
class=
"carBtnCon"
type=
"primary"
:data-attr=
"goodsTotalNumber"
icon=
"carIcon"
@
click=
"drawer = true"
>
购物车
</el-button>
<el-drawer
class=
"shoppingCartDrawerCon"
title=
"购物车"
:visible
.
sync=
"drawer"
size=
"500px"
:direction=
"direction"
>
<div
class=
"headerCon"
v-if=
"goodsList.length"
>
<div
class=
"left"
>
<el-checkbox
:indeterminate=
"isIndeterminate"
@
change=
"handleAllCheckChange(isAllCheck)"
v-model=
"isAllCheck"
>
全选
</el-checkbox>
<!--
<input
type=
"checkbox"
class=
"pointer"
/>
全选 -->
</div>
<!-- :indeterminate="isIndeterminate" -->
<div
class=
"right"
>
已选
<span
class=
"red"
>
{{
goodsSelectTotalNumber
}}
</span>
件,共计
<span
class=
"red"
>
{{
totalPrice
}}
</span>
元
</div>
</div>
<div
class=
"goodsTypeCon"
v-for=
"(item, index) in goodsList"
:key=
"index"
>
<div
class=
"itemHeader"
>
<el-checkbox
:indeterminate=
"item.isIndeterminate"
class=
"checkoutBox pointer"
@
change=
"handleGoodsTypeCheckChange(item.goodsTypeCheckout, item)"
v-model=
"item.goodsTypeCheckout"
>
{{
item
.
goodsTypeName
}}
</el-checkbox>
<!--
<input
type=
"checkbox"
class=
"checkoutBox pointer"
@
change=
"handleGoodsTypeCheckChange(item.goodsTypeCheckout, item)"
v-model=
"item.goodsTypeCheckout"
/>
-->
</div>
<div
class=
"goodsCon"
v-for=
"(goodsItem, goodsIndex) in item.upgradeGoodsList"
:key=
"goodsIndex"
>
<el-checkbox
class=
"pointer typeCheckoutBox"
@
change=
"handleGoodsCheckChange(goodsItem.selectedFlag, goodsItem)"
v-model=
"goodsItem.selectedFlag"
/>
<!--
<input
type=
"checkbox"
class=
"pointer typeCheckoutBox"
@
change=
"handleGoodsCheckChange(goodsItem.selectedFlag,goodsItem)"
v-model=
"goodsItem.selectedFlag"
>
-->
<div
class=
"itemInfo"
>
<div
class=
"imgCon"
>
<img
:src=
"goodsItem.thumbUrl"
alt=
""
/>
</div>
<div
class=
"right"
>
<div
class=
"name one-line-ellipsis"
>
{{
goodsItem
.
upgradeGoodsName
}}
</div>
<div
class=
"price"
>
<span
class=
"label"
>
商品价格:
</span>
¥
{{
goodsItem
.
purchasePrice
}}
</div>
<div
class=
"num"
>
<el-input-number
v-model=
"goodsItem.goodsNumber"
@
change=
"handleGoodsNumChange($event, goodsItem.upgradeGoodsId)"
:min=
"1"
class=
"numInput"
size=
"mini"
:max=
"9999"
></el-input-number>
{{
membraneTypeList
.
includes
(
goodsItem
.
goodsType
)
?
`卷(1卷=${goodsItem.convertedValue || 30
}
米)`
:
'件'
}}
<
/div
>
<
i
class
=
"el-icon-delete deleteIcon pointer"
@
click
=
"handleDelete(goodsItem.id)"
><
/i
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
div
class
=
"totalCon"
>
<
span
class
=
"label"
>
总价:
<
/span
>
<
span
class
=
"num"
>
¥
{{
totalPrice
}}
<
/span
>
<!--
<
div
><
/div> --
>
<
el
-
button
class
=
"submitBtn"
@
click
=
"validateGoodsNumber"
type
=
"primary"
>
结算
<
/el-button
>
<
/div
>
<
/el-drawer
>
<
GLDialog
class
=
"addressDialog"
title
=
"结算确认"
okText
=
"确定结算"
:
visible
.
sync
=
"dialogShow"
:
close
-
on
-
click
-
modal
=
"false"
@
onOk
=
"handleSubmit"
@
onCancel
=
"dialogShow = false"
>
<
h4
class
=
"title"
>
确认要结算订单吗
?
<
/h4
>
<
div
class
=
"info"
>
<
p
class
=
"tips"
>
<
span
>
请核对收货仓信息
:
<
/span
>
<
el
-
button
type
=
"text"
@
click
=
"editAddress"
>
修改
<
/el-button
>
<
/p
>
<
ul
class
=
"orderInfoCom"
>
<
li
class
=
"item"
v
-
for
=
"(item, index) in addressInfoList"
:
key
=
"index"
>
<
span
class
=
"label"
>
{{
item
.
label
}}
<
/span
>
<
span
class
=
"conten"
>
{{
$$
(
addressInfo
,
[
item
.
name
])
}}
<
/span
>
<
/li
>
<
/ul
>
<
/div
>
<
/GLDialog
>
<
/div
>
<
/template
>
<
script
>
import
{
limitPrice
}
from
'@/common/format'
import
{
membraneTypeList
}
from
'@/utils/constants.js'
export
default
{
name
:
'ShoppingCartCom'
,
props
:
{
addressInfo
:
{
type
:
Object
,
default
:
()
=>
{
}
}
}
,
data
()
{
return
{
// addressInfo:
{
}
,
throttleSubmit
:
false
,
membraneTypeList
,
drawer
:
false
,
dialogShow
:
false
,
direction
:
'rtl'
,
isAllCheck
:
false
,
isIndeterminate
:
true
,
totalPrice
:
0
,
goodsSelectTotalNumber
:
0
,
goodsTotalNumber
:
0
,
goodsList
:
[],
addressInfoList
:
[
{
label
:
'店铺名称'
,
name
:
'yqMerchantName'
}
,
{
label
:
'店铺编号'
,
name
:
'yqMerchantId'
}
,
{
label
:
'收货人'
,
name
:
'contactName'
}
,
{
label
:
'收货人电话'
,
name
:
'contactPhone'
}
,
{
label
:
'收货地址'
,
name
:
'contactAddress'
}
],
selectList
:
[]
}
}
,
computed
:
{
goodsSelectStatus
()
{
return
this
.
goodsList
.
reduce
((
list
,
item
)
=>
{
item
.
upgradeGoodsList
.
forEach
(
goodsItem
=>
{
list
.
push
({
id
:
goodsItem
.
id
,
upgradeGoodsId
:
goodsItem
.
upgradeGoodsId
,
selectedFlag
:
goodsItem
.
selectedFlag
?
'Y'
:
'N'
,
goodsNumber
:
goodsItem
.
goodsNumber
}
)
}
)
return
list
}
,
[])
}
}
,
// watch:
{
//
}
,
mounted
()
{
// this.restGoodsList()
this
.
getGoodsList
()
// 更新购物车数据
this
.
$EventBus
.
$on
(
'updateCarShopping'
,
()
=>
{
// console.log('updateCarShopping')
this
.
getGoodsList
()
}
)
}
,
methods
:
{
editAddress
()
{
this
.
dialogShow
=
false
this
.
$emit
(
'editAddress'
)
}
,
validateGoodsNumber
()
{
// 判断 是否有地址
if
(
!
this
.
addressInfo
?.
id
)
{
this
.
$message
.
warning
(
'请先填写地址'
)
return
}
// 判断 是否有选中的商品
const
selectList
=
this
.
goodsSelectStatus
.
reduce
((
list
,
item
)
=>
{
if
(
item
.
selectedFlag
===
'Y'
)
{
list
.
push
({
upgradeGoodsId
:
item
.
upgradeGoodsId
,
goodsNumber
:
item
.
goodsNumber
}
)
}
return
list
}
,
[])
if
(
!
selectList
.
length
)
{
return
this
.
$message
.
warning
(
'请选择商品'
)
}
else
{
this
.
selectList
=
selectList
this
.
dialogShow
=
true
this
.
throttleSubmit
=
false
}
}
,
handleSubmit
()
{
if
(
this
.
throttleSubmit
)
return
console
.
log
(
this
.
throttleSubmit
)
console
.
log
(
'submit'
)
const
{
contactAddress
,
contactName
,
contactPhone
}
=
this
.
addressInfo
const
params
=
{
orderDelivery
:
{
contactAddress
,
contactName
,
contactPhone
}
,
shoppingCarList
:
this
.
selectList
}
// console.log(params)
// return
this
.
throttleSubmit
=
true
this
.
$apis
.
purchaseShopping
.
purchaseOrderAdd
(
params
).
then
(
result
=>
{
this
.
drawer
=
false
this
.
dialogShow
=
false
this
.
$message
.
success
(
'提交成功'
)
this
.
getGoodsList
()
// this.$nextTick(() =>
{
// this.throttleSubmit = false
//
}
,
1000
)
}
)
// purchaseOrderAdd
// this.getGoodsList()
//
}
else
{
//
}
}
,
handleDelete
(
upgradeGoodsId
)
{
// console.log(upgradeGoodsId)
this
.
$apis
.
purchaseShopping
.
shoppingCarRemove
({
id
:
upgradeGoodsId
}
).
then
(
result
=>
{
this
.
getGoodsList
()
}
)
}
,
handleAllCheckChange
(
value
)
{
console
.
log
(
value
)
const
idsName
=
value
?
'selectedIds'
:
'notSelectedIds'
const
list
=
this
.
goodsSelectStatus
.
map
(
item
=>
{
// item.selectedFlag = value ? 'Y' : 'N'
return
item
.
id
}
)
this
.
updateSelectedFlag
({
[
idsName
]:
list
}
)
}
,
handleGoodsTypeCheckChange
(
value
,
typeList
)
{
console
.
log
(
value
)
const
idsName
=
value
?
'selectedIds'
:
'notSelectedIds'
const
list
=
typeList
.
upgradeGoodsList
.
map
(
item
=>
{
return
item
.
id
}
)
this
.
updateSelectedFlag
({
[
idsName
]:
list
}
)
}
,
handleGoodsCheckChange
(
value
,
goodsItem
)
{
console
.
log
(
value
)
const
idsName
=
value
?
'selectedIds'
:
'notSelectedIds'
// this.restGoodsList()
this
.
updateSelectedFlag
({
[
idsName
]:
[
goodsItem
.
id
]
}
)
}
,
updateSelectedFlag
(
list
)
{
this
.
$apis
.
purchaseShopping
.
updateSelectedFlag
(
list
).
then
(
result
=>
{
this
.
getGoodsList
()
}
)
}
,
getGoodsList
()
{
this
.
$apis
.
purchaseShopping
.
listGroupByGoodsType
({
}
)
.
then
(
result
=>
{
// console.log(result)
this
.
goodsList
=
result
.
map
(
item
=>
{
const
upgradeGoodsList
=
item
.
list
.
reduce
((
total
,
cur
,
index
)
=>
{
total
.
push
({
upgradeGoodsName
:
cur
.
upgradeGoods
.
upgradeGoodsName
,
upgradeGoodsId
:
cur
.
upgradeGoodsId
,
selectedFlag
:
cur
.
selectedFlag
==
'Y'
,
goodsNumber
:
cur
.
goodsNumber
,
goodsType
:
cur
.
goodsInfo
.
goodsType
,
convertedValue
:
cur
.
goodsInfo
.
convertedValue
,
thumbUrl
:
cur
.
goodsInfo
.
thumbUrl
,
purchasePrice
:
cur
.
upgradeGoods
.
purchasePrice
,
id
:
cur
.
id
}
)
return
total
}
,
[])
return
{
goodsType
:
item
.
goodsType
,
goodsTypeName
:
item
.
gooodsTypeName
,
upgradeGoodsList
// isIndeterminate: length > 1 && isIndeterminate
}
}
)
this
.
restGoodsList
()
}
)
.
catch
(
err
=>
{
console
.
log
(
err
)
}
)
}
,
restGoodsList
()
{
let
checkoutFlag
=
true
let
totalPrice
=
0
let
goodsSelectTotalNumber
=
0
let
goodsTotalNumber
=
0
let
isIndeterminate
=
false
console
.
log
(
'this.goodsList'
,
this
.
goodsList
)
// debugger
this
.
goodsList
=
this
.
goodsList
.
map
(
item
=>
{
const
length
=
item
.
upgradeGoodsList
.
length
let
typeIsIndeterminate
=
false
item
.
goodsTypeCheckout
=
item
.
upgradeGoodsList
.
every
(
goodsItem
=>
goodsItem
.
selectedFlag
)
item
.
upgradeGoodsList
.
forEach
(
goodsItem
=>
{
// if (goodsItem.selectedFlag == 'Y') isIndeterminate = true
console
.
log
(
goodsItem
,
'goodsItem'
)
goodsTotalNumber
+=
1
if
(
goodsItem
.
selectedFlag
)
{
// debugger
typeIsIndeterminate
=
true
isIndeterminate
=
true
goodsSelectTotalNumber
+=
1
totalPrice
+=
goodsItem
.
goodsNumber
*
goodsItem
.
purchasePrice
}
return
goodsItem
.
selectedFlag
}
)
// if (item.goodsTypeCheckout)
if
(
!
item
.
goodsTypeCheckout
)
{
checkoutFlag
=
false
}
item
.
isIndeterminate
=
length
>
1
&&
!
item
.
goodsTypeCheckout
&&
typeIsIndeterminate
return
item
}
)
// 只有有一个选中并且不是全选状态
console
.
log
(
isIndeterminate
)
this
.
isIndeterminate
=
checkoutFlag
?
false
:
isIndeterminate
this
.
goodsSelectTotalNumber
=
goodsSelectTotalNumber
this
.
goodsTotalNumber
=
goodsTotalNumber
this
.
isAllCheck
=
checkoutFlag
this
.
totalPrice
=
totalPrice
}
,
handleGoodsNumChange
(
goodsNumber
,
upgradeGoodsId
)
{
goodsNumber
=
parseInt
(
goodsNumber
)
goodsNumber
=
limitPrice
(
goodsNumber
,
1
,
6
,
2
)
this
.
$apis
.
purchaseShopping
.
shoppingCarUpdateNumber
({
upgradeGoodsId
,
goodsNumber
}
)
.
then
(
result
=>
{
this
.
getGoodsList
()
}
)
.
catch
(
err
=>
{
console
.
log
(
err
)
}
)
}
}
}
<
/script
>
<
style
lang
=
"scss"
scoped
>
ul
,
li
{
padding
:
0
;
margin
:
0
;
list
-
style
:
none
;
}
.
shoppingCartDrawerCon
{
box
-
sizing
:
border
-
box
;
margin
-
top
:
20
vh
;
font
-
size
:
14
px
;
::
v
-
deep
.
el
-
drawer__header
{
color
:
#
333333
;
border
-
bottom
:
1
px
solid
#
e7eaec
;
margin
-
bottom
:
0
px
;
padding
-
bottom
:
10
px
;
font
-
weight
:
600
;
font
-
size
:
20
px
;
}
::
v
-
deep
.
el
-
drawer__body
{
box
-
sizing
:
border
-
box
;
overflow
:
scroll
;
padding
:
20
px
20
px
65
px
;
// padding: 0px;
// padding-bottom: 50px;
// // padding-bottom: 300px;
// ::v-deep .el-drawer.rtl
{
// padding-bottom: 50px;
//
}
}
// padding-bottom: 300px;
// ::v-deep .el-drawer.rtl
{
// padding-bottom: 50px;
//
}
}
.
totalCon
{
position
:
absolute
;
bottom
:
0
;
left
:
0
;
display
:
flex
;
align
-
items
:
center
;
width
:
100
%
;
border
-
top
:
1
px
solid
#
e7eaec
;
color
:
#
333333
;
padding
:
20
px
20
px
;
font
-
size
:
14
px
;
background
-
color
:
#
fff
;
z
-
index
:
1
;
.
num
{
margin
-
left
:
3
px
;
font
-
size
:
20
px
;
font
-
weight
:
600
;
color
:
#
ee3040
;
}
.
submitBtn
{
margin
-
left
:
auto
;
}
}
::
v
-
deep
.
carBtnCon
{
// position: absolute;
position
:
fixed
;
top
:
30
vh
;
right
:
2
vw
;
display
:
flex
;
flex
-
direction
:
column
;
align
-
items
:
center
;
padding
:
32
px
12
px
;
z
-
index
:
2
;
// width: 52px;
// height: 158px;
box
-
sizing
:
border
-
box
;
&
::
after
{
// content: "123";
content
:
attr
(
data
-
attr
);
box
-
sizing
:
border
-
box
;
position
:
absolute
;
// right: 7px;
top
:
30
px
;
left
:
30
px
;
display
:
block
;
height
:
14
px
;
border
-
radius
:
7
px
;
padding
:
1
px
4
px
0
;
color
:
#
185
efe
;
background
:
#
ffffff
;
// width: 100%;
// height: 100%;
// background: url(../assets/img/car.png) no-repeat;
// background-size: 100% 100%;
}
.
carIcon
{
width
:
30
px
;
height
:
30
px
;
background
-
position
:
1
px
0
;
margin
:
0
;
}
// cursor: pointer;
span
{
// writing-mode: vertical-lr;
writing
-
mode
:
vertical
-
lr
;
}
}
.
headerCon
{
display
:
flex
;
align
-
items
:
center
;
justify
-
content
:
space
-
between
;
color
:
#
666
;
margin
-
bottom
:
10
px
;
.
left
{
display
:
flex
;
align
-
items
:
center
;
}
.
red
{
color
:
#
ee3040
;
}
}
.
goodsTypeCon
{
display
:
flex
;
flex
-
direction
:
column
;
width
:
100
%
;
margin
-
bottom
:
20
px
;
background
:
#
f9f9f9
;
color
:
#
666
;
.
itemHeader
{
display
:
flex
;
align
-
items
:
center
;
padding
:
12
px
19
px
;
border
-
bottom
:
1
px
solid
#
e7e7e7
;
}
}
.
goodsCon
{
box
-
sizing
:
border
-
box
;
display
:
flex
;
align
-
items
:
center
;
padding
:
16
px
;
padding
-
right
:
20
px
;
margin
-
top
:
16
px
;
&
:
nth
-
last
-
child
(
1
)
{
margin
-
bottom
:
16
px
;
}
.
itemInfo
{
display
:
flex
;
flex
:
1
;
width
:
501
px
;
height
:
104
px
;
margin
-
left
:
5
px
;
background
:
#
ffffff
;
border
-
radius
:
2
px
;
.
imgCon
{
width
:
104
px
;
height
:
104
px
;
overflow
:
hidden
;
border
-
radius
:
2
px
;
img
{
width
:
100
%
;
height
:
100
%
;
object
-
fit
:
cover
;
}
}
.
right
{
position
:
relative
;
box
-
sizing
:
border
-
box
;
display
:
flex
;
flex
-
direction
:
column
;
padding
:
8
px
17
px
11
px
;
.
name
{
font
-
weight
:
600
;
font
-
size
:
14
px
;
color
:
#
333333
;
}
.
price
{
display
:
flex
;
align
-
items
:
center
;
font
-
weight
:
600
;
font
-
size
:
18
px
;
color
:
#
ee3040
;
margin
:
4
px
0
8
px
;
.
label
{
font
-
size
:
12
px
;
font
-
weight
:
normal
;
color
:
#
666666
;
}
}
.
num
{
font
-
size
:
12
px
;
color
:
#
666666
;
.
numInput
{
margin
-
right
:
4
px
;
}
}
.
deleteIcon
{
position
:
absolute
;
right
:
-
20
px
;
top
:
50
%
;
transform
:
translateX
(
-
50
%
);
}
}
}
}
.
addressDialog
{
.
title
{
text
-
align
:
center
;
font
-
size
:
20
px
;
color
:
#
f8ba37
;
}
.
tips
{
display
:
flex
;
justify
-
content
:
space
-
between
;
}
.
info
{
padding
:
15
px
20
px
;
box
-
shadow
:
0
px
0
px
5
px
0
px
rgba
(
136
,
152
,
157
,
0.3
);
}
.
item
{
margin
-
bottom
:
15
px
;
}
.
label
{
display
:
inline
-
block
;
width
:
100
px
;
text
-
align
:
right
;
margin
-
right
:
10
px
;
}
}
<
/style
>
src/views/purchaseOrder/index.vue
View file @
5999eb0
...
...
@@ -369,5 +369,6 @@ export default {
@include
dot;
background
:
$
color-gray
;
}
}
</
style
>
Write
Preview
Markdown
is supported
Attach a file
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 post a comment