Commit efe197e1 by huaying

fix: 积分购现金权限

parent b9c7e3d5
...@@ -23,6 +23,11 @@ export default { ...@@ -23,6 +23,11 @@ export default {
request.get('/api-auth/get-login-user-info').then(res => { request.get('/api-auth/get-login-user-info').then(res => {
if (res.data.errorCode === 0) { if (res.data.errorCode === 0) {
this.userId = res.data.result.userId; this.userId = res.data.result.userId;
const limitCodeType = res.data.result.limitCodeList;
if (limitCodeType) {
const jifenquanxian = limitCodeType.indexOf('integralCashPurchase') != -1;
localStorage.setItem('limitCodeType', jifenquanxian);
}
} else { } else {
this.$message.error(res.data.message); this.$message.error(res.data.message);
} }
......
...@@ -47126,7 +47126,8 @@ ...@@ -47126,7 +47126,8 @@
.el-popover { .el-popover {
position: absolute; position: absolute;
background: #fff; background: #fff;
min-width: 150px; /* min-width: 150px; */
min-width: auto;
border-radius: 4px; border-radius: 4px;
border: 1px solid #ebeef5; border: 1px solid #ebeef5;
padding: 12px; padding: 12px;
...@@ -28,7 +28,23 @@ ...@@ -28,7 +28,23 @@
<td :key="index3" v-for="(item3, index3) in item2" v-if="intergralModal.type === 'cash'"> <td :key="index3" v-for="(item3, index3) in item2" v-if="intergralModal.type === 'cash'">
<span v-if="item2.length - index3 > 2" style="width:120px;display:inline-block">{{ item3.valueName }}</span> <span v-if="item2.length - index3 > 2" style="width:120px;display:inline-block">{{ item3.valueName }}</span>
<p v-else> <p v-else>
<el-input v-model="item3.valueName" placeholder="请输入内容" @blur="inputLimit(item3, index3, item2)" /> <el-popover
popper-class="noClass"
v-if="jifenquanxian"
placement="bottom"
trigger="hover"
content="无积分购现金权限">
<el-input slot="reference"
v-model="item3.valueName"
placeholder="请输入内容"
:disabled="jifenquanxian && intergralModal.headerList[index3].proName == '现金'"
@blur="inputLimit(item3, index3, item2)" />
</el-popover>
<el-input
v-else
v-model="item3.valueName"
placeholder="请输入内容"
@blur="inputLimit(item3, index3, item2)" />
</p> </p>
</td> </td>
</tr> </tr>
...@@ -50,7 +66,23 @@ ...@@ -50,7 +66,23 @@
/> />
</p> </p>
<p><el-input v-model="giftProSkuIntegral" placeholder="请输入内容" @blur="limitSkuIntegral" /></p> <p><el-input v-model="giftProSkuIntegral" placeholder="请输入内容" @blur="limitSkuIntegral" /></p>
<p><el-input v-model="giftProSkuCash" placeholder="请输入内容" @blur="limitSkuCash" /></p> <p >
<el-popover
placement="bottom"
trigger="hover"
v-if="jifenquanxian"
content="无积分购现金权限">
<el-input slot="reference"
v-model="giftProSkuCash"
placeholder="请输入内容"
@blur="limitSkuCash"
:disabled="jifenquanxian" />
</el-popover>
<el-input v-else
v-model="giftProSkuCash"
placeholder="请输入内容"
@blur="limitSkuCash" />
</p>
</div> </div>
</div> </div>
<div class="gift-spu" v-if="intergralModal.type === 'stock' && intergralModal.tableSkuData.length === 0"> <div class="gift-spu" v-if="intergralModal.type === 'stock' && intergralModal.tableSkuData.length === 0">
...@@ -80,6 +112,7 @@ export default { ...@@ -80,6 +112,7 @@ export default {
}, },
data () { data () {
return { return {
jifenquanxian: '',
payload: [], payload: [],
giftProSkuCode: '', giftProSkuCode: '',
giftProSkuIntegral: '', giftProSkuIntegral: '',
...@@ -89,6 +122,7 @@ export default { ...@@ -89,6 +122,7 @@ export default {
}; };
}, },
created () { created () {
this.jifenquanxian = localStorage.getItem('limitCodeType') == 'true';
if (this.intergralModal.type === 'cash') { if (this.intergralModal.type === 'cash') {
this.title = '编辑积分费用或现金费用'; this.title = '编辑积分费用或现金费用';
} else if (this.intergralModal.type === 'stock') { } else if (this.intergralModal.type === 'stock') {
...@@ -101,6 +135,12 @@ export default { ...@@ -101,6 +135,12 @@ export default {
this.virtualStock = this.intergralModal.virtualStock; // 库存 this.virtualStock = this.intergralModal.virtualStock; // 库存
this.currentStock = this.intergralModal.virtualStock; this.currentStock = this.intergralModal.virtualStock;
}, },
// mounted () {
// setTimeout(_ => {
// this.jifenquanxian = localStorage.getItem('limitCodeType') == 'true';
// console.log(typeof this.jifenquanxian, ((!this.jifenquanxian) == false), 'this.jifenquanxian');
// }, 500);
// },
methods: { methods: {
limitSkuCode () { limitSkuCode () {
const reg = /^[0-9a-zA-Z\-]+?$/; const reg = /^[0-9a-zA-Z\-]+?$/;
...@@ -132,6 +172,7 @@ export default { ...@@ -132,6 +172,7 @@ export default {
} }
}, },
limitSkuCash () { limitSkuCash () {
if (this.jifenquanxian) return;
if (Number(this.giftProSkuCash) < 0) { if (Number(this.giftProSkuCash) < 0) {
this.$message.error('请输入大于0的数字'); this.$message.error('请输入大于0的数字');
this.giftProSkuCash = ''; this.giftProSkuCash = '';
...@@ -197,7 +238,7 @@ export default { ...@@ -197,7 +238,7 @@ export default {
} else { } else {
item2.valueName = Number(item2.valueName).toFixed(0); item2.valueName = Number(item2.valueName).toFixed(0);
} }
} else if (item1.length - index2 === 1) { } else if (item1.length - index2 === 1 && !this.jifenquanxian) {
// 现金 // 现金
// 现金 // 现金
if (Number(item2.valueName < 0)) { if (Number(item2.valueName < 0)) {
...@@ -367,7 +408,7 @@ export default { ...@@ -367,7 +408,7 @@ export default {
}, },
}; };
</script> </script>
<style scoped> <style lang="less" scoped>
.spu-table { .spu-table {
width: 580px; width: 580px;
font-size: 14px; font-size: 14px;
......
...@@ -22,14 +22,32 @@ ...@@ -22,14 +22,32 @@
</el-table-column> </el-table-column>
<el-table-column prop="cashCost" label="现金"> <el-table-column prop="cashCost" label="现金">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input-number <el-popover
v-model="scope.row.cashCost" popper-class="noClass"
:precision="2" v-if="jifenquanxian == true"
:min="0" placement="bottom"
controls-position="right" trigger="hover"
@blur="handleIntegralCostTotal" content="无积分购现金权限">
@change="handleIntegralCostTotal" <el-input-number
/> slot="reference"
:disabled="jifenquanxian"
v-model="scope.row.cashCost"
:precision="2"
:min="0"
controls-position="right"
@blur="handleIntegralCostTotal"
@change="handleIntegralCostTotal"
/>
</el-popover>
<el-input-number
v-else
v-model="scope.row.cashCost"
:precision="2"
:min="0"
controls-position="right"
@blur="handleIntegralCostTotal"
@change="handleIntegralCostTotal"
/>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -48,7 +66,23 @@ ...@@ -48,7 +66,23 @@
</el-table-column> </el-table-column>
<el-table-column prop="cashCost" label="现金"> <el-table-column prop="cashCost" label="现金">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input-number <el-popover
popper-class="noClass"
v-if="jifenquanxian == true"
placement="bottom"
trigger="hover"
content="无积分购现金权限">
<el-input-number
slot="reference"
:disabled="jifenquanxian"
v-model="scope.row.cashCost"
:precision="2"
:min="0"
controls-position="right"
/>
</el-popover>
<el-input-number
v-else
:disabled="cardCostList.length > 1" :disabled="cardCostList.length > 1"
v-model="scope.row.cashCost" v-model="scope.row.cashCost"
:precision="2" :precision="2"
...@@ -84,12 +118,14 @@ export default { ...@@ -84,12 +118,14 @@ export default {
}, },
data () { data () {
return { return {
jifenquanxian: '',
dialogVisible: true, dialogVisible: true,
cardCostList: [], cardCostList: [],
tableData: [], tableData: [],
}; };
}, },
created () { created () {
this.jifenquanxian = localStorage.getItem('limitCodeType') == 'true';
this.getList(); this.getList();
}, },
methods: { methods: {
......
...@@ -276,7 +276,23 @@ ...@@ -276,7 +276,23 @@
/> />
</div> </div>
<div v-if="!(row.giftType && row.children && row.children.length) && !isEdit" class="mt10"> <div v-if="!(row.giftType && row.children && row.children.length) && !isEdit" class="mt10">
<el-popover
popper-class="noClass"
v-if="jifenquanxian"
placement="bottom"
trigger="hover"
content="无积分购现金权限">
<el-input
slot="reference"
v-model.trim="row.activityPrice"
:disabled="jifenquanxian"
placeholder="输入现金"
size="small"
class="w-110"
/>
</el-popover>
<el-input <el-input
v-else
v-model.trim="row.activityPrice" v-model.trim="row.activityPrice"
:disabled="!row.activityProStatus" :disabled="!row.activityProStatus"
placeholder="输入现金" placeholder="输入现金"
...@@ -533,6 +549,7 @@ export default { ...@@ -533,6 +549,7 @@ export default {
}, },
data () { data () {
return { return {
jifenquanxian: '',
pickerOptions: { pickerOptions: {
disabledDate (time) { disabledDate (time) {
// disabledDate 文档上:设置禁用状态,参数为当前日期,要求返回 Boolean // disabledDate 文档上:设置禁用状态,参数为当前日期,要求返回 Boolean
...@@ -625,6 +642,7 @@ export default { ...@@ -625,6 +642,7 @@ export default {
}, },
}, },
created () { created () {
this.jifenquanxian = localStorage.getItem('limitCodeType') == 'true';
// this.isEdit = this.$route.query.edit; // this.isEdit = this.$route.query.edit;
this.isEdit = !!this.$route.query.activityId; this.isEdit = !!this.$route.query.activityId;
this.activityId = this.$route.query.activityId; this.activityId = this.$route.query.activityId;
......
...@@ -193,7 +193,25 @@ ...@@ -193,7 +193,25 @@
</el-table-column> </el-table-column>
<el-table-column label="现金费用"> <el-table-column label="现金费用">
<template slot-scope="scope"> <template slot-scope="scope">
<el-popover
popper-class="noClass"
v-if="jifenquanxian == true"
placement="bottom"
trigger="hover"
content="无积分购现金权限">
<el-input-number
slot="reference"
:disabled="jifenquanxian"
v-model="scope.row.cashCost"
:precision="2"
:min="0"
controls-position="right"
@blur="handleIntegralCostTotal"
@change="handleIntegralCostTotal"
/>
</el-popover>
<el-input-number <el-input-number
v-else
v-model="scope.row.cashCost" v-model="scope.row.cashCost"
:precision="2" :precision="2"
:min="0" :min="0"
...@@ -215,7 +233,23 @@ ...@@ -215,7 +233,23 @@
/> />
</el-form-item> </el-form-item>
<el-form-item label="现金费用" prop="cashCost"> <el-form-item label="现金费用" prop="cashCost">
<el-popover
popper-class="noClass"
v-if="jifenquanxian == true"
placement="bottom"
trigger="hover"
content="无积分购现金权限">
<el-input-number
slot="reference"
class="w-350"
:disabled="jifenquanxian"
:precision="2"
:min="0"
v-model="couponForm.cashCost"
/>
</el-popover>
<el-input-number <el-input-number
v-else
class="w-350" class="w-350"
:disabled="cardCouponList.length > 1" :disabled="cardCouponList.length > 1"
:precision="2" :precision="2"
...@@ -331,7 +365,24 @@ ...@@ -331,7 +365,24 @@
<el-input size="small" v-model.trim="list3[index].skuList[0].giftProSkuIntegral" style="width:180px" /> <el-input size="small" v-model.trim="list3[index].skuList[0].giftProSkuIntegral" style="width:180px" />
</el-form-item> </el-form-item>
<el-form-item label="现金"> <el-form-item label="现金">
<el-input size="small" v-model.trim="list3[index].skuList[0].giftProSkuCash" style="width:180px" />&nbsp;&nbsp; <el-popover
popper-class="noClass"
v-if="jifenquanxian == true"
placement="bottom"
trigger="hover"
content="无积分购现金权限">
<el-input
slot="reference"
:disabled="jifenquanxian"
size="small"
v-model.trim="list3[index].skuList[0].giftProSkuCash"
style="width:180px" />
</el-popover>
<el-input
v-else
size="small"
v-model.trim="list3[index].skuList[0].giftProSkuCash"
style="width:180px" />&nbsp;&nbsp;
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-tab-pane> </el-tab-pane>
...@@ -582,6 +633,7 @@ export default { ...@@ -582,6 +633,7 @@ export default {
} }
}; };
return { return {
jifenquanxian: '',
addCardMax: 15, // 添加卡券的上限数量 addCardMax: 15, // 添加卡券的上限数量
ladder: [], ladder: [],
isDifferentialPricing: '', isDifferentialPricing: '',
...@@ -719,6 +771,7 @@ export default { ...@@ -719,6 +771,7 @@ export default {
}, },
}, },
mounted () { mounted () {
this.jifenquanxian = localStorage.getItem('limitCodeType') == 'true';
this.getOpenStatus(); this.getOpenStatus();
this.getUserId(); this.getUserId();
window.onbeforeunload = function (e) { window.onbeforeunload = function (e) {
...@@ -845,6 +898,10 @@ export default { ...@@ -845,6 +898,10 @@ export default {
break; break;
} }
if ((skuList[j].giftProSkuCash === '' || skuList[j].giftProSkuCash === null) && skuList[j].giftProSkuIntegral) { if ((skuList[j].giftProSkuCash === '' || skuList[j].giftProSkuCash === null) && skuList[j].giftProSkuIntegral) {
if (this.jifenquanxian) {
skuList[j].giftProSkuCash = 0.00;
return;
}
this.isCorrect = false; this.isCorrect = false;
this.$message.error('已填入积分,则必填现金'); this.$message.error('已填入积分,则必填现金');
break; break;
...@@ -1385,7 +1442,11 @@ export default { ...@@ -1385,7 +1442,11 @@ export default {
} }
if (this.cardCouponList.length > 1) { if (this.cardCouponList.length > 1) {
for (const item of this.cardCouponList) { for (const item of this.cardCouponList) {
if (item.cashCost === undefined || item.integralCost === undefined) { if (item.integralCost === undefined) {
this.$message.error('卡券积分不能为空');
return false;
}
if (item.cashCost === undefined && !this.jifenquanxian) {
this.$message.error('卡券积分或现金不能为空'); this.$message.error('卡券积分或现金不能为空');
return false; return false;
} }
......
...@@ -110,13 +110,30 @@ ...@@ -110,13 +110,30 @@
class="w-100 margin-right10 vertical-top" class="w-100 margin-right10 vertical-top"
@blur="limitIntergral(intergral)" @blur="limitIntergral(intergral)"
/> />
<el-input <el-popover
v-model="cash" popper-class="noClass"
placeholder="现金" v-if="jifenquanxian"
size="small" placement="bottom"
class="w-100 margin-right10 vertical-top" trigger="hover"
@blur="limitCash" content="无积分购现金权限">
/> <el-input
slot="reference"
:disabled="jifenquanxian"
v-model="cash"
placeholder="现金"
size="small"
class="w-100 margin-right10 vertical-top"
@blur="limitCash"
/>
</el-popover>
<el-input
v-else
v-model="cash"
placeholder="现金"
size="small"
class="w-100 margin-right10 vertical-top"
@blur="limitCash"
/>
<el-input <el-input
v-model="stock" v-model="stock"
placeholder="库存" placeholder="库存"
...@@ -176,11 +193,27 @@ ...@@ -176,11 +193,27 @@
<td :key="index2" style="width:120px" v-if="item1.length - index2 > 1"> <td :key="index2" style="width:120px" v-if="item1.length - index2 > 1">
<!-- {{ item1[7] }} --> <!-- {{ item1[7] }} -->
<span v-if="item1.length - index2 < 7"> <span v-if="item1.length - index2 < 7">
<el-popover
popper-class="noClass"
v-if="jifenquanxian"
placement="bottom"
trigger="hover"
content="无积分购现金权限">
<el-input
slot="reference"
size="small"
v-model.trim="item2.valueName"
@blur="skuInput(item1, item2, index1, index2)"
@input="setSkuValueName"
:disabled="jifenquanxian && index2 == 2"
/>
</el-popover>
<el-input <el-input
size="small" size="small"
v-model.trim="item2.valueName" v-model.trim="item2.valueName"
@blur="skuInput(item1, item2, index1, index2)" @blur="skuInput(item1, item2, index1, index2)"
@input="setSkuValueName" @input="setSkuValueName"
v-else
/> />
</span> </span>
...@@ -232,6 +265,7 @@ export default { ...@@ -232,6 +265,7 @@ export default {
}, },
data () { data () {
return { return {
jifenquanxian: '',
// skuJson: [], // skuJson: [],
standardList: [], // 规格列表 standardList: [], // 规格列表
standardValueList: [], // 规格值列表 standardValueList: [], // 规格值列表
...@@ -240,7 +274,7 @@ export default { ...@@ -240,7 +274,7 @@ export default {
uploadAction: window.location.origin + '/api-plug/upload-img?requestProject=intergral-mall', uploadAction: window.location.origin + '/api-plug/upload-img?requestProject=intergral-mall',
// uploadAction: 'http://www.gicdev.com/api-plug/upload-img?requestProject=intergral-mall', // uploadAction: 'http://www.gicdev.com/api-plug/upload-img?requestProject=intergral-mall',
intergral: '', intergral: '',
cash: '', cash: 0.00,
stock: '', stock: '',
code: '', code: '',
barCode: '', barCode: '',
...@@ -256,6 +290,7 @@ export default { ...@@ -256,6 +290,7 @@ export default {
}; };
}, },
created () { created () {
this.jifenquanxian = localStorage.getItem('limitCodeType') == 'true';
// this.skuList = copy(this.combine(copy(this.skuJson))); // this.skuList = copy(this.combine(copy(this.skuJson)));
}, },
methods: { methods: {
...@@ -598,17 +633,18 @@ export default { ...@@ -598,17 +633,18 @@ export default {
// 现金 // 现金
limitCash () { limitCash () {
if (this.jifenquanxian) return;
if (Number(this.cash) === 0) { if (Number(this.cash) === 0) {
return false; return false;
} else if (!Number(this.cash)) { } else if (!Number(this.cash)) {
this.$message.error('请输入数字类型'); this.$message.error('请输入数字类型');
this.cash = ''; this.cash = 0.00;
} else if (Number(this.cash) < 0) { } else if (Number(this.cash) < 0) {
this.$message.error('请输入大于0的数字'); this.$message.error('请输入大于0的数字');
this.cash = ''; this.cash = 0.00;
} else if (Number(this.cash) > 9999999) { } else if (Number(this.cash) > 9999999) {
this.$message.error('现金最大9999999'); this.$message.error('现金最大9999999');
this.cash = ''; this.cash = 0.00;
} else { } else {
this.cash = Number(this.cash).toFixed(2); this.cash = Number(this.cash).toFixed(2);
} }
...@@ -748,6 +784,7 @@ export default { ...@@ -748,6 +784,7 @@ export default {
item2.valueName = Number(item2.valueName).toFixed(0); item2.valueName = Number(item2.valueName).toFixed(0);
} }
} else if (item1.length - index2 === 5) { } else if (item1.length - index2 === 5) {
if (this.jifenquanxian) return;
// 现金 // 现金
if (Number(item2.valueName < 0)) { if (Number(item2.valueName < 0)) {
this.$message.error('请输入大于0的数字'); this.$message.error('请输入大于0的数字');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment