diff --git a/src/views/base/area/Area.api.ts b/src/views/base/area/Area.api.ts
index 6c02a58..7058f81 100644
--- a/src/views/base/area/Area.api.ts
+++ b/src/views/base/area/Area.api.ts
@@ -5,6 +5,7 @@ const { createConfirm } = useMessage();
enum Api {
list = '/base/area/list',
+ queryById='/base/area/queryById',
save = '/base/area/add',
edit = '/base/area/edit',
deleteOne = '/base/area/delete',
@@ -30,6 +31,11 @@ export const getImportUrl = Api.importExcel;
*/
export const list = (params) => defHttp.get({ url: Api.list, params });
+/**
+ * id查询
+ * @param params
+ */
+export const queryById = (params) => defHttp.get({ url: Api.queryById, params });
/**
* 删除单个
* @param params
diff --git a/src/views/base/area/components/AreaSelect.vue b/src/views/base/area/components/AreaSelect.vue
index 8d85752..acd3075 100644
--- a/src/views/base/area/components/AreaSelect.vue
+++ b/src/views/base/area/components/AreaSelect.vue
@@ -1,4 +1,4 @@
-
+
-
- 暂无库区数据
+
-
+
{{ getOptionLabel(option) }}
diff --git a/src/views/base/item/components/ItemSelect.vue b/src/views/base/item/components/ItemSelect.vue
index cc94a12..c967616 100644
--- a/src/views/base/item/components/ItemSelect.vue
+++ b/src/views/base/item/components/ItemSelect.vue
@@ -17,8 +17,7 @@
v-bind="attrs"
>
-
- 暂无物料数据
+
{{ getOptionLabel(option) }}
@@ -78,6 +77,8 @@
returnValue: propTypes.string.def('id'),
//默认启用
izActive: propTypes.number.def(1),
+ //默认未删除
+ delFlag: propTypes.number.def(0),
},
emits: ['change', 'update:value', 'optionsLoaded'],
setup(props, { emit }) {
@@ -97,7 +98,7 @@
// 未找到内容
const notFoundContent = computed(() => {
- return loading.value ? undefined : null;
+ return loading.value ? undefined : '暂无数据';
});
/**
@@ -165,6 +166,7 @@
pageNo: page,
keyword: keyword,
izActive: props.izActive,
+ delFlag: props.delFlag,
},
});
diff --git a/src/views/base/point/components/PointSelect.vue b/src/views/base/point/components/PointSelect.vue
index 8fdd648..be94aab 100644
--- a/src/views/base/point/components/PointSelect.vue
+++ b/src/views/base/point/components/PointSelect.vue
@@ -16,10 +16,7 @@
:getPopupContainer="getParentContainer"
v-bind="attrs"
>
-
-
- 暂无库位数据
-
+
{{ getOptionLabel(option) }}
@@ -76,8 +73,14 @@
immediateChange: propTypes.bool.def(false),
// 返回值类型: 'id'(默认) | 'object' | 其他字段名
returnValue: propTypes.string.def('id'),
+ //默认空闲
+ status: propTypes.number.def(0),
//默认启用
izActive: propTypes.number.def(1),
+ //默认未删除
+ delFlag: propTypes.number.def(0),
+ //库区ID
+ areaCode: propTypes.array,
},
emits: ['change', 'update:value', 'optionsLoaded'],
setup(props, { emit }) {
@@ -97,7 +100,7 @@
// 未找到内容
const notFoundContent = computed(() => {
- return loading.value ? undefined : null;
+ return loading.value ? undefined : '暂无数据';
});
/**
@@ -147,7 +150,7 @@
*/
function ensureUnique(Points: Point[], newPoint: Point): Point[] {
// 如果已经存在相同id的库位,先移除旧的再添加新的
- const filtered = Points.filter(Point => Point.id !== newPoint.id);
+ const filtered = Points.filter((Point) => Point.id !== newPoint.id);
return [newPoint, ...filtered];
}
@@ -164,7 +167,10 @@
pageSize: props.pageSize,
pageNo: page,
keyword: keyword,
+ status: props.status,
izActive: props.izActive,
+ delFlag: props.delFlag,
+ areaCode: props.areaCode,
},
});
@@ -176,9 +182,7 @@
Options.value = records;
} else {
// 滚动加载时,追加数据(确保不重复)
- const newRecords = records.filter(record =>
- !allPoints.value.some(Point => Point.id === record.id)
- );
+ const newRecords = records.filter((record) => !allPoints.value.some((Point) => Point.id === record.id));
allPoints.value = [...allPoints.value, ...newRecords];
Options.value = [...Options.value, ...newRecords];
}
diff --git a/src/views/base/stock/Stock.data.ts b/src/views/base/stock/Stock.data.ts
index 70af32d..cb1610c 100644
--- a/src/views/base/stock/Stock.data.ts
+++ b/src/views/base/stock/Stock.data.ts
@@ -21,11 +21,6 @@ export const columns: BasicColumn[] = [
return render.renderTag(text, color);
},
},
- {
- title: '库位',
- align: "center",
- dataIndex: 'pointId_dictText'
- },
{
title: '是否启用',
align: 'center',
diff --git a/src/views/base/stock/StockList.vue b/src/views/base/stock/StockList.vue
index a2e2292..5370544 100644
--- a/src/views/base/stock/StockList.vue
+++ b/src/views/base/stock/StockList.vue
@@ -10,12 +10,6 @@
-
-
- 库位
-
-
-
状态
@@ -88,21 +82,16 @@
import { list, deleteOne, batchDelete, saveOrUpdate, getImportUrl, getExportUrl } from './Stock.api';
import StockModal from './components/StockModal.vue';
import SwitchStatus from '/@/views/base/SwitchStatus.vue';
- import { useUserStore } from '/@/store/modules/user';
- import { useMessage } from '/@/hooks/web/useMessage';
import { getDateByPicker } from '/@/utils';
import { JDictSelectTag, JSearchSelect } from '@/components/Form';
import { JInputTypeEnum } from '@/enums/cpteEnum';
import JInput from '../../../components/Form/src/jeecg/components/JInput.vue';
- import PointSelect from '@/views/base/point/components/PointSelect.vue';
const fieldPickers = reactive({});
const formRef = ref();
const queryParam = reactive({});
const toggleSearchStatus = ref(false);
const registerModal = ref();
- const userStore = useUserStore();
- const { createMessage } = useMessage();
//将是否启用转换成开关
const enhancedColumns = columns.map((col) => {
@@ -130,7 +119,7 @@
});
//注册table数据
- const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
+ const { tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '容器',
api: list,
@@ -164,7 +153,7 @@
success: handleSuccess,
},
});
- const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] =
+ const [registerTable, { reload }, { rowSelection, selectedRowKeys }] =
tableContext;
const labelCol = reactive({
xs: 24,
diff --git a/src/views/base/stock/components/StockForm.vue b/src/views/base/stock/components/StockForm.vue
index 847c155..ef7a21e 100644
--- a/src/views/base/stock/components/StockForm.vue
+++ b/src/views/base/stock/components/StockForm.vue
@@ -25,11 +25,6 @@
/>
-
-
-
-
-
@@ -57,7 +52,6 @@
import JSwitch from '@/components/Form/src/jeecg/components/JSwitch.vue';
import { JDictSelectTag } from '@/components/Form';
import { getTenantId } from '@/utils/auth';
- import PointSelect from '@/views/base/point/components/PointSelect.vue';
const props = defineProps({
formDisabled: { type: Boolean, default: false },
@@ -71,7 +65,6 @@
let tenantId = getTenantId();
const formData = reactive>({
id: '',
- pointId: '',
stockCode: '',
stockType: 'TRAY',
status: 0,
diff --git a/src/views/base/stock/components/StockSelect.vue b/src/views/base/stock/components/StockSelect.vue
index 4520894..9b2a7d0 100644
--- a/src/views/base/stock/components/StockSelect.vue
+++ b/src/views/base/stock/components/StockSelect.vue
@@ -17,8 +17,7 @@
v-bind="attrs"
>
-
- 暂无容器数据
+
{{ getOptionLabel(option) }}
@@ -75,8 +74,14 @@
immediateChange: propTypes.bool.def(false),
// 返回值类型: 'id'(默认) | 'object' | 其他字段名
returnValue: propTypes.string.def('id'),
+ //默认空闲
+ status: propTypes.number.def(0),
//默认启用
izActive: propTypes.number.def(1),
+ //默认未删除
+ delFlag: propTypes.number.def(0),
+ //是否扫描
+ izScan: propTypes.bool.def(false),
},
emits: ['change', 'update:value', 'optionsLoaded'],
setup(props, { emit }) {
@@ -96,7 +101,7 @@
// 未找到内容
const notFoundContent = computed(() => {
- return loading.value ? undefined : null;
+ return loading.value ? undefined : '暂无数据';
});
/**
@@ -146,7 +151,7 @@
*/
function ensureUnique(Stocks: Stock[], newStock: Stock): Stock[] {
// 如果已经存在相同id的容器,先移除旧的再添加新的
- const filtered = Stocks.filter(Stock => Stock.id !== newStock.id);
+ const filtered = Stocks.filter((Stock) => Stock.id !== newStock.id);
return [newStock, ...filtered];
}
@@ -163,11 +168,15 @@
pageSize: props.pageSize,
pageNo: page,
keyword: keyword,
+ status: props.status,
izActive: props.izActive,
+ delFlag: props.delFlag,
+ izScan: props.izScan,
},
});
const records = res.records || [];
+ console.log('res', records)
if (page === 1 || isSearch) {
// 第一页或搜索时,重置数据
@@ -175,9 +184,7 @@
Options.value = records;
} else {
// 滚动加载时,追加数据(确保不重复)
- const newRecords = records.filter(record =>
- !allStocks.value.some(Stock => Stock.id === record.id)
- );
+ const newRecords = records.filter((record) => !allStocks.value.some((Stock) => Stock.id === record.id));
allStocks.value = [...allStocks.value, ...newRecords];
Options.value = [...Options.value, ...newRecords];
}
@@ -296,6 +303,7 @@
const returnValue = getReturnValue(value);
emit('update:value', returnValue);
emit('change', returnValue);
+ console.log('值变化:', returnValue);
}
/**
diff --git a/src/views/inventory/InventoryList.vue b/src/views/inventory/InventoryList.vue
index 67b5716..85d12e1 100644
--- a/src/views/inventory/InventoryList.vue
+++ b/src/views/inventory/InventoryList.vue
@@ -13,7 +13,7 @@
库位
-
+
diff --git a/src/views/inventoryLog/InventoryLog.data.ts b/src/views/inventoryLog/InventoryLog.data.ts
index 3c219c6..e1d4874 100644
--- a/src/views/inventoryLog/InventoryLog.data.ts
+++ b/src/views/inventoryLog/InventoryLog.data.ts
@@ -7,6 +7,12 @@ export const columns: BasicColumn[] = [
dataIndex: 'logType_dictText',
width: 100,
},
+ {
+ title: '业务单号',
+ align: 'center',
+ dataIndex: 'businessNo',
+ width: 130,
+ },
{
title: '物料',
align: 'center',
@@ -17,19 +23,19 @@ export const columns: BasicColumn[] = [
title: '原库位',
align: 'center',
dataIndex: 'fromPointId_dictText',
- width: 120,
+ width: 100,
},
{
title: '目标库位',
align: 'center',
dataIndex: 'toPointId_dictText',
- width: 120,
+ width: 100,
},
{
title: '容器',
align: 'center',
dataIndex: 'stockId_dictText',
- width: 120,
+ width: 100,
},
{
title: '变动前数量',
@@ -50,15 +56,36 @@ export const columns: BasicColumn[] = [
width: 100,
},
{
- title: '变动前分配数量',
+ title: '分配前数量',
align: 'center',
dataIndex: 'beforeAllocatedQty',
- width: 120,
+ width: 100,
},
{
- title: '变动后分配数量',
+ title: '分配数量',
+ align: 'center',
+ dataIndex: 'allocatedQty',
+ width: 100,
+ customRender: ({ record }) => {
+ // 从记录中获取分配前和分配后的数量
+ const before = record.beforeAllocatedQty || 0;
+ const after = record.afterAllocatedQty || 0;
+ if(record.logType_dictText==='分配'){
+ if(before>0){
+ return after - before;
+ }
+ return before + after;
+ }else if(record.logType_dictText==='取消分配'){
+ return before - after;
+ }else {
+ return 0;
+ }
+ }
+ },
+ {
+ title: '分配后数量',
align: 'center',
dataIndex: 'afterAllocatedQty',
- width: 120,
+ width: 100,
}
];
diff --git a/src/views/receive/asn/components/scanTray/ScanTrayForm.vue b/src/views/receive/asn/components/scanTray/ScanTrayForm.vue
index 436047c..d86c945 100644
--- a/src/views/receive/asn/components/scanTray/ScanTrayForm.vue
+++ b/src/views/receive/asn/components/scanTray/ScanTrayForm.vue
@@ -6,12 +6,7 @@
-
+
@@ -38,6 +33,7 @@
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
import { JSearchSelect } from '@/components/Form';
import { scanTray } from '@/views/conveyorLine/ConveyorLine.api';
+ import StockSelect from '@/views/base/stock/components/StockSelect.vue';
const props = defineProps({
formDisabled: { type: Boolean, default: false },
diff --git a/src/views/shipping/Pick.api.ts b/src/views/shipping/Pick.api.ts
index cb13856..2c21d81 100644
--- a/src/views/shipping/Pick.api.ts
+++ b/src/views/shipping/Pick.api.ts
@@ -16,6 +16,7 @@ enum Api {
queryTaskByMainId = '/shipping/pick/queryTaskByMainId',
allocatePick = '/shipping/pick/allocatePick',
cancelAllocate = '/shipping/pick/cancelAllocate',
+ pickTask = '/shipping/pick/pickTask',
}
/**
@@ -123,3 +124,13 @@ export const cancelAllocate = (ids,handleSuccess) => {
handleSuccess();
});
};
+
+/**
+ * 出库单拣货
+ * @param params
+ */
+export const pickTask = (ids,handleSuccess) => {
+ return defHttp.get({ url: Api.pickTask, params: { ids } }, { joinParamsToUrl: true }).then(() => {
+ handleSuccess();
+ });
+};
diff --git a/src/views/shipping/PickList.vue b/src/views/shipping/PickList.vue
index d74c87c..e39af35 100644
--- a/src/views/shipping/PickList.vue
+++ b/src/views/shipping/PickList.vue
@@ -37,9 +37,9 @@
-
+
状态
-
+
@@ -53,22 +53,34 @@
- 分配
+ 批量分配
取消分配
+
+ 批量拣货
+
导出
导入
@@ -107,15 +119,17 @@
import { useModal } from '/@/components/Modal';
import PickModal from './components/PickModal.vue';
import { columns } from './Pick.data';
- import { list, deleteOne, batchDelete, getImportUrl, getExportUrl, allocatePick, cancelAllocate } from './Pick.api';
+ import { list, deleteOne, batchDelete, getImportUrl, getExportUrl, allocatePick, cancelAllocate, pickTask } from './Pick.api';
import { useMessage } from '/@/hooks/web/useMessage';
import { getDateByPicker } from '/@/utils';
import { JInputTypeEnum } from '@/enums/cpteEnum';
import { JInput, JDictSelectTag } from '@/components/Form';
import JRangeDate from '@/components/Form/src/jeecg/components/JRangeDate.vue';
+ import JSelectMultiple from '/@/components/Form/src/jeecg/components/JSelectMultiple.vue';
const allocate_loading = ref(false);
const cancel_loading = ref(false);
+ const pick_loading = ref(false);
const fieldPickers = reactive({});
const formRef = ref();
const queryParam = reactive({});
@@ -184,10 +198,6 @@
* 分配事件
*/
async function handleAllocatePick() {
- if (selectedRowKeys.value.length === 0) {
- return createMessage.error('请选择出库单');
- }
-
// 选中的数据中状态有1、2、4 返回true,否则返回false
const validStatuses = [1, 2, 4];
const allValidStatus = selectedRows.value.every((row: any) => validStatuses.includes(row.status));
@@ -214,10 +224,6 @@
* 取消分配
*/
async function handleCancelAllocate() {
- if (selectedRowKeys.value.length === 0) {
- return createMessage.error('请选择出库单');
- }
-
// 选中的数据中状态有2、3 返回true,否则返回false
const validStatuses = [2, 3];
const allValidStatus = selectedRows.value.every((row: any) => validStatuses.includes(row.status));
@@ -240,6 +246,32 @@
}
}
+ /**
+ * 拣货事件
+ */
+ async function handlePick() {
+ // 选中的数据中状态有1、2、4 返回true,否则返回false
+ const validStatuses = [2, 3, 4];
+ const allValidStatus = selectedRows.value.every((row: any) => validStatuses.includes(row.status));
+ if (!allValidStatus) {
+ return createMessage.error('【部分分配、已分配、部分拣货】状态的出库单才允许拣货');
+ }
+ if (pick_loading.value) {
+ return;
+ }
+ // 设置加载状态,防止重复提交
+ pick_loading.value = true;
+ try {
+ await pickTask(selectedRowKeys.value, handleSuccess);
+ } catch (e) {
+ console.error('拣货失败:', e);
+ handleSuccess();
+ } finally {
+ // 重置加载状态
+ pick_loading.value = false;
+ }
+ }
+
/**
* 编辑事件
*/