This commit is contained in:
凌尛 2026-06-29 09:20:49 +08:00
parent bf82e71e85
commit b30fdabd8f
2 changed files with 288 additions and 322 deletions

View File

@ -1052,7 +1052,11 @@ const printNew = async () => {
const LODOP = (await createPrintTask(expressType.value, res.data)) as LODOPObject; const LODOP = (await createPrintTask(expressType.value, res.data)) as LODOPObject;
LODOP.SET_PRINTER_INDEX(printerData.value); LODOP.SET_PRINTER_INDEX(printerData.value);
LODOP.PRINT(); LODOP.PRINT();
if (expressType.value == 'YZXB') {
faHuo('POSTBBZ', res.data.waybillNo, currentItem.erpOrderId); faHuo('POSTBBZ', res.data.waybillNo, currentItem.erpOrderId);
} else {
faHuo(expressType.value, res.data.waybillNo, currentItem.erpOrderId);
}
} }
} catch (error) { } catch (error) {
buttonLoading.value = false; buttonLoading.value = false;
@ -1077,7 +1081,11 @@ const printNew = async () => {
const LODOP = (await createPrintTask(expressType.value, res.data)) as LODOPObject; const LODOP = (await createPrintTask(expressType.value, res.data)) as LODOPObject;
LODOP.SET_PRINTER_INDEX(printerData.value); LODOP.SET_PRINTER_INDEX(printerData.value);
LODOP.PRINT(); LODOP.PRINT();
if (expressType.value == 'YZXB') {
faHuo('POSTBBZ', res.data.waybillNo, erpOrderId.value); faHuo('POSTBBZ', res.data.waybillNo, erpOrderId.value);
} else {
faHuo(expressType.value, res.data.waybillNo, erpOrderId.value);
}
buttonLoading.value = false; buttonLoading.value = false;
dialogCompany.visible = false; dialogCompany.visible = false;
getList(); getList();

View File

@ -23,10 +23,14 @@
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['zhishu:warehouseSettings:add']">新增</el-button> <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['zhishu:warehouseSettings:add']">新增</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['zhishu:warehouseSettings:edit']">修改</el-button> <el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['zhishu:warehouseSettings:edit']"
>修改</el-button
>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['zhishu:warehouseSettings:remove']">删除</el-button> <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['zhishu:warehouseSettings:remove']"
>删除</el-button
>
</el-col> </el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
@ -62,9 +66,8 @@
</el-table-column> </el-table-column>
<el-table-column label="状态" align="center" prop="status"> <el-table-column label="状态" align="center" prop="status">
<template #default="scope"> <template #default="scope">
<dict-tag :options="t_is_open" :value="scope.row.status" @click="clickStatus(scope.row)" style="cursor: pointer;" /> <dict-tag :options="t_is_open" :value="scope.row.status" @click="clickStatus(scope.row)" style="cursor: pointer" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="创建时间" align="center" prop="createAt"> <el-table-column label="创建时间" align="center" prop="createAt">
<template #default="scope"> <template #default="scope">
@ -82,7 +85,13 @@
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['zhishu:warehouseSettings:edit']"></el-button> <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['zhishu:warehouseSettings:edit']"></el-button>
</el-tooltip> </el-tooltip>
<el-tooltip content="删除" placement="top"> <el-tooltip content="删除" placement="top">
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['zhishu:warehouseSettings:remove']"></el-button> <el-button
link
type="primary"
icon="Delete"
@click="handleDelete(scope.row)"
v-hasPermi="['zhishu:warehouseSettings:remove']"
></el-button>
</el-tooltip> </el-tooltip>
</template> </template>
</el-table-column> </el-table-column>
@ -94,10 +103,7 @@
<!-- 新增修改弹窗 --> <!-- 新增修改弹窗 -->
<el-dialog :title="dialog.title" v-model="dialog.visible" @close="resetFormData" width="672px" append-to-body> <el-dialog :title="dialog.title" v-model="dialog.visible" @close="resetFormData" width="672px" append-to-body>
<el-form ref="priceTemplateFormRef" :model="form" :rules="rules"> <el-form ref="priceTemplateFormRef" :model="form" :rules="rules">
<div class="headClass" style="margin-top: 10px">基本规则</div>
<div class="headClass" style="margin-top:10px">
基本规则
</div>
<el-divider style="color: black" /> <el-divider style="color: black" />
<el-form-item label="应用店铺" prop="templateName" label-width="100px"> <el-form-item label="应用店铺" prop="templateName" label-width="100px">
@ -113,31 +119,16 @@
style="width: 240px" style="width: 240px"
> >
<template #header> <template #header>
<el-checkbox <el-checkbox v-model="checkAll" :indeterminate="indeterminate" @change="handleCheckAll"> 全选 </el-checkbox>
v-model="checkAll"
:indeterminate="indeterminate"
@change="handleCheckAll"
>
全选
</el-checkbox>
</template> </template>
</el-select-v2> </el-select-v2>
</el-form-item> </el-form-item>
<el-form-item label="规则模板名称" prop="templateName" label-width="100px"> <el-form-item label="规则模板名称" prop="templateName" label-width="100px">
<el-input v-model="form.settingName" style="width: 300px" placeholder="请输入模板名称" /> <el-input v-model="form.settingName" style="width: 300px" placeholder="请输入模板名称" />
</el-form-item> </el-form-item>
<el-form-item label="库存同步形式" prop="stockSynchronizeType" label-width="100px" style="width: 100%">
<el-form-item
label="库存同步形式"
prop="stockSynchronizeType"
label-width="100px"
style="width: 100%"
>
<el-radio-group v-model="form.stockSynchronizeType"> <el-radio-group v-model="form.stockSynchronizeType">
<el-radio :key="0" :value="0" disabled>下单减库存</el-radio> <el-radio :key="0" :value="0" disabled>下单减库存</el-radio>
<el-radio :key="1" :value="1">支付减库存</el-radio> <el-radio :key="1" :value="1">支付减库存</el-radio>
@ -145,12 +136,7 @@
</el-form-item> </el-form-item>
<div style="color: red; margin-top: -25px; font-size: 12px; margin-left: 2px; margin-bottom: 10px">下单减库存功能暂未开放</div> <div style="color: red; margin-top: -25px; font-size: 12px; margin-left: 2px; margin-bottom: 10px">下单减库存功能暂未开放</div>
<el-form-item <el-form-item label="开启自动下发" prop="autoIssue" label-width="100px" style="width: 100%">
label="开启自动下发"
prop="autoIssue"
label-width="100px"
style="width: 100%"
>
<el-radio-group v-model="form.autoIssue"> <el-radio-group v-model="form.autoIssue">
<el-radio :key="0" :value="0"></el-radio> <el-radio :key="0" :value="0"></el-radio>
<el-radio :key="1" :value="1"></el-radio> <el-radio :key="1" :value="1"></el-radio>
@ -158,32 +144,24 @@
</el-form-item> </el-form-item>
<div v-if="form.autoIssue == 1"> <div v-if="form.autoIssue == 1">
<div class="headClass"> <div class="headClass">商品匹配规则</div>
商品匹配规则
</div>
<el-divider /> <el-divider />
<el-form-item <el-form-item label="开启亏损保护" prop="lossProtection" label-width="100px" style="width: 100%">
label="开启亏损保护"
prop="lossProtection"
label-width="100px"
style="width: 100%"
>
<el-radio-group v-model="form.lossProtection"> <el-radio-group v-model="form.lossProtection">
<el-radio :key="0" :value="0"></el-radio> <el-radio :key="0" :value="0"></el-radio>
<el-radio :key="1" :value="1"></el-radio> <el-radio :key="1" :value="1"></el-radio>
</el-radio-group> </el-radio-group>
<el-input v-if="form.lossProtection == 1" <el-input
v-if="form.lossProtection == 1"
v-model="form.profitFloor" v-model="form.profitFloor"
placeholder="请输入利润下限" placeholder="请输入利润下限"
type="number" type="number"
style="width: 150px; margin-left: 20px" style="width: 150px; margin-left: 20px"
/> />
</el-form-item> </el-form-item>
<el-table :data="form.ruleList" border style="width: 100%" :cell-style="() => ({ padding: '2px' })"> <el-table :data="form.ruleList" border style="width: 100%" :cell-style="() => ({ padding: '2px' })">
<!-- 规则内容 --> <!-- 规则内容 -->
<el-table-column label="规则名称" align="center" width="300"> <el-table-column label="规则名称" align="center" width="300">
<template #default="scope"> <template #default="scope">
@ -201,32 +179,34 @@
<el-option :key="'0'" :label="'货号优先匹配'" :value="'0'" /> <el-option :key="'0'" :label="'货号优先匹配'" :value="'0'" />
<el-option :key="'1'" :label="'ISBN优先匹配'" :value="'1'" /> <el-option :key="'1'" :label="'ISBN优先匹配'" :value="'1'" />
</el-select> </el-select>
<el-select v-else-if="scope.row.attributeId == '4'" v-model="scope.row.attributeValue" placeholder="请选择发货地" clearable :loading="loading"> <el-select
v-else-if="scope.row.attributeId == '4'"
v-model="scope.row.attributeValue"
placeholder="请选择发货地"
clearable
:loading="loading"
>
<el-option v-for="item in districtList" :key="item.id" :label="item.name" :value="item.name" /> <el-option v-for="item in districtList" :key="item.id" :label="item.name" :value="item.name" />
</el-select> </el-select>
<el-select v-else-if="scope.row.attributeId == '6'" v-model="scope.row.attributeValue" placeholder="请选择品相" clearable :loading="loading"> <el-select
v-else-if="scope.row.attributeId == '6'"
v-model="scope.row.attributeValue"
placeholder="请选择品相"
clearable
:loading="loading"
>
<el-option v-for="item in conditionCodeList" :key="item.id" :label="item.value" :value="item.id" /> <el-option v-for="item in conditionCodeList" :key="item.id" :label="item.value" :value="item.id" />
</el-select> </el-select>
<el-input v-else <el-input v-else v-model="scope.row.attributeValue" placeholder="请输入规则内容" style="width: 100%" />
v-model="scope.row.attributeValue"
placeholder="请输入规则内容"
style="width: 100%"
/>
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<!-- 操作列 --> <!-- 操作列 -->
<el-table-column label="操作" align="center" width="120"> <el-table-column label="操作" align="center" width="120">
<template #default="scope"> <template #default="scope">
<el-button <el-button v-if="scope.$index > 0" type="danger" icon="Minus" circle @click="removeAdjustment(scope.$index)" />
v-if="scope.$index > 0"
type="danger"
icon="Minus"
circle
@click="removeAdjustment(scope.$index)"
/>
<el-button <el-button
v-if="scope.$index === form.ruleList.length - 1 && form.ruleList.length < 30" v-if="scope.$index === form.ruleList.length - 1 && form.ruleList.length < 30"
type="primary" type="primary"
@ -239,17 +219,10 @@
</el-table> </el-table>
</div> </div>
<div class="headClass"> <div class="headClass">退货规则<span style="color: red; font-size: 15px">仅针对未发货订单退款自动回退库存</span></div>
退货规则<span style="color:red;font-size:15px">仅针对未发货订单退款自动回退库存</span>
</div>
<el-divider /> <el-divider />
<el-form-item <el-form-item label="退款后是否自动回退库存" prop="stockRollback" label-width="170px" style="width: 100%">
label="退款后是否自动回退库存"
prop="stockRollback"
label-width="170px"
style="width: 100%"
>
<el-radio-group v-model="form.stockRollback"> <el-radio-group v-model="form.stockRollback">
<el-radio :key="0" :value="0"></el-radio> <el-radio :key="0" :value="0"></el-radio>
<el-radio :key="1" :value="1"></el-radio> <el-radio :key="1" :value="1"></el-radio>
@ -267,21 +240,23 @@
</template> </template>
<script setup name="WarehouseSettings" lang="ts"> <script setup name="WarehouseSettings" lang="ts">
import { listWarehouseSettings, getWarehouseSettings, delWarehouseSettings, addWarehouseSettings, updateWarehouseSettings,getWarehouseSettingsAttribute,updateWarehouseSettingsStatus } from '@/api/zhishu/warehouseSettings'; import {
listWarehouseSettings,
getWarehouseSettings,
delWarehouseSettings,
addWarehouseSettings,
updateWarehouseSettings,
getWarehouseSettingsAttribute,
updateWarehouseSettingsStatus
} from '@/api/zhishu/warehouseSettings';
import { WarehouseSettingsVO, WarehouseSettingsQuery, WarehouseSettingsForm } from '@/api/zhishu/warehouseSettings/types'; import { WarehouseSettingsVO, WarehouseSettingsQuery, WarehouseSettingsForm } from '@/api/zhishu/warehouseSettings/types';
import { getFreInfo, getProvinces } from '@/api/zhishu/district'; import { getFreInfo, getProvinces } from '@/api/zhishu/district';
import { TDistrictVo } from '@/api/zhishu/district/types'; import { TDistrictVo } from '@/api/zhishu/district/types';
import { getListShop } from '@/api/zhishu/shop'; import { getListShop } from '@/api/zhishu/shop';
import type { CheckboxValueType } from 'element-plus' import type { CheckboxValueType } from 'element-plus';
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { const { t_is_open } = toRefs<any>(proxy?.useDict('t_is_open'));
t_is_open
} = toRefs<any>(
proxy?.useDict(
't_is_open'
)
);
const warehouseSettingsList = ref<WarehouseSettingsVO[]>([]); const warehouseSettingsList = ref<WarehouseSettingsVO[]>([]);
const buttonLoading = ref(false); const buttonLoading = ref(false);
@ -296,66 +271,46 @@ const districtList = ref<TDistrictVo[]>([]);
const shopList = ref([]); const shopList = ref([]);
const conditionCodeList = ref([ const conditionCodeList = ref([
{ {
id:"N", id: '100',
value:"全新" value: '全新'
}, },
{ {
id:"M", id: '95',
value:"九五品" value: '九五品'
}, },
{ {
id:"L", id: '90',
value:"九品" value: '九品'
}, },
{ {
id:"K", id: '85',
value:"八五品" value: '八五品'
}, },
{ {
id:"J", id: '80',
value:"八品" value: '八品'
}, },
{ {
id:"I", id: '75',
value:"七五品" value: '七五品'
}, },
{ {
id:"H", id: '70',
value:"七品" value: '七品'
}, },
{ {
id:"G", id: '65',
value:"六五品" value: '六五品'
}, },
{ {
id:"F", id: '60',
value:"六品" value: '六品'
},
{
id:"E",
value:"五品"
},
{
id:"D",
value:"四品"
},
{
id:"C",
value:"三品"
},
{
id:"B",
value:"二品"
},
{
id:"A",
value:"一品"
} }
]) ]);
const checkAll = ref(false) const checkAll = ref(false);
const indeterminate = ref(false) const indeterminate = ref(false);
const chooseShopList = ref<CheckboxValueType[]>([]) const chooseShopList = ref<CheckboxValueType[]>([]);
const queryFormRef = ref<ElFormInstance>(); const queryFormRef = ref<ElFormInstance>();
const warehouseSettingsFormRef = ref<ElFormInstance>(); const warehouseSettingsFormRef = ref<ElFormInstance>();
@ -388,7 +343,7 @@ const initFormData: WarehouseSettingsForm = {
attributeValue: undefined attributeValue: undefined
} }
] ]
} };
const data = reactive<PageData<WarehouseSettingsForm, WarehouseSettingsQuery>>({ const data = reactive<PageData<WarehouseSettingsForm, WarehouseSettingsQuery>>({
form: { ...initFormData }, form: { ...initFormData },
queryParams: { queryParams: {
@ -408,13 +363,10 @@ const data = reactive<PageData<WarehouseSettingsForm, WarehouseSettingsQuery>>({
updateAt: undefined, updateAt: undefined,
shopIds: undefined, shopIds: undefined,
userSettingsAttributeListStr: undefined, userSettingsAttributeListStr: undefined,
params: { params: {}
}
}, },
rules: { rules: {
settingName:[ settingName: [{ required: true, message: '模板名称不能为空', trigger: 'blur' }]
{ required: true, message: "模板名称不能为空", trigger: "blur" }
]
} }
}); });
@ -427,64 +379,64 @@ const getList = async () => {
warehouseSettingsList.value = res.rows; warehouseSettingsList.value = res.rows;
total.value = res.total; total.value = res.total;
loading.value = false; loading.value = false;
} };
/** 取消按钮 */ /** 取消按钮 */
const cancel = () => { const cancel = () => {
reset(); reset();
dialog.visible = false; dialog.visible = false;
} };
/** 表单重置 */ /** 表单重置 */
const reset = () => { const reset = () => {
chooseShopList.value.length = 0; chooseShopList.value.length = 0;
form.value = { ...initFormData }; form.value = { ...initFormData };
form.value.ruleList = [{ form.value.ruleList = [
{
id: undefined, id: undefined,
attributeId: undefined, attributeId: undefined,
attributeValue: undefined attributeValue: undefined
}
}]; ];
checkAll.value = false; checkAll.value = false;
warehouseSettingsFormRef.value?.resetFields(); warehouseSettingsFormRef.value?.resetFields();
} };
/** 搜索按钮操作 */ /** 搜索按钮操作 */
const handleQuery = () => { const handleQuery = () => {
queryParams.value.pageNum = 1; queryParams.value.pageNum = 1;
getList(); getList();
} };
/** 重置按钮操作 */ /** 重置按钮操作 */
const resetQuery = () => { const resetQuery = () => {
queryFormRef.value?.resetFields(); queryFormRef.value?.resetFields();
handleQuery(); handleQuery();
} };
/** 多选框选中数据 */ /** 多选框选中数据 */
const handleSelectionChange = (selection: WarehouseSettingsVO[]) => { const handleSelectionChange = (selection: WarehouseSettingsVO[]) => {
ids.value = selection.map(item => item.id); ids.value = selection.map((item) => item.id);
single.value = selection.length != 1; single.value = selection.length != 1;
multiple.value = !selection.length; multiple.value = !selection.length;
} };
/** 新增按钮操作 */ /** 新增按钮操作 */
const handleAdd = () => { const handleAdd = () => {
reset(); reset();
dialog.visible = true; dialog.visible = true;
dialog.title = "添加设置"; dialog.title = '添加设置';
} };
/** 修改按钮操作 */ /** 修改按钮操作 */
const handleUpdate = async (row?: WarehouseSettingsVO) => { const handleUpdate = async (row?: WarehouseSettingsVO) => {
reset(); reset();
const _id = row?.id || ids.value[0] const _id = row?.id || ids.value[0];
const res = await getWarehouseSettings(_id); const res = await getWarehouseSettings(_id);
Object.assign(form.value, res.data); Object.assign(form.value, res.data);
dialog.visible = true; dialog.visible = true;
dialog.title = "修改设置"; dialog.title = '修改设置';
/** /**
* 解析后赋值店铺 * 解析后赋值店铺
@ -495,13 +447,15 @@ const handleUpdate = async (row?: WarehouseSettingsVO) => {
*/ */
form.value.ruleList = JSON.parse(res.data.userSettingsAttributeListStr); form.value.ruleList = JSON.parse(res.data.userSettingsAttributeListStr);
if (form.value.ruleList.length == 0) { if (form.value.ruleList.length == 0) {
form.value.ruleList = [{ form.value.ruleList = [
{
id: undefined, id: undefined,
attributeId: undefined, attributeId: undefined,
attributeValue: undefined attributeValue: undefined
}];
} }
];
} }
};
// //
const formatTimestamp = (timestamp: number | undefined | null) => { const formatTimestamp = (timestamp: number | undefined | null) => {
@ -547,7 +501,6 @@ const formatTimestamp = (timestamp: number | undefined | null) => {
/** 提交按钮 */ /** 提交按钮 */
const submitForm = async () => { const submitForm = async () => {
if (chooseShopList.value.length <= 0) { if (chooseShopList.value.length <= 0) {
proxy?.$modal.msgError('请选择应用店铺'); proxy?.$modal.msgError('请选择应用店铺');
return false; return false;
@ -558,17 +511,22 @@ const submitForm = async () => {
} }
if (form.value.autoIssue == 1) { if (form.value.autoIssue == 1) {
if(form.value.lossProtection == 1 && (form.value.profitFloor == undefined || form.value.profitFloor == null || form.value.profitFloor == '' || form.value.profitFloor < 0)){ if (
form.value.lossProtection == 1 &&
(form.value.profitFloor == undefined || form.value.profitFloor == null || form.value.profitFloor == '' || form.value.profitFloor < 0)
) {
proxy?.$modal.msgError('利润下限不能为空或小于0'); proxy?.$modal.msgError('利润下限不能为空或小于0');
return false; return false;
} }
for (var i = 0; i < form.value.ruleList.length; i++) { for (var i = 0; i < form.value.ruleList.length; i++) {
if (!form.value.ruleList[i].attributeId) { if (!form.value.ruleList[i].attributeId) {
proxy?.$modal.msgError('商品匹配规则 第'+(i+1)+"行,请选择规则"); proxy?.$modal.msgError('商品匹配规则 第' + (i + 1) + '行,请选择规则');
return false; return false;
} }
if(!form.value.ruleList[i].attributeValue){ if (form.value.ruleList[i].attributeId == 7) {
proxy?.$modal.msgError('商品匹配规则 第'+(i+1)+"行,请填写规则内容"); form.value.ruleList[i].attributeValue = '不匹配';
}else if (!form.value.ruleList[i].attributeValue) {
proxy?.$modal.msgError('商品匹配规则 第' + (i + 1) + '行,请填写规则内容');
return false; return false;
} }
} }
@ -577,9 +535,9 @@ const submitForm = async () => {
let shopIds = ''; let shopIds = '';
for (var i = 0; i < chooseShopList.value.length; i++) { for (var i = 0; i < chooseShopList.value.length; i++) {
if (shopIds == '') { if (shopIds == '') {
shopIds = chooseShopList.value[i] shopIds = chooseShopList.value[i];
} else { } else {
shopIds += ','+chooseShopList.value[i] shopIds += ',' + chooseShopList.value[i];
} }
} }
form.value.shopIds = shopIds; form.value.shopIds = shopIds;
@ -588,29 +546,29 @@ const submitForm = async () => {
buttonLoading.value = true; buttonLoading.value = true;
if (form.value.id) { if (form.value.id) {
await updateWarehouseSettings(form.value).finally(() => buttonLoading.value = false); await updateWarehouseSettings(form.value).finally(() => (buttonLoading.value = false));
} else { } else {
await addWarehouseSettings(form.value).finally(() => buttonLoading.value = false); await addWarehouseSettings(form.value).finally(() => (buttonLoading.value = false));
} }
proxy?.$modal.msgSuccess("操作成功"); proxy?.$modal.msgSuccess('操作成功');
dialog.visible = false; dialog.visible = false;
await getList(); await getList();
} };
/** 删除按钮操作 */ /** 删除按钮操作 */
const handleDelete = async (row?: WarehouseSettingsVO) => { const handleDelete = async (row?: WarehouseSettingsVO) => {
const _ids = row?.id || ids.value; const _ids = row?.id || ids.value;
await proxy?.$modal.confirm('是否确认删除设置编号为"' + _ids + '"的数据项?').finally(() => loading.value = false); await proxy?.$modal.confirm('是否确认删除设置编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
await delWarehouseSettings(_ids); await delWarehouseSettings(_ids);
proxy?.$modal.msgSuccess("删除成功"); proxy?.$modal.msgSuccess('删除成功');
await getList(); await getList();
} };
/** 获取匹配属性 */ /** 获取匹配属性 */
const getAttribute = async () => { const getAttribute = async () => {
attributeList.value = await getWarehouseSettingsAttribute() attributeList.value = await getWarehouseSettingsAttribute();
} };
// //
const addAdjustment = () => { const addAdjustment = () => {
@ -640,7 +598,7 @@ const ruleIdChange = (row) => {
} }
} }
row.attributeValue = undefined; row.attributeValue = undefined;
} };
/** /**
* 获取发货地 * 获取发货地
@ -657,13 +615,13 @@ const clickStatus = async (row) => {
const loading = ElLoading.service({ const loading = ElLoading.service({
lock: true, lock: true,
text: '正在修改规则状态', text: '正在修改规则状态',
background: 'rgba(0, 0, 0, 0.7)', background: 'rgba(0, 0, 0, 0.7)'
}) });
await updateWarehouseSettingsStatus(row).finally(() => loading.close());; await updateWarehouseSettingsStatus(row).finally(() => loading.close());
proxy?.$modal.msgSuccess("操作成功"); proxy?.$modal.msgSuccess('操作成功');
await getList(); await getList();
} };
/** /**
* 获取店铺列表 * 获取店铺列表
@ -674,30 +632,30 @@ const getShops = async () => {
shopList.value.push({ shopList.value.push({
value: res[i].id, value: res[i].id,
label: res[i].shopName label: res[i].shopName
}) });
}
} }
};
watch(chooseShopList, (val) => { watch(chooseShopList, (val) => {
if (val.length === 0) { if (val.length === 0) {
checkAll.value = false checkAll.value = false;
indeterminate.value = false indeterminate.value = false;
} else if (val.length === shopList.value.length) { } else if (val.length === shopList.value.length) {
checkAll.value = true checkAll.value = true;
indeterminate.value = false indeterminate.value = false;
} else { } else {
indeterminate.value = true indeterminate.value = true;
} }
}) });
const handleCheckAll = (val: CheckboxValueType) => { const handleCheckAll = (val: CheckboxValueType) => {
indeterminate.value = false indeterminate.value = false;
if (val) { if (val) {
chooseShopList.value = shopList.value.map((_) => _.value) chooseShopList.value = shopList.value.map((_) => _.value);
} else { } else {
chooseShopList.value = [] chooseShopList.value = [];
}
} }
};
onMounted(() => { onMounted(() => {
getList(); getList();