|
|
@@ -27,30 +27,21 @@ Page({
|
|
|
},
|
|
|
submit() {
|
|
|
let data = this.selectComponent("#Form").submit(),
|
|
|
- content = this.data.content,
|
|
|
- continue1 = this.data.continue1,
|
|
|
+ content = JSON.parse(JSON.stringify(this.data.content)),
|
|
|
that = this;
|
|
|
content.remarks = data.remarks;
|
|
|
- if (continue1 == null) {
|
|
|
- wx.showModal({
|
|
|
- title: '提示',
|
|
|
- content: '是否确认本次签到',
|
|
|
- complete: (res) => {
|
|
|
- if (res.confirm) that.onConfirm(content);
|
|
|
- }
|
|
|
- })
|
|
|
- } else {
|
|
|
- content.ownertable = data[continue1] == '' ? continue1 == 'sa_project' ? 'sys_enterprise' : 'sa_project' : continue1;
|
|
|
- content.ownerid = data[content.ownertable][1][0];
|
|
|
-
|
|
|
- wx.showModal({
|
|
|
- title: '提示',
|
|
|
- content: `本次签到将跟进${content.ownertable=='sa_project'?'项目':'客户'}“${data[content.ownertable][0]}”`,
|
|
|
- complete: (res) => {
|
|
|
- if (res.confirm) that.onConfirm(content);
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
+ if (data.sys_enterprise) content.sys_enterpriseid = data.sys_enterprise[1][0];
|
|
|
+ if (data.sa_project) content.sa_projectid = data.sa_project[1][0];
|
|
|
+ console.log(content)
|
|
|
+ wx.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '是否确认本次签到',
|
|
|
+ complete: ({
|
|
|
+ confirm
|
|
|
+ }) => {
|
|
|
+ if (confirm) that.onConfirm(content);
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
onConfirm(content) {
|
|
|
_Http.basic({
|
|
|
@@ -134,107 +125,75 @@ Page({
|
|
|
placeholder: "请填写",
|
|
|
valueName: "remarks",
|
|
|
required: false, //必填
|
|
|
- }],
|
|
|
- continue1: null
|
|
|
- })
|
|
|
+ }]
|
|
|
+ });
|
|
|
},
|
|
|
/* 打断处理form */
|
|
|
interrupt(e) {
|
|
|
let {
|
|
|
data,
|
|
|
form
|
|
|
- } = e.detail,
|
|
|
- that = this;
|
|
|
+ } = e.detail;
|
|
|
console.log("处理", data, form)
|
|
|
- if (this.data.continue1 == null) {
|
|
|
- wx.showModal({
|
|
|
- title: '提示',
|
|
|
- cancelText: "继续选择",
|
|
|
- confirmText: `跟进${data.label}`,
|
|
|
- content: `继续选择"${data.value[0]}"相关${data.label=='客户'?"项目":"客户"},还是跟进当前选择${data.label}?`,
|
|
|
- complete: (res) => {
|
|
|
- if (data.label == '客户') {
|
|
|
- if (res.confirm) {
|
|
|
- form.splice(1, 1);
|
|
|
- that.setData({
|
|
|
- form,
|
|
|
- continue1: "sys_enterprise"
|
|
|
- })
|
|
|
- }
|
|
|
- if (res.cancel) {
|
|
|
- form[1].label = '客户关联项目'
|
|
|
- form[1].params = {
|
|
|
- "id": "20221018102003",
|
|
|
- "content": {
|
|
|
- "nocache": true,
|
|
|
- "pageNumber": 1,
|
|
|
- "pageTotal": 1,
|
|
|
- sys_enterpriseid: data.value[1][0],
|
|
|
- "total": null,
|
|
|
- "type": 1,
|
|
|
- "where": {
|
|
|
- "condition": ""
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- that.setData({
|
|
|
- form,
|
|
|
- continue1: "sa_project"
|
|
|
- })
|
|
|
- }
|
|
|
- } else {
|
|
|
- if (res.confirm) {
|
|
|
- form.splice(0, 1);
|
|
|
- that.setData({
|
|
|
- form,
|
|
|
- continue1: "sa_project"
|
|
|
- })
|
|
|
- }
|
|
|
- if (res.cancel) {
|
|
|
- form.splice(0, 1);
|
|
|
- form.splice(1, 0, {
|
|
|
- label: "项目关联客户",
|
|
|
- error: false,
|
|
|
- errMsg: "",
|
|
|
- type: "route",
|
|
|
- url: "/packageA/select/setclient/select",
|
|
|
- radio: true,
|
|
|
- value: "",
|
|
|
- params: {
|
|
|
- "id": "20221027143702",
|
|
|
- content: {
|
|
|
- nocache: true,
|
|
|
- sa_projectid: data.value[1][0],
|
|
|
- pageNumber: 1,
|
|
|
- pageTotal: 1,
|
|
|
- pageSize: 10,
|
|
|
- total: null,
|
|
|
- where: {
|
|
|
- condition: "",
|
|
|
- }
|
|
|
- },
|
|
|
- },
|
|
|
- placeholder: "选择客户",
|
|
|
- valueName: "sys_enterprise",
|
|
|
- checking: "base",
|
|
|
- required: false
|
|
|
- });
|
|
|
- that.setData({
|
|
|
- form,
|
|
|
- continue1: "sys_enterprise"
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- } else {
|
|
|
- if (data.valueName != this.data.continue1 && form.length == 3) {
|
|
|
- form[1].params.sa_projectid = data.value[1][0];
|
|
|
- form[1].params.sys_enterpriseid = data.value[1][0];
|
|
|
- form[1].value = "";
|
|
|
+ data.params.content.pageNumber = 1;
|
|
|
+ if (data.label == '客户') {
|
|
|
+ form[1].label = '客户关联项目'
|
|
|
+ form[1].params = {
|
|
|
+ "id": 20221020143502,
|
|
|
+ content: {
|
|
|
+ nocache: true,
|
|
|
+ "type": 0,
|
|
|
+ "pageNumber": 1,
|
|
|
+ "pageSize": 20,
|
|
|
+ "where": {
|
|
|
+ "condition": "", //模糊搜索
|
|
|
+ sys_enterpriseid: data.value[1][0],
|
|
|
+ },
|
|
|
+ },
|
|
|
}
|
|
|
+ form[1].value = "";
|
|
|
+ this.setData({
|
|
|
+ form,
|
|
|
+ continue1: "sa_project"
|
|
|
+ })
|
|
|
+ } else if (data.label == '项目') {
|
|
|
+ form.splice(0, 1, data);
|
|
|
+ form.splice(1, 1, {
|
|
|
+ label: "项目关联客户",
|
|
|
+ error: false,
|
|
|
+ errMsg: "",
|
|
|
+ type: "route",
|
|
|
+ url: "/packageA/select/setclient/select",
|
|
|
+ radio: true,
|
|
|
+ value: "",
|
|
|
+ params: {
|
|
|
+ "id": 20221012164402,
|
|
|
+ content: {
|
|
|
+ nocache: true,
|
|
|
+ "type": 0,
|
|
|
+ "pageNumber": 1,
|
|
|
+ "pageSize": 20,
|
|
|
+ "isExport": 0,
|
|
|
+ "where": {
|
|
|
+ "condition": "",
|
|
|
+ sa_projectid: data.value[1][0],
|
|
|
+ },
|
|
|
+ "sort": [{
|
|
|
+ sortname: "默认",
|
|
|
+ sorted: 1,
|
|
|
+ sortid: 67,
|
|
|
+ reversed: 0
|
|
|
+ }]
|
|
|
+ },
|
|
|
+ },
|
|
|
+ placeholder: "选择客户",
|
|
|
+ valueName: "sys_enterprise",
|
|
|
+ checking: "base",
|
|
|
+ required: false
|
|
|
+ });
|
|
|
this.setData({
|
|
|
- form
|
|
|
+ form,
|
|
|
+ continue1: "sys_enterprise"
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
@@ -276,8 +235,8 @@ Page({
|
|
|
longitude,
|
|
|
latitude,
|
|
|
remarks: "",
|
|
|
- ownertable: "",
|
|
|
- ownerid: ""
|
|
|
+ sa_projectid: 0,
|
|
|
+ sys_enterpriseid: 0
|
|
|
}
|
|
|
})
|
|
|
},
|