|
|
@@ -53,6 +53,8 @@ export default defineComponent({
|
|
|
queryTable(qryAreaStockReport, param).then((res) => {
|
|
|
if (res.length) {
|
|
|
selectedRow.value = res[0];
|
|
|
+ } else {
|
|
|
+ changeTab(tabIndex.value)
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
@@ -80,22 +82,11 @@ export default defineComponent({
|
|
|
|
|
|
// 切换明细
|
|
|
function changeTab(index: number) {
|
|
|
- tabIndex.value = index;
|
|
|
const { code, lable } = tabList[index];
|
|
|
- const data = selectedRow.value as Ermcp3AreaStockReport;
|
|
|
- const { cycletype, deliverygoodsid, wrstandardid, spotgoodsbrandid, warehouseinfoid } = data;
|
|
|
+ tabIndex.value = index;
|
|
|
+ detailTableList.value = [];
|
|
|
+ visible.value = true;
|
|
|
|
|
|
- const param: AreaStockReportReq = {
|
|
|
- querytype: 2,
|
|
|
- cycletype,
|
|
|
- cycletime,
|
|
|
- sumfields: '1,2,3,4',
|
|
|
- deliverygoodsid,
|
|
|
- wrstandardid,
|
|
|
- spotgoodsbrandid,
|
|
|
- warehouseinfoid,
|
|
|
- userid: chaceSearchValue.value?.userid,
|
|
|
- };
|
|
|
if (code === 'inventory_report_inventory_category_brand_detail') {
|
|
|
// 品牌明细
|
|
|
// 注册表头
|
|
|
@@ -108,21 +99,28 @@ export default defineComponent({
|
|
|
console.error(`${lable}没有配置对应的code: ${code},`);
|
|
|
return;
|
|
|
}
|
|
|
- if (param.warehouseinfoid === '--') {
|
|
|
- param.warehouseinfoid = '';
|
|
|
+
|
|
|
+ if (selectedRow.value) {
|
|
|
+ const data = selectedRow.value as Ermcp3AreaStockReport;
|
|
|
+ const { cycletype, deliverygoodsid, wrstandardid, spotgoodsbrandid, warehouseinfoid } = data;
|
|
|
+ const param: AreaStockReportReq = {
|
|
|
+ querytype: 2,
|
|
|
+ cycletype,
|
|
|
+ cycletime,
|
|
|
+ sumfields: '1,2,3,4',
|
|
|
+ deliverygoodsid,
|
|
|
+ wrstandardid,
|
|
|
+ spotgoodsbrandid,
|
|
|
+ warehouseinfoid: warehouseinfoid === '--' ? '' : warehouseinfoid,
|
|
|
+ userid: chaceSearchValue.value?.userid,
|
|
|
+ };
|
|
|
+ // 查询明细数据
|
|
|
+ queryResultLoadingAndInfo(qryAreaStockReport, loading, param).then((res) => {
|
|
|
+ detailTableList.value = res;
|
|
|
+ });
|
|
|
}
|
|
|
- // 查询明细数据
|
|
|
- queryResultLoadingAndInfo(qryAreaStockReport, loading, param).then((res) => {
|
|
|
- detailTableList.value = res;
|
|
|
- });
|
|
|
}
|
|
|
- watch(selectedRow, () => {
|
|
|
- detailTableList.value = [];
|
|
|
- if (tabList.length) {
|
|
|
- visible.value = true;
|
|
|
- changeTab(tabIndex.value);
|
|
|
- }
|
|
|
- })
|
|
|
+
|
|
|
function search(value: TypeAndTime) {
|
|
|
detailTableList.value = [];
|
|
|
chaceSearchValue.value = value;
|
|
|
@@ -135,6 +133,8 @@ export default defineComponent({
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ watch(selectedRow, () => changeTab(tabIndex.value))
|
|
|
+
|
|
|
return { loading, tableList, visible, columns, updateColumn, search, columnsDetail, detailTableList, expandedRowKeys, selectedRow, Rowclick, tabList, changeTab };
|
|
|
},
|
|
|
});
|