Commit 94d94080 by 前端

Merge branch 'SAAS+V4.41.1' into 'master'

上线合并

See merge request !12
2 parents 308b687c bce1ea18
...@@ -234,11 +234,17 @@ export function checkShipper(params) { ...@@ -234,11 +234,17 @@ export function checkShipper(params) {
returnAll: true returnAll: true
}) })
} }
// 确认发货 // 根据产品id获取产品、规格列表、升级商品详情
// export function purchaseOrderConfirmDelivery(data) { export function getByIdWithSpecification(params) {
// params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale` params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
// data.routerMethod = `${path}purchaseOrder.confirmDelivery` params.routerMethod = `dj.api.goodsinfo.getByIdWithSpecification`
// return http(data) return http({
// } url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
export default { checkShipper, get4SRefByYqShopList, selectByOrderCode, purchaseOrderDelete, getManageMode, getMerchantList, purchaseOrderPutIn, exportExcel, shoppingCarUpdateNumber, purchaseOrderAdd, shoppingCarAdd, shoppingCarRemove, updateSelectedFlag, listGroupByGoodsType, getPurchaseOrderList, purchaseOrderCancelOrCheck, purchaseOrderDetail, listWithPagePurchaseInfo, addressGet, addressSave } export default { checkShipper, get4SRefByYqShopList, selectByOrderCode, purchaseOrderDelete, getManageMode, getMerchantList, purchaseOrderPutIn, exportExcel, shoppingCarUpdateNumber, purchaseOrderAdd, shoppingCarAdd, shoppingCarRemove, updateSelectedFlag, listGroupByGoodsType, getPurchaseOrderList, purchaseOrderCancelOrCheck, purchaseOrderDetail, listWithPagePurchaseInfo, addressGet, addressSave, getByIdWithSpecification }
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<div class="detail-info"> <div class="detail-info">
<div> <div>
商品名称: 商品名称:
<span>{{ item.upgradeGoodsName }}</span> <span>{{ item.upgradeGoodsName }}&nbsp;&nbsp;&nbsp;&nbsp; {{detailInfo.specificationData}}</span>
</div> </div>
<div> <div>
发货数量: 发货数量:
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<div class="detail-info"> <div class="detail-info">
<div> <div>
商品名称: 商品名称:
<span>{{ detailInfo.upgradeGoodsName }}</span> <span>{{ detailInfo.upgradeGoodsName }}&nbsp;&nbsp; {{detailInfo.specificationData}}</span>
</div> </div>
<div> <div>
发货数量: 发货数量:
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<GLTable ref="orderRef" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun"> <GLTable ref="orderRef" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<template slot="putStatus" slot-scope="scope"> <template slot="putStatus" slot-scope="scope">
<div> <div>
<span :class="[scope.scope.putStatus == 1 ? 'ashSpot' :scope.scope.putStatus == 2? 'greenSpot':'yellowSpot']"></span> <span :class="[scope.scope.putStatus == 1 ? 'ashSpot' : scope.scope.putStatus == 2 ? 'greenSpot' : 'yellowSpot']"></span>
<span>{{ scope.scope.putStatus | puStatus }}</span> <span>{{ scope.scope.putStatus | puStatus }}</span>
</div> </div>
</template> </template>
...@@ -180,6 +180,11 @@ export default { ...@@ -180,6 +180,11 @@ export default {
prop: 'type' prop: 'type'
}, },
{ {
label: '规格',
prop: 'specificationData',
width: 100
},
{
label: '系列', label: '系列',
prop: 'goodsName' prop: 'goodsName'
}, },
......
...@@ -20,7 +20,23 @@ ...@@ -20,7 +20,23 @@
</span> </span>
</div> </div>
<div class="productCode" v-if="goodsInfo.upgradeGoodsList && goodsInfo.upgradeGoodsList.length > 0">商品编码:{{ goodsInfo.upgradeGoodsList[selectIndex].type }}</div> <div class="productCode" v-if="goodsInfo.upgradeGoodsList && goodsInfo.upgradeGoodsList.length > 0">商品编码:{{ goodsInfo.upgradeGoodsList[selectIndex].type }}</div>
<div class="skuCon">
<!--选择商品规格 v-if="!isSkuArguments"-->
<div class="content fix-header fix-bottom" v-if="goodsInfo.specificationType == 2">
<div class="mask">
<div class="mask-content">
<div class="spec-items">
<div class="spec-menu-item js-spec-menu skuCon" v-for="(item, index) in goodsTypeList" :key="item.id">
<div class="spec-note label">{{ item.name }}:</div>
<div class="spec-choices">
<span v-for="(el, i) in item.propertyList" :key="el.id" class="spec-nor skuItem one-line-ellipsis pointer" :class="{ active: el.selected, disabled: el.disabled }" @click="handleClickSpecs1(item.id, el.id, el, index, i)">{{ el.name }}</span>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="skuCon" v-if="goodsInfo.specificationType == 1">
<div class="label">规格:</div> <div class="label">规格:</div>
<div class="itemCon"> <div class="itemCon">
<div <div
...@@ -70,6 +86,442 @@ ...@@ -70,6 +86,442 @@
</template> </template>
<script> <script>
let orgdata = {
skus: [
{
id: 'f5eee18b8d5b4fc2b46a56e92abdb525',
stockAmmount: 7,
isPaymentAccpoints: 1,
isPaymentCurrency: 0,
isPaymentMixed: 0,
priceAccpoints: 1,
priceCurrency: 0,
mixedPriceAccpoints: 0,
mixedPriceCurrency: 0,
rebate: 100,
skusTypes: [
{
id: '74fe546803e44a7c95bebfe56a29952d',
typeId: '21967fba6b574b479974e50720ad25fe',
typeName: '测试类别',
type: 2,
propertyId: 'f40c3884e5e9422c973d31631a65ae64',
propertyName: '小',
property: 1
},
{
id: '78f98ee53ae549ceb2c18629152ff849',
typeId: 'fe7f49a798794670be622e6b9d2f386a',
typeName: 'tester',
type: 3,
propertyId: '02808ac287e8410f936a90167d82ee2b',
propertyName: 'two',
property: 2
},
{
id: '91cefe600f40498bb5013deebb9c27be',
typeId: '547f76222d4d4f92a49de2e0bf6bd7ef',
typeName: '颜色',
type: 1,
propertyId: 'c80cbe4c6cbf49f5b2822331768cd422',
propertyName: '绿色',
property: 2
}
]
},
{
id: '383feb7947f14ce5b832bc8700e65c9e',
stockAmmount: 2,
isPaymentAccpoints: 1,
isPaymentCurrency: 0,
isPaymentMixed: 0,
priceAccpoints: 1,
priceCurrency: 0,
mixedPriceAccpoints: 0,
mixedPriceCurrency: 0,
rebate: 100,
skusTypes: [
{
id: '1beed60c2eb244f89ad82806d343d468',
typeId: 'fe7f49a798794670be622e6b9d2f386a',
typeName: 'tester',
type: 3,
propertyId: '02808ac287e8410f936a90167d82ee2b',
propertyName: 'two',
property: 2
},
{
id: '357fd7db1f5244e5b64f48a34bb581fa',
typeId: '21967fba6b574b479974e50720ad25fe',
typeName: '测试类别',
type: 2,
propertyId: 'edac997ed2c54e41b1f3076fbd6e19f9',
propertyName: '中',
property: 2
},
{
id: '5c29a251e55a4b678fc4f8287cc560b5',
typeId: '547f76222d4d4f92a49de2e0bf6bd7ef',
typeName: '颜色',
type: 1,
propertyId: 'c80cbe4c6cbf49f5b2822331768cd422',
propertyName: '绿色',
property: 2
}
]
},
{
id: '905b10e1740e4be992d14cfc23a887a2',
stockAmmount: 4,
isPaymentAccpoints: 1,
isPaymentCurrency: 0,
isPaymentMixed: 0,
priceAccpoints: 1,
priceCurrency: 0,
mixedPriceAccpoints: 0,
mixedPriceCurrency: 0,
rebate: 100,
skusTypes: [
{
id: '0a5f93d9ef1c486ba369dcb1fbd3aed9',
typeId: 'fe7f49a798794670be622e6b9d2f386a',
typeName: 'tester',
type: 3,
propertyId: 'c76dc797eaae4d8eb360de8811a9ec7a',
propertyName: 'one',
property: 1
},
{
id: 'd920730c34644218b3d0bbc5fca5edf4',
typeId: '21967fba6b574b479974e50720ad25fe',
typeName: '测试类别',
type: 2,
propertyId: 'f40c3884e5e9422c973d31631a65ae64',
propertyName: '小',
property: 1
},
{
id: '2afbe8a77d034de0a1655f9ad1a25b95',
typeId: '547f76222d4d4f92a49de2e0bf6bd7ef',
typeName: '颜色',
type: 1,
propertyId: 'c80cbe4c6cbf49f5b2822331768cd422',
propertyName: '绿色',
property: 2
}
]
},
{
id: 'a440b0084e564d3e9d7c8b445bb7645e',
stockAmmount: 10,
isPaymentAccpoints: 1,
isPaymentCurrency: 0,
isPaymentMixed: 0,
priceAccpoints: 1,
priceCurrency: 0,
mixedPriceAccpoints: 0,
mixedPriceCurrency: 0,
rebate: 100,
skusTypes: [
{
id: '12a4715b6730438888e88f302871245a',
typeId: '21967fba6b574b479974e50720ad25fe',
typeName: '测试类别',
type: 2,
propertyId: 'f40c3884e5e9422c973d31631a65ae64',
propertyName: '小',
property: 1
},
{
id: '9063e1f1586f4a74b2f614039e8743c4',
typeId: '547f76222d4d4f92a49de2e0bf6bd7ef',
typeName: '颜色',
type: 1,
propertyId: 'c80cbe4c6cbf49f5b2822331768cd422',
propertyName: '绿色',
property: 2
},
{
id: 'ae38b9cf56d5408a809d6fbd1b902ee5',
typeId: 'fe7f49a798794670be622e6b9d2f386a',
typeName: 'tester',
type: 3,
propertyId: 'd5660085ff8743d999f6ed3a497ec8b7',
propertyName: 'three',
property: 3
}
]
},
{
id: '9961364cc3494823aaf7699733393335',
stockAmmount: 15,
isPaymentAccpoints: 1,
isPaymentCurrency: 0,
isPaymentMixed: 0,
priceAccpoints: 1,
priceCurrency: 0,
mixedPriceAccpoints: 0,
mixedPriceCurrency: 0,
rebate: 100,
skusTypes: [
{
id: '3335920f79914cfb8a39ae22b0802bc0',
typeId: 'fe7f49a798794670be622e6b9d2f386a',
typeName: 'tester',
type: 3,
propertyId: 'c76dc797eaae4d8eb360de8811a9ec7a',
propertyName: 'one',
property: 1
},
{
id: '34950de7059d4fffac485abb59a79381',
typeId: '21967fba6b574b479974e50720ad25fe',
typeName: '测试类别',
type: 2,
propertyId: 'edac997ed2c54e41b1f3076fbd6e19f9',
propertyName: '中',
property: 2
},
{
id: 'a82ff8d74d3d4a1ea454e4870cc68b64',
typeId: '547f76222d4d4f92a49de2e0bf6bd7ef',
typeName: '颜色',
type: 1,
propertyId: 'c80cbe4c6cbf49f5b2822331768cd422',
propertyName: '绿色',
property: 2
}
]
},
{
id: 'bd3aeb3c7c854a80b88e7f82a5a78a1e',
stockAmmount: 8,
isPaymentAccpoints: 1,
isPaymentCurrency: 0,
isPaymentMixed: 0,
priceAccpoints: 1,
priceCurrency: 0,
mixedPriceAccpoints: 0,
mixedPriceCurrency: 0,
rebate: 100,
skusTypes: [
{
id: '4fc8e61aa192463085578de92974b18b',
typeId: '21967fba6b574b479974e50720ad25fe',
typeName: '测试类别',
type: 2,
propertyId: 'edac997ed2c54e41b1f3076fbd6e19f9',
propertyName: '中',
property: 2
},
{
id: '884f32b64a4b478bb01f93b40dfeb6fc',
typeId: '547f76222d4d4f92a49de2e0bf6bd7ef',
typeName: '颜色',
type: 1,
propertyId: 'c80cbe4c6cbf49f5b2822331768cd422',
propertyName: '绿色',
property: 2
},
{
id: 'f66109eccd934529a18026376fccfa7b',
typeId: 'fe7f49a798794670be622e6b9d2f386a',
typeName: 'tester',
type: 3,
propertyId: 'd5660085ff8743d999f6ed3a497ec8b7',
propertyName: 'three',
property: 3
}
]
},
{
id: '5e094973bbaf41ce81b7b626174b0bbf',
stockAmmount: 8,
isPaymentAccpoints: 1,
isPaymentCurrency: 0,
isPaymentMixed: 0,
priceAccpoints: 1,
priceCurrency: 0,
mixedPriceAccpoints: 0,
mixedPriceCurrency: 0,
rebate: 100,
skusTypes: [
{
id: '23d688678aaa42eebd3c04cceaa61bac',
typeId: '547f76222d4d4f92a49de2e0bf6bd7ef',
typeName: '颜色',
type: 1,
propertyId: '8ed34030c93c4dc29e43edb95e6cfca2',
propertyName: '橙色',
property: 1
},
{
id: '55649f0753464921b68b0017ce0010d7',
typeId: '21967fba6b574b479974e50720ad25fe',
typeName: '测试类别',
type: 2,
propertyId: '408fb530344a4a41b33932431638dcbb',
propertyName: '大',
property: 3
},
{
id: 'd7248b12b7e847ca9be024ed3bb6d101',
typeId: 'fe7f49a798794670be622e6b9d2f386a',
typeName: 'tester',
type: 3,
propertyId: 'd5660085ff8743d999f6ed3a497ec8b7',
propertyName: 'three',
property: 3
}
]
},
{
id: '60ce0a1f99e940dc82d041d36681111b',
stockAmmount: 9,
isPaymentAccpoints: 1,
isPaymentCurrency: 0,
isPaymentMixed: 0,
priceAccpoints: 1,
priceCurrency: 0,
mixedPriceAccpoints: 0,
mixedPriceCurrency: 0,
rebate: 100,
skusTypes: [
{
id: '91faddf91e944cabadbda5c342430139',
typeId: '547f76222d4d4f92a49de2e0bf6bd7ef',
typeName: '颜色',
type: 1,
propertyId: 'c80cbe4c6cbf49f5b2822331768cd422',
propertyName: '绿色',
property: 2
},
{
id: '207698d97e4247bb9747843d16e25750',
typeId: '21967fba6b574b479974e50720ad25fe',
typeName: '测试类别',
type: 2,
propertyId: '408fb530344a4a41b33932431638dcbb',
propertyName: '大',
property: 3
},
{
id: '3c69d3c73aa24cccbacaf805d71117fd',
typeId: 'fe7f49a798794670be622e6b9d2f386a',
typeName: 'tester',
type: 3,
propertyId: 'd5660085ff8743d999f6ed3a497ec8b7',
propertyName: 'three',
property: 3
}
]
},
{
id: 'f3c805d1959d413a86679955ae047ec5',
stockAmmount: 10,
isPaymentAccpoints: 1,
isPaymentCurrency: 0,
isPaymentMixed: 0,
priceAccpoints: 1,
priceCurrency: 0,
mixedPriceAccpoints: 0,
mixedPriceCurrency: 0,
rebate: 100,
skusTypes: [
{
id: '00113d4b6046411cb8ff935b2743904b',
typeId: 'fe7f49a798794670be622e6b9d2f386a',
typeName: 'tester',
type: 3,
propertyId: '02808ac287e8410f936a90167d82ee2b',
propertyName: 'two',
property: 2
},
{
id: 'c13d8a4c7a18477fbe7027044d0393a0',
typeId: '547f76222d4d4f92a49de2e0bf6bd7ef',
typeName: '颜色',
type: 1,
propertyId: 'c80cbe4c6cbf49f5b2822331768cd422',
propertyName: '绿色',
property: 2
},
{
id: '653d0e243bab45eaa5c83dc8206ee33e',
typeId: '21967fba6b574b479974e50720ad25fe',
typeName: '测试类别',
type: 2,
propertyId: '408fb530344a4a41b33932431638dcbb',
propertyName: '大',
property: 3
}
]
}
]
}
let goodType = [
{
id: '547f76222d4d4f92a49de2e0bf6bd7ef',
type: 1,
name: '颜色',
propertyList: [
{
id: '8ed34030c93c4dc29e43edb95e6cfca2',
property: 1,
name: '橙色'
},
{
id: 'c80cbe4c6cbf49f5b2822331768cd422',
property: 2,
name: '绿色'
}
]
},
{
id: '21967fba6b574b479974e50720ad25fe',
type: 2,
name: '测试类别',
propertyList: [
{
id: 'f40c3884e5e9422c973d31631a65ae64',
property: 1,
name: '小'
},
{
id: 'edac997ed2c54e41b1f3076fbd6e19f9',
property: 2,
name: '中'
},
{
id: '408fb530344a4a41b33932431638dcbb',
property: 3,
name: '大'
}
]
},
{
id: 'fe7f49a798794670be622e6b9d2f386a',
type: 3,
name: 'tester',
propertyList: [
{
id: 'c76dc797eaae4d8eb360de8811a9ec7a',
property: 1,
name: 'one'
},
{
id: '02808ac287e8410f936a90167d82ee2b',
property: 2,
name: 'two'
},
{
id: 'd5660085ff8743d999f6ed3a497ec8b7',
property: 3,
name: 'three'
}
]
}
]
import { membraneTypeList } from '@/utils/constants.js' import { membraneTypeList } from '@/utils/constants.js'
export default { export default {
name: 'GoodsDetailCom', name: 'GoodsDetailCom',
...@@ -91,7 +543,16 @@ export default { ...@@ -91,7 +543,16 @@ export default {
data() { data() {
return { return {
// dialogShow: false, // maskVisible: true,
isSkuArguments: true,
skuList: [],
lastCheckedSku: {}, // 选中的sku信息
buyNumber: 1, // 购买数量
sku: null,
currentSkuList: [],
valueIdSortAndIndex: [],
goodsTypeList: [],
selectItemList: [],
membraneTypeList, membraneTypeList,
goodsInfo: {}, goodsInfo: {},
selectIndex: 0, selectIndex: 0,
...@@ -131,17 +592,6 @@ export default { ...@@ -131,17 +592,6 @@ export default {
this.$emit('update:visible', 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: { watch: {
visible(val) { visible(val) {
...@@ -151,17 +601,255 @@ export default { ...@@ -151,17 +601,255 @@ export default {
} }
} }
}, },
mounted() {
this.getGoodsDetail()
},
methods: { methods: {
init() {
let valueIdSortAndIndex = []
let currentSkuList = orgdata.skus.map((item, index) => {
let valueIdSort = []
item.skusTypes.map(skusTypesItem => {
valueIdSort.push(skusTypesItem.propertyId)
})
/*
将sku规格值的ID,即 propertyId,组成一个数组并且字典排序,以及将该sku所对应的index存入数组,供点击后查询sku*/
valueIdSortAndIndex.push({ valueIdSort: valueIdSort.sort() })
return item.skusTypes
})
this.$set(this.$data, 'currentSkuList', currentSkuList)
this.$set(this.$data, 'valueIdSortAndIndex', valueIdSortAndIndex)
},
isContained(aa, bb) {
//判断aa数组是否 全 包含bb数组
if (!(aa instanceof Array) || !(bb instanceof Array) || aa.length < bb.length) {
return false
}
let aaStr = aa.toString()
for (var i = 0; i < bb.length; i++) {
if (aaStr.indexOf(bb[i]) < 0) {
return false
}
}
return true
},
// 获取所有的规格
getShopGoodsType() {
// goodType 为接口返回数据
goodType.forEach(items => {
items.propertyList.forEach(item => {
item.selected = item.selected || false
item.disabled = true
})
})
this.goodsTypeList = goodType
},
// 初始化 判断 是否有库存
initGoodType() {
let currentSkuList = this.currentSkuList.flat(Infinity)
this.goodsTypeList.forEach(items => {
items.propertyList.forEach(item => {
for (var i = 0; i < currentSkuList.length; i++) {
if (item.id == currentSkuList[i].propertyId) {
// console.log('item.id', item.id, currentSkuList[i])
item.disabled = false
break
}
}
})
})
},
// 选择每个规格,判断对应的库存
handleClickSpecs1(grounpId, id, el, index, i) {
console.log('handleClickSpecs1', grounpId, id, el, index, i)
let selectItemList = this.selectItemList // 已选规格
if (el.disabled) {
return
}
// 处理selected的逻辑
if (!el.selected) {
this.goodsTypeList[index].propertyList.forEach(item => {
item.selected = false
})
this.goodsTypeList[index].propertyList[i].selected = true
// 选中项中有同组元素,替换
selectItemList.forEach((item, x_selected_index) => {
if (item.index === index) {
selectItemList.splice(x_selected_index, 1)
}
})
selectItemList.push({ grounpId, id, index, i })
} else {
// 取消选中并删除选中项中数据
this.goodsTypeList[index].propertyList[i].selected = false
selectItemList.forEach((item, x_selected_index) => {
if (item.id === id && item.grounpId === grounpId) {
selectItemList.splice(x_selected_index, 1)
}
})
}
console.log('selectItemList', selectItemList)
this.$set(this.$data, 'selectItemList', selectItemList)
if (selectItemList.length == this.goodsTypeList.length) {
let selectId = selectItemList
.map(item => item.id)
.sort()
.join('')
console.log(selectId)
let skusItem = orgdata.skus.find(item => {
console.log(item)
return item.skuId == selectId
})
console.log(skusItem, 'skusItem')
this.handleItemInfo.purchasePrice = skusItem.purchasePrice
} else {
this.handleItemInfo.purchasePrice = ''
}
// 取出组ID
let x_selected_grounpIds = []
selectItemList.forEach(item => {
x_selected_grounpIds.push(item.grounpId)
})
// 处理disabled的逻辑
if (selectItemList.length == 0) {
// 选中属性为空,重新初始化数据
this.initGoodType()
} else {
//拿所有规格属性(即goodsTypeList)的每一项分别与已选中的数据(即selectItemList)的每一项,组成一个比较项,与现有库存比较,找到存在的可点项
this.goodsTypeList.forEach((goodsType, goodsTypeIndex) => {
goodsType.propertyList.forEach((prop, propIndex) => {
if (!prop.selected) {
prop.disabled = true
}
// 本次循环数据
let push_data = { grounpId: goodsType.id, id: prop.id, index: goodsTypeIndex, i: propIndex }
if (x_selected_grounpIds.indexOf(goodsType.id) > -1) {
// 当前循环的规格的组ID在已选规格中,删除同组规格,用当前规格替换后去与库存比较
let sel = selectItemList.slice() // 用一个新变量接受数据,防止修改源数据
let index_splice = x_selected_grounpIds.indexOf(goodsType.id)
sel.splice(index_splice, 1, push_data)
this.optionsHandle(sel, push_data)
} else {
// 当前循环规格组ID不在已选规格中,添加当前规格到复制出来的已选数组中,循环比较
let sel = selectItemList.slice()
sel.push(push_data)
this.optionsHandle(sel, push_data)
}
})
})
}
},
optionsHandle(selArr, push_data) {
let propertyIds = []
// 将当前比较项的属性ID提取
selArr.map(item => {
propertyIds.push(item.id)
})
// 在现有库存中查找是否有可选项,可选的置为可点击
this.valueIdSortAndIndex.map(item => {
if (this.isContained(item.valueIdSort, propertyIds)) {
this.goodsTypeList[push_data.index].propertyList[push_data.i].disabled = false
}
})
},
getGoodsDetail() { getGoodsDetail() {
this.$apis.product.getProductInfo({ id: this.goodsId }).then(res => { // this.$apis.purchaseShopping.getByIdWithSpecification({ id: this.goodsId || 677 }).then(res => {
this.goodsInfo = res this.$apis.purchaseShopping.getByIdWithSpecification({ id: this.goodsId }).then(res => {
this.tableInfo = res.upgradeGoodsList.merchantGoodsInfoList // goodsSpecificationNameList 商品
// for (let index = 0; index < 12; index++) { res = res.data
// this.goodsInfo.upgradeGoodsList[index] = this.goodsInfo.upgradeGoodsList[0] console.log(res, 'res')
// }
if (res.specificationType == 2) {
this.handleItemInfo.purchasePrice = res.upgradeGoodsSpecificationValueDTOS[0].purchasePrice
// console.log(this.handleItemInfo)
// console.log(res, 'res')
goodType = res.goodsSpecificationNameList.map((item, index) => {
item.name = item.specificationName
item.propertyList = item.goodsSpecificationValueList.map((el, elIndex) => {
el.name = el.specificationValue
el.index = elIndex
// el.id = el.specificationValue
el.id = index.toString() + elIndex.toString()
return el
})
return item
})
console.log(goodType, 'goodType')
this.selectItemList = []
orgdata.skus = res.upgradeGoodsSpecificationValueDTOS.map((item, index) => {
item.skuId = ''
item.skusTypes = item.specificationValues.map((el, elIndex) => {
let skuItem = goodType[elIndex].propertyList.find((skuItem, skuItemIndex) => {
// console.log(skuItem.name == el, skuItem.name, el)
// 取第一个默认选中
if (skuItem.name == el && index == 0) {
// if (skuItem.name == el && index == res.upgradeGoodsSpecificationValueDTOS.length - 1) {
// goodType[elIndex].propertyList[skuItemIndex].selected = true
// // // 记录选中的值
// this.selectItemList.push({
// grounpId: goodType[elIndex].id,
// id: skuItem.id,
// index: elIndex,
// i: skuItemIndex
// })
// setTimeout(() => {
// console.log(item.id, item)
// // this.handleClickSpecs1(el, skuItem.id, skuItem, index, skuItemIndex)
// // goodType[elIndex].propertyList[skuItemIndex].selected = true
// // // 记录选中的值
// // this.selectItemList.push({
// // grounpId: goodType[elIndex].id,
// // id: skuItem.id,
// // index: elIndex,
// // i: skuItemIndex
// // })
// }, 0)
}
return skuItem.name == el
})
let obj = {
propertyId: skuItem.id,
propertyName: el,
index: skuItem.index
}
item.skuId += skuItem.id
return obj
})
return item
})
// console.log(this.selectItemList, ' this.selectItemList')
// console.log(goodType, 'goodType')
// console.log(orgdata, 'orgdata')
// return
// 初始化
this.init()
// 获取所有的规格
this.getShopGoodsType()
this.initGoodType()
// 默认选中 第一个选项
// console.log(orgdata.skus[0], this.goodsTypeList)
let norSelectSkus = orgdata.skus[0]
this.goodsTypeList.forEach((item, index) => {
let sku = norSelectSkus.skusTypes[index]
this.handleClickSpecs1(item.id, sku.propertyId, sku, index, sku.index)
})
} else {
// 默认选中第一个 // 默认选中第一个
let item = this.goodsInfo.upgradeGoodsList[0] let item = this.goodsInfo.upgradeGoodsList[0]
this.setHandleItemInfo(item) this.setHandleItemInfo(item)
}
this.goodsInfo = res
this.tableInfo = res?.upgradeGoodsList?.merchantGoodsInfoList
}) })
}, },
setHandleItemInfo(item = {}) { setHandleItemInfo(item = {}) {
...@@ -176,7 +864,41 @@ export default { ...@@ -176,7 +864,41 @@ export default {
this.dialogShow = false this.dialogShow = false
}, },
updateCarShopping() { updateCarShopping() {
const params = { let params = {}
if (this.goodsInfo.specificationType == 2) {
// 是多规格就要所有属性都选中
let flag = false
let selectId = this.goodsTypeList.reduce((pre, item, index) => {
let value = item.propertyList.find(el => el.selected)
console.log(value, 'value')
// 有一行没有选中 抛错
if (!value) {
flag = true
} else {
pre += value.id
}
return pre
}, '')
if (flag) {
return this.$message.error('请选择规格')
}
// this.goodsInfo
orgdata.skus.find(item => {
console.log(item, item.skuId, selectId)
if (item.skuId == selectId) {
// this.handleItemInfo.goodsNumber = item.goodsNumber
// this.handleItemInfo.upgradeGoodsId = item.id
params = {
goodsNumber: this.handleItemInfo.goodsNumber,
upgradeGoodsId: item.upgradeGoodsId
}
}
})
// console.log(para)
console.log(selectId, params, 'selectId')
} else {
params = {
goodsNumber: this.handleItemInfo.goodsNumber, goodsNumber: this.handleItemInfo.goodsNumber,
upgradeGoodsId: this.handleItemInfo.upgradeGoodsId upgradeGoodsId: this.handleItemInfo.upgradeGoodsId
} }
...@@ -184,9 +906,12 @@ export default { ...@@ -184,9 +906,12 @@ export default {
this.$message.error('商品不存在') this.$message.error('商品不存在')
return return
} }
}
// 判断是否有值 // 判断是否有值
params.upgradeGoodsId && params.upgradeGoodsId &&
this.$apis.purchaseShopping.shoppingCarAdd(params).then(res => { this.$apis.purchaseShopping.shoppingCarAdd(params).then(res => {
console.log(res, 'res')
this.$message.success('加入购物车成功') this.$message.success('加入购物车成功')
this.$EventBus.$emit('updateCarShopping') this.$EventBus.$emit('updateCarShopping')
this.dialogShow = false this.dialogShow = false
...@@ -265,8 +990,12 @@ export default { ...@@ -265,8 +990,12 @@ export default {
flex-wrap: wrap; flex-wrap: wrap;
justify-content: space-between; justify-content: space-between;
} }
.spec-choices {
display: flex;
flex-wrap: wrap;
}
.skuItem { .skuItem {
display: inline-block;
box-sizing: border-box; box-sizing: border-box;
min-width: 234px; min-width: 234px;
height: 36px; height: 36px;
...@@ -282,18 +1011,38 @@ export default { ...@@ -282,18 +1011,38 @@ export default {
&.active { &.active {
border: 1px solid #5850ff; border: 1px solid #5850ff;
} }
&.disabled {
border: 1px solid #e5e5e5;
border-radius: 2px;
// background-color: #3d3d3d;
color: #c6c6c6;
}
// .active {
// padding: 2px 4px;
// border: 1px solid #5850ff;
// color: #5850ff;
// background-color: #fff;
// }
}
.spec-nor {
min-width: auto;
margin-right: 15px;
} }
} }
.label { .label {
box-sizing: border-box; box-sizing: border-box;
width: 60px; // width: 60px;
min-width: 90px;
height: 36px; height: 36px;
text-align: center; text-align: left;
padding-left: 18px; padding-left: 18px;
line-height: 36px; line-height: 36px;
color: #666666; color: #666666;
} }
.spec-note {
// width: 120px;
}
} }
} }
...@@ -340,4 +1089,12 @@ export default { ...@@ -340,4 +1089,12 @@ export default {
margin-bottom: 16px; margin-bottom: 16px;
padding-left: 18px; padding-left: 18px;
} }
.spec-menu-item {
display: flex;
// height: 50px;
}
.spec-nor {
// padding: 2px 4px;
// margin-left: 10px;
}
</style> </style>
...@@ -18,6 +18,10 @@ ...@@ -18,6 +18,10 @@
收货地址: 收货地址:
<span class="label">{{ detailInfo.provinceName }}{{ detailInfo.cityName }}{{ detailInfo.areaName }}{{ detailInfo.contactAddress }}</span> <span class="label">{{ detailInfo.provinceName }}{{ detailInfo.cityName }}{{ detailInfo.areaName }}{{ detailInfo.contactAddress }}</span>
</span> </span>
<span class="address" v-if="detailInfo.purchaseOrderRemark">
备注:
<span class="label">{{ detailInfo.purchaseOrderRemark }}</span>
</span>
<span class="address" v-if="detailInfo.rejectCause"> <span class="address" v-if="detailInfo.rejectCause">
驳回原因: 驳回原因:
<span class="label">{{ detailInfo.rejectCause }}</span> <span class="label">{{ detailInfo.rejectCause }}</span>
...@@ -88,6 +92,11 @@ export default { ...@@ -88,6 +92,11 @@ export default {
width: 100 width: 100
}, },
{ {
label: '规格',
prop: 'specificationData',
width: 100
},
{
label: '系列', label: '系列',
prop: 'goodsName', prop: 'goodsName',
width: 100, width: 100,
......
...@@ -42,7 +42,8 @@ ...@@ -42,7 +42,8 @@
<div class="right"> <div class="right">
<div class="name one-line-ellipsis">{{ goodsItem.upgradeGoodsName }}</div> <div class="name one-line-ellipsis">{{ goodsItem.upgradeGoodsName }}</div>
<div class="price"> <div class="price">
<span class="label">商品价格:</span> <!-- v-if="goodsItem.specificationType == 2" .replace(';~;', '/')-->
<span class="label" v-if="goodsItem.specificationType == 2">{{ goodsItem.formatSpecificationData }}</span>
¥{{ goodsItem.purchasePrice }} ¥{{ goodsItem.purchasePrice }}
</div> </div>
<div class="num"> <div class="num">
...@@ -62,11 +63,18 @@ ...@@ -62,11 +63,18 @@
</div> </div>
</el-drawer> </el-drawer>
<GLDialog class="addressDialog" mode="big" bigTitle="结算确认" okText="确定结算" :visible.sync="dialogShow" :close-on-click-modal="false" @onOk="handleSubmit" @onCancel="dialogShow = false"> <GLDialog class="addressDialog" mode="big" bigTitle="结算确认" okText="确定结算" :visible.sync="dialogShow" :close-on-click-modal="false" @onOk="handleSubmit" @onCancel="dialogShow = false">
<h4 class="title">确认要结算订单吗?</h4> <h4 class="title">
<img src="@/images/confirm.png" alt="" class="confirm" />
确认要结算订单吗?
</h4>
<div class="info"> <div class="info">
<p class="tips"> <p class="tips">
<span>请核对收货仓信息:</span> <span>请核对收货仓信息</span>
<el-button type="text" @click="editAddress">修改</el-button> <el-button type="text" @click="editAddress">
<!-- <img src="@/images/edit.png" alt="" /> -->
<img src="@/images/edit.png" alt="" class="editIcon" />
修改
</el-button>
</p> </p>
<ul class="orderInfoCom"> <ul class="orderInfoCom">
<li class="item" v-for="(item, index) in addressInfoList" :key="index"> <li class="item" v-for="(item, index) in addressInfoList" :key="index">
...@@ -76,6 +84,17 @@ ...@@ -76,6 +84,17 @@
</li> </li>
</ul> </ul>
</div> </div>
<div class="info">
<p class="tips">
<span>订单备注</span>
</p>
<div class="item-remark orderInfoCom">
<div class="label">备注:</div>
<div class="item-content">
<el-input show-word-limit type="textarea" maxlength="200" :rows="3" placeholder="备注说明" v-model="remarks"></el-input>
</div>
</div>
</div>
</GLDialog> </GLDialog>
</div> </div>
</template> </template>
...@@ -93,6 +112,7 @@ export default { ...@@ -93,6 +112,7 @@ export default {
}, },
data() { data() {
return { return {
remarks: '',
// addressInfo: {}, // addressInfo: {},
throttleSubmit: false, throttleSubmit: false,
membraneTypeList, membraneTypeList,
...@@ -107,23 +127,23 @@ export default { ...@@ -107,23 +127,23 @@ export default {
goodsList: [], goodsList: [],
addressInfoList: [ addressInfoList: [
{ {
label: '店铺名称', label: '店铺名称:',
name: 'yqMerchantName' name: 'yqMerchantName'
}, },
{ {
label: '店铺编号', label: '店铺编号:',
name: 'yqMerchantId' name: 'yqMerchantId'
}, },
{ {
label: '收货人', label: '收货人:',
name: 'contactName' name: 'contactName'
}, },
{ {
label: '收货人电话', label: '收货人电话:',
name: 'contactPhone' name: 'contactPhone'
}, },
{ {
label: '收货地址', label: '收货地址:',
name: 'contactAddress' name: 'contactAddress'
} }
], ],
...@@ -198,7 +218,8 @@ export default { ...@@ -198,7 +218,8 @@ export default {
cityName, cityName,
areaId, areaId,
areaName, areaName,
shoppingCarList: this.selectList shoppingCarList: this.selectList,
remark: this.remarks
} }
if (provinceName === null) { if (provinceName === null) {
this.dialogShow = false this.dialogShow = false
...@@ -263,6 +284,8 @@ export default { ...@@ -263,6 +284,8 @@ export default {
const upgradeGoodsList = item.list.reduce((total, cur, index) => { const upgradeGoodsList = item.list.reduce((total, cur, index) => {
total.push({ total.push({
upgradeGoodsName: cur.upgradeGoods.upgradeGoodsName, upgradeGoodsName: cur.upgradeGoods.upgradeGoodsName,
specificationType: cur.upgradeGoods.specificationType,
formatSpecificationData: cur.upgradeGoods.formatSpecificationData ? cur.upgradeGoods.formatSpecificationData.replaceAll(';~;', '/') : '',
upgradeGoodsId: cur.upgradeGoodsId, upgradeGoodsId: cur.upgradeGoodsId,
selectedFlag: cur.selectedFlag == 'Y', selectedFlag: cur.selectedFlag == 'Y',
goodsNumber: cur.goodsNumber, goodsNumber: cur.goodsNumber,
...@@ -559,6 +582,7 @@ li { ...@@ -559,6 +582,7 @@ li {
font-size: 12px; font-size: 12px;
font-weight: normal; font-weight: normal;
color: #666666; color: #666666;
margin-right: 10px;
} }
} }
...@@ -584,24 +608,50 @@ li { ...@@ -584,24 +608,50 @@ li {
.addressDialog { .addressDialog {
.title { .title {
text-align: center; text-align: center;
font-size: 20px;
color: #f8ba37;
margin: 20px 0 40px 0; margin: 20px 0 40px 0;
font-weight: 600;
font-size: 18px;
color: #333333;
.confirm {
width: 24px;
height: 24px;
vertical-align: -6px;
}
} }
.tips { .tips {
height: 40px;
line-height: 40px;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
background: #f4f6fc;
border: 1px solid #e5e5e5;
font-weight: 600;
font-size: 14px;
padding: 0px 20px;
color: #333333;
span { span {
margin-bottom: 20px; margin-bottom: 20px;
} }
.editIcon {
width: 16px;
height: 16px;
vertical-align: -3px;
}
} }
.info { .info {
padding: 15px 20px; // padding: 15px 20px;
// padding: ;
box-shadow: 0px 0px 5px 0px rgba(136, 152, 157, 0.3); box-shadow: 0px 0px 5px 0px rgba(136, 152, 157, 0.3);
&.info {
margin-top: 15px;
}
}
.orderInfoCom {
padding: 15px 20px;
} }
.item { .item {
margin-bottom: 15px; margin-bottom: 15px;
} }
...@@ -612,5 +662,17 @@ li { ...@@ -612,5 +662,17 @@ li {
text-align: right; text-align: right;
margin-right: 10px; margin-right: 10px;
} }
.item-remark {
display: flex;
.item-content {
width: 500px;
}
::v-deep .el-input__count {
right: -50px;
bottom: 5px;
font-size: 12px;
color: #999999;
}
}
} }
</style> </style>
...@@ -227,7 +227,7 @@ export default { ...@@ -227,7 +227,7 @@ export default {
type: 'text' type: 'text'
}, },
condition: row => { condition: row => {
return (row.purchaseType == 1 && row.deliveryStatus == 2) || (row.purchaseType == 1 && row.deliveryStatus == 3) return (row.purchaseType == 1 && row.deliveryStatus == 2) || (row.purchaseType == 1 && row.deliveryStatus == 3)||(row.purchaseType == 1 && row.deliveryStatus == 4)
}, },
listeners: { listeners: {
click: this.handleDispatch click: this.handleDispatch
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!