Commit d888cd34 by zhouzy

更改了一些基础bug

1 parent 64331f6c
......@@ -37,8 +37,7 @@
<el-input-number
v-model="ruleForm.validity"
controls-position="right"
:min="0"
:max="10"
:min="1"
size="mini"
></el-input-number>
月内有效
......@@ -155,6 +154,7 @@ export default {
// name:ruleForm.name,
// validitVaule:""
// },
submit: false,
ruleForm: {
name: '',
explain: '',
......@@ -183,10 +183,10 @@ export default {
},
rules: {
name: [
{ required: true, message: '请输入权益卡名字', trigger: 'blur' },
{ min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur' }
{ required: true, message: '请输入长度在2-10以内的权益卡名称', trigger: 'blur' },
{ min: 2, max: 10, message: '长度在 2 到 10 个字符', trigger: 'blur' }
],
explain: [{ required: true, message: '请填写说明', trigger: 'blur' }],
explain: [{ min: 0, max: 200, required: true, message: '请填写200字以内的说明', trigger: 'blur' }],
validity: [{ required: true, message: '请选择有效期', trigger: 'blur' }],
currencyInpution: [
{ required: true, message: '请填写返回的嘀币数', trigger: 'blur' }
......@@ -246,54 +246,78 @@ export default {
rightsId: 20,
equityItemJson: JSON.stringify(equityItemJson)
})
this.submit = true
}
if (this.ruleForm.oilCheckbox) {
params.rightsList.push({
rightsId: 21,
equityItemJson: JSON.stringify(equityItemJson)
})
this.submit = true
}
if (this.ruleForm.worryFreeCheckbox) {
params.rightsList.push({
rightsId: 22,
equityItemJson: JSON.stringify(equityItemJson)
})
this.submit = true
}
if (this.ruleForm.specialOfferCheckbox) {
params.rightsList.push({
rightsId: 23,
equityItemJson: JSON.stringify(equityItemJson)
})
this.submit = true
}
if (this.ruleForm.rescueCheckbox) {
params.rightsList.push({
rightsId: 24,
equityItemJson: JSON.stringify(equityItemJson)
})
this.submit = true
}
if (this.ruleForm.creditCheckbox) {
params.rightsList.push({
rightsId: 25,
equityItemJson: JSON.stringify(equityItemJson)
})
this.submit = true
}
if (this.ruleForm.meituanCheckbox) {
params.rightsList.push({
rightsId: 26,
equityItemJson: JSON.stringify(equityItemJson)
})
this.submit = true
}
insertMemberCardDefineRf(params).then((res) => {
console.log(res)
if (res > 0) {
window.history.go(-1)
if (this.ruleForm.name) {
if (this.submit == true) {
insertMemberCardDefineRf(params).then((res) => {
// console.log(res)
if (res > 0) {
window.history.go(-1)
ruleForm = {}
}else {
this.$message({
message: '增加失败',
type: 'error'
})
}
})
} else {
this.$message({
message: '增添失败!',
message: '需开通至少一项服务',
type: 'error'
})
}
})
} else {
this.$message({
message: '权益卡名称不能为空',
type: 'error'
})
}
}
......@@ -317,6 +341,8 @@ export default {
.container {
overflow-y: scroll;
height: 900px;
margin-left: 100px;
margin-top: 20px;
}
.itemContainer {
margin-left: 20px;
......
......@@ -6,10 +6,8 @@
type="primary"
@click="addCard"
>新建权益卡</el-button>
</div>
<div class="tablecontainer">
<d2-table
ref="recordTable"
:searchForm="searchForm"
......@@ -26,15 +24,21 @@
</d2-table>
</div>
</div>
</template>
<script>
function date_format(d) {
var date = new Date(d);
var Y = date.getFullYear() + "-";
var M =
(date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1) + "-";
var D = date.getDate() + " ";
return Y + M + D;
}
// import { getListApi } from '@/api/test'
// import {memberCardDetails} from "@/api/test";
import { listMemberCardDefine } from '@/api/test'
// import selectbotton from '@/components/selectbotton'
export default {
// components: {
......@@ -42,8 +46,8 @@ export default {
// },
data() {
return {
date_format,
getListApi: listMemberCardDefine,
// getListApi: none,
searchForm: null,
tableParams: {
......@@ -58,7 +62,10 @@ export default {
},
{
label: '有效期',
prop: 'validitDate'
prop: 'validitDate',
formatter: (cellValue) => {
return this.date_format(cellValue.validitDate);
}
},
{
label: '权益内容',
......@@ -80,7 +87,7 @@ export default {
prop: 'status',
formatter: (cellValue) => {
return {
1: '正常',
1: '正常'
}[cellValue.status]
}
......@@ -96,16 +103,14 @@ export default {
}
},
mounted() {
},
methods: {
addCard() {
// window.location.href = 'http://glsx-oss-equity2.frontend.test.glsx.com.cn/customer/newEquityCard.html'
window.location.href = '/customer/newEquityCard.html'
}
// handleEdit() {
// // },
// updateRightCardTable(params = {}) {
// var _this = this;
......@@ -120,7 +125,6 @@ export default {
// });
// },
}
}
</script>
<style>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!