|
@@ -36,7 +36,7 @@ |
|
@@ -36,7 +36,7 @@ |
36
|
</template>
|
36
|
</template>
|
37
|
</Form>
|
37
|
</Form>
|
38
|
<div slot="footer" class="modal-footer">
|
38
|
<div slot="footer" class="modal-footer">
|
39
|
- <span v-if="formItem.status !== UNOPEN"><i>*</i>在第三方开票系统冲红或作废后更新保存发票信息</span>
|
39
|
+ <span v-if="formItem.status !== UNOPEN"><i>*</i> 在第三方开票系统冲红或作废后更新保存发票信息</span>
|
40
|
<Button type="primary" :loading="inLoading" @click="update">保存</Button>
|
40
|
<Button type="primary" :loading="inLoading" @click="update">保存</Button>
|
41
|
<Button @click="close">关闭</Button>
|
41
|
<Button @click="close">关闭</Button>
|
42
|
</div>
|
42
|
</div>
|
|
@@ -144,6 +144,10 @@ export default { |
|
@@ -144,6 +144,10 @@ export default { |
144
|
logisticsSwitch: this.LOGISTICS_YES,
|
144
|
logisticsSwitch: this.LOGISTICS_YES,
|
145
|
...invoice,
|
145
|
...invoice,
|
146
|
};
|
146
|
};
|
|
|
147
|
+ // transfer CANCELLED state to invoice type
|
|
|
148
|
+ if (this.formItem.status === InvoiceStatusName2Id.CANCELLED) {
|
|
|
149
|
+ this.formItem.type = InvoiceStatusName2Id.CANCELLED;
|
|
|
150
|
+ }
|
147
|
this.visible = true;
|
151
|
this.visible = true;
|
148
|
},
|
152
|
},
|
149
|
/**
|
153
|
/**
|
|
@@ -180,7 +184,7 @@ export default { |
|
@@ -180,7 +184,7 @@ export default { |
180
|
const isCancled = invoice.status === InvoiceStatusName2Id.CANCELLED;
|
184
|
const isCancled = invoice.status === InvoiceStatusName2Id.CANCELLED;
|
181
|
|
185
|
|
182
|
if (isCancled) {
|
186
|
if (isCancled) {
|
183
|
- if (currentStatus === isCancled) {
|
187
|
+ if (currentStatus === InvoiceStatusName2Id.CANCELLED) {
|
184
|
return false;
|
188
|
return false;
|
185
|
}
|
189
|
}
|
186
|
|
190
|
|
|
@@ -216,16 +220,38 @@ export default { |
|
@@ -216,16 +220,38 @@ export default { |
216
|
|
220
|
|
217
|
return true;
|
221
|
return true;
|
218
|
},
|
222
|
},
|
219
|
- update() {
|
|
|
220
|
- const params = { ...this.formItem };
|
223
|
+ validate(callback) {
|
|
|
224
|
+ if (this.$refs.modal.fields.length !== 0) {
|
|
|
225
|
+ return this.$refs.modal.validate(callback);
|
|
|
226
|
+ }
|
221
|
|
227
|
|
|
|
228
|
+ return callback(true);
|
|
|
229
|
+ },
|
|
|
230
|
+ update() {
|
222
|
// validate
|
231
|
// validate
|
223
|
- this.$refs.modal.validate(valid => {
|
232
|
+ this.validate(valid => {
|
224
|
if (valid) {
|
233
|
if (valid) {
|
|
|
234
|
+ // only whitelist
|
|
|
235
|
+ const params = _.pick(this.formItem, [
|
|
|
236
|
+ 'shopId',
|
|
|
237
|
+ 'orderCode',
|
|
|
238
|
+ 'status',
|
|
|
239
|
+ 'step',
|
|
|
240
|
+ // issueDate
|
|
|
241
|
+ 'pdfUrl',
|
|
|
242
|
+ 'type',
|
|
|
243
|
+ 'logisticsId',
|
|
|
244
|
+ // logisticsCompanyName
|
|
|
245
|
+ 'expressNumber',
|
|
|
246
|
+ 'logisticsSwitch',
|
|
|
247
|
+ ]);
|
|
|
248
|
+
|
|
|
249
|
+ // clean data?
|
225
|
if (!this.updateState(params)) {
|
250
|
if (!this.updateState(params)) {
|
226
|
- this.close(true);
|
251
|
+ this.close();
|
227
|
return;
|
252
|
return;
|
228
|
}
|
253
|
}
|
|
|
254
|
+
|
229
|
this.inLoading = true;
|
255
|
this.inLoading = true;
|
230
|
this.invoiceAPI
|
256
|
this.invoiceAPI
|
231
|
.update(params)
|
257
|
.update(params)
|
|
@@ -241,13 +267,8 @@ export default { |
|
@@ -241,13 +267,8 @@ export default { |
241
|
});
|
267
|
});
|
242
|
}
|
268
|
}
|
243
|
});
|
269
|
});
|
244
|
- // TODO:
|
|
|
245
|
- // update status
|
|
|
246
|
},
|
270
|
},
|
247
|
- close(force) {
|
|
|
248
|
- if (!force) {
|
|
|
249
|
- // dirty check
|
|
|
250
|
- }
|
271
|
+ close() {
|
251
|
this.visible = false;
|
272
|
this.visible = false;
|
252
|
},
|
273
|
},
|
253
|
onPDFUrlChang() {
|
274
|
onPDFUrlChang() {
|