|
@@ -217,14 +217,10 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
|
+import request from '@/utils/request'
|
|
|
|
|
+
|
|
|
export default {
|
|
export default {
|
|
|
name: 'ProfitShareReceiver',
|
|
name: 'ProfitShareReceiver',
|
|
|
- props: {
|
|
|
|
|
- axiosInstance: {
|
|
|
|
|
- type: Object,
|
|
|
|
|
- default: null
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
loading: false,
|
|
loading: false,
|
|
@@ -279,12 +275,6 @@ export default {
|
|
|
|
|
|
|
|
// 获取列表数据
|
|
// 获取列表数据
|
|
|
async fetchData() {
|
|
async fetchData() {
|
|
|
- // 优先使用通过props传递的axios实例
|
|
|
|
|
- if (!this.axiosInstance) {
|
|
|
|
|
- this.$message.error('无法获取请求实例')
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
this.loading = true
|
|
this.loading = true
|
|
|
try {
|
|
try {
|
|
|
const params = {
|
|
const params = {
|
|
@@ -294,7 +284,7 @@ export default {
|
|
|
status: this.searchForm.status
|
|
status: this.searchForm.status
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- const res = await this.axiosInstance.get('/lakala/profit_share_receiver', { params })
|
|
|
|
|
|
|
+ const res = await request.get('/lakala/profit_share_receiver', { params })
|
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
|
// 根据接口返回结构调整数据处理
|
|
// 根据接口返回结构调整数据处理
|
|
|
this.tableData = res.page.data
|
|
this.tableData = res.page.data
|
|
@@ -313,23 +303,17 @@ export default {
|
|
|
|
|
|
|
|
// 获取详情数据
|
|
// 获取详情数据
|
|
|
async fetchDetail(id) {
|
|
async fetchDetail(id) {
|
|
|
- if (!this.axiosInstance) {
|
|
|
|
|
- this.$message.error('无法获取请求实例')
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
this.detailLoading = true
|
|
this.detailLoading = true
|
|
|
try {
|
|
try {
|
|
|
- const res = await this.axiosInstance.get(`/lakala/profit_share_receiver/${id}`)
|
|
|
|
|
|
|
+ const res = await request.get(`/lakala/profit_share_receiver/${id}`)
|
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
|
this.detailData = res.data
|
|
this.detailData = res.data
|
|
|
// 处理合作协议文件路径
|
|
// 处理合作协议文件路径
|
|
|
if (this.detailData.entrust_local_path) {
|
|
if (this.detailData.entrust_local_path) {
|
|
|
// 如果是相对路径,则拼接VITE_API_BASE_URL
|
|
// 如果是相对路径,则拼接VITE_API_BASE_URL
|
|
|
if (!this.detailData.entrust_local_path.startsWith('http')) {
|
|
if (!this.detailData.entrust_local_path.startsWith('http')) {
|
|
|
- const { VITE_API_BASE_URL } = this.axiosInstance.defaults.baseURL ?
|
|
|
|
|
- { VITE_API_BASE_URL: this.axiosInstance.defaults.baseURL.replace('/admin', '') } :
|
|
|
|
|
- { VITE_API_BASE_URL: '' }
|
|
|
|
|
|
|
+ const baseURL = request.defaults.baseURL || ''
|
|
|
|
|
+ const VITE_API_BASE_URL = baseURL.replace('/admin', '')
|
|
|
this.detailData.entrust_local_full_url = VITE_API_BASE_URL + this.detailData.entrust_local_path
|
|
this.detailData.entrust_local_full_url = VITE_API_BASE_URL + this.detailData.entrust_local_path
|
|
|
} else {
|
|
} else {
|
|
|
// 如果是绝对路径,直接使用
|
|
// 如果是绝对路径,直接使用
|
|
@@ -377,14 +361,9 @@ export default {
|
|
|
|
|
|
|
|
// 分账接收方创建申请
|
|
// 分账接收方创建申请
|
|
|
async handleCreateApplication() {
|
|
async handleCreateApplication() {
|
|
|
- if (!this.axiosInstance) {
|
|
|
|
|
- this.$message.error('无法获取请求实例')
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
this.applyLoading = true
|
|
this.applyLoading = true
|
|
|
try {
|
|
try {
|
|
|
- const res = await this.axiosInstance.put(`/lakala/profit_share_receiver/${this.detailData.id}/apply`)
|
|
|
|
|
|
|
+ const res = await request.put(`/lakala/profit_share_receiver/${this.detailData.id}/apply`)
|
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
|
this.$message.success('分账接收方创建申请已提交')
|
|
this.$message.success('分账接收方创建申请已提交')
|
|
|
this.handleCloseDetailDialog()
|
|
this.handleCloseDetailDialog()
|
|
@@ -403,14 +382,9 @@ export default {
|
|
|
|
|
|
|
|
// 分账关系绑定申请
|
|
// 分账关系绑定申请
|
|
|
async handleBindApplication() {
|
|
async handleBindApplication() {
|
|
|
- if (!this.axiosInstance) {
|
|
|
|
|
- this.$message.error('无法获取请求实例')
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
this.applyLoading = true
|
|
this.applyLoading = true
|
|
|
try {
|
|
try {
|
|
|
- const res = await this.axiosInstance.put(`/lakala/profit_share_receiver/${this.detailData.id}/bind`)
|
|
|
|
|
|
|
+ const res = await request.put(`/lakala/profit_share_receiver/${this.detailData.id}/bind`)
|
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
|
this.$message.success('分账关系绑定申请已提交')
|
|
this.$message.success('分账关系绑定申请已提交')
|
|
|
this.handleCloseDetailDialog()
|
|
this.handleCloseDetailDialog()
|
|
@@ -429,14 +403,9 @@ export default {
|
|
|
|
|
|
|
|
// 分账接收方信息变更申请
|
|
// 分账接收方信息变更申请
|
|
|
async handleUpdateApplication() {
|
|
async handleUpdateApplication() {
|
|
|
- if (!this.axiosInstance) {
|
|
|
|
|
- this.$message.error('无法获取请求实例')
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
this.applyLoading = true
|
|
this.applyLoading = true
|
|
|
try {
|
|
try {
|
|
|
- const res = await this.axiosInstance.put(`/lakala/profit_share_receiver/${this.detailData.id}/modify`)
|
|
|
|
|
|
|
+ const res = await request.put(`/lakala/profit_share_receiver/${this.detailData.id}/modify`)
|
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
|
this.$message.success('分账接收方信息变更申请已提交')
|
|
this.$message.success('分账接收方信息变更申请已提交')
|
|
|
this.handleCloseDetailDialog()
|
|
this.handleCloseDetailDialog()
|
|
@@ -521,4 +490,4 @@ export default {
|
|
|
flex-grow: 1;
|
|
flex-grow: 1;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-</style>
|
|
|
|
|
|
|
+</style>
|