|
@@ -135,7 +135,7 @@
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
- <el-dialog title="续费" v-model="renewVisible" :modal-append-to-body="false" :close-on-click-modal="false" :close-on-press-escape="false">
|
|
|
|
|
|
+ <el-dialog title="续费" v-model="renewVisible" :modal-append-to-body="false" width="450px" :close-on-click-modal="false" :close-on-press-escape="false">
|
|
<el-form :model="packageForm" :rules="stockRules" ref="packageFormRef" label-width="140px">
|
|
<el-form :model="packageForm" :rules="stockRules" ref="packageFormRef" label-width="140px">
|
|
<el-form-item label="套餐:" prop="company_package_id">
|
|
<el-form-item label="套餐:" prop="company_package_id">
|
|
<el-select v-model="packageForm.company_package_id" clearable placeholder="请选择套餐">
|
|
<el-select v-model="packageForm.company_package_id" clearable placeholder="请选择套餐">
|
|
@@ -227,21 +227,39 @@ const roleArray = ref<any[]>([]);
|
|
|
|
|
|
const renewVisible = ref(false);
|
|
const renewVisible = ref(false);
|
|
/* 套餐 */
|
|
/* 套餐 */
|
|
-const packageForm = ref({
|
|
|
|
|
|
+const packageForm = ref<any>({
|
|
company_package_id: '',
|
|
company_package_id: '',
|
|
this_money: '',
|
|
this_money: '',
|
|
});
|
|
});
|
|
|
|
+let packageId = ref('');
|
|
|
|
+let companyId = ref('');
|
|
const packageFormRef = ref();
|
|
const packageFormRef = ref();
|
|
/* 续费 */
|
|
/* 续费 */
|
|
const handleRenew = (index: number, row: any) => {
|
|
const handleRenew = (index: number, row: any) => {
|
|
- renewVisible.value = true;
|
|
|
|
|
|
+ packageForm.value.company_package_id = row.company_package_id;
|
|
|
|
+ companyId.value=row.id
|
|
|
|
+ packageId.value = row.company_package_id;
|
|
|
|
+ API_Company.companyPackage(row.company_package_id).then((res) => {
|
|
|
|
+ packageForm.value.this_money = res.money;
|
|
|
|
+ renewVisible.value = true;
|
|
|
|
+ });
|
|
};
|
|
};
|
|
const submitPackageForm = () => {
|
|
const submitPackageForm = () => {
|
|
- companyFormRef.value.validate((valid: boolean) => {
|
|
|
|
|
|
+ packageFormRef.value.validate((valid: boolean) => {
|
|
if (valid) {
|
|
if (valid) {
|
|
- API_Company.renewCompany(id, params).then(res=>{
|
|
|
|
-
|
|
|
|
- })
|
|
|
|
|
|
+ API_Company.difference(packageId.value).then((response) => {
|
|
|
|
+ packageForm.value.this_money += response;
|
|
|
|
+ API_Company.renewCompany(companyId.value,packageId.value).then((res) => {
|
|
|
|
+ packageForm.value = {};
|
|
|
|
+ packageId.value = '';
|
|
|
|
+ if (packageId.value == packageForm.value.company_package_id) {
|
|
|
|
+ ElMessage.success('续费成功!');
|
|
|
|
+ } else {
|
|
|
|
+ ElMessage.success('付费后立即生效!');
|
|
|
|
+ }
|
|
|
|
+ renewVisible.value = false;
|
|
|
|
+ });
|
|
|
|
+ });
|
|
}
|
|
}
|
|
});
|
|
});
|
|
};
|
|
};
|