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.

398 lines
16 KiB

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