冷凝胶前端
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.

489 lines
15 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <script>
  2. import OutWarehouseDetail from './outWarehouse/outWarehouseDetail.vue'
  3. import {getShipmentPage, printShipment} from '../../../api/shipment'
  4. import {getShipmentDetailList} from '../../../api/shipment/detail'
  5. import ShipmentBox from './outWarehouse/shipmentBox.vue'
  6. import {addShipmentBox, getShipmentBoxList} from '../../../api/shipment/box'
  7. import {printShipmentInnerLabel} from '../label/print_shipment_inner_label'
  8. import dayjs from 'dayjs'
  9. import {printShipmentBoxLabel} from '../label/print_shipment_box_label'
  10. import {printShipmentPackingBoxLabel} from '../label/print_shipment_packing_box_label'
  11. export default {
  12. name: "outWarehouse",
  13. components: {ShipmentBox, OutWarehouseDetail},
  14. props:{
  15. height:{
  16. type: Number,
  17. default:300,
  18. }
  19. },
  20. data(){
  21. return{
  22. loading: false,
  23. open: false,
  24. queryForm:{
  25. shipmentId: "",
  26. startDate: "",
  27. endDate: "",
  28. },
  29. no: 1,
  30. size: 50,
  31. total: 0,
  32. dataList:[],
  33. // selectDataList:[],
  34. form:{},
  35. columnList:[
  36. {
  37. userId: this.$store.state.user.name,
  38. functionId: 400002,
  39. serialNumber: '400002TableShipmentId',
  40. tableId: "400002Table",
  41. tableName: "shipment",
  42. columnProp: "shipmentId",
  43. headerAlign: "center",
  44. align: "left",
  45. columnLabel: "发货ID",
  46. columnHidden: false,
  47. columnImage: false,
  48. columnSortable: false,
  49. sortLv: 0,
  50. status: true,
  51. fixed: '',
  52. columnWidth: 70
  53. },{
  54. userId: this.$store.state.user.name,
  55. functionId: 400002,
  56. serialNumber: '400002TableShipDate',
  57. tableId: "400002Table",
  58. tableName: "shipment",
  59. columnProp: "shipDate",
  60. headerAlign: "center",
  61. align: "center",
  62. columnLabel: "发货日期",
  63. columnHidden: false,
  64. columnImage: false,
  65. columnSortable: false,
  66. sortLv: 0,
  67. status: true,
  68. fixed: '',
  69. columnWidth: 100
  70. },{
  71. userId: this.$store.state.user.name,
  72. functionId: 400002,
  73. serialNumber: '400002TableCustomerNo',
  74. tableId: "400002Table",
  75. tableName: "shipment",
  76. columnProp: "customerNo",
  77. headerAlign: "center",
  78. align: "left",
  79. columnLabel: "客户编码",
  80. columnHidden: false,
  81. columnImage: false,
  82. columnSortable: false,
  83. sortLv: 0,
  84. status: true,
  85. fixed: '',
  86. columnWidth: 70
  87. },{
  88. userId: this.$store.state.user.name,
  89. functionId: 400002,
  90. serialNumber: '400002TableCustomerName',
  91. tableId: "400002Table",
  92. tableName: "shipment",
  93. columnProp: "customerName",
  94. headerAlign: "center",
  95. align: "left",
  96. columnLabel: "客户名称",
  97. columnHidden: false,
  98. columnImage: false,
  99. columnSortable: false,
  100. sortLv: 0,
  101. status: true,
  102. fixed: '',
  103. columnWidth: 360
  104. },
  105. ],
  106. row:{},
  107. activeName:'detail',
  108. detailDataList:[],
  109. detailLoading: false,
  110. columnDetailList:[
  111. {
  112. userId: this.$store.state.user.name,
  113. functionId: 400002,
  114. serialNumber: '400002Table2PartNo',
  115. tableId: "400002Table2",
  116. tableName: "ShipmentDetail",
  117. columnProp: "partNo",
  118. headerAlign: "center",
  119. align: "left",
  120. columnLabel: "料号",
  121. columnHidden: false,
  122. columnImage: false,
  123. columnSortable: false,
  124. sortLv: 0,
  125. status: true,
  126. fixed: '',
  127. columnWidth: 80
  128. },
  129. // {
  130. // userId: this.$store.state.user.name,
  131. // functionId: 400002,
  132. // serialNumber: '400002Table2PartDesc',
  133. // tableId: "400002Table2",
  134. // tableName: "ShipmentDetail",
  135. // columnProp: "partDesc",
  136. // headerAlign: "center",
  137. // align: "left",
  138. // columnLabel: "物料描述",
  139. // columnHidden: false,
  140. // columnImage: false,
  141. // columnSortable: false,
  142. // sortLv: 0,
  143. // status: true,
  144. // fixed: '',
  145. // columnWidth: 100
  146. // },
  147. {
  148. userId: this.$store.state.user.name,
  149. functionId: 400002,
  150. serialNumber: '400002Table2SaleQty',
  151. tableId: "400002Table2",
  152. tableName: "ShipmentDetail",
  153. columnProp: "saleQty",
  154. headerAlign: "center",
  155. align: "left",
  156. columnLabel: "数量",
  157. columnHidden: false,
  158. columnImage: false,
  159. columnSortable: false,
  160. sortLv: 0,
  161. status: true,
  162. fixed: '',
  163. columnWidth: 80
  164. },
  165. {
  166. userId: this.$store.state.user.name,
  167. functionId: 400002,
  168. serialNumber: '400002Table2OrderNumber',
  169. tableId: "400002Table2",
  170. tableName: "ShipmentDetail",
  171. columnProp: "orderNumber",
  172. headerAlign: "center",
  173. align: "left",
  174. columnLabel: "关联单号1",
  175. columnHidden: false,
  176. columnImage: false,
  177. columnSortable: false,
  178. sortLv: 0,
  179. status: true,
  180. fixed: '',
  181. columnWidth: 80
  182. },
  183. {
  184. userId: this.$store.state.user.name,
  185. functionId: 400002,
  186. serialNumber: '400002Table2LineNo',
  187. tableId: "400002Table2",
  188. tableName: "ShipmentDetail",
  189. columnProp: "lineNo",
  190. headerAlign: "center",
  191. align: "left",
  192. columnLabel: "关联单号2",
  193. columnHidden: false,
  194. columnImage: false,
  195. columnSortable: false,
  196. sortLv: 0,
  197. status: true,
  198. fixed: '',
  199. columnWidth: 80
  200. },
  201. {
  202. userId: this.$store.state.user.name,
  203. functionId: 400002,
  204. serialNumber: '400002Table2RelNo',
  205. tableId: "400002Table2",
  206. tableName: "ShipmentDetail",
  207. columnProp: "relNo",
  208. headerAlign: "center",
  209. align: "center",
  210. columnLabel: "关联单号3",
  211. columnHidden: false,
  212. columnImage: false,
  213. columnSortable: false,
  214. sortLv: 0,
  215. status: true,
  216. fixed: '',
  217. columnWidth: 80
  218. }
  219. ],
  220. boxDataList:[],
  221. }
  222. },
  223. methods:{
  224. getDataList(){
  225. let params = {
  226. ...this.queryForm,
  227. no: this.no,
  228. size: this.size,
  229. site:this.$store.state.user.site
  230. }
  231. this.dataList = [];
  232. this.loading = true;
  233. getShipmentPage(params).then(({data})=>{
  234. this.loading = false;
  235. if (data && data.code === 0){
  236. this.dataList = data.page.records;
  237. this.total = data.page.total;
  238. if (this.total > 0){
  239. this.handleRowClick(this.dataList[0])
  240. }
  241. }else {
  242. this.$message.warning(data.msg)
  243. }
  244. }).catch((error)=>{
  245. this.loading = false;
  246. this.$message.error(error)
  247. })
  248. },
  249. handleQuery(){
  250. this.getDataList();
  251. },
  252. handleSizeChange(val){
  253. this.size = val;
  254. this.getDataList();
  255. },
  256. handleCurrentChange(val){
  257. this.no = val;
  258. this.getDataList();
  259. },
  260. handleOutWarehouse(row){
  261. this.form = {...row}
  262. this.getBoxDataList();
  263. this.open = true;
  264. },
  265. getDetailDataList(){
  266. let params = {
  267. shipmentId: this.row.shipmentId,
  268. site:this.row.site
  269. }
  270. this.detailDataList = [];
  271. this.detailLoading = true;
  272. getShipmentDetailList(params).then(({data})=>{
  273. this.detailLoading = false;
  274. if (data && data.code === 0){
  275. this.detailDataList = data.rows;
  276. }else {
  277. this.$message.warning(data.msg)
  278. }
  279. }).catch((error)=>{
  280. this.detailLoading = false;
  281. this.$message.error(error)
  282. })
  283. },
  284. rowStyle({row}){
  285. if (row.site === this.row.site && row.shipmentId === this.row.shipmentId){
  286. return {
  287. background: '#E8F7F6'
  288. }
  289. }
  290. },
  291. handleRowClick(row){
  292. this.row = {...row};
  293. },
  294. getBoxDataList(){
  295. let params = {
  296. shipmentId: this.form.shipmentId,
  297. site:this.form.site
  298. }
  299. this.boxDataList = [];
  300. getShipmentBoxList(params).then(({data})=>{
  301. if (data && data.code === 0){
  302. this.boxDataList = data.rows;
  303. }else {
  304. this.$message.warning(data.msg)
  305. }
  306. }).catch((error)=>{
  307. this.$message.error(error)
  308. })
  309. },
  310. handleAddBox(){
  311. let params = {
  312. shipmentId: this.form.shipmentId,
  313. site:this.form.site,
  314. createBy:this.$store.state.user.name,
  315. }
  316. addShipmentBox(params).then(({data})=>{
  317. if (data && data.code === 0){
  318. this.$message.success(data.msg)
  319. this.getBoxDataList();
  320. }else {
  321. this.$message.warning(data.msg)
  322. }
  323. }).catch((error)=>{
  324. this.$message.error(error)
  325. })
  326. },
  327. handleEndShip(){
  328. this.open = false;
  329. this.getDataList();
  330. },
  331. handlePrint(row){
  332. printShipment(row).then(({data})=>{
  333. if (data && data.code === 0){
  334. let arr = data.rows.map(item=>{
  335. item.productionDate = `${dayjs(item.productionDate).format("YYYYMMDD")}`
  336. return item
  337. })
  338. printShipmentPackingBoxLabel(arr);
  339. }else {
  340. this.$message.warning(data.msg)
  341. }
  342. }).catch((error)=>{
  343. this.$message.error(error)
  344. })
  345. }
  346. },
  347. watch:{
  348. row(newVal,oldVal){
  349. if (newVal){
  350. this.getDetailDataList();
  351. }
  352. }
  353. },
  354. created () {
  355. // this.getDataList();
  356. },
  357. }
  358. </script>
  359. <template>
  360. <div>
  361. <div style="width: 1100px">
  362. <el-form :model="queryForm" ref="queryForm" label-position="top">
  363. <el-row :gutter="10">
  364. <el-col :span="3">
  365. <el-form-item label="发货ID">
  366. <el-input v-model="queryForm.shipmentId"></el-input>
  367. </el-form-item>
  368. </el-col>
  369. <el-col :span="7">
  370. <el-row :gutter="10">
  371. <el-col :span="11">
  372. <el-form-item label="发货日期">
  373. <el-date-picker
  374. style="width: 100%"
  375. v-model="queryForm.startDate"
  376. type="date"
  377. value-format="yyyy-MM-dd"
  378. placeholder="选择日期">
  379. </el-date-picker>
  380. </el-form-item>
  381. </el-col>
  382. <el-col :span="2">
  383. <el-form-item label=" ">
  384. <label style="margin-left: 0px;font-size: 19px">&#10142</label>
  385. </el-form-item>
  386. </el-col>
  387. <el-col :span="11">
  388. <el-form-item label=" ">
  389. <el-date-picker
  390. style="width: 100%"
  391. v-model="queryForm.endDate"
  392. type="date"
  393. value-format="yyyy-MM-dd"
  394. placeholder="选择日期">
  395. </el-date-picker>
  396. </el-form-item>
  397. </el-col>
  398. </el-row>
  399. </el-col>
  400. <el-col :span="3">
  401. <el-form-item label=" ">
  402. <el-button type="primary" @click="handleQuery">查询</el-button>
  403. <!-- <el-button type="primary" @click="handlePrint">打印</el-button>-->
  404. </el-form-item>
  405. </el-col>
  406. </el-row>
  407. </el-form>
  408. </div>
  409. <el-table :data="dataList" v-loading="loading" border :height="height" @row-click="handleRowClick" :row-style="rowStyle">
  410. <el-table-column align="center" label="操作" width="100">
  411. <template slot-scope="scope">
  412. <el-link v-if="scope.row.createDate" @click="handlePrint(scope.row)">装箱单标签</el-link>
  413. <el-link v-else @click="handleOutWarehouse(scope.row)">装箱出库</el-link>
  414. </template>
  415. </el-table-column>
  416. <el-table-column
  417. v-for="(item,index) in columnList" :key="index"
  418. :sortable="item.columnSortable"
  419. :prop="item.columnProp"
  420. :header-align="item.headerAlign"
  421. :show-overflow-tooltip="item.showOverflowTooltip"
  422. :align="item.align"
  423. :fixed="item.fixed==''?false:item.fixed"
  424. :min-width="item.columnWidth"
  425. :label="item.columnLabel">
  426. <template slot-scope="scope">
  427. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  428. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  429. style="width: 100px; height: 80px"/></span>
  430. </template>
  431. </el-table-column>
  432. </el-table>
  433. <!-- <div style="float: left;margin-top: 10px;color: gray;font-size: 13px" v-html="`共 <span style='color: #16B3A3'>${total}</span> 条 记 录,已 选 <span style='color: #16B3A3'>${selectDataList.length}</span> 条`"></div>-->
  434. <el-pagination
  435. @size-change="handleSizeChange"
  436. @current-change="handleCurrentChange"
  437. :current-page="no"
  438. :page-sizes="[50, 100, 1000]"
  439. :page-size="size"
  440. :total="total"
  441. style="margin-top: 0px"
  442. layout="total, sizes, prev, pager, next, jumper">
  443. </el-pagination>
  444. <el-tabs v-model="activeName">
  445. <el-tab-pane label="出库明细" name="detail">
  446. <out-warehouse-detail :height="420"
  447. :loading="detailLoading"
  448. :data-list="detailDataList"
  449. :column-list="columnDetailList"></out-warehouse-detail>
  450. </el-tab-pane>
  451. </el-tabs>
  452. <el-dialog title="装箱出库" v-drag :visible.sync="open" width="1000px" :close-on-click-modal="false">
  453. <el-form :model="form" ref="form" label-position="top">
  454. <el-row :gutter="10">
  455. <el-col :span="4">
  456. <el-form-item label="发货ID">
  457. <el-input v-model="form.shipmentId" disabled></el-input>
  458. </el-form-item>
  459. </el-col>
  460. <el-col :span="4">
  461. <el-form-item label="客户编码">
  462. <el-input v-model="form.customerNo" disabled></el-input>
  463. </el-form-item>
  464. </el-col>
  465. <el-col :span="8">
  466. <el-form-item label="客户名称">
  467. <el-input v-model="form.customerName" disabled></el-input>
  468. </el-form-item>
  469. </el-col>
  470. </el-row>
  471. </el-form>
  472. <shipment-box :data-list="boxDataList"
  473. :shipment="form"
  474. @add="handleAddBox"
  475. @end="handleEndShip"
  476. @refresh="getBoxDataList"
  477. :height="300"></shipment-box>
  478. <el-footer style="height: 20px"></el-footer>
  479. </el-dialog>
  480. </div>
  481. </template>
  482. <style scoped>
  483. </style>