Commit b5d0eb4b by cen

Merge branch 'V4.56.0' of http://192.168.3.233:8090/glsx/gl_tape into V4.56.0

2 parents 41c4220d ea4b3257
......@@ -53,4 +53,14 @@ module.exports = {
...data
})
},
/**
* 获取商品列表
*/
getGoodsList (data) {
return http.post({
method: 'dj.api.smartcarlife.selectOrderGoods.list',
projectName: 'boutique',
...data
})
},
}
\ No newline at end of file
......@@ -18,7 +18,7 @@
<!-- 输入框 -->
<template v-if="item.type === 'input'">
<view class="input-box">
<input class="input-value" v-model="formData[item.value]" :placeholder="item.placeholder || '请输入'"
<input class="input-value" v-model="formData[item.value]" :type="item.inputType || 'text'" @blur="handleBlur($event, item)" :placeholder="item.placeholder || '请输入'"
:maxlength="item.maxlength || 500" />
<view v-if="item.valueIcon" :class="['sprite-icon', `icon-${item.valueIcon}`]"
@click="onValueClick(item)"></view>
......@@ -27,11 +27,11 @@
<!-- 下拉选择 -->
<template v-else-if="item.type === 'select'">
<view class="value">
<template v-if="formData[item.value] && formData[item.value][item.key]">
<template v-if="formData[item.value] && formData[item.value]">
<template v-if="item.showText && userInfo && userInfo[item.showText]">
{{ userInfo[item.showText] }}<text>|</text>
</template>
{{ formData[item.value][item.key] }}
{{ formData[item.value] }}
</template>
<template v-else>
<span class="placeholder">请选择</span>
......@@ -109,6 +109,9 @@ export default {
},
onValueClick(item) {
this.$emit('handleValue', item)
},
handleBlur(e, item) {
this.$emit('inputBlur', e, item)
}
}
};
......@@ -205,6 +208,7 @@ export default {
align-items: center;
justify-content: flex-end;
height: 100%;
width: 100%;
.sprite-icon {
margin-left: toRpx(8);
......@@ -214,6 +218,7 @@ export default {
.input-value {
height: 100%;
text-align: right;
width: 100%;
}
.input-bottom {
......
......@@ -56,6 +56,16 @@ export default {
this.getList(searchValue, true)
},
choose (i) {
let { params: { idKey }, data } = this,
value = {
userId: data.deliveryUserId,
deliveryUserId: data.userId
}[idKey]
if ((idKey == 'userId' || idKey == 'deliveryUserId') && value == i.uuid) return uni.showToast({
title: '销售顾问/录单员与交付专员不能选取同一人',
icon: 'none',
mask: true
})
this.currentId = i.uuid
this.$emit('choose', i)
}
......
<template>
<view class="goods-list">
<!-- <template v-if="list.length"> -->
<template v-for="(i, index) in (searchStatus ? searchList : list)">
<view
:key="index"
@click="choose(i)"
:class="['item flex',{active: checkActive(i)}]"
>
<view class="sprite-icon icon-tag-checked"></view>
<text class="goods-name text-hide">
{{replaceItemText(i.goods,'goodsAlias') ||replaceItemText(i.goods,'upgradeGoodsName') || replaceItemText(i.goodsInfo,'goodsName')}}
</text>
<template v-if="i.goods.merchantGoodsPosition && (i.goods.goodsInfo.goodsType == 1 || i.goods.goodsInfo.goodsType == baseConfigData.selfBuildFilmType)">
<text>「{{ i.goods.positionStr}}」</text>
</template>
<text class="price">¥{{i.goods.price}}</text>
</view>
</template>
<!-- </template> -->
</view>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'GoodsList',
inject: ['userInfo', 'baseConfigData'],
data () {
return {
list: [],
currentIds: [],
chooseList: [],
searchStatus: false,
searchList: [],
}
},
props: {
params: Object,
data: [Object, Array],
cacheData: Array
},
mounted () {
},
methods: {
async getList (searchValue) {
const { userInfo, params } = this,
{ cacheData } = params
this.currentIds = []
this.chooseList = []
if (cacheData && cacheData.length) {
this.list = this.initGoodsList(cacheData)
if (searchValue) this.handleSearch(searchValue)
return
}
const { shopMerchantId, sceneType } = userInfo,
response = await uni.$api.popupApi.getGoodsList({
merchantId: shopMerchantId,
sceneType
})
if (response && response.length) {
this.list = this.initGoodsList(response)
params.cacheData = response
this.$emit('update:params', params)
}
},
handleSearch (searchValue) {
if (!searchValue) this.searchStatus = false
else {
let { list } = this,
goodsList = JSON.parse(JSON.stringify(list)),
arr = []
goodsList.map(c => {
let name = ''
if (c.goodsFlag == 1 && c.goods) name = c.goods.goodsAlias || c.goods.upgradeGoodsName || c.goods.goodsName || ''
if (name.indexOf(searchValue) != -1) {
arr.push(c)
}
})
console.log(arr)
this.searchList = arr
this.searchStatus = true
}
},
initGoodsList (goodsData) {
let { goodsType } = this.params,
{ data } = this,
arr = []
goodsData.map(val => {
if (val.goodsFlag == 1) {
let subVal = val.goods
subVal.positionStr = subVal.position
subVal.upgradePrice = subVal.sellPrice
subVal.price = subVal.sellPrice
subVal.goodsId = subVal.merchantGoodsId
if (goodsType.includes(subVal.merchantGoodsPosition)) arr.push(val)
}
})
if (data.length) data.map(e => {
this.currentIds.push(e.goods.goodsId)
this.chooseList.push(e)
})
return arr
},
choose (i) {
let { goodsId } = i.goods,
{ currentIds } = this,
index = currentIds.indexOf(goodsId)
if (index == -1) {
this.currentIds.push(goodsId)
this.chooseList.push(i)
}
else {
this.currentIds.splice(index, 1)
this.chooseList.splice(index, 1)
}
this.$emit('choose', this.chooseList)
},
replaceItemText (item, key) {
let reg = getRegExp(';~;', 'g'),
value = item[key]
return value ? value.replace(reg, ' ') : ''
},
checkActive (i) {
let { currentIds } = this,
active = false
if (currentIds.length) active = currentIds.includes(i.goods.goodsId)
return active
}
}
}
</script>
<style scoped lang='scss'>
.goods-list {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 32rpx;
margin: 0 48rpx;
.item {
justify-content: center;
height: 72rpx;
border-radius: 8rpx;
border: 2rpx solid #dce0e6;
box-sizing: border-box;
position: relative;
color: #333333;
font-size: 32rpx;
box-sizing: border-box;
padding: 0 32rpx;
.sprite-icon {
display: none;
position: absolute;
top: 0;
right: 0;
}
.price {
margin-left: auto;
}
.goods-name {
max-width: 600rpx;
}
}
.active {
border-color: #2c66f7;
background: #ecf1ff;
color: #2c66f7;
.sprite-icon {
display: block;
}
}
}
</style>
\ No newline at end of file
......@@ -5,6 +5,15 @@
* 2:二级流量方
* 3:转化人员
* 4:车品牌
* 5: 礼券
* 6:前档
* 7:前侧窗玻璃
* 8:后侧窗玻璃
* 9:后档
* 10:天窗
* 11:套餐
* 12:其他精品
* 13:时间选择
*/
const componentConfig = {
......@@ -43,13 +52,49 @@ const componentConfig = {
title: '选择礼券',
placeholder: '查找',
idKey: 'customerCouponCode'
}
},
6: {
name: 'GoodsList',
title: '选择商品(可多选)',
placeholder: '请输入名称',
idKey: 'goodsId',
goodsType: [1]//前档
},
7: {
name: 'GoodsList',
title: '选择商品(可多选)',
placeholder: '请输入名称',
idKey: 'goodsId',
goodsType:[2] // 前侧窗玻璃
},
8: {
name: 'GoodsList',
title: '选择商品(可多选)',
placeholder: '请输入名称',
idKey: 'goodsId',
goodsType: [3] // 后侧窗玻璃
},
9: {
name: 'GoodsList',
title: '选择商品(可多选)',
placeholder: '请输入名称',
idKey: 'goodsId',
goodsType: [5, 6, 7] // 后档
},
10: {
name: 'GoodsList',
title: '选择商品(可多选)',
placeholder: '请输入名称',
idKey: 'goodsId',
goodsType: 'skylight' // 天窗
},
}
import EmployeeList from './components/EmployeeList.vue'
import DiversionMerchant from './components/DiversionMerchant.vue'
import CarModelList from './components/CarModelList.vue'
import CouponList from './components/CouponList.vue'
import GoodsList from './components/GoodsList.vue'
export default {
data () {
return {
......@@ -60,6 +105,7 @@ export default {
EmployeeList,
DiversionMerchant,
CarModelList,
CouponList
CouponList,
GoodsList
},
}
\ No newline at end of file
......@@ -86,25 +86,17 @@ export default {
type: Boolean,
default: false
},
/**
* 0:销售顾问/录单员
* 1:交付专员
* 2:二级流量方
* 3:转化专员
*/
popupType: {
type: [Number, String],
default: 0
},
data: {
type: Object,
default: () => ({})
},
data: [Object, Array],
externalData: null
},
provide () {
return {
userInfo: this.userInfo
userInfo: this.userInfo,
baseConfigData: this.baseConfigData
}
},
data () {
......@@ -136,6 +128,9 @@ export default {
userInfo () {
return uni.$storage.get("userInfo")
},
baseConfigData () {
return this.$store.state.boutique.baseConfigData
}
},
mounted () {
},
......
......@@ -222,7 +222,9 @@ export default {
},
// 查询素材
async getSoure () {
let { moduleList, toolList, defaultCarId } = await uni.$api.systemApi.getBoutiqueMockData(true)
let baseConfigData = await uni.$api.systemApi.getBoutiqueMockData(true),
{moduleList, toolList, defaultCarId } = baseConfigData
this.$store.state.boutique.baseConfigData = configData
this.moduleList = moduleList
this.toolList = toolList
this.defaultCarId = defaultCarId
......
......@@ -4,7 +4,7 @@
<view class="box">
<scroll-view class="scroll-view" scroll-y="true">
<view class="box-content">
<GlCell :formList="formList" :formData="orderObj" @radioChange="radioChange" @handleCell="handleCell">
<GlCell :formList="formList" :formData="orderObj" @radioChange="radioChange" @inputBlur="inputBlur" @handleCell="handleCell">
<template slot="product">
<view class="shop-list">
<view class="shop-item">
......@@ -84,11 +84,11 @@
</template>
</GlCell>
</view>
<view @click="submit">直接下单</view>
<view @click="submit" class="btn">直接下单</view>
</scroll-view>
</view>
<!-- 弹窗 -->
<order-popup ref="orderPopup" :data="popData" @onConfirm="onConfirm" :popupType="popupType" />
<order-popup ref="orderPopup" :data="orderObj" @onConfirm="onConfirm" :externalData="externalData" :popupType="popupType" />
</view>
</template>
......@@ -120,7 +120,7 @@ export default {
},
data() {
return {
orderObj: {
formObj: {
userInfo: {},
deliveryUserInfo: {},
subShopMerchantInfo: {},
......@@ -130,16 +130,23 @@ export default {
experienceFlag: 'Y',
payeeType: 0,
selectPayType: '3',
carBrand: {}
carBrand: {},
customerPhone: ''
},
formList: FORM_LIST,
userInfo: {},
requiredList: [], // 录单设置的必填项
popData: {
customer: {}
},
orderObj: {
customer: {},
customerSex: '1',
experienceFlag: 'Y',
payeeType: 0
}, // 弹窗传入的数据},
popupType: 0,
popupTypeEnum
popupTypeEnum,
externalData: [], //弹窗接口数据
subShopMerchantList: [], // 二级流量方列表
employeeList: []
}
},
computed: {
......@@ -148,9 +155,22 @@ export default {
else return false
}
},
onload(options) {
console.log(options, 'options')
},
mounted() {
console.log('mounted')
this.userInfo = uni.$storage.get('userInfo') || {}
const { userInfo } = this
// 在原有的 orderObj 对象上新增这些属性
Object.assign(this.orderObj, {
sellerMerchantNam: userInfo.merchantName,
sellerName: userInfo.name,
sellerMerchantId: userInfo.merchantId,
sellerUserId: userInfo.uuid,
merchantId: userInfo.shopMerchantId,
merchantName: userInfo.shopMerchantName
})
this.initData()
},
methods: {
......@@ -159,21 +179,23 @@ export default {
this.getShopMerchantPointConfig(userInfo.shopMerchantId)
this.getSubShopMerchantList(userInfo.shopMerchantId)
this.getSetting()
// this.orderObj.userInfo = {
// id: 1,
// name: '测试'
// }
this.orderObj.sellerMerchant = {
sellerUserId: userInfo.uuid,
sellerName: userInfo.name
}
this.getConfig()
this.getEmployeeList()
},
// 选择行事件
handleCell(val) {
console.log(val)
this.popupType = Object.keys(this.popupTypeEnum).find(key => this.popupTypeEnum[key] === val.value) * 1
console.log(this.popupType)
this.$refs.orderPopup.open()
console.log(val, this.orderObj)
// 获取当前选中的popupType
this.popupType = Object.keys(this.popupTypeEnum).find(key => this.popupTypeEnum[key].key === val.value) * 1;
// 获取对应的list字段
const popupConfig = this.popupTypeEnum[this.popupType];
if (popupConfig && popupConfig.list) {
this.externalData = this[popupConfig.list] || [];
} else {
this.externalData = [];
}
console.log(this.popupType, this.externalData, '-------------')
this.$refs.orderPopup.open();
},
// 单选框change事件
radioChange(e, val) {
......@@ -182,13 +204,40 @@ export default {
},
onConfirm(val) {
console.log(val, 'onConfirm')
const {chooseContent} = val
// 根据popupTypeEnum优化处理
const typeKey = this.popupTypeEnum[this.popupType]
if (typeKey) this.orderObj[typeKey] = val
if (typeKey == 'carBrand') {
this.orderObj[typeKey].carInfo = `${val.carBrand}-${val.carChildsBrandName}-${val.carSeriesName}`
const _typeValue = this.popupTypeEnum[this.popupType];
console.log(_typeValue)
if (_typeValue.key == 'carBrand') {
// 车型
this.$set(this.orderObj, _typeValue.key, `${chooseContent.carBrand}-${chooseContent.carChildsBrandName}-${chooseContent.carSeriesName}`)
this.orderObj.customer = {
...(this.orderObj.customer || {}),
...chooseContent
}
} else if (_typeValue.key == 'couponInfo') {
// 礼券
const {couponName, merchantCouponId, customerCouponCode } = chooseContent
Object.assign(this.orderObj, {
couponName: couponName,
merchantCouponId: merchantCouponId,
customerCouponCode: customerCouponCode
})
this.$set(this.orderObj, 'couponInfo', couponName + customerCouponCode)
} else if (_typeValue.key) {
// this.formObj[_typeValue.key] = chooseContent;
this.orderObj[_typeValue.targetIdKey] = chooseContent[_typeValue.sourceIdKey]
this.$set(this.orderObj, _typeValue.targetNameKey, chooseContent[_typeValue.sourceNameKey])
}
},
// 输入框失去焦点事件
inputBlur(e, val) {
console.log(e, val)
this.orderObj.customer[val.value] = this.orderObj[val.value]
},
checkRequired() {
},
// 提交
submit() {
console.log(this.orderObj)
......@@ -208,7 +257,8 @@ export default {
const res = await uni.$api.boutiqueApi.getSubShopMerchantList({ merchantId })
console.log(res, '流量方')
if (res && res.length) {
const cell = this.formList[0].find(item => item.label === '二级流量方')
this.subShopMerchantList = res
const cell = this.formList[0].find(item => item.label === '二级流量方');
if (cell) {
cell.hidden = false
}
......@@ -245,7 +295,27 @@ export default {
if (cell) cell.required = res[key] == 'Y'
}
},
async getConfig() {}
async getConfig() {
const res = await uni.$api.boutiqueApi.getYqStoreConfig({
yqMerchantId: this.orderObj.sellerMerchantId
})
console.log(res)
},
// 获取 销售顾问列表
async getEmployeeList() {
const { userInfo, orderObj } = this
const { shopMerchantId, sceneType, merchantId } = userInfo,
data = await uni.$api.popupApi.getEmployeeList({
merchantId: orderObj.idKey == 'sellerUserId' ? merchantId : shopMerchantId,
sceneList: orderObj.idKey == 'sellerUserId' ? '' : [sceneType]
})
if (data && data.length) {
this.employeeList = data
this.formObj.userInfo = data[0]
this.$set(this.orderObj, 'employeeName', data[0].staffName)
this.orderObj.userId = data[0].uuid
}
}
}
}
</script>
......@@ -257,7 +327,7 @@ export default {
.box {
height: calc(100% - #{toRpx(120)});
padding-bottom: toRpx(24);
.scroll-view {
height: 100%;
}
......@@ -385,9 +455,7 @@ export default {
justify-content: space-between;
align-items: center;
border-bottom: toRpx(1.6) solid #dce1e6;
padding: toRpx(24);
&-left {
padding: toRpx(24); &-left {
display: flex;
align-items: center;
font-size: toRpx(28);
......@@ -429,4 +497,15 @@ export default {
font-size: toRpx(24);
color: #999;
}
.btn {
display: flex;
align-items: center;
justify-content: center;
margin: toRpx(88) auto 0;
width: toRpx(1130);
height: toRpx(80);
color: #fff;
border-radius: toRpx(48);
background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
}
</style>
......@@ -2,34 +2,34 @@ const FORM_LIST = [
[
{
label: '销售顾问',
value: 'userInfo',
value: 'employeeName',
type: 'select',
key: 'staffName',
// key: 'staffName',
required: true,
showText: 'shopMerchantName'
},
{
label: '交付专员',
value: 'deliveryUserInfo',
value: 'deliveryEmployeeName',
type: 'select',
required: true,
key: 'staffName',
// key: 'staffName',
hidden: true,
showText: 'shopMerchantName'
},
{
label: '二级流量方',
value: 'subShopMerchantInfo',
value: 'subShopMerchantName',
type: 'select',
required: true,
key: 'subMerchantName',
// key: 'subMerchantName',
hidden: true
},
{
label: '转化人员',
value: 'sellerUserInfo',
value: 'sellerName',
type: 'select',
key: 'staffName',
// key: 'staffName',
required: true,
showText: 'merchantName'
},
......@@ -37,7 +37,7 @@ const FORM_LIST = [
[
{
label: '车主姓名',
value: 'customer',
value: 'customerName',
maxlength: '16',
type: 'input',
required: true
......@@ -80,7 +80,8 @@ const FORM_LIST = [
value: 'customerPhone',
maxlength: '11',
type: 'input',
required: true
required: true,
inputType: 'number'
},
{
label: '选择车型',
......@@ -180,7 +181,7 @@ const FORM_LIST = [
addHtml: 'package'
},
{
label: '精品礼券',
label: '其他精品',
value: 'couponInfo',
type: 'select',
key: 'name',
......@@ -271,11 +272,46 @@ const payType = [
]
const popupTypeEnum = {
0: 'userInfo',
1: 'deliveryUserInfo',
2: 'subShopMerchantInfo',
3: 'sellerUserInfo',
4: 'carBrand'
0: {
key: 'employeeName',
list: 'employeeList',
targetIdKey: 'userId',
targetNameKey: 'employeeName',
sourceIdKey: 'uuid',
sourceNameKey: 'staffName'
},
1: {
key: 'deliveryEmployeeName',
list: 'employeeList',
targetIdKey: 'deliveryUserId',
targetNameKey: 'deliveryEmployeeName',
sourceIdKey: 'uuid',
sourceNameKey: 'staffName'
},
2: {
key: 'subShopMerchantName',
list: 'subShopMerchantList',
targetIdKey: 'subShopMerchantId',
targetNameKey: 'subShopMerchantName',
sourceIdKey: 'subMerchantId',
sourceNameKey: 'subMerchantName'
},
3: {
key: 'sellerName',
list: '',
targetIdKey: 'sellerUserId',
targetNameKey: 'sellerName',
sourceIdKey: 'uuid',
sourceNameKey: 'staffName'
},
4: {
key: 'carBrand',
list: ''
},
5: {
key: 'couponInfo',
list: '',
}
}
export {
......
......@@ -14,6 +14,7 @@ import audio from './modules/audio'
import update from './modules/update'
import sys from './modules/sys'
import point from './modules/point'
import boutique from './modules/boutique'
Vue.use(Vuex)
const store = new Vuex.Store({
......@@ -22,7 +23,8 @@ const store = new Vuex.Store({
audio,
update,
sys,
point
point,
boutique
},
getters
})
......
export default {
state() {
return {
baseConfigData:{}
}
},
mutations: {
},
actions: {
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!