fix:供应商账单测试
This commit is contained in:
@@ -10,6 +10,13 @@ const ShopApi = {
|
|||||||
params: params,
|
params: params,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
getBranchList(params: PageQuery) {
|
||||||
|
return request<any, ShopInfoEditDTO[]>({
|
||||||
|
url: `${baseURL}/branchList`,
|
||||||
|
method: "get",
|
||||||
|
params: params,
|
||||||
|
});
|
||||||
|
},
|
||||||
add(data: ShopInfoEditDTO) {
|
add(data: ShopInfoEditDTO) {
|
||||||
return request<any, ShopInfoEditDTO>({
|
return request<any, ShopInfoEditDTO>({
|
||||||
url: `${baseURL}`,
|
url: `${baseURL}`,
|
||||||
@@ -277,4 +284,4 @@ export interface ShopInfo {
|
|||||||
tubeType?: number | null;
|
tubeType?: number | null;
|
||||||
updateTime?: null | string;
|
updateTime?: null | string;
|
||||||
[property: string]: any;
|
[property: string]: any;
|
||||||
}
|
}
|
||||||
|
|||||||
51
src/api/account/shopBranch.ts
Normal file
51
src/api/account/shopBranch.ts
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
import request from "@/utils/request";
|
||||||
|
import { Account_BaseUrl } from "@/api/config";
|
||||||
|
const baseURL = Account_BaseUrl + "/admin/shop/branch";
|
||||||
|
|
||||||
|
const ShopBranchApi = {
|
||||||
|
getList(params: any) {
|
||||||
|
return request<any>({
|
||||||
|
url: `${baseURL}/page`,
|
||||||
|
method: "get",
|
||||||
|
params
|
||||||
|
});
|
||||||
|
},
|
||||||
|
setDataSync(id: any) {
|
||||||
|
console.log(id)
|
||||||
|
return request<any>({
|
||||||
|
url: `${baseURL}/setting/dataSyncMethod?dataSyncMethod=${id}`,
|
||||||
|
method: "post",
|
||||||
|
});
|
||||||
|
},
|
||||||
|
dataSync(id: any) {
|
||||||
|
console.log(id)
|
||||||
|
return request<any>({
|
||||||
|
url: `${baseURL}/data/sync/enable?branchShopId=${id}`,
|
||||||
|
method: "post",
|
||||||
|
});
|
||||||
|
},
|
||||||
|
enable(id: any) {
|
||||||
|
console.log(id)
|
||||||
|
|
||||||
|
return request<any>({
|
||||||
|
url: `${baseURL}/account/enable?branchShopId=${id}`,
|
||||||
|
method: "post",
|
||||||
|
});
|
||||||
|
},
|
||||||
|
disable(id: any) {
|
||||||
|
return request<any>({
|
||||||
|
url: `${baseURL}/account/disable?branchShopId=${id}`,
|
||||||
|
method: "post",
|
||||||
|
});
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
export interface Responseres {
|
||||||
|
code?: number | null;
|
||||||
|
data?: any;
|
||||||
|
msg?: null | string;
|
||||||
|
[property: string]: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default ShopBranchApi;
|
||||||
60
src/api/supplier/index.ts
Normal file
60
src/api/supplier/index.ts
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
import request from "@/utils/request";
|
||||||
|
const baseURL = "/product/admin/product/vendor";
|
||||||
|
|
||||||
|
// 供应商账单
|
||||||
|
|
||||||
|
const AuthAPI = {
|
||||||
|
/** 供应商账单统计*/
|
||||||
|
getSummary(params: any) {
|
||||||
|
return request<any, Responseres>({
|
||||||
|
url: `${baseURL}/summary`,
|
||||||
|
method: "get",
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 分页*/
|
||||||
|
getPage(params: any) {
|
||||||
|
return request<any, Responseres>({
|
||||||
|
url: `${baseURL}/bill`,
|
||||||
|
method: "get",
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 账单记录
|
||||||
|
getRecordList(params: any) {
|
||||||
|
return request<any, Responseres>({
|
||||||
|
url: `${baseURL}/bill/record`,
|
||||||
|
method: "get",
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 账单付款记录
|
||||||
|
getPayRecordList(params: any) {
|
||||||
|
return request<any, Responseres>({
|
||||||
|
url: `${baseURL}/bill/pay/record`,
|
||||||
|
method: "get",
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 账单付款
|
||||||
|
billPay(data: any) {
|
||||||
|
return request<any, Responseres>({
|
||||||
|
url: `${baseURL}/bill/pay`,
|
||||||
|
method: "post",
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
export interface Responseres {
|
||||||
|
code?: number | null;
|
||||||
|
data?: any;
|
||||||
|
msg?: null | string;
|
||||||
|
[property: string]: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default AuthAPI;
|
||||||
@@ -1,34 +1,67 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="logo">
|
<div class="logo wh-full flex-center">
|
||||||
<transition name="el-fade-in-linear" mode="out-in">
|
<!-- <transition name="el-fade-in-linear" mode="out-in"> -->
|
||||||
<router-link :key="+collapse" class="wh-full flex-center" to="/">
|
<!-- <router-link :key="+collapse" class="wh-full flex-center" to="/"> -->
|
||||||
<img :src="userStore.userInfo.logo" class="w20px h20px" />
|
<img :src="state.userInfo.logo" class="w20px h20px" />
|
||||||
<!-- <span v-if="!collapse" class="title">{{ userStore.userInfo.shopName }}</span> -->
|
<!-- <span v-if="!collapse" class="title">{{ userStore.userInfo.shopName }}</span> -->
|
||||||
<el-dropdown trigger="click">
|
<el-dropdown trigger="click" @command="handleCommand">
|
||||||
<span class="el-dropdown-link">
|
<span class="el-dropdown-link">
|
||||||
<span v-if="!collapse" class="title">{{ userStore.userInfo.shopName }}</span>
|
<span v-if="!collapse" class="title">{{ state.shopName }}</span>
|
||||||
<el-icon class="el-icon--right">
|
<el-icon class="el-icon--right">
|
||||||
<arrow-down />
|
<arrow-down />
|
||||||
</el-icon>
|
</el-icon>
|
||||||
</span>
|
</span>
|
||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
<el-dropdown-menu>
|
<el-dropdown-menu>
|
||||||
<el-dropdown-item>门店 1</el-dropdown-item>
|
<el-dropdown-item
|
||||||
<el-dropdown-item>门店 2</el-dropdown-item>
|
:command="item.shopId"
|
||||||
<el-dropdown-item>门店 3</el-dropdown-item>
|
v-for="(item,index) in state.branchList" :key="index"
|
||||||
</el-dropdown-menu>
|
> {{ item.shopName }}</el-dropdown-item>
|
||||||
</template>
|
</el-dropdown-menu>
|
||||||
</el-dropdown>
|
</template>
|
||||||
</router-link>
|
</el-dropdown>
|
||||||
</transition>
|
<!-- </router-link> -->
|
||||||
|
<!-- </transition> -->
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script setup>
|
||||||
import defaultSettings from "@/settings";
|
import defaultSettings from "@/settings";
|
||||||
import { useUserStore } from "@/store";
|
import { useUserStore } from "@/store";
|
||||||
|
import ShopApi from "@/api/account/shop";
|
||||||
|
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
|
const state = reactive({
|
||||||
|
branchList: [],
|
||||||
|
userInfo: useUserStore().userInfo,
|
||||||
|
shopName: useUserStore().userInfo.shopName
|
||||||
|
});
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
geiShopList()
|
||||||
|
});
|
||||||
|
async function geiShopList() {
|
||||||
|
let res = await ShopApi.getBranchList()
|
||||||
|
state.branchList = res;
|
||||||
|
if ( !localStorage.getItem("shopName") ) {
|
||||||
|
state.shopName = state.branchList[0].shopName
|
||||||
|
// localStorage.setItem("shopId", state.branchList[0].shopId )
|
||||||
|
localStorage.setItem("shopName", state.branchList[0].shopName )
|
||||||
|
} else {
|
||||||
|
state.shopName = localStorage.getItem("shopName")
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
function handleCommand(command) {
|
||||||
|
console.log(command)
|
||||||
|
let res = state.branchList.filter(v=> v.shopId == command)[0]
|
||||||
|
// localStorage.setItem("shopId", res.shopId )
|
||||||
|
localStorage.setItem("shopName", res.shopName )
|
||||||
|
state.shopName = res.shopName
|
||||||
|
|
||||||
|
console.log(res)
|
||||||
|
console.log(command)
|
||||||
|
}
|
||||||
|
|
||||||
defineProps({
|
defineProps({
|
||||||
collapse: {
|
collapse: {
|
||||||
@@ -43,6 +76,7 @@ defineProps({
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: $navbar-height;
|
height: $navbar-height;
|
||||||
background-color: $sidebar-logo-background;
|
background-color: $sidebar-logo-background;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
|
|||||||
@@ -22,7 +22,8 @@ service.interceptors.request.use(
|
|||||||
} else {
|
} else {
|
||||||
delete config.headers.token;
|
delete config.headers.token;
|
||||||
}
|
}
|
||||||
config.headers.shopId = config.headers.shopId || useUserStoreHook().userInfo.id;
|
config.headers.shopId = config.headers.shopId || localStorage.getItem("shopId");
|
||||||
|
// config.headers.shopId = config.headers.shopId || useUserStoreHook().userInfo.id;
|
||||||
return config;
|
return config;
|
||||||
},
|
},
|
||||||
(error) => Promise.reject(error)
|
(error) => Promise.reject(error)
|
||||||
|
|||||||
@@ -53,7 +53,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="u-flex" style="flex-wrap: wrap">
|
<div class="u-flex" style="flex-wrap: wrap">
|
||||||
<el-select v-model="storeId" placeholder="选择分店" style="width: 200px; margin-right: 10px;">
|
<el-select v-model="storeId" placeholder="选择分店" style="width: 200px; margin-right: 10px;">
|
||||||
<el-option v-for="item in storeList" :key="item.value" :label="item.label" :value="item.value" />
|
<el-option v-for="item in branchList" :key="item.shopId" :label="item.shopName" :value="item.shopId" />
|
||||||
</el-select>
|
</el-select>
|
||||||
<div class="time_wrap u-flex" style="flex-shrink: 0">
|
<div class="time_wrap u-flex" style="flex-shrink: 0">
|
||||||
<el-radio-group v-model="timeValue" class="m-r-5" @change="timeChange">
|
<el-radio-group v-model="timeValue" class="m-r-5" @change="timeChange">
|
||||||
@@ -338,6 +338,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import dataSummaryApi from "@/api/order/data-summary";
|
import dataSummaryApi from "@/api/order/data-summary";
|
||||||
|
import ShopApi from "@/api/account/shop";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import * as echarts from "echarts";
|
import * as echarts from "echarts";
|
||||||
import { debounce, formatDecimal } from "@/utils/tools";
|
import { debounce, formatDecimal } from "@/utils/tools";
|
||||||
@@ -389,7 +390,7 @@ export default {
|
|||||||
saveAmount: null,
|
saveAmount: null,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
storeList: [{ label: "门店1", value: 1 }],
|
branchList: [],
|
||||||
storeId: null,
|
storeId: null,
|
||||||
trade: {},
|
trade: {},
|
||||||
formatDecimal,
|
formatDecimal,
|
||||||
@@ -481,9 +482,14 @@ export default {
|
|||||||
// }
|
// }
|
||||||
}, 100);
|
}, 100);
|
||||||
window.addEventListener("resize", this.__resizeHandler);
|
window.addEventListener("resize", this.__resizeHandler);
|
||||||
|
this.geiShopList()
|
||||||
// this.initCardUserChart();
|
// this.initCardUserChart();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
async geiShopList() {
|
||||||
|
let res = await ShopApi.getBranchList()
|
||||||
|
this.branchList = res;
|
||||||
|
},
|
||||||
// 切换时间
|
// 切换时间
|
||||||
timeChange(e) {
|
timeChange(e) {
|
||||||
const format = ["YYYY-MM-DD 00:00:00", "YYYY-MM-DD 23:59:59"];
|
const format = ["YYYY-MM-DD 00:00:00", "YYYY-MM-DD 23:59:59"];
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-select v-model="storeId" placeholder="选择分店" style="width: 200px; margin-right: 10px">
|
<el-select v-model="storeId" placeholder="选择分店" style="width: 200px; margin-right: 10px">
|
||||||
<el-option v-for="item in storeList" :key="item.value" :label="item.label" :value="item.value" />
|
<el-option v-for="item in branchList" :key="item.shopId" :label="item.shopName" :value="item.shopId" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
@@ -182,7 +182,7 @@ export default {
|
|||||||
downloadLoading: false,
|
downloadLoading: false,
|
||||||
payCount: "",
|
payCount: "",
|
||||||
payCountTotal: 0,
|
payCountTotal: 0,
|
||||||
storeList: [{ label: "门店1", value: 1 }],
|
branchList: [],
|
||||||
storeId: null,
|
storeId: null,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -195,8 +195,16 @@ export default {
|
|||||||
this.resetQuery = { ...this.query };
|
this.resetQuery = { ...this.query };
|
||||||
this.getTableData();
|
this.getTableData();
|
||||||
this.getCategory();
|
this.getCategory();
|
||||||
|
this.geiShopList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
/**
|
||||||
|
* 获取分店列表
|
||||||
|
*/
|
||||||
|
async geiShopList() {
|
||||||
|
let res = await ShopApi.getBranchList()
|
||||||
|
this.branchList = res;
|
||||||
|
},
|
||||||
totalfilter(item, d) {
|
totalfilter(item, d) {
|
||||||
let num = item + d;
|
let num = item + d;
|
||||||
return num.toFixed(2);
|
return num.toFixed(2);
|
||||||
|
|||||||
@@ -12,28 +12,30 @@
|
|||||||
|
|
||||||
<el-col :span="16">
|
<el-col :span="16">
|
||||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||||
<el-button type="primary" @click="getTableData" plain>批量付款</el-button>
|
<el-button type="primary" @click="handlePayment('all')" plain>批量付款</el-button>
|
||||||
<el-text tag="b" size="large" style="margin-left: 15px;">供应商:供应商名称</el-text>
|
<el-text tag="b" size="large" style="margin-left: 15px;">供应商:{{ state.supplierName }}</el-text>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
<div class="head-container">
|
<div class="head-container">
|
||||||
<el-card shadow="never">
|
<el-card shadow="never">
|
||||||
<el-table v-loading="state.tableData.loading" :data="state.tableData.list">
|
<el-table @selection-change="handleSelectionChange" v-loading="state.tableData.loading"
|
||||||
|
:data="state.tableData.list">
|
||||||
|
<el-table-column type="selection" width="55" />
|
||||||
<el-table-column prop="id" label="ID" width="80" />
|
<el-table-column prop="id" label="ID" width="80" />
|
||||||
<el-table-column label="耗材信息">
|
<el-table-column label="耗材信息">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<div>{{ scope.row.shopName }}({{ scope.row.shopName }})</div>
|
<div>{{ scope.row.conName }}</div>
|
||||||
<div>账号:{{ scope.row.shopName }}</div>
|
<div>单价:{{ scope.row.purchasePrice }}</div>
|
||||||
<div>联系电话:{{ scope.row.phone }}</div>
|
<div>入库数量:{{ scope.row.inOutNumber }}</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="status" label="账单金额" width="120" />
|
<el-table-column prop="amountPayable" label="账单金额" width="120" />
|
||||||
<el-table-column prop="status" label="已付款金额" width="120" />
|
<el-table-column prop="actualPaymentAmount" label="已付款金额" width="120" />
|
||||||
<el-table-column prop="status" label="未付款金额" width="120" />
|
<el-table-column prop="unPaidAmount" label="未付款金额" width="120" />
|
||||||
<el-table-column prop="status" label="创建时间" width="120" />
|
<el-table-column prop="createTime" label="创建时间" width="120" />
|
||||||
<el-table-column prop="createdAt" label="备注" />
|
<el-table-column prop="remark" label="备注" />
|
||||||
<el-table-column label="操作" width="200">
|
<el-table-column label="操作" width="200">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-button type="primary" size="small" link @click="handlePayment(scope.row)">
|
<el-button type="primary" size="small" link @click="handlePayment(scope.row)">
|
||||||
@@ -58,9 +60,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import ShopApi from "@/api/account/shop";
|
import AuthAPI from "@/api/supplier/index";
|
||||||
import { ElMessageBox } from "element-plus";
|
|
||||||
import payment from "./components/payment.vue";
|
import payment from "./components/payment.vue";
|
||||||
|
import { ElMessage } from "element-plus";
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -68,6 +70,7 @@ const router = useRouter();
|
|||||||
const state = reactive({
|
const state = reactive({
|
||||||
query: {
|
query: {
|
||||||
name: "",
|
name: "",
|
||||||
|
vendorId: null,
|
||||||
},
|
},
|
||||||
tableData: {
|
tableData: {
|
||||||
list: [],
|
list: [],
|
||||||
@@ -76,23 +79,28 @@ const state = reactive({
|
|||||||
loading: false,
|
loading: false,
|
||||||
total: 0,
|
total: 0,
|
||||||
},
|
},
|
||||||
|
supplierName: '',
|
||||||
|
flowIdList: [],
|
||||||
|
allAmount: 0
|
||||||
});
|
});
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
console.log(route.query);
|
if (route.query.vendorId) {
|
||||||
if (route.query.id) {
|
state.query.vendorId = route.query.vendorId
|
||||||
|
}
|
||||||
|
if (route.query.supplierName) {
|
||||||
|
state.supplierName = route.query.supplierName
|
||||||
}
|
}
|
||||||
getTableData();
|
getTableData();
|
||||||
});
|
});
|
||||||
// 获取商家列表
|
// 获取账单记录列表
|
||||||
async function getTableData() {
|
async function getTableData() {
|
||||||
state.tableData.loading = true;
|
state.tableData.loading = true;
|
||||||
try {
|
try {
|
||||||
const res = await ShopApi.getList({
|
const res = await AuthAPI.getRecordList({
|
||||||
page: state.tableData.page,
|
page: state.tableData.page,
|
||||||
size: state.tableData.size,
|
size: state.tableData.size,
|
||||||
shopName: state.query.name,
|
key: state.query.name,
|
||||||
account: state.query.account,
|
vendorId: state.query.vendorId,
|
||||||
status: state.query.status,
|
|
||||||
});
|
});
|
||||||
state.tableData.loading = false;
|
state.tableData.loading = false;
|
||||||
state.tableData.list = res.records;
|
state.tableData.list = res.records;
|
||||||
@@ -103,11 +111,28 @@ async function getTableData() {
|
|||||||
}
|
}
|
||||||
const refPayment = ref();
|
const refPayment = ref();
|
||||||
function handlePayment(item) {
|
function handlePayment(item) {
|
||||||
refPayment.value.open(item);
|
if (item != 'all') {
|
||||||
|
state.flowIdList = [item.id]
|
||||||
|
} else {
|
||||||
|
if( state.flowIdList.length <= 0 ){
|
||||||
|
ElMessage({ type: "error", message: "请选择付款耗材" });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
refPayment.value.open({ flowIdList: state.flowIdList, supplierName: state.supplierName,allAmount:state.allAmount });
|
||||||
|
}
|
||||||
|
function handleSelectionChange(e) {
|
||||||
|
state.flowIdList = []
|
||||||
|
state.allAmount = 0
|
||||||
|
e.map(item => {
|
||||||
|
state.flowIdList.push(item.id)
|
||||||
|
state.allAmount += item.unPaidAmount
|
||||||
|
})
|
||||||
}
|
}
|
||||||
// 付款记录
|
// 付款记录
|
||||||
function handleRecord(id) {
|
function handleRecord(id) {
|
||||||
router.push({ name: "financePaymentRecord", query: { id: id } });
|
router.push({ name: "financePaymentRecord", query: { id: id, supplierName: state.supplierName } });
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,17 +2,18 @@
|
|||||||
<!-- 修改和增加 -->
|
<!-- 修改和增加 -->
|
||||||
<el-dialog title="付款" v-model="show" width="400px" @close="reset">
|
<el-dialog title="付款" v-model="show" width="400px" @close="reset">
|
||||||
<el-form :inline="false" ref="refform" label-width="90" :model="form" :rules="rules" class="demo-form-inline">
|
<el-form :inline="false" ref="refform" label-width="90" :model="form" :rules="rules" class="demo-form-inline">
|
||||||
<el-form-item label="供应商" prop="conName">
|
<el-form-item label="供应商">
|
||||||
<el-input v-model="form.conName" placeholder="请输入供应商名称"></el-input>
|
<el-input v-model="supplierName" placeholder="请输入供应商名称" readonly></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="付款金额 " prop="price">
|
<el-form-item label="付款金额 " prop="amount">
|
||||||
<el-input-number v-model="form.price" placeholder="请输入付款金额" style="width: 100%;"></el-input-number>
|
<el-input-number v-model="form.amount" :readonly="form.flowIdList.length > 1" placeholder="请输入付款金额"
|
||||||
|
style="width: 100%;"></el-input-number>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="付款方式" prop="conName">
|
<el-form-item label="付款方式" prop="type">
|
||||||
<el-input v-model="form.conName" placeholder="请输入付款方式"></el-input>
|
<el-input v-model="form.type" placeholder="请输入付款方式"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="备注" prop="defaultUnit">
|
<el-form-item label="备注" prop="remark">
|
||||||
<el-input v-model="form.defaultUnit" placeholder="请输入备注"></el-input>
|
<el-input v-model="form.remark" placeholder="请输入备注"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item style="display: flex; justify-content: flex-end">
|
<el-form-item style="display: flex; justify-content: flex-end">
|
||||||
<el-button @click="close">取 消</el-button>
|
<el-button @click="close">取 消</el-button>
|
||||||
@@ -24,33 +25,35 @@
|
|||||||
|
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import consApi from "@/api/product/cons";
|
import AuthAPI from "@/api/supplier/index";
|
||||||
import { ElMessage } from "element-plus";
|
import { ElMessage } from "element-plus";
|
||||||
|
|
||||||
const emits = defineEmits(["refresh"]);
|
const emits = defineEmits(["refresh"]);
|
||||||
|
|
||||||
const rules = {
|
const rules = {
|
||||||
conName: [{ required: true, message: "请输入耗材名称", trigger: "blur" }],
|
amount: [{ required: true, message: "请输入付款金额", trigger: "blur" }],
|
||||||
price: [{ required: true, message: "请输入耗材价格", trigger: "blur" }],
|
type: [{ required: true, message: "请输入付款方式", trigger: "blur" }],
|
||||||
conWarning: [{ required: true, message: "请输入付款金额", trigger: "blur" }],
|
|
||||||
conUnit: [{ required: true, message: "请输入付款方式", trigger: "blur" }],
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const basicForm = {
|
const basicForm = {
|
||||||
conName: "",
|
flowIdList: [],
|
||||||
consGroupId: "",
|
amount: undefined,
|
||||||
conUnit: "",
|
type: '',
|
||||||
price: undefined,
|
remark: '',
|
||||||
conWarning: undefined,
|
|
||||||
};
|
};
|
||||||
const form = reactive({
|
const form = reactive({
|
||||||
...basicForm,
|
...basicForm,
|
||||||
});
|
});
|
||||||
|
const supplierName = ref('');
|
||||||
const show = ref(false);
|
const show = ref(false);
|
||||||
function open(item) {
|
function open(item) {
|
||||||
Object.assign(form, item);
|
form.flowIdList = item.flowIdList
|
||||||
|
supplierName.value = item.supplierName
|
||||||
|
if (item.flowIdList.length > 1 && item.allAmount) {
|
||||||
|
form.amount = item.allAmount
|
||||||
|
}
|
||||||
|
// Object.assign(form, item);
|
||||||
show.value = true;
|
show.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -61,8 +64,8 @@ const refform = ref();
|
|||||||
async function submitForm() {
|
async function submitForm() {
|
||||||
refform.value.validate(async (valid) => {
|
refform.value.validate(async (valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
const res = await consApi.add(form);
|
const res = await AuthAPI.billPay(form);
|
||||||
ElMessage({ type: "success", message: "付款成功" });
|
ElMessage({ type: "success", message: "付款成功" });
|
||||||
emits("refresh");
|
emits("refresh");
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
@@ -72,7 +75,7 @@ async function submitForm() {
|
|||||||
function reset() {
|
function reset() {
|
||||||
console.log("reset");
|
console.log("reset");
|
||||||
Object.assign(form, basicForm);
|
Object.assign(form, basicForm);
|
||||||
console.log(form);
|
close();
|
||||||
}
|
}
|
||||||
defineExpose({
|
defineExpose({
|
||||||
open,
|
open,
|
||||||
|
|||||||
@@ -21,16 +21,16 @@
|
|||||||
<el-row :gutter="24">
|
<el-row :gutter="24">
|
||||||
<el-col :span="8" style="display: flex;flex-direction: column; justify-content: center;align-items: center;">
|
<el-col :span="8" style="display: flex;flex-direction: column; justify-content: center;align-items: center;">
|
||||||
<div>账单总金额(全部/本月)</div>
|
<div>账单总金额(全部/本月)</div>
|
||||||
<div>2000/1000</div>
|
<div>{{ state.summaryData.amountPayable }} / {{ state.summaryData.mouthAmountPayable }}</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="8" style="display: flex;flex-direction: column; justify-content: center;align-items: center;">
|
<el-col :span="8" style="display: flex;flex-direction: column; justify-content: center;align-items: center;">
|
||||||
<div>已付款总金额(全部/本月)</div>
|
<div>已付款总金额(全部/本月)</div>
|
||||||
<div>2000/1000</div>
|
<div>{{ state.summaryData.actualPaymentAmount }} / {{ state.summaryData.mouthActualPaymentAmount }}</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8" style="display: flex;flex-direction: column; justify-content: center;align-items: center;">
|
<el-col :span="8" style="display: flex;flex-direction: column; justify-content: center;align-items: center;">
|
||||||
<div>未付款总金额(全部/本月)</div>
|
<div>未付款总金额(全部/本月)</div>
|
||||||
<div>2000/1000</div>
|
<div>{{ state.summaryData.unPaidAmount }} / {{ state.summaryData.mouthUnPaidAmount }}</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-card>
|
</el-card>
|
||||||
@@ -38,15 +38,14 @@
|
|||||||
<div class="head-container">
|
<div class="head-container">
|
||||||
<el-card shadow="never">
|
<el-card shadow="never">
|
||||||
<el-table v-loading="state.tableData.loading" :data="state.tableData.list">
|
<el-table v-loading="state.tableData.loading" :data="state.tableData.list">
|
||||||
<el-table-column prop="id" label="ID" width="80" />
|
<el-table-column prop="name" label="供应商" width="220" />
|
||||||
<el-table-column prop="status" label="供应商" width="220" />
|
<el-table-column prop="amountPayable" label="账单金额" width="200" />
|
||||||
<el-table-column prop="status" label="账单金额" width="160" />
|
<el-table-column prop="actualPaymentAmount" label="已付款金额" width="200" />
|
||||||
<el-table-column prop="status" label="已付款金额" width="160" />
|
<el-table-column prop="unPaidAmount" label="未付款金额" width="200" />
|
||||||
<el-table-column prop="status" label="未付款金额" width="160" />
|
<el-table-column prop="remark" label="备注" />
|
||||||
<el-table-column prop="createdAt" label="备注" />
|
|
||||||
<el-table-column label="操作" width="120">
|
<el-table-column label="操作" width="120">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-button type="primary" size="small" link @click="handleTo(scope.row.id)">
|
<el-button type="primary" size="small" link @click="handleTo(scope.row)">
|
||||||
账单记录
|
账单记录
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
@@ -64,13 +63,14 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import ShopApi from "@/api/account/shop";
|
import AuthAPI from "@/api/supplier/index";
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
query: {
|
query: {
|
||||||
name: "",
|
name: "",
|
||||||
},
|
},
|
||||||
|
summaryData: {},
|
||||||
tableData: {
|
tableData: {
|
||||||
list: [],
|
list: [],
|
||||||
page: 1,
|
page: 1,
|
||||||
@@ -80,18 +80,27 @@ const state = reactive({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
getSummary();
|
||||||
|
|
||||||
getTableData();
|
getTableData();
|
||||||
});
|
});
|
||||||
// 获取商家列表
|
|
||||||
|
async function getSummary() {
|
||||||
|
try {
|
||||||
|
const res = await AuthAPI.getSummary();
|
||||||
|
state.summaryData = res;
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 获取账单列表
|
||||||
async function getTableData() {
|
async function getTableData() {
|
||||||
state.tableData.loading = true;
|
state.tableData.loading = true;
|
||||||
try {
|
try {
|
||||||
const res = await ShopApi.getList({
|
const res = await AuthAPI.getPage({
|
||||||
page: state.tableData.page,
|
page: state.tableData.page,
|
||||||
size: state.tableData.size,
|
size: state.tableData.size,
|
||||||
shopName: state.query.name,
|
key: state.query.name,
|
||||||
account: state.query.account,
|
|
||||||
status: state.query.status,
|
|
||||||
});
|
});
|
||||||
state.tableData.loading = false;
|
state.tableData.loading = false;
|
||||||
state.tableData.list = res.records;
|
state.tableData.list = res.records;
|
||||||
@@ -100,9 +109,9 @@ async function getTableData() {
|
|||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function handleTo(id) {
|
function handleTo(row) {
|
||||||
// router.push({ path: "/finance/supplierBill/billingRecord", query: { id: e.id } });
|
// router.push({ path: "/finance/supplierBill/billingRecord", query: { id: e.id } });
|
||||||
router.push({ name: "financeBillingRecord", query: { id: id } });
|
router.push({ name: "financeBillingRecord", query: { vendorId: row.vendorId, supplierName: row.name } });
|
||||||
|
|
||||||
}
|
}
|
||||||
// 重置查询
|
// 重置查询
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<el-card shadow="never">
|
<el-card shadow="never">
|
||||||
<el-alert title="当前列表仅作为数据记录,不产生任何实际交易。" type="warning" show-icon :closable="false"
|
<el-alert title="当前列表仅作为数据记录,不产生任何实际交易。" type="warning" show-icon :closable="false"
|
||||||
style="margin-bottom: 15px;" />
|
style="margin-bottom: 15px;" />
|
||||||
<el-text tag="b" size="large" style="margin-left: 15px;">供应商:供应商名称</el-text>
|
<el-text tag="b" size="large" style="margin-left: 15px;">供应商:{{ state.supplierName }}</el-text>
|
||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
<div class="head-container">
|
<div class="head-container">
|
||||||
@@ -13,20 +13,20 @@
|
|||||||
<el-table-column prop="id" label="ID" width="80" />
|
<el-table-column prop="id" label="ID" width="80" />
|
||||||
<el-table-column label="耗材信息">
|
<el-table-column label="耗材信息">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<div>{{ scope.row.shopName }}({{ scope.row.shopName }})</div>
|
<div>{{ scope.row.conName }}</div>
|
||||||
<div>账号:{{ scope.row.shopName }}</div>
|
<div>单价:{{ scope.row.purchasePrice }}</div>
|
||||||
<div>联系电话:{{ scope.row.phone }}</div>
|
<div>入库数量:{{ scope.row.inOutNumber }}</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="status" label="付款金额" width="120" />
|
<el-table-column prop="amount" label="付款金额" width="120" />
|
||||||
<el-table-column prop="status" label="付款方式" width="120" />
|
<el-table-column prop="type" label="付款方式" width="120" />
|
||||||
<el-table-column prop="createdAt" label="备注" />
|
<el-table-column prop="remark" label="备注" />
|
||||||
<el-table-column prop="status" label="创建时间" />
|
<el-table-column prop="createTime" label="创建时间" />
|
||||||
<el-table-column label="操作人" width="200">
|
<el-table-column label="操作人" width="200">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<div>员工名称:{{ scope.row.shopName }}</div>
|
<div>员工名称:{{ scope.row.nickname }}</div>
|
||||||
<div>员工编号:{{ scope.row.shopName }}</div>
|
<div>员工编号:{{ scope.row.code }}</div>
|
||||||
<div>员工账号:{{ scope.row.phone }}</div>
|
<div>员工账号:{{ scope.row.account }}</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -43,12 +43,15 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import ShopApi from "@/api/account/shop";
|
import ShopApi from "@/api/account/shop";
|
||||||
|
import AuthAPI from "@/api/supplier/index";
|
||||||
|
|
||||||
import { ElMessageBox } from "element-plus";
|
import { ElMessageBox } from "element-plus";
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
query: {
|
query: {
|
||||||
name: "",
|
name: "",
|
||||||
|
flowId: null,
|
||||||
},
|
},
|
||||||
tableData: {
|
tableData: {
|
||||||
list: [],
|
list: [],
|
||||||
@@ -57,23 +60,26 @@ const state = reactive({
|
|||||||
loading: false,
|
loading: false,
|
||||||
total: 0,
|
total: 0,
|
||||||
},
|
},
|
||||||
|
supplierName: '',
|
||||||
});
|
});
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
console.log(route.query);
|
console.log(route.query);
|
||||||
if (route.query.id) {
|
if (route.query.id) {
|
||||||
|
state.query.flowId = route.query.id
|
||||||
|
}
|
||||||
|
if (route.query.supplierName) {
|
||||||
|
state.supplierName = route.query.supplierName
|
||||||
}
|
}
|
||||||
getTableData();
|
getTableData();
|
||||||
});
|
});
|
||||||
// 获取商家列表
|
// 获取账单付款列表
|
||||||
async function getTableData() {
|
async function getTableData() {
|
||||||
state.tableData.loading = true;
|
state.tableData.loading = true;
|
||||||
try {
|
try {
|
||||||
const res = await ShopApi.getList({
|
const res = await AuthAPI.getPayRecordList({
|
||||||
page: state.tableData.page,
|
page: state.tableData.page,
|
||||||
size: state.tableData.size,
|
size: state.tableData.size,
|
||||||
shopName: state.query.name,
|
flowId: state.query.flowId,
|
||||||
account: state.query.account,
|
|
||||||
status: state.query.status,
|
|
||||||
});
|
});
|
||||||
state.tableData.loading = false;
|
state.tableData.loading = false;
|
||||||
state.tableData.list = res.records;
|
state.tableData.list = res.records;
|
||||||
|
|||||||
@@ -202,6 +202,8 @@ function handleLogin() {
|
|||||||
userStore.meituan_douyin_info = checkInfo.userInfo;
|
userStore.meituan_douyin_info = checkInfo.userInfo;
|
||||||
setDouyinToken(checkInfo.userInfo.token);
|
setDouyinToken(checkInfo.userInfo.token);
|
||||||
});
|
});
|
||||||
|
localStorage.removeItem("shopName")
|
||||||
|
|
||||||
await userStore.getUserInfo();
|
await userStore.getUserInfo();
|
||||||
|
|
||||||
const { path, queryParams } = parseRedirect();
|
const { path, queryParams } = parseRedirect();
|
||||||
|
|||||||
@@ -7,8 +7,14 @@
|
|||||||
<el-input v-model="state.query.name" clearable placeholder="请输入分店名称" style="width: 100%" class="filter-item"
|
<el-input v-model="state.query.name" clearable placeholder="请输入分店名称" style="width: 100%" class="filter-item"
|
||||||
@keyup.enter="getTableData" />
|
@keyup.enter="getTableData" />
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="4">
|
||||||
|
<el-select v-model="state.par.dataSyncMethod" @change="setDataSync" placeholder="请设置同步方式"
|
||||||
|
style="width: 100%">
|
||||||
|
<el-option v-for="item in state.status" :key="item.type" :label="item.label" :value="item.type" />
|
||||||
|
</el-select>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="6">
|
<el-col :span="12">
|
||||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||||
<el-button @click="resetHandle">重置</el-button>
|
<el-button @click="resetHandle">重置</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -19,41 +25,42 @@
|
|||||||
<el-card shadow="never">
|
<el-card shadow="never">
|
||||||
<el-table v-loading="state.tableData.loading" :data="state.tableData.list">
|
<el-table v-loading="state.tableData.loading" :data="state.tableData.list">
|
||||||
<el-table-column prop="status" label="ID" width="80" />
|
<el-table-column prop="status" label="ID" width="80" />
|
||||||
<el-table-column label="店铺信息" >
|
<el-table-column label="店铺信息">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<div>{{ scope.row.shopName }}({{ scope.row.shopName }})</div>
|
<div>{{ scope.row.shopName }}({{ scope.row.shopName }})</div>
|
||||||
<div>账号:{{ scope.row.shopName }}</div>
|
<div>账号:{{ scope.row.account }}</div>
|
||||||
<div>联系电话:{{ scope.row.phone }}</div>
|
<div>联系电话:{{ scope.row.phone }}</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="status" label="商品同步" width="120">
|
<el-table-column prop="isEnableProdSync" label="商品同步" width="120">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-switch v-model="scope.row.status" :active-value="1" :inactive-value="0" disabled />
|
<el-tag :type="scope.row.isEnableProdSync == 1 ? 'success' : 'error'" effect="dark"> {{ scope.row.isEnableProdSync == 1 ? '启用' : '禁用' }} </el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="status" label="会员同步" width="120">
|
<el-table-column prop="isEnableVipSync" label="会员同步" width="120">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-switch v-model="scope.row.status" :active-value="1" :inactive-value="0" disabled />
|
<el-tag :type="scope.row.isEnableVipSync == 1 ? 'success' : 'error'" effect="dark"> {{ scope.row.isEnableVipSync == 1 ? '启用' : '禁用' }} </el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="status" label="耗材同步" width="120">
|
<el-table-column prop="isEnableConsSync" label="耗材同步" width="120">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-switch v-model="scope.row.status" :active-value="1" :inactive-value="0" disabled />
|
<el-tag :type="scope.row.isEnableConsSync == 1 ? 'success' : 'error'" effect="dark"> {{ scope.row.isEnableConsSync == 1 ? '启用' : '禁用' }} </el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="status" label="账号状态" width="120">
|
<el-table-column prop="isAllowAccountLogin" label="账号状态" width="120">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-switch v-model="scope.row.status" :active-value="1" :inactive-value="0" disabled />
|
<el-tag :type="scope.row.isAllowAccountLogin == 1 ? 'success' : 'error'" effect="dark"> {{ scope.row.isAllowAccountLogin == 1 ? '启用' : '禁用' }} </el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="createdAt" label="备注" />
|
<el-table-column prop="createdAt" label="备注" />
|
||||||
<el-table-column label="操作" width="200">
|
<el-table-column label="操作" width="200">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-button type="primary" size="small" link icon="edit" @click="handleSync(scope.row)">
|
<el-button v-if="!scope.row.isEnableProdSync || !scope.row.isEnableVipSync || !scope.row.isEnableConsSync"
|
||||||
|
type="primary" size="small" link icon="edit" @click="handleSync(scope.row)">
|
||||||
同步启用
|
同步启用
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="primary" size="small" link icon="edit" @click="handleAccount(scope.row.id)">
|
<el-button type="primary" size="small" link icon="edit" @click="handleAccount(scope.row)">
|
||||||
账号启用
|
{{ scope.row.isAllowAccountLogin ? '账号禁用' : '账号启用' }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -71,22 +78,19 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import ShopApi from "@/api/account/shop";
|
import ShopBranchApi from "@/api/account/shopBranch";
|
||||||
import { ElNotification, ElMessageBox } from "element-plus";
|
import { ElNotification, ElMessageBox } from "element-plus";
|
||||||
|
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
query: {
|
query: {
|
||||||
name: "",
|
name: "",
|
||||||
},
|
},
|
||||||
|
par: {
|
||||||
|
dataSyncMethod: '',
|
||||||
|
},
|
||||||
status: [
|
status: [
|
||||||
{
|
{ type: 'auto', label: "实时自动同步", },
|
||||||
type: 1,
|
{ type: 'manual', label: "手动同步", }
|
||||||
label: "开启",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 0,
|
|
||||||
label: "关闭",
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
tableData: {
|
tableData: {
|
||||||
list: [],
|
list: [],
|
||||||
@@ -99,15 +103,14 @@ const state = reactive({
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getTableData();
|
getTableData();
|
||||||
});
|
});
|
||||||
// 获取商家列表
|
// 获取分店列表
|
||||||
async function getTableData() {
|
async function getTableData() {
|
||||||
state.tableData.loading = true;
|
state.tableData.loading = true;
|
||||||
try {
|
try {
|
||||||
const res = await ShopApi.getList({
|
const res = await ShopBranchApi.getList({
|
||||||
page: state.tableData.page,
|
page: state.tableData.page,
|
||||||
size: state.tableData.size,
|
size: state.tableData.size,
|
||||||
shopName: state.query.name,
|
shopName: state.query.name,
|
||||||
account: state.query.account,
|
|
||||||
status: state.query.status,
|
status: state.query.status,
|
||||||
});
|
});
|
||||||
state.tableData.loading = false;
|
state.tableData.loading = false;
|
||||||
@@ -117,6 +120,16 @@ async function getTableData() {
|
|||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 设置数据同步
|
||||||
|
async function setDataSync() {
|
||||||
|
await ShopBranchApi.setDataSync(state.par.dataSyncMethod);
|
||||||
|
ElMessage({
|
||||||
|
type: "success",
|
||||||
|
message: "设置成功",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 开启同步
|
||||||
function handleSync(e) {
|
function handleSync(e) {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
ElMessageBox.confirm(`同步功能开启后不能关闭,请确认是否给${e.shopName}开启同步?`, "提示", {
|
ElMessageBox.confirm(`同步功能开启后不能关闭,请确认是否给${e.shopName}开启同步?`, "提示", {
|
||||||
@@ -124,7 +137,7 @@ function handleSync(e) {
|
|||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
type: "warning",
|
type: "warning",
|
||||||
}).then(async () => {
|
}).then(async () => {
|
||||||
const res = await ShopApi.delete({ id: row.id });
|
await ShopBranchApi.dataSync(e.id)
|
||||||
ElMessage({
|
ElMessage({
|
||||||
type: "success",
|
type: "success",
|
||||||
message: "同步成功",
|
message: "同步成功",
|
||||||
@@ -132,6 +145,17 @@ function handleSync(e) {
|
|||||||
getTableData();
|
getTableData();
|
||||||
}).catch(() => { });
|
}).catch(() => { });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 账号启用/禁用
|
||||||
|
async function handleAccount(row) {
|
||||||
|
if (row.isAllowAccountLogin) {
|
||||||
|
await ShopBranchApi.disable(row.id);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
await ShopBranchApi.enable(row.id);
|
||||||
|
}
|
||||||
|
getTableData();
|
||||||
|
}
|
||||||
// 重置查询
|
// 重置查询
|
||||||
function resetHandle() {
|
function resetHandle() {
|
||||||
state.query.name = "";
|
state.query.name = "";
|
||||||
|
|||||||
@@ -13,13 +13,13 @@
|
|||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
<div class="tips">请谨慎修改!!!</div>
|
<div class="tips">请谨慎修改!!!</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="是否为主店" prop="isMainStore">
|
<el-form-item label="是否为主店" prop="isHeadShop">
|
||||||
<el-radio-group v-model="state.form.isMainStore" @change=" state.form.mainId = ''">
|
<el-radio-group v-model="state.form.isHeadShop" @change=" state.form.mainId = ''">
|
||||||
<el-radio value="1">是</el-radio>
|
<el-radio value="1">是</el-radio>
|
||||||
<el-radio value="0">否</el-radio>
|
<el-radio value="0">否</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="主店账号" prop="mainId" v-if="state.form.isMainStore == '0'">
|
<el-form-item label="主店账号" prop="mainId" v-if="state.form.isHeadShop == '0'">
|
||||||
<!-- <el-form-item label="主店账号" prop="mainId" v-if="state.form.shopType != 'only'"> -->
|
<!-- <el-form-item label="主店账号" prop="mainId" v-if="state.form.shopType != 'only'"> -->
|
||||||
<el-select v-model="state.form.mainId" placeholder="请选择主店铺" filterable reserve-keyword
|
<el-select v-model="state.form.mainId" placeholder="请选择主店铺" filterable reserve-keyword
|
||||||
:remote-method="getTableData" :loading="state.shopListLoading">
|
:remote-method="getTableData" :loading="state.shopListLoading">
|
||||||
@@ -208,7 +208,7 @@ const state = reactive({
|
|||||||
cities: "",
|
cities: "",
|
||||||
districts: "",
|
districts: "",
|
||||||
chainName: "",
|
chainName: "",
|
||||||
isMainStore: '0',
|
isHeadShop: '0',
|
||||||
},
|
},
|
||||||
resetForm: "",
|
resetForm: "",
|
||||||
rules: {
|
rules: {
|
||||||
@@ -226,7 +226,7 @@ const state = reactive({
|
|||||||
trigger: "blur",
|
trigger: "blur",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
isMainStore: [
|
isHeadShop: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: " ",
|
message: " ",
|
||||||
@@ -354,6 +354,7 @@ function submitHandle() {
|
|||||||
type: "success",
|
type: "success",
|
||||||
});
|
});
|
||||||
close();
|
close();
|
||||||
|
location.reload()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
state.formLoading = false;
|
state.formLoading = false;
|
||||||
console.log(error);
|
console.log(error);
|
||||||
@@ -528,4 +529,4 @@ defineExpose({
|
|||||||
.amap-sug-result {
|
.amap-sug-result {
|
||||||
z-index: 2000;
|
z-index: 2000;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -68,7 +68,7 @@
|
|||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<div>
|
<div>
|
||||||
<span>{{ scope.row.shopName }}</span>
|
<span>{{ scope.row.shopName }}</span>
|
||||||
<div>(主店:)</div>
|
<div>(主店:{{ scope.row.headShopName }})</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import type { ISearchConfig } from "@/components/CURD/types";
|
import type { ISearchConfig } from "@/components/CURD/types";
|
||||||
import { paramTypeOptions } from './config'
|
import { paramTypeOptions } from './config'
|
||||||
import UserAPI from "@/api/product/productclassification";
|
import UserAPI from "@/api/product/productclassification";
|
||||||
|
import ShopApi from "@/api/account/shop";
|
||||||
|
|
||||||
|
|
||||||
const searchConfig: ISearchConfig = {
|
const searchConfig: ISearchConfig = {
|
||||||
@@ -19,7 +20,17 @@ const searchConfig: ISearchConfig = {
|
|||||||
},
|
},
|
||||||
options: [],
|
options: [],
|
||||||
async initFn(formItem) {
|
async initFn(formItem) {
|
||||||
formItem.options = await UserAPI.getList();
|
// formItem.options = await UserAPI.getList();
|
||||||
|
let res = await ShopApi.getBranchList();
|
||||||
|
let options = [];
|
||||||
|
res.map(v=>{
|
||||||
|
options.push({
|
||||||
|
label: v.shopName,
|
||||||
|
value: v.shopId,
|
||||||
|
})
|
||||||
|
})
|
||||||
|
formItem.options = options
|
||||||
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user