|
|
@@ -3,6 +3,9 @@ let _Http = getApp().globalData.http,
|
|
|
|
|
|
Page({
|
|
|
data: {
|
|
|
+ repetitionShow: false,
|
|
|
+ repetitionList: [],
|
|
|
+ isSubmit: false,
|
|
|
"sa_projectid": 0,
|
|
|
showAll: false,
|
|
|
form: [{
|
|
|
@@ -189,8 +192,28 @@ Page({
|
|
|
title: `查询到${res.total}条疑似重复项目信息`,
|
|
|
icon: "none"
|
|
|
})
|
|
|
+ this.setData({
|
|
|
+ repetitionShow: true,
|
|
|
+ repetitionList: res.data
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
+ repClose() {
|
|
|
+ if (this.data.isSubmit) {
|
|
|
+ let that = this;
|
|
|
+ wx.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: `是否继续创建项目`,
|
|
|
+ complete: (res) => {
|
|
|
+ if (res.confirm) that.handleSubmit(true);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.setData({
|
|
|
+ repetitionShow: false,
|
|
|
+ isSubmit: false
|
|
|
+ })
|
|
|
+ },
|
|
|
/* 处理查重 */
|
|
|
handleQueryRepetition(content) {
|
|
|
return _Http.basic({
|
|
|
@@ -200,29 +223,34 @@ Page({
|
|
|
},
|
|
|
async submit() {
|
|
|
let data = this.selectComponent("#Form").submit();
|
|
|
- if (data.region.length != 0) {
|
|
|
- data.province = data.region[0]
|
|
|
- data.city = data.region[1]
|
|
|
- data.county = data.region[2]
|
|
|
- };
|
|
|
- delete(data.region);
|
|
|
-
|
|
|
let query = await this.handleQueryRepetition({
|
|
|
sa_projectid: this.data.sa_projectid,
|
|
|
projectname: data.projectname,
|
|
|
address: data.address
|
|
|
});
|
|
|
- if (query.total != 0) await new Promise((resolve, reject) => {
|
|
|
- wx.showModal({
|
|
|
- title: '提示',
|
|
|
- content: `查询到${query.total}条疑似重复项目信息 是否确认继续新建`,
|
|
|
- complete: (res) => {
|
|
|
- if (res.cancel) reject()
|
|
|
- if (res.confirm) resolve(true);
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
|
|
|
+ if (query.total != 0) {
|
|
|
+ wx.showToast({
|
|
|
+ title: `查询到${query.total}条疑似重复项目信息`,
|
|
|
+ icon: "none"
|
|
|
+ })
|
|
|
+ this.setData({
|
|
|
+ repetitionShow: true,
|
|
|
+ repetitionList: query.data,
|
|
|
+ isSubmit: true
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.handleSubmit();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleSubmit(tag = false) {
|
|
|
+ let data = this.selectComponent("#Form").submit();
|
|
|
+ if (data.region.length != 0) {
|
|
|
+ data.province = data.region[0]
|
|
|
+ data.city = data.region[1]
|
|
|
+ data.county = data.region[2]
|
|
|
+ };
|
|
|
+ delete(data.region);
|
|
|
_Http.basic({
|
|
|
"id": 20221020144202,
|
|
|
"content": {
|
|
|
@@ -230,7 +258,7 @@ Page({
|
|
|
...data
|
|
|
}
|
|
|
}).then(res => {
|
|
|
- console.log("新建客户", res)
|
|
|
+ console.log("新建项目", res)
|
|
|
if (res.msg != '成功') return wx.showToast({
|
|
|
title: res.msg,
|
|
|
icon: "none"
|
|
|
@@ -241,7 +269,7 @@ Page({
|
|
|
})
|
|
|
|
|
|
//绑定疑似重复标签
|
|
|
- if (query.total != 0) _Http.basic({
|
|
|
+ if (tag) _Http.basic({
|
|
|
"id": 20220929090901,
|
|
|
"content": {
|
|
|
"ownertable": "sa_project",
|
|
|
@@ -273,7 +301,8 @@ Page({
|
|
|
url: '/packageA/project/detail?sa_projectid=' + res.data.sa_projectid,
|
|
|
})
|
|
|
}
|
|
|
- }, query.total != 0 ? 300 : 500)
|
|
|
+ }, tag ? 500 : 300)
|
|
|
})
|
|
|
- },
|
|
|
+ }
|
|
|
+
|
|
|
})
|