diff --git a/css/car_demand_plan/H5/demand_plan_apply.css b/css/car_demand_plan/H5/demand_plan_apply.css new file mode 100644 index 0000000..812d6b6 --- /dev/null +++ b/css/car_demand_plan/H5/demand_plan_apply.css @@ -0,0 +1,816 @@ +/* H5移动端样式 - 车辆需求计划申请 */ + +* { + box-sizing: border-box; +} + +body { + margin: 0; + padding: 0; + background: #f5f5f5; + font-family: 'Alibaba PuHuiTi R', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; + -webkit-font-smoothing: antialiased; +} + +/* 顶部标题栏 */ +.h5-header { + position: fixed; + top: 0; + left: 0; + right: 0; + height: 44px; + background: #409EFF; + z-index: 1000; + display: flex; + align-items: center; + justify-content: center; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); +} + +.header-content { + display: flex; + align-items: center; + justify-content: center; + color: #fff; + font-size: 16px; + font-weight: 500; +} + +.header-content .layui-icon { + font-size: 18px; + margin-right: 8px; +} + +.header-title { + font-size: 16px; +} + +/* 主容器 */ +.h5-container { + margin-top: 44px; + padding: 12px; + padding-bottom: 70px; /* 为底部固定按钮留出空间 */ +} + +/* 表单卡片 */ +.form-card { + background: #fff; + border-radius: 8px; + margin-bottom: 12px; + padding: 16px; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); +} + +/* 卡片头部 */ +.card-header { + display: flex; + align-items: center; + margin-bottom: 16px; + padding-bottom: 12px; + border-bottom: 1px solid #f0f0f0; + position: relative; +} + +.card-header .layui-icon { + font-size: 18px; + color: #409EFF; + margin-right: 8px; +} + +.card-title { + font-size: 16px; + font-weight: 600; + color: #333; + flex: 1; +} + +.return-btn { + position: absolute; + right: 0; + background: #f5f5f5; + border: none; + border-radius: 4px; + padding: 6px 12px; + display: flex; + align-items: center; + cursor: pointer; + font-size: 14px; + color: #666; +} + +.return-btn .layui-icon { + margin-right: 4px; + font-size: 14px; + color: #666; +} + +.return-btn:active { + background: #e8e8e8; +} + +/* 表单样式 */ +.layui-form-item { + margin-bottom: 16px; +} + +.layui-form-label { + width: 100px !important; + padding: 9px 0; + font-size: 14px; + color: #333; + text-align: left; +} + +.layui-form-label.required::after { + content: '*'; + color: red; + margin-left: 4px; +} + +.layui-input-block { + margin-left: 100px !important; +} + +.layui-input, +.layui-select, +.layui-textarea { + font-size: 14px; + border-radius: 4px; + border: 1px solid #e0e0e0; +} + +.layui-input:focus, +.layui-select:focus, +.layui-textarea:focus { + border-color: #409EFF; +} + +.layui-textarea { + min-height: 100px; + resize: none; +} + +/* 字符计数 */ +.char-count { + text-align: right; + font-size: 12px; + color: #999; + margin-top: 4px; +} + +/* 单位输入框 */ +.input-with-unit { + display: flex; + align-items: center; +} + +.input-with-unit .layui-input { + flex: 1; +} + +.input-with-unit .unit { + margin-left: 8px; + font-size: 14px; + color: #666; +} + +/* 单选框组 */ +.layui-form-radio { + margin-right: 20px; + margin-top: 0; +} + +.layui-form-radio > i { + font-size: 18px; +} + +.layui-form-radioed > i { + color: #409EFF; +} + +/* 途经点提示 */ +.route-point-tip { + margin-top: -8px; + margin-bottom: 16px; + padding-left: 100px; + font-size: 12px; + color: #999; +} + +.add-route-btn { + display: inline-flex; + align-items: center; + color: #409EFF; + cursor: pointer; + margin-left: 8px; + font-size: 14px; +} + +.add-route-btn .layui-icon { + margin-right: 4px; + font-size: 14px; +} + +.add-route-btn:active { + opacity: 0.7; +} + +/* 上传区域 */ +.upload-area { + display: flex; + flex-wrap: wrap; + /* gap: 12px; */ + margin-bottom: 8px; + position: relative; +} + +/* 上传按钮包装器 */ +.upload-btn-wrapper { + position: relative; + width: 80px; + height: 80px; +} + +/* 原生文件输入框 */ +#fileInput { + position: absolute !important; + width: 80px !important; + height: 80px !important; + top: 0 !important; + left: 0 !important; + opacity: 0 !important; + cursor: pointer !important; + z-index: 999 !important; + margin: 0 !important; + padding: 0 !important; + font-size: 0 !important; + pointer-events: auto !important; + /* 确保input可以正常交互 */ + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; +} + +.upload-btn { + width: 80px; + height: 80px; + background-color: #f5f5f5; + border: 1px dashed #d9d9d9; + border-radius: 4px; + display: flex; + align-items: center; + justify-content: center; + cursor: pointer; + position: relative; + z-index: 1; + pointer-events: auto; /* 允许点击,然后手动触发input */ +} + +.layui-upload-list { + /* margin: 0; */ + margin-right: 10px; +} + +/* 确保没有其他元素覆盖 */ +.upload-area { + position: relative; + z-index: 1; +} + +.upload-btn-wrapper { + position: relative; + z-index: 2; + margin-top: 11px; +} + +.upload-btn .layui-icon { + font-size: 32px; + color: #999; +} + +.upload-btn:active { + background-color: #e8e8e8; +} + +.uploader-list { + display: flex; + flex-wrap: wrap; + gap: 12px; + align-items: flex-start; /* 确保顶部对齐 */ +} + +.uploader-list .file-iteme { + position: relative; + width: 80px; + height: 80px; + flex-shrink: 0; /* 防止压缩 */ +} + +/* 图片预览样式 */ +.uploader-list .file-iteme .file-preview-img { + width: 80px; + height: 80px; + object-fit: cover; + border-radius: 4px; + display: block; +} + +/* 非图片文件盒子样式 */ +.uploader-list .file-iteme .file-preview-box { + width: 80px; + height: 80px; + background: #f5f5f5; + border: 1px solid #e0e0e0; + border-radius: 4px; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + padding: 4px; + box-sizing: border-box; +} + +.uploader-list .file-iteme .file-preview-box .file-icon { + width: 40px; + height: 40px; + object-fit: contain; + margin-bottom: 4px; +} + +.uploader-list .file-iteme .file-preview-box .file-name { + font-size: 10px; + color: #666; + text-align: center; + margin: 0; + line-height: 1.2; + word-break: break-all; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + max-height: 24px; +} + +.uploader-list .handle { + position: absolute; + top: -8px; + right: -8px; + width: 20px; + height: 20px; + background-color: #ff4d4f; + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + cursor: pointer; + z-index: 10; +} + +.uploader-list .handle p { + color: #fff; + font-size: 14px; + margin: 0; + line-height: 1; +} + +/* 保留旧的upload-file样式以兼容(如果其他地方用到) */ +.upload-file { + width: 80px; + height: 80px; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + background: #f5f5f5; + border-radius: 4px; +} + +.upload-file img { + width: 40px; + height: 40px; + object-fit: contain; +} + +.upload-file p { + font-size: 10px; + color: #666; + margin-top: 4px; + text-align: center; + word-break: break-all; + padding: 0 4px; +} + +.upload-tip { + /* padding-left: 100px; */ + margin-top: 8px; +} + +.upload-tip p { + font-size: 12px; + color: #ff4d4f; + margin: 0; +} + +/* 无数据状态 */ +.no-data-container { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + padding: 40px 20px; + min-height: 200px; +} + +.no-data-container img { + width: 120px; + height: 120px; + opacity: 0.5; + margin-bottom: 16px; +} + +.no-data-text { + font-size: 16px; + font-weight: 600; + color: #333; + margin: 8px 0; +} + +.no-data-tip { + font-size: 14px; + color: #999; + margin: 8px 0 20px; + text-align: center; +} + +.no-data-container .layui-btn { + display: flex; + align-items: center; + padding: 8px 20px; +} + +.no-data-container .layui-btn .layui-icon { + margin-right: 4px; +} + +/* 有数据时-展示 */ +.has-data-container { + padding: 20px; + background: #f0f7ff; + border-radius: 8px; + border: 1px solid #d0e7ff; +} + +.selected-info { + display: flex; + align-items: center; + justify-content: center; + gap: 8px; + margin-bottom: 16px; + + padding: 12px; + background: #fff; + border-radius: 6px; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); +} + +.selected-count-text { + font-size: 15px; + color: #333; + font-weight: 500; +} + +.selected-count-text span { + color: #409EFF; + font-weight: 600; + font-size: 16px; +} + +.has-data-container .layui-btn { + width: 100%; +} + +/* 选择类型页面样式 */ +.select-type-page { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: #f5f5f5; + z-index: 1000; + overflow-y: auto; +} + +.select-type-page .h5-container { + padding-bottom: 70px; /* 为底部按钮留出空间 */ +} + +/* 选择类型页面头部优化 */ +.select-type-page .h5-header { + padding: 0 8px; /* 减小左右内边距,给右侧更多空间 */ +} + +.select-type-page .header-left { + flex: 0 1 auto; /* 允许缩小,但不扩展 */ + max-width: 50%; /* 限制左侧最大宽度 */ +} + +.select-type-page .header-right { + width: 40%; + gap: 6px; /* 减小间距 */ + margin-left: 8px; /* 增加与左侧的间距 */ +} + +.select-type-page .selected-count { + font-size: 12px; /* 稍微减小字体 */ +} + +.select-type-page .return-btn { + margin-right: 20px; + padding: 4px 6px; /* 减小按钮内边距 */ + font-size: 11px; /* 稍微减小字体 */ +} + +.select-type-page .return-btn span { + display: none; /* 在小屏幕上隐藏文字,只显示图标 */ +} + +/* 在较大屏幕上显示返回按钮文字 */ +@media screen and (min-width: 375px) { + .select-type-page .return-btn span { + display: inline; + } + + .select-type-page .header-right { + gap: 8px; + } +} + +/* 固定在底部的提交按钮 */ +.fixed-submit-btn { + position: fixed; + bottom: 0; + left: 0; + right: 0; + background: #fff; + padding: 12px; + box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1); + z-index: 999; +} + +.submit-btn-full { + width: 100%; + height: 44px; + font-size: 16px; + border-radius: 4px; +} + +/* 为底部按钮留出空间 */ +.h5-container { + padding-bottom: 70px; +} + +/* 底部按钮 */ +.btn-box { + position: fixed; + bottom: 0; + left: 0; + right: 0; + padding: 12px; + background: #fff; + border-top: 1px solid #e0e0e0; + display: flex; + gap: 12px; + z-index: 999; + box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05); +} + +.btn-box .layui-btn { + flex: 1; + height: 44px; + line-height: 44px; + font-size: 16px; + border-radius: 4px; +} + +.btn-box .layui-btn.layui-btn-disabled { + opacity: 0.6; +} + +/* 添加的途径点 */ +.addTjd { + margin-bottom: 12px; + /* position: relative; */ + +} + +.addTjdInput { + width: 85%; +} + +.addTjd .layui-form-label { + /* width: 100px !important; */ +} + +.addTjd .layui-input-block { + + + /* margin-left: 100px !important; */ + /* padding-right: 30px; */ +} + +.addTjd img { + position: absolute; + right: 0; + top: 50%; + transform: translateY(-50%); + width: 24px; + height: 24px; + cursor: pointer; +} + +/* 响应式调整 */ +@media screen and (max-width: 375px) { + .layui-form-label { + width: 90px !important; + } + + .layui-input-block { + margin-left: 90px !important; + } + + .route-point-tip, + .upload-tip { + /* padding-left: 90px; */ + } +} + +/* layout布局类 */ +.layout { + display: flex; + align-items: center; + justify-content: center; +} + +/* 修复layui样式冲突 */ +.layui-form-radio { + line-height: 28px; +} + +.layui-form-radio > * { + font-size: 14px; +} + +.layui-form-select dl dd { + font-size: 14px; +} + +/* 优化下拉选择框样式 - 工程选择 */ +.layui-form-select { + width: 100%; +} + +.layui-form-select .layui-select-title { + width: 100%; +} + +.layui-form-select .layui-select-title input { + width: 100%; + padding-right: 30px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +/* 下拉选项列表容器 */ +.layui-form-select dl { + position: absolute !important; + top: 100% !important; + left: 0 !important; + margin-top: 2px !important; + border: 1px solid #e0e0e0; + border-radius: 4px; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); + background: #fff; + z-index: 9999; + max-height: 50vh; + overflow-y: auto; + -webkit-overflow-scrolling: touch; +} + +/* 下拉选项项 - 不强制display,让layui自己控制过滤 */ +.layui-form-select dl dd { + width: 100% !important; + padding: 10px 12px !important; + white-space: normal !important; + word-wrap: break-word !important; + word-break: break-all !important; + line-height: 1.6 !important; + min-height: auto !important; + height: auto !important; + overflow: visible !important; + text-overflow: clip !important; + box-sizing: border-box !important; +} + +/* 确保layui搜索过滤功能正常 - layui会自动添加layui-disabled类来隐藏被过滤的选项 */ +.layui-form-select dl dd.layui-disabled { + display: none !important; +} + +/* 选项文本内容 - 允许换行 */ +.layui-form-select dl dd, +.layui-form-select dl dd a { + white-space: normal !important; + word-wrap: break-word !important; + word-break: break-all !important; + overflow-wrap: break-word !important; + width: 100% !important; +} + +/* 下拉选项悬停和选中状态 */ +.layui-form-select dl dd:hover, +.layui-form-select dl dd.layui-this { + background-color: #f0f7ff; + color: #409EFF; +} + +/* 搜索输入框样式 - layui的搜索输入框 */ +.layui-form-select dl input[type="text"], +.layui-form-select dl input.layui-input { + width: 100% !important; + padding: 8px 12px !important; + border: none !important; + border-bottom: 1px solid #e0e0e0 !important; + border-radius: 0 !important; + font-size: 14px !important; + box-sizing: border-box !important; + background: #fff !important; +} + +/* 确保搜索输入框可见且可交互 */ +.layui-form-select dl input[type="text"]:focus, +.layui-form-select dl input.layui-input:focus { + outline: none !important; + border-bottom-color: #409EFF !important; +} + +/* 确保下拉列表在移动端正确显示 */ +.layui-form-select .layui-edge { + right: 10px; + top: 50%; +} + +/* 移动端下拉列表优化 */ +@media screen and (max-width: 768px) { + .layui-form-select dl { + max-height: 50vh; + } + + .layui-form-select dl dd { + padding: 12px 16px !important; + font-size: 15px !important; + } +} + +/* 移动端优化 */ +@media screen and (max-width: 320px) { + .layui-form-label { + width: 80px !important; + font-size: 13px; + } + + .layui-input-block { + margin-left: 80px !important; + } + + .route-point-tip, + .upload-tip { + padding-left: 80px; + } +} + +/* 确保按钮在移动端可点击 */ +.layui-btn { + -webkit-tap-highlight-color: transparent; + touch-action: manipulation; +} + +/* 输入框在移动端优化 */ +input, textarea, select { + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; +} + +/* 防止iOS输入框缩放 */ +@media screen and (max-width: 768px) { + input[type="text"], + input[type="number"], + textarea, + select { + font-size: 16px !important; + } +} + diff --git a/css/car_demand_plan/H5/select_type.css b/css/car_demand_plan/H5/select_type.css new file mode 100644 index 0000000..af134c6 --- /dev/null +++ b/css/car_demand_plan/H5/select_type.css @@ -0,0 +1,602 @@ +/* H5移动端样式 - 选择类型页面 */ + +* { + box-sizing: border-box; +} + +body { + margin: 0; + padding: 0; + background: #f5f5f5; + font-family: 'Alibaba PuHuiTi R', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; + -webkit-font-smoothing: antialiased; + padding-bottom: 70px; +} + +/* 顶部标题栏 */ +.h5-header { + position: fixed; + top: 0; + left: 0; + right: 0; + height: 44px; + background: #409EFF; + z-index: 1000; + display: flex; + align-items: center; + justify-content: space-between; + padding: 0 12px; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); + min-width: 0; /* 允许flex容器缩小 */ +} + +.header-left { + display: flex; + align-items: center; + color: #fff; + font-size: 16px; + font-weight: 500; + flex: 1; + min-width: 0; /* 允许缩小 */ + overflow: hidden; /* 防止内容溢出 */ +} + +.header-left .layui-icon { + font-size: 18px; + margin-right: 8px; + flex-shrink: 0; /* 图标不缩小 */ +} + +.header-left .header-title { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.header-right { + display: flex; + align-items: center; + gap: 8px; + flex-shrink: 0; + min-width: 0; /* 允许flex子项缩小 */ +} + +.selected-count { + color: #fff; + font-size: 13px; + white-space: nowrap; /* 防止换行 */ + flex-shrink: 0; +} + +.return-btn { + background: rgba(255, 255, 255, 0.2); + border: none; + border-radius: 4px; + padding: 4px 8px; + display: flex; + align-items: center; + cursor: pointer; + font-size: 12px; + color: #fff; + white-space: nowrap; /* 防止文字换行 */ + flex-shrink: 0; /* 防止按钮被压缩 */ +} + +.return-btn .layui-icon { + margin-right: 4px; + font-size: 12px; + flex-shrink: 0; +} + +.return-btn span { + white-space: nowrap; +} + +.return-btn:active { + background: rgba(255, 255, 255, 0.3); +} + +/* 主容器 */ +.h5-container { + margin-top: 44px; + padding: 12px; +} + +/* 页面标题 */ +.page-title { + display: flex; + align-items: center; + padding: 12px; + background: #fff; + border-radius: 8px; + margin-bottom: 12px; + font-size: 16px; + font-weight: 600; + color: #333; +} + +.page-title .layui-icon { + font-size: 18px; + color: #409EFF; + margin-right: 8px; +} + +/* 搜索卡片 */ +.search-card { + background: #fff; + border-radius: 8px; + padding: 12px; + margin-bottom: 12px; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); +} + +.search-inputs { + display: flex; + gap: 8px; + margin-bottom: 12px; +} + +.search-inputs .layui-input { + width: 100%; + font-size: 14px; + border-radius: 4px; + border: 1px solid #e0e0e0; + +} + +.search-inputs .layui-input:focus { + border-color: #409EFF; +} + +.search-btns { + display: flex; + gap: 8px; +} + +.search-btns .layui-btn { + flex: 1; + font-size: 14px; + /* padding: 8px 12px; */ +} + +/* 列表容器 */ +.list-container { + display: flex; + flex-direction: column; + gap: 12px; +} + +/* 列表项卡片 */ +.list-item { + background: #fff; + border-radius: 8px; + padding: 16px; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); + position: relative; +} + +.list-item.selected { + border: 2px solid #409EFF; + background: #f0f7ff; +} + +.list-item.selected .item-header { + border-bottom-color: #d0e7ff; +} + +.item-header { + display: flex; + align-items: flex-start; + margin-bottom: 12px; + padding-bottom: 12px; + border-bottom: 1px solid #f0f0f0; +} + +.item-checkbox-wrapper { + margin-right: 12px; + margin-top: 2px; + flex-shrink: 0; + display: flex; + align-items: center; + justify-content: center; +} + +.item-checkbox { + width: 20px !important; + height: 20px !important; + cursor: pointer; + margin: 0 !important; + display: block !important; + visibility: visible !important; + opacity: 1 !important; + appearance: checkbox; + -webkit-appearance: checkbox; + -moz-appearance: checkbox; + position: relative; + z-index: 1; +} + +.item-content { + flex: 1; + display: flex; + align-items: flex-start; + gap: 12px; +} + +.item-number { + width: 28px; + height: 28px; + background: #f0f0f0; + border-radius: 4px; + display: flex; + align-items: center; + justify-content: center; + font-size: 13px; + font-weight: 600; + color: #666; + flex-shrink: 0; +} + +.item-basic-info { + flex: 1; + display: flex; + flex-direction: column; + gap: 8px; +} + +.info-row { + display: flex; + align-items: center; + flex-wrap: wrap; + gap: 8px; + line-height: 1.6; +} +.info-row-1 { + display: flex; + align-items: center; + justify-content: space-between !important; + flex-wrap: wrap; + gap: 8px; + line-height: 1.6; +} + +.info-row-item-1 { + margin-right: 10px; +} + + +.info-label { + font-size: 14px; + color: #999; + font-weight: normal; +} + +.info-value { + font-size: 14px; + color: #333; + font-weight: 500; +} + +.info-value.name-text, +.info-value.spec-text { + flex: 1; + word-wrap: break-word; + word-break: break-all; +} + +.type-tag { + display: inline-block; + padding: 2px 8px; + background: #e6f7ff; + color: #409EFF; + border-radius: 4px; + font-size: 13px; + font-weight: 600; + margin-right: 4px; +} + +.item-body { + margin-top: 12px; + padding-top: 12px; +} + +.form-row { + display: flex; + align-items: center; + margin-bottom: 12px; +} + +.form-row:last-child { + margin-bottom: 0; +} + +.form-label { + width: 80px; + font-size: 14px; + color: #666; + flex-shrink: 0; + text-align: left; +} + +.form-label.required::after { + content: '*'; + color: red; + margin-left: 2px; +} + +.form-input { + flex: 1; +} + +.form-input .layui-input, +.form-input .layui-textarea { + font-size: 14px; + border-radius: 4px; + border: 1px solid #e0e0e0; +} + +.form-input .layui-input:focus, +.form-input .layui-textarea:focus { + border-color: #409EFF; +} + +.form-input .layui-textarea { + min-height: 60px; + resize: none; +} + +/* 分页区域 */ +.pagination-box { + display: flex; + align-items: center; + justify-content: center; + gap: 16px; + padding: 16px; + background: #fff; + border-radius: 8px; + margin-top: 12px; +} + +.pagination-box .layui-btn { + min-width: 80px; + font-size: 14px; +} + +.pagination-box .layui-btn:disabled { + opacity: 0.5; + cursor: not-allowed; +} + +.page-info { + font-size: 14px; + color: #666; + min-width: 60px; + text-align: center; +} + +/* 底部按钮 */ +.btn-box { + position: fixed; + bottom: 0; + left: 0; + right: 0; + padding: 12px; + background: #fff; + border-top: 1px solid #e0e0e0; + display: flex; + gap: 12px; + z-index: 999; + box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05); +} + +.btn-box .layui-btn { + flex: 1; + height: 44px; + line-height: 44px; + font-size: 16px; + border-radius: 4px; +} + +/* 空状态 */ +.empty-state { + text-align: center; + padding: 60px 20px; + color: #999; + font-size: 14px; +} + +.empty-state .layui-icon { + font-size: 48px; + color: #d9d9d9; + margin-bottom: 16px; +} + +/* 加载状态 */ +.loading-state { + text-align: center; + padding: 40px 20px; + color: #999; + font-size: 14px; +} + +/* 响应式调整 */ +@media screen and (max-width: 375px) { + .form-label { + width: 70px; + font-size: 13px; + } +} + +/* 修复layui样式 */ +.layui-btn { + -webkit-tap-highlight-color: transparent; + touch-action: manipulation; +} + +input, textarea, select { + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; +} + +/* 防止iOS输入框缩放 */ +@media screen and (max-width: 768px) { + input[type="text"], + input[type="number"], + textarea, + select { + font-size: 16px !important; + } +} + +/* 确认弹框样式 */ +.confirm-dialog-content { + padding: 0; +} + +.confirm-title { + display: flex; + align-items: center; + padding: 16px; + border-bottom: 1px solid #f0f0f0; + background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); + color: #fff; + border-radius: 4px 4px 0 0; +} + +.confirm-title i { + color: #fff !important; +} + +.confirm-title span { + color: #fff !important; +} + +.confirm-tip { + padding: 12px 16px; + background: #fff3e0; + border-left: 3px solid #ff9800; + margin: 0 16px 16px 16px; + border-radius: 4px; + display: flex; + align-items: center; + gap: 8px; +} + +.confirm-tip i { + color: #ff9800; + font-size: 16px; +} + +.confirm-list { + max-height: 400px; + overflow-y: auto; +} + +.confirm-list-header { + padding: 12px 16px; + background: #f5f7fa; + font-weight: 600; + color: #333; + font-size: 14px; + border-bottom: 1px solid #e0e0e0; +} + +.confirm-list-body { + padding: 8px; +} + +.confirm-item { + display: flex; + align-items: flex-start; + padding: 12px; + margin-bottom: 8px; + background: #fff; + border: 1px solid #e0e0e0; + border-radius: 6px; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); + transition: all 0.3s; +} + +.confirm-item:hover { + box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1); + border-color: #409EFF; +} + +.confirm-item-number { + width: 28px; + height: 28px; + background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); + color: #fff; + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + font-size: 13px; + font-weight: 600; + flex-shrink: 0; + margin-right: 12px; +} + +.confirm-item-content { + flex: 1; + display: flex; + flex-direction: column; + gap: 6px; +} + +.confirm-item-row { + display: flex; + align-items: center; + flex-wrap: wrap; + gap: 8px; + line-height: 1.6; + font-size: 13px; +} + +.confirm-label { + color: #999; + font-weight: normal; + flex-shrink: 0; +} + +.confirm-value { + color: #333; + font-weight: 500; +} + +.confirm-value.highlight { + color: #409EFF; + font-weight: 600; + font-size: 14px; +} + +.type-badge { + display: inline-block; + padding: 2px 8px; + background: #e6f7ff; + color: #409EFF; + border-radius: 4px; + font-size: 12px; + font-weight: 600; +} + +/* 滚动条样式 */ +.confirm-list::-webkit-scrollbar { + width: 6px; +} + +.confirm-list::-webkit-scrollbar-track { + background: #f1f1f1; + border-radius: 3px; +} + +.confirm-list::-webkit-scrollbar-thumb { + background: #c1c1c1; + border-radius: 3px; +} + +.confirm-list::-webkit-scrollbar-thumb:hover { + background: #a8a8a8; +} + diff --git a/images/delete_icon.png b/images/delete_icon.png new file mode 100644 index 0000000..d8b99c9 Binary files /dev/null and b/images/delete_icon.png differ diff --git a/js/car_demand_plan/H5/demand_plan_apply..js b/js/car_demand_plan/H5/demand_plan_apply..js new file mode 100644 index 0000000..fb93280 --- /dev/null +++ b/js/car_demand_plan/H5/demand_plan_apply..js @@ -0,0 +1,978 @@ +// H5移动端 - 车辆需求计划申请页面 +let form, laydate, layer, upload; +let fileList = new Array(); +let addNum = 0; +let addNums = 1; + +// 页面初始化 +layui.use(['form', 'layer', 'laydate', 'upload'], function () { + form = layui.form; + layer = layui.layer; + laydate = layui.laydate; + upload = layui.upload; + + // 检查是否有从选择页面返回的数据 + checkSelectedData(); + + // 初始化日期选择器 + laydate.render({ + elem: '#needTime', + type: 'date' + }); + + // 表单提交 + form.on('submit(formData)', function (data) { + // 提交逻辑稍后处理 + + return false; + }); + + // 计划类型切换 + form.on('radio(type)', function (data) { + // 切换类型时清空已选数据(如果有) + + }); + + // 字符计数 + $('#remark').on('input', function () { + let length = $(this).val().length; + $('#charCount').text(length); + }); + + // 文件上传初始化 - 使用原生方式 + initFileUpload(); + + form.render(); + + // 优化下拉选择框宽度 + optimizeSelectWidth(); + + // 监听下拉框打开事件,确保宽度一致 + $(document).on('click', '.layui-form-select .layui-select-title', function () { + setTimeout(function () { + optimizeSelectWidth(); + // 确保搜索输入框可以正常使用 + ensureSearchInput(); + }, 100); + }); + + // 监听窗口大小改变 + $(window).on('resize', function () { + optimizeSelectWidth(); + }); + + // 监听下拉框关闭事件 + $(document).on('click', function (e) { + if (!$(e.target).closest('.layui-form-select').length) { + setTimeout(function () { + optimizeSelectWidth(); + }, 50); + } + }); + + // 不拦截layui的搜索事件,让layui自己处理过滤 + // layui会自动处理搜索过滤,我们只需要确保样式正确 +}); + +// 优化下拉选择框宽度,使选项框与选择框宽度一致 +function optimizeSelectWidth() { + $('.layui-form-select').each(function () { + const $select = $(this); + const selectWidth = $select.outerWidth(); + const $dl = $select.find('dl'); + + if ($dl.length > 0 && selectWidth > 0) { + // 统一设置下拉列表宽度与选择框一致,在选择框下方显示 + $dl.css({ + 'width': selectWidth + 'px', + 'min-width': selectWidth + 'px', + 'max-width': selectWidth + 'px', + 'left': '0px', + 'right': 'auto', + 'position': 'absolute' + }); + + // 确保所有选项项宽度为100%,文本可以换行 + $dl.find('dd').css({ + 'width': '100%', + 'box-sizing': 'border-box', + 'white-space': 'normal', + 'word-wrap': 'break-word', + 'word-break': 'break-all' + }); + } + }); +} + +// 确保搜索输入框正常显示和工作 +function ensureSearchInput() { + // 查找所有layui搜索输入框,只确保宽度正确,不干扰layui的过滤逻辑 + $('.layui-form-select dl input[type="text"], .layui-form-select dl input.layui-input').each(function () { + const $input = $(this); + const $dl = $input.closest('dl'); + + // 确保搜索输入框宽度正确 + if ($dl.length > 0) { + const dlWidth = $dl.width(); + $input.css('width', dlWidth + 'px'); + } + }); +} + +// 工程下拉选 +function getProList() { + let url = dataUrl + 'backstage/carType/getProListSelected'; + ajaxRequest(url, "POST", null, false, function () { + }, function (result) { + if (result.code === 200) { + setSelectData(result.data); + } + }, function (xhr, status, error) { + errorFn(xhr, status, error) + }, null); +} + +// 工程下拉选赋值 +function setSelectData(proList) { + let html = ''; + $.each(proList, function (index, item) { + html += '' + }) + $('#proId').empty().append(html); + layui.form.render(); +} + +// ========== 选择类型页面相关变量和函数 ========== +let selectPageNum = 1; +let selectPageSize = 10; +let selectTotalPages = 1; +let selectSelectedItems = []; // 选中的项目 +let selectAllItems = []; // 所有项目数据 + +// 选择类型 - 显示内嵌的选择页面 +function chooseFitType() { + // 获取当前计划类型 + const type = $('input[name="type"]:checked').val() || '1'; + + // 显示选择类型页面 + $('#selectTypePage').show(); + $('.h5-container').first().hide(); // 隐藏主表单容器 + $('.fixed-submit-btn').hide(); // 隐藏提交按钮 + + // 初始化选择类型页面 + initSelectTypePage(type); +} + +// 初始化选择类型页面 +function initSelectTypePage(type) { + // 重置数据 + selectPageNum = 1; + selectSelectedItems = []; + selectAllItems = []; + + // 如果有已选数据,加载到选中列表 + if (currentSelectedData && currentSelectedData.length > 0) { + selectSelectedItems = currentSelectedData.map(item => ({ ...item })); + } + + // 更新选中数量显示 + updateSelectSelectedCount(); + + // 加载数据 + loadSelectData(type); +} + +// 加载选择类型数据 +function loadSelectData(type) { + const id = parseInt(type) === 1 ? 2 : 3; + let url = dataUrl + "backstage/carType/getCarSelected"; + let params = { + pageNum: selectPageNum, + pageSize: selectPageSize, + encryptedData: JSON.stringify({ + name: $('#selectName').val(), + model: $('#selectModel').val(), + id: id, + }) + }; + + ajaxRequest(url, "GET", params, true, function () { + // loading + }, function (result) { + if (result.list && result.list.length > 0) { + selectAllItems = (result.list || []).map(item => { + // 检查是否在预选数据中 + const preselectedItem = selectSelectedItems.find(selected => String(selected.id) === String(item.id)); + return { + ...item, + backDate: preselectedItem ? (preselectedItem.backDate || preselectedItem.times || 0) : (item.backDate || item.times || 0), + carSpec: preselectedItem ? (preselectedItem.carSpec || '') : (item.carSpec || ''), + needNum: preselectedItem ? (preselectedItem.needNum || 0) : (item.needNum || 0), + remark: preselectedItem ? (preselectedItem.remark || preselectedItem.remarks || '') : (item.remark || item.remarks || '') + }; + }); + selectTotalPages = Math.ceil((result.total || 0) / selectPageSize); + renderSelectList(); + updateSelectPagination(); + updateSelectSelectedCount(); + } else { + showSelectEmptyState(); + } + }, function (xhr, status, error) { + errorFn(xhr, status, error); + showSelectEmptyState(); + }); +} + +// 渲染选择列表 +function renderSelectList() { + if (!selectAllItems || selectAllItems.length === 0) { + showSelectEmptyState(); + return; + } + + let html = ''; + selectAllItems.forEach((item, index) => { + const idStr = String(item.id); + const selectedItem = selectSelectedItems.find(selected => String(selected.id) === idStr); + const isSelected = !!selectedItem; + const itemNumber = (selectPageNum - 1) * selectPageSize + index + 1; + + const needNum = isSelected && selectedItem.needNum ? selectedItem.needNum : (item.needNum || ''); + const backDate = isSelected && selectedItem.backDate ? selectedItem.backDate : (item.backDate || item.times || ''); + const carSpec = isSelected && selectedItem.carSpec ? selectedItem.carSpec : (item.carSpec || ''); + const remark = isSelected && selectedItem.remark ? selectedItem.remark : (item.remark || item.remarks || ''); + + html += ` +
暂无数据
+x
x
' + displayName + '
' + + '暂无数据
+您还没选择需用车辆吊车类型
+请先添加机具类型后再执申请操作
+ +