diff --git a/build/build-uat.js b/build/build-uat.js new file mode 100644 index 0000000000000000000000000000000000000000..b0840eba6af38dd47950f015d62938aaa5d31fc1 --- /dev/null +++ b/build/build-uat.js @@ -0,0 +1,35 @@ +require('./check-versions')() + +process.env.NODE_ENV = 'uat' + +var ora = require('ora') +var rm = require('rimraf') +var path = require('path') +var chalk = require('chalk') +var webpack = require('webpack') +var config = require('../config') +var webpackConfig = require('./webpack.uat.conf') + +var spinner = ora('building for uat...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, function (err, stats) { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, + chunks: false, + chunkModules: false + }) + '\n\n') + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/webpack.uat.conf.js b/build/webpack.uat.conf.js new file mode 100644 index 0000000000000000000000000000000000000000..74142d036183886dbafdae12d7fc886089ccf9de --- /dev/null +++ b/build/webpack.uat.conf.js @@ -0,0 +1,127 @@ +var path = require('path') +var utils = require('./utils') +var webpack = require('webpack') +var config = require('../config') +var merge = require('webpack-merge') +var baseWebpackConfig = require('./webpack.base.conf') +var CopyWebpackPlugin = require('copy-webpack-plugin') +var HtmlWebpackPlugin = require('html-webpack-plugin') +var ExtractTextPlugin = require('extract-text-webpack-plugin') +var OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') + +var env = require('../config/uat.env') + +function resolveApp(relativePath) { + return path.resolve(relativePath); +} + +var webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true + }) + }, + devtool: config.build.productionSourceMap ? '#source-map' : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new webpack.optimize.UglifyJsPlugin({ + compress: { + warnings: false + }, + sourceMap: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css') + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: { + safe: true + } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: resolveApp('favicon.ico'), + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // cache Module Identifiers + new webpack.HashedModuleIdsPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks: function (module, count) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + chunks: ['vendor'] + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + var CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js index 964a7edd78921875bbb0a3f4858d9a2bf6d8b823..4b5832ffbd01fbfe663dcd96c441ca9519b4e7db 100644 --- a/config/dev.env.js +++ b/config/dev.env.js @@ -4,6 +4,11 @@ var prodEnv = require('./prod.env') module.exports = merge(prodEnv, { NODE_ENV: '"development"', // BASE_API: '"http://113.105.88.142:8580/wms-admin"', - BASE_API: '"http://localhost:8090"', + // BASE_API: '"http://10.20.30.111/wms-admin/"', + // BASE_API: '"http://10.2.4.40:8090/admin/"', + // BASE_API: '"http://10.2.6.12:8090"', + BASE_API: '"http://10.2.6.6:8090"', + // BASE_API: '"http://10.2.6.250:8090/"', + // BASE_API: '"http://localhost:8090"', BASE_API_LOGIN:'"http://10.20.30.111:8090/uaa"' }) diff --git a/config/uat.env.js b/config/uat.env.js new file mode 100644 index 0000000000000000000000000000000000000000..72985e5b0ce47e6ed2d5b4e2686f306363bfbf5b --- /dev/null +++ b/config/uat.env.js @@ -0,0 +1,8 @@ +var merge = require('webpack-merge') +var prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"', + BASE_API: '"http://113.105.88.142:8580/wms-admin"', + BASE_API_LOGIN:'"http://10.20.30.111:8090/uaa"' +}) diff --git a/package.json b/package.json index 261fc22a732ab8c78859c96459c59543394594eb..264841ae633688e6a3f7083a89af1e0b15e2cc1c 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "dev": "node build/dev-server.js", "start": "node build/dev-server.js", "build": "node build/build.js", + "build-uat": "node build/build-uat.js", "lint": "eslint --ext .js,.vue src" }, "dependencies": { diff --git a/src/api/inbound/inboundPutaway.js b/src/api/inbound/inboundPutaway.js index e7578841799c717906eac6a9225de88d144d29e5..7faaa5c60741edac2edfb29707e0cbc7d2ef4ac9 100644 --- a/src/api/inbound/inboundPutaway.js +++ b/src/api/inbound/inboundPutaway.js @@ -35,3 +35,12 @@ export function queryUsableLocation(data) { }) } +// 生成二维码 /inboundTask/printBarcode +export function printBarcode(data) { + return fetch({ + url: '/inboundTask/printBarcode', + method: 'post', + data: data + }) +} + diff --git a/src/api/stock/initStock.js b/src/api/stock/initStock.js index 6688155bdf6a394b794fc8d895fbceebdb3cce52..a2e5fa2966c476302447e114ecc037bbd31dc826 100644 --- a/src/api/stock/initStock.js +++ b/src/api/stock/initStock.js @@ -1,6 +1,6 @@ import fetch from '@/utils/fetch' -// 获取供应商信息 +// 导入excel export function importStockInit(data) { return fetch({ url: '/stockInit/importStockInit', @@ -8,3 +8,11 @@ export function importStockInit(data) { data: data }) } +// 列表查询 +export function getStockInitList(data) { + return fetch({ + url: '/stockInit/getStockInitList', + method: 'post', + data: data + }) +} diff --git a/src/main.js b/src/main.js index f4a38044dd9ba5db9158320abacecaebac3fa1e7..6c187871e67f2fcc9c90587ee2dd99ef0c0052dc 100644 --- a/src/main.js +++ b/src/main.js @@ -11,7 +11,9 @@ import '@/filter/customFilters' // 自定义过滤器 import LODOP from 'static/plugIn/LodopFuncs' // import './mock' -Vue.use(ElementUI) +Vue.use(ElementUI, { + size: 'small' +}) Vue.config.productionTip = false diff --git a/src/store/getters.js b/src/store/getters.js index 8cbe96a5dd32e9fadde2366bf4b3de11c34bf7ba..19cfed9c75df045128bb97b825e95f1d0336f614 100644 --- a/src/store/getters.js +++ b/src/store/getters.js @@ -4,6 +4,8 @@ const getters = { avatar: state => state.account.avatar, name: state => state.account.name, roles: state => state.account.roles, + storehouses: state => state.account.storehouses, + currentStorehouse: state => state.account.currentStorehouse, entityName: state => state.account.entityName, allrouter: state => state.navs.routers, nav_routers: state => state.navs.addRouters, diff --git a/src/store/modules/account.js b/src/store/modules/account.js index 778fbf21cf42ed10a524278f4f3645e6af2f112a..7c9b1db74903510767b289f6fb4f1171aceadf5a 100644 --- a/src/store/modules/account.js +++ b/src/store/modules/account.js @@ -7,7 +7,9 @@ const account = { token: getToken(), name: '', avatar: '', - roles: [] + roles: [], + storehouses: [], + currentStorehouse: {} }, mutations: { @@ -25,6 +27,12 @@ const account = { }, SET_ENTITYNAME: (state, entityName) => { state.entityName = entityName + }, + SET_STOREHOUSES: (state, storehouses) => { + state.storehouses = storehouses + }, + SET_CURRENT_STOREHOUSE: (state, storehouse) => { + state.currentStorehouse = storehouse } }, @@ -52,7 +60,6 @@ const account = { }, // 刷新token RefreshToken({ commit }) { - console.log('刷新token') return new Promise((resolve, reject) => { const formData = new FormData() formData.append('grant_type', 'refresh_token') @@ -97,6 +104,8 @@ const account = { commit('SET_NAME', data.userName) commit('SET_AVATAR', data.avatar) commit('SET_ENTITYNAME', data.entityName) + commit('SET_STOREHOUSES', data.storehouses) + commit('SET_CURRENT_STOREHOUSE', data.storehouses[0]) resolve(response) }).catch(error => { reject(error) diff --git a/src/styles/index.scss b/src/styles/index.scss index a2eb3e3a4b9063b60bc56d37af07044ea24a47a8..6c2ebd1db144f1f4de79a9f38fcf389a0a589526 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -67,7 +67,7 @@ a:hover { //main-container全局样式 .app-main{ - overflow-y: scroll; + //overflow-y: scroll; } .app-container { @@ -142,6 +142,9 @@ a:hover { .h70{ height: 70px!important; } +.h46{ + height: 46px!important; +} .h0{ height: 0; transition:height 0.5s; @@ -190,9 +193,27 @@ a:hover { .w400{ width: 400px; } +.w200{ + width: 200px!important; +} .fsc-keep div{ word-break:keep-all !important; } .height-auto{ height: auto; } +.cell{ + white-space:nowrap!important; +} +.el-dialog{ + hr{ + border: 0.5px solid #d8dce5; + margin-bottom: 14px; + } +} +.el-dialog__body{ + padding: 0 0 10px 10px; +} +.el-dialog__header{ + padding: 15px 15px 2px; +} diff --git a/src/styles/printCss/index.css b/src/styles/printCss/index.css index 8256dc785c7a6b4efb8c152ece72f2788f2489c2..4fd541a1beb1dcc2fe70f825e1a2a87904f38ce1 100644 --- a/src/styles/printCss/index.css +++ b/src/styles/printCss/index.css @@ -1,3 +1,11 @@ #big{ font-size: 65px; } +.print-QR-img{ + width: 160px; + height: 170px; + border: 1px solid #000; +} +.print-QR-row{ + margin-bottom: 50px; +} diff --git a/src/utils/tools.js b/src/utils/tools.js index 9d17ab43e9cf730c019ca136105f8d017eb5cfe3..a3c44e5a51b72a729fcebcb8d994d54be5342201 100644 --- a/src/utils/tools.js +++ b/src/utils/tools.js @@ -23,11 +23,7 @@ export function checkPrintInstall(obj) { a.click() // window.open('static/plugin/Lodop6.220_CLodop3.020.zip') }).catch(() => { - Message({ - type: 'warning', - message: '未安装插件', - duration: 2 * 1000 - }); + // }); return false } diff --git a/src/views/inbound/inboundPutaway.vue b/src/views/inbound/inboundPutaway.vue index 1599e456b538eea372565989e14a20f4b8255e64..78330aaed2655e69352c757552b308fb73234e33 100644 --- a/src/views/inbound/inboundPutaway.vue +++ b/src/views/inbound/inboundPutaway.vue @@ -12,7 +12,7 @@ + v-model="search.condition.key" @keyup.enter.native.prevent="list"> 搜索 @@ -58,7 +58,7 @@
-
+
- + +
+ + 车架号(vin) + + + 入库确认 + 打印二维码 + + - - - - - + +
{{columnDetailDialogList.ownerOrderNo}}
- - + +
{{columnDetailDialogList.lotNo1}}
- - + +
{{columnDetailDialogList.materielName}}
- - + +
{{columnDetailDialogList.ownerId}}
- - + +
{{columnDetailDialogList.storeHouseName}}
- - + +
{{columnDetailDialogList.gmtCreate}}
- - + + - - + +
- - 取 消 - 入库确认 - - + +
+
+ + + + + + + + 底盘号: + {{columnDetailDialogList.lotNo1}} + + + + + 库位号: + {{getStoreArea(columnDetailDialogList.storeAreaId)}} + {{getLocationName(columnDetailDialogList.storeAreaId, columnDetailDialogList.locationId)}} + + + + + 运单号: + {{columnDetailDialogList.ownerOrderNo}} + + + + +
+ + + 打印 + 取消 + + +
@@ -146,24 +187,24 @@ const defaultColumn = [ { key: 'ownerId', title: '货主', width: 106 }, { key: 'ownerOrderNo', title: '订单号', width: 106 }, - { key: 'noticeNo', title: '通知单号', width: 106 }, - { key: 'dataSources', title: '数据来源', width: 106 }, - { key: 'status', title: '状态', width: 106 }, - { key: 'storeHouseName', title: '入货仓库', width: 106 }, - { key: 'origin', title: '起始地', width: 106 }, - { key: 'destination', title: '目的地', width: 106 }, - { key: 'materielId', title: '车型', width: 106 }, - { key: 'materielName', title: '车型描述', width: 106 }, - { key: 'lotNo1', title: '底盘号(VIN号)', width: 106 }, - { key: 'carrierName', title: '承运商', width: 106 }, - { key: 'driverName', title: '承运商联系人', width: 106 }, - { key: 'driverPhone', title: '承运商联系人手机号', width: 106 }, - { key: 'consignee', title: '收货员工', width: 106 }, - { key: 'gmtCreate', title: '收货日期', width: 106 }, - { key: 'inspectStatus', title: '质检状态', width: 106 }, - { key: 'inspectRemark', title: '检验描述', width: 106 }, - { key: 'transferDriver', title: '移库司机', width: 106 }, - { key: 'createDate', title: '入库时间', width: 106 }, + { key: 'noticeNo', title: '通知单号', width: 136 }, + { key: 'dataSources', title: '数据来源', width: '' }, + { key: 'status', title: '状态', width: '140' }, + { key: 'storeHouseName', title: '入货仓库', width: '200' }, + { key: 'origin', title: '起始地', width: '' }, + { key: 'destination', title: '目的地', width: '' }, + { key: 'materielId', title: '车型', width: '240' }, + { key: 'materielName', title: '车型描述', width: '200' }, + { key: 'lotNo1', title: '底盘号(VIN号)', width: '200' }, + { key: 'carrierName', title: '承运商', width: '220' }, + { key: 'driverName', title: '承运商联系人', width: '140' }, + { key: 'driverPhone', title: '承运商联系人手机号', width: '240' }, + { key: 'consignee', title: '收货员工', width: '' }, + { key: 'gmtCreate', title: '收货日期', width: '180' }, + { key: 'inspectStatus', title: '质检状态', width: '' }, + { key: 'inspectRemark', title: '检验描述', width: '' }, + { key: 'transferDriver', title: '移库司机', width: '' }, + { key: 'createDate', title: '入库时间', width: '180' }, { key: 'remarks', title: '备注', width: '', fixed: 'right' } ] export default { @@ -203,25 +244,35 @@ 'createDate', 'remarks' ], - columnDetailDialogList: {}, - houseId: '100030', + columnDetailDialogList: { + storeAreaId: '', + locationId: '' + }, moreSearchVisible: false, page: { pageNo: 1, pageSize: 10, totalRecord: 0 }, - areas: [], + areas: [{ storeLocationList: [] }], + storeLocationList: [], loactions: [], dialogVisible: false, stockInitList: [], detailDialogList: [], - listLoading: false + listLoading: false, + printQRFlag: false, + temp: { + id: 1 + }, + img_src_QR: '' } }, created() { this.list() this.queryUsableLocation() + console.log('当前库', this.$store.getters.currentStorehouse) + console.log('所有库', this.$store.getters.storehouses) }, watch: { columnCheckList(valArr) { @@ -235,6 +286,60 @@ } }, methods: { + // 行选中 + rowClick(row, event, column) { + // 标记当前选中行 + // this.$refs.stockInitTable.clearSelection() + // this.$refs.stockInitTable.toggleRowSelection(row) + }, + // 打印二维码 + printQR() { + inbounAPI.printBarcode({ + key: this.columnDetailDialogList.lotNo1, + houseId: this.$store.getters.currentStorehouse.id + }).then(res => { + if (res.code === 0) { + this.img_src_QR = 'data:image/png;base64,' + res.data + } + }) + this.printQRFlag = true + }, + // 确认打印 + printQRConfirm() { + if (this.tools.checkPrintInstall()) { + this.tools.printHTML(document.getElementById('printQRBox').innerHTML, 790, 1) + } + }, + // 取消打印 + printQRCancel() { + this.printQRFlag = false + }, + dialogVisibleClose() { + this.columnDetailDialogList = { + storeAreaId: '', + locationId: '' + } + }, + // 获取库位名字 + getStoreArea(id) { + if (id !== '' && id === null) { + const t = this.areas.filter(i => i.storeAreaId === id)[0] + if (t) { + return t.storeAreaName + } else { + return '' + } + } + return '' + }, + getLocationName(id, id1) { + if (id && id1) { + const t = this.areas.filter(i => i.storeAreaId === id)[0] + const s = t.storeLocationList.filter(i => i.id === id1) + return s[0].name + } + return '' + }, list() { const that = this // 更多 @@ -249,7 +354,7 @@ // 分页 queryParam.current = this.page.pageNo queryParam.size = this.page.pageSize - queryParam.condition.houseId = this.houseId + queryParam.condition.houseId = this.$store.getters.currentStorehouse.id this.listLoading = true inbounAPI.inboundTaskQueryPage(queryParam).then(result => { if (result.code === 0) { @@ -269,7 +374,7 @@ ids.push(row.id) }) queryParam.lineIds = ids - queryParam.houseId = this.houseId + queryParam.houseId = this.$store.getters.currentStorehouse.id inbounAPI.inboundTaskPutAwayList(queryParam).then(result => { if (result.code === 0) { this.list() @@ -286,12 +391,12 @@ seachDetail() { const queryParam = {} queryParam.key = this.columnDetailDialogList.lotNo1in - queryParam.houseId = this.houseId + queryParam.houseId = this.$store.getters.currentStorehouse.id inbounAPI.inboundTaskSeachDetail(queryParam).then(result => { if (result.code === 0) { - this.queryUsableLocation() this.columnDetailDialogList = result.data this.columnDetailDialogList.lotNo1in = queryParam.key + this.queryUsableLocation() } else { this.$notify({ title: '信息提示', @@ -304,9 +409,12 @@ }, queryUsableLocation() { const queryParam = {} - queryParam.houseId = this.houseId + queryParam.houseId = this.$store.getters.currentStorehouse.id inbounAPI.queryUsableLocation(queryParam).then(result => { if (result.code === 0) { + this.storeLocationList = result.data[0].storeLocationList + this.columnDetailDialogList.storeAreaId = result.data[0].storeAreaId + this.columnDetailDialogList.locationId = result.data[0].storeLocationList[0].id this.areas = result.data console.log('Area:' + result.data) } else { @@ -323,7 +431,7 @@ // const queryParam = this.columnDetailDialogList // queryParam.houseId = '100030' const queryParam = this.columnDetailDialogList - queryParam.houseId = this.houseId + queryParam.houseId = this.$store.getters.currentStorehouse.id queryParam.locationId = this.columnDetailDialogList.locationId queryParam.storeAreaId = this.columnDetailDialogList.storeAreaId inbounAPI.inboundTaskPutWay(queryParam).then(result => { @@ -377,20 +485,46 @@ this.page.pageNo = val this.list() }, - areasChange() { + areasChange(val) { const areaid = this.columnDetailDialogList.storeAreaId for (let i = 0; i < this.areas.length; i++) { if (this.areas[i].storeAreaId === areaid) { this.loactions = this.areas[i].storeLocationList + this.storeLocationList = this.areas[i].storeLocationList break } else { this.loactions = [] + this.storeLocationList = [] } } + + // 过滤路径 + const t = this.areas.filter(i => i.storeAreaId === val) + console.log('选择的路径ttt', t) + this.storeLocationList = t[0].storeLocationList + this.columnDetailDialogList.locationId = t[0].storeLocationList[0].id + console.log('选择的路径', this.storeLocationList) } } } - diff --git a/src/views/layout/AppMain.vue b/src/views/layout/AppMain.vue index 52ad00434e53ace3d6bc3c15581e894f16a0bbef..000b26017bf114fab8e9087952ddc83289e576be 100644 --- a/src/views/layout/AppMain.vue +++ b/src/views/layout/AppMain.vue @@ -1,10 +1,10 @@ diff --git a/src/views/layout/Layout.vue b/src/views/layout/Layout.vue index f4ca15ce861f890ae82f8288dc56b28a353477d9..58bfc041bc76da80b1e31d72e490678b63c2c946 100644 --- a/src/views/layout/Layout.vue +++ b/src/views/layout/Layout.vue @@ -15,7 +15,7 @@
- +
diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 25734d0ede1b1f7cb2ae40424d78e643fc1a61a6..a32f699c82de4e810558a1f3b7e2a2d6bf93f9c6 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -50,7 +50,7 @@ export default { } return { loginForm: { - userKey: '15110288389', + userKey: '13049352358', password: '123456' }, loginRules: { diff --git a/static/printCss/index.css b/static/printCss/index.css index 8256dc785c7a6b4efb8c152ece72f2788f2489c2..24970cefdf31d3ea8251ea386612fcd570c0c9a0 100644 --- a/static/printCss/index.css +++ b/static/printCss/index.css @@ -1,3 +1,21 @@ #big{ font-size: 65px; } +.print-QR-img{ + width: 160px; + height: 170px; + position: relative; + overflow: hidden; +} +.print-QR-img .img_src_QR{ + position: absolute; + left: -20px; + top: -30px; +} +.print-QR-row{ + margin-bottom: 34px; +} +.printBig{ + font-size: 14px; + font-weight: bold; +}