You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

608 lines
18 KiB

4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
  1. <template>
  2. <div class="customer-css" >
  3. <!-- 查询时间和产品 -->
  4. <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;" >
  5. <el-row>
  6. <el-col :span="24" style="">
  7. <el-form-item :label="'BU:'">
  8. <el-input v-model="searchData.buNo" style="width: 130px"></el-input>
  9. </el-form-item>
  10. <el-form-item :label="'销售出库单号:'">
  11. <el-input v-model="searchData.orderNo" style="width: 130px"></el-input>
  12. </el-form-item>
  13. <el-form-item :label="'客户编号:'">
  14. <el-input v-model="searchData.customerId" style="width: 130px"></el-input>
  15. </el-form-item>
  16. <el-form-item :label="'客户名称:'">
  17. <el-input v-model="searchData.customerName" style="width: 130px"></el-input>
  18. </el-form-item>
  19. <el-form-item :label="'单据状态'">
  20. <el-select multiple collapse-tags v-model="searchData.orderStatusList" clearable style="width: 160px">
  21. <el-option label="待出库" value="待出库"></el-option>
  22. <el-option label="已出库" value="已出库"></el-option>
  23. </el-select>
  24. </el-form-item>
  25. <el-form-item :label="' '" >
  26. <el-button class="customer-bun-min" type="primary" @click="getMainData" style="">查询</el-button>
  27. <el-button @click="exportExcel()" type="primary" style="margin-left: 2px">{{'导出'}}</el-button>
  28. </el-form-item>
  29. </el-col>
  30. </el-row>
  31. </el-form>
  32. <el-table
  33. :height="height"
  34. :data="mainDataList"
  35. border
  36. ref="mainTable"
  37. highlight-current-row
  38. @row-click="changeData"
  39. v-loading="dataListLoading"
  40. style="margin-top: 0px; width: 100%;">
  41. <!-- <el-table-column-->
  42. <!-- fixed="left"-->
  43. <!-- header-align="center"-->
  44. <!-- align="center"-->
  45. <!-- width="220"-->
  46. <!-- :label="'操作'">-->
  47. <!-- <template slot-scope="scope">-->
  48. <!-- </template>-->
  49. <!-- </el-table-column>-->
  50. <el-table-column
  51. v-for="(item,index) in columnArray1" :key="index"
  52. :sortable="item.columnSortable"
  53. :prop="item.columnProp"
  54. :header-align="item.headerAlign"
  55. :show-overflow-tooltip="item.showOverflowTooltip"
  56. :align="item.align"
  57. :fixed="item.fixed==''?false:item.fixed"
  58. :min-width="item.columnWidth"
  59. :label="item.columnLabel">
  60. <template slot-scope="scope">
  61. <span v-if="!item.columnHidden"> {{scope.row[item.columnProp]}}</span>
  62. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  63. style="width: 100px; height: 80px"/></span>
  64. </template>
  65. </el-table-column>
  66. </el-table>
  67. <!-- 分页插件 -->
  68. <el-pagination style="margin-top: 0px"
  69. @size-change="sizeChangeHandle"
  70. @current-change="currentChangeHandle"
  71. :current-page="pageIndex"
  72. :page-sizes="[20, 50, 100, 200, 500]"
  73. :page-size="pageSize"
  74. :total="totalPage"
  75. layout="total, sizes, prev, pager, next, jumper">
  76. </el-pagination>
  77. <el-tabs v-model="activeName" style="margin-top: 0px; width: 99%;" @tab-click="tabClick" class="customer-tab" type="border-card">
  78. <el-tab-pane label="出库单明细" name="outboundDetail">
  79. <el-table
  80. :data="detailList"
  81. :height="height - 20"
  82. border
  83. style="width: 100%;">
  84. <el-table-column
  85. v-for="(item,index) in columnDetailList" :key="index"
  86. :sortable="item.columnSortable"
  87. :prop="item.columnProp"
  88. :header-align="item.headerAlign"
  89. :show-overflow-tooltip="item.showOverflowTooltip"
  90. :align="item.align"
  91. :fixed="item.fixed===''?false:item.fixed"
  92. :min-width="item.columnWidth"
  93. :label="item.columnLabel">
  94. <template slot-scope="scope">
  95. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  96. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  97. </template>
  98. </el-table-column>
  99. </el-table>
  100. </el-tab-pane>
  101. <el-tab-pane label="装箱清单" name="boxing" style="">
  102. <boxing ref="boxing"></boxing>
  103. </el-tab-pane>
  104. <el-tab-pane label="已扫描卷" name="rollDetail">
  105. <el-table
  106. :data="rollList"
  107. :height="height - 20"
  108. border
  109. style="width: 100%;">
  110. <el-table-column
  111. prop="orderId"
  112. header-align="center"
  113. align="center"
  114. min-width="60"
  115. label="序号">
  116. </el-table-column>
  117. <el-table-column
  118. prop="boxNo"
  119. header-align="center"
  120. align="center"
  121. min-width="100"
  122. label="箱号">
  123. </el-table-column>
  124. <el-table-column
  125. prop="finalRollNo"
  126. header-align="center"
  127. align="center"
  128. min-width="100"
  129. label="卷号">
  130. </el-table-column>
  131. <el-table-column
  132. prop="partNo"
  133. header-align="center"
  134. align="left"
  135. min-width="100"
  136. label="物料编码">
  137. </el-table-column>
  138. <el-table-column
  139. prop="rollQty"
  140. header-align="center"
  141. align="right"
  142. min-width="100"
  143. label="数量">
  144. </el-table-column>
  145. <el-table-column
  146. prop="receivedDate"
  147. header-align="center"
  148. align="center"
  149. min-width="100"
  150. label="装箱日期">
  151. </el-table-column>
  152. <el-table-column
  153. prop="receivedBy"
  154. header-align="center"
  155. align="left"
  156. min-width="100"
  157. label="装箱人">
  158. </el-table-column>
  159. <el-table-column
  160. prop="batchNo"
  161. header-align="center"
  162. align="left"
  163. min-width="100"
  164. label="合约号">
  165. </el-table-column>
  166. <el-table-column
  167. prop="wareHouseID"
  168. header-align="center"
  169. align="left"
  170. min-width="100"
  171. label="仓库">
  172. </el-table-column>
  173. <el-table-column
  174. prop="locationId"
  175. header-align="center"
  176. align="left"
  177. min-width="100"
  178. label="库位">
  179. </el-table-column>
  180. </el-table>
  181. </el-tab-pane>
  182. </el-tabs>
  183. </div>
  184. </template>
  185. <script>
  186. /*组件*/
  187. import excel from "@/utils/excel-util.js";
  188. import boxing from "./com_saleBoxManage_boxing.vue"
  189. import {
  190. getOutboundDetailWithRoll,
  191. searchOutboundNotification
  192. } from '../../../api/qc/outbound_notification'
  193. import {searchRollForOrderNo} from '../../../api/boxManage/boxManage'
  194. export default {
  195. data() {
  196. return {
  197. functionId: this.$route.meta.menuId,
  198. height: 200,
  199. currentRow: {},
  200. searchData:{
  201. orderNo:'',
  202. customerId:'',
  203. orderType:'销售出库',
  204. orderStatus: '',
  205. orderStatusList: ['待出库'],
  206. buNo:'',
  207. customerName:'',
  208. site:this.$store.state.user.site,
  209. userName:this.$store.state.user.name,
  210. page: 1,
  211. limit: 10,
  212. },
  213. pageIndex: 1,
  214. pageSize: 50,
  215. totalPage: 0,
  216. tagNo:'',
  217. rollList:[],
  218. mainDataList:[],
  219. detailList:[],
  220. dataListLoading: false,
  221. activeName: 'outboundDetail',
  222. columnArray1: [
  223. {
  224. userId: this.$store.state.user.name,
  225. functionId: this.functionId,
  226. serialNumber: '750001Table1BU',
  227. tableId: "750001Table1",
  228. tableName: "销售发货清单",
  229. columnProp: "buNo",
  230. headerAlign: "center",
  231. align: "left",
  232. columnLabel: "BU",
  233. columnWidth: '60',
  234. columnHidden: false,
  235. columnImage: false,
  236. columnSortable: false,
  237. sortLv: 0,
  238. status: true,
  239. fixed: false
  240. },
  241. {
  242. userId: this.$store.state.user.name,
  243. functionId: this.functionId,
  244. serialNumber: '750001Table1OrderNo',
  245. tableId: "750001Table1",
  246. tableName: "销售发货清单",
  247. columnProp: "orderNo",
  248. headerAlign: "center",
  249. align: "left",
  250. columnLabel: "销售出库单号",
  251. columnWidth: '100',
  252. columnHidden: false,
  253. columnImage: false,
  254. columnSortable: false,
  255. sortLv: 0,
  256. status: true,
  257. fixed: false
  258. },
  259. {
  260. userId: this.$store.state.user.name,
  261. functionId: this.functionId,
  262. serialNumber: '750001Table1OrderStatus',
  263. tableId: "750001Table1",
  264. tableName: "销售发货清单",
  265. columnProp: "orderStatus",
  266. headerAlign: "center",
  267. align: "left",
  268. columnLabel: "通知单状态",
  269. columnWidth: '80',
  270. columnHidden: false,
  271. columnImage: false,
  272. columnSortable: false,
  273. sortLv: 0,
  274. status: true,
  275. fixed: false
  276. },
  277. {
  278. userId: this.$store.state.user.name,
  279. functionId: this.functionId,
  280. serialNumber: '750001Table1CustomerId',
  281. tableId: "750001Table1",
  282. tableName: "销售发货清单",
  283. columnProp: "customerId",
  284. headerAlign: "center",
  285. align: "left",
  286. columnLabel: "客户编号",
  287. columnWidth: '100',
  288. columnHidden: false,
  289. columnImage: false,
  290. columnSortable: false,
  291. sortLv: 0,
  292. status: true,
  293. fixed: false
  294. },
  295. {
  296. userId: this.$store.state.user.name,
  297. functionId: this.functionId,
  298. serialNumber: '750001Table1CustomerName',
  299. tableId: "750001Table1",
  300. tableName: "销售发货清单",
  301. columnProp: "customerName",
  302. headerAlign: "center",
  303. align: "left",
  304. columnLabel: "客户编号",
  305. columnWidth: '240',
  306. columnHidden: false,
  307. columnImage: false,
  308. columnSortable: false,
  309. sortLv: 0,
  310. status: true,
  311. fixed: false
  312. },
  313. {
  314. userId: this.$store.state.user.name,
  315. functionId: this.functionId,
  316. serialNumber: '750001Table1RequiredOutboundDate',
  317. tableId: "750001Table1",
  318. tableName: "销售发货清单",
  319. columnProp: "requiredOutboundDate",
  320. headerAlign: "center",
  321. align: "left",
  322. columnLabel: "要求发货日期",
  323. columnWidth: '120',
  324. columnHidden: false,
  325. columnImage: false,
  326. columnSortable: false,
  327. sortLv: 0,
  328. status: true,
  329. fixed: false
  330. },
  331. ],
  332. columnDetailList: [
  333. {
  334. columnProp: 'relatedOrderNo',
  335. headerAlign: "center",
  336. align: "left",
  337. columnLabel: '销售订单号',
  338. columnHidden: false,
  339. columnImage: false,
  340. columnSortable: false,
  341. sortLv: 0,
  342. status: true,
  343. fixed: '',
  344. columnWidth: 100,
  345. },
  346. {
  347. columnProp: 'relatedOrderLineNo',
  348. headerAlign: "center",
  349. align: "right",
  350. columnLabel: '销售订单行号',
  351. columnHidden: false,
  352. columnImage: false,
  353. columnSortable: false,
  354. sortLv: 0,
  355. status: true,
  356. fixed: '',
  357. columnWidth: 100,
  358. },
  359. {
  360. columnProp: 'partNo',
  361. headerAlign: "center",
  362. align: "left",
  363. columnLabel: '物料编码',
  364. columnHidden: false,
  365. columnImage: false,
  366. columnSortable: false,
  367. sortLv: 0,
  368. status: true,
  369. fixed: '',
  370. columnWidth: 120,
  371. },
  372. {
  373. columnProp: 'partDesc',
  374. headerAlign: "center",
  375. align: "left",
  376. columnLabel: '物料名称',
  377. columnHidden: false,
  378. columnImage: false,
  379. columnSortable: false,
  380. sortLv: 0,
  381. status: true,
  382. fixed: '',
  383. columnWidth: 200,
  384. },
  385. {
  386. columnProp: 'outBatchNo',
  387. headerAlign: "center",
  388. align: "left",
  389. columnLabel: '合约号',
  390. columnHidden: false,
  391. columnImage: false,
  392. columnSortable: false,
  393. sortLv: 0,
  394. status: true,
  395. fixed: '',
  396. columnWidth: 100,
  397. },
  398. {
  399. columnProp: 'orderQty',
  400. headerAlign: "center",
  401. align: "right",
  402. columnLabel: '销售订单数量',
  403. columnHidden: false,
  404. columnImage: false,
  405. columnSortable: false,
  406. sortLv: 0,
  407. status: true,
  408. fixed: '',
  409. columnWidth: 100,
  410. },
  411. {
  412. columnProp: 'requiredQty',
  413. headerAlign: "center",
  414. align: "right",
  415. columnLabel: '要求发货数量',
  416. columnHidden: false,
  417. columnImage: false,
  418. columnSortable: false,
  419. sortLv: 0,
  420. status: true,
  421. fixed: '',
  422. columnWidth: 100,
  423. },
  424. {
  425. columnProp: 'rollQty',
  426. headerAlign: "center",
  427. align: "right",
  428. columnLabel: '已扫描数量',
  429. columnHidden: false,
  430. columnImage: false,
  431. columnSortable: false,
  432. sortLv: 0,
  433. status: true,
  434. fixed: '',
  435. columnWidth: 100,
  436. },
  437. {
  438. columnProp: 'unScanQty',
  439. headerAlign: "center",
  440. align: "right",
  441. columnLabel: '未扫描数量',
  442. columnHidden: false,
  443. columnImage: false,
  444. columnSortable: false,
  445. sortLv: 0,
  446. status: true,
  447. fixed: '',
  448. columnWidth: 100,
  449. },
  450. {
  451. columnProp: 'unit',
  452. headerAlign: "center",
  453. align: "left",
  454. columnLabel: '单位',
  455. columnHidden: false,
  456. columnImage: false,
  457. columnSortable: false,
  458. sortLv: 0,
  459. status: true,
  460. fixed: '',
  461. columnWidth: 100,
  462. },
  463. ],
  464. exportName: '销售出库单'+this.dayjs().format('YYYYMMDDHHmmss'),
  465. }
  466. },
  467. /*组件*/
  468. components: {
  469. boxing,
  470. },
  471. mounted() {
  472. this.$nextTick(() => {
  473. this.height = ( window.innerHeight - 220)/2;
  474. })
  475. },
  476. methods: {
  477. getMainData(){
  478. this.searchData.limit = this.pageSize
  479. this.searchData.page = this.pageIndex
  480. searchOutboundNotification(this.searchData).then(({data}) => {
  481. if (data.code === 0) {
  482. this.mainDataList = data.page.list
  483. this.pageIndex = data.page.currPage
  484. this.pageSize = data.page.pageSize
  485. this.totalPage = data.page.totalCount
  486. //判断是否全部存在数据
  487. if (this.totalPage > 0) {
  488. //设置选中行
  489. this.$refs.mainTable.setCurrentRow(this.mainDataList[0])
  490. this.changeData(this.mainDataList[0])
  491. }else {
  492. this.changeData(null)
  493. }
  494. }
  495. this.dataListLoading = false
  496. })
  497. },
  498. tabClick(tab, event){
  499. this.refreshCurrentTabTable()
  500. },
  501. // 每页数
  502. sizeChangeHandle (val) {
  503. this.pageSize = val
  504. this.pageIndex = 1
  505. this.getMainData()
  506. },
  507. // 当前页
  508. currentChangeHandle (val) {
  509. this.pageIndex = val
  510. this.getMainData()
  511. },
  512. changeData(row){
  513. this.currentRow=JSON.parse(JSON.stringify(row))
  514. this.refreshCurrentTabTable ();
  515. },
  516. refreshCurrentTabTable(){
  517. if(this.currentRow===''||this.currentRow===null){
  518. this.currentRow={site:'',supplierNo:''}
  519. }
  520. if(this.activeName==='boxing'){
  521. this.refreshBoxingTable();
  522. }
  523. if(this.activeName==='outboundDetail'){
  524. this.refreshDetailTable();
  525. }
  526. if(this.activeName==='rollDetail'){
  527. this.refreshRollsTable();
  528. }
  529. },
  530. async exportExcel() {
  531. this.searchData.limit = -1
  532. this.searchData.page = 1
  533. excel.exportTable({
  534. url: "/outbound/searchOutboundNotification",
  535. columnMapping: this.columnArray1,//可以直接用table,不需要的列就剔除
  536. mergeSetting: [],//需要合并的列
  537. params: this.searchData,
  538. fileName: this.exportName+".xlsx",
  539. rowFetcher: res => res.data,
  540. columnFormatter: [],
  541. dropColumns: [],//需要剔除的列,例如dropColumns: ["netWeight"],即剔除净重列
  542. });
  543. },
  544. refreshBoxingTable(){
  545. let inData={
  546. site: this.currentRow.site,
  547. buNo: this.currentRow.buNo,
  548. orderNo: this.currentRow.orderNo,
  549. boxType: this.currentRow.orderType,
  550. height:Number(this.height)-25
  551. }
  552. this.$refs.boxing.init(inData)
  553. },
  554. refreshDetailTable(){
  555. let templateData = {
  556. site: this.currentRow.site,
  557. buNo: this.currentRow.buNo,
  558. orderNo: this.currentRow.orderNo,
  559. }
  560. getOutboundDetailWithRoll(templateData).then(({data}) => {
  561. this.detailList = data.rows
  562. })
  563. },
  564. refreshRollsTable(){
  565. let templateData = {
  566. site: this.currentRow.site,
  567. buNo: this.currentRow.buNo,
  568. orderNo: this.currentRow.orderNo,
  569. }
  570. searchRollForOrderNo(templateData).then(({data}) => {
  571. this.rollList = data.rows
  572. })
  573. },
  574. },
  575. created() {
  576. //查询报表的类型
  577. this.getMainData();
  578. },
  579. }
  580. </script>
  581. <!--当前页面的标签样式-->
  582. <style scoped lang="scss">
  583. /deep/ .customer-tab .el-tabs__content {
  584. padding: 5px !important;
  585. }
  586. </style>