src/layout/components/Sidebar/index.vue
@@ -2,7 +2,8 @@ <div :class="{'has-logo':showLogo}"> <logo v-if="showLogo" :collapse="isCollapse" /> <div class="layoutLogo" /> <div v-if="$store.state.app.sidebar.opened" class="layoutLogo" /> <el-scrollbar wrap-class="scrollbar-wrapper" class="scrollbarWrapperClass"> <el-menu :default-active="activeMenu" @@ -27,7 +28,7 @@ </el-scrollbar> <div style="position: absolute;bottom: 20px;left: 30px;"> <div> <el-button type="text" style="font-size: 14px;cursor: pointer">新凯迪制造V1.0.01</el-button> <el-button v-if="$store.state.app.sidebar.opened" type="text" style="font-size: 14px;cursor: pointer">新凯迪制造V1.0.01</el-button> <!-- <el-button type="text"><a href="http://www.ykxkd.com/" target="_blank">新凯迪制造V1.0.01</a></el-button>--> </div> </div> src/store/getters.js
@@ -1,6 +1,7 @@ const getters = { sidebar: state => state.app.sidebar, device: state => state.app.device, buttonIsDisabled: state => state.app.buttonIsDisabled, // 自定义全局变量参数 控制按钮提交时disabled token: state => state.user.token, avatar: state => state.user.avatar, name: state => state.user.name, src/store/modules/app.js
@@ -5,7 +5,8 @@ opened: Cookies.get('sidebarStatus') ? !!+Cookies.get('sidebarStatus') : true, withoutAnimation: false }, device: 'desktop' device: 'desktop', buttonIsDisabled: false // 自定义全局变量参数 控制按钮提交时disabled } const mutations = { @@ -42,6 +43,7 @@ export default { namespaced: true, buttonIsDisabled: false, state, mutations, actions src/utils/request.js
@@ -85,6 +85,7 @@ // }) // }) // } store.state.app.buttonIsDisabled = false // 将按钮变回可点击 return Promise.reject(new Error(res.message || 'Error')) } // else if (res.code === '303') { src/views/jcsz/jsqd.vue
@@ -236,7 +236,12 @@ <span slot="footer" class="dialog-footer"> <div class="footerButton"> <el-button @click="dialogVisibleCancel">取 消</el-button> <el-button type="primary" @click="dialogVisibleConfirm">确 定</el-button> <el-button type="primary" :loading="$store.state.app.buttonIsDisabled" :disabled="$store.state.app.buttonIsDisabled" @click="dialogVisibleConfirm" >确 定</el-button> </div> </span> </el-dialog> @@ -479,7 +484,12 @@ <span slot="footer" class="dialog-footer"> <div class="footerButton"> <el-button @click="userDialogVisibleCancel">取 消</el-button> <el-button type="primary" @click="userDialogVisibleConfirm">确 定</el-button> <el-button type="primary" :loading="$store.state.app.buttonIsDisabled" :disabled="$store.state.app.buttonIsDisabled" @click="userDialogVisibleConfirm" >确 定</el-button> </div> </span> </el-dialog> @@ -557,7 +567,12 @@ <span slot="footer" class="dialog-footer"> <div class="footerButton"> <el-button @click="rightDialogVisibleCancel">取 消</el-button> <el-button type="primary" @click="rightDialogVisibleConfirm">确 定</el-button> <el-button type="primary" :loading="$store.state.app.buttonIsDisabled" :disabled="$store.state.app.buttonIsDisabled" @click="rightDialogVisibleConfirm" >确 定</el-button> </div> </span> </el-dialog> @@ -854,6 +869,7 @@ dialogVisibleConfirm() { this.$refs.dialogForm.validate(valid => { if (valid) { this.$store.state.app.buttonIsDisabled = true const data = { RoleId: this.dialogForm.RoleId, RoleCode: this.dialogForm.RoleCode, @@ -865,11 +881,13 @@ } AddUpdateRole(data).then(res => { if (res.code === '200') { this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!') this.dialogVisible = false this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!') this.getRoleSearch() this.$store.state.app.buttonIsDisabled = false } else { this.$message.error(this.operation === 'add' ? '添加失败!' : '修改失败!') this.$store.state.app.buttonIsDisabled = false } }) } @@ -963,17 +981,33 @@ }, /* 关联用户模块*/ userClick(row) { async userClick(row) { if (row.role_code === 'S001') { return this.$message.info('此角色无法操作!') } this.userDialogVisible = true const loading = this.$loading({ lock: true, text: '正在加载数据,请稍等...', spinner: 'el-icon-loading', customClass: 'osloading', background: 'rgba(0, 0, 0, 0.7)' }) this.userForm.roleName = row.role_name this.dialogFormUser.rolecode = row.role_code this.getRoleAssociationUser() this.$nextTick(() => { this.$refs.multipleTable.doLayout() }) const res = await this.getRoleAssociationUser() if (res.code === '200') { setTimeout(() => { loading.close() this.userDialogVisible = true this.$nextTick(() => { this.$refs.multipleTable.doLayout() }) }, 1000) } else { loading.close() } }, // 获取角色清单关联用户 async getRoleAssociationUser() { @@ -987,6 +1021,7 @@ } }) }) return { code: res.code } }, // 处理多选 handleSelectionChange(rows) { @@ -1037,15 +1072,19 @@ }, // 关联用户对话框确认 async userDialogVisibleConfirm() { this.$store.state.app.buttonIsDisabled = true const userMultipleArr = [] this.userMultipleArr.forEach(item => { userMultipleArr.push({ code: item.usercode, name: item.username }) }) const res = await SaveRoleAssoctUser(userMultipleArr, this.dialogFormUser.rolecode) if (res.code === '200') { this.userDialogVisible = false this.$message.success('保存成功!') await this.getRoleSearch() this.userDialogVisible = false this.$store.state.app.buttonIsDisabled = false } else { this.$store.state.app.buttonIsDisabled = false } }, // 级联选择器 @@ -1065,7 +1104,15 @@ /* 角色关联权限对话框部分*/ // 分配权限点击 async rightClick(row) { this.dialogVisibleRight = true const loading = this.$loading({ lock: true, text: '正在加载数据,请稍等...', spinner: 'el-icon-loading', customClass: 'osloading', background: 'rgba(0, 0, 0, 0.7)' }) // this.dialogVisibleRight = true this.rightFrom.usercode = row.role_code this.rightFrom.username = row.role_name @@ -1073,250 +1120,258 @@ rolecode: this.rightFrom.usercode, type: '' } const { data: res } = await RoleAssociationRight(data)// 接口获取数据 // console.log(res, 111) this.dialogFormRight.rightPCArr = res[0][0].is_delete === '0' ? res[0] : [] this.dialogFormRight.rightAPPArr = res[1][0].is_delete === '0' ? res[1] : [] RoleAssociationRight(data).then(res => { if (res.code === '200') { setTimeout(() => { loading.close() this.dialogVisibleRight = true this.dialogFormRight.rightPCArr = res.data[0][0].is_delete === '0' ? res.data[0] : [] this.dialogFormRight.rightAPPArr = res.data[1][0].is_delete === '0' ? res.data[1] : [] this.PCTrue = res[0][0].is_delete === '0' this.APPTrue = res[1][0].children.filter(item => item.is_delete === '0').length === 0 ? false : res[1][0].is_delete === '0' this.PCTrue = res.data[0][0].is_delete === '0' this.APPTrue = res.data[1][0].children.filter(item => item.is_delete === '0').length === 0 ? false : res.data[1][0].is_delete === '0' // '0'显示 '1' 不显示 过滤出相对应的菜单 if (this.PCTrue) { this.dialogFormRight.rightPCArr[0].children = this.dialogFormRight.rightPCArr[0].children.filter(item => item.is_delete === '0') this.dialogFormRight.rightPCArr[0].children.forEach(item => { item.children = item.children.filter(it => it.is_delete === '0') // '0'显示 '1' 不显示 过滤出相对应的菜单 if (this.PCTrue) { this.dialogFormRight.rightPCArr[0].children = this.dialogFormRight.rightPCArr[0].children.filter(item => item.is_delete === '0') this.dialogFormRight.rightPCArr[0].children.forEach(item => { item.children = item.children.filter(it => it.is_delete === '0') if (this.rightFrom.usercode === 'S001') { // Admin系统管理员菜单做到只增不减 if (item.flag === 'Y') { item.disabled = true } if (item.children && item.children.length > 0) { item.children.forEach(it => { if (it.flag === 'Y') { it.disabled = true if (this.rightFrom.usercode === 'S001') { // Admin系统管理员菜单做到只增不减 if (item.flag === 'Y') { item.disabled = true } if (item.children && item.children.length > 0) { item.children.forEach(it => { if (it.flag === 'Y') { it.disabled = true } }) } } }) } } }) } if (this.APPTrue) { this.dialogFormRight.rightAPPArr[0].children = this.dialogFormRight.rightAPPArr[0].children.filter(item => item.is_delete === '0' || item.is_delete === null) this.dialogFormRight.rightAPPArr[0].children.forEach(item => { item.children = item.children.filter(it => it.is_delete === '0' || it.is_delete === null) // item.children = item.children.filter(it => it.is_delete !== '1') if (this.APPTrue) { this.dialogFormRight.rightAPPArr[0].children = this.dialogFormRight.rightAPPArr[0].children.filter(item => item.is_delete === '0' || item.is_delete === null) this.dialogFormRight.rightAPPArr[0].children.forEach(item => { item.children = item.children.filter(it => it.is_delete === '0' || it.is_delete === null) // item.children = item.children.filter(it => it.is_delete !== '1') if (this.rightFrom.usercode === 'S001') { // Admin系统管理员菜单做到只增不减 if (item.flag === 'Y') { item.disabled = true } if (item.children && item.children.length > 0) { item.children.forEach(it => { if (it.flag === 'Y') { it.disabled = true if (this.rightFrom.usercode === 'S001') { // Admin系统管理员菜单做到只增不减 if (item.flag === 'Y') { item.disabled = true } if (item.children && item.children.length > 0) { item.children.forEach(it => { if (it.flag === 'Y') { it.disabled = true } }) } } }) } } }) } // console.log(this.dialogFormRight.rightAPPArr[0], 234) // 判断哪个是高亮 let pcIsSelected1 = false let pcIsSelected2 = false let appIsSelected1 = false let appIsSelected2 = false let rightPCArrFlag let rightAPPArrFlag // console.log(this.dialogFormRight.rightAPPArr[0], 234) // 判断哪个是高亮 let pcIsSelected1 = false let pcIsSelected2 = false let appIsSelected1 = false let appIsSelected2 = false let rightPCArrFlag let rightAPPArrFlag if (this.PCTrue) { rightPCArrFlag = this.dialogFormRight.rightPCArr[0].flag } if (this.APPTrue) { rightAPPArrFlag = this.dialogFormRight.rightAPPArr[0].flag } let waitFlag = false// 回显等待是否放行 if (this.PCTrue && this.APPTrue) { // 1.第一种情况PC和APP都一次都没选中时 PC未选中,APP未选中 if (rightPCArrFlag === 'N' && rightAPPArrFlag === 'N') { pcIsSelected1 = true this.dialogFormRight.rightCurrentCode = this.dialogFormRight.rightPCArr[0].code } // 2.第二种情况PC已选中,APP未选中 if (rightPCArrFlag === 'Y' && rightAPPArrFlag === 'N') { pcIsSelected1 = true pcIsSelected2 = true const interval = setInterval(() => { if ($("input[name='PC']").length > 0) { waitFlag = true if (this.PCTrue) { rightPCArrFlag = this.dialogFormRight.rightPCArr[0].flag } if (waitFlag) { clearInterval(interval) this.$nextTick(() => { $("input[name='PC']").eq(0).prop('checked', true)// 自定义单选框回显 if (this.APPTrue) { rightAPPArrFlag = this.dialogFormRight.rightAPPArr[0].flag } let waitFlag = false// 回显等待是否放行 if (this.PCTrue && this.APPTrue) { // 1.第一种情况PC和APP都一次都没选中时 PC未选中,APP未选中 if (rightPCArrFlag === 'N' && rightAPPArrFlag === 'N') { pcIsSelected1 = true this.dialogFormRight.rightCurrentCode = this.dialogFormRight.rightPCArr[0].code } // 2.第二种情况PC已选中,APP未选中 if (rightPCArrFlag === 'Y' && rightAPPArrFlag === 'N') { pcIsSelected1 = true pcIsSelected2 = true const interval = setInterval(() => { if ($("input[name='PC']").length > 0) { waitFlag = true } if (waitFlag) { clearInterval(interval) this.$nextTick(() => { $("input[name='PC']").eq(0).prop('checked', true)// 自定义单选框回显 }) } }, 100) this.dialogFormRight.rightCurrentCode = this.dialogFormRight.rightPCArr[0].code } // 3.第三种情况PC未选中,APP已选中 if (rightPCArrFlag === 'N' && rightAPPArrFlag === 'Y') { appIsSelected1 = true appIsSelected2 = true const interval = setInterval(() => { if ($("input[name='APP']").length > 0) { waitFlag = true } if (waitFlag) { clearInterval(interval) this.$nextTick(() => { $("input[name='APP']").eq(0).prop('checked', true)// 自定义单选框回显 }) } }, 100) this.dialogFormRight.rightCurrentCode = this.dialogFormRight.rightAPPArr[0].code } // 4.第四种情况PC已选中,APP已选中 if (rightPCArrFlag === 'Y' && rightAPPArrFlag === 'Y') { pcIsSelected1 = true pcIsSelected2 = true appIsSelected1 = false appIsSelected2 = true const interval = setInterval(() => { if ($("input[name='PC']").length > 0) { waitFlag = true } if (waitFlag) { clearInterval(interval) this.$nextTick(() => { $("input[name='PC']").eq(0).prop('checked', true)// 自定义单选框回显 $("input[name='APP']").eq(0).prop('checked', true)// 自定义单选框回显 }) } }, 100) this.dialogFormRight.rightCurrentCode = this.dialogFormRight.rightPCArr[0].code } } // 目前一期肯定是这个 if (this.PCTrue && !this.APPTrue) { // pcIsSelected1 = true if (rightPCArrFlag === 'Y') { pcIsSelected1 = true pcIsSelected2 = true const interval = setInterval(() => { if ($("input[name='PC']").length > 0) { waitFlag = true } if (waitFlag) { clearInterval(interval) this.$nextTick(() => { $("input[name='PC']").eq(0).prop('checked', true)// 自定义单选框回显 }) } }, 100) this.dialogFormRight.rightCurrentCode = this.dialogFormRight.rightPCArr[0].code } // this.dialogFormRight.rightCurrentCode = this.dialogFormRight.rightPCArr[0].code } if (!this.PCTrue && this.APPTrue) { if (rightAPPArrFlag === 'Y') { appIsSelected1 = true appIsSelected2 = true const interval = setInterval(() => { if ($("input[name='APP']").length > 0) { waitFlag = true } if (waitFlag) { clearInterval(interval) this.$nextTick(() => { $("input[name='APP']").eq(0).prop('checked', true)// 自定义单选框回显 }) } }, 100) this.dialogFormRight.rightCurrentCode = this.dialogFormRight.rightAPPArr[0].code } } if (this.PCTrue) { this.dialogFormRight.rightOperationArr.push({ isSelected1: pcIsSelected1, isSelected2: pcIsSelected2, code: this.dialogFormRight.rightPCArr[0].code, flag: rightPCArrFlag, name: this.dialogFormRight.rightPCArr[0].name }) } }, 100) this.dialogFormRight.rightCurrentCode = this.dialogFormRight.rightPCArr[0].code } // 3.第三种情况PC未选中,APP已选中 if (rightPCArrFlag === 'N' && rightAPPArrFlag === 'Y') { appIsSelected1 = true appIsSelected2 = true const interval = setInterval(() => { if ($("input[name='APP']").length > 0) { waitFlag = true } if (waitFlag) { clearInterval(interval) this.$nextTick(() => { $("input[name='APP']").eq(0).prop('checked', true)// 自定义单选框回显 if (this.APPTrue) { this.dialogFormRight.rightOperationArr.push({ isSelected1: appIsSelected1, isSelected2: appIsSelected2, code: this.dialogFormRight.rightAPPArr[0].code, flag: rightAPPArrFlag, name: this.dialogFormRight.rightAPPArr[0].name }) } }, 100) this.dialogFormRight.rightCurrentCode = this.dialogFormRight.rightAPPArr[0].code } // 4.第四种情况PC已选中,APP已选中 if (rightPCArrFlag === 'Y' && rightAPPArrFlag === 'Y') { pcIsSelected1 = true pcIsSelected2 = true appIsSelected1 = false appIsSelected2 = true const interval = setInterval(() => { if ($("input[name='PC']").length > 0) { waitFlag = true if (this.PCTrue) { this.dialogFormRight.rightPCArr[0].name = '全部' if (this.rightFrom.usercode === 'S001') { // Admin系统管理员菜单做到只增不减 this.dialogFormRight.rightPCArr[0].disabled = true } } if (waitFlag) { clearInterval(interval) this.$nextTick(() => { $("input[name='PC']").eq(0).prop('checked', true)// 自定义单选框回显 $("input[name='APP']").eq(0).prop('checked', true)// 自定义单选框回显 if (this.APPTrue) { this.dialogFormRight.rightAPPArr[0].name = '全部' if (this.rightFrom.usercode === 'S001') { // Admin系统管理员菜单做到只增不减 this.dialogFormRight.rightAPPArr[0].disabled = true } } // 树形回显部分 if (this.PCTrue) { this.dialogFormRight.rightPCArr[0].children.forEach(item => { if (item.children && item.children.length > 0 && item.flag === 'Y') { item.children.forEach(it => { if (it.flag === 'Y') { this.dialogFormRight.rightPCArrSelected.push(it.code) } }) } else if (item.children && item.children.length === 0 && item.flag === 'Y') { this.dialogFormRight.rightPCArrSelected.push(item.code) } }) } }, 100) this.dialogFormRight.rightCurrentCode = this.dialogFormRight.rightPCArr[0].code } } // 目前一期肯定是这个 if (this.PCTrue && !this.APPTrue) { // pcIsSelected1 = true if (rightPCArrFlag === 'Y') { pcIsSelected1 = true pcIsSelected2 = true const interval = setInterval(() => { if ($("input[name='PC']").length > 0) { waitFlag = true } if (waitFlag) { clearInterval(interval) this.$nextTick(() => { $("input[name='PC']").eq(0).prop('checked', true)// 自定义单选框回显 if (this.APPTrue) { this.dialogFormRight.rightAPPArr[0].children.forEach(item => { if (item.children && item.children.length > 0 && item.flag === 'Y') { item.children.forEach(it => { if (it.flag === 'Y') { this.dialogFormRight.rightAPPArrSelected.push(it.code) } }) } else if (item.children && item.children.length === 0 && item.flag === 'Y') { this.dialogFormRight.rightAPPArrSelected.push(item.code) } }) } }, 100) this.dialogFormRight.rightCurrentCode = this.dialogFormRight.rightPCArr[0].code } // this.dialogFormRight.rightCurrentCode = this.dialogFormRight.rightPCArr[0].code } if (!this.PCTrue && this.APPTrue) { if (rightAPPArrFlag === 'Y') { appIsSelected1 = true appIsSelected2 = true const interval = setInterval(() => { if ($("input[name='APP']").length > 0) { waitFlag = true } if (waitFlag) { clearInterval(interval) this.$nextTick(() => { $("input[name='APP']").eq(0).prop('checked', true)// 自定义单选框回显 }) } }, 100) this.dialogFormRight.rightCurrentCode = this.dialogFormRight.rightAPPArr[0].code } } if (this.PCTrue) { this.dialogFormRight.rightOperationArr.push({ isSelected1: pcIsSelected1, isSelected2: pcIsSelected2, code: this.dialogFormRight.rightPCArr[0].code, flag: rightPCArrFlag, name: this.dialogFormRight.rightPCArr[0].name }) } if (this.APPTrue) { this.dialogFormRight.rightOperationArr.push({ isSelected1: appIsSelected1, isSelected2: appIsSelected2, code: this.dialogFormRight.rightAPPArr[0].code, flag: rightAPPArrFlag, name: this.dialogFormRight.rightAPPArr[0].name }) } if (this.PCTrue) { this.dialogFormRight.rightPCArr[0].name = '全部' if (this.rightFrom.usercode === 'S001') { // Admin系统管理员菜单做到只增不减 this.dialogFormRight.rightPCArr[0].disabled = true } } if (this.APPTrue) { this.dialogFormRight.rightAPPArr[0].name = '全部' if (this.rightFrom.usercode === 'S001') { // Admin系统管理员菜单做到只增不减 this.dialogFormRight.rightAPPArr[0].disabled = true } } // 树形回显部分 if (this.PCTrue) { this.dialogFormRight.rightPCArr[0].children.forEach(item => { if (item.children && item.children.length > 0 && item.flag === 'Y') { item.children.forEach(it => { if (it.flag === 'Y') { this.dialogFormRight.rightPCArrSelected.push(it.code) this.$nextTick(() => { if (this.$refs.rightPCRef) { this.$refs.rightPCRef.setCheckedKeys(this.dialogFormRight.rightPCArrSelected) } if (this.$refs.rightAPPRef) { this.$refs.rightAPPRef.setCheckedKeys(this.dialogFormRight.rightAPPArrSelected) } }) } else if (item.children && item.children.length === 0 && item.flag === 'Y') { this.dialogFormRight.rightPCArrSelected.push(item.code) } }) } if (this.APPTrue) { this.dialogFormRight.rightAPPArr[0].children.forEach(item => { if (item.children && item.children.length > 0 && item.flag === 'Y') { item.children.forEach(it => { if (it.flag === 'Y') { this.dialogFormRight.rightAPPArrSelected.push(it.code) } }) } else if (item.children && item.children.length === 0 && item.flag === 'Y') { this.dialogFormRight.rightAPPArrSelected.push(item.code) } }) } this.$nextTick(() => { if (this.$refs.rightPCRef) { this.$refs.rightPCRef.setCheckedKeys(this.dialogFormRight.rightPCArrSelected) } if (this.$refs.rightAPPRef) { this.$refs.rightAPPRef.setCheckedKeys(this.dialogFormRight.rightAPPArrSelected) }, 1000) } else { loading.close() } }) }, @@ -1342,6 +1397,8 @@ }, // 权限对话框确认事件 async rightDialogVisibleConfirm() { this.$store.state.app.buttonIsDisabled = true const rightPCArrSelected = []// 保存提交树选中 PC const rightAPPArrSelected = []// 保存提交树选中 APP if (this.PCTrue) { @@ -1415,8 +1472,11 @@ const res = await SaveUserAssoctRight(rightSubmit, rolecode, usercode) if (res.code === '200') { this.$message.success('保存成功!') await this.getRoleSearch() this.dialogVisibleRight = false await this.getRoleSearch() this.$store.state.app.buttonIsDisabled = false } else { this.$store.state.app.buttonIsDisabled = false } }, // 大盒子点击事件 @@ -1753,7 +1813,13 @@ } </style> <style> .osloading{ font-size: 26px !important; } .el-loading-text{ font-size: 26px !important; } .el-table .custom-row { background: #f8f8fa; } src/views/jcsz/wldw.vue
@@ -248,7 +248,12 @@ <span slot="footer" class="dialog-footer"> <div class="footerButton"> <el-button @click="dialogVisibleCancel">取 消</el-button> <el-button type="primary" @click="dialogVisibleConfirm">确 定</el-button> <el-button type="primary" :loading="$store.state.app.buttonIsDisabled" :disabled="$store.state.app.buttonIsDisabled" @click="dialogVisibleConfirm" >确 定</el-button> </div> </span> </el-dialog> @@ -505,6 +510,7 @@ dialogVisibleConfirm() { this.$refs.dialogForm.validate(valid => { if (valid) { this.$store.state.app.buttonIsDisabled = true let mtypecode = null // 外购编码 let btypecode = null // 外协编码 let htypecode = null // 客户编码 @@ -530,14 +536,16 @@ description: this.dialogForm.description, OperType: this.operation === 'add' ? 'Add' : 'Update' } // console.log(data, 2) AddUpdateCurrentUnit(data).then(res => { if (res.code === '200') { this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!') this.dialogVisible = false this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!') this.getCurrentUnitSearch() this.$store.state.app.buttonIsDisabled = false } else { this.$message.error(this.operation === 'add' ? '添加失败!' : '修改失败!') this.$store.state.app.buttonIsDisabled = false } }) } src/views/jcsz/yhqd.vue
@@ -356,7 +356,12 @@ <span slot="footer" class="dialog-footer"> <div class="footerButton"> <el-button @click="dialogVisibleCancel">取 消</el-button> <el-button type="primary" @click="dialogVisibleConfirm">确 定</el-button> <el-button type="primary" :loading="$store.state.app.buttonIsDisabled" :disabled="$store.state.app.buttonIsDisabled" @click="dialogVisibleConfirm" >确 定</el-button> </div> </span> </el-dialog> @@ -425,7 +430,12 @@ <span slot="footer" class="dialog-footer"> <div class="footerButton"> <el-button @click="rolesDialogVisibleCancel">取 消</el-button> <el-button type="primary" @click="rolesDialogVisibleConfirm">确 定</el-button> <el-button type="primary" :loading="$store.state.app.buttonIsDisabled" :disabled="$store.state.app.buttonIsDisabled" @click="rolesDialogVisibleConfirm" >确 定</el-button> </div> </span> </el-dialog> @@ -477,7 +487,12 @@ sortable="custom" > <template slot-scope="{row}"> <el-input v-if="row.isVisible===1" v-model="row.group_code" oninput="value=value.replace(/[^0-9a-zA-Z]/g,'')" placeholder="请输入" /> <el-input v-if="row.isVisible===1" v-model="row.group_code" oninput="value=value.replace(/[^0-9a-zA-Z]/g,'')" placeholder="请输入" /> <div v-else> {{ row.group_code }}</div> </template> </el-table-column> @@ -531,7 +546,14 @@ </el-dialog> <!--导入组件--> <import-picker ref="importPickerFunc" class="importPickerClass" :shows.sync="shows" :title="title_value" :colos="colos" :code="code" /> <import-picker ref="importPickerFunc" class="importPickerClass" :shows.sync="shows" :title="title_value" :colos="colos" :code="code" /> </div> </template> @@ -863,6 +885,7 @@ dialogVisibleConfirm() { this.$refs.dialogForm.validate(valid => { if (valid) { this.$store.state.app.buttonIsDisabled = true const data = { id: this.dialogForm.id, UserCode: this.dialogForm.UserCode, @@ -880,11 +903,13 @@ } AddUpdateUser(data).then(res => { if (res.code === '200') { this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!') this.dialogVisible = false this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!') this.getUserSearch() this.$store.state.app.buttonIsDisabled = false } else { this.$message.error(this.operation === 'add' ? '添加失败!' : '修改失败!') this.$store.state.app.buttonIsDisabled = false } }) } @@ -904,53 +929,71 @@ }) }, // 关联角色点击事件 async roleClick({ row }) { roleClick({ row }) { const loading = this.$loading({ lock: true, text: '正在加载数据,请稍等...', spinner: 'el-icon-loading', customClass: 'osloading', background: 'rgba(0, 0, 0, 0.7)' }) this.dialogFormRoles.rolesArrSelectedArr = [] this.dialogFormRoles.rolesArr = [] this.dialogFormRoles.roleTreeSelectedArr = [] this.dialogVisibleRoles = true this.dialogFormRoles.username = row.username this.dialogFormRoles.usercode = row.usercode const { data: res } = await UserAssociationRole({ usercode: row.usercode }) this.rolesAll = res.filter(item => item.children.length !== 0) UserAssociationRole({ usercode: row.usercode }).then(res => { if (res.code === '200') { setTimeout(() => { loading.close() const nodeKey = []// 树形回显key this.rolesAll.forEach((item, index) => { this.dialogFormRoles.rolesArr.push({ code: item.code, name: item.name, flag: item.flag, isSelected1: false, isSelected2: false }) if (item.flag === 'Y') { this.dialogFormRoles.rolesArr[index].isSelected2 = true this.$nextTick(() => { // $('input:checkbox').eq(index).attr('checked', true)// 自定义单选框回显 $('input:checkbox').eq(index).prop('checked', true)// 自定义单选框回显 }) this.dialogFormRoles.rolesArrSelectedArr.push(item.name) if (item.children && item.children.length > 0) { const Data = [] item.children.forEach(it => { if (it.flag === 'Y') { nodeKey.push(it.code) Data.push(it.code) this.dialogVisibleRoles = true this.rolesAll = res.data.filter(item => item.children.length !== 0) const nodeKey = []// 树形回显key this.rolesAll.forEach((item, index) => { this.dialogFormRoles.rolesArr.push({ code: item.code, name: item.name, flag: item.flag, isSelected1: false, isSelected2: false }) if (item.flag === 'Y') { this.dialogFormRoles.rolesArr[index].isSelected2 = true this.$nextTick(() => { // $('input:checkbox').eq(index).attr('checked', true)// 自定义单选框回显 $('input:checkbox').eq(index).prop('checked', true)// 自定义单选框回显 }) this.dialogFormRoles.rolesArrSelectedArr.push(item.name) if (item.children && item.children.length > 0) { const Data = [] item.children.forEach(it => { if (it.flag === 'Y') { nodeKey.push(it.code) Data.push(it.code) } }) this.dialogFormRoles.roleTreeSelectedArr.push({ Code: item.code, Name: item.name, Data: Data }) } } }) this.dialogFormRoles.roleTreeSelectedArr.push({ Code: item.code, Name: item.name, Data: Data }) } this.dialogFormRoles.rolesArr[0].isSelected1 = true// 默认选中第一个 this.dialogFormRoles.roleTree = this.rolesAll.filter(item => item.code === this.dialogFormRoles.rolesArr[0].code) this.dialogFormRoles.roleTree[0].name = '全部' this.$nextTick(() => { this.$refs.roleTree.setCheckedKeys(nodeKey) }) }, 1000) } else { loading.close() } }) this.dialogFormRoles.rolesArr[0].isSelected1 = true// 默认选中第一个 // this.dialogFormRoles.rolesArr[0].name = '全部' this.dialogFormRoles.roleTree = this.rolesAll.filter(item => item.code === this.dialogFormRoles.rolesArr[0].code) this.dialogFormRoles.roleTree[0].name = '全部' // this.dialogFormRoles.rolesArr console.log(nodeKey, 1) this.$refs.roleTree.setCheckedKeys(nodeKey) }, // 处理用户关联对话框关闭事件 handleCloseRoles() { @@ -963,12 +1006,15 @@ }, // 用户关联对话框确认事件 async rolesDialogVisibleConfirm() { console.log(this.dialogFormRoles.roleTreeSelectedArr, 333337) this.$store.state.app.buttonIsDisabled = true const res = await SaveUserAssoctRole(this.dialogFormRoles.roleTreeSelectedArr, this.dialogFormRoles.usercode) if (res.code === '200') { this.dialogVisibleRoles = false this.$message.success('保存成功!') await this.getUserSearch() this.dialogVisibleRoles = false this.$store.state.app.buttonIsDisabled = false } else { this.$store.state.app.buttonIsDisabled = false } }, // 树形复选框点击事件 @@ -1368,15 +1414,17 @@ <style lang="scss" scoped> $main_color: #42b983; ::v-deep .el-button--text{ font-size: 14px ; cursor: pointer ; ::v-deep .el-button--text { font-size: 14px; cursor: pointer; } .el-icon-share ,.el-icon-delete,.el-icon-edit-outline{ .el-icon-share, .el-icon-delete, .el-icon-edit-outline { color: $main_color; cursor: pointer; } .el-icon-edit-outline{ .el-icon-edit-outline { margin-right: 15px; } @@ -1437,8 +1485,8 @@ background-color: #f8f8fa; } ::v-deep .el-table__body .el-table__row.hover-row td{ background-color: #eaecef ; ::v-deep .el-table__body .el-table__row.hover-row td { background-color: #eaecef; } ::v-deep .el-form--inline .el-form-item__label { @@ -1455,18 +1503,25 @@ margin-bottom: 0; } .tableFixed{ ::v-deep .el-table__fixed-right{ .tableFixed { ::v-deep .el-table__fixed-right { height: 100% !important; } ::v-deep .el-table__fixed{ ::v-deep .el-table__fixed { height: 100% !important; } } </style> <style> .osloading{ font-size: 26px !important; } .el-loading-text{ font-size: 26px !important; } .el-table .custom-row { background: #f8f8fa; } src/views/jcsz/zzjg.vue
@@ -5,7 +5,6 @@ <div class="bodyTopButtonGroup"> <el-button type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">新增</el-button> </div> <div class="bodyTopFormGroup"> <el-form ref="form" @@ -204,7 +203,12 @@ <span slot="footer" class="dialog-footer"> <div class="footerButton"> <el-button @click="dialogVisibleCancel">取 消</el-button> <el-button type="primary" @click="dialogVisibleConfirm">确 定</el-button> <el-button type="primary" :loading="$store.state.app.buttonIsDisabled" :disabled="$store.state.app.buttonIsDisabled" @click="dialogVisibleConfirm" >确 定</el-button> </div> </span> </el-dialog> @@ -329,6 +333,9 @@ // })() // } }, destroyed() { }, methods: { async getOrganizationSearch() { const res = await OrganizationSearch(this.form) @@ -367,7 +374,6 @@ this.SupUnitArr = res } }, // 新增按钮 async add(operation) { this.operation = operation @@ -437,6 +443,7 @@ dialogVisibleConfirm() { this.$refs.dialogForm.validate(valid => { if (valid) { this.$store.state.app.buttonIsDisabled = true const data = { OrganType: this.dialogForm.OrgType === '部门' ? 'D' : 'W', OrganCode: this.dialogForm.OrgCode, @@ -452,11 +459,13 @@ AddUpdateOrganization(data).then(res => { if (res.code === '200') { this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!') this.dialogVisible = false this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!') this.getOrganizationSearch() this.$store.state.app.buttonIsDisabled = false } else { this.$message.error(this.operation === 'add' ? '添加失败!' : '修改失败!') this.$store.state.app.buttonIsDisabled = false } }) } @@ -568,11 +577,12 @@ margin-bottom: 0; } .tableFixed{ ::v-deep .el-table__fixed-right{ .tableFixed { ::v-deep .el-table__fixed-right { height: 100% !important; } ::v-deep .el-table__fixed{ ::v-deep .el-table__fixed { height: 100% !important; } } @@ -588,6 +598,9 @@ //} </style> <style> .osloading{ font-size: 30px; } .el-table .custom-row { background: #f8f8fa; src/views/kb/ckgl.vue
@@ -291,11 +291,12 @@ <div class="kb_right kb_pd10"> <div class="kb_right_top kb_pd10"> <div class="kb_right_top_content"> <div class="content_head kb_title_text" style="margin-top: 30px;">产品库存量排行Top5</div> <div class="content_head kb_title_text" style="margin-top: 30px;">半成品、产品库存量排行Top5</div> <div class="content_body" style="height:402px;"> <div id="bar03" style="width: 100%;height:100%" /> </div> <div class="content_head kb_title_text" style="margin-top: 12px">半成品库存量排行Top5</div> <!-- <div class="content_head kb_title_text" style="margin-top: 12px">半成品库存量排行Top5</div>--> <div class="content_head kb_title_text" style="margin-top: 12px">原材料库存量排行Top5</div> <div class="content_body"> <div id="bar04" style="width: 100%;height:100%" /> </div> src/views/sbgl/bybw.vue
@@ -187,7 +187,12 @@ <span slot="footer" class="dialog-footer"> <div class="footerButton"> <el-button @click="dialogVisibleCancel">取 消</el-button> <el-button type="primary" @click="dialogVisibleConfirm">确 定</el-button> <el-button type="primary" :loading="$store.state.app.buttonIsDisabled" :disabled="$store.state.app.buttonIsDisabled" @click="dialogVisibleConfirm" >确 定</el-button> </div> </span> </el-dialog> @@ -366,6 +371,7 @@ dialogVisibleConfirm() { this.$refs.dialogForm.validate(valid => { if (valid) { this.$store.state.app.buttonIsDisabled = true const data = { id: this.dialogForm.id, maiitemcode: this.dialogForm.maiitemcode, @@ -374,12 +380,12 @@ isqrcode: this.dialogForm.isqrcode, OperType: this.operation === 'add' ? 'Add' : 'Update' } console.log(data) AddUpdateDeviceMaiItem(data).then(res => { if (res.code === '200') { this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!') this.dialogVisible = false this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!') this.getDeviceMaiItemSearch() this.$store.state.app.buttonIsDisabled = false } else { this.$message.error(this.operation === 'add' ? '添加失败!' : '修改失败!') } src/views/sbgl/bybz.vue
@@ -304,7 +304,12 @@ <span slot="footer" class="dialog-footer"> <div class="footerButton"> <el-button @click="dialogVisibleCancel">取 消</el-button> <el-button type="primary" @click="dialogVisibleConfirm">确 定</el-button> <el-button type="primary" :loading="$store.state.app.buttonIsDisabled" :disabled="$store.state.app.buttonIsDisabled" @click="dialogVisibleConfirm" >确 定</el-button> </div> </span> </el-dialog> @@ -373,7 +378,12 @@ <span slot="footer" class="dialog-footer"> <div class="footerButton"> <el-button @click="eqpDialogVisibleCancel">取 消</el-button> <el-button type="primary" @click="eqpDialogVisibleConfirm">确 定</el-button> <el-button type="primary" :loading="$store.state.app.buttonIsDisabled" :disabled="$store.state.app.buttonIsDisabled" @click="eqpDialogVisibleConfirm" >确 定</el-button> </div> </span> </el-dialog> @@ -575,7 +585,7 @@ }, // 修改前请求接口 async getViewDeviceRepairStanedSearch(repairstand_code) { const { data: res } = await ViewDeviceRepairStanedSearch({ repairstand_code }) const { data: res } = await ViewDeviceRepairStanedSearch({ repairstand_code }) this.tableDataDialog = res.Data this.dialogForm.code = res.code @@ -631,6 +641,7 @@ dialogVisibleConfirm() { this.$refs.dialogForm.validate(valid => { if (valid) { this.$store.state.app.buttonIsDisabled = true this.tableDataDialog.filter(item => item.repairitem_code !== '') let Data = [] @@ -652,9 +663,10 @@ AddUpdateDeviceRepairStandArd(data, this.operation === 'add' ? 'Add' : 'Update').then(res => { if (res.code === '200') { this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!') this.dialogVisible = false this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!') this.getDeviceRepairStandArdSearch() this.$store.state.app.buttonIsDisabled = false } else { this.$message.error(this.operation === 'add' ? '添加失败!' : '修改失败!') } @@ -775,43 +787,59 @@ return 'custom-row' }, // 关联设备 async checkeqpClick(row) { checkeqpClick(row) { const loading = this.$loading({ lock: true, text: '正在加载数据,请稍等...', spinner: 'el-icon-loading', customClass: 'osloading', background: 'rgba(0, 0, 0, 0.7)' }) this.dialogFormEqp.name = row.name this.dialogFormEqp.code = row.code const { data: res } = await DeviceRepairStanedAssociationEqp({ repairstand_code: row.code }) this.dialogFormEqp.eqpAll = res.filter(item => item.children.length > 0) DeviceRepairStanedAssociationEqp({ repairstand_code: row.code }).then(res => { if (res.code === '200') { setTimeout(() => { loading.close() this.dialogFormEqp.eqpAll = res.data.filter(item => item.children.length > 0) if (this.dialogFormEqp.eqpAll.length > 0) { this.dialogFormEqp.eqpAll.forEach((item, index) => { this.dialogFormEqp.eqpArr.push({ code: item.code, name: item.name, type: item.type, isSelected1: index === 0, isSelected2: item.flag === 'Y' }) if (item.flag === 'Y') { this.$nextTick(() => { $('input:checkbox').eq(index).prop('checked', true)// 自定义单选框回显 if (this.dialogFormEqp.eqpAll.length > 0) { this.dialogFormEqp.eqpAll.forEach((item, index) => { this.dialogFormEqp.eqpArr.push({ code: item.code, name: item.name, type: item.type, isSelected1: index === 0, isSelected2: item.flag === 'Y' }) if (item.flag === 'Y') { this.$nextTick(() => { $('input:checkbox').eq(index).prop('checked', true)// 自定义单选框回显 }) } if (item.children && item.children.length > 0) { item.children.forEach(it => { if (it.flag === 'Y') { this.dialogFormEqp.eqpCodeSelectedArr.push(it.code) } }) } }) this.dialogFormEqp.eqpAll[0].name = '全部' this.dialogFormEqp.eqpTree = [this.dialogFormEqp.eqpAll[0]] } this.dialogVisibleEqp = true this.$nextTick(() => { // 树形回显 this.$refs.epqTree.setCheckedKeys(this.dialogFormEqp.eqpCodeSelectedArr) }) } if (item.children && item.children.length > 0) { item.children.forEach(it => { if (it.flag === 'Y') { this.dialogFormEqp.eqpCodeSelectedArr.push(it.code) } }) } }) this.dialogFormEqp.eqpAll[0].name = '全部' this.dialogFormEqp.eqpTree = [this.dialogFormEqp.eqpAll[0]] } this.dialogVisibleEqp = true this.$nextTick(() => { // 树形回显 this.$refs.epqTree.setCheckedKeys(this.dialogFormEqp.eqpCodeSelectedArr) }, 1000) } else { loading.close() } }) }, // 关联设备对话框关闭 @@ -971,6 +999,7 @@ eqpDialogVisibleConfirm() { // console.log(this.dialogFormEqp.eqpCodeSelectedArr, 888) // this.dialogVisibleEqp = false this.$store.state.app.buttonIsDisabled = true const data = [] this.dialogFormEqp.eqpAll.forEach((item, index) => { if (item.children && item.children.length > 0) { @@ -987,9 +1016,10 @@ SaveDeviceRepairStanedAssociationEqp(data, this.dialogFormEqp.code).then(res => { if (res.code === '200') { this.dialogVisibleEqp = false this.$message.success('关联成功!') this.getDeviceRepairStandArdSearch() this.dialogVisibleEqp = false this.$store.state.app.buttonIsDisabled = false } }) } @@ -1163,18 +1193,25 @@ justify-content: center; } .tableFixed{ ::v-deep .el-table__fixed-right{ .tableFixed { ::v-deep .el-table__fixed-right { height: 100% !important; } ::v-deep .el-table__fixed{ ::v-deep .el-table__fixed { height: 100% !important; } } </style> <style> .osloading{ font-size: 26px !important; } .el-loading-text{ font-size: 26px !important; } .el-table .custom-row { background: #f8f8fa; } src/views/sbgl/djbw.vue
@@ -233,7 +233,12 @@ <span slot="footer" class="dialog-footer"> <div class="footerButton"> <el-button @click="dialogVisibleCancel">取 消</el-button> <el-button type="primary" @click="dialogVisibleConfirm">确 定</el-button> <el-button type="primary" :loading="$store.state.app.buttonIsDisabled" :disabled="$store.state.app.buttonIsDisabled" @click="dialogVisibleConfirm" >确 定</el-button> </div> </span> </el-dialog> @@ -425,6 +430,7 @@ dialogVisibleConfirm() { this.$refs.dialogForm.validate(valid => { if (valid) { this.$store.state.app.buttonIsDisabled = true const data = { id: this.dialogForm.id, checkitemcode: this.dialogForm.checkitemcode, @@ -437,9 +443,10 @@ } AddUpdateDeviceCheckItem(data).then(res => { if (res.code === '200') { this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!') this.dialogVisible = false this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!') this.getDeviceCheckItemSearch() this.$store.state.app.buttonIsDisabled = false } else { this.$message.error(this.operation === 'add' ? '添加失败!' : '修改失败!') } src/views/sbgl/djbz.vue
@@ -337,7 +337,12 @@ <span slot="footer" class="dialog-footer"> <div class="footerButton"> <el-button @click="dialogVisibleCancel">取 消</el-button> <el-button type="primary" @click="dialogVisibleConfirm">确 定</el-button> <el-button type="primary" :loading="$store.state.app.buttonIsDisabled" :disabled="$store.state.app.buttonIsDisabled" @click="dialogVisibleConfirm" >确 定</el-button> </div> </span> </el-dialog> @@ -406,7 +411,12 @@ <span slot="footer" class="dialog-footer"> <div class="footerButton"> <el-button @click="eqpDialogVisibleCancel">取 消</el-button> <el-button type="primary" @click="eqpDialogVisibleConfirm">确 定</el-button> <el-button type="primary" :loading="$store.state.app.buttonIsDisabled" :disabled="$store.state.app.buttonIsDisabled" @click="eqpDialogVisibleConfirm" >确 定</el-button> </div> </span> </el-dialog> @@ -661,6 +671,7 @@ dialogVisibleConfirm() { this.$refs.dialogForm.validate(valid => { if (valid) { this.$store.state.app.buttonIsDisabled = true // this.tableDataDialog.forEach((item, index) => { // 去掉正在编辑且是空checkitem_code // if (item.isVisible === 1 && item.checkitem_code === '') { // this.tableDataDialog.splice(index, 1) @@ -688,9 +699,10 @@ AddUpdateDeviceCheckStandArd(data, this.operation === 'add' ? 'Add' : 'Update').then(res => { if (res.code === '200') { this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!') this.dialogVisible = false this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!') this.getDeviceCheckStandArdSearch() this.$store.state.app.buttonIsDisabled = false } else { this.$message.error(this.operation === 'add' ? '添加失败!' : '修改失败!') } @@ -817,43 +829,58 @@ return 'custom-row' }, // 关联设备 async checkeqpClick(row) { checkeqpClick(row) { const loading = this.$loading({ lock: true, text: '正在加载数据,请稍等...', spinner: 'el-icon-loading', customClass: 'osloading', background: 'rgba(0, 0, 0, 0.7)' }) this.dialogFormEqp.name = row.name this.dialogFormEqp.code = row.code const { data: res } = await DeviceCheckStanedAssociationEqp({ checkstand_code: row.code }) this.dialogFormEqp.eqpAll = res.filter(item => item.children.length > 0) DeviceCheckStanedAssociationEqp({ checkstand_code: row.code }).then(res => { if (res.code === '200') { setTimeout(() => { loading.close() this.dialogFormEqp.eqpAll = res.data.filter(item => item.children.length > 0) if (this.dialogFormEqp.eqpAll.length > 0) { this.dialogFormEqp.eqpAll.forEach((item, index) => { this.dialogFormEqp.eqpArr.push({ code: item.code, name: item.name, type: item.type, isSelected1: index === 0, isSelected2: item.flag === 'Y' }) if (item.flag === 'Y') { this.$nextTick(() => { $('input:checkbox').eq(index).prop('checked', true)// 自定义单选框回显 if (this.dialogFormEqp.eqpAll.length > 0) { this.dialogFormEqp.eqpAll.forEach((item, index) => { this.dialogFormEqp.eqpArr.push({ code: item.code, name: item.name, type: item.type, isSelected1: index === 0, isSelected2: item.flag === 'Y' }) if (item.flag === 'Y') { this.$nextTick(() => { $('input:checkbox').eq(index).prop('checked', true)// 自定义单选框回显 }) } if (item.children && item.children.length > 0) { item.children.forEach(it => { if (it.flag === 'Y') { this.dialogFormEqp.eqpCodeSelectedArr.push(it.code) } }) } }) this.dialogFormEqp.eqpAll[0].name = '全部' this.dialogFormEqp.eqpTree = [this.dialogFormEqp.eqpAll[0]] } this.dialogVisibleEqp = true this.$nextTick(() => { // 树形回显 this.$refs.epqTree.setCheckedKeys(this.dialogFormEqp.eqpCodeSelectedArr) }) } if (item.children && item.children.length > 0) { item.children.forEach(it => { if (it.flag === 'Y') { this.dialogFormEqp.eqpCodeSelectedArr.push(it.code) } }) } }) this.dialogFormEqp.eqpAll[0].name = '全部' this.dialogFormEqp.eqpTree = [this.dialogFormEqp.eqpAll[0]] } this.dialogVisibleEqp = true this.$nextTick(() => { // 树形回显 this.$refs.epqTree.setCheckedKeys(this.dialogFormEqp.eqpCodeSelectedArr) }, 1000) } else { loading.close() } }) }, // 关联设备对话框关闭 @@ -1013,6 +1040,7 @@ eqpDialogVisibleConfirm() { // console.log(this.dialogFormEqp.eqpCodeSelectedArr, 888) // this.dialogVisibleEqp = false this.$store.state.app.buttonIsDisabled = true const data = [] this.dialogFormEqp.eqpAll.forEach((item, index) => { if (item.children && item.children.length > 0) { @@ -1029,9 +1057,10 @@ SaveDeviceCheckStanedAssociationEqp(data, this.dialogFormEqp.code).then(res => { if (res.code === '200') { this.dialogVisibleEqp = false this.$message.success('关联成功!') this.getDeviceCheckStandArdSearch() this.dialogVisibleEqp = false this.$store.state.app.buttonIsDisabled = false } }) } @@ -1215,7 +1244,13 @@ } </style> <style> .osloading{ font-size: 26px !important; } .el-loading-text{ font-size: 26px !important; } .el-table .custom-row { background: #f8f8fa; } src/views/sbgl/sbqd.vue
@@ -374,7 +374,12 @@ <span slot="footer" class="dialog-footer"> <div class="footerButton"> <el-button @click="dialogVisibleCancel">取 消</el-button> <el-button type="primary" @click="dialogVisibleConfirm">确 定</el-button> <el-button type="primary" :loading="$store.state.app.buttonIsDisabled" :disabled="$store.state.app.buttonIsDisabled" @click="dialogVisibleConfirm" >确 定</el-button> </div> </span> </el-dialog> @@ -849,6 +854,7 @@ dialogVisibleConfirm() { this.$refs.dialogForm.validate(valid => { if (valid) { this.$store.state.app.buttonIsDisabled = true const data = { id: this.dialogForm.id, devicecode: this.dialogForm.devicecode, @@ -865,9 +871,10 @@ } AddUpdateDeviceManger(data).then(res => { if (res.code === '200') { this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!') this.dialogVisible = false this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!') this.getDeviceMangerSearch() this.$store.state.app.buttonIsDisabled = false } else { this.$message.error(this.operation === 'add' ? '添加失败!' : '修改失败!') } src/views/scgl/gd.vue
@@ -680,7 +680,12 @@ <div class="footerButton"> <el-button @click="dialogVisibleCancel">取 消</el-button> <!-- <el-button v-if="operation==='add'" type="primary" @click="dialogVisibleConfirmPreview('add')">预览</el-button>--> <el-button type="primary" @click="dialogVisibleConfirm">确 定</el-button> <el-button type="primary" :loading="$store.state.app.buttonIsDisabled" :disabled="$store.state.app.buttonIsDisabled" @click="dialogVisibleConfirm" >确 定</el-button> </div> </span> </el-dialog> @@ -2085,6 +2090,7 @@ if (this.dialogForm.ordertype === 'FO' && this.dialogForm.sourceorder.toString().trim().length <= 0) { return this.$message.info('源单单号不能为空!') } const data = { // partname: this.dialogForm.partname, // 产品名称 // partspec: this.dialogForm.partspec, // 产品规格 @@ -2104,7 +2110,7 @@ orderlev: this.dialogForm.orderlev, // 工单等级 OperType: this.operation === 'add' ? 'Add' : 'Update' } this.$store.state.app.buttonIsDisabled = true AddUpdateMesOrder(data).then(res => { if (res.code === '200') { this.dialogVisible = false @@ -2114,6 +2120,7 @@ this.$message.success(this.operation === 'add' ? '添加成功!' : '派发成功!') // this.dialogVisible = false this.getMesOrderSearch() this.$store.state.app.buttonIsDisabled = false } else { this.$message.error(this.operation === 'add' ? '添加失败!' : '派发失败!') } src/views/scgl/scdd.vue
@@ -370,7 +370,12 @@ <span slot="footer" class="dialog-footer"> <div class="footerButton"> <el-button @click="dialogVisibleCancel">取 消</el-button> <el-button type="primary" :disabled="sendButtonIsDisabled" @click="dialogVisibleConfirm">下 达</el-button> <el-button type="primary" :loading="$store.state.app.buttonIsDisabled" :disabled="$store.state.app.buttonIsDisabled" @click="dialogVisibleConfirm" >下 达</el-button> </div> </span> </el-dialog> @@ -653,7 +658,6 @@ this.dialogForm.ordernum = '' this.dialogForm.relse_qty = '' this.sendButtonIsDisabled = false this.$refs.dialogForm.clearValidate() }, // 对话框取消 @@ -670,13 +674,13 @@ return this.$message.info('下单数量超出可下单数的范围!') } console.log(this.dialogForm.ordernum < this.dialogForm.markqty) if (this.dialogForm.ordernum < 1 || this.dialogForm.ordernum > this.dialogForm.markqty) { return this.$message.info('下单单数超出可下单单数的范围!') } this.$refs.dialogForm.validate(valid => { if (valid) { this.$store.state.app.buttonIsDisabled = true const data = { 'erporderid': this.dialogForm.erporderid, // 'erporderstus': this.dialogForm.erporderstus, @@ -689,12 +693,12 @@ 'ordernum': this.dialogForm.ordernum, 'relse_qty': this.dialogForm.relse_qty } this.sendButtonIsDisabled = true MarkSaveErpOrder(data).then(res => { if (res.code === '200') { this.$message.success('下达成功!') this.dialogVisible = false this.$message.success('下达成功!') this.getErpOrderSearch() this.$store.state.app.buttonIsDisabled = false } else { this.$message.error('下达失败!') } @@ -839,15 +843,18 @@ height: 100% !important; } } </style> <style> .el-table .custom-row { background: #f8f8fa; } </style> <style> .osloading{ font-size: 40px; font-size: 26px !important; } .el-loading-text{ font-size: 26px !important; } </style> src/views/scgl/sckbg.vue
@@ -857,10 +857,34 @@ <span slot="footer" class="dialog-footer"> <div class="footerButton"> <el-button @click="dialogVisibleCancel">取 消</el-button> <el-button v-if="dialogTitle==='自制开始'" type="primary" @click="dialogVisibleConfirm">开 工</el-button> <el-button v-if="dialogTitle==='自制报工'" type="primary" @click="dialogVisibleConfirm">提交/打印</el-button> <el-button v-if="dialogTitle==='外协发料'" type="primary" @click="dialogVisibleConfirm">发料</el-button> <el-button v-if="dialogTitle==='外协收料'" type="primary" @click="dialogVisibleConfirm">收料/打印</el-button> <el-button v-if="dialogTitle==='自制开始'" :loading="$store.state.app.buttonIsDisabled" :disabled="$store.state.app.buttonIsDisabled" type="primary" @click="dialogVisibleConfirm" >开 工</el-button> <el-button v-if="dialogTitle==='自制报工'" :loading="$store.state.app.buttonIsDisabled" :disabled="$store.state.app.buttonIsDisabled" type="primary" @click="dialogVisibleConfirm" >提交/打印</el-button> <el-button v-if="dialogTitle==='外协发料'" :loading="$store.state.app.buttonIsDisabled" :disabled="$store.state.app.buttonIsDisabled" type="primary" @click="dialogVisibleConfirm" >发料</el-button> <el-button v-if="dialogTitle==='外协收料'" :loading="$store.state.app.buttonIsDisabled" :disabled="$store.state.app.buttonIsDisabled" type="primary" @click="dialogVisibleConfirm" >收料/打印</el-button> </div> </span> </el-dialog> @@ -1100,7 +1124,12 @@ <span slot="footer" class="dialog-footer"> <div class="footerButton"> <el-button @click="badDialogVisibleCancel">取 消</el-button> <el-button type="primary" @click="badDialogVisibleConfirm ">保 存/打 印</el-button> <el-button type="primary" :loading="$store.state.app.buttonIsDisabled" :disabled="$store.state.app.buttonIsDisabled" @click="badDialogVisibleConfirm " >保 存/打 印</el-button> </div> </span> </el-dialog> @@ -1320,7 +1349,7 @@ OperationArr: [], // 人员数组 sendButtonIsDisabled: false, // 下达按钮是否可点击 judgeIsScanningArr: [], // 判断是否扫码数组 countJudgeIsScanningInput: 0// 判断扫码框的个数 countJudgeIsScanningInput: 0 // 判断扫码框的个数 } }, watch: { @@ -1909,6 +1938,7 @@ dialogVisibleConfirm() { this.$refs.dialogForm.validate(valid => { if (valid) { this.$store.state.app.buttonIsDisabled = true if (this.dialogTitle === '外协发料') { if (parseFloat(this.dialogForm.fqty) > parseFloat(this.dialogForm.noreportqty)) { return this.$message.info('发料数量不能大于未发数量!') @@ -1925,9 +1955,10 @@ } SavaMesOrderStepOut(data).then(res => { if (res.code === '200') { this.$message.success('发料成功!') this.dialogVisible = false this.$message.success('发料成功!') this.tabClick() this.$store.state.app.buttonIsDisabled = false } else { this.$message.error('发料失败!') } @@ -1967,7 +1998,9 @@ this.dialogVisible2 = true } this.dialogVisible = false this.tabClick() this.$store.state.app.buttonIsDisabled = false } else { this.$message.error('收料失败!') } @@ -1989,6 +2022,7 @@ this.$message.success('开工成功!') this.dialogVisible = false this.tabClick() this.$store.state.app.buttonIsDisabled = false } else { this.$message.error('开工失败!') } @@ -2041,6 +2075,7 @@ if (this.dialogForm.nextstepcode === '') { this.ZZprint2(this.OperationArr.find(item => item.usercode === this.dialogForm.operation).username) this.dialogVisible2 = true this.$store.state.app.buttonIsDisabled = false } this.dialogVisible = false this.tabClick() @@ -2129,13 +2164,16 @@ const data = { Data: this.badTableDataDialog } this.$store.state.app.buttonIsDisabled = true EditOrderNgStepSeave(data, this.badDialogForm.operation).then(res => { if (res.code === '200' || res.code === '301') { this.getBadList() this.badDialogVisible = false this.badPrint(this.OperationArr.find(item => item.usercode === this.badDialogForm.operation).username) this.dialogVisible2 = true return this.$message.success('保存成功!') this.$message.success('保存成功!') this.$store.state.app.buttonIsDisabled = false } }) }, @@ -2148,7 +2186,7 @@ this.qrForm.nextstepname = this.badDialogForm.nextstepname this.qrForm.operator = username this.qrForm.operatorTime = handleDatetime2(new Date()) console.log(this.qrForm, 22) this.$nextTick(() => { this.bindQRCode(this.qrForm.qrvalue) }) src/views/wlgl/ckdy.vue
@@ -154,7 +154,12 @@ <span slot="footer" class="dialog-footer"> <div class="footerButton"> <el-button @click="dialogVisibleCancel">取 消</el-button> <el-button type="primary" @click="dialogVisibleConfirm">确 定</el-button> <el-button type="primary" :loading="$store.state.app.buttonIsDisabled" :disabled="$store.state.app.buttonIsDisabled" @click="dialogVisibleConfirm" >确 定</el-button> </div> </span> </el-dialog> @@ -344,6 +349,7 @@ dialogVisibleConfirm() { this.$refs.dialogForm.validate(valid => { if (valid) { this.$store.state.app.buttonIsDisabled = true const data = { 'id': this.dialogForm.id, 'warehousecode': this.dialogForm.warehousecode, @@ -353,9 +359,10 @@ } AddUpdateWareHouseDef(data).then(res => { if (res.code === '200') { this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!') this.dialogVisible = false this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!') this.getWareHouseDefSearch() this.$store.state.app.buttonIsDisabled = false } else { this.$message.error(this.operation === 'add' ? '添加失败!' : '修改失败!') } src/views/wlgl/kwdy.vue
@@ -200,7 +200,12 @@ <span slot="footer" class="dialog-footer"> <div class="footerButton"> <el-button @click="dialogVisibleCancel">取 消</el-button> <el-button type="primary" @click="dialogVisibleConfirm">确 定</el-button> <el-button type="primary" :loading="$store.state.app.buttonIsDisabled" :disabled="$store.state.app.buttonIsDisabled" @click="dialogVisibleConfirm" >确 定</el-button> </div> </span> </el-dialog> @@ -374,6 +379,7 @@ dialogVisibleConfirm() { this.$refs.dialogForm.validate(valid => { if (valid) { this.$store.state.app.buttonIsDisabled = true const data = { 'id': this.dialogForm.id, 'storagecode': this.dialogForm.storagecode, @@ -384,9 +390,10 @@ } AddUpdateStorageDef(data).then(res => { if (res.code === '200') { this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!') this.dialogVisible = false this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!') this.getStorageDefSearch() this.$store.state.app.buttonIsDisabled = false } else { this.$message.error(this.operation === 'add' ? '添加失败!' : '修改失败!') } src/views/xtsz/cjgg.vue
@@ -242,7 +242,12 @@ <span slot="footer" class="dialog-footer"> <div class="footerButton"> <el-button @click="dialogVisibleCancel">取 消</el-button> <el-button type="primary" @click="dialogVisibleConfirm">确 定</el-button> <el-button type="primary" :loading="$store.state.app.buttonIsDisabled" :disabled="$store.state.app.buttonIsDisabled" @click="dialogVisibleConfirm" >确 定</el-button> </div> </span> </el-dialog> @@ -454,19 +459,19 @@ }, // 对话框确认 dialogVisibleConfirm() { console.log(this.dialogForm.dtString, 111) console.log(this.dialogForm.id, this.dialogForm.ancetitle, this.dialogForm.ancecont, this.dialogForm.level, this.dialogForm.cancel, this.dialogForm.opertype, 111) this.$refs.dialogForm.validate(valid => { if (valid) { this.$store.state.app.buttonIsDisabled = true const data = [] this.dialogForm.dtString.forEach(item => { data.push({ wksp_code: item }) }) SystemAnnouncementAddUpdate(data, this.dialogForm.id, this.dialogForm.ancetitle, this.dialogForm.ancecont, this.dialogForm.level, this.dialogForm.cancel, this.operation === 'add' ? 'Add' : 'Update').then(res => { if (res.code === '200') { this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!') this.dialogVisible = false this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!') this.getSystemAnnouncementSearch() this.$store.state.app.buttonIsDisabled = false } else { this.$message.error(this.operation === 'add' ? '添加失败!' : '修改失败!') } src/views/zlgl/gxjybz.vue
@@ -258,7 +258,13 @@ <div class="footerButton"> <el-button v-if="operation==='check'" @click="dialogVisibleCancel">返 回</el-button> <el-button v-if="operation!=='check'" @click="dialogVisibleCancel">取 消</el-button> <el-button v-if="operation!=='check'" type="primary" @click="dialogVisibleConfirm">提 交</el-button> <el-button v-if="operation!=='check'" :loading="$store.state.app.buttonIsDisabled" :disabled="$store.state.app.buttonIsDisabled" type="primary" @click="dialogVisibleConfirm" >提 交</el-button> </div> </span> </el-dialog> @@ -446,6 +452,7 @@ dialogVisibleConfirm() { this.$refs.dialogForm.validate(valid => { if (valid) { this.$store.state.app.buttonIsDisabled = true const tableData = [] this.JYTableData = this.JYTableData.filter(item => item.code !== '') this.JYTableData.forEach((item, index) => { @@ -464,9 +471,10 @@ } AddUpdateStepCheckStaned(this.operation === 'add' ? 'Add' : 'Update', data).then(res => { if (res.code === '200') { this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!') this.dialogVisible = false this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!') this.getStepCheckStanedSearch() this.$store.state.app.buttonIsDisabled = false } else { this.$message.error(this.operation === 'add' ? '添加失败!' : '修改失败!') } src/views/zlgl/gxjyxm.vue
@@ -141,7 +141,12 @@ <span slot="footer" class="dialog-footer"> <div class="footerButton"> <el-button @click="dialogVisibleCancel">取 消</el-button> <el-button type="primary" @click="dialogVisibleConfirm">确 定</el-button> <el-button type="primary" :loading="$store.state.app.buttonIsDisabled" :disabled="$store.state.app.buttonIsDisabled" @click="dialogVisibleConfirm" >确 定</el-button> </div> </span> </el-dialog> @@ -282,6 +287,7 @@ dialogVisibleConfirm() { this.$refs.dialogForm.validate(valid => { if (valid) { this.$store.state.app.buttonIsDisabled = true const data = { checkitemcode: this.dialogForm.checkitemcode, checkitemname: this.dialogForm.checkitemname, @@ -290,9 +296,10 @@ } AddUpdateStepCheckItem(data).then(res => { if (res.code === '200') { this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!') this.dialogVisible = false this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!') this.getStepCheckItemSearch() this.$store.state.app.buttonIsDisabled = false } else { this.$message.error(this.operation === 'add' ? '添加失败!' : '修改失败!') } src/views/zlgl/qxdy.vue
@@ -143,7 +143,12 @@ <span slot="footer" class="dialog-footer"> <div class="footerButton"> <el-button @click="dialogVisibleCancel">取 消</el-button> <el-button type="primary" @click="dialogVisibleConfirm">确 定</el-button> <el-button type="primary" :loading="$store.state.app.buttonIsDisabled" :disabled="$store.state.app.buttonIsDisabled" @click="dialogVisibleConfirm" >确 定</el-button> </div> </span> </el-dialog> @@ -303,6 +308,7 @@ dialogVisibleConfirm() { this.$refs.dialogForm.validate(valid => { if (valid) { this.$store.state.app.buttonIsDisabled = true const data = { defectcode: this.dialogForm.defectcode, defectname: this.dialogForm.defectname, @@ -311,9 +317,10 @@ } AddUpdateDedect(data).then(res => { if (res.code === '200') { this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!') this.dialogVisible = false this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!') this.getDedectSearch() this.$store.state.app.buttonIsDisabled = false } else { this.$message.error(this.operation === 'add' ? '添加失败!' : '修改失败!') } src/views/zzmx/chda.vue
@@ -161,6 +161,7 @@ prop="partspec" label="物料规格" width="110" show-tooltip-when-overflow sortable="custom" > <template slot-scope="{row}"> @@ -372,7 +373,12 @@ <span slot="footer" class="dialog-footer"> <div class="footerButton"> <el-button @click="dialogVisibleCancel">取 消</el-button> <el-button type="primary" @click="dialogVisibleConfirm">确 定</el-button> <el-button type="primary" :loading="$store.state.app.buttonIsDisabled" :disabled="$store.state.app.buttonIsDisabled" @click="dialogVisibleConfirm" >确 定</el-button> </div> </span> </el-dialog> @@ -606,7 +612,12 @@ <span slot="footer" class="dialog-footer"> <div class="footerButton"> <el-button @click="routeDialogVisibleCancel">取 消</el-button> <el-button type="primary" @click="routeDialogVisibleConfirm">确 定</el-button> <el-button type="primary" :loading="$store.state.app.buttonIsDisabled" :disabled="$store.state.app.buttonIsDisabled" @click="routeDialogVisibleConfirm" >确 定</el-button> </div> </span> </el-dialog> @@ -953,6 +964,7 @@ this.$refs.dialogForm.validate(valid => { if (valid) { this.$store.state.app.buttonIsDisabled = true const data = { id: this.dialogForm.id, materialcode: this.dialogForm.materialcode, @@ -968,9 +980,10 @@ } AddUpdateInventoryFile(data).then(res => { if (res.code === '200') { this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!') this.dialogVisible = false this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!') this.getInventoryFileSelect() this.$store.state.app.buttonIsDisabled = false } else { this.$message.error(this.operation === 'add' ? '添加失败!' : '修改失败!') } @@ -992,46 +1005,60 @@ }, /* 点击关联工艺路线模块*/ // 工艺路线点击 async routeClick(row) { console.log(row) routeClick(row) { const loading = this.$loading({ lock: true, text: '正在加载数据,请稍等...', spinner: 'el-icon-loading', customClass: 'osloading', background: 'rgba(0, 0, 0, 0.7)' }) this.defaultroute_code = row.default_route this.dialogFormRoute.projectCode = row.partcode this.dialogFormRoute.projectName = row.partname this.dialogVisibleRoute = true const { data: res } = await InventoryFileAssociationRoute({ partcode: this.dialogFormRoute.projectCode }) this.dialogFormRoute.routeOperationArr = res // let waitFlag = false// 回显等待是否放行 this.dialogFormRoute.routeOperationArr.forEach((item, index) => { item.isSelected1 = false item.isSelected2 = false if (index === 0) { item.isSelected1 = true this.projectTableData = item.Data } if (item.flag === 'Y') { item.isSelected2 = true this.$nextTick(() => { $('input:checkbox').eq(index).prop('checked', true) }) InventoryFileAssociationRoute({ partcode: this.dialogFormRoute.projectCode }).then(res => { if (res.code === '200') { setTimeout(() => { loading.close() this.dialogVisibleRoute = true this.dialogFormRoute.routeOperationArr = res.data // let waitFlag = false// 回显等待是否放行 // const interval = setInterval(() => { // if ($('input:checkbox').length > 0) { // waitFlag = true // } // if (waitFlag) { // clearInterval(interval) // this.$nextTick(() => { // $('input:checkbox').eq(index).prop('checked', true) // }) // } // }, 100) this.dialogFormRoute.routeOperationArr.forEach((item, index) => { item.isSelected1 = false item.isSelected2 = false if (index === 0) { item.isSelected1 = true this.projectTableData = item.Data } if (item.flag === 'Y') { item.isSelected2 = true this.$nextTick(() => { $('input:checkbox').eq(index).prop('checked', true) }) // const interval = setInterval(() => { // if ($('input:checkbox').length > 0) { // waitFlag = true // } // if (waitFlag) { // clearInterval(interval) // this.$nextTick(() => { // $('input:checkbox').eq(index).prop('checked', true) // }) // } // }, 100) } }) this.defaultroute_codeArr = this.dialogFormRoute.routeOperationArr.filter(item => item.flag === 'Y') }, 1000) } else { loading.close() } }) this.defaultroute_codeArr = this.dialogFormRoute.routeOperationArr.filter(item => item.flag === 'Y') console.log(this.defaultroute_codeArr, 123) }, // 对话框关闭 handleCloseRoute() { @@ -1056,12 +1083,13 @@ data.push({ code: item.code, name: item.name }) } }) this.$store.state.app.buttonIsDisabled = true const res = await SaveInventoryFile(this.dialogFormRoute.projectCode, this.defaultroute_code, data) if (res.code === '200') { this.dialogVisibleRoute = false this.$message.success('保存成功!') await this.getInventoryFileSelect() this.dialogVisibleRoute = false this.$store.state.app.buttonIsDisabled = false } }, // 大盒子点击事件 @@ -1374,7 +1402,13 @@ } </style> <style> .osloading{ font-size: 26px !important; } .el-loading-text{ font-size: 26px !important; } .el-table .custom-row { background: #f8f8fa; } src/views/zzmx/gxdy.vue
@@ -148,8 +148,14 @@ width="110" > <template slot-scope="{row}"> <div v-if="row.enable==='Y'"><svg-icon icon-class="circleYes" style="margin-right: 2px" />是</div> <div v-if="row.enable==='N'"> <svg-icon icon-class="circleNo" style="margin-right: 2px" />否</div> <div v-if="row.enable==='Y'"> <svg-icon icon-class="circleYes" style="margin-right: 2px" /> 是 </div> <div v-if="row.enable==='N'"> <svg-icon icon-class="circleNo" style="margin-right: 2px" /> 否 </div> </template> </el-table-column> <el-table-column @@ -296,7 +302,12 @@ <span slot="footer" class="dialog-footer"> <div class="footerButton"> <el-button @click="dialogVisibleCancel">取 消</el-button> <el-button type="primary" @click="dialogVisibleConfirm">确 定</el-button> <el-button type="primary" :loading="$store.state.app.buttonIsDisabled" :disabled="$store.state.app.buttonIsDisabled" @click="dialogVisibleConfirm" >确 定</el-button> </div> </span> </el-dialog> @@ -364,7 +375,12 @@ <span slot="footer" class="dialog-footer"> <div class="footerButton"> <el-button @click="workDialogVisibleCancel">取 消</el-button> <el-button type="primary" @click="workDialogVisibleConfirm">确 定</el-button> <el-button type="primary" :loading="$store.state.app.buttonIsDisabled" :disabled="$store.state.app.buttonIsDisabled" @click="workDialogVisibleConfirm" >确 定</el-button> </div> </span> </el-dialog> @@ -406,7 +422,12 @@ <span slot="footer" class="dialog-footer"> <div class="footerButton"> <el-button @click="defectDialogVisibleCancel">取 消</el-button> <el-button type="primary" @click="defectDialogVisibleConfirm">确 定</el-button> <el-button type="primary" :loading="$store.state.app.buttonIsDisabled" :disabled="$store.state.app.buttonIsDisabled" @click="defectDialogVisibleConfirm" >确 定</el-button> </div> </span> </el-dialog> @@ -610,6 +631,7 @@ dialogVisibleConfirm() { this.$refs.dialogForm.validate(valid => { if (valid) { this.$store.state.app.buttonIsDisabled = true const data = { id: this.dialogForm.id, stepcode: this.dialogForm.stepcode, @@ -621,9 +643,10 @@ } AddUpdateStep(data).then(res => { if (res.code === '200') { this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!') this.dialogVisible = false this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!') this.getStepSearch() this.$store.state.app.buttonIsDisabled = false } else { this.$message.error(this.operation === 'add' ? '添加失败!' : '修改失败!') } @@ -646,56 +669,71 @@ }, /* 关联工作站模块*/ // 关联工作站点击 async workClick(row) { this.workDialogVisible = true workClick(row) { const loading = this.$loading({ lock: true, text: '正在加载数据,请稍等...', spinner: 'el-icon-loading', customClass: 'osloading', background: 'rgba(0, 0, 0, 0.7)' }) this.workDialogForm.stepcode = row.stepcode this.workDialogForm.stepname = row.stepname const { data: res } = await StepAssociationEqp({ stepcode: this.workDialogForm.stepcode }) this.workDialogForm.workArr = res.filter(item => item.children.length !== 0) StepAssociationEqp({ stepcode: this.workDialogForm.stepcode }).then(res => { if (res.code === '200') { setTimeout(() => { loading.close() this.workDialogVisible = true let workGatherArr = [] if (row.flwtype === 'W') { // 外协情况下 workGatherArr = this.workDialogForm.workArr.filter(item => item.type === 'W') } else if (row.flwtype === 'Z') { // 自制情况下 workGatherArr = this.workDialogForm.workArr.filter(item => item.type === 'E') } else { // 自制+外协 workGatherArr = this.workDialogForm.workArr } // this.workDialogForm.workArr[1].children = [] const nodeKey = []// 需要树形数显的值 workGatherArr.forEach((item, index) => { this.workDialogForm.workGatherArr.push({ isSelected1: index === 0, isSelected2: item.flag === 'Y', code: item.code, name: item.name, type: item.type, flag: item.flag }) if (item.flag === 'Y' && item.children && item.children.length > 0) { this.$nextTick(() => { $("input[name='gather']").eq(index).prop('checked', true)// 自定义单选框回显 }) item.children.forEach(it => { if (it.flag === 'Y') { nodeKey.push(it.code) this.workDialogForm.workArr = res.data.filter(item => item.children.length !== 0) let workGatherArr = [] if (row.flwtype === 'W') { // 外协情况下 workGatherArr = this.workDialogForm.workArr.filter(item => item.type === 'W') } else if (row.flwtype === 'Z') { // 自制情况下 workGatherArr = this.workDialogForm.workArr.filter(item => item.type === 'E') } else { // 自制+外协 workGatherArr = this.workDialogForm.workArr } }) } if (index === 0) { if (item.children && item.children.length > 0) { this.workDialogForm.workTreeArr = this.workDialogForm.workArr.filter(it => it.code === item.code) this.workDialogForm.workTreeArr[0].name = '全部' } } // item.flag === 'Y'&&item }) console.log(nodeKey, 1) this.$refs.workTree.setCheckedKeys(nodeKey) this.workDialogForm.workTreeSelectedArr = nodeKey const nodeKey = []// 需要树形数显的值 workGatherArr.forEach((item, index) => { this.workDialogForm.workGatherArr.push({ isSelected1: index === 0, isSelected2: item.flag === 'Y', code: item.code, name: item.name, type: item.type, flag: item.flag }) if (item.flag === 'Y' && item.children && item.children.length > 0) { this.$nextTick(() => { $("input[name='gather']").eq(index).prop('checked', true)// 自定义单选框回显 }) item.children.forEach(it => { if (it.flag === 'Y') { nodeKey.push(it.code) } }) } if (index === 0) { if (item.children && item.children.length > 0) { this.workDialogForm.workTreeArr = this.workDialogForm.workArr.filter(it => it.code === item.code) this.workDialogForm.workTreeArr[0].name = '全部' } } // item.flag === 'Y'&&item }) console.log(this.workDialogForm.workGatherArr, 6) console.log(this.workDialogForm.workTreeArr, 7) this.$nextTick(() => { this.$refs.workTree.setCheckedKeys(nodeKey) }) this.workDialogForm.workTreeSelectedArr = nodeKey }, 1000) } else { loading.close() } }) }, // 大盒子点击事件 myCheckboxClick(val) { @@ -914,8 +952,7 @@ // 确认 async workDialogVisibleConfirm() { this.workDialogForm.workTreeSelectedArr = [...new Set(this.workDialogForm.workTreeSelectedArr)] console.log(this.workDialogForm.workTreeSelectedArr, 18) console.log(this.workDialogForm.workArr, 20) const data = [] this.workDialogForm.workArr.forEach(item => { if (item.flag === 'Y' && item.children && item.children.length > 0) { @@ -926,34 +963,51 @@ }) } }) console.log(data) this.$store.state.app.buttonIsDisabled = true const res = await SaveStepAssociationEqp(this.workDialogForm.stepcode, data) if (res.code === '200') { this.workDialogVisible = false this.$message.success('保存成功!') await this.getStepSearch() this.workDialogVisible = false this.$store.state.app.buttonIsDisabled = false } }, /* 关联缺陷*/ // 关联缺陷点击 async defectClick(row) { defectClick(row) { const loading = this.$loading({ lock: true, text: '正在加载数据,请稍等...', spinner: 'el-icon-loading', customClass: 'osloading', background: 'rgba(0, 0, 0, 0.7)' }) this.defectTreeCode = row.stepcode this.defectTreeName = row.stepname this.defectDialogVisible = true const { data: res } = await StepAssociationDefect({ stepcode: row.stepcode }) // this.defectTree = res this.defectTree.push({ code: 'QB', name: '全部', children: res, flag: 'N' }) console.log(this.defectTree, 6) const nokeKey = [] this.defectTree[0].children.forEach(item => { if (item.flag === 'Y') { nokeKey.push(item.code) StepAssociationDefect({ stepcode: row.stepcode }).then(res => { if (res.code === '200') { setTimeout(() => { loading.close() this.defectDialogVisible = true this.defectTree.push({ code: 'QB', name: '全部', children: res.data, flag: 'N' }) const nokeKey = [] this.defectTree[0].children.forEach(item => { if (item.flag === 'Y') { nokeKey.push(item.code) } }) this.$nextTick(() => { this.$refs.defectTree.setCheckedKeys(nokeKey) }) }, 1000) } else { loading.close() } }) console.log(nokeKey, 2) this.$nextTick(() => { this.$refs.defectTree.setCheckedKeys(nokeKey) }) }, // 关闭 @@ -974,11 +1028,13 @@ data.push({ code: item.code, name: item.name }) } }) this.$store.state.app.buttonIsDisabled = true const res = await SaveStepAssociationDefect(this.defectTreeCode, data) if (res.code === '200') { this.defectDialogVisible = false this.$message.success('保存成功!') await this.getStepSearch() this.defectDialogVisible = false this.$store.state.app.buttonIsDisabled = false } } } @@ -1136,17 +1192,25 @@ .userDialogVisible ::v-deep .el-form-item { margin-bottom: 0; } .tableFixed{ ::v-deep .el-table__fixed-right{ .tableFixed { ::v-deep .el-table__fixed-right { height: 100% !important; } ::v-deep .el-table__fixed{ ::v-deep .el-table__fixed { height: 100% !important; } } </style> <style> .osloading{ font-size: 26px !important; } .el-loading-text{ font-size: 26px !important; } .el-table .custom-row { background: #f8f8fa; } src/views/zzmx/gylx.vue
@@ -282,7 +282,13 @@ <div class="footerButton"> <el-button v-if="operation==='edit'" @click="dialogVisibleCancel">返 回</el-button> <el-button v-if="operation!=='edit'" @click="dialogVisibleCancel">取 消</el-button> <el-button v-if="operation!=='edit'" type="primary" @click="dialogVisibleConfirm">确 定</el-button> <el-button v-if="operation!=='edit'" type="primary" :loading="$store.state.app.buttonIsDisabled" :disabled="$store.state.app.buttonIsDisabled" @click="dialogVisibleConfirm" >确 定</el-button> </div> </span> </el-dialog> @@ -703,8 +709,6 @@ if (this.dynamicTags[0].stepname.trim() === '') { return this.$message.info('工艺设置第一项不能为空!') } console.log(this.routeSelectedArr, 3666666) console.log(this.dynamicTags, 3) const Data = [] this.dynamicTags.forEach(item => { Data.push({ seq: item.seq, stepcode: this.routeSelectedArr.find(it => it.stepname === item.stepname).stepcode, stepname: item.stepname }) @@ -715,9 +719,10 @@ item.stepcode = this.routeSelectedArr.find(it => it.stepname === item.stepname).stepcode } }) console.log(Data, 32) this.$refs.dialogForm.validate(valid => { if (valid) { this.$store.state.app.buttonIsDisabled = true const data = { code: this.dialogForm.code, name: this.dialogForm.name, @@ -725,12 +730,13 @@ description: this.dialogForm.description, Data: Data } console.log(data, 2) AddUpdateRoute(this.dialogForm.id, this.operation === 'add' ? 'Add' : 'Update', data).then(res => { if (res.code === '200') { this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!') this.dialogVisible = false this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!') this.getRouteSearch() this.$store.state.app.buttonIsDisabled = false } else { this.$message.error(this.operation === 'add' ? '添加失败!' : '修改失败!') } vue.config.js
@@ -52,7 +52,7 @@ [process.env.VUE_APP_BASE_API]: { target: 'http://121.196.36.24:8001', // 请求的第三⽅接⼝地址 本地开发服务器 // target: 'http://192.168.2.138:8001', // 请求的第三⽅接⼝地址 客户服务器(大岛) // target: 'http://192.168.5.176:8001', // 请求的第三⽅接⼝地址 客户服务器(索普) // target: 'http://192.168.5.176:8001', // 请求的第三⽅接⼝地址 客户服务器(普登) changeOrigin: true, // 请求跨域时,需 配置此项 pathRewrite: { // 路径重写,替换target中的请求地址 ['^' + process.env.VUE_APP_BASE_API]: '/api/'