Quellcode durchsuchen

添加功能--预计投标时间限制只能选择之后的时间

MS-CIAZDCOIXVRW\Administrator vor 3 Jahren
Ursprung
Commit
8ca681147b

+ 39 - 23
pages/index/index.vue

@@ -39,8 +39,8 @@
 
 			<view class="form_item">
 				<span class="icon">*</span>预计投标时间
-				<picker mode="date" fields="month" :value="biddingTime" @change="bindDateChange">
-					<uni-easyinput placeholder="请选择预计投标时间" suffixIcon="calendar-filled" v-model="biddingTime">
+				<picker mode="date" fields="month" :start="getCurrentDate()" :value="biddingTime" @change="bindDateChange">
+					<uni-easyinput disabled placeholder="请选择预计投标时间" suffixIcon="calendar-filled" v-model="biddingTime">
 					</uni-easyinput>
 				</picker>
 			</view>
@@ -94,23 +94,28 @@
 	// 用户单位绑定数据
 	const company = ref(uni.getStorageSync('form_company') || '')
 	// 客户名称
-	const clientName = ref(uni.getStorageSync('form_content') ? JSON.parse(uni.getStorageSync('form_content')).clientName : '')
+	const clientName = ref(uni.getStorageSync('form_content') ? JSON.parse(uni.getStorageSync('form_content')).clientName :
+		'')
 	// 项目名称
-	const projectName = ref(uni.getStorageSync('form_content') ? JSON.parse(uni.getStorageSync('form_content')).projectName : '')
+	const projectName = ref(uni.getStorageSync('form_content') ? JSON.parse(uni.getStorageSync('form_content'))
+		.projectName : '')
 	// 项目金额
-	const projectAmount = ref(uni.getStorageSync('form_content') ? JSON.parse(uni.getStorageSync('form_content')).projectAmount : '')
+	const projectAmount = ref(uni.getStorageSync('form_content') ? JSON.parse(uni.getStorageSync('form_content'))
+		.projectAmount : '')
 	// 预计投标时间
-	const biddingTime = ref(uni.getStorageSync('form_content') ? JSON.parse(uni.getStorageSync('form_content')).biddingTime : '')
+	const biddingTime = ref(uni.getStorageSync('form_content') ? JSON.parse(uni.getStorageSync('form_content'))
+		.biddingTime : '')
 	// 所属行业
 	const industry = ref(uni.getStorageSync('form_content') ? JSON.parse(uni.getStorageSync('form_content')).industry : '')
 	// 产品类型
-	const productType = ref(uni.getStorageSync('form_content') ? JSON.parse(uni.getStorageSync('form_content')).productType : [])
+	const productType = ref(uni.getStorageSync('form_content') ? JSON.parse(uni.getStorageSync('form_content'))
+		.productType : [])
 	// 项目基本情况
-	const projectInformation = ref(uni.getStorageSync('form_content') ? JSON.parse(uni.getStorageSync('form_content')).projectInformation : '')
+	const projectInformation = ref(uni.getStorageSync('form_content') ? JSON.parse(uni.getStorageSync('form_content'))
+		.projectInformation : '')
 	// 微信手机号码绑定数据
 	const wxPhone = ref(uni.getStorageSync('wxPhone') || '')
 
-
 	// 所属行业数组数据
 	const range = ref(
 		[{
@@ -218,13 +223,13 @@
 			}
 		}
 	}
