diff --git a/src/App.vue b/src/App.vue index 7a9f59f..193a07a 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,6 +1,6 @@ @@ -16,16 +16,17 @@ // +---------------------------------------------------------------------- export default { name: 'App', - provide () { + provide() { return { reload: this.reload } - }, - data () { + }, + data() { return { isRouterAlive: true } }, + methods: { reload() { this.isRouterAlive = false @@ -36,3 +37,20 @@ export default { } } + + diff --git a/src/api/merchant.js b/src/api/merchant.js index bd4724b..7b1dde6 100644 --- a/src/api/merchant.js +++ b/src/api/merchant.js @@ -48,7 +48,7 @@ export function merchantCreateApi() { } //新增商户 export function merchantCreate(data) { - return request.post('system/merchant/create',data) + return request.post('system/merchant/create', data) } /** * @description 商户列表 -- 编辑表单 @@ -59,8 +59,8 @@ export function merchantUpdateApi(id) { /** * @description 商户列表 -- 更新表单 */ -export function merchantUpdateA(id,data) { - return request.post(`system/merchant/update/${id}`,data) +export function merchantUpdateA(id, data) { + return request.post(`system/merchant/update/${id}`, data) } /** * @description 商户列表 -- 删除 @@ -165,6 +165,12 @@ export function intentionDelte(mer_id) { export function intentionStatusApi(mer_id) { return request.get(`merchant/intention/status/${mer_id}/form`) } + +// 新增修改状态 +export function updateStatus(mer_id, data) { + return request.post(`merchant/intention/status/${mer_id}`, data) +} + /** * @description 申请管理 -- 编辑复制次数 */ @@ -181,19 +187,19 @@ export function intentionAgreeInfo() { * @description 申请管理 -- 入驻协议保存 */ export function intentionAgreeUpdate(data) { - return request.post(`agreement/sys_intention_agree`,data) + return request.post(`agreement/sys_intention_agree`, data) } /** * @description 店铺类型 -- 获取说明 */ - export function getStoreTypeApi(key) { - return request.get(`agreement/${key}`) +export function getStoreTypeApi(key) { + return request.get(`agreement/${key}`) } /** * @description 店铺类型 -- 编辑说明 */ export function updateStoreTypeApi(type, data) { - return request.post(`agreement/${type}`, data) + return request.post(`agreement/${type}`, data) } /** * @description 商户列表 -- 开启关闭 @@ -212,137 +218,137 @@ export function merchantCountApi() { * @description 店铺类型 -- 创建店铺类型 */ export function storeTypeCreateApi(data) { - return request.post(`merchant/type/create`, data) + return request.post(`merchant/type/create`, data) } /** * @description 店铺类型 -- 列表 */ - export function storeTypeLstApi(data) { +export function storeTypeLstApi(data) { return request.get(`merchant/type/lst`, data) } /** * @description 店铺类型 -- 店铺权限 */ - export function storeJurisdictionApi() { +export function storeJurisdictionApi() { return request.get(`merchant/mer_auth`) } /** * @description 店铺类型 -- 创建店铺类型 */ export function storeTypeUpdateApi(id, data) { - return request.post(`merchant/type/update/${id}`, data) + return request.post(`merchant/type/update/${id}`, data) } /** * @description 店铺类型列表 -- 删除 */ export function storeTypeDeleteApi(id) { - return request.delete(`merchant/type/delete/${id}`) + return request.delete(`merchant/type/delete/${id}`) } /** * @description 店铺类型列表 -- 备注 */ export function merchantTypeMarkForm(id) { - return request.get(`merchant/type/mark/${id}`) + return request.get(`merchant/type/mark/${id}`) } /** * @description 店铺类型列表 -- 详情 */ - export function merchantTypeMarkApi(id) { +export function merchantTypeMarkApi(id) { return request.get(`/merchant/type/detail/${id}`) } /** * @description 店铺类型 -- 获取选择项 */ export function getstoreTypeApi() { - return request.get(`merchant/type/options`) + return request.get(`merchant/type/options`) } /** * @description 商户分类 -- 获取选择项 */ export function getMerCateApi() { - return request.get(`system/merchant/category/options`) + return request.get(`system/merchant/category/options`) } /** * @description 服务申请 -- 列表 */ export function getApplymentLst(data) { - return request.get(`system/applyments/lst`, data) + return request.get(`system/applyments/lst`, data) } /** * @description 服务申请 -- 审核 */ export function applymentStatusApi(id, data) { - return request.post(`system/applyments/status/${id}`, data) + return request.post(`system/applyments/status/${id}`, data) } /** * @description 服务申请 -- 详情 */ export function applymentDetailApi(id) { - return request.get(`system/applyments/detail/${id}`) + return request.get(`system/applyments/detail/${id}`) } /** * @description 商户 -- 分账列表 */ - export function applymentLstApi(data) { - return request.get(`profitsharing/lst`, data) +export function applymentLstApi(data) { + return request.get(`profitsharing/lst`, data) } /** * @description 商户 -- 分账(立即分账) */ - export function splitAccountApi(id) { - return request.post(`profitsharing/again/${id}`) +export function splitAccountApi(id) { + return request.post(`profitsharing/again/${id}`) } /** * @description 分账申请 -- 备注 */ export function splitAccountMark(id) { - return request.get(`system/applyments/mark/${id}/form`) + return request.get(`system/applyments/mark/${id}/form`) } /** * @description 分账管理 -- 导出 */ - export function ledgerManageExportApi(data) { +export function ledgerManageExportApi(data) { return request.get(`profitsharing/export`, data) } /** * @description 缴存保证金 -- 列表 */ - export function marginLstApi(data) { +export function marginLstApi(data) { return request.get(`margin/lst`, data) } /** * @description 退回保证金 -- 列表 */ - export function marginRefundLstApi(data) { +export function marginRefundLstApi(data) { return request.get(`margin/refund/lst`, data) } /** * @description 退回保证金 -- 审核 */ - export function marginRefundStatus(id) { +export function marginRefundStatus(id) { return request.get(`margin/refund/status/${id}/form`) } /** * @description 退回保证金 -- 备注 */ - export function marginRefundMark(id) { +export function marginRefundMark(id) { return request.get(`margin/refund/mark/${id}/form`) } /** * @description 退回保证金 -- 退回信息 */ - export function marginRefundInfo(id) { +export function marginRefundInfo(id) { return request.get(`margin/refund/show/${id}`) } /** * @description 退回保证金 -- 扣费记录 */ - export function marginDeductionRecord(id, data) { +export function marginDeductionRecord(id, data) { return request.get(`margin/list/${id}`, data) } /** * @description 退回保证金 -- 保证金扣费 */ - export function marginDeductionForm(id) { +export function marginDeductionForm(id) { return request.get(`margin/set/${id}/form`) } diff --git a/src/libs/modal-form.js b/src/libs/modal-form.js index be800b7..d644375 100644 --- a/src/libs/modal-form.js +++ b/src/libs/modal-form.js @@ -18,12 +18,12 @@ const uniqueId = () => ++unique export default function modalForm(formRequestPromise, config = {}) { const h = this.$createElement return new Promise((resolve) => { - formRequestPromise.then(({data}) => { + formRequestPromise.then(({ data }) => { data.config.submitBtn = false data.config.resetBtn = false if (!data.config.form) data.config.form = {} if (!data.config.formData) data.config.formData = {} - data.config.formData = {...data.config.formData, ...config.formData} + data.config.formData = { ...data.config.formData, ...config.formData } data.config.form.labelWidth = '120px' data.config.global = { upload: { @@ -40,7 +40,7 @@ export default function modalForm(formRequestPromise, config = {}) { this.$msgbox({ title: data.title, customClass: config.class || 'modal-form', - message: h('div', {class: 'common-form-create', key: uniqueId()}, [ + message: h('div', { class: 'common-form-create', key: uniqueId() }, [ h('formCreate', { props: { rule: data.rule, @@ -54,7 +54,6 @@ export default function modalForm(formRequestPromise, config = {}) { }) ]), beforeClose: (action, instance, done) => { - const fn = () => { setTimeout(() => { instance.confirmButtonLoading = false diff --git a/src/views/accounts/capitalFlow/index.vue b/src/views/accounts/capitalFlow/index.vue index 09d9f89..39751e5 100644 --- a/src/views/accounts/capitalFlow/index.vue +++ b/src/views/accounts/capitalFlow/index.vue @@ -5,39 +5,18 @@
- - {{ item.text }} + + {{ item.text + }} - + - + 列表导出 @@ -47,14 +26,8 @@
- + @@ -100,7 +206,8 @@ import { intentionDelte, intentionStatusApi, getstoreTypeApi, - getMerCateApi + getMerCateApi, + updateStatus } from "@/api/merchant"; import { categoryListApi } from "@/api/product"; import { fromList, statusList } from "@/libs/constants.js"; @@ -109,6 +216,8 @@ export default { name: "MerchantApplication", data() { return { + statusAuditVisible: false,//状态审核 + statusAuditForm: {},//状态审核表单 props: { emitPath: false }, @@ -162,6 +271,7 @@ export default { this.tableFrom.page = 1; this.getList(""); }, + // 具体日期 onchangeTime(e) { this.timeVal = e; @@ -208,16 +318,57 @@ export default { this.tableFrom.limit = val; this.getList(1); }, + // 修改状态 - onchangeIsShow(id) { - this.$modalForm(intentionStatusApi(id)).then(() => this.getList("")); + onchangeIsShow(item) { + this.statusAuditVisible = true; + this.statusAuditForm = item; + this.$set(this.statusAuditForm, 'state', 1); + this.$set(this.statusAuditForm, 'create_mer', 1); + }, + + // 如果审核状态为拒绝,就不能创建商户 + statusChange() { + if (this.statusAuditForm.state == 2) { + this.statusAuditForm.create_mer = 2; + } else { + this.statusAuditForm.create_mer = 1; + } + }, + + // 如果创建商户,则同意审核 + createMerChange() { + if (this.statusAuditForm.create_mer == 2) { + this.statusAuditForm.state = 2; + } else { + this.statusAuditForm.state = 1; + } + }, + + // 提交状态修改 + handleSubmit() { + if (this.statusAuditForm.state == 2 && !this.statusAuditForm.fail_msg) { + return this.$message.warning("请输入拒绝原因"); + } + + updateStatus(this.statusAuditForm.mer_intention_id, { + status: this.statusAuditForm.state, + create_mer: this.statusAuditForm.create_mer, + fail_msg: this.statusAuditForm.fail_msg + }).then(res => { + this.statusAuditVisible = false; + this.$message.success(res.message); + this.getList(""); + }).catch(({ message }) => { + this.$message.error(message); + }); }, - // 添加 // 编辑 onEdit(id) { this.$modalForm(auditApi(id)).then(() => this.getList("")); }, + // 删除 handleDelete(id) { this.$deleteSure().then(() => { diff --git a/src/views/merchant/open/index.vue b/src/views/merchant/open/index.vue index d3a887c..c5bf7a6 100644 --- a/src/views/merchant/open/index.vue +++ b/src/views/merchant/open/index.vue @@ -74,7 +74,7 @@ @@ -86,6 +86,134 @@ @current-change="pageChange" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+ + + + + + +
+
+
+ 提交 +
+
@@ -105,7 +233,8 @@ import { intentionDelte, intentionStatusApi, getstoreTypeApi, - getMerCateApi + getMerCateApi, + updateStatus } from "@/api/merchant"; import { categoryListApi } from "@/api/product"; import { fromList, statusList } from "@/libs/constants.js"; @@ -114,6 +243,8 @@ export default { name: "MerchantApplication", data() { return { + statusAuditVisible: false,//状态审核 + statusAuditForm: {},//状态审核表单 props: { emitPath: false }, @@ -215,15 +346,36 @@ export default { this.getList(1); }, // 修改状态 - onchangeIsShow(id) { - this.$modalForm(intentionStatusApi(id)).then(() => this.getList("")); + onchangeIsShow(item) { + this.statusAuditVisible = true; + this.statusAuditForm = item; + this.$set(this.statusAuditForm, 'state', 1); + }, + + // 提交状态修改 + handleSubmit() { + + if (this.statusAuditForm.state == 2 && !this.statusAuditForm.fail_msg) { + return this.$message.warning("请输入拒绝原因"); + } + + updateStatus(this.statusAuditForm.mer_intention_id, { + status: this.statusAuditForm.state, + fail_msg: this.statusAuditForm.fail_msg + }).then(res => { + this.statusAuditVisible = false; + this.$message.success(res.message); + this.getList(""); + }).catch(({ message }) => { + this.$message.error(message); + }); }, - // 添加 // 编辑 onEdit(id) { this.$modalForm(auditApi(id)).then(() => this.getList("")); }, + // 删除 handleDelete(id) { this.$deleteSure().then(() => {