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.

374 lines
14 KiB

4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
2 months ago
3 months ago
3 months ago
3 months ago
2 months ago
2 months ago
2 months ago
4 months ago
4 months ago
2 months ago
  1. <template>
  2. <div class="mod-config">
  3. <el-form :inline="true" label-position="top">
  4. <el-form-item label="入库状态">
  5. <el-select v-model="queryHeaderData.inStockFlag" placeholder="请选择" style="width: 120px;">
  6. <el-option label="全部" value=""></el-option>
  7. <el-option label="未入库" value="X"></el-option>
  8. <el-option label="已出库" value="N"></el-option>
  9. <el-option label="在库" value="Y"></el-option>
  10. </el-select>
  11. </el-form-item>
  12. <el-form-item label="物料编号">
  13. <el-input style="width: 120px;" v-model="queryHeaderData.partNo" placeholder="请输入物料编号" @keyup.enter.native="getDataList()"></el-input>
  14. </el-form-item>
  15. <el-form-item label="批次号">
  16. <el-input style="width: 120px;" v-model="queryHeaderData.batchNo" placeholder="请输入批次号" @keyup.enter.native="getDataList()"></el-input>
  17. </el-form-item>
  18. <el-form-item label="库位">
  19. <el-input style="width: 120px;" v-model="queryHeaderData.locationId" placeholder="请输入库位" @keyup.enter.native="getDataList()"></el-input>
  20. </el-form-item>
  21. <el-form-item label="标签ID">
  22. <el-input style="width: 120px;" v-model="queryHeaderData.unitId" placeholder="请输入标签ID" @keyup.enter.native="getDataList()"></el-input>
  23. </el-form-item>
  24. <el-form-item label="物料描述">
  25. <el-input style="width: 120px;" v-model="queryHeaderData.partDesc" placeholder="请输入物料描述" @keyup.enter.native="getDataList()"></el-input>
  26. </el-form-item>
  27. <el-form-item label="所在栈板">
  28. <el-input style="width: 120px;" v-model="queryHeaderData.palletId" @keyup.enter.native="getDataList()"></el-input>
  29. </el-form-item>
  30. <el-form-item label="栈板所在区域">
  31. <el-input style="width: 120px;" v-model="queryHeaderData.stationArea" @keyup.enter.native="getDataList()"></el-input>
  32. </el-form-item>
  33. <el-form-item style="margin-top: 20px;">
  34. <el-button @click="getDataList()" type="primary">查询</el-button>
  35. <!-- 导出按钮 - rqrq -->
  36. <download-excel
  37. :fields="fields()"
  38. :data="exportData"
  39. type="xls"
  40. :name="exportName"
  41. :header="exportHeader"
  42. :footer="exportFooter"
  43. :fetch="createExportData"
  44. :before-generate="startDownload"
  45. :before-finish="finishDownload"
  46. worksheet="导出信息"
  47. class="el-button el-button--primary el-button--medium">
  48. {{ '导出' }}
  49. </download-excel>
  50. </el-form-item>
  51. </el-form>
  52. <el-table
  53. id="labelQueryTable"
  54. :height="height"
  55. :data="dataList"
  56. border
  57. v-loading="dataListLoading || printLoading"
  58. :element-loading-text="loadingText"
  59. style="width: 100%; margin-bottom: 15px;">
  60. <!-- 动态列配置 - rqrq -->
  61. <el-table-column
  62. v-for="(item,index) in columnList" :key="index"
  63. :sortable="item.columnSortable"
  64. :prop="item.columnProp"
  65. :header-align="item.headerAlign"
  66. :show-overflow-tooltip="item.showOverflowTooltip"
  67. :align="item.align"
  68. :fixed="item.fixed==''?false:item.fixed"
  69. :min-width="item.columnWidth"
  70. :label="item.columnLabel">
  71. <template slot-scope="scope">
  72. <span v-if="item.columnProp === 'reserveFlag'">
  73. {{ scope.row.reserveFlag === 'Y' ? '是' : '否' }}
  74. </span>
  75. <span v-else>{{ scope.row[item.columnProp] }}</span>
  76. </template>
  77. </el-table-column>
  78. </el-table>
  79. <el-pagination
  80. @size-change="sizeChangeHandle"
  81. @current-change="currentChangeHandle"
  82. :current-page="pageIndex"
  83. :page-sizes="[20, 50, 100]"
  84. :page-size="pageSize"
  85. :total="totalPage"
  86. layout="total, sizes, prev, pager, next, jumper">
  87. </el-pagination>
  88. </div>
  89. </template>
  90. <script>
  91. import { getHandlingUnitLabelList, reprintLabel, deleteLabel, getHandlingUnitLabelAll, } from '@/api/warehouse/labelQuery'
  92. import { searchSysLanguagePackList, saveUserFavorite, searchUserFavorite } from '@/api/sysLanguage'
  93. import { createOtherInboundHU, printLabel } from '@/api/warehouse/otherInbound'
  94. import {getHandlingUnitLabelListLocation} from '../../../api/warehouse/labelQuery'
  95. export default {
  96. data() {
  97. return {
  98. dataForm: {
  99. key: ''
  100. },
  101. dataList: [],
  102. pageIndex: 1,
  103. pageSize: 50,
  104. totalPage: 0,
  105. dataListLoading: false,
  106. printLoading: false,
  107. loadingText: '加载中...',
  108. dataListSelections: [],
  109. favorite: false,
  110. height: 500,
  111. // 表格列配置 - rqrq
  112. columnList: [
  113. {columnProp: "unitId", headerAlign: "center", align: "center", columnLabel: "标签ID", columnWidth: 150, columnSortable: false, showOverflowTooltip: true, fixed: ""},
  114. {columnProp: "partNo", headerAlign: "center", align: "center", columnLabel: "物料编号", columnWidth: 120, columnSortable: false, showOverflowTooltip: true, fixed: ""},
  115. {columnProp: "qty", headerAlign: "center", align: "right", columnLabel: "数量", columnWidth: 80, columnSortable: false, showOverflowTooltip: true, fixed: ""},
  116. {columnProp: "palletId", headerAlign: "center", align: "center", columnLabel: "所在栈板", columnWidth: 80, columnSortable: false, showOverflowTooltip: true, fixed: ""},
  117. {columnProp: "callingFlag", headerAlign: "center", align: "center", columnLabel: "是否调用", columnWidth: 80, columnSortable: false, showOverflowTooltip: true, fixed: ""},
  118. {columnProp: "remark", headerAlign: "center", align: "left", columnLabel: "最近一次调用备注", columnWidth: 150, columnSortable: false, showOverflowTooltip: true, fixed: ""},
  119. {columnProp: "position", headerAlign: "center", align: "center", columnLabel: "位置", columnWidth: 60, columnSortable: false, showOverflowTooltip: true, fixed: ""},
  120. {columnProp: "layer", headerAlign: "center", align: "center", columnLabel: "层数", columnWidth: 60, columnSortable: false, showOverflowTooltip: true, fixed: ""},
  121. {columnProp: "stationId", headerAlign: "center", align: "center", columnLabel: "站点", columnWidth: 60, columnSortable: false, showOverflowTooltip: true, fixed: ""},
  122. {columnProp: "stationArea", headerAlign: "center", align: "center", columnLabel: "区域", columnWidth: 80, columnSortable: false, showOverflowTooltip: true, fixed: ""},
  123. {columnProp: "batchNo", headerAlign: "center", align: "center", columnLabel: "批次号", columnWidth: 120, columnSortable: false, showOverflowTooltip: true, fixed: ""},
  124. {columnProp: "locationId", headerAlign: "center", align: "center", columnLabel: "库位", columnWidth: 100, columnSortable: false, showOverflowTooltip: true, fixed: ""},
  125. {columnProp: "warehouseId", headerAlign: "center", align: "center", columnLabel: "仓库", columnWidth: 100, columnSortable: false, showOverflowTooltip: true, fixed: ""},
  126. {columnProp: "partDesc", headerAlign: "center", align: "center", columnLabel: "物料描述", columnWidth: 150, columnSortable: false, showOverflowTooltip: true, fixed: ""},
  127. {columnProp: "height", headerAlign: "center", align: "right", columnLabel: "高度(mm)", columnWidth: 100, columnSortable: false, showOverflowTooltip: true, fixed: ""},
  128. {columnProp: "reserveFlag", headerAlign: "center", align: "center", columnLabel: "是否预留", columnWidth: 80, columnSortable: false, showOverflowTooltip: true, fixed: ""},
  129. {columnProp: "reserveOrderRef1", headerAlign: "center", align: "center", columnLabel: "预留单号1", columnWidth: 120, columnSortable: false, showOverflowTooltip: true, fixed: ""},
  130. {columnProp: "reserveOrderRef2", headerAlign: "center", align: "center", columnLabel: "预留单号2", columnWidth: 120, columnSortable: false, showOverflowTooltip: true, fixed: ""},
  131. {columnProp: "reserveOrderRef3", headerAlign: "center", align: "center", columnLabel: "预留单号3", columnWidth: 120, columnSortable: false, showOverflowTooltip: true, fixed: ""},
  132. {columnProp: "wdr", headerAlign: "center", align: "center", columnLabel: "WDR", columnWidth: 80, columnSortable: false, showOverflowTooltip: true, fixed: ""},
  133. {columnProp: "engChgLevel", headerAlign: "center", align: "center", columnLabel: "版本号", columnWidth: 80, columnSortable: false, showOverflowTooltip: true, fixed: ""},
  134. {columnProp: "expiredDate", headerAlign: "center", align: "center", columnLabel: "失效日期", columnWidth: 120, columnSortable: false, showOverflowTooltip: true, fixed: ""},
  135. {columnProp: "receiveDate", headerAlign: "center", align: "center", columnLabel: "接收日期", columnWidth: 120, columnSortable: false, showOverflowTooltip: true, fixed: ""},
  136. ],
  137. queryHeaderData: {
  138. inStockFlag: 'Y',
  139. partNo: '',
  140. batchNo: '',
  141. locationId: '',
  142. unitId: '',
  143. partDesc: '',
  144. stationArea:'',
  145. palletId:'',
  146. },
  147. // 导出相关 - rqrq
  148. exportData: [],
  149. exportName: '标签位置查询' + this.dayjs().format('YYYYMMDDHHmmss'),
  150. exportHeader: ["标签位置查询"],
  151. exportFooter: [],
  152. // 打印相关配置
  153. reportId: 'HU_LABEL', // 默认报表ID,可根据实际情况调整
  154. zplCode: '', // ZPL代码
  155. paperSize: 'A4',
  156. orientation: 'portrait',
  157. dpi: 203,
  158. // 其它入库标签打印相关
  159. otherInboundVisible: false,
  160. otherInboundLoading: false,
  161. otherInboundForm: {
  162. partNo: '',
  163. partDesc: '',
  164. batchNo: '',
  165. locationId: '',
  166. warehouseId: '',
  167. wdr: '*',
  168. qty: 1,
  169. umId: '个',
  170. packageCount: 1,
  171. manufactureDate: '',
  172. expiredDate: '',
  173. remark: ''
  174. },
  175. otherInboundRules: {
  176. partNo: [
  177. { required: true, message: '物料编码不能为空', trigger: 'blur' }
  178. ],
  179. partDesc: [
  180. { required: true, message: '物料描述不能为空', trigger: 'blur' }
  181. ],
  182. batchNo: [
  183. { required: true, message: '批次号不能为空', trigger: 'blur' }
  184. ],
  185. locationId: [
  186. { required: true, message: '库位不能为空', trigger: 'blur' }
  187. ],
  188. warehouseId: [
  189. { required: true, message: '仓库不能为空', trigger: 'blur' }
  190. ],
  191. qty: [
  192. { required: true, message: '数量不能为空', trigger: 'blur' },
  193. { type: 'number', min: 0.01, message: '数量必须大于0', trigger: 'blur' }
  194. ],
  195. umId: [
  196. { required: true, message: '单位不能为空', trigger: 'blur' }
  197. ],
  198. packageCount: [
  199. { required: true, message: '包装数不能为空', trigger: 'blur' },
  200. { type: 'number', min: 1, message: '包装数必须大于等于1', trigger: 'blur' }
  201. ]
  202. }
  203. }
  204. },
  205. activated() {
  206. this.getDataList()
  207. this.getHeight()
  208. },
  209. mounted() {
  210. this.getDataList()
  211. this.getHeight()
  212. },
  213. methods: {
  214. // 获取数据列表
  215. getDataList() {
  216. this.dataListLoading = true
  217. const params = {
  218. page: this.pageIndex,
  219. size: this.pageSize,
  220. site: localStorage.getItem('site'),
  221. ...this.queryHeaderData
  222. }
  223. getHandlingUnitLabelListLocation(params).then(({ data }) => {
  224. if (data && data.code === 0) {
  225. this.dataList = data.page.list || []
  226. this.totalPage = data.page.totalCount || 0
  227. } else {
  228. this.dataList = []
  229. this.totalPage = 0
  230. this.$alert(data.msg || '查询失败', '错误', { confirmButtonText: '确定' })
  231. }
  232. this.dataListLoading = false
  233. }).catch(() => {
  234. this.dataList = []
  235. this.totalPage = 0
  236. this.dataListLoading = false
  237. })
  238. },
  239. // 重置查询条件
  240. resetQuery() {
  241. this.queryHeaderData = {
  242. inStockFlag: 'Y',
  243. partNo: '',
  244. batchNo: '',
  245. locationId: '',
  246. unitId: '',
  247. partDesc: ''
  248. }
  249. this.pageIndex = 1
  250. this.getDataList()
  251. },
  252. // 每页数
  253. sizeChangeHandle(val) {
  254. this.pageSize = val
  255. this.pageIndex = 1
  256. this.getDataList()
  257. },
  258. // 当前页
  259. currentChangeHandle(val) {
  260. this.pageIndex = val
  261. this.getDataList()
  262. },
  263. // 格式化日期
  264. formatDate(date) {
  265. if (!date) return ''
  266. const d = new Date(date)
  267. const year = d.getFullYear()
  268. const month = String(d.getMonth() + 1).padStart(2, '0')
  269. const day = String(d.getDate()).padStart(2, '0')
  270. const hours = String(d.getHours()).padStart(2, '0')
  271. const minutes = String(d.getMinutes()).padStart(2, '0')
  272. const seconds = String(d.getSeconds()).padStart(2, '0')
  273. return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
  274. },
  275. // 获取表格高度
  276. getHeight() {
  277. this.$nextTick(() => {
  278. this.height = window.innerHeight - 220
  279. })
  280. },
  281. // 导出相关方法 - rqrq
  282. async createExportData() {
  283. const queryParams = {
  284. site: localStorage.getItem('site'),
  285. ...this.queryHeaderData,
  286. page: 1,
  287. size: 999999 // 设置一个很大的数字来获取全部数据 - rqrq
  288. }
  289. const {data} = await getHandlingUnitLabelListLocation(queryParams)
  290. if (data && data.code === 0) {
  291. return (data.page.list || []).map(item => {
  292. return {
  293. ...item,
  294. reserveFlag: item.reserveFlag === 'Y' ? '是' : '否'
  295. }
  296. })
  297. }
  298. return []
  299. },
  300. startDownload() {
  301. // 开始导出 - rqrq
  302. },
  303. finishDownload() {
  304. // 导出完成 - rqrq
  305. },
  306. fields() {
  307. let json = "{"
  308. this.columnList.forEach((item, index) => {
  309. if (index == this.columnList.length - 1) {
  310. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  311. } else {
  312. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  313. }
  314. })
  315. json += "}"
  316. let s = eval("(" + json + ")")
  317. return s
  318. },
  319. }
  320. }
  321. </script>
  322. <style>
  323. .mod-config .el-form-item {
  324. margin-bottom: 15px;
  325. }
  326. .sl-svg {
  327. font-size: 20px;
  328. cursor: pointer;
  329. color: #409EFF;
  330. }
  331. /* 其它入库标签打印表单样式 */
  332. .other-inbound-form .form-item-vertical {
  333. margin-bottom: 20px;
  334. }
  335. .other-inbound-form .form-item-vertical .el-form-item__label {
  336. display: block;
  337. text-align: left;
  338. padding: 0 0 8px 0;
  339. line-height: 1.5;
  340. font-weight: 500;
  341. }
  342. .other-inbound-form .form-item-vertical .el-form-item__content {
  343. margin-left: 0 !important;
  344. }
  345. .other-inbound-form .el-row {
  346. margin-bottom: 0;
  347. }
  348. </style>