|
|
@@ -1,68 +1,38 @@
|
|
|
<template>
|
|
|
<div style="padding: 0 10px;">
|
|
|
- <Navbar :title="'选择库存生成物料盘点详情'" :is-go-back="false" />
|
|
|
+ <Navbar :title="'选择工装设备生成盘点详情'" :is-go-back="false" />
|
|
|
<div class="action-buttons">
|
|
|
<a-button type="primary" @click="searchDatas">搜索</a-button>
|
|
|
<a-button type="dashed" @click="generateCheckVouchs">生成盘点明细</a-button>
|
|
|
- <a-button danger @click="isAll = 'true'">清空</a-button>
|
|
|
- </div>
|
|
|
- <div v-if="setPositions.length > 0" class="selected-positions">
|
|
|
- <a-tag v-for="(data, index) in setPositions" :key="index" closable @close="setPosition2(index)">
|
|
|
- {{ data.positionBarCode }}
|
|
|
- </a-tag>
|
|
|
+ <a-button danger @click="clear">清空</a-button>
|
|
|
</div>
|
|
|
<div style="display: flex; gap: 10px;">
|
|
|
<div style="width: 26%;">
|
|
|
<div class="filter-section">
|
|
|
- <a-form layout="inline">
|
|
|
- <a-form-item label="盘点范围">
|
|
|
- <a-select v-model:value="isAll" style="width: 200px">
|
|
|
- <a-select-option value="true">仓库全部物料</a-select-option>
|
|
|
- <a-select-option value="false">根据条件选择生成</a-select-option>
|
|
|
- </a-select>
|
|
|
- </a-form-item>
|
|
|
- </a-form>
|
|
|
- <div v-show="isAll === 'false'" class="category-panel">
|
|
|
- <div>
|
|
|
- <div class="panel-header" @click="toggleNamePanel">
|
|
|
- <DownOutlined v-show="!namePanelVisible" />
|
|
|
- <RightOutlined v-show="namePanelVisible" />
|
|
|
- <span style="margin-left: 5px;">物料类别名称、编号</span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div v-show="!namePanelVisible">
|
|
|
- <div class="m-tree">
|
|
|
- <TreeViewNode
|
|
|
- v-for="data in inventoryClasses" :key="data.id" :node="data" :is-root="true"
|
|
|
- :is-show-check="true" @node-select="inventoryClassSelect"
|
|
|
- />
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div v-show="isAll === 'false'" class="position-panel">
|
|
|
- <div>
|
|
|
- <div class="panel-header" @click="togglePanel">
|
|
|
- <DownOutlined v-show="!panelVisible" />
|
|
|
- <RightOutlined v-show="panelVisible" />
|
|
|
- <span style="margin-left: 5px;">货位</span>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div v-show="!panelVisible">
|
|
|
- <a-input v-model:value="positionCondition" placeholder="输入货位条形码(回车查询)" @keyup.enter="searchPosition" />
|
|
|
- <CommonTable
|
|
|
- ref="tableRef2" :columns="positionColumns" :data-source="showPositions" :is-select="true"
|
|
|
- :extra-height="440" @get-pager="getPositionPagerParams" @get-selected="getPositionSelected"
|
|
|
- />
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ <div class="category-panel">
|
|
|
+ <a-form layout="horizontal" :model="formState">
|
|
|
+ <a-form-item label="名称">
|
|
|
+ <a-input v-model:value="formState.inventoryName" placeholder="请输入名称" @keyup.enter="getCurrentStock" />
|
|
|
+ </a-form-item>
|
|
|
+ <a-form-item label="编号">
|
|
|
+ <a-input v-model:value="formState.inventoryNo" placeholder="请输入编号" @keyup.enter="getCurrentStock" />
|
|
|
+ </a-form-item>
|
|
|
+ <a-form-item label="类型">
|
|
|
+ <a-select v-model:value="formState.inventoryType" placeholder="请选择类型" @change="getCurrentStock">
|
|
|
+ <a-select-option :value="undefined">全部工装设备</a-select-option>
|
|
|
+ <a-select-option value="Clamp">工装</a-select-option>
|
|
|
+ <a-select-option value="Instrument">设备</a-select-option>
|
|
|
+ <a-select-option value="FinishProduct">成品</a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-form>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div style="width: 74%;margin:10px 0 0 10px;">
|
|
|
<CommonTable
|
|
|
ref="tableRef" :columns="currentStockColumns" :data-source="currentStocks"
|
|
|
- :total="pagination.total" :is-custom-row-click="true" @get-pager="getPagerParams"
|
|
|
- @custom-row-click="openWindow"
|
|
|
+ :total="currentStocks.length" :is-custom-row-click="true" @custom-row-click="openWindow"
|
|
|
>
|
|
|
<template #bodyCell="{ column, index }">
|
|
|
<span v-if="column.dataIndex === 'index'">
|
|
|
@@ -100,54 +70,34 @@ export default {
|
|
|
pageSize: 10,
|
|
|
current: 1,
|
|
|
},
|
|
|
- isAll: 'true',
|
|
|
isCurrentStock: true,
|
|
|
uuid: Uuid.createUUID(),
|
|
|
- showPositions: [],
|
|
|
- setPositions: [],
|
|
|
- positionSelectedIds: [],
|
|
|
- positionPagination: {
|
|
|
- total: 0,
|
|
|
- current: 1,
|
|
|
- pageSize: 10,
|
|
|
- },
|
|
|
- positionCondition: '',
|
|
|
loading: false,
|
|
|
panelVisible: true,
|
|
|
namePanelVisible: true,
|
|
|
+ formState: {
|
|
|
+ inventoryName: '',
|
|
|
+ inventoryNo: '',
|
|
|
+ inventoryType: undefined,
|
|
|
+ },
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
- positionColumns() {
|
|
|
- return [
|
|
|
- {
|
|
|
- title: '货位条形码',
|
|
|
- dataIndex: 'positionBarCode',
|
|
|
- width: 80,
|
|
|
- },
|
|
|
- ];
|
|
|
- },
|
|
|
currentStockColumns() {
|
|
|
return [
|
|
|
{ title: '序号', dataIndex: 'index', width: 50 },
|
|
|
- { title: '存货编码', dataIndex: 'inventoryNo', width: 100 },
|
|
|
- { title: '存货名称', dataIndex: 'inventoryName', width: 140 },
|
|
|
- { title: '规格型号', dataIndex: 'inventoryType', width: 140 },
|
|
|
- { title: '数量', dataIndex: 'quantity', width: 140 },
|
|
|
- { title: '存货分类', dataIndex: 'inventoryCategoryName', width: 140 },
|
|
|
- { title: '货位名称', dataIndex: 'positionName', width: 100 },
|
|
|
- { title: '货位编号', dataIndex: 'positionNo', width: 100 },
|
|
|
- { title: '货位条形码', dataIndex: 'positionBarCode', width: 100 },
|
|
|
- ];
|
|
|
- },
|
|
|
- },
|
|
|
- watch: {
|
|
|
- isAll: function () {
|
|
|
- if (this.isAll === 'true') {
|
|
|
- this.clear();
|
|
|
- }
|
|
|
+ { title: '名称', dataIndex: 'inventoryName', width: 100 },
|
|
|
+ { title: '编号', dataIndex: 'inventoryNo', width: 100 },
|
|
|
+ { title: '类型', dataIndex: 'inventoryType', width: 140 },
|
|
|
+ { title: '默认货位', dataIndex: 'inventoryPosition', width: 140 },
|
|
|
+ { title: '实际货位', dataIndex: 'inventoryActulPosition', width: 140 },
|
|
|
+ { title: '所在仓库', dataIndex: 'inventoryWarehouse', width: 100 },
|
|
|
+ ].map(item => {
|
|
|
+ return { ...item, align: 'center' };
|
|
|
+ });
|
|
|
},
|
|
|
},
|
|
|
+
|
|
|
created() {
|
|
|
const _self = this;
|
|
|
const uuid = this.$route.params.uuid;
|
|
|
@@ -158,7 +108,6 @@ export default {
|
|
|
_self.checkVouchId = modelData.id;
|
|
|
_self.warehouseId = modelData.data.warehouse.id;
|
|
|
_self.warehouseName = modelData.data.warehouse.displayValue[0];
|
|
|
- _self.queryPosition();
|
|
|
}
|
|
|
},
|
|
|
errorData => {
|
|
|
@@ -167,60 +116,25 @@ export default {
|
|
|
);
|
|
|
},
|
|
|
mounted() {
|
|
|
- const _self = this;
|
|
|
- _self.getInventoryClass();
|
|
|
+ this.getCurrentStock();
|
|
|
},
|
|
|
methods: {
|
|
|
|
|
|
searchDatas() {
|
|
|
- this.$refs.tableRef.backFirstPage();
|
|
|
- },
|
|
|
-
|
|
|
- getPagerParams(page, pageSize) {
|
|
|
- this.pagination.current_page = page;
|
|
|
- this.pagination.per_page = pageSize;
|
|
|
this.getCurrentStock();
|
|
|
},
|
|
|
|
|
|
- searchPosition() {
|
|
|
- this.$refs.tableRef2.backFirstPage();
|
|
|
- },
|
|
|
-
|
|
|
- getPositionPagerParams(page, pageSize) {
|
|
|
- this.positionPagination.current = page;
|
|
|
- this.positionPagination.pageSize = pageSize;
|
|
|
- this.queryPosition();
|
|
|
- },
|
|
|
-
|
|
|
- getPositionSelected(selected) {
|
|
|
- this.positionSelectedIds = selected.selectedRowKeys;
|
|
|
- this.setPositions = selected.selectedRows;
|
|
|
- this.searchDatas();
|
|
|
- },
|
|
|
-
|
|
|
- setPosition2(index) {
|
|
|
- this.positionSelectedIds.splice(index, 1);
|
|
|
- this.setPositions.splice(index, 1);
|
|
|
- this.searchDatas();
|
|
|
- },
|
|
|
-
|
|
|
getCurrentStock() {
|
|
|
const _self = this;
|
|
|
- const inventoryClassIds = _self.getSelectedInventoryClassIds();
|
|
|
|
|
|
_self.loading = true;
|
|
|
const obj = {
|
|
|
- inventoryClassIds,
|
|
|
- positionIds: _self.positionSelectedIds,
|
|
|
- isAll: _self.isAll,
|
|
|
- warehouseId: _self.warehouseId,
|
|
|
- range: {
|
|
|
- start: (_self.pagination.current - 1) * _self.pagination.pageSize,
|
|
|
- length: _self.pagination.pageSize,
|
|
|
- },
|
|
|
+ inventoryName: _self.formState.inventoryName,
|
|
|
+ inventoryNo: _self.formState.inventoryNo,
|
|
|
+ inventoryType: _self.formState.inventoryType,
|
|
|
};
|
|
|
$.ajax({
|
|
|
- url: Common.getApiURL('CurrentStockResource/getByPositionAndCategory'),
|
|
|
+ url: Common.getApiURL('InventoryResource/checkVouchFindInventoryByCondition'),
|
|
|
type: 'post',
|
|
|
dataType: 'json',
|
|
|
contentType: 'application/json',
|
|
|
@@ -231,7 +145,6 @@ export default {
|
|
|
success: data => {
|
|
|
if (data.errorCode === 0) {
|
|
|
_self.currentStocks = data.datas;
|
|
|
- _self.pagination.total = data.total;
|
|
|
} else {
|
|
|
message.warning(data.errorMessage);
|
|
|
}
|
|
|
@@ -244,135 +157,12 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
|
|
|
- getInventoryClass() {
|
|
|
- const _self = this;
|
|
|
- $.ajax({
|
|
|
- url: Common.getApiURL('InventoryClassResource/findByTree'),
|
|
|
- type: 'get',
|
|
|
- dataType: 'json',
|
|
|
- beforeSend: request => {
|
|
|
- Common.addTokenToRequest(request);
|
|
|
- },
|
|
|
- success: data => {
|
|
|
- if (data.errorCode === 0) {
|
|
|
- _self.initInventoryClass(data.datas);
|
|
|
- _self.inventoryClasses = data.datas;
|
|
|
- } else {
|
|
|
- message.warning(data.errorMessage);
|
|
|
- }
|
|
|
- },
|
|
|
- error: (XMLHttpRequest, textStatus, errorThrown) => {
|
|
|
- Common.processException(XMLHttpRequest, textStatus, errorThrown);
|
|
|
- },
|
|
|
- });
|
|
|
- },
|
|
|
- initInventoryClass(data) {
|
|
|
- const _self = this;
|
|
|
- function setOpen(node) {
|
|
|
- node.open = false;
|
|
|
- node.selected = false;
|
|
|
- node.isShowCheck = true;
|
|
|
- node.text = node.name + ',' + node.no;
|
|
|
- if (node.childrenDatas && node.childrenDatas.length > 0) {
|
|
|
- node.childrenDatas.forEach(item => {
|
|
|
- setOpen(item);
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- if (data) {
|
|
|
- data.forEach(item => {
|
|
|
- setOpen(item);
|
|
|
- });
|
|
|
- }
|
|
|
- },
|
|
|
- inventoryClassSelect(node) {
|
|
|
- const _self = this;
|
|
|
- node.selected = !node.selected;
|
|
|
- const current = node.selected;
|
|
|
- function changeSelect(item) {
|
|
|
- item.selected = current;
|
|
|
- if (item.childrenDatas && item.childrenDatas.length > 0) {
|
|
|
- item.childrenDatas.forEach(item1 => {
|
|
|
- changeSelect(item1);
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- changeSelect(node);
|
|
|
- _self.searchDatas();
|
|
|
- },
|
|
|
- getSelectedInventoryClassIds() {
|
|
|
- const _self = this;
|
|
|
- const arr = [];
|
|
|
- function getSelected(item) {
|
|
|
- if (!item.isClient && item.selected) {
|
|
|
- arr.push(item.id);
|
|
|
- }
|
|
|
- if (item.childrenDatas && item.childrenDatas.length > 0) {
|
|
|
- item.childrenDatas.forEach(item1 => {
|
|
|
- getSelected(item1);
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- _self.inventoryClasses.forEach(item => {
|
|
|
- getSelected(item);
|
|
|
- });
|
|
|
- return arr;
|
|
|
- },
|
|
|
- queryPosition() {
|
|
|
- const _self = this;
|
|
|
- const param = {
|
|
|
- id: _self.warehouseId,
|
|
|
- condition: _self.positionCondition.trim(),
|
|
|
- range: {
|
|
|
- start: (_self.positionPagination.current - 1) * _self.positionPagination.pageSize,
|
|
|
- length: _self.positionPagination.pageSize,
|
|
|
- },
|
|
|
- };
|
|
|
- _self.showPositions = [];
|
|
|
- _self.loading = true;
|
|
|
- $.ajax({
|
|
|
- url: Common.getApiURL('positionResource/findByWarehouseAndRange'),
|
|
|
- type: 'post',
|
|
|
- dataType: 'json',
|
|
|
- contentType: 'application/json',
|
|
|
- data: JSON.stringify(param),
|
|
|
- beforeSend: request => {
|
|
|
- Common.addTokenToRequest(request);
|
|
|
- },
|
|
|
- success: data => {
|
|
|
- if (data.errorCode === 0) {
|
|
|
- if (data.datas && data.datas.length > 0) {
|
|
|
- data.datas.forEach(item => {
|
|
|
- const showPosition = {
|
|
|
- id: item.positionId,
|
|
|
- positionName: item.positionName,
|
|
|
- positionNo: item.positionNo,
|
|
|
- positionBarCode: item.positionBarCode,
|
|
|
- check: false,
|
|
|
- };
|
|
|
- _self.showPositions.push(showPosition);
|
|
|
- });
|
|
|
- }
|
|
|
- _self.positionPagination.total = data.total;
|
|
|
- } else {
|
|
|
- message.warning(data.errorMessage);
|
|
|
- }
|
|
|
- _self.loading = false;
|
|
|
- },
|
|
|
- error: (XMLHttpRequest, textStatus, errorThrown) => {
|
|
|
- _self.loading = false;
|
|
|
- Common.processException(XMLHttpRequest, textStatus, errorThrown);
|
|
|
- },
|
|
|
- });
|
|
|
- _self.searchDatas();
|
|
|
- },
|
|
|
generateCheckVouchs() {
|
|
|
const _self = this;
|
|
|
- const inventoryClassIds = _self.getSelectedInventoryClassIds();
|
|
|
let information = '';
|
|
|
- if (_self.isAll === 'true') {
|
|
|
+ if (!_self.formState.inventoryType && _self.formState.inventoryName === '' && _self.formState.inventoryNo === '') {
|
|
|
information =
|
|
|
- `您确定要将仓库:${_self.warehouseName} 下的所有物料生成盘点明细`;
|
|
|
+ `您确定要将仓库:【${_self.warehouseName}】下所有物料生成盘点明细`;
|
|
|
} else {
|
|
|
information = '您确定要根据选择的过滤条件生成对应的盘点明细';
|
|
|
}
|
|
|
@@ -382,16 +172,12 @@ export default {
|
|
|
onOk() {
|
|
|
_self.loading = true;
|
|
|
const obj = {
|
|
|
- inventoryClassIds,
|
|
|
- positionIds: _self.positionSelectedIds,
|
|
|
- isAll: _self.isAll,
|
|
|
- warehouseId: _self.warehouseId,
|
|
|
checkVouchId: _self.checkVouchId,
|
|
|
- isCurrentStock: _self.isCurrentStock,
|
|
|
+ inventoryIds: _self.currentStocks.map(item => item.id),
|
|
|
};
|
|
|
$.ajax({
|
|
|
url: Common.getApiURL(
|
|
|
- 'checkVouchsResource/generateCheckVouchsForSiemensProject',
|
|
|
+ 'CheckVouchResource/generateCheckVouchsByInventorys',
|
|
|
),
|
|
|
type: 'post',
|
|
|
dataType: 'json',
|
|
|
@@ -402,7 +188,7 @@ export default {
|
|
|
},
|
|
|
success: data => {
|
|
|
if (data.errorCode === 0) {
|
|
|
- message.success('盘点明细生成成功,请返回查看。');
|
|
|
+ message.success(data.errorMessage);
|
|
|
} else {
|
|
|
message.warning(data.errorMessage);
|
|
|
}
|
|
|
@@ -418,21 +204,18 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
clear() {
|
|
|
- this.isAll = 'true';
|
|
|
- this.type = 0;
|
|
|
- this.inventoryClasses = [];
|
|
|
- this.setPositions = [];
|
|
|
- this.positionSelectedIds = [];
|
|
|
- this.positionCondition = '';
|
|
|
- this.searchPosition();
|
|
|
- this.getInventoryClass();
|
|
|
- this.checked = false;
|
|
|
- this.$refs.tableRef2.clear();
|
|
|
+ this.formState = {
|
|
|
+ inventoryName: '',
|
|
|
+ inventoryNo: '',
|
|
|
+ inventoryType: undefined,
|
|
|
+ };
|
|
|
+ this.getCurrentStock();
|
|
|
},
|
|
|
openWindow(item) {
|
|
|
- window.open(
|
|
|
- `#/desktop/window1/window-read/view/050405/0/${item.id}?currPage=1&currIndex=1&totalCount=1&uuid=${Uuid.createUUID()}`,
|
|
|
- );
|
|
|
+ console.log(item);
|
|
|
+ // window.open(
|
|
|
+ // `#/desktop/window1/window-read/view/050405/0/${item.id}?currPage=1&currIndex=1&totalCount=1&uuid=${Uuid.createUUID()}`,
|
|
|
+ // );
|
|
|
},
|
|
|
togglePanel() {
|
|
|
this.panelVisible = !this.panelVisible;
|
|
|
@@ -485,4 +268,11 @@ export default {
|
|
|
justify-content: space-between;
|
|
|
align-items: center;
|
|
|
}
|
|
|
+:deep(.ant-form-item){
|
|
|
+ margin-bottom: 10px !important;
|
|
|
+}
|
|
|
+:deep(.ant-form-item-label > label) {
|
|
|
+ font-size: 14px !important;
|
|
|
+ font-weight: 600 !important;
|
|
|
+}
|
|
|
</style>
|