Commit 31b66168 by zhangxw Committed by chenwq

创建员工防连点

1 parent 0c3e4714
...@@ -19,7 +19,8 @@ Page({ ...@@ -19,7 +19,8 @@ Page({
connectionValue: '全部', connectionValue: '全部',
visualType: 0 visualType: 0
}, },
showServiceConfirm: false showServiceConfirm: false,
isConfirm: false
}, },
watch: { watch: {
...@@ -156,7 +157,11 @@ Page({ ...@@ -156,7 +157,11 @@ Page({
// 提交 // 提交
handleConfirm() { handleConfirm() {
let { addOrEdit, formData, allConnectionIds } = this.data let _this = this
let { addOrEdit, formData, allConnectionIds, isConfirm } = _this.data
if (isConfirm) {
return true
}
let validObj = wx.$util.checkRule(formData, constantData.formRule) let validObj = wx.$util.checkRule(formData, constantData.formRule)
if (validObj) { if (validObj) {
wx.$api.showToast(validObj.message) wx.$api.showToast(validObj.message)
...@@ -182,6 +187,9 @@ Page({ ...@@ -182,6 +187,9 @@ Page({
confirmColor: '#3666FE', confirmColor: '#3666FE',
success(res) { success(res) {
if (res.confirm) { if (res.confirm) {
_this.setData({
isConfirm: true
})
// 创建/编辑接口 // 创建/编辑接口
let requestEvent = addOrEdit == 'add' ? 'createStaffAPI' : 'updateStaffAPI' let requestEvent = addOrEdit == 'add' ? 'createStaffAPI' : 'updateStaffAPI'
mineApi[requestEvent](params).then(res => { mineApi[requestEvent](params).then(res => {
...@@ -190,6 +198,10 @@ Page({ ...@@ -190,6 +198,10 @@ Page({
} else { } else {
wx.$router.back() wx.$router.back()
} }
}).catch(err => {
_this.setData({
isConfirm: false
})
}) })
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!