2023-07-15 18:18:22 +08:00
|
|
|
<template>
|
|
|
|
|
<div class="conent">
|
2023-08-22 15:26:34 +08:00
|
|
|
<div>
|
|
|
|
|
<el-button type="primary" @click="addAuthVisible = true">新增授权</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
|
2023-07-15 18:18:22 +08:00
|
|
|
<div class="table" style="margin-top: 10px">
|
|
|
|
|
<el-table v-loading="loading" :data="tableData" style="width: 100%">
|
2023-08-22 15:26:34 +08:00
|
|
|
<el-table-column prop="shop.name" label="店铺名称"></el-table-column>
|
|
|
|
|
<el-table-column prop="type" label="账户类型"></el-table-column>
|
|
|
|
|
<el-table-column prop="expires_at" label="授权过期时间点"></el-table-column>
|
|
|
|
|
<el-table-column prop="owner_id" label="商家店铺id"></el-table-column>
|
|
|
|
|
<el-table-column prop="owner_name" label="商家账号名称"></el-table-column>
|
2023-07-15 18:18:22 +08:00
|
|
|
<el-table-column label="操作">
|
|
|
|
|
<template slot-scope="scope">
|
2023-08-22 15:26:34 +08:00
|
|
|
<el-button type="info" @click="getSenders(scope.row)" size="small">发货信息</el-button>
|
2023-07-15 18:18:22 +08:00
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
</div>
|
2023-07-27 18:30:09 +08:00
|
|
|
|
2023-08-22 15:26:34 +08:00
|
|
|
<!-- 新增授权 -->
|
|
|
|
|
<el-dialog title="新增授权" :visible.sync="addAuthVisible" :close-on-click-modal="false" width="20%">
|
|
|
|
|
<el-form :model="authForm" label-width="80px">
|
|
|
|
|
<el-form-item label="店铺">
|
|
|
|
|
<el-select v-model="authForm.shop_id" placeholder="请选择店铺">
|
|
|
|
|
<el-option v-for="item in shops" :key="item.id" :label="item.name" :value="item.id">
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="账户类型">
|
|
|
|
|
<el-radio-group v-model="authForm.type">
|
|
|
|
|
<el-radio label="normal">电商标快</el-radio>
|
|
|
|
|
<el-radio label="air">空运</el-radio>
|
|
|
|
|
</el-radio-group>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item>
|
|
|
|
|
<el-button type="primary" @click="authBtn()">授权</el-button>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
</el-dialog>
|
2023-07-27 18:30:09 +08:00
|
|
|
|
|
|
|
|
<!-- 发货信息 -->
|
|
|
|
|
<el-dialog title="发货信息" :visible.sync="dialogVisible" :close-on-click-modal="false">
|
|
|
|
|
<el-form ref="sendersForm" :model="sendersForm" label-width="100px">
|
|
|
|
|
|
|
|
|
|
<template v-for="(item, index) in sendersForm.senderList" :prop="`senderList.$(index)`">
|
|
|
|
|
<div>
|
|
|
|
|
<p>发货地址 {{ index + 1 }}</p>
|
|
|
|
|
<el-form-item label="详细地址">
|
|
|
|
|
{{ item.province }} {{ item.city }} {{ item.district }} {{ item.detail }}
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
<el-form-item label="发货人" prop="name">
|
|
|
|
|
<el-input v-model="item.name"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
<el-form-item label="手机号" prop="mobile">
|
|
|
|
|
<el-input v-model="item.mobile"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
<el-form-item label="排序" prop="sort">
|
|
|
|
|
<el-input v-model="item.sort"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
<el-form-item label="状态">
|
|
|
|
|
<el-radio-group v-model="item.status">
|
|
|
|
|
<el-radio :label="1">启用</el-radio>
|
|
|
|
|
<el-radio :label="0">停用</el-radio>
|
|
|
|
|
</el-radio-group>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<el-form-item>
|
2023-08-22 15:26:34 +08:00
|
|
|
<el-button type="primary" @click="saveSenders()">保存</el-button>
|
2023-07-27 18:30:09 +08:00
|
|
|
<el-button @click="dialogVisible = false">取消</el-button>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
</el-dialog>
|
2023-07-15 18:18:22 +08:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2023-08-22 15:26:34 +08:00
|
|
|
import { shipList, ShopSenderList, saveSenders, storeList } from "../../api/shop";
|
2023-07-15 18:18:22 +08:00
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
storeId: [],
|
|
|
|
|
loading: true,
|
|
|
|
|
tableData: [],
|
2023-07-27 18:30:09 +08:00
|
|
|
dialogVisible: false,
|
2023-08-22 15:26:34 +08:00
|
|
|
addAuthVisible: false,
|
2023-07-27 18:30:09 +08:00
|
|
|
sendersForm: {
|
|
|
|
|
senderList: []
|
|
|
|
|
},
|
2023-08-22 15:26:34 +08:00
|
|
|
shops: [],
|
|
|
|
|
authForm: {
|
|
|
|
|
shop_id: '',
|
|
|
|
|
type: 'normal'
|
|
|
|
|
}
|
2023-07-15 18:18:22 +08:00
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
this.getShipList();
|
2023-08-22 15:26:34 +08:00
|
|
|
this.getShopsList();
|
2023-07-15 18:18:22 +08:00
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
getShipList() {
|
|
|
|
|
shipList().then((res) => {
|
|
|
|
|
this.tableData = res.data.data;
|
|
|
|
|
});
|
|
|
|
|
this.loading = false
|
|
|
|
|
},
|
2023-07-27 18:30:09 +08:00
|
|
|
getSenders(row) {
|
2023-08-22 15:26:34 +08:00
|
|
|
ShopSenderList(row.shop_id, row.id).then((res) => {
|
2023-07-27 18:30:09 +08:00
|
|
|
this.sendersForm.senderList = res.data.data;
|
|
|
|
|
this.dialogVisible = true;
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
saveSenders() {
|
|
|
|
|
saveSenders(this.sendersForm).then((res) => {
|
|
|
|
|
if (200 === res.status) {
|
|
|
|
|
this.$message.success(res.data.message);
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(res.data.message);
|
|
|
|
|
}
|
|
|
|
|
})
|
2023-08-22 15:26:34 +08:00
|
|
|
},
|
|
|
|
|
getShopsList() {
|
|
|
|
|
let page = {
|
|
|
|
|
page: 0,
|
|
|
|
|
per_page: 999,
|
|
|
|
|
plat_id: 1,
|
|
|
|
|
};
|
|
|
|
|
storeList(page).then((res) => {
|
|
|
|
|
this.shops = res.data.data;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
authBtn() {
|
|
|
|
|
location.href = "https://wb.pinduoduo.com/logistics/auth?client_id=24f25877aca447c5830a6aa896301d5e&redirect_uri=http://erp.chutang66.com/pdd/ship&state=" + this.authForm.shop_id + '_' + this.authForm.type;
|
2023-07-27 18:30:09 +08:00
|
|
|
}
|
2023-07-15 18:18:22 +08:00
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
a {
|
|
|
|
|
text-decoration: none;
|
|
|
|
|
color: white;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.block {
|
|
|
|
|
margin-top: 20px;
|
|
|
|
|
}
|
|
|
|
|
</style>
|