Commit f9fe7ce2 by 前端

Merge branch 'SAAS+V5.8.4' into 'master'

上线合并

See merge request !100
2 parents 7f6dcaee 5259f7e5
......@@ -79,21 +79,21 @@ const getDiscussionStaffList = async (data = {}) => {
})
}
/**
日报草稿数据保存
日报保存
*/
const saveDraft = async (data = {}) => {
return http.post({
method: 'dj.api.smartcarlife.dailyReport.dynamic.draft.save',
method: 'dj.api.smartcarlife.dailyReport.dynamic.save',
projectName: 'boutique',
...data
})
}
/**
日报数据提交
日报数据推送
*/
const submitReport = async (data = {}) => {
return http.post({
method: 'dj.api.smartcarlife.dailyReport.dynamic.save',
method: 'dj.api.smartcarlife.dailyReport.dynamic.data.push',
projectName: 'boutique',
...data
})
......
......@@ -140,7 +140,6 @@ const getSoureData = async (shopMerchantId, sceneType, params = {}) => {
...params
})
if (res && res.id) {
console.log(res.id, 'res.idres.idres.idres.id')
let data = await getEquityMaterialConfig({
id: res.id
})
......
......@@ -132,6 +132,8 @@ export default {
index = 0
if (clickFlga) return
this.clickFlga = true
// 进入车系选择过程中保持弹层打开态,避免「查看长图」按钮冒出来
this.$store.dispatch('setCarBrandOpenStatus', true)
this.selectItem = {
carBrand: e.brandName,
carBrandId: e.brandId,
......@@ -166,7 +168,10 @@ export default {
if (index < 0) index = 0
this.handleSelect(res[index])
}
else this.$refs.carBoxVisible.open()
else {
this.$store.dispatch('setCarBrandOpenStatus', true)
this.$refs.carBoxVisible.open()
}
}
this.clickFlga = false
}).catch(err => {
......@@ -197,6 +202,8 @@ export default {
this.$store.dispatch('setCurrentCarInfo', selectItem)
}
this.$refs.carBoxVisible?.close();
this.$refs.carBrandListVisible?.close();
this.carBrandListOff = false
this.$store.dispatch('setCarBrandOpenStatus', false)
this.$emit('select', {
...item,
......@@ -211,10 +218,16 @@ export default {
},
closeCarBoxVisible() {
if (this.carBrandListOff) return
else this.$emit('close')
// 关车系弹窗:若还要从品牌列表回来,保持打开态;否则关闭
if (this.carBrandListOff) {
this.$store.dispatch('setCarBrandOpenStatus', true)
return
}
this.$store.dispatch('setCarBrandOpenStatus', false)
this.$emit('close')
},
clickClose() {
this.carBrandListOff = false
this.$store.dispatch('setCarBrandOpenStatus', false)
this.$emit('close')
},
......
......@@ -368,6 +368,7 @@ export default {
tipsObject: {},
autoplay: true,
previewOff: false,
previewClickIndex: -1,
showStudyPopup: false,
showExamPopup: false,
examPopInfo: {
......@@ -973,6 +974,7 @@ export default {
uni.$track.add({
eventCode: 'app_product_Introduction'
}) //轻改场景不埋点
this.previewClickIndex = e
this.previewOff = true
this.$emit('swiperClick', e)
},
......@@ -982,6 +984,15 @@ export default {
})
},
previewHandler(name, off = false) {
const item = this.moduleList[this.previewClickIndex]
if (name === 'preview' && item?.id) {
const businessParam = {
materialId: item.id,
title: item.title || item.detailTitle || item.materialTitle
}
console.log('previewHandler 埋点:', { eventCode: 'app-longImage-click', businessParam })
uni.$track.add({ eventCode: 'app-longImage-click', businessParam })
}
this.previewOff = off
this.$emit(name)
},
......
......@@ -20,10 +20,10 @@
<text class="goods-name text-hide">
{{ replaceItemText(item, 'upgradeGoodsAlias') || replaceItemText(item, 'upgradeGoodsName') || replaceItemText(item.goodsInfo, 'goodsName') }}
</text>
<template v-if="item.merchantGoodsPosition && (item.goodsInfo.goodsType == 1 || item.goodsInfo.goodsType == baseConfigData.selfBuildFilmType)">
<template v-if="item.merchantGoodsPosition">
<text>「{{ item.positionStr }}」</text>
</template>
<template v-if="!item.merchantGoodsPosition && (item.goodsInfo.goodsType == 1 || item.goodsInfo.goodsType == baseConfigData.selfBuildFilmType)">
<template v-else>
<view class="no-postion">无部位</view>
</template>
<text class="price">¥{{ item.upgradePrice }}</text>
......@@ -46,10 +46,10 @@
<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)">
<template v-if="i.goods.merchantGoodsPosition">
<text>「{{ i.goods.positionStr }}」</text>
</template>
<template v-if="!i.goods.merchantGoodsPosition && (i.goods.goodsInfo.goodsType == 1 || i.goods.goodsInfo.goodsType == baseConfigData.selfBuildFilmType)">
<template v-else>
<text class="no-postion">无部位</text>
</template>
<text class="price">¥{{ i.goods.price }}</text>
......
......@@ -47,7 +47,7 @@
}}
</template>
</text>
<template v-if="i.goods.merchantGoodsPosition && (i.goods.goodsInfo.goodsType == 1 || i.goods.goodsInfo.goodsType == baseConfigData.selfBuildFilmType)">
<template v-if="i.goods.merchantGoodsPosition">
<text>「{{ i.goods.positionStr }}」</text>
</template>
<text class="price">¥{{ i.goods.price }}</text>
......
......@@ -113,8 +113,9 @@ export default {
if (!val.length) {
this.datalist = []
this.imagelist = []
return
}
if (val.length && !this.imagelist.length) this.getDatalist()
if (!this.imagelist.length) this.getDatalist()
},
deep: true
},
......
{
"name" : "展业助手",
"appid" : "__UNI__D3BD3DF",
"description" : "",
"versionName" : "2.26.2",
"versionCode" : 2262,
"transformPx" : false,
"sassImplementationName" : "node-sass",
/* 5+App特有相关 */
"app-plus" : {
"cache" : {
"mode" : "noCache"
},
"webview" : {
"cacheMode" : "noCache"
},
"bounce" : "none",
"usingComponents" : true,
"nvueStyleCompiler" : "uni-app",
"compilerVersion" : 3,
"compatible" : {
"ignoreVersion" : true
},
"screenOrientation" : "landscape",
"splashscreen" : {
"alwaysShowBeforeRender" : true,
"waiting" : true,
"autoclose" : true,
"delay" : 0
},
/* 模块配置 */
"modules" : {
"Camera" : {},
"VideoPlayer" : {},
"AudioPlayer" : {},
"SQLite" : {},
"Maps" : {},
"Geolocation" : {}
},
/* 应用发布信息 */
"distribute" : {
/* android打包配置 */
"android" : {
"permissions" : [
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.INTERNET\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>"
],
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ],
"targetSdkVersion" : 30,
"minSdkVersion" : 21,
"excludePermissions" : [
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>"
]
},
/* ios打包配置 */
"ios" : {
"dSYMs" : false,
"UIBackgroundModes" : "audio"
},
/* SDK配置 */
"sdkConfigs" : {
"ad" : {},
"speech" : {},
"geolocation" : {
"baidu" : {
"__platform__" : [ "android" ],
"appkey_ios" : "",
"appkey_android" : "rfN7u5gCi0KyCGIWWBYGXlmKrVQsKH8z"
}
},
"maps" : {}
},
"icons" : {
"android" : {
"hdpi" : "static/72.png",
"xhdpi" : "static/96.png",
"xxhdpi" : "static/144.png"
}
},
"plugins" : {
"audio" : {
"mp3" : {
"description" : "Android平台录音支持MP3格式文件"
}
}
}
},
"nativePlugins" : {
"Ba-KeepAliveSuit" : {
"__plugin_info__" : {
"name" : "安卓保活套装(通用、常驻通知、电池优化、自启管理、后台运行等)",
"description" : "在Ba-KeepAlive的基础上,新增了忽略电池优化、自启管理、常驻通知。为定位、推送、websocket、定时任务、蓝牙、聊天等保驾护航(**注意:**不保证支持所有机型和场景,建议先试用再购买)",
"platforms" : "Android",
"url" : "https://ext.dcloud.net.cn/plugin?id=11765",
"android_package_name" : "uni.gltap",
"ios_bundle_id" : "",
"isCloud" : true,
"bought" : 1,
"pid" : "11765",
"parameters" : {}
}
}
}
"name": "展业助手",
"appid": "__UNI__D3BD3DF",
"description": "",
"versionName": "2.26.3",
"versionCode": 2263,
"transformPx": false,
"sassImplementationName": "node-sass",
/* 5+App特有相关 */
"app-plus": {
"cache": {
"mode": "noCache"
},
/* 快应用特有相关 */
"quickapp" : {},
/* 小程序特有相关 */
"mp-weixin" : {
"appid" : "wx79d1ff39bee3d047",
"setting" : {
"urlCheck" : false
},
"usingComponents" : true
"webview": {
"cacheMode": "noCache"
},
"mp-alipay" : {
"usingComponents" : true
"bounce": "none",
"usingComponents": true,
"nvueStyleCompiler": "uni-app",
"compilerVersion": 3,
"compatible": {
"ignoreVersion": true
},
"mp-baidu" : {
"usingComponents" : true
"screenOrientation": "landscape",
"splashscreen": {
"alwaysShowBeforeRender": true,
"waiting": true,
"autoclose": true,
"delay": 0
},
"mp-toutiao" : {
"usingComponents" : true
/* 模块配置 */
"modules": {
"Camera": {},
"VideoPlayer": {},
"AudioPlayer": {},
"SQLite": {},
"Maps": {},
"Geolocation": {}
},
"uniStatistics" : {
"enable" : false
/* 应用发布信息 */
"distribute": {
/* android打包配置 */
"android": {
"permissions": [
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.INTERNET\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>"
],
"abiFilters": ["armeabi-v7a", "arm64-v8a", "x86"],
"targetSdkVersion": 30,
"minSdkVersion": 21,
"excludePermissions": ["<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>"]
},
/* ios打包配置 */
"ios": {
"dSYMs": false,
"UIBackgroundModes": "audio"
},
/* SDK配置 */
"sdkConfigs": {
"ad": {},
"speech": {},
"geolocation": {
"baidu": {
"__platform__": ["android"],
"appkey_ios": "",
"appkey_android": "rfN7u5gCi0KyCGIWWBYGXlmKrVQsKH8z"
}
},
"maps": {}
},
"icons": {
"android": {
"hdpi": "static/72.png",
"xhdpi": "static/96.png",
"xxhdpi": "static/144.png"
}
},
"plugins": {
"audio": {
"mp3": {
"description": "Android平台录音支持MP3格式文件"
}
}
}
},
"vueVersion" : "2",
"h5" : {
"devServer" : {
"port" : 8080,
"https" : false
"nativePlugins": {
"Ba-KeepAliveSuit": {
"__plugin_info__": {
"name": "安卓保活套装(通用、常驻通知、电池优化、自启管理、后台运行等)",
"description": "在Ba-KeepAlive的基础上,新增了忽略电池优化、自启管理、常驻通知。为定位、推送、websocket、定时任务、蓝牙、聊天等保驾护航(**注意:**不保证支持所有机型和场景,建议先试用再购买)",
"platforms": "Android",
"url": "https://ext.dcloud.net.cn/plugin?id=11765",
"android_package_name": "uni.gltap",
"ios_bundle_id": "",
"isCloud": true,
"bought": 1,
"pid": "11765",
"parameters": {}
}
}
}
},
/* 快应用特有相关 */
"quickapp": {},
/* 小程序特有相关 */
"mp-weixin": {
"appid": "wx79d1ff39bee3d047",
"setting": {
"urlCheck": false
},
"usingComponents": true
},
"mp-alipay": {
"usingComponents": true
},
"mp-baidu": {
"usingComponents": true
},
"mp-toutiao": {
"usingComponents": true
},
"uniStatistics": {
"enable": false
},
"vueVersion": "2",
"h5": {
"devServer": {
"port": 8080,
"https": false
}
}
}
......@@ -45,7 +45,7 @@
<view class="flex align-center">
<view class="name">{{ g.upgradeGoodsAlias || g.upgradeGoodsName }}</view>
<view class="meal-bd-bottom flex align-center">
{{ g.upgradeGoodsType === 1 ? g.positionStr : g.upgradeGoodsTypeName }}
{{ g.positionStr || g.upgradeGoodsTypeName }}
<view class="count">x{{ g.number }}</view>
</view>
</view>
......
......@@ -77,7 +77,7 @@
<view class="flex align-center">
<view class="name">{{ g.upgradeGoodsAlias || g.upgradeGoodsName }}</view>
<view class="meal-bd-bottom flex align-center">
{{ g.upgradeGoodsType === 1 ? g.positionStr : g.upgradeGoodsTypeName }}
{{ g.positionStr || g.upgradeGoodsTypeName }}
<view class="count">x{{ g.number }}</view>
</view>
</view>
......
......@@ -28,7 +28,7 @@
<!-- <view class="front-gear-label" v-if="goods.merchantGoodsPosition || goods.goodsInfo.goodsTypeName">{{goods.goodsInfo.goodsType===1?formatPosition(goods.merchantGoodsPosition, positionTypeList):goods.goodsInfo.goodsTypeName}}</view> -->
<view class="front-gear-input">
<view class="unit">¥</view>
<input class="uni-input" type="digit" maxlength="9" placeholder="请输入价格" placeholder-style="font-size: 14px" v-model="goods.sellPrice" @blur="validatePrice($event, goods, ind, index)" />
<input class="uni-input" type="digit" maxlength="9" :disabled="isMarketingGoods(goods, item)" placeholder="请输入价格" placeholder-style="font-size: 14px" v-model="goods.sellPrice" @blur="validatePrice($event, goods, ind, index)" />
</view>
</view>
</view>
......@@ -42,8 +42,8 @@
<script>
import utils from '@/utils/utils'
import OrderStrategy from './OrderStrategy.vue'
import { shouldShowMarketingIcon as checkMarketingIcon, snapshotOriginalPrice } from '@/utils/marketingFlag'
import { isBelowMinSellPrice, normalizeGoodsPrice, shouldUseMinPriceApproval, applyLegacyMinSellPriceClamp } from '@/utils/minSellPrice'
import { shouldShowMarketingIcon as checkMarketingIcon, isMarketingGoods, snapshotOriginalPrice } from '@/utils/marketingFlag'
import { normalizeGoodsPrice, applyLegacyMinSellPriceClamp } from '@/utils/minSellPrice'
export default {
name: 'Package',
......@@ -93,6 +93,7 @@ export default {
}
},
methods: {
isMarketingGoods,
// 验证价格输入(修改套餐内单个商品单价)
validatePrice(event, goods, goodsIndex, packageIndex) {
let value = event.detail.value
......@@ -196,14 +197,10 @@ export default {
this.$emit('changeTotalPrice')
},
validatePrice(event, goods, ind, index) {
const packageItem = this.list[index]
if (isMarketingGoods(goods, packageItem)) return
let value = normalizeGoodsPrice(event.detail.value)
if (shouldUseMinPriceApproval(this.orderTypeCode)) {
if (isBelowMinSellPrice(goods, value)) {
this.$emit('min-price-warning', value)
}
} else {
value = applyLegacyMinSellPriceClamp(goods, value)
}
value = applyLegacyMinSellPriceClamp(goods, value)
this.$set(this.list[index].packageGoods.goodsList[ind], 'sellPrice', value)
// 价格变动时,清空该商品的折扣/买赠/抵扣配置,并按原价重算 finalPrice
......
......@@ -15,12 +15,12 @@
<!-- <view class="alias">商品别名:{{ item.goods.goodsAlias }}</view> -->
<view class="front-gear-box">
<view class="front-gear-input-box">
<view class="front-gear-label" v-if="(item.goods.merchantGoodsPosition || item.goods.upgradeGoodsPosition) && (item.goods.goodsInfo.goodsType == 1 || item.goods.upgradeGoodsType == 1 || item.goods.goodsInfo.goodsType == baseConfigData.selfBuildFilmType || item.goods.upgradeGoodsType == baseConfigData.selfBuildFilmType)">
<view class="front-gear-label" v-if="item.goods.merchantGoodsPosition || item.goods.upgradeGoodsPosition">
{{ formatPosition(item.goods.merchantGoodsPosition || item.goods.upgradeGoodsPosition, positionTypeList) }}
</view>
<view class="front-gear-input">
<view class="unit">¥</view>
<input class="uni-input" :disabled="isDisabled" type="digit" maxlength="9" placeholder="请输入价格" placeholder-style="font-size: 14px" v-model="item.goods.sellPrice" @blur="validatePrice($event, item, index)" />
<input class="uni-input" :disabled="isDisabled || isMarketingGoods(item.goods, item)" type="digit" maxlength="9" placeholder="请输入价格" placeholder-style="font-size: 14px" v-model="item.goods.sellPrice" @blur="validatePrice($event, item, index)" />
</view>
</view>
<view class="control">
......@@ -41,8 +41,8 @@
<script>
import utils from '@/utils/utils'
import OrderStrategy from './OrderStrategy.vue'
import { shouldShowMarketingIcon as checkMarketingIcon, snapshotOriginalPrice } from '@/utils/marketingFlag'
import { isBelowMinSellPrice, normalizeGoodsPrice, shouldUseMinPriceApproval, applyLegacyMinSellPriceClamp } from '@/utils/minSellPrice'
import { shouldShowMarketingIcon as checkMarketingIcon, isMarketingGoods, snapshotOriginalPrice } from '@/utils/marketingFlag'
import { normalizeGoodsPrice, applyLegacyMinSellPriceClamp } from '@/utils/minSellPrice'
export default {
name: 'Product',
......@@ -96,6 +96,7 @@ export default {
}
},
methods: {
isMarketingGoods,
// 根据订单类型获取策略类型
getStrategyType(item) {
const orderType = String(this.orderTypeCode || '')
......@@ -269,14 +270,9 @@ export default {
},
// 验证价格输入
validatePrice(event, item, index) {
if (isMarketingGoods(item.goods, item)) return
let value = normalizeGoodsPrice(event.detail.value)
if (shouldUseMinPriceApproval(this.orderTypeCode)) {
if (isBelowMinSellPrice(item.goods, value)) {
this.$emit('min-price-warning', value)
}
} else {
value = applyLegacyMinSellPriceClamp(item.goods, value)
}
value = applyLegacyMinSellPriceClamp(item.goods, value)
this.$set(this.list[index].goods, 'sellPrice', value)
this.resetStrategyWhenPriceChange(this.list[index])
this.$forceUpdate()
......
......@@ -20,21 +20,18 @@
{{ item.multipleSpecificationsGoods.goods.specificationStr }}
</view>
</template>
<template v-if="item.goods">
<template v-if="(item.goods.merchantGoodsPosition || item.goods.upgradeGoodsPosition) && (item.goods.goodsInfo.goodsType == 1 || item.goods.upgradeGoodsType == 1 || item.goods.goodsInfo.goodsType == baseConfigData.selfBuildFilmType || item.goods.upgradeGoodsType == baseConfigData.selfBuildFilmType)">
<view class="front-gear-label">
{{ formatPosition(item.goods.merchantGoodsPosition || item.goods.upgradeGoodsPosition, positionTypeList) }}
</view>
</template>
<template v-if="(item.goods.goodsInfo.goodsType == 1 || item.goods.upgradeGoodsType == 1) && !item.goods.merchantGoodsPosition && !item.goods.upgradeGoodsPosition">无部位属性</template>
<template v-if="item.goods && (item.goods.merchantGoodsPosition || item.goods.upgradeGoodsPosition)">
<view class="front-gear-label">
{{ formatPosition(item.goods.merchantGoodsPosition || item.goods.upgradeGoodsPosition, positionTypeList) }}
</view>
</template>
<view class="front-gear-input">
<view class="unit">¥</view>
<template v-if="item.multipleSpecificationsGoods">
<input class="uni-input" type="digit" maxlength="9" :disabled="isDisabled" placeholder="请输入价格" placeholder-style="font-size: 14px" v-model="item.multipleSpecificationsGoods.goods.sellPrice" @blur="validatePrice($event, item, index)" />
<input class="uni-input" type="digit" maxlength="9" :disabled="isDisabled || isMarketingGoods(item.multipleSpecificationsGoods.goods, item)" placeholder="请输入价格" placeholder-style="font-size: 14px" v-model="item.multipleSpecificationsGoods.goods.sellPrice" @blur="validatePrice($event, item, index)" />
</template>
<template v-else>
<input class="uni-input" type="digit" :disabled="isDisabled" maxlength="9" placeholder="请输入价格" placeholder-style="font-size: 14px" v-model="item.goods.sellPrice" @blur="validatePrice($event, item, index)" />
<input class="uni-input" type="digit" :disabled="isDisabled || isMarketingGoods(item.goods, item)" maxlength="9" placeholder="请输入价格" placeholder-style="font-size: 14px" v-model="item.goods.sellPrice" @blur="validatePrice($event, item, index)" />
</template>
<!-- <input class="uni-input" type="digit" maxlength="9" placeholder="请输入价格"
placeholder-style="font-size: 14px"
......@@ -68,8 +65,8 @@
<script>
import utils from '@/utils/utils'
import OrderStrategy from './OrderStrategy.vue'
import { shouldShowMarketingIcon as checkMarketingIcon } from '@/utils/marketingFlag'
import { getSkuGoodsPriceTarget, isBelowMinSellPrice, normalizeGoodsPrice, shouldUseMinPriceApproval, applyLegacyMinSellPriceClamp } from '@/utils/minSellPrice'
import { shouldShowMarketingIcon as checkMarketingIcon, isMarketingGoods } from '@/utils/marketingFlag'
import { getSkuGoodsPriceTarget, normalizeGoodsPrice, applyLegacyMinSellPriceClamp } from '@/utils/minSellPrice'
export default {
name: 'SkuGoods',
......@@ -125,6 +122,7 @@ export default {
}
},
methods: {
isMarketingGoods,
// 初始化商品数量方法
initProductNumbers() {
if (this.list && this.list.length > 0) {
......@@ -155,15 +153,10 @@ export default {
},
// 验证价格输入
validatePrice(event, item, index) {
let value = normalizeGoodsPrice(event.detail.value)
const priceTarget = getSkuGoodsPriceTarget(item)
if (shouldUseMinPriceApproval(this.orderTypeCode)) {
if (isBelowMinSellPrice(priceTarget, value)) {
this.$emit('min-price-warning', value)
}
} else if (priceTarget) {
value = applyLegacyMinSellPriceClamp(priceTarget, value)
}
if (!priceTarget || isMarketingGoods(priceTarget, item)) return
let value = normalizeGoodsPrice(event.detail.value)
value = applyLegacyMinSellPriceClamp(priceTarget, value)
if (item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods) {
this.$set(this.list[index].multipleSpecificationsGoods.goods, 'sellPrice', value)
} else if (item.goods) {
......
......@@ -74,12 +74,15 @@ import Popup from '@/components/Popup.vue'
import utils from '@/utils/utils'
import dayjs from 'dayjs'
import Nothing from '../../components/Nothing'
const nextDayNum = 29,
prevDayNum = 29
export default {
inject: ['userInfo'],
components: { Popup, Nothing },
name: 'CustomerDrawer',
props: {
activeDate: String
},
data() {
return {
......@@ -92,12 +95,12 @@ export default {
computed: {
currentDateText() {
let { currentDate } = this,
dayText = dayjs(currentDate).format('M日D日'),
dayText = dayjs(currentDate).format('YY-MM-DD'),
weekText = this.weekCN[currentDate.day()],
/**今天/明天/昨天/N天前/N天后 */
tips = this.getDateTips(currentDate)
desc = this.getDateTips(currentDate)
return `${dayText} ${weekText}(${tips})`
return `${dayText} ${weekText}(${desc})`
},
isAllSelected() {
return this.customerList.length > 0 && this.customerList.every(item => item.selected)
......@@ -148,7 +151,7 @@ export default {
}
},
open() {
this.currentDate = dayjs()
this.currentDate = dayjs(this.activeDate)
this.$nextTick(() => {
this.$refs.popup.open()
})
......@@ -180,7 +183,7 @@ export default {
})
},
getDateTips(currentDate) {
const today = dayjs().startOf('day')
const today = dayjs(this.activeDate).startOf('day')
const targetDate = dayjs(currentDate).startOf('day')
const diffDays = targetDate.diff(today, 'day')
if (diffDays === 0) return '今天'
......@@ -193,16 +196,16 @@ export default {
return ''
},
changeDay(offset) {
if (this.currentDate.add(offset, 'day').isAfter(dayjs().add(6, 'day'))) {
if (this.currentDate.add(offset, 'day').isAfter(dayjs(this.activeDate).add(nextDayNum, 'day'))) {
return
}
if (this.currentDate.add(offset, 'day').isBefore(dayjs().subtract(7, 'day'))) {
if (this.currentDate.add(offset, 'day').isBefore(dayjs(this.activeDate).subtract(prevDayNum, 'day'))) {
return
}
this.currentDate = dayjs(this.currentDate).add(offset, 'day')
},
disabledBtn(offset) {
return this.currentDate.add(offset, 'day').isAfter(dayjs().add(6, 'day')) || this.currentDate.add(offset, 'day').isBefore(dayjs().subtract(7, 'day'))
return this.currentDate.add(offset, 'day').isAfter(dayjs(this.activeDate).add(nextDayNum, 'day')) || this.currentDate.add(offset, 'day').isBefore(dayjs(this.activeDate).subtract(prevDayNum, 'day'))
},
}
......
......@@ -44,14 +44,14 @@
<view class="footer">
<Footer>
<view class="btn default-btn" @click="saveBtn = true" v-if="!saveBtn">编辑</view>
<view class="btn" @click="$emit('submitReport', list)" v-else>保存</view>
<view class="btn" @click="$emit('saveReport', list)" v-else>保存</view>
</Footer>
</view>
</template>
<nothing v-else />
</template>
<EditForm ref="editForm" @onDel="delItem" @onConfirm="confirm" />
<CustomerDrawer ref="CustomerDrawer" @onConfirm="chooseCustomer" />
<CustomerDrawer ref="CustomerDrawer" @onConfirm="chooseCustomer" :activeDate="currentDate" />
</view>
</template>
......@@ -72,7 +72,8 @@ export default {
type: Array,
default: () => []
},
ReportStatus: null
ReportStatus: null,
currentDate:String
},
data() {
return {
......@@ -118,7 +119,7 @@ export default {
data = await uni.$api.dailyTemplateApi.getTodayPlanStoreCount({
merchantId: shopMerchantId,
advanceUserId: uuid,
inviteDate: dayjs().format('YYYY-MM-DD')
inviteDate: this.currentDate
})
this.customerCount = data
} catch (error) {
......
<template>
<view class="report-content ">
<template v-if="!isToday">
<template v-if="!editableDate">
<Detail :templateData="templateData" />
</template>
<template v-else>
<Edit :templateData="templateData" @submitReport="submitReport" @getSaveBtnStatus="saveBtnStatus = $event"
:ReportStatus="ReportStatus" @maxLengthError="$emit('maxLengthError',$event)" />
<Edit :templateData="templateData" @saveReport="saveReport" @getSaveBtnStatus="saveBtnStatus = $event"
:ReportStatus="ReportStatus" @maxLengthError="$emit('maxLengthError',$event)" :currentDate="currentDate" />
</template>
</view>
</template>
......
......@@ -41,7 +41,7 @@
<view class="footer">
<Footer>
<view class="btn default-btn" @click="saveBtn = true" v-if="!saveBtn">编辑</view>
<view class="btn" @click="$emit('submitReport', list)" v-else>保存</view>
<view class="btn" @click="$emit('saveReport', list)" v-else>保存</view>
</Footer>
</view>
</template>
......
......@@ -4,7 +4,7 @@
<Detail :templateData="templateData" />
</template>
<template v-else>
<Edit :templateData="templateData" @submitReport="submitReport" @getSaveBtnStatus="saveBtnStatus = $event"
<Edit :templateData="templateData" @saveReport="saveReport" @getSaveBtnStatus="saveBtnStatus = $event"
:ReportStatus="ReportStatus" />
</template>
</view>
......
......@@ -47,10 +47,12 @@
</view>
<view class="footer">
<Footer>
<view class="btn default-btn" @click="$emit('showNegotiationList')">查看洽谈明细表汇总</view>
<view class="btn default-btn" @click="saveBtn = true" v-if="!saveBtn">编辑</view>
<view class="btn default-btn" @click="$emit('saveReport', list)" v-else>保存</view>
<view class="btn" @click="$emit('submitReport', list)">提交</view>
<view :class="['btn default-btn', { w50: !saveBtn || !showPushBtn }]" @click="$emit('showNegotiationList')">查看洽谈明细表汇总</view>
<view :class="['btn default-btn',{w50:!saveBtn || !showPushBtn}]" @click="saveBtn = true" v-if="!saveBtn">编辑</view>
<template v-else>
<view :class="['btn default-btn',{w50:!showPushBtn}]" @click="$emit('saveReport', list)">保存</view>
<view class="btn" @click="$emit('submitReport', list )" v-if="showPushBtn">上报数据</view>
</template>
</Footer>
</view>
</template>
......@@ -73,14 +75,16 @@ import DailyPopup from '../components/DailyPopup/index.vue'
export default {
name: 'StoreDailyReport',
components: { Table, Nothing, Footer, EditForm, FormItem, DailyPopup },
inject: ['userInfo','sceneType'],
inject: ['userInfo', 'sceneType'],
props: {
templateData: {
type: Array,
default: () => []
},
reportDate: String,
ReportStatus: null
ReportStatus: null,
isToday:Boolean,
SubmissionStatus:null
},
data() {
return {
......@@ -89,6 +93,11 @@ export default {
saveBtn: true
}
},
computed: {
showPushBtn(){
return this.SubmissionStatus != 1 && this.isToday
}
},
watch: {
templateData: {
handler(val) {
......@@ -104,7 +113,7 @@ export default {
},
ReportStatus: {
handler(val) {
this.saveBtn = val !== 0
this.saveBtn = val != 1
},
immediate: true,
deep: true
......@@ -242,6 +251,7 @@ export default {
flex-wrap: wrap;
gap: toRpx(24) toRpx(32);
align-content: start;
.list-item {
width: calc(50% - #{toRpx(16)});
}
......@@ -327,6 +337,7 @@ export default {
}
}
}
.disabled {
opacity: .5;
}
......@@ -390,6 +401,9 @@ export default {
background: #3b73ff1a;
color: #4673ff;
}
.w50{
width: calc(100% / 2 - #{toRpx(32)});
}
}
}
</style>
\ No newline at end of file
<template>
<view class="report-content ">
<view :class="['report-component', { 'opacity': showNegotiationList }, { 'show': showReport }]">
<template v-if="!isToday || ReportStatus == 1">
<template v-if="!editableDate">
<Detail :templateData="templateData" />
</template>
<template v-else>
<Edit :templateData="templateData" @showNegotiationList="changeComponent(true)" @saveReport="saveReport"
@submitReport="submitReport" :reportDate="currentDate" :ReportStatus="ReportStatus"
@getSaveBtnStatus="saveBtnStatus = $event" />
@getSaveBtnStatus="saveBtnStatus = $event" :SubmissionStatus="SubmissionStatus" :isToday="isToday" />
</template>
</view>
......
......@@ -25,7 +25,8 @@
<view class="detail-right">
<component :ref="`ref-${componentName}`" :is="componentName" :templateData="templateData"
:currentDate="currentDate" @changeComponent="changeComponent" @submitReport="submitReport"
@saveReportStatus="saveReportStatus" :ReportStatus="reportStatus" @maxLengthError="maxLengthError" />
@saveReportStatus="saveReportStatus" :ReportStatus="reportStatus" @maxLengthError="maxLengthError"
:SubmissionStatus="submissionStatus" :submissionDate="submissionDate" />
</view>
</view>
<NoticePopup ref="notice" :title="noticeObj.title" :text="noticeObj.text" :type="noticeObj.type || 'success'"
......@@ -56,7 +57,8 @@ export default {
userInfo: this.userInfo,
templateType: () => this.templateType,
dailyReportRecordId: () => this.dailyReportRecordId,
reportStatus: () => this.reportStatus
reportStatus: () => this.reportStatus,
submissionStatus: () => this.submissionStatus
}
},
data() {
......@@ -74,7 +76,9 @@ export default {
assignTitle: '',
assignIcon: '',
dailyReportRecordId: '',
reportStatus: ''
reportStatus: '',
submissionStatus: '',
submissionDate:''
}
},
onBackPress(options) {
......@@ -280,12 +284,12 @@ export default {
async checkReport() {
let componentRef = this.$refs[`ref-${this.componentName}`],
{ templateData, templateType, currentDate } = this
if (templateType != 1) {
if (!componentRef.isToday) return false
} else {
let lastDay = dayjs().subtract(7, 'day')
if (!lastDay.isBefore(dayjs(currentDate), 'day')) return false
}
// if (templateType != 1) {
// if (!componentRef.isToday) return false
// } else {
let lastDay = dayjs().subtract(30, 'day')
if (!lastDay.isBefore(dayjs(currentDate), 'day')) return false
// }
return templateData.length ? componentRef.saveBtnStatus : false
},
......@@ -330,9 +334,10 @@ export default {
this.noticeObj = noticeObj
this.$refs.notice.open()
},
async getReportDetail() {
async getReportDetail(getDailyReportRecordId = false) {
this.reportStatus = ''
this.dailyReportRecordId = ''
this.submissionDate = ''
uni.showLoading({ title: '加载中...', mask: true })
try {
const { uuid, shopMerchantId } = this.userInfo,
......@@ -349,41 +354,46 @@ export default {
if (data) {
uni.hideLoading()
this.dailyReportRecordId = data.id
this.reportStatus = data.reportStatus
let templateData = JSON.parse(data.jsonContent || '[]')
templateData.forEach(e => {
if (e.childrenValue && e.childrenValue.length > 0) {
const children = e.childrenValue.map(c => {
// 每次循环创建新的深拷贝,避免引用共享问题
const originChildren = utils.deepClone(e.origin_children)
originChildren.forEach(item => {
const key = item.key
const val = c[e.key]?.[key]
if (getDailyReportRecordId) return Promise.resolve(data.id)
else {
this.reportStatus = data.reportStatus
let templateData = JSON.parse(data.jsonContent || '[]')
templateData.forEach(e => {
if (e.childrenValue && e.childrenValue.length > 0) {
const children = e.childrenValue.map(c => {
// 每次循环创建新的深拷贝,避免引用共享问题
const originChildren = utils.deepClone(e.origin_children)
originChildren.forEach(item => {
const key = item.key
const val = c[e.key]?.[key]
if (['string', 'number'].includes(typeof val)) {
item.value = val
} else if (val) {
item.value = val.text
item[key] = val.value
}
if (['string', 'number'].includes(typeof val)) {
item.value = val
} else if (val) {
item.value = val.text
item[key] = val.value
}
})
return originChildren
})
return originChildren
})
e.children = children
} else {
if (!e.children) e.children = []
}
})
this.templateData = templateData
} else {
if (this.templateType == 1) {
let lastDay = dayjs().subtract(7, 'day')
if (lastDay.isBefore(dayjs(currentDate), 'day')) this.getDailyTemplate()
else uni.hideLoading()
} else {
if (nowDate == currentDate) this.getDailyTemplate()
else uni.hideLoading()
e.children = children
} else {
if (!e.children) e.children = []
}
})
this.templateData = templateData
this.submissionStatus = data.submissionStatus
this.submissionDate = data.submissionDate
}
} else {
// if (this.templateType == 1) {
let lastDay = dayjs().subtract(30, 'day')
if (lastDay.isBefore(dayjs(currentDate), 'day')) this.getDailyTemplate()
else uni.hideLoading()
// } else {
// if (nowDate == currentDate) this.getDailyTemplate()
// else uni.hideLoading()
// }
}
} catch (error) {
......@@ -412,19 +422,20 @@ export default {
if (this.templateType == 2 && !skip) {
uni.hideLoading()
this.noticeObj = {
title: '确定提交门店日报?',
text: '请确认驻店人员在当前场景下已完成所有个人的驻店日报及洽谈明细。门店日报提交后,将立即发送相关门店经营统计数据到指定消息群。',
title: '确定上报数据?',
text: '请确认驻店人员在当前场景下已完成所有个人的驻店日报及洽谈明细。门店日报上报后,将立即发送相关门店经营统计数据到指定消息群。',
type: 'warning',
buttons: [
{
text: '我再想想',
text: '我再想想',
type: 'default',
callback: _ => {
this.$refs.notice.close()
}
},
{
text: '确定提交',
text: '确定',
type: 'primary',
callback: _ => {
this.submitReport(reportParams, true)
......@@ -437,12 +448,17 @@ export default {
}
this.$refs.notice.close()
uni.showLoading({ title: '提交中...', mask: true })
const data = await uni.$api.dailyTemplateApi.submitReport(reportParams)
uni.hideLoading()
if (data) {
uni.showToast({ title: '操作成功', icon: 'success', mask: true })
this.saveReportStatus(data)
const saveData = await uni.$api.dailyTemplateApi.saveDraft(reportParams)
if (saveData) {
const dailyReportRecordId = await this.getReportDetail(true),
data = await uni.$api.dailyTemplateApi.submitReport({ dailyReportRecordId })
uni.hideLoading()
if (data) {
uni.showToast({ title: '操作成功', icon: 'success', mask: true })
this.saveReportStatus(data)
} else uni.showToast({ title: '操作失败', icon: 'none', mask: true })
} else uni.showToast({ title: '操作失败', icon: 'none', mask: true })
},
saveReportStatus(data) {
if (data)
......
......@@ -17,12 +17,14 @@ export default {
type: Array,
default: () => []
},
ReportStatus: null
ReportStatus: null,
SubmissionStatus: null,
submissionDate:[String, Number]
},
computed: {
/**可编辑日期 */
editableDate() {
let lastDay = dayjs().subtract(7, 'day'),
let lastDay = dayjs().subtract(30, 'day'),
{ currentDate } = this
return lastDay.isBefore(dayjs(currentDate), 'day')
},
......@@ -31,7 +33,7 @@ export default {
},
reportParams() {
let { shopMerchantId, shopMerchantName, uuid, name, merchantId, merchantName } = this.userInfo,
{ currentDate, templateType, dailyReportRecordId, sceneType } = this,
{ currentDate, templateType, dailyReportRecordId, sceneType, SubmissionStatus , submissionDate} = this,
params = {
merchantId: shopMerchantId,
merchantName: shopMerchantName,
......@@ -42,8 +44,12 @@ export default {
templateType: templateType(),
yqMerchantId: merchantId,
yqMerchantName: merchantName,
sceneType
sceneType,
}
if (!SubmissionStatus) params.submissionStatus = 2
else params.submissionStatus = SubmissionStatus
if(!submissionDate) params.submissionDate = dayjs().format('YYYY-MM-DD HH:mm:ss')
else params.submissionDate = dayjs(submissionDate).format('YYYY-MM-DD HH:mm:ss')
if (dailyReportRecordId()) params.dailyReportRecordId = dailyReportRecordId()
return params
}
......@@ -76,52 +82,7 @@ export default {
console.log(error)
}
},
async saveReport(res) {
try {
uni.showLoading({ title: '提交中...', mask: true })
let { reportParams } = this,
list = utils.deepClone(res)
let jsonContent = JSON.stringify(list)
let requestJson = buildAppNormalizedListsFromJsonContent(jsonContent)
list.map(e => {
let childrenValue = []
if (e.children && e.children.length)
e.children.map((c, cIndex) => {
let isArray = Array.isArray(c)
if (isArray) {
childrenValue.push({
[e.key]: {}
})
c.map(i => {
let value = i.value
if (i[i.key])
childrenValue[cIndex][e.key][i.key] = {
text: value,
value: i[i.key]
}
else childrenValue[cIndex][e.key][i.key] = value
})
}
})
e.childrenValue = childrenValue
if (e.type == 'subform') delete e.children
})
reportParams.jsonContent = JSON.stringify(list)
reportParams.requestJson = JSON.stringify(requestJson)
console.log('保存草稿', reportParams)
const data = await uni.$api.dailyTemplateApi.saveDraft(reportParams)
uni.hideLoading()
if (data) {
uni.showToast({ title: '操作成功', icon: 'success', mask: true })
this.$emit('saveReportStatus', data)
} else uni.showToast({ title: '操作失败', icon: 'none', mask: true })
console.log(data)
} catch (error) {
uni.hideLoading()
uni.showToast({ title: error, icon: 'none', mask: true })
}
},
async submitReport(res) {
async saveReport(res, isPush = false) {
try {
const phoneRegex = /^1[3456789]\d{9}$/
uni.showLoading({ title: '提交中...', mask: true })
......@@ -194,11 +155,22 @@ export default {
reportParams.requestJson = JSON.stringify(requestJson)
console.log('提交日报', reportParams)
uni.hideLoading()
this.$emit('submitReport', reportParams)
if (isPush) return Promise.resolve(reportParams)
const data = await uni.$api.dailyTemplateApi.saveDraft(reportParams)
uni.hideLoading()
if (data) {
uni.showToast({ title: '操作成功', icon: 'success', mask: true })
this.$emit('saveReportStatus', data)
} else uni.showToast({ title: '操作失败', icon: 'none', mask: true })
} catch (error) {
console.log(error)
uni.hideLoading()
uni.showToast({ title: error, icon: 'none', mask: true })
}
},
async submitReport(res) {
let reportParams = await this.saveReport(res, true)
this.$emit('submitReport', reportParams)
}
}
}
......@@ -26,6 +26,7 @@
<image
:key="viewKey"
class="content"
:mode="isLongImage ? 'widthFix' : undefined"
:src="views[customerInfo.carModelId] || require('@/assets/images/media/nothing.webp')"
/>
</template>
......@@ -34,6 +35,7 @@
<image
v-if="views.detailUrl"
class="content"
:mode="isLongImage ? 'widthFix' : undefined"
:src="views.detailUrl"
/>
<!-- <image
......@@ -59,7 +61,8 @@ export default {
madiaId: Number,
isByd: Boolean,
show: Boolean,
hasCarBrand: Boolean
hasCarBrand: Boolean,
isLongImage: Boolean
},
components: {
PageTitle
......@@ -90,6 +93,7 @@ export default {
.layout {
width: 100%;
height: 100%;
overflow: hidden;
&-content {
height: 100%;
position: relative;
......
......@@ -197,6 +197,7 @@ export default {
},
// 完成接待
done (e) {
this.$refs.detail?.closeLongImagePopup?.()
this.$refs.home.finishRef.close()
if (this.recording) this.$refs.home.stopAudio()
this.recording = false
......@@ -210,12 +211,18 @@ export default {
},
back () {
const detailRef = this.$refs.detail
if (detailRef.showPayPage) return (detailRef.showPayPage = false)
// 手势/物理返回走父页,须先关掉详情里的长图弹层,否则组件常挂载会把状态带回
if (detailRef?.longImagePopupVisible) {
detailRef.closeLongImagePopup()
return
}
if (detailRef?.showPayPage) return (detailRef.showPayPage = false)
if (!this.id) return uni.navigateBack()
if (this.type != 'preview') return this.$refs.home.finishRef.open()
this.backHome()
},
backHome () {
this.$refs.detail?.closeLongImagePopup?.()
if (this.recording) this.$refs.home.stopAudio(true)
this.$refs.home.finishRef.close()
this.id = ''
......
......@@ -8,7 +8,7 @@
<!-- <view class="alias">商品别名:{{ item.goods.goodsAlias }}</view> -->
<view class="front-gear-box">
<view class="front-gear-input-box">
<view class="front-gear-label" v-if="(item.goods.merchantGoodsPosition || item.goods.upgradeGoodsPosition) && (item.goods.goodsInfo.goodsType == 1 || item.goods.upgradeGoodsType == 1 || item.goods.goodsInfo.goodsType == baseConfigData.selfBuildFilmType || item.goods.upgradeGoodsType == baseConfigData.selfBuildFilmType)">
<view class="front-gear-label" v-if="item.goods.merchantGoodsPosition || item.goods.upgradeGoodsPosition">
{{ formatPosition(item.goods.merchantGoodsPosition || item.goods.upgradeGoodsPosition, positionTypeList) }}
</view>
<view class="front-gear-input">
......
......@@ -20,6 +20,7 @@ export function getGoodsActivityPrice(goods, orderItem) {
}
function buildSingleApprovalItem(item, goods, number) {
if (isMarketingGoods(goods, item)) return null
const sellPrice = normalizeGoodsPrice(goods.sellPrice)
if (!isBelowMinSellPrice(goods, sellPrice)) return null
return {
......@@ -51,6 +52,7 @@ function getPackageDisplayTotal(item, orderTypeCode) {
function buildPackageApprovalItem(item, orderTypeCode) {
const children = (item.packageGoods.goodsList || [])
.map(goods => {
if (isMarketingGoods(goods, item)) return null
const sellPrice = normalizeGoodsPrice(goods.sellPrice)
if (!isBelowMinSellPrice(goods, sellPrice)) return null
return {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!