From 482efd9ee971fe7d799a015dc288340c85b8805c Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期四, 29 九月 2022 11:24:17 +0800
Subject: [PATCH] 1.新增 提交类按钮只能提交一次的控制2.关联类的按钮 接口返回成功后显示对话框
---
src/views/jcsz/zzjg.vue | 27
src/views/zzmx/chda.vue | 110 ++-
src/views/scgl/scdd.vue | 23
src/views/jcsz/wldw.vue | 14
src/views/scgl/gd.vue | 11
vue.config.js | 2
src/views/scgl/sckbg.vue | 56 +
src/views/kb/ckgl.vue | 5
src/views/sbgl/djbz.vue | 107 ++-
src/views/zlgl/gxjyxm.vue | 11
src/views/sbgl/bybw.vue | 12
src/views/sbgl/bybz.vue | 117 ++-
src/views/zlgl/qxdy.vue | 11
src/layout/components/Sidebar/index.vue | 5
src/store/getters.js | 1
src/store/modules/app.js | 4
src/views/wlgl/kwdy.vue | 11
src/views/sbgl/djbw.vue | 11
src/views/zzmx/gylx.vue | 18
src/views/sbgl/sbqd.vue | 11
src/views/xtsz/cjgg.vue | 13
src/utils/request.js | 1
src/views/jcsz/yhqd.vue | 163 ++++--
src/views/jcsz/jsqd.vue | 532 +++++++++++--------
src/views/wlgl/ckdy.vue | 11
src/views/zzmx/gxdy.vue | 210 +++++--
src/views/zlgl/gxjybz.vue | 12
27 files changed, 973 insertions(+), 536 deletions(-)
diff --git a/src/layout/components/Sidebar/index.vue b/src/layout/components/Sidebar/index.vue
index a30d465..b66020e 100644
--- a/src/layout/components/Sidebar/index.vue
+++ b/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">鏂板嚡杩埗閫燰1.0.01</el-button>
+ <el-button v-if="$store.state.app.sidebar.opened" type="text" style="font-size: 14px;cursor: pointer">鏂板嚡杩埗閫燰1.0.01</el-button>
<!-- <el-button type="text"><a href="http://www.ykxkd.com/" target="_blank">鏂板嚡杩埗閫燰1.0.01</a></el-button>-->
</div>
</div>
diff --git a/src/store/getters.js b/src/store/getters.js
index 4a1d325..1d661bf 100644
--- a/src/store/getters.js
+++ b/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, // 鑷畾涔夊叏灞�鍙橀噺鍙傛暟 鎺у埗鎸夐挳鎻愪氦鏃禿isabled
token: state => state.user.token,
avatar: state => state.user.avatar,
name: state => state.user.name,
diff --git a/src/store/modules/app.js b/src/store/modules/app.js
index 7ea7e33..a868bf9 100644
--- a/src/store/modules/app.js
+++ b/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 // 鑷畾涔夊叏灞�鍙橀噺鍙傛暟 鎺у埗鎸夐挳鎻愪氦鏃禿isabled
}
const mutations = {
@@ -42,6 +43,7 @@
export default {
namespaced: true,
+ buttonIsDisabled: false,
state,
mutations,
actions
diff --git a/src/utils/request.js b/src/utils/request.js
index 77c864f..f67886e 100644
--- a/src/utils/request.js
+++ b/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') {
diff --git a/src/views/jcsz/jsqd.vue b/src/views/jcsz/jsqd.vue
index 7e5e879..8a26993 100644
--- a/src/views/jcsz/jsqd.vue
+++ b/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: '姝e湪鍔犺浇鏁版嵁锛岃绋嶇瓑...',
+ 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: '姝e湪鍔犺浇鏁版嵁锛岃绋嶇瓑...',
+ 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.绗竴绉嶆儏鍐礟C鍜孉PP閮戒竴娆¢兘娌¢�変腑鏃� PC鏈�変腑锛孉PP鏈�変腑
- if (rightPCArrFlag === 'N' && rightAPPArrFlag === 'N') {
- pcIsSelected1 = true
- this.dialogFormRight.rightCurrentCode = this.dialogFormRight.rightPCArr[0].code
- }
- // 2.绗簩绉嶆儏鍐礟C宸查�変腑锛孉PP鏈�変腑
- 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.绗竴绉嶆儏鍐礟C鍜孉PP閮戒竴娆¢兘娌¢�変腑鏃� PC鏈�変腑锛孉PP鏈�変腑
+ if (rightPCArrFlag === 'N' && rightAPPArrFlag === 'N') {
+ pcIsSelected1 = true
+ this.dialogFormRight.rightCurrentCode = this.dialogFormRight.rightPCArr[0].code
+ }
+ // 2.绗簩绉嶆儏鍐礟C宸查�変腑锛孉PP鏈�変腑
+ 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.绗笁绉嶆儏鍐礟C鏈�変腑锛孉PP宸查�変腑
+ 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.绗洓绉嶆儏鍐礟C宸查�変腑锛孉PP宸查�変腑
+ 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.绗笁绉嶆儏鍐礟C鏈�変腑锛孉PP宸查�変腑
- 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.绗洓绉嶆儏鍐礟C宸查�変腑锛孉PP宸查�変腑
- 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;
}
diff --git a/src/views/jcsz/wldw.vue b/src/views/jcsz/wldw.vue
index 0e47aee..31b1ed2 100644
--- a/src/views/jcsz/wldw.vue
+++ b/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
}
})
}
diff --git a/src/views/jcsz/yhqd.vue b/src/views/jcsz/yhqd.vue
index da3304d..20a2285 100644
--- a/src/views/jcsz/yhqd.vue
+++ b/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: '姝e湪鍔犺浇鏁版嵁锛岃绋嶇瓑...',
+ 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;
}
diff --git a/src/views/jcsz/zzjg.vue b/src/views/jcsz/zzjg.vue
index baacc88..5fa44be 100644
--- a/src/views/jcsz/zzjg.vue
+++ b/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;
diff --git a/src/views/kb/ckgl.vue b/src/views/kb/ckgl.vue
index 219485c..91121aa 100644
--- a/src/views/kb/ckgl.vue
+++ b/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;">浜у搧搴撳瓨閲忔帓琛孴op5</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>
diff --git a/src/views/sbgl/bybw.vue b/src/views/sbgl/bybw.vue
index 6857a7f..bda6be2 100644
--- a/src/views/sbgl/bybw.vue
+++ b/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' ? '娣诲姞澶辫触锛�' : '淇敼澶辫触锛�')
}
diff --git a/src/views/sbgl/bybz.vue b/src/views/sbgl/bybz.vue
index e4efde1..fe0ea0e 100644
--- a/src/views/sbgl/bybz.vue
+++ b/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: '姝e湪鍔犺浇鏁版嵁锛岃绋嶇瓑...',
+ 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;
}
diff --git a/src/views/sbgl/djbw.vue b/src/views/sbgl/djbw.vue
index 94b108d..a48882a 100644
--- a/src/views/sbgl/djbw.vue
+++ b/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' ? '娣诲姞澶辫触锛�' : '淇敼澶辫触锛�')
}
diff --git a/src/views/sbgl/djbz.vue b/src/views/sbgl/djbz.vue
index 45ab3dc..82a4437 100644
--- a/src/views/sbgl/djbz.vue
+++ b/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) => { // 鍘绘帀姝e湪缂栬緫涓旀槸绌篶heckitem_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: '姝e湪鍔犺浇鏁版嵁锛岃绋嶇瓑...',
+ 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;
}
diff --git a/src/views/sbgl/sbqd.vue b/src/views/sbgl/sbqd.vue
index 80caa79..6c58af2 100644
--- a/src/views/sbgl/sbqd.vue
+++ b/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' ? '娣诲姞澶辫触锛�' : '淇敼澶辫触锛�')
}
diff --git a/src/views/scgl/gd.vue b/src/views/scgl/gd.vue
index 79d4bc0..a132a69 100644
--- a/src/views/scgl/gd.vue
+++ b/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' ? '娣诲姞澶辫触锛�' : '娲惧彂澶辫触锛�')
}
diff --git a/src/views/scgl/scdd.vue b/src/views/scgl/scdd.vue
index 262793f..c6c1ced 100644
--- a/src/views/scgl/scdd.vue
+++ b/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>
+
diff --git a/src/views/scgl/sckbg.vue b/src/views/scgl/sckbg.vue
index 9cb938b..265672a 100644
--- a/src/views/scgl/sckbg.vue
+++ b/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)
})
diff --git a/src/views/wlgl/ckdy.vue b/src/views/wlgl/ckdy.vue
index 8ff90d4..91e55b7 100644
--- a/src/views/wlgl/ckdy.vue
+++ b/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' ? '娣诲姞澶辫触锛�' : '淇敼澶辫触锛�')
}
diff --git a/src/views/wlgl/kwdy.vue b/src/views/wlgl/kwdy.vue
index 6770cd2..af417f6 100644
--- a/src/views/wlgl/kwdy.vue
+++ b/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' ? '娣诲姞澶辫触锛�' : '淇敼澶辫触锛�')
}
diff --git a/src/views/xtsz/cjgg.vue b/src/views/xtsz/cjgg.vue
index 23fa776..7a853bc 100644
--- a/src/views/xtsz/cjgg.vue
+++ b/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' ? '娣诲姞澶辫触锛�' : '淇敼澶辫触锛�')
}
diff --git a/src/views/zlgl/gxjybz.vue b/src/views/zlgl/gxjybz.vue
index bdf6000..29c33dc 100644
--- a/src/views/zlgl/gxjybz.vue
+++ b/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' ? '娣诲姞澶辫触锛�' : '淇敼澶辫触锛�')
}
diff --git a/src/views/zlgl/gxjyxm.vue b/src/views/zlgl/gxjyxm.vue
index 6331da4..36dbce8 100644
--- a/src/views/zlgl/gxjyxm.vue
+++ b/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' ? '娣诲姞澶辫触锛�' : '淇敼澶辫触锛�')
}
diff --git a/src/views/zlgl/qxdy.vue b/src/views/zlgl/qxdy.vue
index d2cfe59..eb49ba0 100644
--- a/src/views/zlgl/qxdy.vue
+++ b/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' ? '娣诲姞澶辫触锛�' : '淇敼澶辫触锛�')
}
diff --git a/src/views/zzmx/chda.vue b/src/views/zzmx/chda.vue
index 19a17ce..a77a8cd 100644
--- a/src/views/zzmx/chda.vue
+++ b/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: '姝e湪鍔犺浇鏁版嵁锛岃绋嶇瓑...',
+ 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;
}
diff --git a/src/views/zzmx/gxdy.vue b/src/views/zzmx/gxdy.vue
index 38772d7..edc9fc6 100644
--- a/src/views/zzmx/gxdy.vue
+++ b/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: '姝e湪鍔犺浇鏁版嵁锛岃绋嶇瓑...',
+ 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: '姝e湪鍔犺浇鏁版嵁锛岃绋嶇瓑...',
+ 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;
}
diff --git a/src/views/zzmx/gylx.vue b/src/views/zzmx/gylx.vue
index 5f5b9fd..832913d 100644
--- a/src/views/zzmx/gylx.vue
+++ b/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' ? '娣诲姞澶辫触锛�' : '淇敼澶辫触锛�')
}
diff --git a/vue.config.js b/vue.config.js
index 2bc1c20..5ffb87c 100644
--- a/vue.config.js
+++ b/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/'
--
Gitblit v1.9.3