Commit cbb76217 by 李伟康

```

fix(equity): 修复股权工具创建页面日期选择逻辑

- 修正未来日历组件的startDate属性,从endDate改为startDate
- 添加startDate数据属性,默认为当前日期的下一天
- 注释掉viewKey的更新逻辑,避免不必要的组件重渲染
```
1 parent eca5b1a6
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
ref="futureCalendar" ref="futureCalendar"
:insert="false" :insert="false"
:clearDate="false" :clearDate="false"
:startDate="endDate" :startDate="startDate"
@confirm="confirmCalendar($event,'effectiveDate')" @confirm="confirmCalendar($event,'effectiveDate')"
:date="orderObj.effectiveDate" :date="orderObj.effectiveDate"
showBottomBtn showBottomBtn
...@@ -173,6 +173,7 @@ export default { ...@@ -173,6 +173,7 @@ export default {
formList: utils.deepClone(EQUITY_FORM_LIST), formList: utils.deepClone(EQUITY_FORM_LIST),
titleList: utils.deepClone(EQUITY_FORM_TITLE_LIST), titleList: utils.deepClone(EQUITY_FORM_TITLE_LIST),
endDate: dayjs().format('YYYY-MM-DD'), endDate: dayjs().format('YYYY-MM-DD'),
startDate: dayjs().add(1, 'day').format('YYYY-MM-DD'),
equityFormRule: utils.deepClone(EQUITY_FORM_RULE), equityFormRule: utils.deepClone(EQUITY_FORM_RULE),
orderObj: {}, orderObj: {},
loadComplete: false, loadComplete: false,
...@@ -232,7 +233,7 @@ export default { ...@@ -232,7 +233,7 @@ export default {
if (i.value == val.value) i.current = e.detail.value if (i.value == val.value) i.current = e.detail.value
}) })
}) })
this.viewKey = Date.now() // this.viewKey = Date.now()
}, },
handleCell (val) { handleCell (val) {
if (['calendar', 'futureCalendar'].includes(val.key)) return this.$refs[val.key]?.open() if (['calendar', 'futureCalendar'].includes(val.key)) return this.$refs[val.key]?.open()
......
...@@ -104,7 +104,7 @@ import GlCell from '../../../../components/Form/GlCell.vue' ...@@ -104,7 +104,7 @@ import GlCell from '../../../../components/Form/GlCell.vue'
import Product from './Product.vue' import Product from './Product.vue'
import Package from './Package.vue' import Package from './Package.vue'
import SkuGoods from './SkuGoods.vue' import SkuGoods from './SkuGoods.vue'
import { FORM_LIST, popupTypeEnum, payTypeList, titleList } from '../contant' import { FORM_LIST, popupTypeEnum, titleList } from '../contant'
import { interceptionMixin } from '@/mixin/index' import { interceptionMixin } from '@/mixin/index'
import UploadProofOfPayment from './UploadProofOfPayment.vue' import UploadProofOfPayment from './UploadProofOfPayment.vue'
import dayjs from 'dayjs' import dayjs from 'dayjs'
...@@ -194,7 +194,6 @@ export default { ...@@ -194,7 +194,6 @@ export default {
djPayList: [], // 嘀加收款方对应支付方式 djPayList: [], // 嘀加收款方对应支付方式
merchantPayList: [], // 门店收款方对应支付方式 merchantPayList: [], // 门店收款方对应支付方式
configPayTypeList: [], // 园区店配置支持的支付方式 configPayTypeList: [], // 园区店配置支持的支付方式
payTypeList,
goodsList: [], goodsList: [],
subOrderList: [], subOrderList: [],
otherProduct: [], otherProduct: [],
...@@ -234,7 +233,7 @@ export default { ...@@ -234,7 +233,7 @@ export default {
orderObj.price = this.divideByHundred(owner.price) orderObj.price = this.divideByHundred(owner.price)
orderObj.insurancePrice = this.divideByHundred(insurancePrice) orderObj.insurancePrice = this.divideByHundred(insurancePrice)
orderObj.quotedPriceUpdate = this.divideByHundred(quotedPriceUpdate) orderObj.quotedPriceUpdate = this.divideByHundred(quotedPriceUpdate)
if(!data.vdQuotationGoodsList) data.vdQuotationGoodsList = [] if (!data.vdQuotationGoodsList) data.vdQuotationGoodsList = []
orderObj.vdQuotationGoodsList = data.vdQuotationGoodsList.map( orderObj.vdQuotationGoodsList = data.vdQuotationGoodsList.map(
item => { item => {
item.price = this.divideByHundred(item.goodsPrice) item.price = this.divideByHundred(item.goodsPrice)
...@@ -791,7 +790,9 @@ export default { ...@@ -791,7 +790,9 @@ export default {
total = NP.plus(total, NP.times(item.goods.sellPrice, item.goods.number)) total = NP.plus(total, NP.times(item.goods.sellPrice, item.goods.number))
} else if (item.packageGoods && item.packageGoods.totalPrice) { } else if (item.packageGoods && item.packageGoods.totalPrice) {
console.log(item.packageGoods, '套餐') console.log(item.packageGoods, '套餐')
total = NP.plus(total, item.packageGoods.totalPrice) item.packageGoods.goodsList.map(i => {
total = NP.plus(total, i.sellPrice * i.number)
})
} else if (item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods && item.multipleSpecificationsGoods.goods.sellPrice) { } else if (item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods && item.multipleSpecificationsGoods.goods.sellPrice) {
console.log(item.multipleSpecificationsGoods, '多规格') console.log(item.multipleSpecificationsGoods, '多规格')
total = NP.plus(total, NP.times(item.multipleSpecificationsGoods.goods.sellPrice, item.multipleSpecificationsGoods.number || 1)) total = NP.plus(total, NP.times(item.multipleSpecificationsGoods.goods.sellPrice, item.multipleSpecificationsGoods.number || 1))
...@@ -806,19 +807,11 @@ export default { ...@@ -806,19 +807,11 @@ export default {
// 获取园区店支付方式 // 获取园区店支付方式
async getConfig () { async getConfig () {
const { merchantId } = this.userInfo,
res = await uni.$api.boutiqueApi.getYqStoreConfig({
yqMerchantId: merchantId
})
console.log(123)
let m = res.supportPayTypes || []
let n = this.payTypeList
let list = n.filter(k => {
let idx = m.find(j => j == k.value)
return idx >= 0
})
this.djPayList = [ this.djPayList = [
...list?.filter(v => ![2, 5].includes(Number(v.value))), {
value: '1',
name: '微信支付'
},
{ {
name: '对公转账', name: '对公转账',
value: '6' value: '6'
...@@ -828,7 +821,10 @@ export default { ...@@ -828,7 +821,10 @@ export default {
value: '7' value: '7'
}, },
] ]
this.merchantPayList = [...list?.filter(v => v.value == 2)] this.merchantPayList = [{
value: '2',
name: '门店收款'
},]
this.changePayee() this.changePayee()
}, },
changePayee () { changePayee () {
...@@ -999,8 +995,8 @@ export default { ...@@ -999,8 +995,8 @@ export default {
}, },
clearPayMentDocList () { clearPayMentDocList () {
this.showUpload = false this.showUpload = false
this.orderInfo.paymentDocList = [] this.orderObj.paymentDocList = []
this.orderInfo.transactionNo = '' this.orderObj.transactionNo = ''
} }
} }
} }
......
...@@ -221,25 +221,38 @@ export default { ...@@ -221,25 +221,38 @@ export default {
value = '0' value = '0'
} }
// 检查最小价格 // 检查最小价格
// if (!item.multipleSpecificationsGoods) { if (!item.multipleSpecificationsGoods) {
// // 普通商品的最小价格检查 if (item.packageGoods) {
// if (item.goods.validMinSellPrice === 'Y' && item.goods.minSellPrice && parseFloat(value) < parseFloat(item.goods.minSellPrice)) { item.packageGoods?.goodsList[cindex]
// uni.showToast({ let packageItem = item.packageGoods?.goodsList[cindex]
// title: '单价不可低于商品最低价', if (packageItem && packageItem.validMinSellPrice === 'N' && packageItem.minSellPrice && parseFloat(value) < parseFloat(packageItem.minSellPrice)) {
// icon: 'none' uni.showToast({
// }) title: '价格不可低于商品最低价',
// value = item.goods.minSellPrice.toString() icon: 'none'
// } })
// } else if (item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods) { value = packageItem.minSellPrice.toString()
// // 多规格商品的最小价格检查 }
// if (item.multipleSpecificationsGoods.goods.validMinSellPrice === 'Y' && item.multipleSpecificationsGoods.goods.minSellPrice && parseFloat(value) < parseFloat(item.multipleSpecificationsGoods.goods.minSellPrice)) { } else {
// uni.showToast({ // 普通商品的最小价格检查
// title: '单价不可低于商品最低价', if (item.goods.validMinSellPrice === 'Y' && item.goods.minSellPrice && parseFloat(value) < parseFloat(item.goods.minSellPrice)) {
// icon: 'none' uni.showToast({
// }) title: '价格不可低于商品最低价',
// value = item.multipleSpecificationsGoods.goods.minSellPrice.toString() icon: 'none'
// } })
// } value = item.goods.minSellPrice.toString()
}
}
} else if (item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods) {
// 多规格商品的最小价格检查
if (item.multipleSpecificationsGoods.goods.validMinSellPrice === 'Y' && item.multipleSpecificationsGoods.goods.minSellPrice && parseFloat(value) < parseFloat(item.multipleSpecificationsGoods.goods.minSellPrice)) {
uni.showToast({
title: '价格不可低于商品最低价',
icon: 'none'
})
value = item.multipleSpecificationsGoods.goods.minSellPrice.toString()
}
}
if (!item.multipleSpecificationsGoods) { if (!item.multipleSpecificationsGoods) {
if (item.goodsFlag == 1) { if (item.goodsFlag == 1) {
//如果没有多规格商品,更新普通商品的价格 //如果没有多规格商品,更新普通商品的价格
...@@ -439,12 +452,11 @@ export default { ...@@ -439,12 +452,11 @@ export default {
.number { .number {
margin-left: toRpx(16); margin-left: toRpx(16);
} }
.front-number-box{ .front-number-box {
position: absolute; position: absolute;
top: 50%; top: 50%;
right: toRpx(24); right: toRpx(24);
transform: translateY(-50%); transform: translateY(-50%);
} }
} }
} }
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
</view> </view>
<view class="uni-calendar__header"> <view class="uni-calendar__header">
<view <view
class="uni-calendar__header-btn-box" :class="['uni-calendar__header-btn-box prev-btn',{'show-prev-btn':showPreBtn}]"
@click.stop="pre" @click.stop="pre"
> >
<view class="uni-calendar__header-btn uni-calendar--left"></view> <view class="uni-calendar__header-btn uni-calendar--left"></view>
...@@ -291,7 +291,12 @@ export default { ...@@ -291,7 +291,12 @@ export default {
showNextBtn () { showNextBtn () {
let { cale, endDate, nowDate } = this, let { cale, endDate, nowDate } = this,
maxDate = cale.getDate(endDate, -1, 'month') maxDate = cale.getDate(endDate, -1, 'month')
return cale.dateCompare(`${nowDate.year}/${nowDate.month}`, `${maxDate.year}/${maxDate.month}`) return !endDate ? true :cale.dateCompare(`${nowDate.year}/${nowDate.month}`, `${maxDate.year}/${maxDate.month}`)
},
showPreBtn () {
let { cale, startDate, nowDate } = this,
minDate = cale.getDate(startDate, -1, 'month')
return !startDate ? true : cale.dateCompare(`${nowDate.year}/${nowDate.month}`, `${minDate.year}/${minDate.month}`)
} }
}, },
watch: { watch: {
...@@ -656,10 +661,10 @@ $uni-text-color-grey: #999; ...@@ -656,10 +661,10 @@ $uni-text-color-grey: #999;
width: 50px; width: 50px;
height: 50px; height: 50px;
} }
.next-btn { .next-btn ,.prev-btn{
opacity: 0; opacity: 0;
} }
.show-next-btn { .show-next-btn ,.show-prev-btn{
opacity: 1; opacity: 1;
} }
.uni-calendar__header-btn { .uni-calendar__header-btn {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!