From 69e1c14b6b848db04b1dbf9f6c67584cbd2325e3 Mon Sep 17 00:00:00 2001 From: Tom Date: Sat, 17 Jan 2026 13:08:45 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E7=89=A9=E6=96=99=E7=AE=A1=E7=90=86):=20?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E5=87=BA=E5=85=A5=E5=BA=93=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增入库记录和出库记录页面,包含表单提交、扫码识别、库位选择等功能 扩展uni-combox组件支持插槽和选择事件 添加相关API接口和样式文件 --- api/productionMaterial/inventory.js | 11 + api/productionMaterial/recordIOutbound.js | 49 +++ api/productionMaterial/recordInbound.js | 49 +++ pages/materialManagement/inventory/index.vue | 2 +- .../recordIOutbound/index.css | 36 ++ .../recordIOutbound/index.vue | 389 +++++++++++++++++- .../recordInbound/index.css | 6 + .../recordInbound/index.vue | 183 +++++++- .../components/uni-combox/uni-combox.vue | 15 +- 9 files changed, 696 insertions(+), 44 deletions(-) create mode 100644 api/productionMaterial/recordIOutbound.js create mode 100644 api/productionMaterial/recordInbound.js create mode 100644 pages/materialManagement/recordIOutbound/index.css diff --git a/api/productionMaterial/inventory.js b/api/productionMaterial/inventory.js index ccebfc7..42ed398 100644 --- a/api/productionMaterial/inventory.js +++ b/api/productionMaterial/inventory.js @@ -11,3 +11,14 @@ export function listMmInventory(query) { params: query, }); } + +/** + * 获取物料编码列表 + */ +export function getMaterialOption(query) { + return request({ + url: 'mes/productionMaterial/MmInventory/GetMaterialOption/', + method: 'post', + data: query + }) +} diff --git a/api/productionMaterial/recordIOutbound.js b/api/productionMaterial/recordIOutbound.js new file mode 100644 index 0000000..98cb20b --- /dev/null +++ b/api/productionMaterial/recordIOutbound.js @@ -0,0 +1,49 @@ +import request from "@/utils/request"; + +/** + * 物料表查询 + * @param {查询条件} data + */ +export function listMmMaterial(query) { + return request({ + url: '/mes/productionMaterial/MmMaterial/list', + method: 'get', + params: query + }) +} + +/** + * 库位表查询 + * @param {查询条件} data + */ +export function listMmLocation(query) { + return request({ + url: '/mes/productionMaterial/MmLocation/list', + method: 'get', + params: query + }) +} + +/** + * 出入库类别对照表查询 + * @param {查询条件} data + */ +export function listMmTransactionType(query) { + return request({ + url: '/mes/productionMaterial/MmTransactionType/list', + method: 'get', + params: query + }) +} + +/** + * 新增出库记录表 + * @param data + */ +export function addMmRecordOutbound(data) { + return request({ + url: '/mes/productionMaterial/MmRecordOutbound', + method: 'post', + data: data + }) +} diff --git a/api/productionMaterial/recordInbound.js b/api/productionMaterial/recordInbound.js new file mode 100644 index 0000000..b36831e --- /dev/null +++ b/api/productionMaterial/recordInbound.js @@ -0,0 +1,49 @@ +import request from "@/utils/request"; + +/** + * 物料表查询 + * @param {查询条件} data + */ +export function listMmMaterial(query) { + return request({ + url: '/mes/productionMaterial/MmMaterial/list', + method: 'get', + params: query + }) +} + +/** + * 库位表查询 + * @param {查询条件} data + */ +export function listMmLocation(query) { + return request({ + url: '/mes/productionMaterial/MmLocation/list', + method: 'get', + params: query + }) +} + +/** + * 出入库类别对照表查询 + * @param {查询条件} data + */ +export function listMmTransactionType(query) { + return request({ + url: '/mes/productionMaterial/MmTransactionType/list', + method: 'get', + params: query + }) +} + +/** + * 新增入库单 + * @param data + */ +export function createInboundReceipt(data) { + return request({ + url: '/mes/productionMaterial/MmInventory/CreateInboundReceipt', + method: 'post', + data: data + }) +} diff --git a/pages/materialManagement/inventory/index.vue b/pages/materialManagement/inventory/index.vue index 5113d78..2911b57 100644 --- a/pages/materialManagement/inventory/index.vue +++ b/pages/materialManagement/inventory/index.vue @@ -80,7 +80,7 @@ export default { this.currentPage = page; this.scanConfirm(this.lastScanValue); }, - // 扫工单码结果 + // 扫物料编码结果 scanConfirm(val) { this.lastScanValue = val; const params = { diff --git a/pages/materialManagement/recordIOutbound/index.css b/pages/materialManagement/recordIOutbound/index.css new file mode 100644 index 0000000..72419d6 --- /dev/null +++ b/pages/materialManagement/recordIOutbound/index.css @@ -0,0 +1,36 @@ +.example { + padding: 15px; + background-color: #fff; +} + +.segmented-control { + margin-bottom: 15px; +} + +.button-group { + margin-top: 15px; + display: flex; + justify-content: space-around; +} + +.form-item { + display: flex; + align-items: center; +} + +.button { + display: flex; + align-items: center; + height: 35px; + margin-left: 10px; +} + +.form-box { + padding: 12px; +} + +.location-name { + color: #999; + font-size: 12px; + margin-left: 10px; +} \ No newline at end of file diff --git a/pages/materialManagement/recordIOutbound/index.vue b/pages/materialManagement/recordIOutbound/index.vue index 1c07732..5a37f49 100644 --- a/pages/materialManagement/recordIOutbound/index.vue +++ b/pages/materialManagement/recordIOutbound/index.vue @@ -1,35 +1,380 @@ -vue \ No newline at end of file +@import "./index.css"; + diff --git a/pages/materialManagement/recordInbound/index.css b/pages/materialManagement/recordInbound/index.css index af26c14..72419d6 100644 --- a/pages/materialManagement/recordInbound/index.css +++ b/pages/materialManagement/recordInbound/index.css @@ -27,4 +27,10 @@ .form-box { padding: 12px; +} + +.location-name { + color: #999; + font-size: 12px; + margin-left: 10px; } \ No newline at end of file diff --git a/pages/materialManagement/recordInbound/index.vue b/pages/materialManagement/recordInbound/index.vue index 408cf53..9d49191 100644 --- a/pages/materialManagement/recordInbound/index.vue +++ b/pages/materialManagement/recordInbound/index.vue @@ -19,11 +19,6 @@ label-width="120" > - - + @select="handleLocationSelect" + > + + @@ -78,11 +80,19 @@ /> - - + + + + @@ -121,15 +131,22 @@ diff --git a/uni_modules/uni-combox/components/uni-combox/uni-combox.vue b/uni_modules/uni-combox/components/uni-combox/uni-combox.vue index 83454e5..b8721b5 100644 --- a/uni_modules/uni-combox/components/uni-combox/uni-combox.vue +++ b/uni_modules/uni-combox/components/uni-combox/uni-combox.vue @@ -16,7 +16,9 @@ {{emptyTips}} - {{item}} + + {{item}} + @@ -39,7 +41,7 @@ */ export default { name: 'uniCombox', - emits: ['input', 'update:modelValue'], + emits: ['input', 'update:modelValue', 'select'], props: { border: { type: Boolean, @@ -143,10 +145,12 @@ } }, onSelectorClick(index) { - this.inputVal = this.filterCandidates[index] + const selectedItem = this.filterCandidates[index] + this.inputVal = selectedItem this.showSelector = false this.$emit('input', this.inputVal) this.$emit('update:modelValue', this.inputVal) + this.$emit('select', selectedItem) }, onInput() { setTimeout(() => { @@ -232,9 +236,12 @@ display: flex; cursor: pointer; /* #endif */ + flex-direction: row; + justify-content: flex-start; + align-items: center; line-height: 36px; font-size: 14px; - text-align: center; + text-align: left; // border-bottom: solid 1px #DDDDDD; padding: 0px 10px; }