-num-new"> 151
+          if (data.coupon_info[0].coupon_value == 0) {
152
+            data.coupon_info = [{"coupon_expire_at": "-","coupon_value": "-"}]
124 153
           }
125
-        })
154
+          self.queryRes = [response.data.data]
126 155
 
156
+        })
127 157
       })
128 158
     },
129 159
 
130 160
     handleClick(index, row) {
131 161
       var self = this
132 162
       this.$axios.post('admin/usecoupon', {"model_id": this.selectModel.model_id,
133
-                        "sn": this.selectSerialNo})
163
+                                           "sn": this.selectSerialNo,
164
+                                           "admin_id": sessionStorage.admin_id})
134 165
       .then(function (response) {
135 166
         self.$nextTick(function (){
136 167
           self.clear()
137 168
           self.tableEmptyText = "暂无数据"
138
-          alert("已核销")
169
+          self.getMaintainRecord()
170
+          if (response.status == 200 && response.data.status == 200) {
171
+            alert("已核销")
172
+          }
139 173
         })
140 174
       })
141 175
     },
@@ -145,6 +179,20 @@ export default {
145 179
       this.selectModel = {}
146 180
       this.selectSerialNo = ""
147 181
       this.selectModelName = ""
182
+    },
183
+
184
+    getMaintainRecord() {
185
+      var self = this
186
+      this.$axios.post('admin/queryusedsn', {"admin_id": sessionStorage.admin_id})
187
+      .then(function (response) {
188
+        let logs = response.data.data.logs
189
+        for (var log of logs) {
190
+          let date = new Date(log.used_at)
191
+          console.log(date);
192
+          log.used_at = date.getFullYear() + "/" + (date.getMonth() + 1) + "/" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes()
193
+        }
194
+        self.maintainRecord = response.data.data.logs
195
+      })
148 196
     }
149 197
   }
150 198
 }
@@ -153,20 +201,43 @@ export default {
153 201
 <style lang="scss">
154 202
 #maintain {
155 203
   display: flex;
156
-  flex-direction: column;
157 204
   justify-content: center;
158
-  align-items: center;
159
-  width: 100%;
160
-  height: 200px;
161
-  .filter {
205
+  .maintain-content {
162 206
     display: flex;
163
-    flex-direction: row;
207
+    flex-direction: column;
208
+    justify-content: center;
209
+    align-items: center;
210
+    width: 700px;
211
+    height: 200px;
212
+    .filter {
213
+      display: flex;
214
+      flex-direction: row;
215
+    }
216
+    .table {
217
+      margin-top: 50px;
218
+      width: 80%;
219
+      max-width: 900px;
220
+      height: 100px;
221
+    }
164 222
   }
165
-  .table {
166
-    margin-top: 50px;
167
-    width: 80%;
168
-    max-width: 900px;
169
-    height: 100px;
223
+  .maintain-record {
224
+    display: flex;
225
+    flex-direction: column;
226
+    justify-content: center;
227
+    width: 280px;
228
+    background: #fff;
229
+    h3 {
230
+      margin-left: 5px;
231
+    }
232
+    .line {
233
+      width: 100%;
234
+      height: 1px;
235
+      background: #E5EAF2;
236
+    }
237
+    .el-table {
238
+      width: 260px;
239
+      margin-left: 10px;
240
+    }
170 241
   }
171 242
 }
172 243
 </style>

kodosale - Gogs: Go Git Service

Brak opisu

huangqimin: 9e28f52376 :tada: Initial 6 lat temu
..
migrations 9e28f52376 :tada: Initial 6 lat temu
static 9e28f52376 :tada: Initial 6 lat temu
__init__.py 9e28f52376 :tada: Initial 6 lat temu
admin.py 9e28f52376 :tada: Initial 6 lat temu
apps.py 9e28f52376 :tada: Initial 6 lat temu
models.py 9e28f52376 :tada: Initial 6 lat temu
tests.py 9e28f52376 :tada: Initial 6 lat temu
views.py 9e28f52376 :tada: Initial 6 lat temu