Commit 2aaec9fc by 前端

商品类型单级可选处理、对兑换价、批量改价处理、售后订单详情、商品订单详情用积分字段做判断

1 parent aff7e6eb
...@@ -117,7 +117,7 @@ export default { ...@@ -117,7 +117,7 @@ export default {
label: '单价 (元)', label: '单价 (元)',
prop: 'salePrice', prop: 'salePrice',
formatter: cell => { formatter: cell => {
return cell.businessType == 1 ? cell.redeemPoints + '积分' + cell.salePrice + '元' : cell.salePrice return cell.redeemPoints ? cell.redeemPoints + '积分' + cell.salePrice + '元' : cell.salePrice + '元'
} }
}, },
{ {
...@@ -134,7 +134,7 @@ export default { ...@@ -134,7 +134,7 @@ export default {
label: '实收金额 (元)', label: '实收金额 (元)',
prop: 'orderAmount', prop: 'orderAmount',
formatter: cell => { formatter: cell => {
return cell.businessType == 1 ? cell.redeemPoints + '积分' + cell.salePrice + '元' : (cell.salePrice * cell.sellQty).toFixed(2) return cell.redeemPoints ? cell.redeemPoints + '积分' + cell.salePrice + '元' : (cell.salePrice * cell.sellQty).toFixed(2) + '元'
} }
} }
] ]
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<div v-if="!editing" class="edit"> <div v-if="!editing" class="edit">
<span class="price">{{ redeemPoints || '--' }}积分</span> <span class="price">{{ redeemPoints || '--' }}积分</span>
+ +
<span class="price">{{ salePrice || '--' }}元</span> <span class="price">{{ salePrice || 0 }}元</span>
<img :src="require('@/assets/images/edit.png')" alt="" @click="editPrice"> <img :src="require('@/assets/images/edit.png')" alt="" @click="editPrice">
</div> </div>
<!-- <el-input v-else v-focus clearable v-model="salePrice" onkeyup="value = value ? value.replace(/^0\d/g, '0').replace(/[^\d.]/g, '').replace(/^\./g, '').replace(/^\d{6}\d+(\.\d+)?/g, value.substr(0,6)).replace(/\.{2,}/g, '').replace('.', '$#$')--> <!-- <el-input v-else v-focus clearable v-model="salePrice" onkeyup="value = value ? value.replace(/^0\d/g, '0').replace(/[^\d.]/g, '').replace(/^\./g, '').replace(/^\d{6}\d+(\.\d+)?/g, value.substr(0,6)).replace(/\.{2,}/g, '').replace('.', '$#$')-->
...@@ -192,17 +192,17 @@ export default { ...@@ -192,17 +192,17 @@ export default {
// return (this.redeemPoints == this.goodsInfo.redeemPoints) && (this.salePrice == this.goodsInfo.salePrice) // return (this.redeemPoints == this.goodsInfo.redeemPoints) && (this.salePrice == this.goodsInfo.salePrice)
// }, // },
setPriceFn(e) { setPriceFn(e) {
if (!this.salePrice || !this.redeemPoints) { if (!this.redeemPoints) {
this.salePrice = this.goodsInfo.salePrice this.salePrice = this.goodsInfo.salePrice
this.redeemPoints = this.goodsInfo.redeemPoints this.redeemPoints = this.goodsInfo.redeemPoints
this.$message.error(!this.salePrice ? '请输入大于0的金额' : '请输入大于0的积分') this.$message.error('请输入大于0的积分')
return return
} }
let params = { let params = {
businessType: 1, businessType: 1,
modifyPriceRequestList: [{ modifyPriceRequestList: [{
id: this.goodsInfo.id, id: this.goodsInfo.id,
salePrice: this.salePrice, salePrice: this.salePrice || 0,
redeemPoints: Number(this.redeemPoints), redeemPoints: Number(this.redeemPoints),
}], }],
} }
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
<GLTableButton :buttonList="buttonList" :buttonItem="scope" :buttonNum="3"></GLTableButton> <GLTableButton :buttonList="buttonList" :buttonItem="scope" :buttonNum="3"></GLTableButton>
</div> </div>
</GLTable> </GLTable>
<setPriceDialog v-if="isVisible" :isConversionRate="isConversionRate" :visible="isVisible" <setPriceDialog v-if="isVisible" :echoParams="echoParams" :isConversionRate="isConversionRate" :visible="isVisible"
@handleClose="handleClose" @confirm="confirmPriceChange"> @handleClose="handleClose" @confirm="confirmPriceChange">
</setPriceDialog> </setPriceDialog>
</div> </div>
...@@ -67,6 +67,7 @@ export default { ...@@ -67,6 +67,7 @@ export default {
batchCount: '', batchCount: '',
searchForm: {}, searchForm: {},
editParams: {}, editParams: {},
echoParams:{},
isConversionRate: false, isConversionRate: false,
goodsFormObj: { goodsFormObj: {
goodsPosition: 2, goodsPosition: 2,
...@@ -140,7 +141,7 @@ export default { ...@@ -140,7 +141,7 @@ export default {
} }
}, },
{ {
label: '设置销售价(元)', label: '兑换价',
width: 180, width: 180,
addHtml: 'setPriceSlot', addHtml: 'setPriceSlot',
prop: 'salePrice', prop: 'salePrice',
...@@ -156,12 +157,12 @@ export default { ...@@ -156,12 +157,12 @@ export default {
width: 150, width: 150,
prop: 'marketPrice' prop: 'marketPrice'
}, },
{ // {
label: '真实销量', // label: '真实销量',
width: 150, // width: 150,
prop: 'saleAmount', // prop: 'saleAmount',
sortable: 'custom', // sortable: 'custom',
}, // },
{ {
label: '库存', label: '库存',
width: 150, width: 150,
...@@ -186,7 +187,7 @@ export default { ...@@ -186,7 +187,7 @@ export default {
buttonList: [ buttonList: [
{ {
type: 'el-button', type: 'el-button',
name: '商品详情', name: '详情',
attrs: { attrs: {
type: 'text', type: 'text',
fn: '商品详情' fn: '商品详情'
...@@ -197,7 +198,7 @@ export default { ...@@ -197,7 +198,7 @@ export default {
}, },
{ {
type: 'el-button', type: 'el-button',
name: '下架至仓库', name: '下架',
attrs: { attrs: {
type: 'text', type: 'text',
fn: '下架至仓库' fn: '下架至仓库'
...@@ -232,6 +233,10 @@ export default { ...@@ -232,6 +233,10 @@ export default {
id: scope.id, id: scope.id,
sellPrice: scope.sellPrice sellPrice: scope.sellPrice
} }
this.echoParams = {
redeemPoints: scope.redeemPoints,
salePrice: scope.salePrice
}
this.isConversionRate = true this.isConversionRate = true
this.isVisible = true this.isVisible = true
}, },
...@@ -342,8 +347,8 @@ export default { ...@@ -342,8 +347,8 @@ export default {
params = { params = {
modifyPriceRequestList: [{ modifyPriceRequestList: [{
id: this.editParams.id, id: this.editParams.id,
redeemPoints: Number(((+Math.ceil(this.editParams.sellPrice)) + (+this.batchCount)).toFixed(2)), redeemPoints: Number((+this.batchCount).toFixed(2)),
salePrice: this.batchPrice salePrice: this.batchPrice || 0
}], }],
} }
} }
...@@ -378,7 +383,16 @@ export default { ...@@ -378,7 +383,16 @@ export default {
const {categoryCode} = this.searchForm const {categoryCode} = this.searchForm
this.searchForm.businessType = 1 this.searchForm.businessType = 1
this.searchForm.categoryCode = categoryCode && categoryCode.length ? categoryCode.pop() : '' this.searchForm.categoryCode = categoryCode && categoryCode.length ? categoryCode.pop() : ''
// 商品类型单级可选处理
if (0 < this.searchForm.categoryCode.length && this.searchForm.categoryCode.length < 6) {
let name = this.searchForm.categoryCode.length == 2 ? 'categoryCode1' : 'categoryCode2'
this.searchForm[name] = this.searchForm.categoryCode
delete this.searchForm.categoryCode
}
resolve() resolve()
}) })
}, },
......
...@@ -6,7 +6,13 @@ ...@@ -6,7 +6,13 @@
<span> <span>
{{ isConversionRate ? '兑换价 = ' : '兑换价 = 供货价1:1积分 +' }} {{ isConversionRate ? '兑换价 = ' : '兑换价 = 供货价1:1积分 +' }}
</span> </span>
<el-input size="small" type="text" onkeyup="value=value.replace(/[^\d]/g,'').replace(/^[0]+[0-9]*$/gi,'')"
<el-input v-if="isConversionRate" size="small" type="text"
onkeyup="value = value.replace(/[^\d]/g,'').replace(/^[0]+[0-9]*$/gi,'')"
v-model="batchCount" placeholder="请输入积分">
<span slot="append">积分</span>
</el-input>
<el-input v-else size="small" type="text" onkeyup="value = value.replace(/[^\d]/g,'').replace(/^0\d/g, '0')"
v-model="batchCount" placeholder="请输入积分"> v-model="batchCount" placeholder="请输入积分">
<span slot="append">积分</span> <span slot="append">积分</span>
</el-input> </el-input>
...@@ -31,23 +37,28 @@ export default { ...@@ -31,23 +37,28 @@ export default {
visible: { visible: {
type: Boolean, type: Boolean,
default: false default: false
},
echoParams: {
type: Object,
default: () => {
}
} }
}, },
data() { data() {
return { return {
batchCount: '', batchCount: this.isConversionRate ? this.echoParams.redeemPoints : '',
batchPrice: '' batchPrice: this.isConversionRate ? this.echoParams.salePrice : '',
} }
}, },
methods: { methods: {
confirmPriceChange() { confirmPriceChange() {
const batchParams ={ const batchParams = {
batchPrice:this.batchPrice, batchPrice: this.batchPrice,
batchCount:this.batchCount batchCount: this.batchCount
} }
this.$emit('confirm',batchParams ) this.$emit('confirm', batchParams)
}, },
handleClose() { handleClose() {
this.$emit('handleClose') this.$emit('handleClose')
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<div v-if="!editing" class="edit"> <div v-if="!editing" class="edit">
<span class="price">{{ redeemPoints || '--' }}积分</span> <span class="price">{{ redeemPoints || '--' }}积分</span>
<span>+</span> <span>+</span>
<span class="price">{{ salePrice || '--' }}元</span> <span class="price">{{ salePrice || 0 }}元</span>
<img :src="require('@/assets/images/edit.png')" alt="" @click="editPrice"> <img :src="require('@/assets/images/edit.png')" alt="" @click="editPrice">
</div> </div>
...@@ -188,10 +188,10 @@ export default { ...@@ -188,10 +188,10 @@ export default {
return (this.redeemPoints == this.goodsInfo.redeemPoints) && (this.salePrice == this.goodsInfo.salePrice) return (this.redeemPoints == this.goodsInfo.redeemPoints) && (this.salePrice == this.goodsInfo.salePrice)
}, },
setPriceFn(type,e) { setPriceFn(type,e) {
if (!this.salePrice || !this.redeemPoints) { if (!this.redeemPoints) {
this.salePrice = this.goodsInfo.salePrice this.salePrice = this.goodsInfo.salePrice
this.redeemPoints = this.goodsInfo.redeemPoints this.redeemPoints = this.goodsInfo.redeemPoints
this.$message.error(!this.salePrice ? '请输入大于0的金额' : '请输入大于0的积分') this.$message.error('请输入大于0的积分')
return return
} }
...@@ -199,7 +199,7 @@ export default { ...@@ -199,7 +199,7 @@ export default {
businessType:1, businessType:1,
modifyPriceRequestList: [{ modifyPriceRequestList: [{
id: this.goodsInfo.id, id: this.goodsInfo.id,
salePrice: this.salePrice, salePrice: this.salePrice || 0,
redeemPoints: Number(this.redeemPoints), redeemPoints: Number(this.redeemPoints),
}], }],
} }
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
<span>{{ scope.scope.shelvesStatus == 1001 ? '可上架' : '已下架' }}</span> <span>{{ scope.scope.shelvesStatus == 1001 ? '可上架' : '已下架' }}</span>
</div> </div>
</GLTable> </GLTable>
<setPriceDialog v-if="isVisible" :isConversionRate="isConversionRate" :visible="isVisible" <setPriceDialog v-if="isVisible" :echoParams="echoParams" :isConversionRate="isConversionRate" :visible="isVisible"
@handleClose="handleClose" @confirm="confirmPriceChange"> @handleClose="handleClose" @confirm="confirmPriceChange">
</setPriceDialog> </setPriceDialog>
</div> </div>
...@@ -69,6 +69,7 @@ export default { ...@@ -69,6 +69,7 @@ export default {
batchPrice: '', batchPrice: '',
batchCount: '', batchCount: '',
editParams: {}, editParams: {},
echoParams:{},
isConversionRate: false, isConversionRate: false,
goodsFormObj: { goodsFormObj: {
goodsPosition: 1, goodsPosition: 1,
...@@ -172,7 +173,7 @@ export default { ...@@ -172,7 +173,7 @@ export default {
buttonList: [ buttonList: [
{ {
type: 'el-button', type: 'el-button',
name: '商品详情', name: '详情',
attrs: { attrs: {
type: 'text', type: 'text',
fn: '商品详情' fn: '商品详情'
...@@ -197,7 +198,7 @@ export default { ...@@ -197,7 +198,7 @@ export default {
}, },
{ {
type: 'el-button', type: 'el-button',
name: '移出仓库', name: '移出',
attrs: { attrs: {
type: 'text', type: 'text',
fn: '移出仓库' fn: '移出仓库'
...@@ -225,6 +226,11 @@ export default { ...@@ -225,6 +226,11 @@ export default {
id: scope.id, id: scope.id,
sellPrice: scope.sellPrice sellPrice: scope.sellPrice
} }
// const this.pr
this.echoParams = {
redeemPoints: scope.redeemPoints,
salePrice: scope.salePrice
}
this.isConversionRate = true this.isConversionRate = true
this.isVisible = true this.isVisible = true
}, },
...@@ -257,7 +263,7 @@ export default { ...@@ -257,7 +263,7 @@ export default {
}, },
// 取消批量改价弹框 // 取消批量改价弹框
handleClose() { handleClose() {
this.batchPrice = '' // this.batchPrice = ''
this.isVisible = false this.isVisible = false
}, },
// 点击批量改价打开弹框 // 点击批量改价打开弹框
...@@ -293,8 +299,8 @@ export default { ...@@ -293,8 +299,8 @@ export default {
params = { params = {
modifyPriceRequestList: [{ modifyPriceRequestList: [{
id: this.editParams.id, id: this.editParams.id,
redeemPoints: Number(((+Math.ceil(this.editParams.sellPrice)) + (+this.batchCount)).toFixed(2)), redeemPoints: Number((+this.batchCount).toFixed(2)),
salePrice: this.batchPrice salePrice: this.batchPrice || 0
}], }],
} }
} }
...@@ -336,7 +342,7 @@ export default { ...@@ -336,7 +342,7 @@ export default {
type: 'warning', type: 'warning',
callback: action => { callback: action => {
if (action == 'confirm') { if (action == 'confirm') {
if (operate == '上架销售' && (!isAll && (!item.redeemPoints || !item.salePrice) ) || (isAll && !conversionRateAll)) { if (operate == '上架销售' && (!isAll && (!item.redeemPoints || !item.salePrice)) || (isAll && !conversionRateAll)) {
this.$message.error('请先输入兑换价') this.$message.error('请先输入兑换价')
return return
} }
...@@ -372,6 +378,14 @@ export default { ...@@ -372,6 +378,14 @@ export default {
this.searchForm.businessType = 1 this.searchForm.businessType = 1
const {categoryCode} = this.searchForm const {categoryCode} = this.searchForm
this.searchForm.categoryCode = categoryCode && categoryCode.length ? categoryCode.pop() : '' this.searchForm.categoryCode = categoryCode && categoryCode.length ? categoryCode.pop() : ''
// 商品类型单级可选处理
if (0 < this.searchForm.categoryCode.length && this.searchForm.categoryCode.length < 6) {
let name = this.searchForm.categoryCode.length == 2 ? 'categoryCode1' : 'categoryCode2'
this.searchForm[name] = this.searchForm.categoryCode
delete this.searchForm.categoryCode
}
resolve() resolve()
}) })
}, },
......
...@@ -95,7 +95,7 @@ export default { ...@@ -95,7 +95,7 @@ export default {
label: '申请金额 (元)', label: '申请金额 (元)',
prop: 'refundPrice', prop: 'refundPrice',
formatter: cell => { formatter: cell => {
return cell.businessType == 1 ? cell.redeemPoints + '积分' + cell.refundPrice + '元' : cell.refundPrice + '元' return cell.redeemPoints ? cell.redeemPoints + '积分' + cell.refundPrice + '元' : cell.refundPrice + '元'
} }
}, },
{ {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!