InventorySearchDetail.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480
  1. <template>
  2. <div class="container-fluid">
  3. <div>
  4. <div class="row">
  5. <div class="col-md-12">
  6. <h1 class="page-header" style="margin-top: 10px; margin-bottom: 0px;">
  7. <AuthImage
  8. :auth-src="Common.getThumbnailImageSrc(inventoryClassName, showInventory.imageName)" class="image img-thumbnail"
  9. style="width: 78px; height: 78px;" @click="$refs.imagePreview.preview(inventoryClassName, showInventory.imageName)"
  10. />
  11. 物料详细信息
  12. </h1>
  13. </div>
  14. </div>
  15. <div class="row" style="margin-top: 15px;">
  16. <div class="col-md-12 asset-detail">
  17. <div class="col-md-3">
  18. <div>
  19. <strong>存货编号:{{ showInventory.no }}</strong>
  20. </div>
  21. </div>
  22. <div class="col-md-3">
  23. <div>
  24. <strong>存货名称:{{ showInventory.name }}</strong>
  25. </div>
  26. </div>
  27. <div class="col-md-3">
  28. <div>
  29. <strong>所属公司:{{ showInventory.client }}</strong>
  30. </div>
  31. </div>
  32. <div class="col-md-3">
  33. <div>
  34. <strong>规格型号:{{ showInventory.type }}</strong>
  35. </div>
  36. </div>
  37. </div>
  38. </div>
  39. <div class="row">
  40. <div class="col-md-12 div-asset-info">
  41. <ul id="myTab" class="nav nav-tabs">
  42. <li class="active">
  43. <a href="#asset-content-1" data-toggle="tab">出入库流水</a>
  44. </li>
  45. <li>
  46. <a href="#asset-content-2" data-toggle="tab">库存情况</a>
  47. </li>
  48. <li>
  49. <a href="#asset-content-3" data-toggle="tab">库位信息</a>
  50. </li>
  51. </ul>
  52. <div class="tab-content div-asset-info">
  53. <div id="asset-content-1" class="tab-pane fade in active">
  54. <div class="form form-inline time-box">
  55. <InAndOutFlow ref="inAndOutFlow" />
  56. <!-- <div class="form-group">
  57. <label>开始时间</label>
  58. <DateTime v-model="startDate" class="form-control" name="datetime" />
  59. </div>
  60. <div class="form-group">
  61. <label>结束时间</label>
  62. <DateTime v-model="endDate" class="form-control" name="datetime />
  63. </div>
  64. <button type="button" class="btn btn-default" @click="getHistoryEvent2">确定</button> -->
  65. </div>
  66. <div class="row div-history-event">
  67. <div v-for="item in historyEvents2" :key="item.id" class="media col-md-12">
  68. <div class="media-left">
  69. <a href="javascript:void(0);">
  70. <AuthImage :auth-src="getHistoryIconSrc(item.title)" class="media-object media-img img-thumbnail" />
  71. </a>
  72. </div>
  73. <div class="media-body">
  74. <h4 class="media-heading">{{ item.title }}</h4>
  75. <p class="event-time">时间: {{ item.eventDate }}</p>
  76. <p>{{ item.content }}</p>
  77. </div>
  78. </div>
  79. </div>
  80. </div>
  81. <div id="asset-content-2" class="tab-pane fade in">
  82. <table class="table table-striped table-bordered">
  83. <thead>
  84. <tr height="40px">
  85. <th>仓库名称</th>
  86. <th>入库单号</th>
  87. <th>存货名称</th>
  88. <th>存货编码</th>
  89. <th>批次</th>
  90. <th>结存数量</th>
  91. </tr>
  92. </thead>
  93. <tbody>
  94. <tr v-for="stockInfo in stockInfos" :key="stockInfo.id">
  95. <td>{{ stockInfo.warehouseName }}</td>
  96. <td>{{ stockInfo.documentNo }}</td>
  97. <td>{{ stockInfo.inventoryName }}</td>
  98. <td>{{ stockInfo.inventoryNo }}</td>
  99. <td>{{ stockInfo.batchNo }}</td>
  100. <td>{{ stockInfo.quantity }}</td>
  101. </tr>
  102. </tbody>
  103. </table>
  104. </div>
  105. <div id="asset-content-3" class="tab-pane fade in">
  106. <div class="table-responsive">
  107. <table class="table table-striped table-bordered">
  108. <thead>
  109. <tr height="40px">
  110. <th>仓库名称</th>
  111. <th>入库单号</th>
  112. <th>存货名称</th>
  113. <th>存货编号</th>
  114. <th>库位名称</th>
  115. <th>库位编号</th>
  116. <th>数量</th>
  117. <th>处理人</th>
  118. <th>处理时间</th>
  119. </tr>
  120. </thead>
  121. <tbody>
  122. <tr v-for="positionInfo in positionInfos" :key="positionInfo.id">
  123. <td>{{ positionInfo.warehouseName }}</td>
  124. <td>{{ positionInfo.documentNo }}</td>
  125. <td>{{ positionInfo.inventoryName }}</td>
  126. <td>{{ positionInfo.inventoryNo }}</td>
  127. <td>{{ positionInfo.positionName }}</td>
  128. <td>{{ positionInfo.positionNo }}</td>
  129. <td>{{ positionInfo.quantity }}</td>
  130. <td>{{ positionInfo.handlerUser }}</td>
  131. <td>{{ positionInfo.handlerDate }}</td>
  132. </tr>
  133. </tbody>
  134. </table>
  135. <VueBootstrapPagination :pagination="pagination2" :callback="callbackFun" />
  136. </div>
  137. </div>
  138. </div>
  139. </div>
  140. </div>
  141. </div>
  142. <Modal v-model:show="modal" large="true" @cancel="modal = false">
  143. <template #header>
  144. 历史图片
  145. </template>
  146. <div class="row">
  147. <div class="center-block" style="width:432px;">
  148. <img :src="imageUrl" class="m-image" />
  149. </div>
  150. </div>
  151. </Modal>
  152. <Loading v-if="loading" />
  153. <ImagePreview ref="imagePreview" />
  154. </div>
  155. </template>
  156. <script>
  157. import Common from '../common/Common.js';
  158. import InAndOutFlow from '../stock/InAndOutFlow.vue';
  159. export default {
  160. components: {
  161. InAndOutFlow,
  162. },
  163. data: function() {
  164. this.Common = Common;
  165. return {
  166. pagination: {
  167. total: 0,
  168. per_page: Common.pageSize, // required
  169. current_page: 1, // required
  170. last_page: 1, // required
  171. },
  172. //历史图片分页参数
  173. pagination2: {
  174. total: 0,
  175. per_page: Common.pageSize, // required
  176. current_page: 1, // required
  177. last_page: 1, // required
  178. from: 1,
  179. to: 1, // required
  180. },
  181. condition: '',
  182. showPager: false, // 是否显示分页
  183. assetInstances: [],
  184. inventorys: [],
  185. assetClassName: 'com.leanwo.prodog.asset.model.AssetInstance',
  186. inventoryClassName: 'com.leanwo.prodog.model.common.Inventory',
  187. showAssetInstance: '',
  188. showInventory: '',
  189. activeContent: 1,
  190. imageInfos: [],
  191. imageUrl: '',
  192. historyEvents: [],
  193. assetHistoryEvents: [],
  194. historyEvents2: [],
  195. stockInfos: [],
  196. positionInfos: [],
  197. results: [],
  198. startDate: '',
  199. endDate: '',
  200. firstSearch: true,
  201. loading: false,
  202. modal: false,
  203. };
  204. },
  205. computed: {},
  206. watch: {},
  207. mounted: function() {
  208. var _self = this;
  209. $('#right-container').css('background-color', '#ffffff');
  210. var inventoryresultId = _self.$route.query.inventoryresultId;
  211. var dataId = {};
  212. dataId.inventoryId = inventoryresultId;
  213. // console.log(dataId);
  214. _self.$refs.inAndOutFlow.findByInventoryId(dataId);
  215. _self.$refs.inAndOutFlow.fixedTableHeader();
  216. _self.findInventoryById(inventoryresultId);
  217. if (_self.firstSearch) {
  218. _self.condition = localStorage.getItem('##searchStr##');
  219. _self.firstSearch = false;
  220. }
  221. },
  222. beforeUnmount: function() {
  223. $('#right-container').css('background-color', '#f7f7f7');
  224. },
  225. methods: {
  226. findInventoryById: function(inventoryresultId) {
  227. var _self = this;
  228. $.ajax({
  229. url: Common.getApiURL('InventoryResource/findInventoryById'),
  230. type: 'post',
  231. data: inventoryresultId,
  232. contentType: 'application/json',
  233. beforeSend: function(request) {
  234. Common.addTokenToRequest(request);
  235. },
  236. success: function(data) {
  237. _self.showItem2(data);
  238. },
  239. error: function(XMLHttpRequest, textStatus, errorThrown) {
  240. Common.processException(XMLHttpRequest, textStatus, errorThrown);
  241. },
  242. });
  243. },
  244. /**
  245. * 显示存货详细信息
  246. * @param {Object} inventoryresult
  247. */
  248. showItem2: function(inventoryresult) {
  249. var _self = this;
  250. _self.showInventory = inventoryresult;
  251. // 查询生命周期数据
  252. _self.getHistoryEvent2();
  253. _self.getStockInfo();
  254. },
  255. callbackFun: function() {
  256. if (this.showAssetInstance == undefined || this.showAssetInstance == '') {
  257. return;
  258. }
  259. this.showItem(this.showAssetInstance);
  260. },
  261. showImage: function(imageName) {
  262. this.imageUrl = imageName;
  263. this.modal = true;
  264. },
  265. /**
  266. * 查询存货的出入库记录
  267. */
  268. getHistoryEvent2: function() {
  269. var _self = this;
  270. $.ajax({
  271. url: Common.getApiURL('StockOutResource/getHistoryEventByInventory'),
  272. type: 'post',
  273. dataType: 'json',
  274. data: {
  275. inventoryId: _self.showInventory.id,
  276. startDate: _self.startDate,
  277. endDate: _self.endDate,
  278. },
  279. beforeSend: function(request) {
  280. Common.addTokenToRequest(request);
  281. },
  282. success: function(data) {
  283. console.log(data);
  284. _self.historyEvents2 = data;
  285. },
  286. error: function(XMLHttpRequest, textStatus, errorThrown) {
  287. Common.processException(XMLHttpRequest, textStatus, errorThrown);
  288. },
  289. });
  290. },
  291. /**
  292. * 根据inventoryId获取库存信息
  293. */
  294. getStockInfo: function() {
  295. var _self = this;
  296. $.ajax({
  297. url: Common.getApiURL('StockOutResource/getStockInfoByInventory'),
  298. type: 'GET',
  299. dataType: 'json',
  300. data: {
  301. inventoryId: _self.showInventory.id,
  302. },
  303. beforeSend: function(request) {
  304. Common.addTokenToRequest(request);
  305. },
  306. success: function(data) {
  307. console.log(data);
  308. _self.stockInfos = data;
  309. },
  310. error: function(XMLHttpRequest, textStatus, errorThrown) {
  311. Common.processException(XMLHttpRequest, textStatus, errorThrown);
  312. },
  313. });
  314. },
  315. // 获取图标
  316. getHistoryIconSrc: function(title) {
  317. var iconSrc = 'static/image/';
  318. switch (title) {
  319. case '资产盘点':
  320. iconSrc += 'inventory.png';
  321. break;
  322. case '资产归还':
  323. iconSrc += 'stockin.png';
  324. break;
  325. case '资产领用':
  326. iconSrc += 'stockout.png';
  327. break;
  328. case '资产报失':
  329. iconSrc += 'lost.png';
  330. break;
  331. case '资产报失找回':
  332. iconSrc += 'lostRetrieve.png';
  333. break;
  334. case '资产保养':
  335. iconSrc += 'maintain.png';
  336. break;
  337. case '资产维修':
  338. iconSrc += 'repair.png';
  339. break;
  340. case '资产报废':
  341. iconSrc += 'scrap.png';
  342. break;
  343. case '材料出库':
  344. iconSrc += 'stockout.png';
  345. break;
  346. case '材料入库':
  347. iconSrc += 'stockin.png';
  348. break;
  349. }
  350. return iconSrc;
  351. },
  352. },
  353. };
  354. </script>
  355. <style scoped>
  356. .table-footer-left {
  357. float: left;
  358. margin: 0px;
  359. }
  360. .image {
  361. width: 100%;
  362. }
  363. .m-img {
  364. max-width: 100%;
  365. }
  366. .box {
  367. margin-bottom: 14px;
  368. }
  369. .box-title {
  370. margin-bottom: 6px;
  371. }
  372. .a-title {
  373. text-decoration: underline;
  374. font-size: 1.2em;
  375. color: #5b3bcd;
  376. }
  377. .p-tooltip {
  378. color: #999;
  379. font-size: 12px;
  380. line-height: 42px;
  381. margin: 0px;
  382. }
  383. .asset-detail div {
  384. word-wrap: break-word;
  385. padding: 0px;
  386. }
  387. .div-asset-info {
  388. margin-top: 15px;
  389. margin-bottom: 15px;
  390. }
  391. .m-image {
  392. height: 648px;
  393. width: 432px;
  394. }
  395. .modal-img-box {
  396. text-align: center;
  397. }
  398. .div-history-event ul {
  399. list-style-type: circle;
  400. }
  401. .div-history-event li {
  402. margin-bottom: 10px;
  403. font-size: 18px;
  404. border-bottom: 1px solid #dcd6d6;
  405. }
  406. .div-history-event p {
  407. margin: 3px 0px;
  408. font-size: 14px;
  409. }
  410. .event-title {
  411. font-weight: bold;
  412. }
  413. .event-time {
  414. color: #aaa;
  415. font-size: 0.9em;
  416. }
  417. .no-padding-left {
  418. padding-left: 0px;
  419. }
  420. .media-img {
  421. width: 45px;
  422. height: 45px;
  423. }
  424. .img-thumbnail {
  425. cursor: pointer;
  426. }
  427. .time-box {
  428. margin-bottom: 15px;
  429. }
  430. </style>