订单列表代码调整

This commit is contained in:
joylink_cuiweidong 2019-12-10 10:44:18 +08:00
parent 9199d7bc64
commit fed85fe78e
3 changed files with 9 additions and 96 deletions

View File

@ -27,15 +27,6 @@ export function permissionTurnAdd(data) {
});
}
/** 从订单分发权限(获取二维码)*/
export function postDistribute(data) {
return request({
url: `/api/distribute/${data.code}/distribute`,
method: 'post',
data: data
});
}
/** 权限获取*/
export function getPermission(state) {
return request({

View File

@ -1,57 +0,0 @@
<template>
<el-dialog v-dialogDrag :title="title" :visible.sync="show" width="360px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<div style="text-align:center">
<el-radio-group v-model="formModel.canDistribute">
<el-radio :label="true">{{ $t('orderAuthor.publicAuthority') }}</el-radio>
<el-radio :label="false">{{ $t('orderAuthor.privateAuthority') }}</el-radio>
</el-radio-group>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="handleClose">{{ $t('global.cancel') }}</el-button>
<el-button type="primary" @click="handleSure">{{ $t('global.confirm') }}</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
name: 'CanTransfer',
data() {
return {
dialogShow: false,
formModel: {
canDistribute: true
},
data: {}
};
},
computed: {
show() {
return this.dialogShow;
},
title() { return this.$t('orderAuthor.optionPrivilegeTransfer'); }
},
methods: {
doShow(data) {
this.dialogShow = true;
this.formModel.canDistribute = true;
this.data = data;
},
doClose() {
this.dialogShow = false;
},
handleSure() {
this.doClose();
Object.assign(this.data, this.formModel);
const model = {
code: this.data.code,
canDistribute: this.data.canDistribute ? this.data.canDistribute : false
};
this.$emit('distribute', model);
},
handleClose() {
this.doClose();
}
}
};
</script>

View File

@ -1,7 +1,6 @@
<template>
<div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<can-distribute ref="canDistribute" @distribute="distribute" />
<qr-code ref="qrCode" />
<detail ref="detail" />
</div>
@ -11,17 +10,15 @@
import { getOrderPageList } from '@/api/management/order';
import { getSellerList } from '@/api/management/user';
import { getOrganizationList } from '@/api/management/organization';
import { postDistribute } from '@/api/management/distribute';
import { getDistributeFromOrder } from '@/api/management/order';
import { UrlConfig } from '@/router/index';
import QrCode from '@/components/QrCode';
import CanDistribute from './canDistribute';
import detail from './detail';
export default {
name: 'List',
components: {
QrCode,
CanDistribute,
detail
},
data() {
@ -177,13 +174,7 @@ export default {
name: this.$t('orderAuthor.obtainQrCode'),
type: 'warning',
handleClick: this.handleCanDistribute,
showControl: (row) => { return row.bizType !== '02' && row.orderType !== '01' && row.qrCodeGenerated; }
},
{
name: this.$t('orderAuthor.generatingQRCode'),
type: 'warning',
handleClick: this.handleCanDistribute,
showControl: (row) => { return row.bizType !== '02' && row.orderType !== '01' && !row.qrCodeGenerated; }
showControl: (row) => { return row.bizType !== '02' && row.orderType !== '01'; }
}
]
}
@ -250,27 +241,15 @@ export default {
this.$refs.detail.doShow(data);
},
handleCanDistribute(index, data) {
if (data.qrCodeGenerated) {
data.canDistribute = true;
this.distribute(data);
} else {
this.$refs.canDistribute.doShow(data);
}
this.distribute(data.code);
},
distribute(data) {
const model = {
code: data.code,
canDistribute: data.canDistribute ? data.canDistribute : false
};
postDistribute(model).then(response => {
distribute(orderCode) {
getDistributeFromOrder(orderCode).then(response => {
this.reloadTable();
if (data.qrCodeGenerated) {
this.$refs.qrCode.doShow({
url: response.data,
title: this.$t('orderAuthor.transferQRCode')
});
}
}).catch(() => {
this.$messageBox(this.$t('error.transferredQRCodeFailed'));