|
@@ -3,11 +3,15 @@ const common_vendor = require("../../common/vendor.js");
|
|
|
const util_api = require("../../util/api.js");
|
|
const util_api = require("../../util/api.js");
|
|
|
if (!Array) {
|
|
if (!Array) {
|
|
|
const _easycom_uni_easyinput2 = common_vendor.resolveComponent("uni-easyinput");
|
|
const _easycom_uni_easyinput2 = common_vendor.resolveComponent("uni-easyinput");
|
|
|
- _easycom_uni_easyinput2();
|
|
|
|
|
|
|
+ const _easycom_uni_data_select2 = common_vendor.resolveComponent("uni-data-select");
|
|
|
|
|
+ const _easycom_uni_data_checkbox2 = common_vendor.resolveComponent("uni-data-checkbox");
|
|
|
|
|
+ (_easycom_uni_easyinput2 + _easycom_uni_data_select2 + _easycom_uni_data_checkbox2)();
|
|
|
}
|
|
}
|
|
|
const _easycom_uni_easyinput = () => "../../uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.js";
|
|
const _easycom_uni_easyinput = () => "../../uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.js";
|
|
|
|
|
+const _easycom_uni_data_select = () => "../../uni_modules/uni-data-select/components/uni-data-select/uni-data-select.js";
|
|
|
|
|
+const _easycom_uni_data_checkbox = () => "../../uni_modules/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox.js";
|
|
|
if (!Math) {
|
|
if (!Math) {
|
|
|
- _easycom_uni_easyinput();
|
|
|
|
|
|
|
+ (_easycom_uni_easyinput + _easycom_uni_data_select + _easycom_uni_data_checkbox)();
|
|
|
}
|
|
}
|
|
|
const _sfc_main = {
|
|
const _sfc_main = {
|
|
|
__name: "index",
|
|
__name: "index",
|
|
@@ -21,9 +25,119 @@ const _sfc_main = {
|
|
|
const name = common_vendor.ref(common_vendor.index.getStorageSync("form_name") || "");
|
|
const name = common_vendor.ref(common_vendor.index.getStorageSync("form_name") || "");
|
|
|
const phone = common_vendor.ref(common_vendor.index.getStorageSync("form_phone") || "");
|
|
const phone = common_vendor.ref(common_vendor.index.getStorageSync("form_phone") || "");
|
|
|
const company = common_vendor.ref(common_vendor.index.getStorageSync("form_company") || "");
|
|
const company = common_vendor.ref(common_vendor.index.getStorageSync("form_company") || "");
|
|
|
- const content = common_vendor.ref(common_vendor.index.getStorageSync("form_content") || "");
|
|
|
|
|
|
|
+ const clientName = common_vendor.ref(common_vendor.index.getStorageSync("form_content") ? JSON.parse(common_vendor.index.getStorageSync("form_content")).clientName : "");
|
|
|
|
|
+ const projectName = common_vendor.ref(common_vendor.index.getStorageSync("form_content") ? JSON.parse(common_vendor.index.getStorageSync("form_content")).projectName : "");
|
|
|
|
|
+ const projectAmount = common_vendor.ref(common_vendor.index.getStorageSync("form_content") ? JSON.parse(common_vendor.index.getStorageSync("form_content")).projectAmount : "");
|
|
|
|
|
+ const biddingTime = common_vendor.ref(common_vendor.index.getStorageSync("form_content") ? JSON.parse(common_vendor.index.getStorageSync("form_content")).biddingTime : "");
|
|
|
|
|
+ const industry = common_vendor.ref(common_vendor.index.getStorageSync("form_content") ? JSON.parse(common_vendor.index.getStorageSync("form_content")).industry : "");
|
|
|
|
|
+ const productType = common_vendor.ref(common_vendor.index.getStorageSync("form_content") ? JSON.parse(common_vendor.index.getStorageSync("form_content")).productType : []);
|
|
|
|
|
+ const projectInformation = common_vendor.ref(common_vendor.index.getStorageSync("form_content") ? JSON.parse(common_vendor.index.getStorageSync("form_content")).projectInformation : "");
|
|
|
const wxPhone = common_vendor.ref(common_vendor.index.getStorageSync("wxPhone") || "");
|
|
const wxPhone = common_vendor.ref(common_vendor.index.getStorageSync("wxPhone") || "");
|
|
|
|
|
+ const range = common_vendor.ref(
|
|
|
|
|
+ [
|
|
|
|
|
+ {
|
|
|
|
|
+ value: 0,
|
|
|
|
|
+ text: "政府"
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ value: 1,
|
|
|
|
|
+ text: "教育"
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ value: 2,
|
|
|
|
|
+ text: "医疗"
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ value: 3,
|
|
|
|
|
+ text: "企业"
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ value: 4,
|
|
|
|
|
+ text: "公检法"
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ value: 5,
|
|
|
|
|
+ text: "交通"
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ value: 6,
|
|
|
|
|
+ text: "分销&SMB"
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ value: 7,
|
|
|
|
|
+ text: "其他"
|
|
|
|
|
+ }
|
|
|
|
|
+ ]
|
|
|
|
|
+ );
|
|
|
|
|
+ const hobby = common_vendor.ref(
|
|
|
|
|
+ [{
|
|
|
|
|
+ text: "网络",
|
|
|
|
|
+ value: 0
|
|
|
|
|
+ }, {
|
|
|
|
|
+ text: "安全",
|
|
|
|
|
+ value: 1
|
|
|
|
|
+ }, {
|
|
|
|
|
+ text: "IT",
|
|
|
|
|
+ value: 2
|
|
|
|
|
+ }, {
|
|
|
|
|
+ text: "云智",
|
|
|
|
|
+ value: 3
|
|
|
|
|
+ }, {
|
|
|
|
|
+ text: "PC",
|
|
|
|
|
+ value: 4
|
|
|
|
|
+ }, {
|
|
|
|
|
+ text: "AI视觉",
|
|
|
|
|
+ value: 5
|
|
|
|
|
+ }]
|
|
|
|
|
+ );
|
|
|
|
|
+ const bindDateChange = (e) => {
|
|
|
|
|
+ const val = e.detail.value;
|
|
|
|
|
+ biddingTime.value = val;
|
|
|
|
|
+ };
|
|
|
const handleSubmit = () => {
|
|
const handleSubmit = () => {
|
|
|
|
|
+ const flag = handleValidate();
|
|
|
|
|
+ if (flag) {
|
|
|
|
|
+ common_vendor.index.setStorageSync("form_name", name.value);
|
|
|
|
|
+ common_vendor.index.setStorageSync("form_phone", phone.value);
|
|
|
|
|
+ common_vendor.index.setStorageSync("form_company", company.value);
|
|
|
|
|
+ const formContent = {
|
|
|
|
|
+ clientName: clientName.value,
|
|
|
|
|
+ projectName: projectName.value,
|
|
|
|
|
+ projectAmount: projectAmount.value,
|
|
|
|
|
+ biddingTime: biddingTime.value,
|
|
|
|
|
+ industry: industry.value,
|
|
|
|
|
+ productType: productType.value,
|
|
|
|
|
+ projectInformation: projectInformation.value
|
|
|
|
|
+ };
|
|
|
|
|
+ common_vendor.index.setStorageSync("form_content", JSON.stringify(formContent));
|
|
|
|
|
+ if (!wxPhone.value) {
|
|
|
|
|
+ common_vendor.index.showModal({
|
|
|
|
|
+ title: "提示",
|
|
|
|
|
+ content: "本次操作需要获取您的手机号码",
|
|
|
|
|
+ success: (res) => {
|
|
|
|
|
+ if (res.confirm) {
|
|
|
|
|
+ common_vendor.index.navigateTo({
|
|
|
|
|
+ url: "/pages/authorization/authorization"
|
|
|
|
|
+ });
|
|
|
|
|
+ } else if (res.cancel)
|
|
|
|
|
+ ;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ common_vendor.index.showModal({
|
|
|
|
|
+ title: "提示",
|
|
|
|
|
+ content: "确认提交吗",
|
|
|
|
|
+ success: (res) => {
|
|
|
|
|
+ if (res.confirm) {
|
|
|
|
|
+ submit();
|
|
|
|
|
+ } else if (res.cancel)
|
|
|
|
|
+ ;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+ const handleValidate = () => {
|
|
|
const reName = /^[\u4e00-\u9fa5]{2,4}$/;
|
|
const reName = /^[\u4e00-\u9fa5]{2,4}$/;
|
|
|
const rePhone = /^[1][3,4,5,7,8,9][0-9]{9}$/;
|
|
const rePhone = /^[1][3,4,5,7,8,9][0-9]{9}$/;
|
|
|
if (name.value == "") {
|
|
if (name.value == "") {
|
|
@@ -31,74 +145,85 @@ const _sfc_main = {
|
|
|
title: "请输入姓名",
|
|
title: "请输入姓名",
|
|
|
icon: "none"
|
|
icon: "none"
|
|
|
});
|
|
});
|
|
|
- return;
|
|
|
|
|
|
|
+ return false;
|
|
|
}
|
|
}
|
|
|
if (!reName.test(name.value)) {
|
|
if (!reName.test(name.value)) {
|
|
|
common_vendor.index.showToast({
|
|
common_vendor.index.showToast({
|
|
|
title: "姓名格式有误",
|
|
title: "姓名格式有误",
|
|
|
icon: "none"
|
|
icon: "none"
|
|
|
});
|
|
});
|
|
|
- return;
|
|
|
|
|
|
|
+ return false;
|
|
|
}
|
|
}
|
|
|
if (phone.value == "") {
|
|
if (phone.value == "") {
|
|
|
common_vendor.index.showToast({
|
|
common_vendor.index.showToast({
|
|
|
title: "请输入手机号",
|
|
title: "请输入手机号",
|
|
|
icon: "none"
|
|
icon: "none"
|
|
|
});
|
|
});
|
|
|
- return;
|
|
|
|
|
|
|
+ return false;
|
|
|
}
|
|
}
|
|
|
if (!rePhone.test(phone.value)) {
|
|
if (!rePhone.test(phone.value)) {
|
|
|
common_vendor.index.showToast({
|
|
common_vendor.index.showToast({
|
|
|
title: "手机格式有误",
|
|
title: "手机格式有误",
|
|
|
icon: "none"
|
|
icon: "none"
|
|
|
});
|
|
});
|
|
|
- return;
|
|
|
|
|
|
|
+ return false;
|
|
|
}
|
|
}
|
|
|
if (company.value == "") {
|
|
if (company.value == "") {
|
|
|
common_vendor.index.showToast({
|
|
common_vendor.index.showToast({
|
|
|
title: "请输入单位名称",
|
|
title: "请输入单位名称",
|
|
|
icon: "none"
|
|
icon: "none"
|
|
|
});
|
|
});
|
|
|
- return;
|
|
|
|
|
|
|
+ return false;
|
|
|
}
|
|
}
|
|
|
- if (!content.value) {
|
|
|
|
|
|
|
+ if (clientName.value == "") {
|
|
|
common_vendor.index.showToast({
|
|
common_vendor.index.showToast({
|
|
|
- title: "请输入需要登记的事件",
|
|
|
|
|
|
|
+ title: "请输入客户名称",
|
|
|
icon: "none"
|
|
icon: "none"
|
|
|
});
|
|
});
|
|
|
- return;
|
|
|
|
|
|
|
+ return false;
|
|
|
}
|
|
}
|
|
|
- common_vendor.index.setStorageSync("form_name", name.value);
|
|
|
|
|
- common_vendor.index.setStorageSync("form_phone", phone.value);
|
|
|
|
|
- common_vendor.index.setStorageSync("form_company", company.value);
|
|
|
|
|
- common_vendor.index.setStorageSync("form_content", content.value);
|
|
|
|
|
- if (!wxPhone.value) {
|
|
|
|
|
- common_vendor.index.showModal({
|
|
|
|
|
- title: "提示",
|
|
|
|
|
- content: "本次操作需要获取您的手机号码",
|
|
|
|
|
- success: (res) => {
|
|
|
|
|
- if (res.confirm) {
|
|
|
|
|
- common_vendor.index.navigateTo({
|
|
|
|
|
- url: "/pages/authorization/authorization"
|
|
|
|
|
- });
|
|
|
|
|
- } else if (res.cancel)
|
|
|
|
|
- ;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (projectName.value == "") {
|
|
|
|
|
+ common_vendor.index.showToast({
|
|
|
|
|
+ title: "请输入项目名称",
|
|
|
|
|
+ icon: "none"
|
|
|
});
|
|
});
|
|
|
- } else {
|
|
|
|
|
- common_vendor.index.showModal({
|
|
|
|
|
- title: "提示",
|
|
|
|
|
- content: "确认提交吗",
|
|
|
|
|
- success: (res) => {
|
|
|
|
|
- if (res.confirm) {
|
|
|
|
|
- submit();
|
|
|
|
|
- } else if (res.cancel)
|
|
|
|
|
- ;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (projectAmount.value == "") {
|
|
|
|
|
+ common_vendor.index.showToast({
|
|
|
|
|
+ title: "请输入项目金额",
|
|
|
|
|
+ icon: "none"
|
|
|
|
|
+ });
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (biddingTime.value == "") {
|
|
|
|
|
+ common_vendor.index.showToast({
|
|
|
|
|
+ title: "请选择预计投标时间",
|
|
|
|
|
+ icon: "none"
|
|
|
});
|
|
});
|
|
|
|
|
+ return false;
|
|
|
}
|
|
}
|
|
|
|
|
+ if (industry.value === "") {
|
|
|
|
|
+ common_vendor.index.showToast({
|
|
|
|
|
+ title: "请选择所属行业",
|
|
|
|
|
+ icon: "none"
|
|
|
|
|
+ });
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (productType.value.length == 0) {
|
|
|
|
|
+ common_vendor.index.showToast({
|
|
|
|
|
+ title: "请选择产品类型",
|
|
|
|
|
+ icon: "none"
|
|
|
|
|
+ });
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ return true;
|
|
|
};
|
|
};
|
|
|
const submit = async () => {
|
|
const submit = async () => {
|
|
|
|
|
+ const bProduct = [];
|
|
|
|
|
+ productType.value.forEach((item) => {
|
|
|
|
|
+ bProduct.push(hobby.value[item].text);
|
|
|
|
|
+ });
|
|
|
const res = await util_api.myRequest({
|
|
const res = await util_api.myRequest({
|
|
|
url: "/informationReporting/add",
|
|
url: "/informationReporting/add",
|
|
|
method: "post",
|
|
method: "post",
|
|
@@ -106,7 +231,13 @@ const _sfc_main = {
|
|
|
name: name.value,
|
|
name: name.value,
|
|
|
phone: phone.value,
|
|
phone: phone.value,
|
|
|
company: company.value,
|
|
company: company.value,
|
|
|
- content: content.value,
|
|
|
|
|
|
|
+ customerName: clientName.value,
|
|
|
|
|
+ entryName: projectName.value,
|
|
|
|
|
+ projectAmount: projectAmount.value,
|
|
|
|
|
+ tenderTime: biddingTime.value,
|
|
|
|
|
+ content: projectInformation.value,
|
|
|
|
|
+ trade: range.value[industry.value].text,
|
|
|
|
|
+ bProduct,
|
|
|
wxPhone: wxPhone.value
|
|
wxPhone: wxPhone.value
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
@@ -115,8 +246,14 @@ const _sfc_main = {
|
|
|
title: "提交成功",
|
|
title: "提交成功",
|
|
|
duration: 3e3
|
|
duration: 3e3
|
|
|
});
|
|
});
|
|
|
- content.value = "";
|
|
|
|
|
- common_vendor.index.setStorageSync("form_content", "");
|
|
|
|
|
|
|
+ clientName.value = "";
|
|
|
|
|
+ projectName.value = "";
|
|
|
|
|
+ projectAmount.value = "";
|
|
|
|
|
+ biddingTime.value = "";
|
|
|
|
|
+ industry.value = "";
|
|
|
|
|
+ productType.value = [];
|
|
|
|
|
+ projectInformation.value = "";
|
|
|
|
|
+ common_vendor.index.removeStorageSync("form_content");
|
|
|
common_vendor.index.setStorageSync("accredit", false);
|
|
common_vendor.index.setStorageSync("accredit", false);
|
|
|
} else {
|
|
} else {
|
|
|
common_vendor.index.showToast({
|
|
common_vendor.index.showToast({
|
|
@@ -143,14 +280,50 @@ const _sfc_main = {
|
|
|
placeholder: "请输入单位名称",
|
|
placeholder: "请输入单位名称",
|
|
|
modelValue: company.value
|
|
modelValue: company.value
|
|
|
}),
|
|
}),
|
|
|
- g: common_vendor.o(($event) => content.value = $event),
|
|
|
|
|
|
|
+ g: common_vendor.o(($event) => clientName.value = $event),
|
|
|
h: common_vendor.p({
|
|
h: common_vendor.p({
|
|
|
|
|
+ placeholder: "请输入客户名称",
|
|
|
|
|
+ modelValue: clientName.value
|
|
|
|
|
+ }),
|
|
|
|
|
+ i: common_vendor.o(($event) => projectName.value = $event),
|
|
|
|
|
+ j: common_vendor.p({
|
|
|
|
|
+ placeholder: "请输入项目名称",
|
|
|
|
|
+ modelValue: projectName.value
|
|
|
|
|
+ }),
|
|
|
|
|
+ k: common_vendor.o(($event) => projectAmount.value = $event),
|
|
|
|
|
+ l: common_vendor.p({
|
|
|
|
|
+ type: "number",
|
|
|
|
|
+ placeholder: "请输入项目金额",
|
|
|
|
|
+ modelValue: projectAmount.value
|
|
|
|
|
+ }),
|
|
|
|
|
+ m: common_vendor.o(($event) => biddingTime.value = $event),
|
|
|
|
|
+ n: common_vendor.p({
|
|
|
|
|
+ placeholder: "请选择预计投标时间",
|
|
|
|
|
+ suffixIcon: "calendar-filled",
|
|
|
|
|
+ modelValue: biddingTime.value
|
|
|
|
|
+ }),
|
|
|
|
|
+ o: biddingTime.value,
|
|
|
|
|
+ p: common_vendor.o(bindDateChange),
|
|
|
|
|
+ q: common_vendor.o(($event) => industry.value = $event),
|
|
|
|
|
+ r: common_vendor.p({
|
|
|
|
|
+ placeholder: "请选择所属行业",
|
|
|
|
|
+ localdata: range.value,
|
|
|
|
|
+ modelValue: industry.value
|
|
|
|
|
+ }),
|
|
|
|
|
+ s: common_vendor.o(($event) => productType.value = $event),
|
|
|
|
|
+ t: common_vendor.p({
|
|
|
|
|
+ multiple: true,
|
|
|
|
|
+ localdata: hobby.value,
|
|
|
|
|
+ modelValue: productType.value
|
|
|
|
|
+ }),
|
|
|
|
|
+ v: common_vendor.o(($event) => projectInformation.value = $event),
|
|
|
|
|
+ w: common_vendor.p({
|
|
|
type: "textarea",
|
|
type: "textarea",
|
|
|
maxlength: -1,
|
|
maxlength: -1,
|
|
|
- placeholder: "请输入需要登记的事件",
|
|
|
|
|
- modelValue: content.value
|
|
|
|
|
|
|
+ placeholder: "建议填写竞争情况 , 客户情况",
|
|
|
|
|
+ modelValue: projectInformation.value
|
|
|
}),
|
|
}),
|
|
|
- i: common_vendor.o(handleSubmit)
|
|
|
|
|
|
|
+ x: common_vendor.o(handleSubmit)
|
|
|
};
|
|
};
|
|
|
};
|
|
};
|
|
|
}
|
|
}
|