diff --git a/api/warehouse/warehose.js b/api/warehouse/warehose.js index d5ebeaa..cb2e0b1 100644 --- a/api/warehouse/warehose.js +++ b/api/warehouse/warehose.js @@ -1,6 +1,6 @@ import upload from '@/utils/upload' import request from '@/utils/request' - +// 入库接口 ======== // 获取库位信息 export function getProductLocationInfo(params) { return request({ @@ -73,3 +73,70 @@ export function handlerIntoProductWarehouse(data) { }) } +// 一般退库 +export function handlErexitwarehouse(params) { + return request({ + url: '/mes/wm/exitwarehouse/common', + method: 'get', + params + }) +} + +// 2 根据箱标签的批次号,获取成品库内的信息 +export function getInfoByPatchCode(params) { + return request({ + url: '/mes/wm/WmMaterial/getInfoByPatchCode', + method: 'get', + params + }) +} + +// 出库接口 ========= + +/** + * 获取出货单(物料+客户)详情 + * @param {Id} + */ +export function getWmOutOrder(id) { + return request({ + url: '/mes/wm/WmOutOrder/' + id, + method: 'get' + }) +} + +/** + * 5.成品出库 + * @param {Id} + */ +export function doMaterialOut(data) { + return request({ + url: '/mes/wm/WmOutOrder/doMaterialOut', + method: 'post', + data + }) +} + +/** + * 5.出库单完成 + * @param {Id} + */ +export function doOverOutorderplan(params) { + return request({ + url: '/mes/wm/WmOutOrder/over_outorderplan', + method: 'get', + params + }) +} + +// 移库接口 +/** + * 移库(物料+客户) + * @data id,location + */ +export function UpdateWmGoodsOutProduction(data) { + return request({ + url: '/mes/wm/WmOutOrder', + method: 'PUT', + data: data, + }) +} \ No newline at end of file diff --git a/api/warehouse/wmGoodsNowProduction.js b/api/warehouse/wmGoodsNowProduction.js new file mode 100644 index 0000000..108471c --- /dev/null +++ b/api/warehouse/wmGoodsNowProduction.js @@ -0,0 +1,60 @@ +import request from '@/utils/request' + +/** +* 成品库当前货物表分页查询 +* @param {查询条件} data +*/ +export function listWmGoodsNowProduction(query) { + return request({ + url: '/mes/wm/WmGoodsNowProduction/list', + method: 'get', + params: query, + }) +} + +/** +* 新增成品库当前货物表 +* @param data +*/ +export function addWmGoodsNowProduction(data) { + return request({ + url: '/mes/wm/WmGoodsNowProduction', + method: 'post', + data: data, + }) +} +/** +* 修改成品库当前货物表 +* @param data +* 主键:id +* goodsNumAction 盘点零件号 +* locationCode 库存编号 +*/ +export function updateWmGoodsNowProduction(data) { + return request({ + url: '/mes/wm/WmGoodsNowProduction', + method: 'PUT', + data: data, + }) +} +/** +* 获取成品库当前货物表详情 +* @param {Id} +*/ +export function getWmGoodsNowProduction(id) { + return request({ + url: '/mes/wm/WmGoodsNowProduction/' + id, + method: 'get' + }) +} + +/** +* 删除成品库当前货物表 +* @param {主键} pid +*/ +export function delWmGoodsNowProduction(pid) { + return request({ + url: '/mes/wm/WmGoodsNowProduction/' + pid, + method: 'delete' + }) +} diff --git a/components/package-card/package-card.vue b/components/package-card/package-card.vue index 1d7b6f5..b083825 100644 --- a/components/package-card/package-card.vue +++ b/components/package-card/package-card.vue @@ -25,18 +25,19 @@ export default { props: { packageInfo: { default: { + id:-1, // 工单号 - workoderID:'240305021', + workoderID:'', // 批次号(工单号+箱号+班组) - patchCode: 'BNW240312023_18B1', + patchCode: '', // 零件号 - partNumner: '0215.000.801-6SU', + partNumner: '', // 描述 - productionDescribe: 'D365支架-幻影黒-后右', + productionDescribe: '', // 出厂日期/生产日期 - productionTime: '20240315', + productionTime: '', // 此箱数量 - quantity: 10, + quantity: 0, // 货物内部编号 originalCode:'' } @@ -51,7 +52,7 @@ export default { diff --git a/pages/relocation/relocation.vue b/pages/relocation/relocation.vue index 2b10917..8231a2d 100644 --- a/pages/relocation/relocation.vue +++ b/pages/relocation/relocation.vue @@ -1,23 +1,310 @@ - diff --git a/pages/returnWarehose/returnWarehose.vue b/pages/returnWarehose/returnWarehose.vue index 989082e..c0e2efa 100644 --- a/pages/returnWarehose/returnWarehose.vue +++ b/pages/returnWarehose/returnWarehose.vue @@ -1,17 +1,17 @@ @@ -76,8 +76,8 @@ export default { oldMaterialList: [], // 库位新录入货物信息 newMaterialList: [], - // 1-仓库扫码 2-货物扫码 - searchType: 1 + // 4-退库扫码 + searchType: 4 }; }, watch: {}, @@ -100,82 +100,67 @@ export default { this.clearData.warehouseInfo = JSON.parse(JSON.stringify(this.warehouseInfo)); this.clearData.oldMaterialList = JSON.parse(JSON.stringify(this.oldMaterialList)); this.clearData.newMaterialList = JSON.parse(JSON.stringify(this.newMaterialList)); - this.searchType = 1; + this.searchType = 4; }, clear() { this.warehouseInfo = JSON.parse(JSON.stringify(this.clearData.warehouseInfo)); this.oldMaterialList = JSON.parse(JSON.stringify(this.clearData.oldMaterialList)); this.newMaterialList = JSON.parse(JSON.stringify(this.clearData.newMaterialList)); - this.searchType = 1; + this.searchType = 4; }, handleGetInfo(data, type) { - if (type === 1) { - // 仓库扫完后是箱号 - this.searchType = 2; - this.warehouseInfo = data?.warehoseInfo; - this.newMaterialList = []; - } else if (type === 2) { + if (type === 4) { // 此时扫描的是箱号 // 当前录入的箱号是否在同一批次录入过 - if (this.newMaterialList.length > 0) { - uni.showModal({ - title: '提示', - content: '退库只可退一个货物!', - showCancel: false, - confirmText: '确定' - }); - return; - } - this.newMaterialList.push(data); + const checkData = { + originalCode: data.originalCode + }; + WarehoseApi.isExistedWarehouse(checkData).then((res) => { + if (this.newMaterialList.length > 0) { + uni.showModal({ + title: '提示', + content: '退库只可退一个货物!', + showCancel: false, + confirmText: '确定' + }); + return; + } + this.newMaterialList.push(data); + }); } }, - - // 长按弹出删除 - handleDeleteItem(item, index) { - // 双击判定 - this.touchNum++; - setTimeout(() => { - if (this.touchNum >= 2) { - uni.showModal({ - title: '删除提示', - content: '是否从列表中删除此货物?', - showCancel: true, - cancelText: '取消', - confirmText: '删除', - success: (res) => { - if (res.confirm) { - this.newMaterialList.splice(index, 1); - } - } - }); - } - this.touchNum = 0; - }, 250); - }, // 退库提交 handlerSubmit() { + if (this.newMaterialList.length === 0) { + uni.showModal({ + title: '提示', + content: '无退库货物!', + showCancel: false, + confirmText: '确定' + }); + return; + } uni.showModal({ - title: '入库操作', - content: '是否确认入库?', + title: '退库操作', + content: '是否确认执行退库操作?', showCancel: true, cancelText: '取消', - confirmText: '确认入库', + confirmText: '确认退库', success: (res) => { if (res.confirm) { let list = []; - for (item in this.newMaterialList) { - list.push(item.patchCode); + for (let item of this.newMaterialList) { + list.push(item.originalCode); } const data = { - location: this.warehouseInfo.location, - packagelist: list + originalCode: list[0] }; - WarehoseApi.handlerIntoProductWarehouse(data).then((res) => { + WarehoseApi.handlErexitwarehouse(data).then((res) => { if (res.code === 200) { if (!res.data) { uni.showModal({ title: '提示', - content: res.msg, + content: '退库异常:' + res.msg, showCancel: false, confirmText: '确定' }); @@ -183,13 +168,13 @@ export default { } uni.showToast({ icon: 'success', - title: '入库成功!' + title: '退库成功!' }); this.clear(); } else { uni.showToast({ icon: 'error', - title: '入库失败!' + title: '退库失败!' }); } }); diff --git a/pages/stocktake/stocktake.vue b/pages/stocktake/stocktake.vue index db320f8..a0cd1df 100644 --- a/pages/stocktake/stocktake.vue +++ b/pages/stocktake/stocktake.vue @@ -1,23 +1,287 @@ - diff --git a/permission.js b/permission.js index 24cf416..55d544c 100644 --- a/permission.js +++ b/permission.js @@ -22,11 +22,11 @@ list.forEach(item => { uni.addInterceptor(item, { invoke(to) { if (getToken()) { - if (to.url === loginPage) { - uni.reLaunch({ - url: loginPage - }) - } + // if (to.url === loginPage) { + // uni.reLaunch({ + // url: loginPage + // }) + // } return true } else { if (checkWhite(to.url)) { diff --git a/utils/request.js b/utils/request.js index ef427ce..86a96e6 100644 --- a/utils/request.js +++ b/utils/request.js @@ -17,7 +17,10 @@ import { let timeout = 10000 const request = config => { + // 浏览器测试用 const storageBaseUrl = 'http://' + getBaseUrl() + '/api'; + // 真机测试以及部署用 + // const storageBaseUrl = 'http://' + getBaseUrl(); // 是否需要设置 token const isToken = (config.headers || {}).isToken === false config.header = config.header || {} @@ -41,7 +44,8 @@ const request = config => { dataType: 'json' }).then(response => { let [error, res] = response - console.log(response); + // console.log('token:','Bearer ' + getToken()); + // console.log('request:',storageBaseUrl + config.url,response); if (error) { toast('后端接口连接异常') reject('后端接口连接异常')