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.

370 lines
14 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
3 months ago
3 months ago
3 months ago
4 months ago
4 months ago
4 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. ],
  133. queryHeaderData: {
  134. inStockFlag: '',
  135. partNo: '',
  136. batchNo: '',
  137. locationId: '',
  138. unitId: '',
  139. partDesc: '',
  140. stationArea:'',
  141. palletId:'',
  142. },
  143. // 导出相关 - rqrq
  144. exportData: [],
  145. exportName: '标签位置查询' + this.dayjs().format('YYYYMMDDHHmmss'),
  146. exportHeader: ["标签位置查询"],
  147. exportFooter: [],
  148. // 打印相关配置
  149. reportId: 'HU_LABEL', // 默认报表ID,可根据实际情况调整
  150. zplCode: '', // ZPL代码
  151. paperSize: 'A4',
  152. orientation: 'portrait',
  153. dpi: 203,
  154. // 其它入库标签打印相关
  155. otherInboundVisible: false,
  156. otherInboundLoading: false,
  157. otherInboundForm: {
  158. partNo: '',
  159. partDesc: '',
  160. batchNo: '',
  161. locationId: '',
  162. warehouseId: '',
  163. wdr: '*',
  164. qty: 1,
  165. umId: '个',
  166. packageCount: 1,
  167. manufactureDate: '',
  168. expiredDate: '',
  169. remark: ''
  170. },
  171. otherInboundRules: {
  172. partNo: [
  173. { required: true, message: '物料编码不能为空', trigger: 'blur' }
  174. ],
  175. partDesc: [
  176. { required: true, message: '物料描述不能为空', trigger: 'blur' }
  177. ],
  178. batchNo: [
  179. { required: true, message: '批次号不能为空', trigger: 'blur' }
  180. ],
  181. locationId: [
  182. { required: true, message: '库位不能为空', trigger: 'blur' }
  183. ],
  184. warehouseId: [
  185. { required: true, message: '仓库不能为空', trigger: 'blur' }
  186. ],
  187. qty: [
  188. { required: true, message: '数量不能为空', trigger: 'blur' },
  189. { type: 'number', min: 0.01, message: '数量必须大于0', trigger: 'blur' }
  190. ],
  191. umId: [
  192. { required: true, message: '单位不能为空', trigger: 'blur' }
  193. ],
  194. packageCount: [
  195. { required: true, message: '包装数不能为空', trigger: 'blur' },
  196. { type: 'number', min: 1, message: '包装数必须大于等于1', trigger: 'blur' }
  197. ]
  198. }
  199. }
  200. },
  201. activated() {
  202. this.getDataList()
  203. this.getHeight()
  204. },
  205. mounted() {
  206. this.getDataList()
  207. this.getHeight()
  208. },
  209. methods: {
  210. // 获取数据列表
  211. getDataList() {
  212. this.dataListLoading = true
  213. const params = {
  214. page: this.pageIndex,
  215. size: this.pageSize,
  216. site: localStorage.getItem('site'),
  217. ...this.queryHeaderData
  218. }
  219. getHandlingUnitLabelListLocation(params).then(({ data }) => {
  220. if (data && data.code === 0) {
  221. this.dataList = data.page.list || []
  222. this.totalPage = data.page.totalCount || 0
  223. } else {
  224. this.dataList = []
  225. this.totalPage = 0
  226. this.$message.error(data.msg || '查询失败')
  227. }
  228. this.dataListLoading = false
  229. }).catch(() => {
  230. this.dataList = []
  231. this.totalPage = 0
  232. this.dataListLoading = false
  233. })
  234. },
  235. // 重置查询条件
  236. resetQuery() {
  237. this.queryHeaderData = {
  238. inStockFlag: '',
  239. partNo: '',
  240. batchNo: '',
  241. locationId: '',
  242. unitId: '',
  243. partDesc: ''
  244. }
  245. this.pageIndex = 1
  246. this.getDataList()
  247. },
  248. // 每页数
  249. sizeChangeHandle(val) {
  250. this.pageSize = val
  251. this.pageIndex = 1
  252. this.getDataList()
  253. },
  254. // 当前页
  255. currentChangeHandle(val) {
  256. this.pageIndex = val
  257. this.getDataList()
  258. },
  259. // 格式化日期
  260. formatDate(date) {
  261. if (!date) return ''
  262. const d = new Date(date)
  263. const year = d.getFullYear()
  264. const month = String(d.getMonth() + 1).padStart(2, '0')
  265. const day = String(d.getDate()).padStart(2, '0')
  266. const hours = String(d.getHours()).padStart(2, '0')
  267. const minutes = String(d.getMinutes()).padStart(2, '0')
  268. const seconds = String(d.getSeconds()).padStart(2, '0')
  269. return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
  270. },
  271. // 获取表格高度
  272. getHeight() {
  273. this.$nextTick(() => {
  274. this.height = window.innerHeight - 220
  275. })
  276. },
  277. // 导出相关方法 - rqrq
  278. async createExportData() {
  279. const queryParams = {
  280. site: localStorage.getItem('site'),
  281. ...this.queryHeaderData,
  282. page: 1,
  283. size: 999999 // 设置一个很大的数字来获取全部数据 - rqrq
  284. }
  285. const {data} = await getHandlingUnitLabelAll(queryParams)
  286. if (data && data.code === 0) {
  287. return (data.page.list || []).map(item => {
  288. return {
  289. ...item,
  290. reserveFlag: item.reserveFlag === 'Y' ? '是' : '否'
  291. }
  292. })
  293. }
  294. return []
  295. },
  296. startDownload() {
  297. // 开始导出 - rqrq
  298. },
  299. finishDownload() {
  300. // 导出完成 - rqrq
  301. },
  302. fields() {
  303. let json = "{"
  304. this.columnList.forEach((item, index) => {
  305. if (index == this.columnList.length - 1) {
  306. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  307. } else {
  308. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  309. }
  310. })
  311. json += "}"
  312. let s = eval("(" + json + ")")
  313. return s
  314. },
  315. }
  316. }
  317. </script>
  318. <style>
  319. .mod-config .el-form-item {
  320. margin-bottom: 15px;
  321. }
  322. .sl-svg {
  323. font-size: 20px;
  324. cursor: pointer;
  325. color: #409EFF;
  326. }
  327. /* 其它入库标签打印表单样式 */
  328. .other-inbound-form .form-item-vertical {
  329. margin-bottom: 20px;
  330. }
  331. .other-inbound-form .form-item-vertical .el-form-item__label {
  332. display: block;
  333. text-align: left;
  334. padding: 0 0 8px 0;
  335. line-height: 1.5;
  336. font-weight: 500;
  337. }
  338. .other-inbound-form .form-item-vertical .el-form-item__content {
  339. margin-left: 0 !important;
  340. }
  341. .other-inbound-form .el-row {
  342. margin-bottom: 0;
  343. }
  344. </style>