审批增加loading调节
This commit is contained in:
parent
ef3fac493f
commit
118ff4c71c
@ -5,8 +5,8 @@
|
|||||||
<u--textarea v-model="value" placeholder="请输入审批意见"></u--textarea>
|
<u--textarea v-model="value" placeholder="请输入审批意见"></u--textarea>
|
||||||
</view>
|
</view>
|
||||||
<view class="buttons">
|
<view class="buttons">
|
||||||
<u-button @click="handlePass" class="btn first-btn" type="primary" text="通过"></u-button>
|
<u-button @click="handlePass" class="btn first-btn" type="primary" text="通过" :loading="isDisabled"></u-button>
|
||||||
<u-button @click="handleReject" :disabled="localIsBtnRefuseDisable" type="warning" text="驳回"></u-button>
|
<u-button @click="handleReject" :disabled="localIsBtnRefuseDisable" type="warning" text="驳回" :loading="isDisabled"></u-button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -53,25 +53,26 @@
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
value: '',
|
value: '',
|
||||||
localIsBtnRefuseDisable: this.isBtnRefuseDisable
|
localIsBtnRefuseDisable: this.isBtnRefuseDisable,
|
||||||
|
isDisabled: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// beforeCreate() KO
|
// beforeCreate() KO
|
||||||
// beforeMount() mounted() OK
|
// beforeMount() mounted() OK
|
||||||
created() {
|
created() {
|
||||||
if (this.refuseApi) {
|
if (this.refuseApi) {
|
||||||
this.localIsBtnRefuseDisable = false
|
this.localIsBtnRefuseDisable = false
|
||||||
} else {
|
} else {
|
||||||
const pages = getCurrentPages()
|
const pages = getCurrentPages()
|
||||||
const currentPage = pages[pages.length - 1]
|
const currentPage = pages[pages.length - 1]
|
||||||
const query = currentPage.options || {}
|
const query = currentPage.options || {}
|
||||||
this.localIsBtnRefuseDisable = !(query.refuseApi && query.refuseApi !== 'undefined')
|
this.localIsBtnRefuseDisable = !(query.refuseApi && query.refuseApi !== 'undefined')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
if (this.$route && this.$route.query) {
|
if (this.$route && this.$route.query) {
|
||||||
this.localIsBtnRefuseDisable = !(this.$route.query.refuseApi && this.$route.query.refuseApi !== 'undefined')
|
this.localIsBtnRefuseDisable = !(this.$route.query.refuseApi && this.$route.query.refuseApi !== 'undefined')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
isBtnRefuseDisable(newValue) {
|
isBtnRefuseDisable(newValue) {
|
||||||
@ -81,6 +82,7 @@
|
|||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
handlePass() {
|
handlePass() {
|
||||||
|
this.isDisabled = true
|
||||||
const genParams = this.handleGenParams(10)
|
const genParams = this.handleGenParams(10)
|
||||||
handlePassAudit(genParams, this.okApi).then(res => {
|
handlePassAudit(genParams, this.okApi).then(res => {
|
||||||
// this.$emit('pass', this.dataSource)
|
// this.$emit('pass', this.dataSource)
|
||||||
@ -95,9 +97,11 @@
|
|||||||
//最后一个节点处理问题
|
//最后一个节点处理问题
|
||||||
handlePassAuditCallBack(res.Data + "?id=" + genParams.DATA_ID).then(
|
handlePassAuditCallBack(res.Data + "?id=" + genParams.DATA_ID).then(
|
||||||
res2 => {
|
res2 => {
|
||||||
|
this.isDisabled = false
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
this.isDisabled = false
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
}
|
}
|
||||||
// }
|
// }
|
||||||
@ -105,14 +109,17 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleReject() {
|
handleReject() {
|
||||||
|
this.isDisabled = true
|
||||||
if (this.value == undefined || this.value === '' || this.value.length < 1) {
|
if (this.value == undefined || this.value === '' || this.value.length < 1) {
|
||||||
uni.$showErrorInfo('请输入驳回意见!')
|
uni.$showErrorInfo('请输入驳回意见!')
|
||||||
|
this.isDisabled = false
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
const genParams = this.handleGenParams(20)
|
const genParams = this.handleGenParams(20)
|
||||||
handleRejestAudit(genParams, this.refuseApi).then(res => {
|
handleRejestAudit(genParams, this.refuseApi).then(res => {
|
||||||
// this.$emit('reject', this.dataSource)
|
// this.$emit('reject', this.dataSource)
|
||||||
uni.$showMsgFunc('驳回成功!', () => {
|
uni.$showMsgFunc('驳回成功!', () => {
|
||||||
|
this.isDisabled = false
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
}, 'success', 1000)
|
}, 'success', 1000)
|
||||||
|
|
||||||
@ -133,7 +140,7 @@
|
|||||||
this.dataSource.CurrentNode = currentNodes[0];
|
this.dataSource.CurrentNode = currentNodes[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(this.TASK_ORGID&&this.TASK_ORGID.length>0){
|
if (this.TASK_ORGID && this.TASK_ORGID.length > 0) {
|
||||||
this.dataSource.Parameter22 = this.TASK_ORGID
|
this.dataSource.Parameter22 = this.TASK_ORGID
|
||||||
}
|
}
|
||||||
const params = {
|
const params = {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user