feat: 🚀 仓库关系
This commit is contained in:
27
src/api/modules/setWarehouse.ts
Normal file
27
src/api/modules/setWarehouse.ts
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
import http from "@/api";
|
||||||
|
|
||||||
|
//
|
||||||
|
export const getSetWarehouseListApi = (params: any) => {
|
||||||
|
return http.get<any>(`store`, params);
|
||||||
|
};
|
||||||
|
// getWarehouseUpApi,getWarehouseDetailsApi,getWarehouseUpApi
|
||||||
|
//删除
|
||||||
|
export const getWarehouseDelApi = (params: any) => {
|
||||||
|
return http.delete<any>(`warehouse/relationship/${params}`);
|
||||||
|
};
|
||||||
|
//新增 /admapi/warehouse/relationship
|
||||||
|
export const getWarehouseAddApi = (params: any) => {
|
||||||
|
return http.post<any>(`warehouse/relationship`, params);
|
||||||
|
};
|
||||||
|
//更新
|
||||||
|
export const getWarehouseUpApi = (id: any, params: any) => {
|
||||||
|
return http.post<any>(`warehouse/relationship/${id}`, params);
|
||||||
|
};
|
||||||
|
//详情
|
||||||
|
// export const getWarehouseDetailsApi = (id: any) => {
|
||||||
|
// return http.get<any>(`store/${id}`);
|
||||||
|
// };
|
||||||
|
// //导出
|
||||||
|
// export const getShopListExportApi = (params: any) => {
|
||||||
|
// return http.get<any>(`store/export`, params);
|
||||||
|
// };
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
import http from "@/api";
|
import http from "@/api";
|
||||||
|
|
||||||
//店鋪資料列表
|
//店鋪資料列表
|
||||||
export const getShopListApi = () => {
|
export const getShopListApi = (params: any) => {
|
||||||
return http.get<any>(`store`);
|
return http.get<any>(`store`, params);
|
||||||
};
|
};
|
||||||
//獲取接入系統列表數據
|
//獲取接入系統列表數據
|
||||||
export const getShopAccessSystemApi = () => {
|
export const getShopAccessSystemApi = () => {
|
||||||
@@ -22,7 +22,7 @@ export const getShopUpApi = (id: any, params: any) => {
|
|||||||
};
|
};
|
||||||
//详情
|
//详情
|
||||||
export const getShopDetailsApi = (id: any) => {
|
export const getShopDetailsApi = (id: any) => {
|
||||||
return http.post<any>(`store/${id}`);
|
return http.get<any>(`store/${id}`);
|
||||||
};
|
};
|
||||||
//导出
|
//导出
|
||||||
export const getShopListExportApi = (params: any) => {
|
export const getShopListExportApi = (params: any) => {
|
||||||
|
|||||||
@@ -76,7 +76,22 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
|
<template v-if="item.type === 'selectMultiples'">
|
||||||
|
<el-select
|
||||||
|
v-model="_searchResult[`${item.prop}`]"
|
||||||
|
:placeholder="item.placeholder"
|
||||||
|
clearable
|
||||||
|
multiple
|
||||||
|
:disabled="item.disabled"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="option in item.options"
|
||||||
|
:label="option.label"
|
||||||
|
:value="option.value"
|
||||||
|
:key="option.label"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</template>
|
||||||
<template v-if="item.type === 'date'">
|
<template v-if="item.type === 'date'">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
:disabled="item.disabled"
|
:disabled="item.disabled"
|
||||||
|
|||||||
@@ -65,12 +65,6 @@ export const useTable = (
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// //其他數據處理
|
|
||||||
// const initData = () => {
|
|
||||||
// if (state.totalParam?.warehouse_number) {
|
|
||||||
// state.totalParam.warehouse_number = state.totalParam?.warehouse_number.split("_")[0];
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
//删除临时参数和空值参数
|
//删除临时参数和空值参数
|
||||||
const deleteParams = () => {
|
const deleteParams = () => {
|
||||||
const KEY = ["Time", "customer_number1", "customer_numbers"];
|
const KEY = ["Time", "customer_number1", "customer_numbers"];
|
||||||
@@ -86,7 +80,6 @@ export const useTable = (
|
|||||||
*/
|
*/
|
||||||
const getTableList = async () => {
|
const getTableList = async () => {
|
||||||
if (!api) return;
|
if (!api) return;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await initSubscribeData();
|
await initSubscribeData();
|
||||||
await deleteParams();
|
await deleteParams();
|
||||||
@@ -95,9 +88,7 @@ export const useTable = (
|
|||||||
...state.totalParam,
|
...state.totalParam,
|
||||||
...pageParam.value
|
...pageParam.value
|
||||||
};
|
};
|
||||||
|
|
||||||
const { data } = await api(params);
|
const { data } = await api(params);
|
||||||
|
|
||||||
state.tableData = Array.isArray(data.data) && data.data.length ? data.data : [];
|
state.tableData = Array.isArray(data.data) && data.data.length ? data.data : [];
|
||||||
clearSelection && clearSelection();
|
clearSelection && clearSelection();
|
||||||
if (isPageable && data.total_size !== undefined) {
|
if (isPageable && data.total_size !== undefined) {
|
||||||
|
|||||||
@@ -269,5 +269,5 @@
|
|||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
.el-message {
|
.el-message {
|
||||||
z-index: 555;
|
z-index: 888;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,26 +12,22 @@ export const COLUMNS = [
|
|||||||
align: "left",
|
align: "left",
|
||||||
label: "平台",
|
label: "平台",
|
||||||
prop: "platform_name",
|
prop: "platform_name",
|
||||||
fixed: true,
|
fixed: true
|
||||||
width: 200
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "订单接入系统",
|
label: "订单接入系统",
|
||||||
prop: "access_system",
|
prop: "access_system_name"
|
||||||
width: 200
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "聚水潭店铺名称",
|
label: "聚水潭店铺名称",
|
||||||
prop: "jushuitan_store_name",
|
prop: "jushuitan_store_name"
|
||||||
width: 200
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "领星店铺名称",
|
label: "领星店铺名称",
|
||||||
prop: "lingxing_store_name",
|
prop: "lingxing_store_name"
|
||||||
width: 200
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: "left",
|
align: "left",
|
||||||
|
|||||||
@@ -82,10 +82,10 @@ const dataStore = reactive<any>({
|
|||||||
detailsFormData: cloneDeep(DETAILS_FORM_DATA),
|
detailsFormData: cloneDeep(DETAILS_FORM_DATA),
|
||||||
detailsRuleForm: cloneDeep(DETAILS_RULE_FORM),
|
detailsRuleForm: cloneDeep(DETAILS_RULE_FORM),
|
||||||
dialogVisible: false, // 弹窗
|
dialogVisible: false, // 弹窗
|
||||||
accessSystemOptions: [], //
|
accessSystemOptions: [], // 接入系統列表
|
||||||
selectionList: [] //选中表格的行
|
selectionList: [] // 列表选中数据
|
||||||
});
|
});
|
||||||
console.log(dataStore.detailsFormData, "=detailsFormData=");
|
|
||||||
// 表格选择事件
|
// 表格选择事件
|
||||||
const selectionChange = (selection: any) => {
|
const selectionChange = (selection: any) => {
|
||||||
dataStore.selectionList = selection;
|
dataStore.selectionList = selection;
|
||||||
@@ -108,8 +108,9 @@ const handleDel = () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const result = await getShopDelApi(ids.join(","));
|
const result = await getShopDelApi(ids.join(","));
|
||||||
|
|
||||||
if (result?.code === 0) {
|
if (result?.code === 0) {
|
||||||
proTable?.value!.getTableList();
|
proTableRef?.value!.getTableList();
|
||||||
useMsg("success", "删除成功 !");
|
useMsg("success", "删除成功 !");
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -123,6 +124,7 @@ const getShopAdd = async () => {
|
|||||||
useMsg("success", "新增成功 !");
|
useMsg("success", "新增成功 !");
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
dataStore.dialogVisible = false;
|
dataStore.dialogVisible = false;
|
||||||
|
proTableRef?.value!.getTableList();
|
||||||
}, 600);
|
}, 600);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -133,6 +135,7 @@ const getShopUp = async () => {
|
|||||||
useMsg("success", "更新成功 !");
|
useMsg("success", "更新成功 !");
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
dataStore.dialogVisible = false;
|
dataStore.dialogVisible = false;
|
||||||
|
proTableRef?.value!.getTableList();
|
||||||
}, 600);
|
}, 600);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -194,8 +197,9 @@ const handleClose = () => {
|
|||||||
detailsRef?.value?.formElement?.resetFields();
|
detailsRef?.value?.formElement?.resetFields();
|
||||||
dataStore.dialogVisible = false;
|
dataStore.dialogVisible = false;
|
||||||
};
|
};
|
||||||
//提交前的验证条件
|
|
||||||
const handleAddYz = () => {
|
// 弹窗确认
|
||||||
|
const handleCommit = () => {
|
||||||
if (!dataStore.detailsRuleForm.platform_name) {
|
if (!dataStore.detailsRuleForm.platform_name) {
|
||||||
useMsg("warning", "平台不能为空 !");
|
useMsg("warning", "平台不能为空 !");
|
||||||
return false;
|
return false;
|
||||||
@@ -228,13 +232,7 @@ const handleAddYz = () => {
|
|||||||
useMsg("warning", "领星店铺SellerID不能为空 !");
|
useMsg("warning", "领星店铺SellerID不能为空 !");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
};
|
|
||||||
//弹窗确认
|
|
||||||
const handleCommit = () => {
|
|
||||||
const is = handleAddYz();
|
|
||||||
if (!is) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (dataStore.title === "新增店铺") {
|
if (dataStore.title === "新增店铺") {
|
||||||
getShopAdd();
|
getShopAdd();
|
||||||
} else {
|
} else {
|
||||||
@@ -243,6 +241,7 @@ const handleCommit = () => {
|
|||||||
};
|
};
|
||||||
// 搜索
|
// 搜索
|
||||||
const handleSearch = async (params: any) => {
|
const handleSearch = async (params: any) => {
|
||||||
|
console.log(params, "==============>");
|
||||||
dataStore.initParam = cloneDeep(params);
|
dataStore.initParam = cloneDeep(params);
|
||||||
//这里需要等到表格刷新以后才去请求
|
//这里需要等到表格刷新以后才去请求
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
@@ -257,6 +256,7 @@ const handleReset = () => {
|
|||||||
proTableRef?.value!.getTableList();
|
proTableRef?.value!.getTableList();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
// 接入系统切换
|
||||||
const setAccessSystem = (val: any) => {
|
const setAccessSystem = (val: any) => {
|
||||||
if (val === 2) {
|
if (val === 2) {
|
||||||
dataStore.detailsFormData = cloneDeep(DETAILS_FORM_DATA1);
|
dataStore.detailsFormData = cloneDeep(DETAILS_FORM_DATA1);
|
||||||
|
|||||||
@@ -1,6 +1,15 @@
|
|||||||
export const DETAILS_FORM_DATA: any[] = [
|
export const DETAILS_FORM_DATA: any[] = [
|
||||||
{
|
{
|
||||||
prop: "org_number",
|
prop: "use_org_number",
|
||||||
|
placeholder: "请输入",
|
||||||
|
type: "select",
|
||||||
|
label: "组织:",
|
||||||
|
disabled: false,
|
||||||
|
required: true,
|
||||||
|
class: "form-item1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "kd_warehouse_number ",
|
||||||
placeholder: "请输入",
|
placeholder: "请输入",
|
||||||
type: "select",
|
type: "select",
|
||||||
label: "金蝶仓库:",
|
label: "金蝶仓库:",
|
||||||
@@ -9,24 +18,26 @@ export const DETAILS_FORM_DATA: any[] = [
|
|||||||
class: "form-item1"
|
class: "form-item1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: "org_number",
|
prop: "kd_subwarehouse ",
|
||||||
placeholder: "请输入",
|
placeholder: "请选择",
|
||||||
type: "select",
|
type: "selectMultiples",
|
||||||
label: "金蝶子仓库:",
|
label: "金蝶子仓库:",
|
||||||
disabled: false,
|
disabled: false,
|
||||||
class: "form-item1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "org_number",
|
|
||||||
placeholder: "请输入",
|
|
||||||
type: "select",
|
|
||||||
label: "对应聚水潭仓库:",
|
|
||||||
disabled: false,
|
|
||||||
required: true,
|
required: true,
|
||||||
class: "form-item1"
|
class: "form-item1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: "org_number",
|
prop: "jst_warehouse_number",
|
||||||
|
placeholder: "请输入",
|
||||||
|
type: "select",
|
||||||
|
label: "对应聚水潭仓库:",
|
||||||
|
disabled: false,
|
||||||
|
required: true,
|
||||||
|
|
||||||
|
class: "form-item1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "lx_warehouse_number",
|
||||||
placeholder: "请输入",
|
placeholder: "请输入",
|
||||||
type: "select",
|
type: "select",
|
||||||
label: "对应领星仓库:",
|
label: "对应领星仓库:",
|
||||||
@@ -35,4 +46,6 @@ export const DETAILS_FORM_DATA: any[] = [
|
|||||||
class: "form-item1"
|
class: "form-item1"
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
export const DETAILS_RULE_FORM: any = {};
|
export const DETAILS_RULE_FORM: any = {
|
||||||
|
use_org_number: "101"
|
||||||
|
};
|
||||||
|
|||||||
@@ -17,19 +17,26 @@ interface FormItem {
|
|||||||
}
|
}
|
||||||
export const FORM_DATA: FormItem[] = [
|
export const FORM_DATA: FormItem[] = [
|
||||||
{
|
{
|
||||||
prop: "org_number",
|
prop: "use_org_number",
|
||||||
|
placeholder: "请选择组织",
|
||||||
|
type: "selectMultiple",
|
||||||
|
label: "组织: ",
|
||||||
|
options: []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "kd_warehouse_number",
|
||||||
placeholder: "请输入金蝶仓库",
|
placeholder: "请输入金蝶仓库",
|
||||||
type: "input",
|
type: "input",
|
||||||
label: "金蝶仓库: "
|
label: "金蝶仓库: "
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: "org_number",
|
prop: "kd_subwarehouse",
|
||||||
placeholder: "请输入金蝶子仓库",
|
placeholder: "请输入金蝶子仓库",
|
||||||
type: "input",
|
type: "input",
|
||||||
label: "金蝶子仓库: "
|
label: "金蝶子仓库: "
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: "org_number",
|
prop: "operator_name",
|
||||||
placeholder: "请输入更新人",
|
placeholder: "请输入更新人",
|
||||||
type: "input",
|
type: "input",
|
||||||
label: "更新人: "
|
label: "更新人: "
|
||||||
@@ -41,7 +48,7 @@ export const FORM_DATA: FormItem[] = [
|
|||||||
options: [],
|
options: [],
|
||||||
startPlaceholder: "更新开始日期",
|
startPlaceholder: "更新开始日期",
|
||||||
endPlaceholder: "更新结束日期",
|
endPlaceholder: "更新结束日期",
|
||||||
startDate: "updated_at",
|
startDate: "update_time",
|
||||||
// endDate: "createEndDate",
|
// endDate: "createEndDate",
|
||||||
label: "更新时间: "
|
label: "更新时间: "
|
||||||
}
|
}
|
||||||
@@ -49,5 +56,6 @@ export const FORM_DATA: FormItem[] = [
|
|||||||
|
|
||||||
export const RULE_FORM = {
|
export const RULE_FORM = {
|
||||||
page: 1,
|
page: 1,
|
||||||
size: 50
|
size: 50,
|
||||||
|
use_org_number: ["101"]
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -8,6 +8,13 @@ export const COLUMNS = [
|
|||||||
prop: "material_number",
|
prop: "material_number",
|
||||||
width: 200
|
width: 200
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
align: "left",
|
||||||
|
fixed: true,
|
||||||
|
label: "组织",
|
||||||
|
prop: "use_org_number",
|
||||||
|
width: 200
|
||||||
|
},
|
||||||
{
|
{
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "金蝶子仓库",
|
label: "金蝶子仓库",
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<!-- 仓库关系 -->
|
<!-- 店铺资料 -->
|
||||||
<template>
|
<template>
|
||||||
<div class="table-box">
|
<div class="table-box">
|
||||||
<div style="padding-bottom: 16px">
|
<div style="padding-bottom: 16px">
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
@handleButtonClickCallback="handleButtonClickCallback"
|
@handleButtonClickCallback="handleButtonClickCallback"
|
||||||
></PermissionButton>
|
></PermissionButton>
|
||||||
</div>
|
</div>
|
||||||
<el-dialog v-model="dataStore.dialogVisible" width="660" :before-close="handleClose" title="新增店铺">
|
<el-dialog v-model="dataStore.dialogVisible" width="660" :before-close="handleClose" :title="dataStore.title">
|
||||||
<DetailsSearch
|
<DetailsSearch
|
||||||
:formData="dataStore.detailsFormData"
|
:formData="dataStore.detailsFormData"
|
||||||
:ruleForm="dataStore.detailsRuleForm"
|
:ruleForm="dataStore.detailsRuleForm"
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
<ProTable
|
<ProTable
|
||||||
ref="proTableRef"
|
ref="proTableRef"
|
||||||
:columns="dataStore.columns"
|
:columns="dataStore.columns"
|
||||||
:request-api="getMaterialListApi"
|
:request-api="getShopListApi"
|
||||||
:init-param="dataStore.initParam"
|
:init-param="dataStore.initParam"
|
||||||
@selectionChange="selectionChange"
|
@selectionChange="selectionChange"
|
||||||
>
|
>
|
||||||
@@ -38,15 +38,22 @@
|
|||||||
:formData="dataStore.formData"
|
:formData="dataStore.formData"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
<template #platform_store_name="scope">
|
||||||
|
<a @click="handleOpen(scope.row)" class="break-word to-details">
|
||||||
|
{{ scope.row.platform_store_name }}
|
||||||
|
</a>
|
||||||
|
</template>
|
||||||
</ProTable>
|
</ProTable>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts" name="foundationSetWarehouse">
|
<script setup lang="ts" name="foundationSetShop">
|
||||||
import ProTable from "@/components/ProTable/index.vue";
|
import ProTable from "@/components/ProTable/index.vue";
|
||||||
import SearchForm from "@/components/SearchForm/index.vue";
|
import SearchForm from "@/components/SearchForm/index.vue";
|
||||||
import PermissionButton from "@/components/PermissionButton/index.vue";
|
import PermissionButton from "@/components/PermissionButton/index.vue";
|
||||||
import { getMaterialListApi } from "@/api/modules/foundationMaterial";
|
import { getShopListApi } from "@/api/modules/shop";
|
||||||
|
import { useUserStore } from "@/stores/modules/user";
|
||||||
|
import { getWarehouseDelApi, getWarehouseAddApi, getWarehouseUpApi } from "@/api/modules/setWarehouse";
|
||||||
import { useMsg } from "@/hooks/useMsg";
|
import { useMsg } from "@/hooks/useMsg";
|
||||||
import { RULE_FORM, FORM_DATA, COLUMNS, BUTTON } from "./constant/list/index";
|
import { RULE_FORM, FORM_DATA, COLUMNS, BUTTON } from "./constant/list/index";
|
||||||
import { DETAILS_RULE_FORM, DETAILS_FORM_DATA } from "./constant/list/details";
|
import { DETAILS_RULE_FORM, DETAILS_FORM_DATA } from "./constant/list/details";
|
||||||
@@ -64,21 +71,28 @@ const dataStore = reactive<any>({
|
|||||||
initParam: cloneDeep(RULE_FORM), // 初始化搜索条件|重置搜索条件
|
initParam: cloneDeep(RULE_FORM), // 初始化搜索条件|重置搜索条件
|
||||||
formData: FORM_DATA, // 搜索配置项
|
formData: FORM_DATA, // 搜索配置项
|
||||||
buttons: cloneDeep(BUTTON),
|
buttons: cloneDeep(BUTTON),
|
||||||
options: [], //规格型号
|
|
||||||
labelWidth: "120px",
|
labelWidth: "120px",
|
||||||
|
title: "新增金蝶子仓与各系统仓库关系",
|
||||||
detailsFormData: cloneDeep(DETAILS_FORM_DATA),
|
detailsFormData: cloneDeep(DETAILS_FORM_DATA),
|
||||||
detailsRuleForm: cloneDeep(DETAILS_RULE_FORM),
|
detailsRuleForm: cloneDeep(DETAILS_RULE_FORM),
|
||||||
dialogVisible: false, // 弹窗
|
dialogVisible: false, // 弹窗
|
||||||
selectionList: [] //选中表格的行
|
selectionList: [] // 列表选中数据
|
||||||
});
|
});
|
||||||
|
const userStore = useUserStore();
|
||||||
|
//初始化组织数据
|
||||||
|
const init = () => {
|
||||||
|
if (userStore.orgIdArr.length) {
|
||||||
|
dataStore.formData[0].options = userStore?.orgIdArr;
|
||||||
|
dataStore.detailsFormData[0].options = userStore?.orgIdArr;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
init();
|
||||||
// 表格选择事件
|
// 表格选择事件
|
||||||
const selectionChange = (selection: any) => {
|
const selectionChange = (selection: any) => {
|
||||||
dataStore.selectionList = selection;
|
dataStore.selectionList = selection;
|
||||||
};
|
};
|
||||||
// 删除
|
// 删除
|
||||||
const handleDel = () => {
|
const handleDel = () => {
|
||||||
console.log();
|
|
||||||
if (!dataStore.selectionList.length) {
|
if (!dataStore.selectionList.length) {
|
||||||
useMsg("warning", "请选择数据 !");
|
useMsg("warning", "请选择数据 !");
|
||||||
return;
|
return;
|
||||||
@@ -90,26 +104,74 @@ const handleDel = () => {
|
|||||||
})
|
})
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
let ids: any = [];
|
let ids: any = [];
|
||||||
dataStore.selectionList.forEach((item: any) => {
|
dataStore.selectionList?.forEach((item: any) => {
|
||||||
ids.push(item.id);
|
ids.push(item.id);
|
||||||
});
|
});
|
||||||
// console.log(ids, "==========");
|
const result = await getWarehouseDelApi(ids.join(","));
|
||||||
// const result = await getSubscribeDelApi(ids.join(","));
|
if (result?.code === 0) {
|
||||||
// if (result?.code === 0) {
|
proTableRef?.value!.getTableList();
|
||||||
// proTable?.value!.getTableList();
|
useMsg("success", "删除成功 !");
|
||||||
// useMsg("success", "删除成功 !");
|
}
|
||||||
// }
|
|
||||||
})
|
})
|
||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
// 新增
|
||||||
|
const getWarehouseAdd = async () => {
|
||||||
|
const result = await getWarehouseAddApi(dataStore.detailsRuleForm);
|
||||||
|
if (result?.code === 0) {
|
||||||
|
useMsg("success", "新增成功 !");
|
||||||
|
setTimeout(() => {
|
||||||
|
dataStore.dialogVisible = false;
|
||||||
|
proTableRef?.value!.getTableList();
|
||||||
|
}, 600);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
// 更新
|
||||||
|
const getWarehouseUp = async () => {
|
||||||
|
const result = await getWarehouseUpApi(dataStore.rowId, dataStore.detailsRuleForm);
|
||||||
|
if (result?.code === 0) {
|
||||||
|
useMsg("success", "更新成功 !");
|
||||||
|
setTimeout(() => {
|
||||||
|
dataStore.dialogVisible = false;
|
||||||
|
proTableRef?.value!.getTableList();
|
||||||
|
}, 600);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
// 详情
|
||||||
|
const getShopDetails = async (id: any) => {
|
||||||
|
const result = await getShopDetailsApi(id);
|
||||||
|
if (result?.code === 0) {
|
||||||
|
dataStore.dialogVisible = true;
|
||||||
|
dataStore.title = "编辑金蝶子仓与各系统仓库关系";
|
||||||
|
setAccessSystem(result?.data?.access_system);
|
||||||
|
dataStore.detailsRuleForm = result?.data;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
// 表格row点击事件
|
||||||
|
const handleOpen = (row: any) => {
|
||||||
|
dataStore.rowId = row.id;
|
||||||
|
getShopDetails(row.id);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 导出
|
||||||
|
const handleExport = async () => {
|
||||||
|
const result = await getShopListExportApi(dataStore.initParam);
|
||||||
|
if (result?.code === 0) {
|
||||||
|
useMsg("success", "导出成功请前往导出列表中进行下载 !");
|
||||||
|
}
|
||||||
|
};
|
||||||
// 顶部按钮点击事件
|
// 顶部按钮点击事件
|
||||||
const handleButtonClickCallback = (item: any) => {
|
const handleButtonClickCallback = (item: any) => {
|
||||||
const { type } = item;
|
const { type } = item;
|
||||||
if (type === "del") {
|
if (type === "del") {
|
||||||
return handleDel();
|
return handleDel();
|
||||||
}
|
}
|
||||||
|
if (type === "export") {
|
||||||
|
return handleExport();
|
||||||
|
}
|
||||||
if (type === "add") {
|
if (type === "add") {
|
||||||
|
dataStore.title = "新增金蝶子仓与各系统仓库关系";
|
||||||
dataStore.dialogVisible = true;
|
dataStore.dialogVisible = true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -119,9 +181,29 @@ const handleClose = () => {
|
|||||||
detailsRef?.value?.formElement?.resetFields();
|
detailsRef?.value?.formElement?.resetFields();
|
||||||
dataStore.dialogVisible = false;
|
dataStore.dialogVisible = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 弹窗确认
|
// 弹窗确认
|
||||||
const handleCommit = () => {
|
const handleCommit = () => {
|
||||||
dataStore.dialogVisible = false;
|
if (!dataStore.detailsRuleForm.use_org_number) {
|
||||||
|
return useMsg("warning", "组织不能为空 !");
|
||||||
|
}
|
||||||
|
if (!dataStore.detailsRuleForm.kd_warehouse_number) {
|
||||||
|
return useMsg("warning", "金蝶仓库不能为空 !");
|
||||||
|
}
|
||||||
|
if (!dataStore.detailsRuleForm.kd_subwarehouse) {
|
||||||
|
return useMsg("warning", "金蝶子仓库不能为空 !");
|
||||||
|
}
|
||||||
|
if (!dataStore.detailsRuleForm.jst_warehouse_number) {
|
||||||
|
return useMsg("warning", "对应聚水潭仓库不能为空 !");
|
||||||
|
}
|
||||||
|
if (!dataStore.detailsRuleForm.lx_warehouse_number) {
|
||||||
|
return useMsg("warning", "对应对应领星仓库不能为空 !");
|
||||||
|
}
|
||||||
|
if (dataStore.title === "新增金蝶子仓与各系统仓库关系") {
|
||||||
|
getWarehouseAdd();
|
||||||
|
} else {
|
||||||
|
getWarehouseUp();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
// 搜索
|
// 搜索
|
||||||
const handleSearch = async (params: any) => {
|
const handleSearch = async (params: any) => {
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ import { cloneDeep } from "lodash-es";
|
|||||||
// 获取 ProTable 元素,调用其获取刷新数据方法(还能获取到当前查询参数,方便导出携带参数)
|
// 获取 ProTable 元素,调用其获取刷新数据方法(还能获取到当前查询参数,方便导出携带参数)
|
||||||
const proTableRef = ref<ProTableInstance>();
|
const proTableRef = ref<ProTableInstance>();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
|
|
||||||
// 数据源
|
// 数据源
|
||||||
|
|||||||
367
vite.config.ts.timestamp-1762304755718-8c17e0d0abd23.mjs
Normal file
367
vite.config.ts.timestamp-1762304755718-8c17e0d0abd23.mjs
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user