-num-new"> 151
+ if (data.coupon_info[0].coupon_value == 0) {
+ data.coupon_info = [{"coupon_expire_at": "-","coupon_value": "-"}]
}
- })
+ self.queryRes = [response.data.data]
+ })
})
},
handleClick(index, row) {
var self = this
this.$axios.post('admin/usecoupon', {"model_id": this.selectModel.model_id,
- "sn": this.selectSerialNo})
+ "sn": this.selectSerialNo,
+ "admin_id": sessionStorage.admin_id})
.then(function (response) {
self.$nextTick(function (){
self.clear()
self.tableEmptyText = "暂无数据"
- alert("已核销")
+ self.getMaintainRecord()
+ if (response.status == 200 && response.data.status == 200) {
+ alert("已核销")
+ }
})
})
},
@@ -145,6 +179,20 @@ export default {
this.selectModel = {}
this.selectSerialNo = ""
this.selectModelName = ""
+ },
+
+ getMaintainRecord() {
+ var self = this
+ this.$axios.post('admin/queryusedsn', {"admin_id": sessionStorage.admin_id})
+ .then(function (response) {
+ let logs = response.data.data.logs
+ for (var log of logs) {
+ let date = new Date(log.used_at)
+ console.log(date);
+ log.used_at = date.getFullYear() + "/" + (date.getMonth() + 1) + "/" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes()
+ }
+ self.maintainRecord = response.data.data.logs
+ })
}
}
}
@@ -153,20 +201,43 @@ export default {
<style lang="scss">
#maintain {
display: flex;
- flex-direction: column;
justify-content: center;
- align-items: center;
- width: 100%;
- height: 200px;
- .filter {
+ .maintain-content {
display: flex;
- flex-direction: row;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+ width: 700px;
+ height: 200px;
+ .filter {
+ display: flex;
+ flex-direction: row;
+ }
+ .table {
+ margin-top: 50px;
+ width: 80%;
+ max-width: 900px;
+ height: 100px;
+ }
}
- .table {
- margin-top: 50px;
- width: 80%;
- max-width: 900px;
- height: 100px;
+ .maintain-record {
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ width: 280px;
+ background: #fff;
+ h3 {
+ margin-left: 5px;
+ }
+ .line {
+ width: 100%;
+ height: 1px;
+ background: #E5EAF2;
+ }
+ .el-table {
+ width: 260px;
+ margin-left: 10px;
+ }
}
}
</style>