|
@@ -1,8 +1,9 @@
|
|
|
<template>
|
|
|
<div class="view" id="labelPage" v-loading="load">
|
|
|
- <by-tool :propConfig="tool" v-if="userInfo && userInfo.userName == 'admin'" class="tool"
|
|
|
- @clickHandle="clickHandle" id="configTool" />
|
|
|
+ <!-- <by-tool :propConfig="tool" v-if="userInfo && userInfo.userName == 'admin'" class="tool"
|
|
|
+ @clickHandle="clickHandle" id="configTool" /> -->
|
|
|
<!-- <module-view :propConfig="config" ref="view" @pagination="getList" @onRefresh="getList" /> -->
|
|
|
+ <el-button type="default" @click="uploadWaterShop" size="small" style="margin-bottom: 10px;">同步店铺</el-button>
|
|
|
<by-table :propConfig="tableConfig" ref="table">
|
|
|
<template v-slot:ordered="{ row }">
|
|
|
<vxe-input v-if="userInfo && userInfo.userName == 'admin'" v-model="row.ordered" size="small"
|
|
@@ -16,10 +17,12 @@
|
|
|
|
|
|
<script lang="ts">
|
|
|
import { Component, Prop, Vue, Watch } from "vue-property-decorator";
|
|
|
-import { query, IShopResponse } from '@/api/shop'
|
|
|
+import { query, IShopResponse, uploadWaterShop } from '@/api/shop'
|
|
|
+import { IResponeData, waterShop } from "@/api/omsOrder";
|
|
|
@Component({ components: {} })
|
|
|
export default class OrderConfig extends Vue {
|
|
|
isHasOne = false;//是否有一条数据
|
|
|
+ shopIds: string[] = [];
|
|
|
userInfo: any = {};
|
|
|
tool = {
|
|
|
tools: {
|
|
@@ -31,15 +34,20 @@ export default class OrderConfig extends Vue {
|
|
|
tableConfig: any = {
|
|
|
attr: {
|
|
|
size: 'mini',
|
|
|
- align: 'center',
|
|
|
+ align: 'left',
|
|
|
seq: true
|
|
|
},
|
|
|
columns: [{
|
|
|
+ width: 150,
|
|
|
title: '店铺编号',
|
|
|
field: 'shopId'
|
|
|
}, {
|
|
|
title: '店铺名称',
|
|
|
field: 'shopName'
|
|
|
+ }, {
|
|
|
+ title: '平台',
|
|
|
+ field: 'shopSite',
|
|
|
+ width: 150,
|
|
|
}, {
|
|
|
title: '创建于',
|
|
|
field: 'createTime',
|
|
@@ -52,26 +60,32 @@ export default class OrderConfig extends Vue {
|
|
|
load = false;
|
|
|
|
|
|
|
|
|
- async getMyList() {
|
|
|
- // this.load = true;
|
|
|
- // const res = await query({ pageSize: 2000, pageNum: 1 }) as IShopResponse<any>;
|
|
|
- // this.load = false;
|
|
|
- // if (res.code != 200) {
|
|
|
- // return;
|
|
|
- // }
|
|
|
- // this.isHasOne = res.rows.length > 0;
|
|
|
- // (this.$refs.table as any).setValue(res.rows);
|
|
|
+ //同步聚水潭店铺
|
|
|
+ async uploadWaterShop() {
|
|
|
+ this.$confirm('确认同步聚水潭店铺吗?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(async () => {
|
|
|
+ const res = await uploadWaterShop({ pageIndex: 1, pageSize: 20 }) as unknown as IShopResponse<any>;
|
|
|
+ if (res.code != 200) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.$message.success('同步成功');
|
|
|
+ this.getList();
|
|
|
+ }).catch((err: any) => {
|
|
|
+ console.info("取消")
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
async getList() {
|
|
|
- // this.load = true;
|
|
|
- // const res = await queryOrderTimeConfig({ pageSize: 20, pageNum: 1 }) as IOrderTimeResponse<IOrderTimeConfigItem[]>;
|
|
|
- // this.load = false;
|
|
|
- // if (res.code != 200) {
|
|
|
- // return;
|
|
|
- // }
|
|
|
- // this.isHasOne = res.rows.length > 0;
|
|
|
- // (this.$refs.table as any).setValue(res.rows);
|
|
|
+ this.load = true;
|
|
|
+ const res = await waterShop() as unknown as IResponeData<any>;
|
|
|
+ this.load = false;
|
|
|
+ if (res.code != 200) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ (this.$refs.table as any).setValue(res.rows);
|
|
|
}
|
|
|
clickHandle(e: string) {
|
|
|
if (e == 'onAdd') {
|