| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606 |
- <template>
- <div class="container-fluid">
- <Navbar
- title="库存查询"
- :is-go-back="false"
- />
-
- <div
- class="flex-container"
- style="margin-top: 10px;"
- >
- <div class="flex-header">
- <div>
- <div
- class="form-inline"
- role="form"
- >
- <div class="form-group">
- SKU:
- <input
- v-model="queryNo"
- autocomplete="off"
- type="text"
- class="form-control"
- placeholder="请输入要查询物料的SKU"
- aria-describedby="basic-addon"
- style="width:250px;"
- @keyup.enter="queryInventory"
- />
- 物料名称:
- <input
- v-model="queryName"
- autocomplete="off"
- type="text"
- class="form-control"
- placeholder="请输入要查询物料的名称"
- aria-describedby="basic-addon"
- style="width:250px;"
- @keyup.enter="queryInventory"
- />
- 规格型号:
- <input
- v-model="queryType"
- autocomplete="off"
- type="text"
- class="form-control"
- placeholder="请输入要查询物料的规格型号"
- aria-describedby="basic-addon"
- style="width:250px;"
- @keyup.enter="queryInventory"
- />
- 物料类型:
- <select
- v-model="selectType"
- class="form-control"
- @change="changeSelectType"
- >
- <option value="0">全部</option>
- <option value="001">成套工具箱</option>
- <option value="002">散件</option>
- </select>
- </div>
- <div class="form-group">
- <button
- class="btn btn-default"
- @click="queryInventory"
- >
- 查询
- </button>
- </div>
- <div class="form-group">
- <button
- class="btn btn-success"
- @click="exportExcel"
- >
- 导出
- </button>
- </div>
- </div>
- </div>
- </div>
- <div
- class="flex-content"
- style="margin-top: 10px;"
- >
- <table class="fixed-table table-striped table-bordered">
- <thead>
- <tr>
- <th style="width: 50px;">
- 序号
- </th>
- <th style="width: 70px;">
- 图片
- </th>
- <th style="width: 150px;">
- 物料名称
- </th>
- <th style="width: 100px;">
- SKU
- </th>
- <th style="width: 150px;">
- 规格型号
- </th>
- <th style="width: 80px;">
- 入库总数量
- </th>
- <th style="width: 80px;">
- 库存数量
- </th>
- <th style="width: 80px;">
- 出库总数量
- </th>
- <th style="width: 80px;">
- RFID管理
- </th>
- <th style="width: 80px;">
- 物料类型
- </th>
- <th style="width: 100px;">
- 操作
- </th>
- </tr>
- </thead>
- <tbody class="table1">
- <tr v-for="(inventoryInstance, index) in inventoryInstanceDatas" :key="inventoryInstance.id">
- <td>
- {{ index + 1 + (pagination.current_page-1) * pagination.per_page }}
- </td>
- <td>
- <img
- :src="Common.getThumbnailImageSrc(className, inventoryInstance.imageName)"
- class="image"
- @click="$refs.imagePreview.preview(className, inventoryInstance.imageName)"
- />
- </td>
- <td>
- {{ inventoryInstance.inventoryName }}
- </td>
- <td>
- {{ inventoryInstance.inventoryNo }}
- </td>
- <td>
- {{ inventoryInstance.inventoryType }}
- </td>
- <td>
- {{ inventoryInstance.totalQuantity }}
- </td>
- <td>
- {{ inventoryInstance.stockQuantity }}
- </td>
- <td>
- {{ inventoryInstance.stockOutQuantity }}
- </td>
- <td>
- {{ inventoryInstance.rfidManagement == true ? '是':'否' }}
- </td>
- <td>
- {{ inventoryInstance.tagNo == '001' ? '成套工具箱':'散件' }}
- </td>
- <td>
- <button
- type="button"
- class="btn btn-link"
- style="width: 100%"
- @click="findByInventoryId(inventoryInstance)"
- >
- 查看详情
- </button>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <div class="flex-footer">
- <div>
- <div class="form-group">
- <div class="pull-left">
- 共查询到<b>{{ pagination.total }}</b>条数据
- </div>
- <div class="pull-right">
- <VueBootstrapPagination
- v-if="pagination.last_page > 0"
- :pagination="pagination"
- :callback="queryInventory"
- />
- </div>
- </div>
- </div>
- </div>
- </div>
- <Modal
- v-model:show="modal"
- small="true"
- :show-canel-button="true"
- :show-ok-button="false"
- >
- <template #header>
- <p>{{ displayData.inventoryNo }}-{{ displayData.inventoryName }}>>库存详情</p>
- </template>
- <table class="fixed-table table-striped table-bordered">
- <thead>
- <tr>
- <th style="width: 100px;">
- 序号
- </th>
- <th style="width: 150px;">
- 物料编码
- </th>
- <th style="width: 150px;">
- 物料名称
- </th>
- <th style="width: 150px;">
- 状态
- </th>
- <th style="width: 100px;">
- 货位
- </th>
- <th style="width: 100px;">
- 项目事件
- </th>
- <th style="width: 100px;">
- 齐套情况
- </th>
- </tr>
- </thead>
- <tbody class="table1">
- <tr v-for="(data, index) in inventoryInstanceCurrentStocks" :key="data.id">
- <td>
- {{ index+1 }}
- </td>
- <td>
- {{ data.no }}
- </td>
- <td>
- {{ data.name }}
- </td>
- <td>
- {{ (data.positionId == undefined || data.positionId == null)? '已出库':'在库' }}
- </td>
- <td>
- {{ data.positionBarCode }}
- </td>
- <td>
- {{ data.projectItem }}
- </td>
- <td>
- {{ data.finished == false ? '未补齐':'已补齐' }}
- </td>
- </tr>
- </tbody>
- </table>
- <div class="modal-footer">
- <slot name="footer" />
- </div>
- </Modal>
- <Modal
- v-model:show="modal2"
- small="true"
- :show-canel-button="true"
- :show-ok-button="false"
- >
- <template #header>
- <p>{{ displayData.inventoryNo }}-{{ displayData.inventoryName }}>>库存详情</p>
- </template>
- <table class="fixed-table table-striped table-bordered">
- <thead>
- <tr>
- <th style="width: 100px;">
- 序号
- </th>
- <th style="width: 150px;">
- 所在成套工具箱
- </th>
- <th style="width: 150px;">
- 数量
- </th>
- <th style="width: 150px;">
- 货位
- </th>
- <th style="width: 150px;">
- 项目事件
- </th>
- </tr>
- </thead>
- <tbody class="table1">
- <tr v-for="(data, index) in inventoryInstanceCurrentStocks2" :key="data.id">
- <td>
- {{ index+1 }}
- </td>
- <td>
- {{ data.no }}
- </td>
- <td>
- {{ data.quantity }}
- </td>
- <td>
- {{ data.positionBarCode }}
- </td>
- <td>
- {{ data.projectItem }}
- </td>
- </tr>
- </tbody>
- </table>
- <div class="modal-footer">
- <slot name="footer" />
- </div>
- </Modal>
- <Modal
- v-model:show="modal3"
- :full="true"
- :show-canel-button="true"
- :show-ok-button="false"
- >
- <template #header>
- <p>{{ displayData.inventoryNo }}-{{ displayData.inventoryName }}>>出入库流水</p>
- </template>
- <div class="modal-body">
- <InAndOutFlow :display-data="displayData" />
- </div>
- <div class="modal-footer">
- <slot name="footer" />
- </div>
- </Modal>
-
- <Loading v-if="loading" />
- <ImagePreview ref="imagePreview" />
- </div>
- </template>
- <script>
- import Common from '../common/Common.js';
- import InventoryInstanceResource from '../api/common/InventoryInstanceResource.js';
- import InventoryInstanceBindResource from '../api/wms/InventoryInstanceBindResource.js';
- import CurrentStockResource from '../api/wms/CurrentStockResource.js';
- import InAndOutFlow from './InAndOutFlow.vue';
- export default {
- components: {
-
- InAndOutFlow,
-
-
-
-
-
- },
- data: function () {
- this.Common = Common;
- return {
- displayData: {},
- queryNo: '',
- queryName: '',
- queryType: '',
- inventoryInstanceDatas: [],
- inventoryInstanceCurrentStocks: [],
- inventoryInstanceCurrentStocks2: [],
- inventoryInstanceCurrentStocks3: [],
- recordIds: [],
- pagination: {
- total: 0,
- per_page: Common.pageSize, // required
- current_page: 1, // required
- last_page: 0, // required
- },
- isUpdatePage: true,
- className: 'com.leanwo.prodog.model.common.Inventory',
- allRepeatPack: [], //重复打印全部的id
- printType: 0,//类型 0:采购入库打印/1:扫描入库打印
- selectType: '0',
- loading: false,
- modal: false,
- modal2: false,
- modal3: false,
- };
- },
- mounted: function () {
- var _self = this;
- _self.queryInventory();
- $('.fixed-table').tableFixer({
- 'left': 3,
- 'head': true,
- });
- $('.fixed-table').colResizable({
- resizeMode: 'overflow',
- partialRefresh: true,
- });
- },
- methods: {
- /**
- * 导出excel
- */
- exportExcel: function () {
- var _self = this;
- var loginInfo = localStorage.getItem('#LoginInfo');
- var loginData = JSON.parse(loginInfo);
- var whereClause = ' totalInventory.clientId=' + loginData.loginClientId;
- if (_self.queryNo != null && _self.queryNo.length > 0) {
- whereClause = whereClause + ' AND totalInventory.no like ' + '\'%' + _self.queryNo + '%\'';
- if (_self.queryName != null && _self.queryName.length > 0) {
- whereClause = whereClause + ' OR totalInventory.name like ' + '\'%' + _self.queryName + '%\'';
- }
- if (_self.queryType != null && _self.queryType.length > 0) {
- whereClause = whereClause + ' OR totalInventory.type like ' + '\'%' + _self.queryType + '%\'';
- }
- } else if (_self.queryName != null && _self.queryName.length > 0) {
- whereClause = whereClause + ' AND totalInventory.name like ' + '\'%' + _self.queryName + '%\'';
- if (_self.queryType != null && _self.queryType.length > 0) {
- whereClause = whereClause + ' OR totalInventory.type like ' + '\'%' + _self.queryType + '%\'';
- }
- } else if (_self.queryType != null && _self.queryType.length > 0) {
- whereClause = whereClause + ' AND totalInventory.type like ' + '\'%' + _self.queryType + '%\'';
- }
- whereClause = encodeURIComponent(whereClause);
- var url = '/ureport/preview?_u=dicfile-wms:stock.ureport.xml&whereClause=' + whereClause;
- window.open(url);
- },
- /**
- * 根据存货档案id进行查询
- */
- findByInventoryId: function (data) {
- var _self = this;
- if (data.totalQuantity == undefined || data.totalQuantity == null) {
- Notify.error('提示', '物料暂无入库记录', false);
- return;
- }
- var inventoryId = data.inventoryId;
- var tagNo = data.tagNo;
- var rfidManagement = data.rfidManagement;
- _self.displayData = data;
- if (rfidManagement == true) {
- if (tagNo == undefined || tagNo == null || tagNo == '002') {
- InventoryInstanceResource.findCurrentStockByInventoryId(inventoryId).then(successData => {
- if(successData.errorCode == 0) {
- if (successData.datas && successData.datas.length > 0) {
- _self.inventoryInstanceCurrentStocks2 = successData.datas;
- _self.modal2 = true;
- }
- } else {
- Notify.error('错误', successData.errorMessage, false);
- return;
- }
- }, errorData => {
- Common.processException(errorData);
- });
- } else {
- InventoryInstanceBindResource.findByInventoryId(inventoryId).then(successData => {
- if(successData.errorCode == 0) {
- if (successData.datas) {
- _self.inventoryInstanceCurrentStocks = successData.datas;
- _self.modal = true;
- }
- }
- }, errorData => {
- Common.processException(errorData);
- });
- }
- } else {
- _self.modal3 = true;
- }
- },
- changeSelectType: function () {
- var _self = this;
- _self.pagination.current_page = 1;
- _self.queryInventory();
- },
- /**
- * 根据物料名称或者编号查询数据
- */
- queryInventory: function () {
- var _self = this;
- if (_self.inventoryInstanceDatas == undefined) {
- _self.inventoryInstanceDatas = [];
- }
- var queryNo = $.trim(_self.queryNo);
- var queryName = $.trim(_self.queryName);
- var queryType = $.trim(_self.queryType);
- if ((queryNo.length > 0 || queryName.length > 0 || queryType.length > 0) && !_self.isUpdatePage) {
- _self.pagination.current_page = 1;
- _self.isUpdatePage = true;
- } else if (queryNo.length == 0 && queryName.length == 0 && queryType.length == 0) {
- _self.isUpdatePage = false;
- }
- _self.inventoryInstanceDatas.splice(0, _self.inventoryInstanceDatas.length);
- var inventoryQueryCondition = {
- 'no': queryNo,
- 'name': queryName,
- 'type': queryType,
- 'start': (_self.pagination.current_page - 1) * _self.pagination.per_page,
- 'length': _self.pagination.per_page,
- };
- _self.loading=true;
- CurrentStockResource.findSiemensCurrentStock(inventoryQueryCondition, _self.selectType).then(successData => {
- _self.loading=false;
- if(successData.errorCode == 0) {
- if (successData.datas) {
- _self.inventoryInstanceDatas = successData.datas;
- _self.pagination.total = successData.total;
- _self.pagination.last_page = Math.ceil(_self.pagination.total / _self.pagination.per_page);
- }
- _self.fixedTableHeader();
- }
- }, errorData => {
- _self.loading=false;
- Common.processException(errorData);
- });
- },
- /**
- * 冻结表头
- */
- fixedTableHeader: function () {
- let _self = this;
- _self.$nextTick(function () {
- $('.fixed-table').tableFixer({
- 'left': 3,
- 'head': true,
- });
- });
- },
- },
- };
- </script>
- <style scoped>
- .flex-container {
- display: flex;
- /* 垂直*/
- flex-direction: column;
- width: 100%;
- /*视口被均分为100单位的vh 占据整个窗口,扣掉顶部topNav的距离后,计算得到container的高度*/
- height: calc(100vh - 140px);
- }
- .flex-header {
- /*放大缩小比例为0 */
- flex: 0 0 35px;
- }
- .flex-footer {
- height: 45px;
- /*放大缩小比例为0 */
- flex: 0 0 45px;
- }
- .flex-content {
- flex: 1;
- overflow: scroll;
- width: 100%;
- }
- .fixed-table {
- table-layout: fixed;
- word-wrap: break-word;
- word-break: break-all;
- }
- </style>
- <style scoped>
- .fixed-table {
- table-layout: fixed;
- width: 800px !important;
- min-width: 800px !important;
- }
- table.fixed-table tr {
- height: 40px;
- }
- table.fixed-table th,
- table.fixed-table td {
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
- .image {
- width: 40px;
- height: 40px;
- }
- .modal-img-box {
- width: 100%;
- text-align: center;
- overflow: auto;
- }
- .m-img {
- width: 100%;
- }
- </style>
|