Commit d888cd34 by zhouzy

更改了一些基础bug

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