Commit f3a98ba2 by wangzhihui

bug修复

1 parent 42ec7ac9
...@@ -47,7 +47,8 @@ import { ...@@ -47,7 +47,8 @@ import {
Empty, Empty,
PullRefresh, PullRefresh,
Picker, Picker,
Dialog Dialog,
Loading
} from 'vant' } from 'vant'
export const components = [ export const components = [
Button, Button,
...@@ -87,5 +88,6 @@ export const components = [ ...@@ -87,5 +88,6 @@ export const components = [
Empty, Empty,
PullRefresh, PullRefresh,
Picker, Picker,
Dialog Dialog,
Loading
] ]
<!--
* @Author: 'wangzhihui' '1733904062@qq.com'
* @Date: 2025-11-19 16:39:10
* @LastEditors: 'wangzhihui' '1733904062@qq.com'
* @LastEditTime: 2025-11-21 16:02:32
* @FilePath: \wx-notification\src\views\purchase\components\approveComp.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template> <template>
<h-dialog ref="myDialog" :title="title" :isVisible="isVisible" @confirm="handleSubmit" @cancel="handleCancel"> <h-dialog ref="myDialog" :title="title" :isVisible="isVisible" @confirm="handleSubmit" @cancel="handleCancel">
<div class="formObj"> <div class="formObj">
...@@ -36,6 +29,7 @@ export default { ...@@ -36,6 +29,7 @@ export default {
components: { hDialog, sendOutComp }, components: { hDialog, sendOutComp },
data() { data() {
return { return {
isSubmit:false,
name: this.$route.query.name, name: this.$route.query.name,
staffType: this.$route.query.staffType, staffType: this.$route.query.staffType,
sendOutVisible: false, sendOutVisible: false,
...@@ -43,7 +37,7 @@ export default { ...@@ -43,7 +37,7 @@ export default {
approveForm: { approveForm: {
remark: '', remark: '',
sendOutMerchantId: '', sendOutMerchantId: '',
sendOutMerchantName: '深圳广联赛讯股份有限公司' sendOutMerchantName: ''
} }
} }
}, },
...@@ -77,7 +71,9 @@ export default { ...@@ -77,7 +71,9 @@ export default {
this.handleSendCancel() this.handleSendCancel()
}, },
initData(val) { initData(val) {
this.approveForm.sendOutMerchantName = val.sendOutMerchantName console.log(1111)
console.log('val', val.sendOutMerchantName)
this.approveForm.sendOutMerchantName = val.sendOutMerchantName? val.sendOutMerchantName:''
this.approveForm.sendOutMerchantId = val.sendOutMerchantId this.approveForm.sendOutMerchantId = val.sendOutMerchantId
}, },
handleSelect() { handleSelect() {
...@@ -115,6 +111,7 @@ export default { ...@@ -115,6 +111,7 @@ export default {
return return
} }
try { try {
this.isSubmit = true
this.$refs.myDialog.startLoading() this.$refs.myDialog.startLoading()
const params = { const params = {
...@@ -133,20 +130,21 @@ export default { ...@@ -133,20 +130,21 @@ export default {
if (result.code == 0) { if (result.code == 0) {
Toast.success('操作成功') Toast.success('操作成功')
setTimeout(() => { setTimeout(() => {
this.isSubmit = false
this.$refs.myDialog.stopLoading() this.$refs.myDialog.stopLoading()
this.handleCancel() this.handleCancel()
this.$emit('success') this.$emit('success')
}, 500) }, 0)
} else { } else {
this.$refs.myDialog.stopLoading() this.$refs.myDialog.stopLoading()
Toast.fail(result.message || '请求失败') Toast.fail(result.message || '请求失败')
} }
} catch (error) { } catch (error) {
this.isSubmit = false
this.$refs.myDialog.stopLoading() this.$refs.myDialog.stopLoading()
Toast.fail('系统异常,请稍后再试') Toast.fail('系统异常,请稍后再试')
console.error(error) console.error(error)
} }
// this.$refs.myDialog.stopLoading();
}, },
handleCancel() { handleCancel() {
this.$emit('cancel') this.$emit('cancel')
......
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
:close-on-click-overlay="false" :close-on-click-overlay="false"
> >
<div class="title">{{ title }}</div> <div class="title">{{ title }}</div>
<div class="content"> <div v-if="!loading">
<div class="content">
<slot></slot> <slot></slot>
</div> </div>
<div class="btn-group"> <div class="btn-group">
...@@ -22,6 +23,13 @@ ...@@ -22,6 +23,13 @@
{{ loading ? '提交中...' : '确定' }} {{ loading ? '提交中...' : '确定' }}
</div> </div>
</div> </div>
</div>
<template v-else>
<div class="loading-home">
<van-loading size="50" color="#1989fa" />
</div>
</template>
</van-popup> </van-popup>
</template> </template>
...@@ -133,5 +141,12 @@ export default { ...@@ -133,5 +141,12 @@ export default {
margin-left: 11px; margin-left: 11px;
} }
} }
.loading-home{
position:absolute;
left:50%;
top:50%;
transform:translate(-50%,-50%);
}
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!