|
@@ -81,7 +81,8 @@
|
|
<el-form-item
|
|
<el-form-item
|
|
label="用量"
|
|
label="用量"
|
|
v-if="formData.chargeType == 2 || formData.chargeType == 3"
|
|
v-if="formData.chargeType == 2 || formData.chargeType == 3"
|
|
- prop="quantity"
|
|
|
|
|
|
+ :prop="formData.chargeType == 2 ? quantity : 'quan'"
|
|
|
|
+ :key="keyChange"
|
|
>
|
|
>
|
|
<el-input v-model="formData.quantity"></el-input>
|
|
<el-input v-model="formData.quantity"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -92,6 +93,7 @@ export default {
|
|
props: ['params'],
|
|
props: ['params'],
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
|
|
+
|
|
formData: {
|
|
formData: {
|
|
assetsId: '',
|
|
assetsId: '',
|
|
strategyId: '',
|
|
strategyId: '',
|
|
@@ -121,7 +123,33 @@ export default {
|
|
submit () {
|
|
submit () {
|
|
this.$refs.form.validate((valid) => {
|
|
this.$refs.form.validate((valid) => {
|
|
if (valid) {
|
|
if (valid) {
|
|
- if (Number(this.formData.quantity) >= 1) {
|
|
|
|
|
|
+ console.log('formData.chargeType', this.formData.chargeType);
|
|
|
|
+ if (this.formData.chargeType == 2 || this.formData.chargeType == 3) {
|
|
|
|
+ if (Number(this.formData.quantity) >= 1) {
|
|
|
|
+ var loading = this.$loading();
|
|
|
|
+ this.$http
|
|
|
|
+ .post('/czc-charge/charge/bill/create', this.formData)
|
|
|
|
+ .then(({ status, msg }) => {
|
|
|
|
+ if (status == 0) {
|
|
|
|
+ this.$message.success(msg);
|
|
|
|
+ this.params.callback();
|
|
|
|
+ this.$emit('close');
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error(msg);
|
|
|
|
+ }
|
|
|
|
+ loading.close();
|
|
|
|
+ })
|
|
|
|
+ .catch(() => {
|
|
|
|
+ loading.close();
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ // if (this.formData.chargeType == 2 || this.formData.chargeType == 3) {
|
|
|
|
+ this.$message.error('请重新输入用量');
|
|
|
|
+ this.formData.quantity = ''
|
|
|
|
+ // }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
var loading = this.$loading();
|
|
var loading = this.$loading();
|
|
this.$http
|
|
this.$http
|
|
.post('/czc-charge/charge/bill/create', this.formData)
|
|
.post('/czc-charge/charge/bill/create', this.formData)
|
|
@@ -138,11 +166,9 @@ export default {
|
|
.catch(() => {
|
|
.catch(() => {
|
|
loading.close();
|
|
loading.close();
|
|
});
|
|
});
|
|
- } else {
|
|
|
|
- this.$message.error('请重新输入用量');
|
|
|
|
- this.formData.quantity = ''
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|