连点限制

This commit is contained in:
zhaoxiao
2021-10-12 10:12:26 +08:00
parent e9f9ca6cab
commit 93e7e8a4f0
25 changed files with 237 additions and 141 deletions
@@ -97,11 +97,6 @@
</a-row>
</a-form>
</a-spin>
<template slot="footer">
<a-button @click="handleCancel">关闭</a-button>
<a-button @click="handleOk" type="primary" v-preventclick>确定</a-button>
</template>
</j-modal>
</template>
@@ -214,11 +209,14 @@ export default {
this.visible = false
},
handleOk() {
if (this.confirmLoading) {
return
}
this.confirmLoading = true
const that = this
// 触发表单验证
this.form.validateFields((err, values) => {
if (!err) {
that.confirmLoading = true
// values.dataSource = this.dataForm
// values.signingUp = this.applyAdd
let httpurl = ''
@@ -239,8 +237,12 @@ export default {
that.$message.warning(res.message)
}
}).finally(() => {
that.confirmLoading = false
setTimeout(() => {
this.confirmLoading = false
}, 1000)
})
} else {
this.confirmLoading = false
}
})
},
@@ -97,10 +97,6 @@
</a-row>
</a-form>
</a-spin>
<template slot="footer">
<a-button @click="handleCancel">关闭</a-button>
<a-button @click="handleOk" type="primary" v-preventclick>确定</a-button>
</template>
</j-modal>
</template>
@@ -237,11 +233,14 @@ export default {
this.visible = false
},
handleOk() {
if (this.confirmLoading) {
return
}
this.confirmLoading = true
const that = this
// 触发表单验证
this.form.validateFields((err, values) => {
if (!err) {
that.confirmLoading = true
// 处理企业名称和id等信息
values.companyName = values.company.companyName
values.companyId = values.company.id
@@ -266,8 +265,12 @@ export default {
that.$message.warning(res.message)
}
}).finally(() => {
that.confirmLoading = false
setTimeout(() => {
this.confirmLoading = false
}, 1000)
})
} else {
this.confirmLoading = false
}
})
},
@@ -349,7 +349,7 @@ export default {
this.$refs.installmentForm.initInstallmentList([])
// 税率默认为6
this.$nextTick(() => {
this.form.setFieldsValue({rate: 6})
this.form.setFieldsValue({ rate: 6 })
})
this.rateNum = 6 / 100
},
@@ -397,9 +397,12 @@ export default {
handleSave() {
// 验证分期信息
this.$refs.installmentForm.handleSave()
if (this.confirmLoading) {
return
}
this.confirmLoading = true
this.form.validateFields((err, values) => {
if (!err) {
this.confirmLoading = true
if (this.installmentList && this.installmentList.length > 0) {
let formData = {}
formData.installment = this.installmentList
@@ -423,11 +426,15 @@ export default {
this.$message.warning(res.message)
}
}).finally(() => {
this.confirmLoading = false
setTimeout(() => {
this.confirmLoading = false
}, 1000)
})
} else {
this.confirmLoading = false
}
} else {
this.confirmLoading = false
}
})
},
@@ -546,7 +553,7 @@ export default {
* @param e
*/
noTaxChange(e) {
e.target.value = (e.target.value.replace(/[^0-9.]/g,'')).trim()
e.target.value = (e.target.value.replace(/[^0-9.]/g, '')).trim()
this.inputNoTaxAmount = Number(e.target.value)
this.calculateContractAmount()
},
@@ -573,7 +580,7 @@ export default {
}
let contractNum = this.inputNoTaxAmount * (1 + this.rateNum)
contractNum = contractNum.toFixed(2)
this.form.setFieldsValue({contractAmount: contractNum})
this.form.setFieldsValue({ contractAmount: contractNum })
},
/**
* 应收金额输入
@@ -74,13 +74,6 @@ export default {
]
}
},
watch: {
// isPack(value) {
// if (value) {
// this.projectType.splice(2, 1)
// }
// }
},
methods: {
open() {
this.visible = true
@@ -32,10 +32,6 @@
</a-form-item>
</a-form>
</a-spin>
<template slot="footer">
<a-button @click="handleCancel">关闭</a-button>
<a-button @click="handleOk" type="primary" v-preventclick :loading="confirmLoading">确定</a-button>
</template>
</j-modal>
</template>
@@ -84,9 +80,12 @@ export default {
methods: {
handleOk() {
// 触发表单验证
if (this.confirmLoading) {
return
}
this.confirmLoading = true
this.form.validateFields((err, values) => {
if (!err) {
this.confirmLoading = true
values.contractId = this.contractId
const formData = Object.assign(this.model, values)
console.log('表单提交数据', formData)
@@ -99,8 +98,12 @@ export default {
this.$message.warning(res.message)
}
}).finally(() => {
this.confirmLoading = false
setTimeout(() => {
this.confirmLoading = false
}, 1000)
})
} else {
this.confirmLoading = false
}
})
},
@@ -232,7 +232,7 @@
</div>
<!-- /分期信息-->
<a-form-item class="table-operator">
<a-button type="primary" @click="handleSave" v-preventclick>保存</a-button>
<a-button type="primary" @click="handleSave" :loading="confirmLoading">保存</a-button>
<a-button @click="handleCancle">取消</a-button>
</a-form-item>
</a-form>
@@ -487,6 +487,10 @@ export default {
* 表单提交
*/
handleSave() {
if (this.confirmLoading) {
return
}
this.confirmLoading = true
// 验证分期信息
this.$refs.installmentForm.handleSave()
this.form.validateFields((err, values) => {
@@ -518,11 +522,15 @@ export default {
this.$message.warning(res.message)
}
}).finally(() => {
this.confirmLoading = false
setTimeout(() => {
this.confirmLoading = false
}, 1000)
})
} else {
this.confirmLoading = false
}
} else {
this.confirmLoading = false
}
})
},
@@ -97,11 +97,6 @@
:is-contract-num-disabled="true"
:flag="1"
@ok="selectProjectOk"></general-project-module>
<template slot="footer">
<a-button @click="handleCancel">关闭</a-button>
<a-button @click="handleOk" type="primary" v-preventclick>确定</a-button>
</template>
</j-modal>
</template>
@@ -288,11 +283,15 @@ export default {
this.$emit('ok')
},
handleOk() {
if (this.selectedRowKeys.length <= 0) {
this.$message.warn('请选择项目后再提交关联')
if (this.confirmLoading) {
return
}
this.confirmLoading = true
if (this.selectedRowKeys.length <= 0) {
this.$message.warn('请选择项目后再提交关联')
this.confirmLoading = false
return
}
let submitData = []
let projectItem
this.selectedRowKeys.forEach(item => {
@@ -311,7 +310,9 @@ export default {
this.$message.warn(res.message)
}
}).finally(() => {
this.confirmLoading = false
setTimeout(() => {
this.confirmLoading = false
}, 1000)
})
},
handleCancel() {
@@ -80,11 +80,6 @@
:is-contract-num-disabled="true"
:flag="1"
:default-charge-way="2"></working-group-member-unit-module>
<template slot="footer">
<a-button @click="handleCancel">关闭</a-button>
<a-button @click="handleOk" type="primary" v-preventclick>确定</a-button>
</template>
</j-modal>
</template>
@@ -179,11 +174,15 @@ export default {
this.$emit('ok')
},
handleOk() {
if (this.selectedRowKeys.length <= 0) {
this.$message.warn('请选择项目后再提交关联')
if (this.confirmLoading) {
return
}
this.confirmLoading = true
if (this.selectedRowKeys.length <= 0) {
this.$message.warn('请选择项目后再提交关联')
this.confirmLoading = false
return
}
let submitData = []
let projectItem
this.selectedRowKeys.forEach(item => {
@@ -203,7 +202,9 @@ export default {
this.$message.warn(res.message)
}
}).finally(() => {
this.confirmLoading = false
setTimeout(() => {
this.confirmLoading = false
}, 1000)
})
},
handleCancel() {
@@ -76,11 +76,6 @@
</a-row>
</a-form>
</a-spin>
<template slot="footer">
<a-button @click="handleCancel">关闭</a-button>
<a-button @click="handleOk" type="primary" v-preventclick>确定</a-button>
</template>
</j-modal>
</template>
@@ -148,6 +143,10 @@ export default {
this.visible = false
},
handleOk() {
if (this.confirmLoading) {
return
}
this.confirmLoading = true
const that = this
// 触发表单验证
this.form.validateFields((err, values) => {
@@ -175,8 +174,12 @@ export default {
that.$message.warning(res.message)
}
}).finally(() => {
that.confirmLoading = false
setTimeout(() => {
this.confirmLoading = false
}, 1000)
})
} else {
this.confirmLoading = false
}
})
},
@@ -34,11 +34,6 @@
</a-row>
</a-form>
</a-spin>
<template slot="footer">
<a-button @click="handleCancel">关闭</a-button>
<a-button @click="handleOk" type="primary" v-preventclick>确定</a-button>
</template>
</j-modal>
</template>
@@ -93,6 +88,10 @@ export default {
this.visible = false
},
handleOk() {
if (this.confirmLoading) {
return
}
this.confirmLoading = true
const that = this
// 触发表单验证
this.form.validateFields((err, values) => {
@@ -116,8 +115,12 @@ export default {
that.$message.warning(res.message)
}
}).finally(() => {
that.confirmLoading = false
setTimeout(() => {
this.confirmLoading = false
}, 1000)
})
} else {
this.confirmLoading = false
}
})
},
@@ -36,10 +36,6 @@
:maxLength='200'
@change="e => {e.target.value = (e.target.value + '').trim()}"/>
</a-form-item>
<a-form-item class="table-operator">
<a-button type="primary" @click="handleOk" v-preventclick>保存</a-button>
<a-button @click="handleCancle">取消</a-button>
</a-form-item>
</a-form>
</a-spin>
</div>
@@ -113,6 +109,10 @@ export default {
})
},
handleOk() {
if (this.confirmLoading) {
return
}
this.confirmLoading = true
// 触发表单验证
this.form.validateFields((err, values) => {
if (!err) {
@@ -136,9 +136,13 @@ export default {
this.$message.warning(res.message)
}
}).finally(() => {
this.confirmLoading = false
setTimeout(() => {
this.confirmLoading = false
}, 1000)
this.initDirectoryList()
})
} else {
this.confirmLoading = false
}
})
},
@@ -35,11 +35,6 @@
</a-form-item>
</a-form>
</a-spin>
<template slot="footer">
<a-button @click="handleCancel">关闭</a-button>
<a-button @click="handleOk" type="primary" v-preventclick>确定</a-button>
</template>
</j-modal>
</template>
@@ -109,6 +104,10 @@ export default {
})
},
handleOk() {
if (this.confirmLoading) {
return
}
this.confirmLoading = true
this.form.validateFields((err, values) => {
if (!err) {
values.projectId = this.projectId
@@ -130,7 +129,13 @@ export default {
} else {
this.$message.warn(res.message)
}
}).finally(() => {
setTimeout(() => {
this.confirmLoading = false
}, 1000)
})
} else {
this.confirmLoading = false
}
})
},
@@ -41,11 +41,6 @@
</a-form-item>
</a-form>
</a-spin>
<template slot="footer">
<a-button @click="handleCancel">关闭</a-button>
<a-button @click="handleOk" type="primary" v-preventclick>确定</a-button>
</template>
</j-modal>
</template>
@@ -137,6 +132,10 @@ export default {
})
},
handleOk() {
if (this.confirmLoading) {
return
}
this.confirmLoading = true
this.form.validateFields((err, values) => {
if (!err) {
// values.chargeCompanyName = this.chargeCompanyName
@@ -170,7 +169,13 @@ export default {
} else {
this.$message.warn(res.message)
}
}).finally(() => {
setTimeout(() => {
this.confirmLoading = false
}, 1000)
})
} else {
this.confirmLoading = false
}
})
},
@@ -134,6 +134,10 @@ export default {
this.visible = false
},
handleOk() {
if (this.confirmLoading) {
return
}
this.confirmLoading = true
const that = this
// 触发表单验证
this.form.validateFields((err, values) => {
@@ -151,8 +155,12 @@ export default {
that.$message.warning(res.message)
}
}).finally(() => {
that.confirmLoading = false
setTimeout(() => {
this.confirmLoading = false
}, 1000)
})
} else {
this.confirmLoading = false
}
})
},
@@ -140,6 +140,10 @@ export default {
this.visible = false
},
handleOk() {
if (this.confirmLoading) {
return
}
this.confirmLoading = true
const that = this
// 触发表单验证
this.form.validateFields((err, values) => {
@@ -166,8 +170,12 @@ export default {
that.$message.warning(res.message)
}
}).finally(() => {
that.confirmLoading = false
setTimeout(() => {
this.confirmLoading = false
}, 1000)
})
} else {
this.confirmLoading = false
}
})
},
@@ -59,11 +59,6 @@
</a-table>
</div>
</a-spin>
<template slot="footer">
<a-button @click="handleCancel">关闭</a-button>
<a-button @click="handleOk" type="primary" v-preventclick>确定</a-button>
</template>
</j-modal>
</template>
@@ -197,6 +192,10 @@ export default {
this.$forceUpdate()
},
handleOk() {
if (this.confirmLoading) {
return
}
this.confirmLoading = true
this.form.validateFields((err, values) => {
if (!err) {
let formData = []
@@ -221,7 +220,13 @@ export default {
} else {
this.$message.warn(res.message)
}
}).finally(() => {
setTimeout(() => {
this.confirmLoading = false
}, 1000)
})
} else {
this.confirmLoading = false
}
})
},
@@ -94,11 +94,6 @@
</a-table>
</a-spin>
<template slot="footer">
<a-button @click="handleCancel">关闭</a-button>
<a-button @click="handleOk" type="primary" v-preventclick>确定</a-button>
</template>
</j-modal>
</template>
@@ -341,6 +336,10 @@ export default {
})
},
handleOk() {
if (this.confirmLoading) {
return
}
this.confirmLoading = true
this.form.validateFields((err, values) => {
if (!err) {
let bmpList = []
@@ -367,7 +366,13 @@ export default {
} else {
this.$message.warn(res.message)
}
}).finally(() => {
setTimeout(() => {
this.confirmLoading = false
}, 1000)
})
} else {
this.confirmLoading = false
}
})
},
@@ -93,11 +93,6 @@
</a-row>
</a-form>
</a-spin>
<template slot="footer">
<a-button @click="handleCancel">关闭</a-button>
<a-button @click="handleOk" type="primary" v-preventclick>确定</a-button>
</template>
</j-modal>
</template>
@@ -205,6 +200,10 @@ export default {
this.visible = false
},
handleOk() {
if (this.confirmLoading) {
return
}
this.confirmLoading = true
const that = this
// 触发表单验证
this.form.validateFields((err, values) => {
@@ -228,8 +227,12 @@ export default {
that.$message.warning(res.message)
}
}).finally(() => {
that.confirmLoading = false
setTimeout(() => {
this.confirmLoading = false
}, 1000)
})
} else {
this.confirmLoading = false
}
})
},
@@ -71,11 +71,6 @@
</a-table>
</div>
</a-spin>
<template slot="footer">
<a-button @click="handleCancel">关闭</a-button>
<a-button @click="handleOk" type="primary" v-preventclick>确定</a-button>
</template>
</j-modal>
</template>
@@ -197,8 +192,13 @@ export default {
},
methods: {
handleOk() {
if (this.confirmLoading) {
return
}
this.confirmLoading = true
if (this.selectedRowKeys.length === 0) {
this.$message.warn('请至少选择一个项目')
this.confirmLoading = false
return
}
let projectIds = this.selectedRowKeys.join(',')
@@ -214,6 +214,10 @@ export default {
} else {
this.$message.warn(res.message)
}
}).finally(() => {
setTimeout(() => {
this.confirmLoading = false
}, 1000)
})
},
handleCancel() {
@@ -173,10 +173,6 @@
</a-row>
</a-form>
</a-spin>
<template slot="footer">
<a-button @click="handleCancel">关闭</a-button>
<a-button @click="handleOk" type="primary" v-preventclick>确定</a-button>
</template>
</j-modal>
</template>
@@ -379,6 +375,10 @@ export default {
this.visible = false
},
handleOk() {
if (this.confirmLoading) {
return
}
this.confirmLoading = true
const that = this
// 触发表单验证
this.form.validateFields((err, values) => {
@@ -411,8 +411,12 @@ export default {
that.$message.warning(res.message)
}
}).finally(() => {
that.confirmLoading = false
setTimeout(() => {
this.confirmLoading = false
}, 1000)
})
} else {
this.confirmLoading = false
}
})
},
@@ -61,11 +61,6 @@
<a @click="handleDelete(record.id)">删除</a>
</span>
</a-table>
<template slot="footer">
<a-button type="primary" :disabled="confirmLoading" @click="handleOk" v-preventclick>确定发布</a-button>
<a-button @click="handleCancel">取消</a-button>
</template>
</j-modal>
</template>
@@ -211,11 +206,15 @@ export default {
this.visible = false
},
handleOk() {
if (this.confirmLoading) {
return
}
this.confirmLoading = true
if (this.selectionRows.length === 0) {
this.$message.warn('请至少选择一个成员单位')
this.confirmLoading = false
return
} else {
this.confirmLoading = true
const param = {
meetingIds: this.selectedMetingList,
subitemIds: this.selectedRowKeys,
@@ -231,7 +230,9 @@ export default {
this.$message.warn(res.message)
}
}).finally(() => {
this.confirmLoading = false
setTimeout(() => {
this.confirmLoading = false
}, 1000)
})
}
},
@@ -27,10 +27,6 @@
</a-form>
<a-empty v-else></a-empty>
</a-spin>
<template slot="footer">
<a-button @click="handleCancel">关闭</a-button>
<a-button @click="handleOk" type="primary" v-preventclick>确定</a-button>
</template>
</j-modal>
</template>
@@ -148,12 +144,18 @@ export default {
this.memberList = []
},
handleOk() {
if (this.confirmLoading) {
return
}
this.confirmLoading = true
if (this.memberList.length === 0) {
this.$message.warn('当前工作组暂无成员,无法分发文件')
this.confirmLoading = false
return
}
if (this.checkedKeys.length === 0) {
this.form.validateFields()
this.confirmLoading = false
return
}
let str = this.checkedKeys.join(',').toString()
@@ -179,7 +181,9 @@ export default {
this.$message.warn(res.message)
}
}).finally(() => {
this.confirmLoading = false
setTimeout(() => {
this.confirmLoading = false
}, 1000)
})
} else {
// 单个分发
@@ -198,9 +202,13 @@ export default {
this.$message.warn(res.message)
}
}).finally(() => {
this.confirmLoading = false
setTimeout(() => {
this.confirmLoading = false
}, 1000)
})
}
} else {
this.confirmLoading = false
}
})
},
@@ -25,10 +25,6 @@
</a-row>
</a-form>
</a-spin>
<template slot="footer">
<a-button @click="handleCancel">关闭</a-button>
<a-button @click="handleOk" type="primary" v-preventclick>确定</a-button>
</template>
</j-modal>
</template>
@@ -101,6 +97,10 @@ export default {
this.visible = false
},
handleOk() {
if (this.confirmLoading) {
return
}
this.confirmLoading = true
// 触发表单验证
this.form.validateFields((err, values) => {
if (!err) {
@@ -108,17 +108,21 @@ export default {
let params = values
params.projectId = this.projectId
params.projectType = this.projectType
postAction(this.url.add, params).then((res) => {
if (res.success) {
this.$message.success(res.message)
this.$emit('ok')
this.close()
} else {
this.$message.warning(res.message)
}
}).finally(() => {
postAction(this.url.add, params).then((res) => {
if (res.success) {
this.$message.success(res.message)
this.$emit('ok')
this.close()
} else {
this.$message.warning(res.message)
}
}).finally(() => {
setTimeout(() => {
this.confirmLoading = false
})
}, 1000)
})
} else {
this.confirmLoading = false
}
})
},
@@ -198,10 +198,6 @@
</a-row>
</a-form>
</a-spin>
<template slot="footer">
<a-button @click="handleCancel">关闭</a-button>
<a-button @click="handleOk" type="primary" v-preventclick>确定</a-button>
</template>
</j-modal>
</template>
@@ -436,6 +432,10 @@ export default {
this.visible = false
},
handleOk() {
if (this.confirmLoading) {
return
}
this.confirmLoading = true
const that = this
// 触发表单验证
this.form.validateFields((err, values) => {
@@ -471,8 +471,12 @@ export default {
that.$message.warning(res.message)
}
}).finally(() => {
that.confirmLoading = false
setTimeout(() => {
this.confirmLoading = false
}, 1000)
})
} else {
this.confirmLoading = false
}
})
},
@@ -168,10 +168,6 @@
</a-row>
</a-form>
</a-spin>
<template slot="footer">
<a-button @click="handleCancel">关闭</a-button>
<a-button @click="handleOk" type="primary" v-preventclick>确定</a-button>
</template>
</j-modal>
</template>
@@ -261,6 +257,10 @@ export default {
this.visible = false
},
handleOk() {
if (this.confirmLoading) {
return
}
this.confirmLoading = true
const that = this
// 触发表单验证
this.form.validateFields((err, values) => {
@@ -286,8 +286,12 @@ export default {
that.$message.warning(res.message)
}
}).finally(() => {
that.confirmLoading = false
setTimeout(() => {
this.confirmLoading = false
}, 1000)
})
} else {
this.confirmLoading = false
}
})
},