|
@@ -5,6 +5,9 @@ import {
|
|
|
SpotContractOperateReq
|
|
SpotContractOperateReq
|
|
|
} from "@/services/proto/spotcontract/interface";
|
|
} from "@/services/proto/spotcontract/interface";
|
|
|
import { ref } from "vue";
|
|
import { ref } from "vue";
|
|
|
|
|
+import {getRequestResultInfo} from "@/common/methods/request";
|
|
|
|
|
+import {ContractStateSign, GldContractStateSign} from "@/views/information/spot-contract/setup";
|
|
|
|
|
+import {message} from "ant-design-vue";
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 合同操作相关
|
|
* 合同操作相关
|
|
@@ -25,34 +28,16 @@ export function changeOrderContract() {
|
|
|
Remark: '',
|
|
Remark: '',
|
|
|
Info: info,
|
|
Info: info,
|
|
|
}
|
|
}
|
|
|
- let successText = "成功"
|
|
|
|
|
- let errorText = "失败"
|
|
|
|
|
-
|
|
|
|
|
- switch (type) {
|
|
|
|
|
- case 1:
|
|
|
|
|
- successText = "保存草稿成功"
|
|
|
|
|
- errorText = "保存草稿失败:"
|
|
|
|
|
- break;
|
|
|
|
|
- case 2:
|
|
|
|
|
- successText = "提交申请成功"
|
|
|
|
|
- errorText = "提交申请失败:"
|
|
|
|
|
- break;
|
|
|
|
|
- case 3:
|
|
|
|
|
- successText = "删除成功"
|
|
|
|
|
- errorText = "删除失败:"
|
|
|
|
|
- break;
|
|
|
|
|
- case 4:
|
|
|
|
|
- successText = "审核通过"
|
|
|
|
|
- errorText = "审核失败:"
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ const sign = getRequestResultInfo(GldContractStateSign, type) // 接口请求后的返回提示 这里统一进行管理
|
|
|
|
|
|
|
|
return orderContract(reqs)
|
|
return orderContract(reqs)
|
|
|
.then(res => {
|
|
.then(res => {
|
|
|
- return Promise.resolve(successText)
|
|
|
|
|
|
|
+ message.success(sign[0])
|
|
|
|
|
+ return Promise.resolve(sign[0])
|
|
|
})
|
|
})
|
|
|
.catch(err => {
|
|
.catch(err => {
|
|
|
- return Promise.reject(errorText + err)
|
|
|
|
|
|
|
+ message.success(sign[1])
|
|
|
|
|
+ return Promise.reject(sign[1] + err)
|
|
|
}).finally(() => {
|
|
}).finally(() => {
|
|
|
loading.value = false
|
|
loading.value = false
|
|
|
})
|
|
})
|
|
@@ -61,13 +46,13 @@ export function changeOrderContract() {
|
|
|
return { loading, orderContractState }
|
|
return { loading, orderContractState }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* 修改合同类型
|
|
* 修改合同类型
|
|
|
* 4:审核拒绝 6:正常完结 5:撤销
|
|
* 4:审核拒绝 6:正常完结 5:撤销
|
|
|
*/
|
|
*/
|
|
|
export function OrderContractControl() {
|
|
export function OrderContractControl() {
|
|
|
const loading = ref<boolean>(false);
|
|
const loading = ref<boolean>(false);
|
|
|
|
|
+ loading.value = true
|
|
|
|
|
|
|
|
function orderContractState(id: string, type: number): Promise<string> {
|
|
function orderContractState(id: string, type: number): Promise<string> {
|
|
|
const reqs: SpotContractOperateReq = {
|
|
const reqs: SpotContractOperateReq = {
|
|
@@ -75,30 +60,15 @@ export function OrderContractControl() {
|
|
|
OperateType: type,
|
|
OperateType: type,
|
|
|
Remark: '',
|
|
Remark: '',
|
|
|
}
|
|
}
|
|
|
- let successText = "成功"
|
|
|
|
|
- let errorText = "失败"
|
|
|
|
|
-
|
|
|
|
|
- switch (type) {
|
|
|
|
|
- case 4:
|
|
|
|
|
- successText = "审核拒绝成功"
|
|
|
|
|
- errorText = "审核拒绝失败:"
|
|
|
|
|
- break;
|
|
|
|
|
- case 5:
|
|
|
|
|
- successText = "撤销成功"
|
|
|
|
|
- errorText = "撤销失败:"
|
|
|
|
|
- break;
|
|
|
|
|
- case 6:
|
|
|
|
|
- successText = "正常完结"
|
|
|
|
|
- errorText = "合同完结失败:"
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
|
|
+ const sign = getRequestResultInfo(ContractStateSign, type) // 接口请求后的返回提示 这里统一进行管理
|
|
|
return spotContractStatus(reqs)
|
|
return spotContractStatus(reqs)
|
|
|
.then(res => {
|
|
.then(res => {
|
|
|
- return Promise.resolve(successText)
|
|
|
|
|
|
|
+ message.success(sign[0])
|
|
|
|
|
+ return Promise.resolve(sign[0])
|
|
|
})
|
|
})
|
|
|
.catch(err => {
|
|
.catch(err => {
|
|
|
- return Promise.reject(errorText + err)
|
|
|
|
|
|
|
+ message.success(sign[1])
|
|
|
|
|
+ return Promise.reject(sign[1] + err)
|
|
|
}).finally(() => {
|
|
}).finally(() => {
|
|
|
loading.value = false
|
|
loading.value = false
|
|
|
})
|
|
})
|