-	
+
 	// 验证表格信息是否符合规范
 	const handleValidate = () => {
 		const reName = /^[\u4e00-\u9fa5]{2,4}$/
 		const rePhone = /^[1][3,4,5,7,8,9][0-9]{9}$/
-		const reProjectAmount =/^\+?[1-9][0-9]*$/
-	
+		const reProjectAmount = /^\+?[1-9][0-9]*$/
+
 		if (name.value == '') {
 			uni.showToast({
 				title: '请输入姓名',
@@ -314,11 +319,11 @@
 
 	// 请求提交接口回调
 	const submit = async () => {
-		const bProduct =[] 
-		productType.value.forEach(item=>{
+		const bProduct = []
+		productType.value.forEach(item => {
 			bProduct.push(hobby.value[item].text)
 		})
-		
+
 		const res = await myRequest({
 			url: "/informationReporting/add",
 			method: "post",
@@ -326,12 +331,12 @@
 				name: name.value,
 				phone: phone.value,
 				company: company.value,
-				customerName:clientName.value,
-				entryName:projectName.value,
-				projectAmount:projectAmount.value,
-				tenderTime:biddingTime.value,
-				content:projectInformation.value,
-				trade:range.value[industry.value].text,
+				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,
 			}
@@ -349,7 +354,7 @@
 			industry.value = ''
 			productType.value = []
 			projectInformation.value = ''
-			
+
 			uni.removeStorageSync('form_content')
 			uni.setStorageSync('accredit', false)
 		} else {
@@ -359,6 +364,17 @@
 			})
 		}
 	}
+
+	// 获取当前时间 YY-MM-DD
+	const getCurrentDate = () => {
+		const date = new Date();
+		let year = date.getFullYear();
+		let month = date.getMonth() + 1;
+		let day = date.getDate();
+		month = month > 9 ? month : '0' + month;
+		day = day > 9 ? day : '0' + day;
+		return `${year}-${month}-${day}`;
+	}
 </script>
 
 <style lang="scss" scoped>
@@ -426,4 +442,4 @@
 			}
 		}
 	}
-</style>
+</style>

+ 3 - 2
uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.vue

@@ -669,11 +669,12 @@ $uni-border-1: #dcdfe6 !default;
 
 .is-disabled {
 	background-color: #f7f6f6;
-	color: #d5d5d5;
+	color: #333;
 
 	.uni-easyinput__placeholder-class {
-		color: #d5d5d5;
+		color: #999;
 		font-size: 12px;
+		background-color: #f2f2f2;
 	}
 }
 </style>

Datei-Diff unterdrückt, da er zu groß ist
+ 702 - 656
unpackage/dist/dev/mp-weixin/common/vendor.js


+ 20 - 9
unpackage/dist/dev/mp-weixin/pages/index/index.js

@@ -270,6 +270,15 @@ const _sfc_main = {
         });
       }
     };
+    const getCurrentDate = () => {
+      const date = new Date();
+      let year = date.getFullYear();
+      let month = date.getMonth() + 1;
+      let day = date.getDate();
+      month = month > 9 ? month : "0" + month;
+      day = day > 9 ? day : "0" + day;
+      return `${year}-${month}-${day}`;
+    };
     return (_ctx, _cache) => {
       return {
         a: common_vendor.o(($event) => name.value = $event),
@@ -306,32 +315,34 @@ const _sfc_main = {
         }),
         m: common_vendor.o(($event) => biddingTime.value = $event),
         n: common_vendor.p({
+          disabled: true,
           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({
+        o: getCurrentDate(),
+        p: biddingTime.value,
+        q: common_vendor.o(bindDateChange),
+        r: common_vendor.o(($event) => industry.value = $event),
+        s: common_vendor.p({
           placeholder: "请选择所属行业",
           localdata: range.value,
           modelValue: industry.value
         }),
-        s: common_vendor.o(($event) => productType.value = $event),
-        t: common_vendor.p({
+        t: common_vendor.o(($event) => productType.value = $event),
+        v: common_vendor.p({
           multiple: true,
           localdata: hobby.value,
           modelValue: productType.value
         }),
-        v: common_vendor.o(($event) => projectInformation.value = $event),
-        w: common_vendor.p({
+        w: common_vendor.o(($event) => projectInformation.value = $event),
+        x: common_vendor.p({
           type: "textarea",
           maxlength: -1,
           placeholder: "建议填写竞争情况 , 客户情况",
           modelValue: projectInformation.value
         }),
-        x: common_vendor.o(handleSubmit)
+        y: common_vendor.o(handleSubmit)
       };
     };
   }

Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/index/index.wxml


+ 1 - 1
unpackage/dist/dev/mp-weixin/uni_modules/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox.js

@@ -2,7 +2,7 @@
 const common_vendor = require("../../../../common/vendor.js");
 const _sfc_main = {
   name: "uniDataChecklist",
-  mixins: [common_vendor.Es.mixinDatacom || {}],
+  mixins: [common_vendor.Ls.mixinDatacom || {}],
   emits: ["input", "update:modelValue", "change"],
   props: {
     mode: {

+ 1 - 1
unpackage/dist/dev/mp-weixin/uni_modules/uni-data-select/components/uni-data-select/uni-data-select.js

@@ -2,7 +2,7 @@
 const common_vendor = require("../../../../common/vendor.js");
 const _sfc_main = {
   name: "uni-stat-select",
-  mixins: [common_vendor.Es.mixinDatacom || {}],
+  mixins: [common_vendor.Ls.mixinDatacom || {}],
   data() {
     return {
       showSelector: false,

+ 3 - 2
unpackage/dist/dev/mp-weixin/uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.wxss

@@ -102,9 +102,10 @@
 }
 .is-disabled {
   background-color: #f7f6f6;
-  color: #d5d5d5;
+  color: #333;
 }
 .is-disabled .uni-easyinput__placeholder-class {
-  color: #d5d5d5;
+  color: #999;
   font-size: 12px;
+  background-color: #f2f2f2;
 }