Commit 2f3b845d by zhangmeng

bug

parent 1a3e9aff
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><link rel="shortcut icon" href=./static/img/favicon.ico><title>GIC后台</title><link rel=stylesheet type=text/css href=static/css/iconfont.css><link rel=stylesheet type=text/css href=static/css/common.css><link href=/integral-mall/static/css/app.a38e4bbf9889d2cf2a9ea15932463f01.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=/integral-mall/static/js/manifest.003beacb9c9ae622c7f2.js></script><script type=text/javascript src=/integral-mall/static/js/vendor.468b1a0927c2f59e9881.js></script><script type=text/javascript src=/integral-mall/static/js/app.f58ac01fbf6ca6005eca.js></script></body></html>
\ No newline at end of file
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><meta http-equiv=Content-Security-Policy content=upgrade-insecure-requests><link rel="shortcut icon" href=./static/img/favicon.ico><title>GIC后台</title><link rel=stylesheet type=text/css href=static/css/iconfont.css><link rel=stylesheet type=text/css href=static/css/common.css><link href=/integral-mall/static/css/app.a38e4bbf9889d2cf2a9ea15932463f01.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=/integral-mall/static/js/manifest.003beacb9c9ae622c7f2.js></script><script type=text/javascript src=/integral-mall/static/js/vendor.468b1a0927c2f59e9881.js></script><script type=text/javascript src=/integral-mall/static/js/app.c14a146bdadeaa092bf6.js></script></body></html>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
<!DOCTYPE html>
<html>
<head>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
<link rel="shortcut icon" href="./static/img/favicon.ico">
<title>GIC后台</title>
<link rel="stylesheet" type="text/css" href="static/css/iconfont.css">
<link rel="stylesheet" type="text/css" href="static/css/common.css">
</head>
<body>
</head>
<body>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
</body>
</html>
\ No newline at end of file
......@@ -50,6 +50,10 @@ export default {
disabled:{
type:Boolean,
default:false
},
cardType:{
type:String,
default:'2'
}
},
data(){
......@@ -60,7 +64,7 @@ export default {
pageSize:20,
requestProject:'gic-web',
coupCardId:'',
cardType:'0 , 1'
cardType:this.cardType
},
total:0,
tableList:[],
......
<template slot-scope="scope">
<el-popover placement="top" width="160" v-model="model[theType+'Flag']">
<el-input-number class="w150" size="small" controls-position="right" :precision="precision" v-model="model.inputValue" :min="0" ></el-input-number>
<el-input-number v-if="model[theType+'Flag']" class="w150" size="small" controls-position="right" :precision="precision" v-model="model.inputValue" :min="0" ></el-input-number>
<div style="text-align: right; margin:10px 0 0 0;">
<el-button size="mini" type="text" @click="model[theType+'Flag'] = false">取消</el-button>
<el-button type="primary" size="mini" @click="submit">确定</el-button>
......@@ -15,57 +15,57 @@
import { updateStockService, updateIntegralCostService,updateCashCostService } from '@/service/api/mallApi.js';
export default {
props: {
model: {
type: Object,
default() {
return {}
}
},
theType: String,
typeName: String,
precision:{
type:Number,
default:0
props: {
model: {
type: Object,
default() {
return {}
}
},
watch: {
},
methods:{
async submit() {
// try {
console.log(this.theType)
if (this.theType === 'cashCost' && this.model.inputValue > this.model.costValue) {
this.$tips({type:'warning',message:'现金费用不能大于礼品成本'});
return;
}
let res = null;
if (this.theType === 'virtualStock') { // 库存
res = await updateStockService({proId:this.model.integralMallProId,stock:this.model.inputValue});
} else if (this.theType === 'cashCost') { // 现金费用
res = await updateCashCostService({proId:this.model.integralMallProId,cost:this.model.inputValue});
} else if (this.theType === 'integralCost') { // 积分费用
res = await updateIntegralCostService({proId:this.model.integralMallProId,cost:this.model.inputValue});
}
if (res.errorCode === 0) {
if (this.theType === 'virtualStock') {
this.$tips({type:'success',message: '积分商城修改库存时,请同步修改对应卡券的库存'});
} else {
this.$tips({type:'success',message: '更新成功'});
}
this.$emit('refresh');
} else {
this.$tips({type:'error',message: '更新失败'});
}
// } catch (err) {
// this.$tips({type:'error',message: '更新失败'});
// }
},
edit() {
this.model[this.theType + 'Flag'] = true;
this.$set(this.model,'inputValue',this.model[this.theType]);
},
theType: String,
typeName: String,
precision:{
type:Number,
default:0
}
},
methods:{
async submit() {
// try {
console.log(this.value,this.theType,this.model.inputValue,this.precision)
if (this.theType === 'cashCost' && this.model.inputValue > this.model.costValue) {
this.$tips({type:'warning',message:'现金费用不能大于礼品成本'});
return;
}
let res = null;
if (this.theType === 'virtualStock') { // 库存
res = await updateStockService({proId:this.model.integralMallProId,stock:this.model.inputValue});
} else if (this.theType === 'cashCost') { // 现金费用
res = await updateCashCostService({proId:this.model.integralMallProId,cost:this.model.inputValue});
} else if (this.theType === 'integralCost') { // 积分费用
res = await updateIntegralCostService({proId:this.model.integralMallProId,cost:this.model.inputValue});
}
if (res.errorCode === 0) {
if (this.theType === 'virtualStock') {
this.$tips({type:'success',message: '积分商城修改库存时,请同步修改对应卡券的库存'});
} else {
this.$tips({type:'success',message: '更新成功'});
}
this.$emit('refresh');
} else {
this.$tips({type:'error',message: '更新失败'});
}
// } catch (err) {
// this.$tips({type:'error',message: '更新失败'});
// }
},
edit() {
// 这里precision不能更新
this.$nextTick(_ => {
this.model[this.theType + 'Flag'] = true;
this.$set(this.model,'inputValue',this.model[this.theType]);
})
}
}
}
</script>
......@@ -2,7 +2,7 @@
<el-form class="dm-wrap" :model="form" ref="form" :rules="rules" label-width="120px">
<div class="border-radius2" style="padding:15px;margin-bottom:20px;">
<card-temp ref="cardTemp" :disabled="isEdit || isInfo" pbSize="pb15" :activeId.sync="form.proReferId" @emitActiveObj="getCardActiveObjFun" :showPagination="false" :cardLimitType="3"></card-temp>
<card-temp ref="cardTemp" cardType="0,1" :disabled="isEdit || isInfo" pbSize="pb15" :activeId.sync="form.proReferId" @emitActiveObj="getCardActiveObjFun" :showPagination="false" :cardLimitType="3"></card-temp>
</div>
<el-form-item prop="integralCost" label="积分费用">
<el-input-number controls-position="right" :disabled="isEdit || isInfo" v-model="form.integralCost" class="w300" :precision="0" :min="0"></el-input-number>
......
......@@ -22,7 +22,7 @@
</el-table-column>
<el-table-column label="现金费用" align="left" prop="cashCost" width="100">
<template slot-scope="scope">
<updateCount :model="scope.row" theType="cashCost" :precision="2" typeName="元" @refresh="getPageCardsList"></updateCount>
<updateCount :model="scope.row" theType="cashCost" :precision="2" typeName="元" @refresh="getPageCardsList"></updateCount>
</template>
</el-table-column>
<el-table-column label="库存" align="left" prop="virtualStock" width="100">
......
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