Commit e9559a37 by 李伟康

修改活动库存

1 parent 47e16908
......@@ -32,11 +32,15 @@
:key="item.id"
:label="item.id"
>
<img
<!-- <img
v-show="infoIdList.includes(item.id)"
class="icon-check"
src="@/assets/icon-check.png"
/>
/> -->
<div
class="icon-number icon-check"
v-show="infoIdList.includes(item.id)"
>{{infoIdList.findIndex(e => item.id == e) + 1}}</div>
<img
class="goods-img"
:src="item.goodsImage"
......
......@@ -448,25 +448,22 @@ export default {
prop: 'verificationNumber'
},
{
label: '定金(元)',
name: 'activityPrice',
width: 140,
formatter: cellValue => {
return (cellValue.activityPrice / 100).toFixed(2)
}
label: '定金/元',
prop: 'activityPrice',
addHtml: 'joinText',
width: 100
},
{
label: '众筹价(元)',
name: 'crowdFundingPrice',
width: 140,
formatter: cellValue => {
return (cellValue.crowdFundingPrice / 100).toFixed(2)
}
label: '众筹价/元',
prop: 'crowdFundingPrice',
addHtml: 'joinText',
width: 100
},
{
label: '库存',
prop: 'goodsStock',
width: 110
prop: 'activityGoodsStock',
addHtml: 'joinText',
width: 100
},
{
label: '创建日期',
......@@ -729,7 +726,7 @@ export default {
formatterNumber (cell, key) {
const str = []
cell?.goodsList?.map(e => {
str.push(key != 'goodsStock' ? (e[key] / 100).toFixed(2) : e[key])
str.push(key != 'activityGoodsStock' ? (e[key] / 100).toFixed(2) : e[key])
})
return str.length > 0 ? str.join(',') : '--'
}
......
......@@ -169,15 +169,15 @@
</div>
<div
class="goods-form-item"
slot="goodsStock"
slot="activityGoodsStock"
>
<el-input
v-model="i.goodsStock"
v-model="i.activityGoodsStock"
:data-index="index"
style="width: 136px"
:disabled="isDisabled"
type="number"
@input="formatAppend(i.goodsStock,'goodsStock',index, true)"
@input="formatAppend(i.activityGoodsStock,'activityGoodsStock',index, true)"
></el-input>
</div>
</glsx-combi-form>
......@@ -1606,13 +1606,15 @@ export default {
trigger: 'change'
}
],
goodsStock: [
activityGoodsStock: [
{ required: true, message: '请设置活动库存', trigger: 'change' },
{
validator: (rule, value, callback) => {
const { dataset: { index } } = event.target || event.srcElement
const { dataset: { index } } = event.target || event.srcElement,
{ selectedProInfo } = this
if (typeof index == 'undefined' && value > -1) return callback()
if (value < 1) return callback(new Error('请设置活动库存'))
if(value > selectedProInfo[index].goodsStock) return callback(new Error('不能大于商品库存'))
},
trigger: 'change'
}
......@@ -1636,8 +1638,8 @@ export default {
},
{
label: '活动库存',
name: 'goodsStock',
addHtml: 'goodsStock'
name: 'activityGoodsStock',
addHtml: 'activityGoodsStock'
}
],
// 服务说明
......@@ -2451,8 +2453,8 @@ export default {
},
formatAppend (val, target, index, isInt) {
let str = String(val)
if (str.split('.').length > 1) val = str.slice(0, str.indexOf('.') + 3)
if (isInt) val = Math.floor(val)
if (str.split('.').length) val = str.slice(0, str.indexOf('.') + 3)
this.editForm.goodsList[index][target] = val < 0 ? 1 : val
},
handleSingleSelectConfirm (list) {
......@@ -2468,7 +2470,7 @@ export default {
if (i.id == e.goodsId) arr[index] = {
...arr[index],
activityPrice: e.activityPrice,
goodsStock: e.goodsStock,
activityGoodsStock: e.goodsStock,
crowdFundingPrice: e.crowdFundingPrice,
}
})
......@@ -2795,7 +2797,7 @@ export default {
activityPrice: (e.activityPrice / 100).toFixed(2),
crowdFundingPrice: (e.crowdFundingPrice / 100).toFixed(2),
goodsId: e.goodsId,
goodsStock: e.activityGoodsStock
activityGoodsStock: e.activityGoodsStock
})
selectedProInfo.push({
id: e.goodsId,
......@@ -3129,7 +3131,7 @@ export default {
flag = false
break
}
if (!item.goodsStock) {
if (!item.activityGoodsStock) {
this.$message({
message: '有未设置活动库存的项',
type: 'error'
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!