|
@@ -158,18 +158,21 @@
|
|
|
<order-list ref="orderListRef" @refresh="refreshList" />
|
|
<order-list ref="orderListRef" @refresh="refreshList" />
|
|
|
<borrow-list ref="borrowListRef" />
|
|
<borrow-list ref="borrowListRef" />
|
|
|
<picking-list ref="pickingListRef" />
|
|
<picking-list ref="pickingListRef" />
|
|
|
|
|
+ <stock-ledger-dialog ref="stockLedgerDialogRef" />
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
import {
|
|
import {
|
|
|
getRequirementListPlanDetail,
|
|
getRequirementListPlanDetail,
|
|
|
- getRequirementListPlanDetailPage
|
|
|
|
|
|
|
+ getRequirementListPlanDetailPage,
|
|
|
|
|
+ getStockLedger
|
|
|
} from '@/api/requirementListPlan';
|
|
} from '@/api/requirementListPlan';
|
|
|
|
|
|
|
|
import orderList from './components/orderList.vue';
|
|
import orderList from './components/orderList.vue';
|
|
|
import borrowList from './components/borrowList.vue';
|
|
import borrowList from './components/borrowList.vue';
|
|
|
import pickingList from './components/pickingList.vue';
|
|
import pickingList from './components/pickingList.vue';
|
|
|
|
|
+ import stockLedgerDialog from './components/stockLedgerDialog.vue';
|
|
|
import PageHeader from '@/components/PageHeader';
|
|
import PageHeader from '@/components/PageHeader';
|
|
|
|
|
|
|
|
const COMPONENT_ATTRIBUTE_MAP = {
|
|
const COMPONENT_ATTRIBUTE_MAP = {
|
|
@@ -193,7 +196,13 @@
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
- components: { orderList, borrowList, pickingList, PageHeader },
|
|
|
|
|
|
|
+ components: {
|
|
|
|
|
+ orderList,
|
|
|
|
|
+ borrowList,
|
|
|
|
|
+ pickingList,
|
|
|
|
|
+ stockLedgerDialog,
|
|
|
|
|
+ PageHeader
|
|
|
|
|
+ },
|
|
|
|
|
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
@@ -205,6 +214,7 @@
|
|
|
tableHeight: 'calc(100vh - 595px)',
|
|
tableHeight: 'calc(100vh - 595px)',
|
|
|
detailList: [],
|
|
detailList: [],
|
|
|
selection: [],
|
|
selection: [],
|
|
|
|
|
+ searchWhere: {},
|
|
|
|
|
|
|
|
componentAttributeMap: COMPONENT_ATTRIBUTE_MAP,
|
|
componentAttributeMap: COMPONENT_ATTRIBUTE_MAP,
|
|
|
attributeTypeMap: ATTRIBUTE_TYPE_MAP,
|
|
attributeTypeMap: ATTRIBUTE_TYPE_MAP,
|
|
@@ -459,6 +469,7 @@
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
async datasource({ page, limit, where }) {
|
|
async datasource({ page, limit, where }) {
|
|
|
|
|
+ this.searchWhere = where || {};
|
|
|
const res = await getRequirementListPlanDetailPage({
|
|
const res = await getRequirementListPlanDetailPage({
|
|
|
...where,
|
|
...where,
|
|
|
pageNum: page,
|
|
pageNum: page,
|
|
@@ -526,7 +537,45 @@
|
|
|
this.$refs.borrowListRef.open(this.form);
|
|
this.$refs.borrowListRef.open(this.form);
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
- inventoryQuery() {},
|
|
|
|
|
|
|
+ async inventoryQuery() {
|
|
|
|
|
+ const loading = this.$loading({
|
|
|
|
|
+ lock: true,
|
|
|
|
|
+ fullscreen: true,
|
|
|
|
|
+ text: '库存查询中...'
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ const res = await getRequirementListPlanDetailPage({
|
|
|
|
|
+ ...this.searchWhere,
|
|
|
|
|
+ pageNum: 1,
|
|
|
|
|
+ size: -1,
|
|
|
|
|
+ materialRequirementsId: this.$route.query.id
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ const materialCodes = [
|
|
|
|
|
+ ...new Set(
|
|
|
|
|
+ (res?.list || [])
|
|
|
|
|
+ .map((item) => item.categoryCode)
|
|
|
|
|
+ .filter(
|
|
|
|
|
+ (code) => code !== undefined && code !== null && code !== ''
|
|
|
|
|
+ )
|
|
|
|
|
+ )
|
|
|
|
|
+ ];
|
|
|
|
|
+
|
|
|
|
|
+ if (!materialCodes.length) {
|
|
|
|
|
+ this.$message.warning('暂无可查询的物料编码');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const stockList = await getStockLedger(materialCodes);
|
|
|
|
|
+ this.$refs.stockLedgerDialogRef.open(stockList || []);
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ console.error(e);
|
|
|
|
|
+ this.$message.error('库存查询失败,请稍后重试');
|
|
|
|
|
+ } finally {
|
|
|
|
|
+ loading.close();
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
|
|
|
materialReturn() {
|
|
materialReturn() {
|
|
|
if (!this.selection.length) {
|
|
if (!this.selection.length) {
|
|
@@ -574,6 +623,7 @@
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
search(where) {
|
|
search(where) {
|
|
|
|
|
+ this.searchWhere = where || {};
|
|
|
this.reload(where);
|
|
this.reload(where);
|
|
|
},
|
|
},
|
|
|
|
|
|