|
@@ -163,60 +163,63 @@
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function handleAdd() {
|
|
function handleAdd() {
|
|
|
- if (data.timer) {
|
|
|
|
|
- uni.showToast({
|
|
|
|
|
- title: '合同正在创建'
|
|
|
|
|
- })
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
- data.timer = setTimeout(() => { },3000)
|
|
|
|
|
- uni.showToast({
|
|
|
|
|
- title: '提交中',
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ uni.showLoading({
|
|
|
|
|
+ title: '创建中...',
|
|
|
|
|
+ mask: true
|
|
|
|
|
+ });
|
|
|
const opt = Object.assign({}, {
|
|
const opt = Object.assign({}, {
|
|
|
...data.hetong,
|
|
...data.hetong,
|
|
|
htId: data.mobanList[data.mobanIndex].id
|
|
htId: data.mobanList[data.mobanIndex].id
|
|
|
})
|
|
})
|
|
|
httpApi.getSanfangAdd(opt).then(res => {
|
|
httpApi.getSanfangAdd(opt).then(res => {
|
|
|
if (res.data) {
|
|
if (res.data) {
|
|
|
|
|
+ uni.hideLoading()
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
|
title: "创建成功",
|
|
title: "创建成功",
|
|
|
|
|
+ duration:2000,
|
|
|
success() {
|
|
success() {
|
|
|
- uni.navigateBack()
|
|
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ uni.navigateBack()
|
|
|
|
|
+ },2000)
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
- }).finally(() => {
|
|
|
|
|
|
|
+ }).catch(() => {
|
|
|
|
|
+ uni.hideLoading()
|
|
|
|
|
+ }).
|
|
|
|
|
+ finally(() => {
|
|
|
clearTimeout(data.timer);
|
|
clearTimeout(data.timer);
|
|
|
data.timer = null;
|
|
data.timer = null;
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function handleUpdate() {
|
|
function handleUpdate() {
|
|
|
- if (data.timer) {
|
|
|
|
|
- uni.showToast({
|
|
|
|
|
- title: '合同正在更新'
|
|
|
|
|
- })
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
- data.timer = setTimeout(() => { },3000)
|
|
|
|
|
|
|
+
|
|
|
|
|
+ uni.showLoading({
|
|
|
|
|
+ title: '更新中...',
|
|
|
|
|
+ mask: true
|
|
|
|
|
+ });
|
|
|
const opt = Object.assign({}, {
|
|
const opt = Object.assign({}, {
|
|
|
...data.hetong,
|
|
...data.hetong,
|
|
|
htId: data.mobanList[data.mobanIndex].id
|
|
htId: data.mobanList[data.mobanIndex].id
|
|
|
})
|
|
})
|
|
|
-
|
|
|
|
|
- console.log('ccc', opt)
|
|
|
|
|
-
|
|
|
|
|
httpApi.getSanfangUpdate(opt).then(res => {
|
|
httpApi.getSanfangUpdate(opt).then(res => {
|
|
|
if (res.data) {
|
|
if (res.data) {
|
|
|
|
|
+ uni.hideLoading()
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
|
- title: "创建成功",
|
|
|
|
|
|
|
+ title: "更新成功",
|
|
|
|
|
+ duration:2000,
|
|
|
|
|
+ mask: true,
|
|
|
success() {
|
|
success() {
|
|
|
- uni.navigateBack()
|
|
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ uni.navigateBack()
|
|
|
|
|
+ },2000)
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
- })
|
|
|
|
|
|
|
+ }).catch(() => {
|
|
|
|
|
+ uni.hideLoading()
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function handleConfirm() {
|
|
function handleConfirm() {
|