|
|
@@ -21,7 +21,7 @@ Page({
|
|
|
checking: "base",
|
|
|
required: true
|
|
|
}, {
|
|
|
- label: "居间服务商",
|
|
|
+ label: "居间商",
|
|
|
error: false,
|
|
|
errMsg: "",
|
|
|
type: "route",
|
|
|
@@ -32,23 +32,22 @@ Page({
|
|
|
"content": {
|
|
|
"where": {
|
|
|
"condition": "",
|
|
|
- "type": 21,
|
|
|
+ "type": 22,
|
|
|
typemx: "居间协议"
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- interrupt: true,
|
|
|
query: "&radio=true&idname=sys_enterpriseid&title=选择服务商",
|
|
|
- placeholder: "选择居间服务商",
|
|
|
+ placeholder: "选择居间商",
|
|
|
valueName: "sys_enterpriseid",
|
|
|
checking: "base",
|
|
|
- required: true
|
|
|
+ required: false
|
|
|
}, {
|
|
|
- label: "项目合同",
|
|
|
+ label: "合同",
|
|
|
error: false,
|
|
|
errMsg: "",
|
|
|
type: "route",
|
|
|
- url: "/packageA/select/contract/select",
|
|
|
+ url: "/packageA/contract/add/type4/select",
|
|
|
value: "",
|
|
|
params: {
|
|
|
"id": 20221217145402,
|
|
|
@@ -61,32 +60,10 @@ Page({
|
|
|
},
|
|
|
query: "&radio=true",
|
|
|
interrupt: true,
|
|
|
- placeholder: "选择项目合同",
|
|
|
+ placeholder: "选择合同",
|
|
|
valueName: "ascription_contractid",
|
|
|
checking: "base",
|
|
|
required: true
|
|
|
- }, {
|
|
|
- label: "项目名称",
|
|
|
- error: false,
|
|
|
- errMsg: "",
|
|
|
- type: "route",
|
|
|
- url: "/packageA/select/project/select",
|
|
|
- disabled: true,
|
|
|
- value: "",
|
|
|
- params: {
|
|
|
- "id": 20221201090802,
|
|
|
- "content": {
|
|
|
- "type": 3, //1直销 2经销 3居间
|
|
|
- nocache: true,
|
|
|
- "where": {
|
|
|
- "condition": "",
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- placeholder: "项目名称",
|
|
|
- valueName: "sa_projectid",
|
|
|
- checking: "base",
|
|
|
- required: true
|
|
|
}, {
|
|
|
label: "计算方式",
|
|
|
error: false,
|
|
|
@@ -159,40 +136,93 @@ Page({
|
|
|
if (options.data) {
|
|
|
let data = JSON.parse(options.data);
|
|
|
let form = this.data.form.map(v => {
|
|
|
- if (v.valueName == "invaliddate") v.start = "";
|
|
|
- v.value = data[v.valueName];
|
|
|
+ if (v.valueName == 'sys_enterpriseid') {
|
|
|
+ v.value = data.sys_enterpriseid[1][0] ? data.sys_enterpriseid : ""
|
|
|
+ } else {
|
|
|
+ if (v.valueName == "invaliddate") v.start = "";
|
|
|
+ v.value = data[v.valueName];
|
|
|
+ }
|
|
|
return v
|
|
|
});
|
|
|
+ let index = form.findIndex(v => v.label == '订单金额比例')
|
|
|
if (data.radios == 1) {
|
|
|
- form[5].label = '订单金额比例'
|
|
|
- form[5].placeholder = '请填写订单金额比例'
|
|
|
- form[5].valueName = 'orderratio'
|
|
|
- form[5].value = data.orderratio == 1 ? 100 : (data.orderratio * 100).toFixed(2)
|
|
|
+ form[index].label = '订单金额比例'
|
|
|
+ form[index].placeholder = '请填写订单金额比例'
|
|
|
+ form[index].valueName = 'orderratio'
|
|
|
+ form[index].value = data.orderratio == 1 ? 100 : (data.orderratio * 100).toFixed(2)
|
|
|
} else {
|
|
|
- form[5].label = '居间产品折扣'
|
|
|
- form[5].placeholder = '请填写居间产品折扣'
|
|
|
- form[5].valueName = 'productdiscount'
|
|
|
- form[5].value = data.productdiscount == 1 ? 100 : (data.productdiscount * 100).toFixed(2)
|
|
|
+ form[index].label = '居间产品折扣'
|
|
|
+ form[index].placeholder = '请填写居间产品折扣'
|
|
|
+ form[index].valueName = 'productdiscount'
|
|
|
+ form[index].value = data.productdiscount == 1 ? 100 : (data.productdiscount * 100).toFixed(2)
|
|
|
}
|
|
|
- form.splice(2, 0, {
|
|
|
+ let ywyParams = {
|
|
|
+ "id": 20230305201202,
|
|
|
+ "content": {
|
|
|
+ nocache: true
|
|
|
+ },
|
|
|
+ }
|
|
|
+ if (data.projectname) {
|
|
|
+ //项目合同
|
|
|
+ ywyParams.content.sa_projectid = data.sa_projectid[1][0];
|
|
|
+ ywyParams.content.type = 2;
|
|
|
+ form.splice(3, 0, {
|
|
|
+ label: "项目名称",
|
|
|
+ error: false,
|
|
|
+ errMsg: "",
|
|
|
+ type: "route",
|
|
|
+ url: "/packageA/select/project/select",
|
|
|
+ disabled: true,
|
|
|
+ value: data.sa_projectid,
|
|
|
+ params: {
|
|
|
+ "id": 20221201090802,
|
|
|
+ "content": {
|
|
|
+ "type": 3, //1直销 2经销 3居间
|
|
|
+ nocache: true,
|
|
|
+ "where": {
|
|
|
+ "condition": "",
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ placeholder: "项目名称",
|
|
|
+ valueName: "sa_projectid",
|
|
|
+ checking: "base",
|
|
|
+ required: false
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ //客户合同
|
|
|
+ ywyParams.content.sys_enterpriseid = data.ascription_enterpriseid;
|
|
|
+ ywyParams.content.type = 4;
|
|
|
+ form.splice(3, 0, {
|
|
|
+ label: "客户名称",
|
|
|
+ error: false,
|
|
|
+ errMsg: "",
|
|
|
+ type: "route",
|
|
|
+ url: "/packageA/select/project/select",
|
|
|
+ disabled: true,
|
|
|
+ value: data.sys_enterpriseid1,
|
|
|
+ params: {},
|
|
|
+ placeholder: "客户名称",
|
|
|
+ valueName: "sys_enterpriseid1",
|
|
|
+ checking: "base",
|
|
|
+ required: false,
|
|
|
+ disabled: true,
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ form.splice(4, 0, {
|
|
|
label: "业务员",
|
|
|
error: false,
|
|
|
errMsg: "",
|
|
|
type: "route",
|
|
|
url: "/packageA/select/contacts/select",
|
|
|
value: [data.leader[0].name, [data.saler_hrid]],
|
|
|
- params: {
|
|
|
- "id": 20230305201202,
|
|
|
- "content": {
|
|
|
- nocache: true,
|
|
|
- "type": "1",
|
|
|
- "sys_enterpriseid": data.sys_enterpriseid[1][0]
|
|
|
- },
|
|
|
- },
|
|
|
+ params: ywyParams,
|
|
|
query: "&radio=true&idname=hrid",
|
|
|
placeholder: "选择业务员",
|
|
|
valueName: "saler_hrid",
|
|
|
checking: "base",
|
|
|
+ disabled: true,
|
|
|
required: true
|
|
|
})
|
|
|
this.setData({
|
|
|
@@ -201,22 +231,67 @@ Page({
|
|
|
"content.sa_contractid": data.sa_contractid
|
|
|
})
|
|
|
}
|
|
|
- //项目进入 修改经销商选择范围
|
|
|
+ //项目进入 修改合同选择范围
|
|
|
if (options.project) {
|
|
|
let form = this.data.form,
|
|
|
project = JSON.parse(options.project);
|
|
|
form[2].params = {
|
|
|
- "id": 20220920083901,
|
|
|
+ "id": 20221217145402,
|
|
|
"content": {
|
|
|
+ nocache: true,
|
|
|
"where": {
|
|
|
"condition": "",
|
|
|
- "type": 14,
|
|
|
- typemx: "居间协议",
|
|
|
"sa_projectid": project.sa_projectid
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
- form[3].value = [project.projectname, [project.sa_projectid]]
|
|
|
+ form.splice(3, 0, {
|
|
|
+ label: "项目名称",
|
|
|
+ error: false,
|
|
|
+ errMsg: "",
|
|
|
+ type: "route",
|
|
|
+ url: "/packageA/select/project/select",
|
|
|
+ disabled: true,
|
|
|
+ value: [project.projectname, [project.sa_projectid]],
|
|
|
+ params: {
|
|
|
+ "id": 20221201090802,
|
|
|
+ "content": {
|
|
|
+ "type": 3, //1直销 2经销 3居间
|
|
|
+ nocache: true,
|
|
|
+ "where": {
|
|
|
+ "condition": "",
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ placeholder: "项目名称",
|
|
|
+ valueName: "sa_projectid",
|
|
|
+ checking: "base",
|
|
|
+ required: false
|
|
|
+ })
|
|
|
+
|
|
|
+ form.splice(4, 0, {
|
|
|
+ label: "业务员",
|
|
|
+ error: false,
|
|
|
+ errMsg: "",
|
|
|
+ type: "route",
|
|
|
+ url: "/packageA/select/contacts/select",
|
|
|
+ value: [project.leader[0].name, [project.leader[0].hr.hrid]],
|
|
|
+ params: {
|
|
|
+ "id": 20230305201202,
|
|
|
+ "content": {
|
|
|
+ nocache: true,
|
|
|
+ type: 2,
|
|
|
+ sa_projectid: project.sa_projectid,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ query: "&radio=true&idname=hrid",
|
|
|
+ placeholder: "选择业务员",
|
|
|
+ disabled: true,
|
|
|
+ valueName: "saler_hrid",
|
|
|
+ checking: "base",
|
|
|
+ required: true
|
|
|
+ })
|
|
|
+
|
|
|
source = 1;
|
|
|
this.setData({
|
|
|
form
|
|
|
@@ -230,7 +305,6 @@ Page({
|
|
|
form,
|
|
|
temporary
|
|
|
} = e.detail;
|
|
|
- console.log(data, form, temporary)
|
|
|
form[temporary.index].value = data.value;
|
|
|
if (temporary.item.label == '计算方式') {
|
|
|
let index = form.findIndex(item => item.valueName == 'radios')
|
|
|
@@ -244,33 +318,78 @@ Page({
|
|
|
form[i].placeholder = '请填写居间产品折扣'
|
|
|
form[i].valueName = 'productdiscount'
|
|
|
}
|
|
|
-
|
|
|
- } else if (temporary.item.label == '项目合同') {
|
|
|
- let index = form.findIndex(v => v.label == '项目名称');
|
|
|
- if (index != -1 && source == 0) form[index].value = [data.item.projectname, [data.item.sa_projectid]]
|
|
|
+ } else if (temporary.item.label == '合同') {
|
|
|
+ let index = form.findIndex(v => v.label == '项目名称'),
|
|
|
+ item = data.item;
|
|
|
+ if (index != -1 && source == 0) form[index].value = [item.projectname, [item.sa_projectid]]
|
|
|
form[temporary.index].value = data.value;
|
|
|
- wx.navigateBack()
|
|
|
+ let ywyParams = {
|
|
|
+ "id": 20230305201202,
|
|
|
+ "content": {
|
|
|
+ nocache: true,
|
|
|
+ },
|
|
|
+ };
|
|
|
+ if (item.projectname) {
|
|
|
+ //项目合同
|
|
|
+ ywyParams.content.sa_projectid = item.sa_projectid;
|
|
|
+ ywyParams.content.type = 2;
|
|
|
+ form.splice(3, form.some(v => v.label == '项目名称' || v.label == '客户名称') ? 1 : 0, {
|
|
|
+ label: "项目名称",
|
|
|
+ error: false,
|
|
|
+ errMsg: "",
|
|
|
+ type: "route",
|
|
|
+ url: "/packageA/select/project/select",
|
|
|
+ disabled: true,
|
|
|
+ value: [item.projectname, [item.sa_projectid]],
|
|
|
+ params: {
|
|
|
+ "id": 20221201090802,
|
|
|
+ "content": {
|
|
|
+ "type": 3, //1直销 2经销 3居间
|
|
|
+ nocache: true,
|
|
|
+ "where": {
|
|
|
+ "condition": "",
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ placeholder: "项目名称",
|
|
|
+ valueName: "sa_projectid",
|
|
|
+ checking: "base",
|
|
|
+ required: false
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ //客户合同
|
|
|
+ ywyParams.content.sys_enterpriseid = item.sys_enterpriseid;
|
|
|
+ ywyParams.content.type = 4;
|
|
|
+ form.splice(3, form.some(v => v.label == '项目名称' || v.label == '客户名称') ? 1 : 0, {
|
|
|
+ label: "客户名称",
|
|
|
+ error: false,
|
|
|
+ errMsg: "",
|
|
|
+ type: "route",
|
|
|
+ url: "/packageA/select/project/select",
|
|
|
+ disabled: true,
|
|
|
+ value: [item.enterprisename, [item.sys_enterpriseid]],
|
|
|
+ params: {},
|
|
|
+ placeholder: "客户名称",
|
|
|
+ valueName: "sys_enterpriseid1",
|
|
|
+ checking: "base",
|
|
|
+ required: false,
|
|
|
+ disabled: true,
|
|
|
+ })
|
|
|
|
|
|
- } else if (temporary.item.label == '居间服务商') {
|
|
|
- form.splice(2, form[2].label == '业务员' ? 1 : 0, {
|
|
|
+ }
|
|
|
+ form.splice(4, form.some(v => v.label == '业务员') ? 1 : 0, {
|
|
|
label: "业务员",
|
|
|
error: false,
|
|
|
errMsg: "",
|
|
|
type: "route",
|
|
|
url: "/packageA/select/contacts/select",
|
|
|
- value: "",
|
|
|
- params: {
|
|
|
- "id": 20230305201202,
|
|
|
- "content": {
|
|
|
- nocache: true,
|
|
|
- "type": "1",
|
|
|
- "sys_enterpriseid": data.id[0]
|
|
|
- },
|
|
|
- },
|
|
|
+ value: [item.name, [item.hrid]],
|
|
|
+ params: ywyParams,
|
|
|
query: "&radio=true&idname=hrid",
|
|
|
placeholder: "选择业务员",
|
|
|
valueName: "saler_hrid",
|
|
|
checking: "base",
|
|
|
+ disabled: true,
|
|
|
required: true
|
|
|
})
|
|
|
wx.navigateBack()
|
|
|
@@ -295,13 +414,12 @@ Page({
|
|
|
}
|
|
|
content.begdate = content.invaliddate[0];
|
|
|
content.enddate = content.invaliddate[1];
|
|
|
- content.ascription_contractid = content.ascription_contractid[1] ? content.ascription_contractid[1][0] : 0;
|
|
|
- content.sys_enterpriseid = content.sys_enterpriseid[1] ? content.sys_enterpriseid[1][0] : 0;
|
|
|
- content.sa_projectid = content.sa_projectid[1] ? content.sa_projectid[1][0] : 0;
|
|
|
- content.saler_hrid = content.saler_hrid[1] ? content.saler_hrid[1][0] : 0;
|
|
|
- content.paytype = ""
|
|
|
+ content.ascription_contractid = content.ascription_contractid[1] ? content.ascription_contractid[1][0] : 0; //合同
|
|
|
+ content.sys_enterpriseid = content.sys_enterpriseid[1] ? content.sys_enterpriseid[1][0] : 0; //居间商
|
|
|
+ content.sa_projectid = content.sa_projectid ? content.sa_projectid[1][0] : 0; //项目合同
|
|
|
+ content.saler_hrid = content.saler_hrid[1] ? content.saler_hrid[1][0] : 0; //业务员
|
|
|
+ content.paytype = "";
|
|
|
if (this.data.source) content.source = 1;
|
|
|
- console.log(content)
|
|
|
delete(content.invaliddate)
|
|
|
_Http.basic({
|
|
|
"id": 20221121185302,
|