基础资料模块 表格添加 switch 触发是否启用。美化界面
parent
381c4b7f31
commit
3c7f2eb212
|
|
@ -14,6 +14,7 @@
|
||||||
:theme="{
|
:theme="{
|
||||||
algorithm: compactFlag ? theme.compactAlgorithm : theme.defaultAlgorithm,
|
algorithm: compactFlag ? theme.compactAlgorithm : theme.defaultAlgorithm,
|
||||||
token: {
|
token: {
|
||||||
|
fontFamily: '微软雅黑, Arial, sans-serif',
|
||||||
colorPrimary: themeColors[colorIndex].primaryColor,
|
colorPrimary: themeColors[colorIndex].primaryColor,
|
||||||
colorLink: themeColors[colorIndex].primaryColor,
|
colorLink: themeColors[colorIndex].primaryColor,
|
||||||
colorLinkActive: themeColors[colorIndex].activeColor,
|
colorLinkActive: themeColors[colorIndex].activeColor,
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ export const appDefaultConfig: AppConfig = {
|
||||||
// 菜单主题
|
// 菜单主题
|
||||||
sideMenuTheme: 'dark',
|
sideMenuTheme: 'dark',
|
||||||
// 主题颜色索引
|
// 主题颜色索引
|
||||||
colorIndex: 0,
|
colorIndex: 1,
|
||||||
// 顶部菜单页面宽度
|
// 顶部菜单页面宽度
|
||||||
pageWidth: '99%',
|
pageWidth: '99%',
|
||||||
// 圆角
|
// 圆角
|
||||||
|
|
@ -41,13 +41,13 @@ export const appDefaultConfig: AppConfig = {
|
||||||
// 页脚
|
// 页脚
|
||||||
footerFlag: true,
|
footerFlag: true,
|
||||||
// 帮助文档
|
// 帮助文档
|
||||||
helpDocFlag: true,
|
helpDocFlag: false,
|
||||||
// 帮助文档默认展开
|
// 帮助文档默认展开
|
||||||
helpDocExpandFlag: true,
|
helpDocExpandFlag: false,
|
||||||
// 水印
|
// 水印
|
||||||
watermarkFlag: true,
|
watermarkFlag: false,
|
||||||
// 网站名称
|
// 网站名称
|
||||||
websiteName: 'SmartAdmin 3.X',
|
websiteName: 'wms',
|
||||||
// 主题颜色
|
// 主题颜色
|
||||||
primaryColor: '#1677ff',
|
primaryColor: '#1677ff',
|
||||||
// 紧凑
|
// 紧凑
|
||||||
|
|
|
||||||
|
|
@ -96,18 +96,18 @@
|
||||||
|
|
||||||
<template v-if="column.dataIndex === 'action'">
|
<template v-if="column.dataIndex === 'action'">
|
||||||
<div class="smart-table-operate">
|
<div class="smart-table-operate">
|
||||||
<a-button @click="showForm(record)" type="link" v-privilege="'address:update'">
|
<a-space>
|
||||||
<template #icon>
|
|
||||||
<EditOutlined/>
|
|
||||||
</template>
|
<a-button @click="showForm(record)" type="primary" ghost style="width:60px;height: 32px"
|
||||||
编辑
|
v-privilege="'address:update'">
|
||||||
</a-button>
|
编辑
|
||||||
<a-button @click="onDelete(record)" danger type="link" v-privilege="'address:delete'">
|
</a-button>
|
||||||
<template #icon>
|
<a-button @click="onDelete(record)" type="primary" danger ghost style="width:60px;height: 32px"
|
||||||
<DeleteOutlined/>
|
v-privilege="'address:delete'">
|
||||||
</template>
|
删除
|
||||||
删除
|
</a-button>
|
||||||
</a-button>
|
</a-space>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -218,7 +218,8 @@ const columns = ref([
|
||||||
title: '操作',
|
title: '操作',
|
||||||
dataIndex: 'action',
|
dataIndex: 'action',
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
width: 140,
|
align: 'center',
|
||||||
|
width: 150,
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
@ -279,7 +280,7 @@ onMounted(queryData);
|
||||||
// ---------------------------- 添加/修改 ----------------------------
|
// ---------------------------- 添加/修改 ----------------------------
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
|
|
||||||
function showForm(data:object) {
|
function showForm(data: object) {
|
||||||
formRef.value.show(data);
|
formRef.value.show(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -319,7 +320,7 @@ async function requestDelete(data: any) {
|
||||||
// 选择表格行
|
// 选择表格行
|
||||||
const selectedRowKeyList = ref([]);
|
const selectedRowKeyList = ref([]);
|
||||||
|
|
||||||
function onSelectChange(selectedRowKeys:any) {
|
function onSelectChange(selectedRowKeys: any) {
|
||||||
selectedRowKeyList.value = selectedRowKeys;
|
selectedRowKeyList.value = selectedRowKeys;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,12 @@
|
||||||
</template> -->
|
</template> -->
|
||||||
|
|
||||||
<template v-if="column.dataIndex === 'disabledFlag'">
|
<template v-if="column.dataIndex === 'disabledFlag'">
|
||||||
<a-tag :color="text ? 'processing' : 'error'">{{ text ? '启用' : '禁用' }}</a-tag>
|
<a-switch
|
||||||
|
@change="(checked: boolean) => handleChangeDisabled(checked, record)"
|
||||||
|
:checked="record.disabledFlag"
|
||||||
|
checked-children="启用"
|
||||||
|
un-checked-children="禁用"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -93,18 +98,19 @@
|
||||||
|
|
||||||
<template v-if="column.dataIndex === 'action'">
|
<template v-if="column.dataIndex === 'action'">
|
||||||
<div class="smart-table-operate">
|
<div class="smart-table-operate">
|
||||||
<a-button @click="showForm(record)" type="link" v-privilege="'area:update'">
|
<a-space>
|
||||||
<template #icon>
|
<a-button @click="showForm(record)" type="primary" ghost style="width:60px;height: 32px"
|
||||||
<EditOutlined/>
|
v-privilege="'area:update'">
|
||||||
</template>
|
<!-- <template #icon>
|
||||||
编辑
|
<IconFontComponent style="font-size: 18px" type="icon-edit"/>
|
||||||
</a-button>
|
</template>-->
|
||||||
<a-button @click="onDelete(record)" danger type="link" v-privilege="'area:delete'">
|
编辑
|
||||||
<template #icon>
|
</a-button>
|
||||||
<DeleteOutlined/>
|
<a-button @click="onDelete(record)" type="primary" danger ghost style="width:60px;height: 32px"
|
||||||
</template>
|
v-privilege="'area:delete'">
|
||||||
删除
|
删除
|
||||||
</a-button>
|
</a-button>
|
||||||
|
</a-space>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -142,7 +148,6 @@ import TableOperator from '/@/components/support/table-operator/index.vue';
|
||||||
import AreaForm from '/@/views/business/wms/base/area/area-form.vue';
|
import AreaForm from '/@/views/business/wms/base/area/area-form.vue';
|
||||||
import {TABLE_ID_CONST} from "/@/constants/support/table-id-const";
|
import {TABLE_ID_CONST} from "/@/constants/support/table-id-const";
|
||||||
import AreaSelect from "/@/views/business/wms/base/area/area-select.vue";
|
import AreaSelect from "/@/views/business/wms/base/area/area-select.vue";
|
||||||
|
|
||||||
// ---------------------------- 表格列 ----------------------------
|
// ---------------------------- 表格列 ----------------------------
|
||||||
|
|
||||||
const columns = ref([
|
const columns = ref([
|
||||||
|
|
@ -180,7 +185,8 @@ const columns = ref([
|
||||||
title: '操作',
|
title: '操作',
|
||||||
dataIndex: 'action',
|
dataIndex: 'action',
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
width: 140,
|
align: 'center',
|
||||||
|
width: 150,
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
@ -217,7 +223,7 @@ function onSearch() {
|
||||||
|
|
||||||
//选择库区
|
//选择库区
|
||||||
function changeAreaSelect(selectValue: any) {
|
function changeAreaSelect(selectValue: any) {
|
||||||
if(selectValue){
|
if (selectValue) {
|
||||||
queryForm.areaId = selectValue.areaId;
|
queryForm.areaId = selectValue.areaId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -236,8 +242,37 @@ async function queryData() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ----------------------- 启用/禁用 ------------------------
|
||||||
|
function handleChangeDisabled(disabledFlag:boolean, record:object) {
|
||||||
|
const content = disabledFlag ? '"启用"' + record.areaName : '"禁用"' + record.areaName + ",确认是否继续?";
|
||||||
|
Modal.confirm({
|
||||||
|
title: '提示',
|
||||||
|
content: '此操作将' + content,
|
||||||
|
okText: '确认',
|
||||||
|
okType: 'danger',
|
||||||
|
onOk() {
|
||||||
|
requestChangeDisabled(disabledFlag, record);
|
||||||
|
},
|
||||||
|
cancelText: '取消',
|
||||||
|
onCancel() {
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function requestChangeDisabled(disabledFlag:boolean, record:object) {
|
||||||
|
SmartLoading.show();
|
||||||
|
try {
|
||||||
|
record.disabledFlag = disabledFlag;
|
||||||
|
await areaApi.update(record);
|
||||||
|
message.success('操作成功');
|
||||||
|
onSearch();
|
||||||
|
} catch (e) {
|
||||||
|
smartSentry.captureError(e);
|
||||||
|
} finally {
|
||||||
|
SmartLoading.hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(queryData);
|
|
||||||
|
|
||||||
// ---------------------------- 添加/修改 ----------------------------
|
// ---------------------------- 添加/修改 ----------------------------
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
|
|
@ -321,4 +356,6 @@ async function requestBatchDelete() {
|
||||||
SmartLoading.hide();
|
SmartLoading.hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onMounted(queryData);
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -74,24 +74,29 @@
|
||||||
<template #bodyCell="{ text, record, column }">
|
<template #bodyCell="{ text, record, column }">
|
||||||
|
|
||||||
<template v-if="column.dataIndex === 'disabledFlag'">
|
<template v-if="column.dataIndex === 'disabledFlag'">
|
||||||
<a-tag :color="text ? 'processing' : 'error'">{{ text ? '启用' : '禁用' }}</a-tag>
|
<a-switch
|
||||||
|
@change="(checked: boolean) => handleChangeDisabled(checked, record)"
|
||||||
|
:checked="record.disabledFlag"
|
||||||
|
checked-children="启用"
|
||||||
|
un-checked-children="禁用"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
||||||
<template v-if="column.dataIndex === 'action'">
|
<template v-if="column.dataIndex === 'action'">
|
||||||
<div class="smart-table-operate">
|
<div class="smart-table-operate">
|
||||||
<a-button @click="showForm(record)" type="link" v-privilege="'customer:update'">
|
<a-space>
|
||||||
<template #icon>
|
|
||||||
<EditOutlined/>
|
|
||||||
</template>
|
<a-button @click="showForm(record)" type="primary" ghost style="width:60px;height: 32px"
|
||||||
编辑
|
v-privilege="'customer:update'">
|
||||||
</a-button>
|
编辑
|
||||||
<a-button @click="onDelete(record)" danger type="link" v-privilege="'customer:delete'">
|
</a-button>
|
||||||
<template #icon>
|
<a-button @click="onDelete(record)" type="primary" danger ghost style="width:60px;height: 32px"
|
||||||
<DeleteOutlined/>
|
v-privilege="'customer:delete'">
|
||||||
</template>
|
删除
|
||||||
删除
|
</a-button>
|
||||||
</a-button>
|
</a-space>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -177,7 +182,8 @@ const columns = ref([
|
||||||
title: '操作',
|
title: '操作',
|
||||||
dataIndex: 'action',
|
dataIndex: 'action',
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
width: 140,
|
align: 'center',
|
||||||
|
width: 150,
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
@ -233,8 +239,36 @@ async function queryData() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ----------------------- 启用/禁用 ------------------------
|
||||||
|
function handleChangeDisabled(disabledFlag: boolean, record: object) {
|
||||||
|
const content = disabledFlag ? '"启用"' + record.customerName : '"禁用"' + record.customerName + ",确认是否继续?";
|
||||||
|
Modal.confirm({
|
||||||
|
title: '提示',
|
||||||
|
content: '此操作将' + content,
|
||||||
|
okText: '确认',
|
||||||
|
okType: 'danger',
|
||||||
|
onOk() {
|
||||||
|
requestChangeDisabled(disabledFlag, record);
|
||||||
|
},
|
||||||
|
cancelText: '取消',
|
||||||
|
onCancel() {
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(queryData);
|
async function requestChangeDisabled(disabledFlag: boolean, record: object) {
|
||||||
|
SmartLoading.show();
|
||||||
|
try {
|
||||||
|
record.disabledFlag = disabledFlag;
|
||||||
|
await customerApi.update(record);
|
||||||
|
message.success('操作成功');
|
||||||
|
onSearch();
|
||||||
|
} catch (e) {
|
||||||
|
smartSentry.captureError(e);
|
||||||
|
} finally {
|
||||||
|
SmartLoading.hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ---------------------------- 添加/修改 ----------------------------
|
// ---------------------------- 添加/修改 ----------------------------
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
|
|
@ -305,11 +339,13 @@ async function requestBatchDelete() {
|
||||||
SmartLoading.show();
|
SmartLoading.show();
|
||||||
await customerApi.batchDelete(selectedRowKeyList.value);
|
await customerApi.batchDelete(selectedRowKeyList.value);
|
||||||
message.success('删除成功');
|
message.success('删除成功');
|
||||||
queryData();
|
await queryData();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
smartSentry.captureError(e);
|
smartSentry.captureError(e);
|
||||||
} finally {
|
} finally {
|
||||||
SmartLoading.hide();
|
SmartLoading.hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onMounted(queryData);
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,12 @@
|
||||||
<template #bodyCell="{ text, record, column }">
|
<template #bodyCell="{ text, record, column }">
|
||||||
|
|
||||||
<template v-if="column.dataIndex === 'disabledFlag'">
|
<template v-if="column.dataIndex === 'disabledFlag'">
|
||||||
<a-tag :color="text ? 'processing' : 'error'">{{ text ? '启用' : '禁用' }}</a-tag>
|
<a-switch
|
||||||
|
@change="(checked: boolean) => handleChangeDisabled(checked, record)"
|
||||||
|
:checked="record.disabledFlag"
|
||||||
|
checked-children="启用"
|
||||||
|
un-checked-children="禁用"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-if="column.dataIndex === 'unit'">
|
<template v-if="column.dataIndex === 'unit'">
|
||||||
|
|
@ -100,18 +105,16 @@
|
||||||
|
|
||||||
<template v-if="column.dataIndex === 'action'">
|
<template v-if="column.dataIndex === 'action'">
|
||||||
<div class="smart-table-operate">
|
<div class="smart-table-operate">
|
||||||
<a-button @click="showForm(record)" type="link" v-privilege="'item:update'">
|
<a-space>
|
||||||
<template #icon>
|
<a-button @click="showForm(record)" type="primary" ghost style="width:60px;height: 32px"
|
||||||
<EditOutlined/>
|
v-privilege="'item:update'">
|
||||||
</template>
|
编辑
|
||||||
编辑
|
</a-button>
|
||||||
</a-button>
|
<a-button @click="onDelete(record)" type="primary" danger ghost style="width:60px;height: 32px"
|
||||||
<a-button @click="onDelete(record)" danger type="link" v-privilege="'item:delete'">
|
v-privilege="'item:delete'">
|
||||||
<template #icon>
|
删除
|
||||||
<DeleteOutlined/>
|
</a-button>
|
||||||
</template>
|
</a-space>
|
||||||
删除
|
|
||||||
</a-button>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -232,7 +235,8 @@ const columns = ref([
|
||||||
title: '操作',
|
title: '操作',
|
||||||
dataIndex: 'action',
|
dataIndex: 'action',
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
width: 140,
|
align: 'center',
|
||||||
|
width: 150,
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
@ -288,8 +292,36 @@ async function queryData() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ----------------------- 启用/禁用 ------------------------
|
||||||
|
function handleChangeDisabled(disabledFlag: boolean, record: object) {
|
||||||
|
const content = disabledFlag ? '"启用"' + record.itemCode : '"禁用"' + record.itemCode + ",确认是否继续?";
|
||||||
|
Modal.confirm({
|
||||||
|
title: '提示',
|
||||||
|
content: '此操作将' + content,
|
||||||
|
okText: '确认',
|
||||||
|
okType: 'danger',
|
||||||
|
onOk() {
|
||||||
|
requestChangeDisabled(disabledFlag, record);
|
||||||
|
},
|
||||||
|
cancelText: '取消',
|
||||||
|
onCancel() {
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(queryData);
|
async function requestChangeDisabled(disabledFlag: boolean, record: object) {
|
||||||
|
SmartLoading.show();
|
||||||
|
try {
|
||||||
|
record.disabledFlag = disabledFlag;
|
||||||
|
await itemApi.update(record);
|
||||||
|
message.success('操作成功');
|
||||||
|
onSearch();
|
||||||
|
} catch (e) {
|
||||||
|
smartSentry.captureError(e);
|
||||||
|
} finally {
|
||||||
|
SmartLoading.hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ---------------------------- 添加/修改 ----------------------------
|
// ---------------------------- 添加/修改 ----------------------------
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
|
|
@ -435,4 +467,6 @@ async function onImportItems() {
|
||||||
function onExportItems() {
|
function onExportItems() {
|
||||||
itemApi.exportItems();
|
itemApi.exportItems();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onMounted(queryData);
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -122,7 +122,12 @@
|
||||||
</template> -->
|
</template> -->
|
||||||
|
|
||||||
<template v-if="column.dataIndex === 'disabledFlag'">
|
<template v-if="column.dataIndex === 'disabledFlag'">
|
||||||
<a-tag :color="text ? 'processing' : 'error'">{{ text ? '启用' : '禁用' }}</a-tag>
|
<a-switch
|
||||||
|
@change="(checked: boolean) => handleChangeDisabled(checked, record)"
|
||||||
|
:checked="record.disabledFlag"
|
||||||
|
checked-children="启用"
|
||||||
|
un-checked-children="禁用"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-if="column.dataIndex === 'status'">
|
<template v-if="column.dataIndex === 'status'">
|
||||||
|
|
@ -137,18 +142,16 @@
|
||||||
|
|
||||||
<template v-if="column.dataIndex === 'action'">
|
<template v-if="column.dataIndex === 'action'">
|
||||||
<div class="smart-table-operate">
|
<div class="smart-table-operate">
|
||||||
<a-button @click="showForm(record)" type="link" v-privilege="'location:update'">
|
<a-space>
|
||||||
<template #icon>
|
<a-button @click="showForm(record)" type="primary" ghost style="width:60px;height: 32px"
|
||||||
<EditOutlined/>
|
v-privilege="'location:update'">
|
||||||
</template>
|
编辑
|
||||||
编辑
|
</a-button>
|
||||||
</a-button>
|
<a-button @click="onDelete(record)" type="primary" danger ghost style="width:60px;height: 32px"
|
||||||
<a-button @click="onDelete(record)" danger type="link" v-privilege="'location:delete'">
|
v-privilege="'location:delete'">
|
||||||
<template #icon>
|
删除
|
||||||
<DeleteOutlined/>
|
</a-button>
|
||||||
</template>
|
</a-space>
|
||||||
删除
|
|
||||||
</a-button>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -289,7 +292,8 @@ const columns = ref([
|
||||||
title: '操作',
|
title: '操作',
|
||||||
dataIndex: 'action',
|
dataIndex: 'action',
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
width: 140,
|
align: 'center',
|
||||||
|
width: 150,
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
@ -357,8 +361,37 @@ async function queryData() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ----------------------- 启用/禁用 ------------------------
|
||||||
|
function handleChangeDisabled(disabledFlag: boolean, record: object) {
|
||||||
|
const content = disabledFlag ? '"启用"' + record.locationCode : '"禁用"' + record.locationCode + ",确认是否继续?";
|
||||||
|
Modal.confirm({
|
||||||
|
title: '提示',
|
||||||
|
content: '此操作将' + content,
|
||||||
|
okText: '确认',
|
||||||
|
okType: 'danger',
|
||||||
|
onOk() {
|
||||||
|
requestChangeDisabled(disabledFlag, record);
|
||||||
|
},
|
||||||
|
cancelText: '取消',
|
||||||
|
onCancel() {
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function requestChangeDisabled(disabledFlag: boolean, record: object) {
|
||||||
|
SmartLoading.show();
|
||||||
|
try {
|
||||||
|
record.disabledFlag = disabledFlag;
|
||||||
|
await locationApi.update(record);
|
||||||
|
message.success('操作成功');
|
||||||
|
onSearch();
|
||||||
|
} catch (e) {
|
||||||
|
smartSentry.captureError(e);
|
||||||
|
} finally {
|
||||||
|
SmartLoading.hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(queryData);
|
|
||||||
|
|
||||||
// ---------------------------- 添加/修改 ----------------------------
|
// ---------------------------- 添加/修改 ----------------------------
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
|
|
@ -519,6 +552,7 @@ function onExportLocations() {
|
||||||
locationApi.exportLocations();
|
locationApi.exportLocations();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onMounted(queryData);
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,7 @@
|
||||||
<template #bodyCell="{ text, record, column }">
|
<template #bodyCell="{ text, record, column }">
|
||||||
|
|
||||||
<template v-if="column.dataIndex === 'stockType'">
|
<template v-if="column.dataIndex === 'stockType'">
|
||||||
<DictLabel :dict-code="'STOCK_TYPE'" :data-value="text" />
|
<DictLabel :dict-code="'STOCK_TYPE'" :data-value="text"/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-if="column.dataIndex === 'status'">
|
<template v-if="column.dataIndex === 'status'">
|
||||||
|
|
@ -103,23 +103,26 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-if="column.dataIndex === 'disabledFlag'">
|
<template v-if="column.dataIndex === 'disabledFlag'">
|
||||||
<a-tag :color="text ? 'processing' : 'error'">{{ text ? '启用' : '禁用' }}</a-tag>
|
<a-switch
|
||||||
|
@change="(checked: boolean) => handleChangeDisabled(checked, record)"
|
||||||
|
:checked="record.disabledFlag"
|
||||||
|
checked-children="启用"
|
||||||
|
un-checked-children="禁用"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-if="column.dataIndex === 'action'">
|
<template v-if="column.dataIndex === 'action'">
|
||||||
<div class="smart-table-operate">
|
<div class="smart-table-operate">
|
||||||
<a-button @click="showForm(record)" type="link" v-privilege="'stock:update'">
|
<a-space>
|
||||||
<template #icon>
|
<a-button @click="showForm(record)" type="primary" ghost style="width:60px;height: 32px"
|
||||||
<EditOutlined/>
|
v-privilege="'stock:update'">
|
||||||
</template>
|
编辑
|
||||||
编辑
|
</a-button>
|
||||||
</a-button>
|
<a-button @click="onDelete(record)" type="primary" danger ghost style="width:60px;height: 32px"
|
||||||
<a-button @click="onDelete(record)" danger type="link" v-privilege="'stock:delete'">
|
v-privilege="'stock:delete'">
|
||||||
<template #icon>
|
删除
|
||||||
<DeleteOutlined/>
|
</a-button>
|
||||||
</template>
|
</a-space>
|
||||||
删除
|
|
||||||
</a-button>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -238,7 +241,8 @@ const columns = ref([
|
||||||
title: '操作',
|
title: '操作',
|
||||||
dataIndex: 'action',
|
dataIndex: 'action',
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
width: 140,
|
align: 'center',
|
||||||
|
width: 150,
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
@ -303,8 +307,36 @@ async function queryData() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ----------------------- 启用/禁用 ------------------------
|
||||||
|
function handleChangeDisabled(disabledFlag: boolean, record: object) {
|
||||||
|
const content = disabledFlag ? '"启用"' + record.stockCode : '"禁用"' + record.stockCode + ",确认是否继续?";
|
||||||
|
Modal.confirm({
|
||||||
|
title: '提示',
|
||||||
|
content: '此操作将' + content,
|
||||||
|
okText: '确认',
|
||||||
|
okType: 'danger',
|
||||||
|
onOk() {
|
||||||
|
requestChangeDisabled(disabledFlag, record);
|
||||||
|
},
|
||||||
|
cancelText: '取消',
|
||||||
|
onCancel() {
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(queryData);
|
async function requestChangeDisabled(disabledFlag: boolean, record: object) {
|
||||||
|
SmartLoading.show();
|
||||||
|
try {
|
||||||
|
record.disabledFlag = disabledFlag;
|
||||||
|
await stockApi.update(record);
|
||||||
|
message.success('操作成功');
|
||||||
|
onSearch();
|
||||||
|
} catch (e) {
|
||||||
|
smartSentry.captureError(e);
|
||||||
|
} finally {
|
||||||
|
SmartLoading.hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ---------------------------- 添加/修改 ----------------------------
|
// ---------------------------- 添加/修改 ----------------------------
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
|
|
@ -450,4 +482,6 @@ async function onImportStocks() {
|
||||||
function onExportStocks() {
|
function onExportStocks() {
|
||||||
stockApi.exportStocks();
|
stockApi.exportStocks();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onMounted(queryData);
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
<template>
|
||||||
|
<a-space>
|
||||||
|
<icon-font :type="type" />
|
||||||
|
</a-space>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { defineProps } from 'vue';
|
||||||
|
import { createFromIconfontCN } from '@ant-design/icons-vue';
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
type: {
|
||||||
|
type: String,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
scriptUrl: {
|
||||||
|
type: String,
|
||||||
|
default: '//at.alicdn.com/t/c/font_4892234_j6gzjo4uhqa.js'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const IconFont = createFromIconfontCN({
|
||||||
|
scriptUrl: props.scriptUrl
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
</style>
|
||||||
|
|
@ -54,13 +54,11 @@
|
||||||
</a-modal>
|
</a-modal>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup lang="ts">
|
||||||
import { reactive, ref } from 'vue';
|
import { reactive, ref } from 'vue';
|
||||||
import { message, Modal } from 'ant-design-vue';
|
|
||||||
import { PAGE_SIZE, PAGE_SIZE_OPTIONS } from '/@/constants/common-const';
|
import { PAGE_SIZE, PAGE_SIZE_OPTIONS } from '/@/constants/common-const';
|
||||||
import { smartSentry } from '/src/lib/smart-sentry';
|
import {SmartLoading} from '/@/components/framework/smart-loading';
|
||||||
import { SmartLoading } from '/src/components/framework/smart-loading';
|
import {smartSentry} from '/@/lib/smart-sentry';
|
||||||
import SmartEnumSelect from '/src/components/framework/smart-enum-select/index.vue';
|
|
||||||
import { employeeApi } from '/@/api/system/employee-api';
|
import { employeeApi } from '/@/api/system/employee-api';
|
||||||
// ---------------查询条件----------------
|
// ---------------查询条件----------------
|
||||||
const queryParamState = {
|
const queryParamState = {
|
||||||
|
|
|
||||||
|
|
@ -24,15 +24,15 @@
|
||||||
</a-modal>
|
</a-modal>
|
||||||
<MessageReceiverModal ref="receiverModalRef" @reloadList="addReceiverIdList" />
|
<MessageReceiverModal ref="receiverModalRef" @reloadList="addReceiverIdList" />
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup lang="ts">
|
||||||
import { nextTick, reactive, ref } from 'vue';
|
import { nextTick, reactive, ref } from 'vue';
|
||||||
import { message } from 'ant-design-vue';
|
import { message } from 'ant-design-vue';
|
||||||
import { SmartLoading } from '/src/components/framework/smart-loading';
|
import {SmartLoading} from '/@/components/framework/smart-loading';
|
||||||
import { smartSentry } from '/src/lib/smart-sentry';
|
import {smartSentry} from '/@/lib/smart-sentry';
|
||||||
import SmartEnumSelect from '/src/components/framework/smart-enum-select/index.vue';
|
import SmartEnumSelect from "/@/components/framework/smart-enum-select/index.vue";
|
||||||
import MessageReceiverModal from './message-receiver-modal.vue';
|
import MessageReceiverModal from '/@/views/support/message/components/message-receiver-modal.vue';
|
||||||
import { USER_TYPE_ENUM } from '/src/constants/common-const.js';
|
import { USER_TYPE_ENUM } from '/@/constants/common-const';
|
||||||
import { messageApi } from '/@/api/support/message-api.js';
|
import { messageApi } from '/@/api/support/message-api';
|
||||||
// ------------------------ 事件 ------------------------
|
// ------------------------ 事件 ------------------------
|
||||||
|
|
||||||
const emits = defineEmits(['reloadList']);
|
const emits = defineEmits(['reloadList']);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue