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