Commit e9559a37 by 李伟康

修改活动库存

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