feat: add coin seller parent unbind dialog
This commit is contained in:
parent
b5a86072f2
commit
6011fca268
@ -523,6 +523,24 @@ export function removeFreightSeller(id) {
|
||||
});
|
||||
}
|
||||
|
||||
// 查询币商当前绑定的上级经理
|
||||
export function getFreightSubSellerParent(params) {
|
||||
return request({
|
||||
url: "/freight/sub-seller-parent",
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
// 解绑币商当前绑定的上级经理
|
||||
export function unbindFreightSubSellerParent(data) {
|
||||
return request({
|
||||
url: "/freight/sub-seller-parent/unbind",
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
// 获取指定用户运行资料
|
||||
export function getUserRunProfileById(userId) {
|
||||
return request({
|
||||
|
||||
@ -2447,7 +2447,8 @@ export default {
|
||||
submit: 'Submit',
|
||||
save: 'Save',
|
||||
delete: 'Delete',
|
||||
confirm: 'Confirm'
|
||||
confirm: 'Confirm',
|
||||
unbindParent: 'Unbind Parent'
|
||||
},
|
||||
table: {
|
||||
system: 'System',
|
||||
@ -2535,6 +2536,16 @@ export default {
|
||||
deleteConfirm: 'This action will delete the seller. Continue?',
|
||||
deleteCanceled: 'Deletion canceled'
|
||||
},
|
||||
parentUnbind: {
|
||||
title: 'Unbind Coin Seller Parent',
|
||||
notBound: 'This coin seller is not currently bound to a parent manager.',
|
||||
warning: 'After unbinding, this coin seller can be bound to the current manager. Verify both users before continuing.',
|
||||
coinSeller: 'Coin Seller',
|
||||
currentParent: 'Current Parent Manager',
|
||||
bindTime: 'Bound At',
|
||||
confirmUnbind: 'Confirm Unbind',
|
||||
confirmMessage: 'Unbind this coin seller from the current parent manager?'
|
||||
},
|
||||
sellerRunningWater: {
|
||||
title: 'Dealer Seller Freight Running Water'
|
||||
}
|
||||
|
||||
@ -2446,7 +2446,8 @@ export default {
|
||||
submit: '提交',
|
||||
save: '保存',
|
||||
delete: '删除',
|
||||
confirm: '确定'
|
||||
confirm: '确定',
|
||||
unbindParent: '解绑上级'
|
||||
},
|
||||
table: {
|
||||
system: '系统',
|
||||
@ -2534,6 +2535,16 @@ export default {
|
||||
deleteConfirm: '此操作将删除该卖家,是否继续?',
|
||||
deleteCanceled: '已取消删除'
|
||||
},
|
||||
parentUnbind: {
|
||||
title: '币商解绑上级',
|
||||
notBound: '该币商当前没有绑定上级经理',
|
||||
warning: '解绑后,该币商可以重新绑定到现任经理名下。请核对币商和原上级后再操作。',
|
||||
coinSeller: '币商',
|
||||
currentParent: '当前上级经理',
|
||||
bindTime: '绑定时间',
|
||||
confirmUnbind: '确认解绑',
|
||||
confirmMessage: '确定解除该币商与当前上级经理的绑定关系吗?'
|
||||
},
|
||||
sellerRunningWater: {
|
||||
title: '经销商卖家货运流水'
|
||||
}
|
||||
|
||||
@ -224,7 +224,7 @@
|
||||
{{ scope.row.createTime | dateFormat }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column fixed="right" :label="$t('pages.userFreight.table.actions')" align="center" width="190">
|
||||
<el-table-column fixed="right" :label="$t('pages.userFreight.table.actions')" align="center" width="270">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click.native="handleUpdate(scope.row)"
|
||||
>{{ $t('pages.userFreight.action.edit') }}</el-button
|
||||
@ -241,6 +241,12 @@
|
||||
<el-button type="text" @click="runningWaterVisible = true"
|
||||
>{{ $t('pages.userFreight.action.runningWater') }}</el-button
|
||||
>
|
||||
<el-button
|
||||
v-if="!scope.row.dealer && !scope.row.superDealer"
|
||||
type="text"
|
||||
@click="showParentUnbind(scope.row)"
|
||||
>{{ $t('pages.userFreight.action.unbindParent') }}</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -272,6 +278,13 @@
|
||||
@close="sellerInfoClose"
|
||||
/>
|
||||
|
||||
<parent-unbind
|
||||
v-if="parentUnbindVisible"
|
||||
:row="parentUnbindRow"
|
||||
@close="parentUnbindVisible = false"
|
||||
@success="parentUnbindSuccess"
|
||||
/>
|
||||
|
||||
<div class="gold-input-box">
|
||||
<el-dialog
|
||||
:title="type ? $t('pages.userFreight.dialog.ship') : $t('pages.userFreight.dialog.deduct')"
|
||||
@ -393,11 +406,12 @@ import Pagination from "@/components/Pagination";
|
||||
import FormEdit from "./form-edit";
|
||||
import RunningWater from "./running-water";
|
||||
import SellerInfo from "./seller-info";
|
||||
import ParentUnbind from "./parent-unbind";
|
||||
import { mapGetters } from "vuex";
|
||||
|
||||
export default {
|
||||
name: "UserPropsTable",
|
||||
components: { Pagination, FormEdit, RunningWater, SellerInfo },
|
||||
components: { Pagination, FormEdit, RunningWater, SellerInfo, ParentUnbind },
|
||||
data() {
|
||||
const blank = value => value === undefined || value === null || String(value).trim() === "";
|
||||
const validateEarnPoints = (rule, value, callback) => {
|
||||
@ -432,6 +446,8 @@ export default {
|
||||
runningWaterVisible: false,
|
||||
showSellerInfoVisable: false,
|
||||
sellerInfoEditParam: {},
|
||||
parentUnbindVisible: false,
|
||||
parentUnbindRow: {},
|
||||
thatRow: null,
|
||||
userInfo: {},
|
||||
searchDisabled: false,
|
||||
@ -571,6 +587,14 @@ export default {
|
||||
this.showSellerInfoVisable = false;
|
||||
this.renderData();
|
||||
},
|
||||
showParentUnbind(row) {
|
||||
this.parentUnbindRow = row;
|
||||
this.parentUnbindVisible = true;
|
||||
},
|
||||
parentUnbindSuccess() {
|
||||
this.parentUnbindVisible = false;
|
||||
this.renderData();
|
||||
},
|
||||
showGoldInputBox(row, type) {
|
||||
const that = this;
|
||||
that.type = type;
|
||||
|
||||
144
src/views/user/freight/parent-unbind.vue
Normal file
144
src/views/user/freight/parent-unbind.vue
Normal file
@ -0,0 +1,144 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="$t('pages.userFreight.parentUnbind.title')"
|
||||
:visible="true"
|
||||
:modal-append-to-body="true"
|
||||
:append-to-body="true"
|
||||
:before-close="handleClose"
|
||||
:close-on-click-modal="false"
|
||||
width="560px"
|
||||
>
|
||||
<div v-loading="loading" class="parent-unbind">
|
||||
<el-alert
|
||||
v-if="!loading && !relation"
|
||||
:title="$t('pages.userFreight.parentUnbind.notBound')"
|
||||
type="info"
|
||||
:closable="false"
|
||||
show-icon
|
||||
/>
|
||||
|
||||
<el-alert
|
||||
v-if="relation"
|
||||
:title="$t('pages.userFreight.parentUnbind.warning')"
|
||||
type="warning"
|
||||
:closable="false"
|
||||
show-icon
|
||||
/>
|
||||
|
||||
<el-form v-if="relation" label-width="150px" class="relation-form">
|
||||
<el-form-item :label="$t('pages.userFreight.parentUnbind.coinSeller')">
|
||||
<user-table-exhibit :user-profile="row.userBaseInfo" :query-details="true" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('pages.userFreight.parentUnbind.currentParent')">
|
||||
<user-table-exhibit
|
||||
v-if="relation.parentUserBaseInfo"
|
||||
:user-profile="relation.parentUserBaseInfo"
|
||||
:query-details="true"
|
||||
/>
|
||||
<span v-else>{{ relation.parentUserId }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('pages.userFreight.parentUnbind.bindTime')">
|
||||
{{ relation.createTime | dateFormat }}
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="handleClose">
|
||||
{{ $t('pages.userFreight.action.cancel') }}
|
||||
</el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
:loading="submitLoading"
|
||||
:disabled="!relation"
|
||||
@click="submitUnbind"
|
||||
>
|
||||
{{ $t('pages.userFreight.parentUnbind.confirmUnbind') }}
|
||||
</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getFreightSubSellerParent,
|
||||
unbindFreightSubSellerParent
|
||||
} from '@/api/app-user'
|
||||
|
||||
export default {
|
||||
name: 'FreightParentUnbind',
|
||||
props: {
|
||||
row: {
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
submitLoading: false,
|
||||
relation: null
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.loadRelation()
|
||||
},
|
||||
methods: {
|
||||
loadRelation() {
|
||||
this.loading = true
|
||||
getFreightSubSellerParent({
|
||||
sysOrigin: this.row.sysOrigin,
|
||||
childUserId: this.row.userId
|
||||
})
|
||||
.then(res => {
|
||||
this.relation = res.body || null
|
||||
})
|
||||
.finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
handleClose() {
|
||||
this.$emit('close')
|
||||
},
|
||||
submitUnbind() {
|
||||
if (!this.relation) {
|
||||
return
|
||||
}
|
||||
|
||||
this.$confirm(
|
||||
this.$t('pages.userFreight.parentUnbind.confirmMessage'),
|
||||
this.$t('pages.userFreight.dialog.prompt'),
|
||||
{
|
||||
confirmButtonText: this.$t('pages.userFreight.parentUnbind.confirmUnbind'),
|
||||
cancelButtonText: this.$t('pages.userFreight.action.cancel'),
|
||||
type: 'warning'
|
||||
}
|
||||
).then(() => {
|
||||
this.submitLoading = true
|
||||
unbindFreightSubSellerParent({
|
||||
relationId: this.relation.relationId,
|
||||
sysOrigin: this.relation.sysOrigin,
|
||||
childUserId: this.relation.childUserId
|
||||
})
|
||||
.then(() => {
|
||||
this.$opsMessage.success()
|
||||
this.$emit('success')
|
||||
})
|
||||
.finally(() => {
|
||||
this.submitLoading = false
|
||||
})
|
||||
}).catch(() => {})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.parent-unbind {
|
||||
min-height: 120px;
|
||||
}
|
||||
|
||||
.relation-form {
|
||||
margin-top: 22px;
|
||||
}
|
||||
</style>
|
||||
Loading…
x
Reference in New Issue
Block a user