diff --git a/.env.production b/.env.production index a702bf97..c7a22f1e 100644 --- a/.env.production +++ b/.env.production @@ -3,8 +3,8 @@ VUE_APP_TITLE = UDI管理系统 # 生产环境配置 ENV = 'production' -VUE_APP_BASE_API = 'http://116.204.71.86:9150/UDI_WMS_MC/' -# VUE_APP_BASE_API = 'http://192.168.0.62:9150/UDI_WMS_MC/' +# VUE_APP_BASE_API = 'http://116.204.71.86:9150/UDI_WMS_MC/' +VUE_APP_BASE_API = 'http://192.168.0.62:9150/UDI_WMS_MC/' # 应用访问路径 例如使用前缀 /admin/ VUE_APP_CONTEXT_PATH = '/UDI_WMS_NEW/' diff --git a/src/api/basic/busType.js b/src/api/basic/busType.js index 6a5cc34c..b156622d 100644 --- a/src/api/basic/busType.js +++ b/src/api/basic/busType.js @@ -8,6 +8,15 @@ export function getBusTypeList(params) { }); } +export function getLocalJoinByUser(params) { + return axios({ + url: "/udiwms/localBusType/filterJoinByUser", + method: "get", + params: params + }); +} + + export function insertBusType(data) { return axios({ url: "/udiwms/bussinessType/insert", diff --git a/src/api/inout/order.js b/src/api/inout/order.js new file mode 100644 index 00000000..55a1d66c --- /dev/null +++ b/src/api/inout/order.js @@ -0,0 +1,378 @@ +import axios from '@/utils/request' + + +export function orderList(query) { + return axios({ + url: "/admin/warehouse/inout/order/list", + method: "get", + params: query + }); +} + +export function orderGetUdi(query) { + return axios({ + url: "/udiwms/inout/order/getUdi", + method: "get", + params: query + }); +} + +export function deleteCodesTempById(query) { + return axios({ + url: "/warehouse/inout/deleteCodesTempById", + method: "get", + params: query + }); +} + +export function submitOrderWeb(query) { + return axios({ + url: "/warehouse/inout/submitOrderWeb", + method: "get", + params: query + }); +} + + +export function saveOrderWeb(query) { + return axios({ + url: "/warehouse/inout/saveOrderWeb", + method: "post", + data: query + }); +} + + +export function orderListError(query) { + return axios({ + url: "/udiwms/inout/order/error", + method: "get", + params: query + }); +} + +export function orderListRepeat(query) { + return axios({ + url: "/admin/warehouse/inout/order/listRepeat", + method: "get", + params: query + }); +} + +export function codeList(query) { + return axios({ + url: "/admin/warehouse/inout/findByOrderId", + method: "get", + params: query + }); +} + +export function addOrderWeb(query) { + return axios({ + url: "/warehouse/inout/addOrderWeb", + method: "post", + data: query + }); +} + +export function enterCodeWeb(query) { + return axios({ + url: "/warehouse/inout/enterCode", + method: "post", + data: query + }); +} + + +export function postOrdersWeb(query) { + return axios({ + url: "/warehouse/inout/postOrdersWeb", + method: "post", + data: query + }); +} + +export function mergeOrder(query) { + return axios({ + url: "/warehouse/inout/order/mergeOrder", + method: "post", + data: query + }); +} + +export function updateUnit(query) { + return axios({ + url: "/udiwms/inout/order/updateUnit", + method: "post", + data: query + }); +} + +export function filterOrder(query) { + return axios({ + url: "/udiwms/inout/order/filter", + method: "get", + params: query + }); +} + +export function selectNew(query) { + return axios({ + url: "/admin/warehouse/inout/order/selectNew", + method: "get", + params: query + }); +} + +export function selectWait(query) { + return axios({ + url: "/sale/inout/order/selectWait", + method: "get", + params: query + }); +} + +export function selectStatus(query) { + return axios({ + url: "/sale/inout/order/selectStatus", + method: "get", + params: query + }); +} + +export function selectDownload(query) { + return axios({ + url: "/sale/inout/order/selectDownload", + method: "get", + params: query + }); +} + +export function selectFinish(query) { + return axios({ + url: "/sale/inout/order/selectFinish", + method: "get", + params: query + }); +} + +export function selectSubOrders(query) { + return axios({ + url: "/sale/inout/order/selectSubOrders", + method: "get", + params: query + }); +} + + +export function errorCodeList(query) { + return axios({ + url: "/admin/warehouse/inout/findErrorByOrderId", + method: "get", + params: query + }); +} + +export function deleteByOrderId(query) { + return axios({ + url: "/udiwms/inout/order/delete", + method: "post", + data: query + }); +} + +export function deleteCodes(query) { + return axios({ + url: "/warehouse/inout/code/deleteCodes", + method: "post", + data: query + }); +} + +export function commitOrder(query) { + return axios({ + url: "/warehouse/inout/commit", + method: "post", + data: query + }); +} + +export function addCommitOrder(query) { + return axios({ + url: "/warehouse/inout/addCommit", + method: "post", + data: query + }); +} + + +export function updateExportStatus(query) { + return axios( + { + url: "/warehouse/inout/order/updateExportStatus", + method: "post", + data: query + } + ) +} + +export function orderDetail(query) { + return axios( + { + url: "/warehouse/inout/order/detail", + method: "get", + params: query + } + ) +} + +export function updateBind(query) { + return axios( + { + url: "/udiwms/erpOrder/updateBind", + method: "post", + data: query + } + ) +} + +export function updateBindSup(query) { + return axios( + { + url: "/udiwms/erpOrder/updateBindSup", + method: "post", + data: query + } + ) +} + +export function updateCodeBindSup(query) { + return axios( + { + url: "/udiwms/addCode/updateBindSup", + method: "post", + data: query + } + ) +} + +export function backStock(query) { + return axios( + { + url: "/sale/inout/order/backStock", + method: "get", + params: query + } + ) +} + +export function uploadOrder(query) { + return axios( + { + url: "/warehouse/inout/order/uploadOrder", + method: "post", + data: query + } + ) +} + +export function moveStock(query) { + return axios( + { + url: "/sale/inout/order/moveStock", + method: "post", + data: query + } + ) +} + + +export function findAllByOrderId(query) { + return axios({ + url: "/admin/warehouse/inout/findAllByOrderId", + method: "get", + params: query + }); +} + +export function revokeOredr(query) { + return axios({ + url: "/spms/inout/order/revoke", + method: "get", + params: query + }); +} + +export function exportJson(query) { + return axios({ + url: "/warehouse/inout/order/exportXml", + method: "post", + data: query, + headers: {'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'}, + responseType: 'arraybuffer', //一定要设置响应类型,否则页面会是空白pdf + }); +} + + +export function expireTimeCheck(query) { + return axios( + { + url: "/warehouse/inout/expireTimeCheck", + method: "post", + data: query + } + ) +} + +export function filterOrderForDelete(params) { + return axios({ + url: "/udiwms/inout/order/filterOrderForDelete", + method: "get", + params: params + }); +} + +export function updateOrderInfo(data) { + return axios({ + url: "/udiwms/inout/order/updateOrderInfo", + method: "post", + data: data + }) +} + + +export function getOrderById(params) { + return axios({ + url: "/udiwms/inout/order/getOrderById", + method: "get", + params: params + }) +} + + +export function updateOrder(data) { + return axios({ + url: "/udiwms/inout/order/updateOrder", + method: "post", + data: data + }) +} + + +export function uploadSpms(query) { + return axios( + { + url: "/warehouse/inout/order/uploadSpms", + method: "post", + data: query + } + ); +} + +export function updateOrderPrintRemark(data) { + return axios({ + url: "/udiwms/inout/order/updateOrderPrintRemark", + method: "post", + data: data + }); +} diff --git a/src/api/system/invSubWarehouse.js b/src/api/system/invSubWarehouse.js index 9415aac6..b9313da7 100644 --- a/src/api/system/invSubWarehouse.js +++ b/src/api/system/invSubWarehouse.js @@ -8,6 +8,14 @@ export function filterSubAll(query) { params: query }); } +export function findByInvUser(query) { + return axios({ + url: "/udiwms/busType/findByInvUser", + method: "get", + params: query + }); +} + export function filterSubByInv(query) { return axios({ @@ -17,6 +25,16 @@ export function filterSubByInv(query) { }); } + +export function findByDeptUser(query) { + return axios({ + url: "/spms/inv/warehouse/findByDeptUser", + method: "get", + params: query + }); +} + + export function filterSub(query) { return axios({ url: "/spms/sub/inv/warehouse/filterSub", diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue index 6f5aa109..f99e5cdc 100644 --- a/src/layout/components/Navbar.vue +++ b/src/layout/components/Navbar.vue @@ -1,50 +1,106 @@ @@ -113,7 +276,7 @@ export default { overflow: hidden; position: relative; background: #fff; - box-shadow: 0 1px 4px rgba(0,21,41,.08); + box-shadow: 0 1px 4px rgba(0, 21, 41, .08); .hamburger-container { line-height: 46px; @@ -121,7 +284,7 @@ export default { float: left; cursor: pointer; transition: background .3s; - -webkit-tap-highlight-color:transparent; + -webkit-tap-highlight-color: transparent; &:hover { background: rgba(0, 0, 0, .025) @@ -169,6 +332,14 @@ export default { } } + .inv-hos-title { + display: inline-block; + height: 100%; + font-size: 18px; + color: #5a5e66; + vertical-align: text-bottom; + } + .avatar-container { margin-right: 30px; diff --git a/src/plugins/KeyScaner.js b/src/plugins/KeyScaner.js new file mode 100644 index 00000000..ee57b6c7 --- /dev/null +++ b/src/plugins/KeyScaner.js @@ -0,0 +1,115 @@ +"use strict"; +/** + * 浏览器按键处理 + * howay + * 20200421 + * 1.0 + */ +const KeyScaner = /** @class */ (function () { + function KeyScaner(_dom) { + this.keybufs = []; + this.altBuf = []; + this.isShift = false; + this.lastTime = 0; + /** + * 在收集到文本输入时触发 + * @param text 收集到的连续文本 + */ + this.onInput = function (text) { + }; + this.dom = _dom; + _dom.addEventListener('keydown', this.onKeyDown.bind(this)); + _dom.addEventListener('keyup', this.onKeyUp.bind(this)); + this.interval = setInterval(this.onTick.bind(this), 100); + } + + KeyScaner.prototype.appendChar = function (c) { + this.keybufs.push(c); + }; + KeyScaner.prototype.onKeyDown = function (ev) { + this.lastTime = new Date().getTime(); + if (ev.key == "Alt") { + if (ev.shiftKey || ev.ctrlKey || ev.metaKey) { + return; + } + } else if (ev.key == "Shift") { + if (ev.altKey || ev.ctrlKey || ev.metaKey) { + return; + } + this.isShift = true; + } else if (ev.key == "Enter") { + if (ev.shiftKey || ev.altKey || ev.ctrlKey || ev.metaKey) { + return; + } + this.appendChar("\r"); + this.completeInput(); //立即完成输入 + } else if (ev.key == "Delete" || ev.key == "Backspace") { + this.dom.innerTex = ""; + this.appendChar("delete"); + this.completeInput(); //立即完成输入 + } else { + if (ev.key.length == 1) { + var charCode = ev.key.charCodeAt(0); + console.log("key="+charCode); + if (charCode >= 48 && charCode <= 57) { + if (ev.altKey) { + this.altBuf.push(ev.key); + } else { + this.appendChar(ev.key); + } + } else if ((charCode >= 65 && charCode <= 90) || (charCode >= 97 && charCode <= 122)) { + //忽略大小写锁定键,直接通过SHIFT键判断大小写 + if (ev.shiftKey) { + this.appendChar(ev.key.toUpperCase()); + } else { + this.appendChar(ev.key.toLowerCase()); + } + } else { + this.appendChar(ev.key); + } + } + //忽略其他控制键 + } + }; + KeyScaner.prototype.onKeyUp = function (ev) { + this.lastTime = new Date().getTime(); + if (ev.key == "Alt") { + if (this.altBuf && this.altBuf.length > 0) { + var str = this.altBuf.join(""); + var num = parseInt(str); + var c = String.fromCharCode(num); + this.appendChar(c); + this.altBuf = []; + } + } else if (ev.key == "Shift") { + this.isShift = false; + } + }; + KeyScaner.prototype.completeInput = function () { + var text = this.keybufs.join(""); + this.keybufs = []; + if (this.onInput) { + this.onInput.bind(this)(text); + } + }; + KeyScaner.prototype.onTick = function () { + if (this.keybufs && this.keybufs.length > 0 && (!this.altBuf || this.altBuf.length == 0) && new Date().getTime() - this.lastTime > 500) { + //有缓存的字符,且没有缓存的alt字符 且 与上次按键时间超过500毫秒。 收集输入 + // this.completeInput(); + } + }; + /** + * 释放资源 + */ + KeyScaner.prototype.dispose = function () { + this.dom.removeEventListener('keydown', this.onKeyDown); + this.dom.removeEventListener('keyup', this.onKeyUp); + clearInterval(this.interval); + }; + return KeyScaner; +}()); + +export default { + KeyScaner +} + diff --git a/src/store/getters.js b/src/store/getters.js index b921d03e..b3dedfe4 100644 --- a/src/store/getters.js +++ b/src/store/getters.js @@ -16,5 +16,11 @@ const getters = { defaultRoutes: state => state.permission.defaultRoutes, sidebarRouters: state => state.permission.sidebarRouters, customerId: state => state.user.customerId, + companyName: state => state.user.companyName, + locDeptCode: state => state.user.locDeptCode, + locInvCode: state => state.user.locInvCode, + locDeptName: state => state.user.locDeptName, + locInvName: state => state.user.locInvName, + adminId: state => state.user.adminId, } export default getters diff --git a/src/store/modules/user.js b/src/store/modules/user.js index 1665f010..97d886be 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -3,15 +3,19 @@ import {getToken, setToken, removeToken, removeAdminId, setAdminId} from '@/util const user = { state: { - adminId:"", + adminId: "", token: getToken(), name: '', avatar: '', roles: [], permissions: [], - employeeName:"", - customerId:"", - companyName:"", + employeeName: "", + customerId: "", + companyName: "", + locDeptCode: "", + locInvCode: "", + locDeptName: "", + locInvName: "", }, mutations: { @@ -19,7 +23,6 @@ const user = { SET_ADMINID: (state, adminId) => { state.adminId = adminId }, - SET_TOKEN: (state, token) => { state.token = token }, @@ -45,6 +48,18 @@ const user = { SET_COMPANYNAME: (state, companyName) => { state.companyName = companyName }, + SET_LOCDEPTCODE: (state, locDeptCode) => { + state.locDeptCode = locDeptCode + }, + SET_LOCIVNCODE: (state, locInvCode) => { + state.locInvCode = locInvCode + }, + SET_LOCDEPTNAME: (state, locDeptName) => { + state.locDeptName = locDeptName + }, + SET_LOCIVNNAME: (state, locInvName) => { + state.locInvName = locInvName + }, }, actions: { @@ -84,7 +99,12 @@ const user = { commit('SET_EMPLOYEENAME', user.employeeName) commit('SET_CUSTOMERID', user.customerId) commit('SET_COMPANYNAME', user.companyName) + commit('SET_LOCDEPTCODE', user.locDeptCode) + commit('SET_LOCIVNCODE', user.locInvCode) + commit('SET_LOCDEPTNAME', user.locDeptName) + commit('SET_LOCIVNNAME', user.locInvName) resolve(res) + console.log("获取用户数据成功-=----"); }).catch(error => { reject(error) }) @@ -102,6 +122,10 @@ const user = { commit('SET_EMPLOYEENAME', "") commit('SET_CUSTOMERID', "") commit('SET_COMPANYNAME', "") + commit('SET_LOCDEPTCODE', "") + commit('SET_LOCIVNCODE', "") + commit('SET_LOCDEPTNAME', "") + commit('SET_LOCIVNNAME', "") removeToken() removeAdminId() resolve() @@ -111,16 +135,6 @@ const user = { }) }, - // 前端 登出 - FedLogOut({commit}) { - return new Promise(resolve => { - commit('SET_TOKEN', '') - commit('SET_ADMINID', '') - removeToken() - removeAdminId() - resolve() - }) - } } } diff --git a/src/utils/coTools.js b/src/utils/coTools.js new file mode 100644 index 00000000..03dd60b6 --- /dev/null +++ b/src/utils/coTools.js @@ -0,0 +1,144 @@ +function pluralize(time, label) { + if (time === 1) { + return time + label; + } + return time + label + "s"; +} +export function timeAgo(time) { + const between = Date.now() / 1000 - Number(time); + if (between < 3600) { + return pluralize(~~(between / 60), " minute"); + } else if (between < 86400) { + return pluralize(~~(between / 3600), " hour"); + } else { + return pluralize(~~(between / 86400), " day"); + } +} + +export function parseTime(time, cFormat) { + if (arguments.length === 0) { + return null; + } + + if ((time + "").length === 10) { + time = +time * 1000; + } + + const format = cFormat || "{y}-{m}-{d} {h}:{i}:{s}"; + let date; + if (typeof time === "object") { + date = time; + } else { + date = new Date(parseInt(time)); + } + const formatObj = { + y: date.getFullYear(), + m: date.getMonth() + 1, + d: date.getDate(), + h: date.getHours(), + i: date.getMinutes(), + s: date.getSeconds(), + a: date.getDay() + }; + const timeStr = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => { + let value = formatObj[key]; + if (key === "a") + return ["一", "二", "三", "四", "五", "六", "日"][value - 1]; + if (result.length > 0 && value < 10) { + value = "0" + value; + } + return value || 0; + }); + return timeStr; +} +export function rTime(date) { + var json_date = new Date(date).toJSON(); + return new Date(new Date(json_date) + 8 * 3600 * 1000) + .toISOString() + .replace(/T/g, " ") + .replace(/\.[\d]{3}Z/, ""); +} +export function formatTime(time, option) { + time = +time * 1000; + const d = new Date(time); + const now = Date.now(); + + const diff = (now - d) / 1000; + + if (diff < 30) { + return "刚刚"; + } else if (diff < 3600) { + // less 1 hour + return Math.ceil(diff / 60) + "分钟前"; + } else if (diff < 3600 * 24) { + return Math.ceil(diff / 3600) + "小时前"; + } else if (diff < 3600 * 24 * 2) { + return "1天前"; + } + if (option) { + return parseTime(time, option); + } else { + return ( + d.getMonth() + + 1 + + "月" + + d.getDate() + + "日" + + d.getHours() + + "时" + + d.getMinutes() + + "分" + ); + } +} + +/* 数字 格式化 */ +export function nFormatter(num, digits) { + const si = [ + { value: 1e18, symbol: "E" }, + { value: 1e15, symbol: "P" }, + { value: 1e12, symbol: "T" }, + { value: 1e9, symbol: "G" }, + { value: 1e6, symbol: "M" }, + { value: 1e3, symbol: "k" } + ]; + for (let i = 0; i < si.length; i++) { + if (num >= si[i].value) { + return ( + (num / si[i].value + 0.1) + .toFixed(digits) + .replace(/\.0+$|(\.[0-9]*[1-9])0+$/, "$1") + si[i].symbol + ); + } + } + return num.toString(); +} + +export function html2Text(val) { + const div = document.createElement("div"); + div.innerHTML = val; + return div.textContent || div.innerText; +} + +export function toThousandslsFilter(num) { + return (+num || 0) + .toString() + .replace(/^-?\d+/g, m => m.replace(/(?=(?!\b)(\d{3})+$)/g, ",")); +} + +/** + * 格式化文件大小 + * @param value + * @returns {*} + */ +export function renderSize(value) { + if (!value || value === null || value === "") { + return ""; + } + let unitArr = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"]; + let srcsize = parseFloat(value); + let index = Math.floor(Math.log(srcsize) / Math.log(1024)); + let size = srcsize / Math.pow(1024, index); + size = size.toFixed(0); // 保留的小数位数 + return size + unitArr[index]; +} diff --git a/src/views/inout/IoCreateOrder.vue b/src/views/inout/IoCreateOrder.vue new file mode 100644 index 00000000..e5c599ab --- /dev/null +++ b/src/views/inout/IoCreateOrder.vue @@ -0,0 +1,1060 @@ + + + + + + + + + diff --git a/src/views/inout/IoCreateOrderBizDetail.vue b/src/views/inout/IoCreateOrderBizDetail.vue new file mode 100644 index 00000000..35f6c816 --- /dev/null +++ b/src/views/inout/IoCreateOrderBizDetail.vue @@ -0,0 +1,15 @@ + + + + + diff --git a/src/views/inout/IoCreateOrderCodeDetail.vue b/src/views/inout/IoCreateOrderCodeDetail.vue new file mode 100644 index 00000000..0356d0f5 --- /dev/null +++ b/src/views/inout/IoCreateOrderCodeDetail.vue @@ -0,0 +1,15 @@ + + + + + diff --git a/src/views/inout/IoCreateOrderCodes.vue b/src/views/inout/IoCreateOrderCodes.vue new file mode 100644 index 00000000..c93032c4 --- /dev/null +++ b/src/views/inout/IoCreateOrderCodes.vue @@ -0,0 +1,211 @@ + + + + + diff --git a/src/views/inout/IoNewOrder.vue b/src/views/inout/IoNewOrder.vue new file mode 100644 index 00000000..3d14f1b9 --- /dev/null +++ b/src/views/inout/IoNewOrder.vue @@ -0,0 +1,737 @@ + + + + + + diff --git a/src/views/login.vue b/src/views/login.vue index 4bceb026..916a8a73 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -56,7 +56,7 @@ diff --git a/src/views/system/dept/authDept.vue b/src/views/system/dept/authDept.vue index 02bc2315..8caf0cdc 100644 --- a/src/views/system/dept/authDept.vue +++ b/src/views/system/dept/authDept.vue @@ -166,11 +166,9 @@ - {{ currentRow.name }}-用户列表 - - @@ -226,7 +223,6 @@ -