From e72ab32224c2aa65238041ffb358c5e0c453df55 Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Wed, 12 Mar 2025 10:26:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=9B=9E=E6=BB=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../apply/component/AddPicking-old.vue | 1704 +++++++++++ .../picking/apply/component/AddPicking1.vue | 2687 +++++++---------- src/views/store/poleConfig/copy-old.vue | 556 ++++ src/views/store/poleConfig/poleConfig-old.vue | 547 ++++ src/views/store/poleConfig/poleConfig.vue | 355 +-- vue.config.js | 265 +- 6 files changed, 4188 insertions(+), 1926 deletions(-) create mode 100644 src/views/claimAndreturn/picking/apply/component/AddPicking-old.vue create mode 100644 src/views/store/poleConfig/copy-old.vue create mode 100644 src/views/store/poleConfig/poleConfig-old.vue diff --git a/src/views/claimAndreturn/picking/apply/component/AddPicking-old.vue b/src/views/claimAndreturn/picking/apply/component/AddPicking-old.vue new file mode 100644 index 0000000..565ca55 --- /dev/null +++ b/src/views/claimAndreturn/picking/apply/component/AddPicking-old.vue @@ -0,0 +1,1704 @@ + + + + + diff --git a/src/views/claimAndreturn/picking/apply/component/AddPicking1.vue b/src/views/claimAndreturn/picking/apply/component/AddPicking1.vue index ca352c0..1873b7b 100644 --- a/src/views/claimAndreturn/picking/apply/component/AddPicking1.vue +++ b/src/views/claimAndreturn/picking/apply/component/AddPicking1.vue @@ -1,1677 +1,1114 @@ diff --git a/src/views/store/poleConfig/copy-old.vue b/src/views/store/poleConfig/copy-old.vue new file mode 100644 index 0000000..7877cf1 --- /dev/null +++ b/src/views/store/poleConfig/copy-old.vue @@ -0,0 +1,556 @@ + + + + + diff --git a/src/views/store/poleConfig/poleConfig-old.vue b/src/views/store/poleConfig/poleConfig-old.vue new file mode 100644 index 0000000..690b26e --- /dev/null +++ b/src/views/store/poleConfig/poleConfig-old.vue @@ -0,0 +1,547 @@ + + + + + diff --git a/src/views/store/poleConfig/poleConfig.vue b/src/views/store/poleConfig/poleConfig.vue index 690b26e..d8b61cb 100644 --- a/src/views/store/poleConfig/poleConfig.vue +++ b/src/views/store/poleConfig/poleConfig.vue @@ -10,17 +10,36 @@ label-width="100px" @submit.native.prevent > - + - + 搜索 重置 @@ -45,9 +64,9 @@ :index="indexContinuation(queryParams.pageNum, queryParams.pageSize)" > - - - + + + @@ -59,7 +78,6 @@ >查看 --> 编辑 - 附属配件 删除 @@ -75,88 +93,72 @@ - + + + + + + + + + @@ -172,7 +174,6 @@ // } from '@/api/store/poleConfig' import { getDeviceTypeTree } from '@/api/claimAndRefund/receive' -import { getInfoListByTypeApi } from '@/api/store/warehousing' import { addCompleteSetToolsApi, queryCompleteSetToolsApi, @@ -220,20 +221,27 @@ export default { assortDevice: '', }, addCompleteRules: { - mainDevice: [ + completeSetName: [ { required: true, - trigger: 'change', - message: '请选择成套设备', + trigger: 'blur', + message: '请输入成套名称', }, - ], - assortDevice: [ { - required: true, - trigger: 'change', - message: '请选择规格型号', + max: 40, + message: '长度不能超过40个字符', }, ], + // mainDevice: [ + // { + // required: true, + // }, + // ], + // assortDevice: [ + // { + // required: true, + // }, + // ], }, deviceTypeTreeProps: { multiple: false, @@ -252,24 +260,40 @@ export default { isEdit: false, deviceName: '', tableList: [], - typesList: [], - lastTypesList: [], - lastTypeId: '', - detailsList: [], - parentId: '', } }, created() { this.getList() // 获取设备树 this.getDeviceTypeTree() + // getDeviceTypeTree().then((res) => { + // // 处理为typeOptions需要的数据格式 + // const data = res.data + // // this.typeOptions = this.getTree(data) + // // this.mountingsOptions = this.getTree(data) + // this.typeOptions = this.mountingsOptions = this.getTree(data) + // }) + // getDeviceTypeTree().then(res => { + // // 处理为mountingsOptions需要的数据格式 + // const data = res.data + // this.mountingsOptions = this.getTree(data) + // }) }, methods: { // 获取列表 async getList() { const res = await getCompleteSetToolsApi(this.formData) + console.log(res, '成套列表') + this.tableList = res.rows this.total = res.total + // this.houseList = [] + // this.queryParams.pageNum = data.page || 1 + // this.queryParams.pageSize = data.limit || 10 + // this.queryParams.keyWord = this.formData.keyWord || '' + // const res = await searchSelectList({ ...this.queryParams }) + // this.houseList = res.data.result + // this.total = res.data.totalCount || 0 }, // 查询 handleQuery() { @@ -299,8 +323,6 @@ export default { mainDevice: '', assortDevice: '', } - - this.$delete(this.saveParams, 'id') this.tempList = [] this.mainDeviceDisabled = false this.open = true @@ -308,23 +330,28 @@ export default { // 编辑 async handleEdit(row) { this.title = '成套设备编辑' - this.addCompleteForm.mainDevice = [row.oneId, row.towId, row.id] + this.addCompleteForm.completeSetName = row.wholeTypeName + this.addCompleteForm.mainDevice = row.deviceTypeId this.saveParams.id = row.id - this.parentId = row.id - this.saveParams.wholeTypeName = row.wholeTypeName - this.deviceName = row.wholeTypeName this.mainDeviceDisabled = true this.isEdit = true - - const result = await getInfoListByTypeApi({ level: '4', parentId: row.id + '' }) - this.lastTypesList = result.data const queryParams = { id: row.id, wholeTypeName: row.wholeTypeName, + // pageNum: 1, + // pageSize: 99999, } const { data: res } = await queryCompleteSetToolsApi(queryParams) this.tempList = res this.open = true + + this.$nextTick(() => { + const mainDeviceRef = this.$refs.mainDeviceRef + const input = mainDeviceRef.$el.querySelector('input') + if (input) { + input.value = this.tempList[0].deviceType + } + }) }, // 删除当前行 @@ -362,23 +389,42 @@ export default { * 以下为弹框内操作代码逻辑 */ //主体设备选择 - async selMainDevice(val) { - if (val.length < 3) { - this.$modal.msgError('请选择第三级设备类型,如未添加可以添加后再操作!') + selMainDevice(val) { + if (val.length < 4) { + this.$modal.msgError('请选择第四级规格型号的数据,如未添加可以添加后再操作!') this.addCompleteForm.mainDevice = [] return } this.$message.closeAll() const checkNode = this.$refs['mainDeviceRef'].getCheckedNodes() + this.recursionGetDeviceName(this.deviceTypeTreeNew, val[val.length - 2]) + if (checkNode.length < 1) return - const label = checkNode[0].label - const value = checkNode[0].value - this.deviceName = label - this.parentId = value - const res = await getInfoListByTypeApi({ level: '4', parentId: value + '' }) - this.lastTypesList = res.data - this.tempList = [] - this.addCompleteForm.assortDevice = '' + this.addCompleteForm.completeSetName = this.deviceName + '-' + checkNode[0].label + const mainDeviceObj = { + deviceType: checkNode[0].label, // 设备型号 + deviceTypeId: val[val.length - 1], // 设备Id + deviceNum: '', // 数量 + deviceAscription: '抱杆设备', // 所属类型 + ascriptionType: 1, // 所属类型 1 主体设备 2 配套设备 + typeName: this.deviceName, + isStorage: checkNode[0].isStorage, + } + + if (this.tempList.length === 0) { + this.tempList.unshift(mainDeviceObj) + } else { + // 判断选择的配套设备是否和主体设备重复 + const isRepeat = this.tempList.some((e) => e.deviceTypeId === mainDeviceObj.deviceTypeId) + if (isRepeat) { + this.$message.error('该设备已选择作为配套设备,不可作为主体设备!') + return + } else { + this.tempList.unshift(mainDeviceObj) + } + } + + this.mainDeviceDisabled = true }, // 配套设备选择 selAssortDevice(val) { @@ -394,7 +440,7 @@ export default { if (checkNode.length < 1) return const assortDeviceObj = { - deviceType: checkNode[0].label, // 设备名称 (规格型号的名称) + deviceType: checkNode[0].label, // 设备名称 deviceTypeId: val[val.length - 1], // 设备Id deviceNum: '', // 数量 deviceAscription: '配套设备', // 所属类型 @@ -438,13 +484,21 @@ export default { this.$refs.addFormRef.validate(async (valid) => { if (valid) { let isNum = false - // const isMainDevice = this.tempList.some((e) => e.ascriptionType === 1) + const isMainDevice = this.tempList.some((e) => e.ascriptionType === 1) - if (this.tempList.length === 0) { - this.$message.error('请添加设备!') + if (!isMainDevice) { + this.$message.error('请添加抱杆设备!') return } + // const isAssortDevice = this.tempList.some( + // (e) => e.ascriptionType === 2, + // ) + + // if (!isAssortDevice) { + // this.$message.error('请添加配套设备!') + // return + // } try { this.tempList.forEach((e) => { if (!parseInt(e.deviceNum)) { @@ -457,14 +511,16 @@ export default { }) } catch (error) {} - this.saveParams.wholeTypeName = this.deviceName - this.saveParams.parentId = this.parentId + if (isNum) return + + this.saveParams.parentId = this.tempList[0].deviceTypeId + this.saveParams.wholeTypeName = this.addCompleteForm.completeSetName this.saveParams.deviceInfo = this.tempList const res = await addCompleteSetToolsApi(this.saveParams) if (res.code == 200) { - this.$message.success(this.title === '成套设备新增' ? '新增成功!' : '修改成功!') + this.$message.success(!this.title === '成套设备新增' ? '新增成功!' : '修改成功!') this.open = false this.tempList = [] this.getList() @@ -476,7 +532,7 @@ export default { // 获取 设备树结构数据 async getDeviceTypeTree() { const params = { - level: 3, + level: 4, } const res = await getDeviceTypeTree(params) this.deviceTypeTreeNew = res.data @@ -501,45 +557,6 @@ export default { }) } catch (error) {} }, - - // 规格型号的change事件 - onChangeLastType(val) { - const typeLabel = this.lastTypesList.find((e) => e.typeId === val) - - const { typeName, isStorage } = typeLabel - const assortDeviceObj = { - deviceType: typeName, // 设备名称 - deviceTypeId: val, // 设备Id - deviceNum: '', // 数量 - deviceAscription: '配套设备', // 所属类型 - ascriptionType: 2, // 所属类型 1 主体设备 2 配套设备 - typeName: this.deviceName, - isStorage, - } - - const isRepeat = this.tempList.some((e) => e.deviceTypeId === assortDeviceObj.deviceTypeId) - - if (isRepeat) { - this.$message.error('该设备已添加,不可重复添加!') - return - } else { - this.tempList.push(assortDeviceObj) - } - }, - - // 查看附属配件 - async onHandleView(row) { - this.title = '附件详情' - - this.saveParams.id = row.id - const queryParams = { - id: row.id, - wholeTypeName: row.wholeTypeName, - } - const { data: res } = await queryCompleteSetToolsApi(queryParams) - this.detailsList = res - this.open = true - }, }, } diff --git a/vue.config.js b/vue.config.js index a9cd1ca..123406d 100644 --- a/vue.config.js +++ b/vue.config.js @@ -2,7 +2,7 @@ const path = require('path') function resolve(dir) { - return path.join(__dirname, dir) + return path.join(__dirname, dir) } const CompressionPlugin = require('compression-webpack-plugin') @@ -16,142 +16,143 @@ const port = process.env.port || process.env.npm_config_port || 80 // 端口 // 这里只列一部分,具体配置参考文档 module.exports = { - // 部署生产环境和开发环境下的URL。 - // 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上 - // 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。 - publicPath: process.env.VUE_APP_ENV === 'production-nw' ? '/gl' : '/', ///gl/ - // 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist) - outputDir: 'dist', - // 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下) - assetsDir: 'static', - // 是否开启eslint保存检测,有效值:ture | false | 'error' - lintOnSave: process.env.NODE_ENV === 'development', - // 如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。 - productionSourceMap: false, - // webpack-dev-server 相关配置 - devServer: { - host: '0.0.0.0', - port: port, - open: true, - proxy: { - [process.env.VUE_APP_BASE_API]: { - // target: `http://112.29.103.165:21626`, //线上环境-重庆 - // target: `http://112.29.103.165:21624`,//线上环境-宁夏 打包前放开数据大屏的路由 - // target: `http://192.168.0.56:39080`, //测试环境 - // target: `http://1.12.248.179:23028`,//线上环境-南网 - // target: `https://test-cc.zhgkxt.com`,//线上环境-南网 - // target: `https://z.csgmall.com.cn`, + // 部署生产环境和开发环境下的URL。 + // 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上 + // 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。 + publicPath: process.env.VUE_APP_ENV === 'production-nw' ? '/gl' : '/', ///gl/ + // 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist) + outputDir: 'dist', + // 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下) + assetsDir: 'static', + // 是否开启eslint保存检测,有效值:ture | false | 'error' + lintOnSave: process.env.NODE_ENV === 'development', + // 如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。 + productionSourceMap: false, + // webpack-dev-server 相关配置 + devServer: { + host: '0.0.0.0', + port: port, + open: true, + proxy: { + [process.env.VUE_APP_BASE_API]: { + // target: `http://112.29.103.165:21626`, //线上环境-重庆 + // target: `http://112.29.103.165:21624`,//线上环境-宁夏 打包前放开数据大屏的路由 + // target: `http://192.168.0.56:39080`, //测试环境 + // target: `http://1.12.248.179:23028`,//线上环境-南网 + // target: `https://test-cc.zhgkxt.com`,//线上环境-南网 + // target: `https://z.csgmall.com.cn`, - // target: `http://192.168.0.15:39080`, //韩 - target: `http://192.168.0.133:39080`, //超 + // target: `http://192.168.0.15:39080`, //韩 + target: `http://192.168.0.133:39080`, //超 + // target: `http://192.168.2.127:39080`, //超 - // target: `http://192.168.2.74:49080`, //旭/ - // target: `http://192.168.2.17:39080`, //帅 - // target: `http://192.168.0.60:39080`, //福 - // target: `http://192.168.0.96:39080`, //马 + // target: `http://192.168.2.74:49080`, //旭/ + // target: `http://192.168.2.17:39080`, //帅 + // target: `http://192.168.0.60:39080`, //福 + // target: `http://192.168.0.96:39080`, //马 - //******** 注意事项 ********* */ - //1.全局替换qrUrl二维码扫码提供的网址-发布服务器的地址target; - //更改 utils/globalUrl.js 内qrUrl地址 - //2.打开view文件夹根目录dashboard.vue 更换大屏项目发布的跳转地址; - //3.只有南网项目产线gl发布打包时候需要注意: - // 将 publicPath:'static' 改为 '/gl/',还有env.development和env.production中的VUE_APP_BASE_API改为'/gl/dev-api'; - // router/indx.js文件中的base放开 - // 登录跳转地址从/login换成/gl/login 3处; - //4. 重庆环境的时候 领料管理线上菜单与宁夏不同需要根据环境在线上菜单管理中修改组件路径 - //******** 注意事项 ********* */ - changeOrigin: true, - pathRewrite: { - ['^' + process.env.VUE_APP_BASE_API]: '', - }, - }, + //******** 注意事项 ********* */ + //1.全局替换qrUrl二维码扫码提供的网址-发布服务器的地址target; + //更改 utils/globalUrl.js 内qrUrl地址 + //2.打开view文件夹根目录dashboard.vue 更换大屏项目发布的跳转地址; + //3.只有南网项目产线gl发布打包时候需要注意: + // 将 publicPath:'static' 改为 '/gl/',还有env.development和env.production中的VUE_APP_BASE_API改为'/gl/dev-api'; + // router/indx.js文件中的base放开 + // 登录跳转地址从/login换成/gl/login 3处; + //4. 重庆环境的时候 领料管理线上菜单与宁夏不同需要根据环境在线上菜单管理中修改组件路径 + //******** 注意事项 ********* */ + changeOrigin: true, + pathRewrite: { + ['^' + process.env.VUE_APP_BASE_API]: '', }, - disableHostCheck: true, + }, }, - css: { - loaderOptions: { - sass: { - sassOptions: { outputStyle: 'expanded' }, - }, + disableHostCheck: true, + }, + css: { + loaderOptions: { + sass: { + sassOptions: { outputStyle: 'expanded' }, + }, + }, + }, + configureWebpack: { + name: name, + resolve: { + alias: { + '@': resolve('src'), + }, + }, + plugins: [ + // http://doc.ruoyi.vip/ruoyi-vue/other/faq.html#使用gzip解压缩静态文件 + new CompressionPlugin({ + cache: false, // 不启用文件缓存 + test: /\.(js|css|html)?$/i, // 压缩文件格式 + filename: '[path].gz[query]', // 压缩后的文件名 + algorithm: 'gzip', // 使用gzip压缩 + minRatio: 0.8, // 压缩率小于1才会压缩 + }), + ], + }, + chainWebpack(config) { + config.plugins.delete('preload') // TODO: need test + config.plugins.delete('prefetch') // TODO: need test + + // set svg-sprite-loader + config.module.rule('svg').exclude.add(resolve('src/assets/icons')).end() + config.module + .rule('icons') + .test(/\.svg$/) + .include.add(resolve('src/assets/icons')) + .end() + .use('svg-sprite-loader') + .loader('svg-sprite-loader') + .options({ + symbolId: 'icon-[name]', + }) + .end() + + config.when(process.env.NODE_ENV !== 'development', (config) => { + config + .plugin('ScriptExtHtmlWebpackPlugin') + .after('html') + .use('script-ext-html-webpack-plugin', [ + { + // `runtime` must same as runtimeChunk name. default is `runtime` + inline: /runtime\..*\.js$/, + }, + ]) + .end() + + config.optimization.splitChunks({ + chunks: 'all', + cacheGroups: { + libs: { + name: 'chunk-libs', + test: /[\\/]node_modules[\\/]/, + priority: 10, + chunks: 'initial', // only package third parties that are initially dependent + }, + elementUI: { + name: 'chunk-elementUI', // split elementUI into a single package + test: /[\\/]node_modules[\\/]_?element-ui(.*)/, // in order to adapt to cnpm + priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app + }, + commons: { + name: 'chunk-commons', + test: resolve('src/components'), // can customize your rules + minChunks: 3, // minimum common number + priority: 5, + reuseExistingChunk: true, + }, }, - }, - configureWebpack: { - name: name, - resolve: { - alias: { - '@': resolve('src'), - }, - }, - plugins: [ - // http://doc.ruoyi.vip/ruoyi-vue/other/faq.html#使用gzip解压缩静态文件 - new CompressionPlugin({ - cache: false, // 不启用文件缓存 - test: /\.(js|css|html)?$/i, // 压缩文件格式 - filename: '[path].gz[query]', // 压缩后的文件名 - algorithm: 'gzip', // 使用gzip压缩 - minRatio: 0.8, // 压缩率小于1才会压缩 - }), - ], - }, - chainWebpack(config) { - config.plugins.delete('preload') // TODO: need test - config.plugins.delete('prefetch') // TODO: need test + }) - // set svg-sprite-loader - config.module.rule('svg').exclude.add(resolve('src/assets/icons')).end() - config.module - .rule('icons') - .test(/\.svg$/) - .include.add(resolve('src/assets/icons')) - .end() - .use('svg-sprite-loader') - .loader('svg-sprite-loader') - .options({ - symbolId: 'icon-[name]', - }) - .end() - - config.when(process.env.NODE_ENV !== 'development', (config) => { - config - .plugin('ScriptExtHtmlWebpackPlugin') - .after('html') - .use('script-ext-html-webpack-plugin', [ - { - // `runtime` must same as runtimeChunk name. default is `runtime` - inline: /runtime\..*\.js$/, - }, - ]) - .end() - - config.optimization.splitChunks({ - chunks: 'all', - cacheGroups: { - libs: { - name: 'chunk-libs', - test: /[\\/]node_modules[\\/]/, - priority: 10, - chunks: 'initial', // only package third parties that are initially dependent - }, - elementUI: { - name: 'chunk-elementUI', // split elementUI into a single package - test: /[\\/]node_modules[\\/]_?element-ui(.*)/, // in order to adapt to cnpm - priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app - }, - commons: { - name: 'chunk-commons', - test: resolve('src/components'), // can customize your rules - minChunks: 3, // minimum common number - priority: 5, - reuseExistingChunk: true, - }, - }, - }) - - config.optimization.runtimeChunk('single'), - { - from: path.resolve(__dirname, './public/robots.txt'), //防爬虫文件 - to: './', //到根目录下 - } - }) - }, + config.optimization.runtimeChunk('single'), + { + from: path.resolve(__dirname, './public/robots.txt'), //防爬虫文件 + to: './', //到根目录下 + } + }) + }, }