createTask.vue 42 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451
  1. <template>
  2. <view class="container">
  3. <Watermark />
  4. <Step :step="currentStep" :stepsData="currentText" />
  5. <scroll-view class="content" scroll-y>
  6. <!-- 驳回意见提示 -->
  7. <view class="rejection-banner" v-if="rejectionInfo">
  8. <view class="rejection-icon">✕</view>
  9. <view class="rejection-text">驳回意见: {{ rejectionInfo }}</view>
  10. </view>
  11. <!-- 基本信息 -->
  12. <view class="form-section">
  13. <view class="form-item">
  14. <view class="form-label">
  15. <text class="required">*</text>
  16. <text>任务归属</text>
  17. </view>
  18. <view class="form-input picker-input" :class="{ placeholder: !formData.deptId }"
  19. @click="showPicker('任务归属', companyData)">
  20. {{ institutionDisplayText || '请选择任务归属' }}
  21. <image class="icon"
  22. src="https://ysrw-1395926010.cos.ap-chengdu.myqcloud.com/image/icon_more.png"></image>
  23. </view>
  24. </view>
  25. <view class="form-item">
  26. <view class="form-label">
  27. <text class="required">*</text>
  28. <text>归属项目</text>
  29. </view>
  30. <view class="form-input picker-input" :class="{ placeholder: !formData.projectId }"
  31. @click="showPicker('归属项目', companyList)">
  32. {{ belongingProjectDisplayText || '请选择归属项目' }}
  33. <image class="icon"
  34. src="https://ysrw-1395926010.cos.ap-chengdu.myqcloud.com/image/icon_more.png"></image>
  35. </view>
  36. </view>
  37. <!-- <view class="form-item">
  38. <view class="form-label">
  39. <text class="required">*</text>
  40. <text>业务员</text>
  41. </view>
  42. <view class="form-input picker-input" :class="{ placeholder: !formData.companyUserId }"
  43. @click="showPicker('业务员',userList)">
  44. {{ salesmanDisplayText || '请选择业务员' }}
  45. <image class="icon" src="https://ysrw-1395926010.cos.ap-chengdu.myqcloud.com/image/icon_more.png"></image>
  46. </view>
  47. </view> -->
  48. <view class="form-item">
  49. <view class="form-label">
  50. <text class="required">*</text>
  51. <text>产品代码</text>
  52. </view>
  53. <view class="form-input picker-input" :class="{ placeholder: !formData.productId }"
  54. @click="showPicker('产品代码', productList)">
  55. {{ productNameDisplayText || '请选择产品代码' }}
  56. <image class="icon"
  57. src="https://ysrw-1395926010.cos.ap-chengdu.myqcloud.com/image/icon_more.png"></image>
  58. </view>
  59. </view>
  60. <view class="form-item">
  61. <view class="form-label">
  62. <text class="required">*</text>
  63. <text>费用分摊</text>
  64. </view>
  65. <view class="form-input picker-input" :class="{ placeholder: !formData.costShareId }"
  66. @click="showPicker('费用分摊', companyData)">
  67. {{ costAllocationDisplayText || '请选择费用分摊主体' }}
  68. <image class="icon"
  69. src="https://ysrw-1395926010.cos.ap-chengdu.myqcloud.com/image/icon_more.png"></image>
  70. </view>
  71. </view>
  72. <view class="form-item">
  73. <view class="form-label">
  74. <text>添加任务备注</text>
  75. </view>
  76. <EvanSwitch v-model="formData.addRemark"></EvanSwitch>
  77. </view>
  78. <view class="form-item" v-if="formData.addRemark">
  79. <textarea class="form-textarea" v-model="formData.remark" placeholder="请输入任务备注" rows="4"></textarea>
  80. </view>
  81. <view class="form-item">
  82. <view class="form-label">
  83. <text class="required">*</text>
  84. <text>归属类型</text>
  85. </view>
  86. <view class="form-input picker-input" :class="{ placeholder: !formData.belongType }"
  87. @click="showPicker('归属类型', dictTypeColumns)">
  88. {{ belongTypeDisplayText || '请选择归属类型' }}
  89. <image class="icon"
  90. src="https://ysrw-1395926010.cos.ap-chengdu.myqcloud.com/image/icon_more.png"></image>
  91. </view>
  92. </view>
  93. <view class="form-item">
  94. <view class="form-label">
  95. <text class="required">*</text>
  96. <text>任务类型</text>
  97. </view>
  98. <view class="form-input picker-input" :class="{ placeholder: !formData.taskType }"
  99. @click="showPicker('任务类型', taskTypeColumns)">
  100. {{ taskTypeDisplayText || '请选择任务类型' }}
  101. <image class="icon"
  102. src="https://ysrw-1395926010.cos.ap-chengdu.myqcloud.com/image/icon_more.png"></image>
  103. </view>
  104. </view>
  105. <!-- 任务类型目标 - 公开课和问卷调查使用选项列表 -->
  106. <view class="form-item"
  107. v-if="formData.taskType === '1' || formData.taskType === '9'">
  108. <view class="form-label">
  109. <view class="form-option" :class="{ 'selected': item.id == formData.targetId }"
  110. v-for="(item, index) in selectionList" :key="index" @click="selectOption(item)">{{
  111. item.title
  112. }}</view>
  113. </view>
  114. </view>
  115. <!-- 任务类型目标 - 用药调研使用弹出选择器 -->
  116. <view class="form-item"
  117. v-if="formData.taskType === '8'">
  118. <view class="form-label">
  119. <text class="required">*</text>
  120. <text>任务类型目标</text>
  121. </view>
  122. <view class="form-input picker-input" :class="{ placeholder: !formData.targetId }"
  123. @click="showPicker('任务类型目标', selectionList)">
  124. {{ formData.targetDisplayText || '请选择任务类型目标' }}
  125. <image class="icon"
  126. src="https://ysrw-1395926010.cos.ap-chengdu.myqcloud.com/image/icon_more.png"></image>
  127. </view>
  128. </view>
  129. <view class="form-item">
  130. <view class="form-label">
  131. <text class="required">*</text>
  132. <text>计划开始时间</text>
  133. </view>
  134. <view class="form-input picker-input" :class="{ placeholder: !formData.planStartTime }"
  135. @click="showStartTimePicker = true">
  136. {{ formData.planStartTime || '请选择计划开始时间' }}
  137. <image class="icon"
  138. src="https://ysrw-1395926010.cos.ap-chengdu.myqcloud.com/image/icon_more.png"></image>
  139. </view>
  140. </view>
  141. <view class="form-item">
  142. <view class="form-label">
  143. <text class="required">*</text>
  144. <text>计划结束时间</text>
  145. </view>
  146. <view class="form-input picker-input" :class="{ placeholder: !formData.planEndTime }"
  147. @click="showEndTimePicker = true">
  148. {{ formData.planEndTime || '请选择计划结束时间' }}
  149. <image class="icon"
  150. src="https://ysrw-1395926010.cos.ap-chengdu.myqcloud.com/image/icon_more.png"></image>
  151. </view>
  152. </view>
  153. </view>
  154. </scroll-view>
  155. <view class="next-button" @click="toNext">下一步</view>
  156. <u-picker :title='pickerTitle' :show="showPickerVisible" confirmColor='#576B95' ref="uPicker"
  157. :columns="pickerData" @confirm="confirm" @cancel="cancel">
  158. </u-picker>
  159. <u-datetime-picker :show="showStartTimePicker" v-model="startTimeValue" mode="datetime" confirmColor='#576B95'
  160. @confirm="onStartTimeConfirm" @cancel="showStartTimePicker = false">
  161. </u-datetime-picker>
  162. <u-datetime-picker :show="showEndTimePicker" v-model="endTimeValue" mode="datetime" confirmColor='#576B95'
  163. @confirm="onEndTimeConfirm" @cancel="showEndTimePicker = false">
  164. </u-datetime-picker>
  165. <u-popup :show="showBelongingPopup" mode="bottom" round="20" @close="closePopup" closeable>
  166. <view class="popup-content p32">
  167. <view class="popup-header">
  168. <text class="title">归属项目</text>
  169. </view>
  170. <view class="search-box">
  171. <image class="icon" src="https://ysrw-1395926010.cos.ap-chengdu.myqcloud.com/image/search.png">
  172. </image>
  173. <u-input v-model="searchKeyword" placeholder="请输入归属项目" border="none" clearable />
  174. </view>
  175. <scroll-view scroll-y class="project-list">
  176. <view v-for="(project, index) in filteredProjects" :key="index" class="project-item"
  177. :class="{ active: selectedIndex === index }" @tap="selectProject(project, index)">
  178. <text class="project-name">{{ project.name }}</text>
  179. <image class="icon"
  180. src="https://ysrw-1395926010.cos.ap-chengdu.myqcloud.com/image/icon_right.png"></image>
  181. </view>
  182. </scroll-view>
  183. </view>
  184. </u-popup>
  185. <u-popup :show="showTaskPopup" mode="bottom" round="16" @close="showTaskPopup = false" safeAreaInsetBottom>
  186. <view class="popup-content">
  187. <view class="popup-header">
  188. <text class="popup-title">任务归属</text>
  189. <image class="close-icon"
  190. src="https://ysrw-1395926010.cos.ap-chengdu.myqcloud.com/image/icon_cross.png"
  191. @click="showTaskPopup = false"></image>
  192. </view>
  193. <view class="two-level-container">
  194. <scroll-view class="primary-list" scroll-y>
  195. <view v-for="(item, index) in primaryOptions" :key="index" class="primary-item"
  196. :class="{ 'primary-active': activePrimaryIndex === index }"
  197. @click="handlePrimarySelect(index)">
  198. <text class="primary-text">{{ item.name }}</text>
  199. </view>
  200. </scroll-view>
  201. <scroll-view class="secondary-list" scroll-y>
  202. <view v-for="(subItem, subIndex) in currentSecondaryOptions" :key="subIndex"
  203. class="secondary-item" :class="{ 'secondary-active': selectedSecondaryItem === subItem }"
  204. @click="handleSecondarySelect(subItem)">
  205. <text class="secondary-text">{{ subItem }}</text>
  206. <u-icon v-if="selectedSecondaryItem === subItem" name="checkbox-mark" color="#2979ff"
  207. size="20" />
  208. </view>
  209. </scroll-view>
  210. </view>
  211. <view class="popup-footer">
  212. <button class="confirm-btn" @click="handleConfirm">确定</button>
  213. </view>
  214. </view>
  215. </u-popup>
  216. </view>
  217. </template>
  218. <script>
  219. import {
  220. companyUserList
  221. } from '@/api/task.js';
  222. import {
  223. getProjectTypeList,
  224. company,
  225. getAllData, //获取项目所有数据
  226. queryAllProduct, //获取公司所有产品
  227. queryAllData, //获取任务类型
  228. getTaskLiveList, //获取公开课选项
  229. getDrugResearchList, //获取用药调研选项
  230. getSurveyTaskList //获取问卷调查选项
  231. } from '@/api/task.js';
  232. import utils from '@/utils/common.js'
  233. import Step from '@/pages_task/components/step.vue'
  234. import EvanSwitch from '@/components/evan-switch.vue'
  235. export default {
  236. components: {
  237. Step,
  238. EvanSwitch
  239. },
  240. data() {
  241. return {
  242. taskTypeDict: [], //任务类型字典
  243. taskType: [], //任务类型
  244. taskTypeOriginalData: [], //任务类型原始数据(包含dictLabel和dictValue)
  245. companyList: [], //归属项目
  246. projectData: [], //项目数据(持久化存储)
  247. productList: [], //产品列表
  248. companyData: [],
  249. userInfo: {},
  250. showTaskPopup: false,
  251. primaryOptions: [{
  252. id: 1,
  253. name: '中药事业部',
  254. children: ['中药一部', '中药二部', '中药三部', '中药四部']
  255. },
  256. {
  257. id: 2,
  258. name: '事业1组',
  259. children: ['事业1组-项目部', '事业1组-市场部', '事业1组-技术部']
  260. },
  261. ],
  262. activePrimaryIndex: 0,
  263. currentSecondaryOptions: [],
  264. selectedSecondaryItem: '',
  265. selectedPrimaryItem: null,
  266. selectedIndex: -1,
  267. selectedProject: null,
  268. belongingprojects: [{
  269. name: '学术交流项目'
  270. },
  271. {
  272. name: '科学调研项目'
  273. },
  274. {
  275. name: '2026年1月医学研究项目'
  276. },
  277. {
  278. name: '2026年2月医学研究项目'
  279. },
  280. {
  281. name: '2026年3月医学研究项目'
  282. }
  283. ],
  284. searchKeyword: '',
  285. showBelongingPopup: false,
  286. showPickerVisible: false,
  287. costColumns: [
  288. ['主体1', '主体2', '主体3'],
  289. ],
  290. taskTypeColumns: [
  291. // ['类型1', '类型2', '类型3'],
  292. ],
  293. currentStep: 1,
  294. currentText: [{
  295. id: 1,
  296. stepNumber: 1,
  297. title: '填写任务'
  298. },
  299. {
  300. id: 2,
  301. stepNumber: 2,
  302. title: '选择客户'
  303. },
  304. {
  305. id: 3,
  306. stepNumber: 3,
  307. title: '积分设置'
  308. }
  309. ],
  310. rejectionInfo: '',
  311. formData: {
  312. costShareId: '',
  313. planStartTime: '',
  314. planEndTime: '',
  315. belongType: '',
  316. deptId: '',
  317. projectId: '',
  318. productId: '',
  319. taskType: '',
  320. targetId: '',
  321. taskTypeId: '',
  322. // companyUserId: '',
  323. addRemark: false,
  324. remark: '',
  325. taskTypeDisplayText: '',
  326. belongTypeDisplayText: ''
  327. },
  328. selectedType: null,
  329. originalCompanyData: null,
  330. pickerTitle: '默认标题',
  331. pickerData: [],
  332. companyId: '',
  333. showStartTimePicker: false,
  334. showEndTimePicker: false,
  335. startTimeValue: Date.now(), // 使用时间戳而不是Date对象
  336. endTimeValue: Date.now(), // 使用时间戳而不是Date对象
  337. selectionList: [], //任务类型选项
  338. }
  339. },
  340. onLoad: async function (options) {
  341. try {
  342. this.taskTypeDict = await utils.getDicts("task_type"); //任务类型
  343. this.belongTypeList = await utils.getDicts("task_belong_type"); //归属类型
  344. } catch (e) {
  345. console.log('获取字典数据失败:', e)
  346. }
  347. this.userInfo = uni.getStorageSync("userInfo") || ''
  348. if (options.rejectionInfo) {
  349. this.rejectionInfo = decodeURIComponent(options.rejectionInfo)
  350. }
  351. // 获取用户信息
  352. // 加载信息
  353. this.companyId = this.userInfo.companyId || 1
  354. // 设置默认日期为当天
  355. // this.formData.planStartTime = this.formatDateTime(new Date());
  356. // this.formData.planEndTime = this.formatDateTime(new Date());
  357. console.log('this.userInfo.companyId:', this.userInfo.companyId)
  358. this.getTaskLiveList()//获取公开课选项
  359. },
  360. computed: {
  361. taskTypeDisplayText() {
  362. console.log('计算taskTypeDisplayText, formData.taskType:', this.formData.taskType);
  363. console.log('计算taskTypeDisplayText, taskTypeOriginalData:', this.taskTypeOriginalData);
  364. if (!this.formData.taskType || !this.taskTypeOriginalData) {
  365. return '';
  366. }
  367. const selectedType = this.taskTypeOriginalData.find(item => item.dictValue === this.formData.taskType);
  368. console.log('找到的selectedType:', selectedType);
  369. return selectedType ? selectedType.dictLabel : '';
  370. },
  371. institutionDisplayText() {
  372. if (!this.formData.deptId || !this.companyData) {
  373. return '';
  374. }
  375. const selectedItem = this.companyData.find(item => item.deptId === this.formData.deptId);
  376. return selectedItem ? selectedItem.deptName : '';
  377. },
  378. costAllocationDisplayText() {
  379. if (!this.formData.costShareId || !this.companyData) {
  380. return '';
  381. }
  382. const selectedItem = this.companyData.find(item => item.deptId === this.formData.costShareId);
  383. return selectedItem ? selectedItem.deptName : '';
  384. },
  385. belongingProjectDisplayText() {
  386. console.log('计算belongingProjectDisplayText:', this.formData.projectId, this.projectData);
  387. if (!this.formData.projectId || !this.projectData) {
  388. console.log('formData.projectId或projectData为空');
  389. return '';
  390. }
  391. const selectedItem = this.projectData.find(item => item.id === this.formData.projectId);
  392. console.log('找到的项目:', selectedItem);
  393. return selectedItem ? selectedItem.projectName : '';
  394. },
  395. productNameDisplayText() {
  396. if (!this.formData.productId || !this.productList) {
  397. return '';
  398. }
  399. const selectedItem = this.productList.find(item => item.id === this.formData.productId);
  400. return selectedItem ? selectedItem.productName : '';
  401. },
  402. belongTypeDisplayText() {
  403. if (!this.formData.belongType || !this.belongTypeList) {
  404. return '';
  405. }
  406. const selectedItem = this.belongTypeList.find(item => item.dictValue === this.formData.belongType);
  407. return selectedItem ? selectedItem.dictLabel : '';
  408. },
  409. // salesmanDisplayText() {
  410. // if (!this.formData.companyUserId || !this.userList) {
  411. // return '';
  412. // }
  413. // const selectedItem = this.userList.find(item => item.userId === this.formData.companyUserId);
  414. // return selectedItem ? selectedItem.nickName : '';
  415. // }
  416. },
  417. methods: {
  418. selectOption(item) {
  419. this.formData.targetId = item.id
  420. },
  421. // 获取用药调研选项
  422. getDrugResearchList() {
  423. getDrugResearchList(this.userInfo.companyId).then(res => {
  424. if (res.code === 200) {
  425. console.log('获取用药调研选项:', res)
  426. this.selectionList = res.data.rows || []
  427. }
  428. })
  429. },
  430. // 获取问卷调查选项
  431. getSurveyTaskList() {
  432. getSurveyTaskList(this.userInfo.companyId).then(res => {
  433. if (res.code === 200) {
  434. console.log('获取问卷调查选项:', res)
  435. this.selectionList = res.data.rows || []
  436. }
  437. })
  438. },
  439. // 获取公开课选项
  440. getTaskLiveList() {
  441. getTaskLiveList(this.userInfo.companyId).then(res => {
  442. if (res.code === 200) {
  443. console.log('获取公开课选项:', res)
  444. this.selectionList = res.rows || []
  445. }
  446. })
  447. },
  448. getProjectTypeList() {
  449. let params = {
  450. companyId: this.userInfo.companyId || '',
  451. // projectId: this.formData.projectId || '',
  452. deptId: this.formData.deptId || '',
  453. }
  454. return getProjectTypeList(params).then(res => {
  455. if (res.code === 200) {
  456. const rows = Array.isArray(res.rows) ? res.rows : []
  457. const first = rows[0] || {}
  458. const idSet = new Set()
  459. String(first.taskTypeIds || '').split(',').forEach(id => {
  460. const t = String(id || '').trim()
  461. if (t) idSet.add(t)
  462. })
  463. const filtered = (this.taskTypeDict || []).filter(d => idSet.has(String(d.dictValue)))
  464. this.taskTypeOriginalData = filtered
  465. this.taskTypeColumns = [filtered.map(d => d.dictLabel)]
  466. }
  467. })
  468. },
  469. //公司下的用户列表
  470. async companyUserList() {
  471. return new Promise((resolve, reject) => {
  472. let data = {
  473. companyId: this.userInfo.companyId || '',
  474. }
  475. companyUserList(data).then(res => {
  476. if (res.code === 200) {
  477. // 处理公司所有产品数据
  478. this.userList = res.rows || []
  479. console.log('company接口返回数据:', res)
  480. }
  481. resolve(res);
  482. }).catch(err => {
  483. console.error('获取公司下的用户列表失败:', err);
  484. reject(err);
  485. });
  486. });
  487. },
  488. //任务类型
  489. queryAllData() {
  490. return new Promise((resolve, reject) => {
  491. if (!this.formData.productId) {
  492. uni.showToast({
  493. title: '请先选择产品',
  494. icon: 'none'
  495. })
  496. resolve();
  497. return
  498. }
  499. let data = {
  500. companyId: this.userInfo.companyId || '',
  501. deptId: this.formData.deptId || '',
  502. productId: this.formData.productId || '',
  503. }
  504. queryAllData(data).then(res => {
  505. if (res.code === 200) {
  506. // 处理任务类型
  507. this.taskType = res.data || []
  508. console.log('company接口返回数据:', res)
  509. // 处理taskTypeIds,获取对应的字典数据
  510. if (res.data && res.data.length > 0) {
  511. const firstData = res.data[0];
  512. if (firstData.taskTypeIds) {
  513. // 分割taskTypeIds为数组
  514. const taskTypeIdsArray = firstData.taskTypeIds.split(',');
  515. // 从字典表中筛选出对应的项
  516. const filteredTaskTypes = this.taskTypeDict.filter(item =>
  517. taskTypeIdsArray.includes(item.dictValue)
  518. );
  519. // 保存原始数据(包含dictLabel和dictValue)
  520. this.taskTypeOriginalData = filteredTaskTypes;
  521. // 提取dictLabel并放到taskTypeColumns中
  522. const taskTypeLabels = filteredTaskTypes.map(item => item.dictLabel);
  523. this.taskTypeColumns = [taskTypeLabels];
  524. console.log('处理后的taskTypeColumns:', this.taskTypeColumns);
  525. console.log('任务类型原始数据:', this.taskTypeOriginalData);
  526. }
  527. }
  528. }
  529. resolve(res);
  530. }).catch(err => {
  531. console.error('获取任务类型失败:', err);
  532. reject(err);
  533. });
  534. });
  535. },
  536. //获取公司所有产品
  537. async queryAllProduct() {
  538. return new Promise((resolve, reject) => {
  539. let data = {
  540. companyId: this.userInfo.companyId || '',
  541. projectId: this.formData.projectId
  542. }
  543. queryAllProduct(data).then(res => {
  544. if (res.code === 200) {
  545. // 处理公司所有产品数据
  546. this.productList = res.data || []
  547. console.log('company接口返回数据:', res)
  548. }
  549. resolve(res);
  550. }).catch(err => {
  551. console.error('获取公司所有产品失败:', err);
  552. reject(err);
  553. });
  554. });
  555. },
  556. // 归属项目
  557. async getAllData() {
  558. return new Promise((resolve, reject) => {
  559. let data = {
  560. companyId: this.userInfo.companyId || '',
  561. deptId: this.userInfo.deptId || '',
  562. productCode: this.userInfo.productCode || ''
  563. }
  564. getAllData(data).then(res => {
  565. if (res.code === 200) {
  566. // 处理公司项目设置列表数据
  567. this.companyList = res.data || []
  568. // 保存项目数据用于显示
  569. this.projectData = res.data || []
  570. console.log('company接口返回数据:', res)
  571. console.log('companyList数据结构:', this.companyList)
  572. }
  573. resolve(res);
  574. }).catch(err => {
  575. console.error('获取公司项目设置失败:', err);
  576. reject(err);
  577. });
  578. });
  579. },
  580. async company() {
  581. return new Promise((resolve, reject) => {
  582. try {
  583. uni.showLoading({
  584. title: '加载中...'
  585. })
  586. // 调用company接口获取公司项目设置列表
  587. // this.companyId
  588. company(this.userInfo.companyId).then(companyRes => {
  589. uni.hideLoading()
  590. if (companyRes.code === 200) {
  591. // 处理公司项目设置列表数据
  592. this.companyData = companyRes.data || []
  593. console.log('company接口返回数据:', companyRes)
  594. // 这里可以根据接口返回的数据进行页面初始化,比如填充项目列表
  595. }
  596. resolve(companyRes);
  597. }).catch(e => {
  598. uni.hideLoading()
  599. console.error('加载信息失败', e)
  600. uni.showToast({
  601. title: '网络错误',
  602. icon: 'none'
  603. })
  604. reject(e);
  605. });
  606. } catch (e) {
  607. uni.hideLoading()
  608. console.error('加载信息失败', e)
  609. uni.showToast({
  610. title: '网络错误',
  611. icon: 'none'
  612. })
  613. reject(e);
  614. }
  615. });
  616. },
  617. submitInfo() {
  618. info(this.userInfo.companyId).then(res => {
  619. if (res.code === 200) {
  620. console.log('公司项目设置:', res.data);
  621. // 处理公司项目设置数据
  622. }
  623. }).catch(err => {
  624. console.error('获取公司项目设置失败:', err);
  625. });
  626. },
  627. handlePrimarySelect(index) {
  628. this.activePrimaryIndex = index;
  629. this.currentSecondaryOptions = this.primaryOptions[index].children || [];
  630. this.selectedSecondaryItem = '';
  631. },
  632. handleSecondarySelect(item) {
  633. this.selectedSecondaryItem = item;
  634. this.selectedPrimaryItem = this.primaryOptions[this.activePrimaryIndex];
  635. },
  636. handleConfirm() {
  637. if (this.selectedSecondaryItem) {
  638. const displayText = `${this.selectedPrimaryItem.name} > ${this.selectedSecondaryItem}`;
  639. this.formData.belongType = displayText;
  640. this.showTaskPopup = false;
  641. } else {
  642. uni.showToast({
  643. title: '请选择二级部门',
  644. icon: 'none'
  645. });
  646. }
  647. },
  648. closePopup() {
  649. this.showBelongingPopup = false;
  650. this.searchKeyword = '';
  651. this.selectedIndex = -1;
  652. },
  653. selectProject(project, index) {
  654. this.selectedIndex = index;
  655. this.selectedProject = project;
  656. this.formData.belongingProject = project.name;
  657. setTimeout(() => {
  658. this.showBelongingPopup = false;
  659. this.searchKeyword = '';
  660. this.selectedIndex = -1;
  661. }, 300);
  662. },
  663. async showPicker(title, data) {
  664. // 根据不同的title调用对应的请求方法
  665. if (title === '任务归属' || title === '费用分摊') {
  666. // 调用company()获取任务归属和费用分摊数据
  667. await this.company();
  668. data = this.companyData;
  669. } else if (title === '归属项目') {
  670. // 调用getAllData()获取归属项目数据
  671. await this.getAllData();
  672. data = this.companyList;
  673. console.log('归属项目数据:', data);
  674. } else if (title === '产品代码') {
  675. // 调用queryAllProduct()获取产品代码数据
  676. await this.queryAllProduct();
  677. data = this.productList;
  678. } else if (title === '任务类型') {
  679. // queryAllData()获取任务类型数据
  680. // await this.queryAllData();
  681. await this.getProjectTypeList();
  682. // 使用处理后的taskTypeColumns作为数据
  683. data = this.taskTypeColumns;
  684. console.log('任务类型数据:', data);
  685. } else if (title === '任务类型目标') {
  686. // 任务类型目标数据使用传入的selectionList
  687. console.log('任务类型目标数据:', data);
  688. } else if (title === '归属类型') {
  689. // 归属类型数据已经在onLoad中获取
  690. data = this.belongTypeList;
  691. console.log('归属类型数据:', data);
  692. } else if (title === '业务员') {
  693. // 调用companyUserList()获取业务员数据
  694. await this.companyUserList();
  695. data = this.userList;
  696. console.log('业务员数据:', data);
  697. }
  698. // 处理任务归属和费用分摊数据,将deptStr作为显示文本
  699. if ((title === '任务归属' || title === '费用分摊') && data && data.length > 0) {
  700. // 转换为picker需要的格式
  701. this.pickerData = [data.map(item => item.deptName)]
  702. // 保存原始数据,用于后续获取deptId
  703. this.originalCompanyData = data
  704. } else if (title === '归属项目' && data && data.length > 0) {
  705. // 处理归属项目数据,将projectName作为显示文本
  706. this.pickerData = [data.map(item => item.projectName)]
  707. // 保存原始数据,用于后续获取productId
  708. this.originalCompanyData = data
  709. } else if (title === '产品代码' && data && data.length > 0) {
  710. // 处理产品代码数据,将productName作为显示文本
  711. this.pickerData = [data.map(item => item.productName)]
  712. // 保存原始数据,用于后续获取productCode
  713. this.originalCompanyData = data
  714. } else if (title === '归属类型' && data && data.length > 0) {
  715. // 处理归属类型数据,将dictLabel作为显示文本
  716. this.pickerData = [data.map(item => item.dictLabel)]
  717. // 保存原始数据,用于后续获取dictType
  718. this.originalCompanyData = data
  719. } else if (title === '业务员' && data && data.length > 0) {
  720. // 处理业务员数据,将nickName作为显示文本
  721. this.pickerData = [data.map(item => item.nickName)]
  722. // 保存原始数据,用于后续获取userId
  723. this.originalCompanyData = data
  724. } else if (title === '任务类型目标' && data && data.length > 0) {
  725. // 处理任务类型目标数据,将title作为显示文本
  726. this.pickerData = [data.map(item => item.title)]
  727. // 保存原始数据,用于后续获取id
  728. this.originalCompanyData = data
  729. } else {
  730. this.pickerData = data
  731. this.originalCompanyData = null
  732. }
  733. this.pickerTitle = title
  734. console.log('打开picker, pickerTitle:', this.pickerTitle);
  735. console.log('pickerData:', this.pickerData);
  736. this.showPickerVisible = true
  737. },
  738. confirm(e) {
  739. console.log('confirm事件返回值:', e);
  740. console.log('pickerTitle:', this.pickerTitle);
  741. console.log('e.value:', e.value);
  742. if (e.value && e.value.length > 0) {
  743. if (this.pickerTitle === '费用分摊') {
  744. // e.value[0]是选中的文本值(deptName)
  745. const selectedDeptStr = e.value[0];
  746. console.log('选中的费用分摊文本:', selectedDeptStr);
  747. console.log('originalCompanyData:', this.originalCompanyData);
  748. // 从originalCompanyData中找到对应的项
  749. const selectedItem = this.originalCompanyData.find(item => item.deptName === selectedDeptStr);
  750. if (selectedItem) {
  751. // 保存deptId到表单(存储id值)
  752. this.formData.costShareId = selectedItem.deptId;
  753. console.log('设置formData.costShareId为:', selectedItem.deptId);
  754. } else {
  755. this.formData.costShareId = '';
  756. console.log('未找到对应的费用分摊');
  757. }
  758. } else if (this.pickerTitle === '任务类型') {
  759. // e.value[0]是选中的文本值(dictLabel)
  760. const selectedLabel = e.value[0];
  761. console.log('选中的任务类型文本:', selectedLabel);
  762. console.log('taskTypeOriginalData:', this.taskTypeOriginalData);
  763. // 从taskTypeOriginalData中找到对应的项
  764. const selectedType = this.taskTypeOriginalData.find(item => item.dictLabel === selectedLabel);
  765. if (selectedType) {
  766. // 从this.taskType中找到与当前项目匹配的配置对象
  767. this.formData.taskType = selectedType.dictValue;
  768. this.formData.taskTypeId = selectedType.dictValue || '';
  769. this.formData.taskTypeDisplayText = this.taskTypeDisplayText;
  770. if (selectedType.dictValue === '9') {
  771. this.getSurveyTaskList();//问卷调查
  772. } else if (selectedType.dictValue === '8') {
  773. this.getDrugResearchList();//用药调研
  774. } else if (selectedType.dictValue === '1') {
  775. this.getTaskLiveList();//公开课
  776. }
  777. this.selectedType = selectedType;
  778. } else { }
  779. } else if (this.pickerTitle === '任务归属' && this.originalCompanyData) {
  780. // e.value[0]是选中的文本值(deptName)
  781. const selectedDeptStr = e.value[0];
  782. console.log('选中的任务归属文本:', selectedDeptStr);
  783. console.log('originalCompanyData:', this.originalCompanyData);
  784. // 从originalCompanyData中找到对应的项
  785. const selectedItem = this.originalCompanyData.find(item => item.deptName === selectedDeptStr);
  786. if (selectedItem) {
  787. // 保存deptId到表单(存储id值)
  788. this.formData.deptId = selectedItem.deptId;
  789. console.log('设置formData.deptId为:', selectedItem.deptId);
  790. } else { }
  791. } else if (this.pickerTitle === '归属项目' && this.originalCompanyData) {
  792. // e.value[0]是选中的文本值(projectName)
  793. const selectedProjectName = e.value[0];
  794. console.log('选中的归属项目文本:', selectedProjectName);
  795. console.log('originalCompanyData:', this.originalCompanyData);
  796. // 从originalCompanyData中找到对应的项
  797. const selectedItem = this.originalCompanyData.find(item => item.projectName ===
  798. selectedProjectName);
  799. if (selectedItem) {
  800. // 保存id到表单(存储id值)
  801. this.formData.projectId = selectedItem.id;
  802. // 保存productId到表单
  803. this.formData.productId = selectedItem.productId;
  804. this.formData.belongTypeDisplayText = this.belongingProjectDisplayText;
  805. console.log('设置formData.projectId为:', selectedItem.id);
  806. } else { }
  807. } else if (this.pickerTitle === '产品代码' && this.originalCompanyData) {
  808. // e.value[0]是选中的文本值(productName)
  809. const selectedProductName = e.value[0];
  810. console.log('选中的产品代码文本:', selectedProductName);
  811. console.log('originalCompanyData:', this.originalCompanyData);
  812. // 从originalCompanyData中找到对应的项
  813. const selectedItem = this.originalCompanyData.find(item => item.productName ===
  814. selectedProductName);
  815. if (selectedItem) {
  816. // 保存id到表单
  817. this.formData.productId = selectedItem.id;
  818. // 保存id用于获取任务类型
  819. console.log('设置formData.productId为:', selectedItem.id);
  820. } else {
  821. }
  822. } else if (this.pickerTitle === '归属类型' && this.originalCompanyData) {
  823. // e.value[0]是选中的文本值(dictLabel)
  824. const selectedLabel = e.value[0];
  825. console.log('选中的归属类型文本:', selectedLabel);
  826. console.log('originalCompanyData:', this.originalCompanyData);
  827. // 从originalCompanyData中找到对应的项
  828. const selectedItem = this.originalCompanyData.find(item => item.dictLabel === selectedLabel);
  829. if (selectedItem) {
  830. // 保存dictValue到表单的belongType字段
  831. this.formData.belongType = selectedItem.dictValue;
  832. console.log('设置formData.belongType为:', selectedItem.dictValue);
  833. } else {
  834. console.log('未找到对应的归属类型');
  835. }
  836. } else if (this.pickerTitle === '任务类型目标' && this.originalCompanyData) {
  837. // e.value[0]是选中的文本值(title)
  838. const selectedTitle = e.value[0];
  839. console.log('选中的任务类型目标文本:', selectedTitle);
  840. console.log('originalCompanyData:', this.originalCompanyData);
  841. // 从originalCompanyData中找到对应的项
  842. const selectedItem = this.originalCompanyData.find(item => item.title === selectedTitle);
  843. if (selectedItem) {
  844. // 保存id到表单的targetId字段
  845. this.formData.targetId = selectedItem.id;
  846. // 保存显示文本
  847. this.formData.targetDisplayText = selectedTitle;
  848. console.log('设置formData.targetId为:', selectedItem.id);
  849. } else {
  850. console.log('未找到对应的任务类型目标');
  851. }
  852. }
  853. // else if (this.pickerTitle === '业务员' && this.originalCompanyData) {
  854. // // e.value[0]是选中的文本值(nickName)
  855. // const selectedUserName = e.value[0];
  856. // console.log('选中的业务员文本:', selectedUserName);
  857. // console.log('originalCompanyData:', this.originalCompanyData);
  858. // // 从originalCompanyData中找到对应的项
  859. // const selectedItem = this.originalCompanyData.find(item => item.nickName === selectedUserName);
  860. // if (selectedItem) {
  861. // // 保存userId到表单的companyUserId字段
  862. // this.formData.companyUserId = selectedItem.userId;
  863. // console.log('设置formData.companyUserId为:', selectedItem.userId);
  864. // } else {
  865. // console.log('未找到对应的业务员');
  866. // }
  867. // }
  868. }
  869. this.showPickerVisible = false
  870. },
  871. cancel() {
  872. this.showPickerVisible = false
  873. },
  874. toNext() {
  875. // 表单验证
  876. if (!this.formData.deptId) {
  877. uni.showToast({
  878. title: '请选择任务归属',
  879. icon: 'none'
  880. })
  881. return
  882. }
  883. if (!this.formData.projectId) {
  884. uni.showToast({
  885. title: '请选择归属项目',
  886. icon: 'none'
  887. })
  888. return
  889. }
  890. if (!this.formData.productId) {
  891. uni.showToast({
  892. title: '请选择产品代码',
  893. icon: 'none'
  894. })
  895. return
  896. }
  897. if (!this.formData.costShareId) {
  898. uni.showToast({
  899. title: '请选择费用分摊',
  900. icon: 'none'
  901. })
  902. return
  903. }
  904. if (!this.formData.belongType) {
  905. uni.showToast({
  906. title: '请选择归属类型',
  907. icon: 'none'
  908. })
  909. return
  910. }
  911. if (!this.formData.taskType) {
  912. uni.showToast({
  913. title: '请选择任务类型',
  914. icon: 'none'
  915. })
  916. return
  917. }
  918. if (!this.formData.targetId && ['1', '8', '9'].includes(this.selectedType.dictValue)) {
  919. uni.showToast({
  920. title: '请选择任务类型目标',
  921. icon: 'none'
  922. })
  923. return
  924. }
  925. if (!this.formData.planStartTime) {
  926. uni.showToast({
  927. title: '请选择计划开始时间',
  928. icon: 'none'
  929. })
  930. return
  931. }
  932. if (!this.formData.planEndTime) {
  933. uni.showToast({
  934. title: '请选择计划结束时间',
  935. icon: 'none'
  936. })
  937. return
  938. }
  939. // 验证计划开始时间不能晚于计划结束时间
  940. const startTime = new Date(this.formData.planStartTime);
  941. const endTime = new Date(this.formData.planEndTime);
  942. if (startTime > endTime) {
  943. uni.showToast({
  944. title: '计划开始时间不能晚于计划结束时间',
  945. icon: 'none'
  946. })
  947. return
  948. }
  949. // 如果开启了任务备注,则备注为必填
  950. if (this.formData.addRemark && !this.formData.remark) {
  951. uni.showToast({
  952. title: '请输入任务备注',
  953. icon: 'none'
  954. })
  955. return
  956. }
  957. // 保存任务表单数据到本地存储
  958. uni.setStorageSync('taskFormData', JSON.stringify(this.formData))
  959. uni.navigateTo({
  960. url: '/pages_task/selectCustomer'
  961. })
  962. },
  963. onStartTimeConfirm(e) {
  964. this.formData.planStartTime = this.formatDateTime(e.value);
  965. this.showStartTimePicker = false;
  966. },
  967. onEndTimeConfirm(e) {
  968. const endTime = new Date(e.value);
  969. const startTime = new Date(this.formData.planStartTime);
  970. if (this.formData.planStartTime && endTime < startTime) {
  971. uni.showToast({
  972. title: '计划结束时间不能早于开始时间',
  973. icon: 'none'
  974. });
  975. return;
  976. }
  977. this.formData.planEndTime = this.formatDateTime(e.value);
  978. this.showEndTimePicker = false;
  979. },
  980. formatDateTime(timestamp) {
  981. const date = new Date(timestamp);
  982. const year = date.getFullYear();
  983. const month = String(date.getMonth() + 1).padStart(2, '0');
  984. const day = String(date.getDate()).padStart(2, '0');
  985. const hours = String(date.getHours()).padStart(2, '0');
  986. const minutes = String(date.getMinutes()).padStart(2, '0');
  987. const seconds = String(date.getSeconds()).padStart(2, '0');
  988. return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
  989. },
  990. openStartTimePicker() {
  991. // 重置开始时间为当前时间(使用时间戳)
  992. this.startTimeValue = Date.now();
  993. this.showStartTimePicker = true;
  994. },
  995. openEndTimePicker() {
  996. // 重置结束时间为当前时间(使用时间戳)
  997. this.endTimeValue = Date.now();
  998. this.showEndTimePicker = true;
  999. }
  1000. }
  1001. }
  1002. </script>
  1003. <style lang="scss" scoped>
  1004. .container {
  1005. min-height: 100vh;
  1006. background: #F7F8FA;
  1007. display: flex;
  1008. flex-direction: column;
  1009. position: relative;
  1010. &::before {
  1011. content: '';
  1012. position: absolute;
  1013. top: 0;
  1014. left: 0;
  1015. right: 0;
  1016. width: 100%;
  1017. height: 544rpx;
  1018. background: linear-gradient(180deg, #E4EFFE 0%, rgba(228, 239, 254, 0) 100%);
  1019. }
  1020. .content {
  1021. flex: 1;
  1022. box-sizing: border-box;
  1023. .rejection-banner {
  1024. display: flex;
  1025. align-items: center;
  1026. padding: 24rpx;
  1027. background: #FF5030;
  1028. color: #fff;
  1029. margin: 24rpx;
  1030. border-radius: 8rpx;
  1031. .rejection-icon {
  1032. width: 40rpx;
  1033. height: 40rpx;
  1034. border-radius: 50%;
  1035. background: rgba(255, 255, 255, 0.3);
  1036. display: flex;
  1037. align-items: center;
  1038. justify-content: center;
  1039. font-size: 24rpx;
  1040. margin-right: 16rpx;
  1041. }
  1042. .rejection-text {
  1043. flex: 1;
  1044. font-size: 28rpx;
  1045. line-height: 1.5;
  1046. }
  1047. }
  1048. .form-section {
  1049. background: #fff;
  1050. margin: 20rpx;
  1051. border-radius: 16rpx;
  1052. padding: 32rpx;
  1053. .form-item {
  1054. display: flex;
  1055. justify-content: space-between;
  1056. align-items: center;
  1057. border-bottom: 1px solid #EBEDF0;
  1058. padding: 30rpx 0;
  1059. &:last-child {
  1060. border-bottom: 0;
  1061. }
  1062. .form-label {
  1063. display: flex;
  1064. flex-wrap: wrap;
  1065. align-items: center;
  1066. font-size: 28rpx;
  1067. color: #333;
  1068. margin-bottom: 16rpx;
  1069. .required {
  1070. color: #CF3546;
  1071. margin-right: 4rpx;
  1072. }
  1073. .form-option {
  1074. background: #F7F8FA;
  1075. padding: 14rpx 32rpx;
  1076. font-size: 28rpx;
  1077. border-radius: 70rpx;
  1078. color: #333333;
  1079. margin-right: 24rpx;
  1080. margin-bottom: 16rpx;
  1081. max-width: 100%;
  1082. word-break: break-word;
  1083. &.selected {
  1084. background: rgba(56, 139, 255, 0.15);
  1085. color: #388BFF;
  1086. }
  1087. }
  1088. }
  1089. .txt {
  1090. font-size: 28rpx;
  1091. color: #333333;
  1092. }
  1093. .form-input {
  1094. flex: 1;
  1095. font-size: 28rpx;
  1096. color: #C8C9CC;
  1097. &.placeholder {
  1098. color: #C8C9CC;
  1099. }
  1100. &.picker-input {
  1101. display: flex;
  1102. align-items: center;
  1103. justify-content: flex-end;
  1104. &:not(.placeholder) {
  1105. color: #000;
  1106. }
  1107. }
  1108. .icon {
  1109. width: 36rpx;
  1110. height: 36rpx;
  1111. }
  1112. }
  1113. .form-textarea {
  1114. flex: 1;
  1115. font-size: 28rpx;
  1116. color: #333;
  1117. padding: 16rpx;
  1118. border: 1px solid #EBEDF0;
  1119. border-radius: 8rpx;
  1120. min-height: 200rpx;
  1121. resize: none;
  1122. box-sizing: border-box;
  1123. &::placeholder {
  1124. color: #C8C9CC;
  1125. }
  1126. }
  1127. }
  1128. }
  1129. }
  1130. .next-button {
  1131. text-align: center;
  1132. font-size: 32rpx;
  1133. color: #FFFFFF;
  1134. height: 88rpx;
  1135. line-height: 88rpx;
  1136. background: #388BFF;
  1137. border-radius: 200rpx;
  1138. margin: 32rpx;
  1139. }
  1140. }
  1141. ::v-deep .u-popup__content {
  1142. border-radius: 40rpx 40rpx 0 0 !important;
  1143. }
  1144. .popup-content {
  1145. border-radius: 40rpx 40rpx 0rpx 0rpx;
  1146. height: 70vh;
  1147. background-color: #fff;
  1148. .popup-header {
  1149. padding: 40rpx 30rpx 20rpx;
  1150. text-align: center;
  1151. .close-icon {
  1152. width: 44rpx;
  1153. height: 44rpx;
  1154. position: absolute;
  1155. right: 32rpx;
  1156. }
  1157. flex-shrink: 0;
  1158. .title {
  1159. font-size: 32rpx;
  1160. font-weight: 600;
  1161. color: #333;
  1162. }
  1163. .popup-title {
  1164. font-size: 32rpx;
  1165. font-weight: 600;
  1166. color: #333;
  1167. }
  1168. }
  1169. .search-box {
  1170. display: flex;
  1171. align-items: center;
  1172. background: #F7F8FA;
  1173. border-radius: 38rpx;
  1174. padding: 16rpx 28rpx;
  1175. margin-bottom: 24rpx;
  1176. .icon {
  1177. width: 26rpx;
  1178. height: 26rpx;
  1179. margin-right: 10rpx;
  1180. }
  1181. }
  1182. .project-list {
  1183. height: calc(100% - 200rpx);
  1184. .project-item {
  1185. display: flex;
  1186. justify-content: space-between;
  1187. align-items: center;
  1188. padding: 28rpx 0;
  1189. font-size: 28rpx;
  1190. border-bottom: 1rpx solid #eee;
  1191. &:active {
  1192. background-color: #f9f9f9;
  1193. }
  1194. &.active {
  1195. .project-name {
  1196. font-weight: 500;
  1197. color: #388BFF;
  1198. }
  1199. .icon {
  1200. opacity: 1;
  1201. }
  1202. }
  1203. .project-name {
  1204. color: #333;
  1205. transition: all 0.2s ease;
  1206. }
  1207. .icon {
  1208. width: 36rpx;
  1209. height: 36rpx;
  1210. opacity: 0;
  1211. transition: opacity 0.2s ease;
  1212. }
  1213. }
  1214. }
  1215. .two-level-container {
  1216. display: flex;
  1217. flex: 1;
  1218. border-top: 1rpx solid #f5f5f5;
  1219. .primary-list {
  1220. width: 40%;
  1221. background-color: #f8f9fa;
  1222. .primary-item {
  1223. padding: 28rpx 20rpx;
  1224. background: #F2F3F5;
  1225. &:active {
  1226. background: #FFFFFF;
  1227. }
  1228. &.primary-active {
  1229. position: relative;
  1230. background-color: #fff;
  1231. &::before {
  1232. content: '';
  1233. position: absolute;
  1234. top: 50%;
  1235. left: 0;
  1236. transform: translateY(-50%);
  1237. width: 8rpx;
  1238. height: 32rpx;
  1239. background: #388BFF;
  1240. }
  1241. .primary-text {
  1242. font-weight: 500;
  1243. }
  1244. }
  1245. .primary-text {
  1246. font-size: 28rpx;
  1247. color: #666;
  1248. }
  1249. }
  1250. }
  1251. .secondary-list {
  1252. width: 60%;
  1253. padding: 0 20rpx;
  1254. .secondary-item {
  1255. display: flex;
  1256. justify-content: space-between;
  1257. align-items: center;
  1258. padding: 28rpx 10rpx;
  1259. font-size: 28rpx;
  1260. color: #333;
  1261. &.secondary-active {
  1262. font-weight: 500;
  1263. color: #388BFF;
  1264. }
  1265. }
  1266. }
  1267. }
  1268. .popup-footer {
  1269. padding: 20rpx 30rpx 40rpx;
  1270. background-color: #fff;
  1271. border-top: 1rpx solid #f5f5f5;
  1272. flex-shrink: 0;
  1273. .confirm-btn {
  1274. width: 100%;
  1275. height: 88rpx;
  1276. line-height: 88rpx;
  1277. background-color: #2979ff;
  1278. color: #fff;
  1279. font-size: 32rpx;
  1280. border-radius: 200rpx 200rpx 200rpx 200rpx;
  1281. &:active {
  1282. opacity: 0.8;
  1283. }
  1284. }
  1285. }
  1286. }
  1287. @media (prefers-color-scheme: dark) {
  1288. .popup-content {
  1289. background-color: #1e1e1e;
  1290. .popup-header {
  1291. .title,
  1292. .popup-title {
  1293. color: #fff;
  1294. }
  1295. }
  1296. .two-level-container {
  1297. .primary-list {
  1298. background-color: #2d2d2d;
  1299. border-right-color: #3d3d3d;
  1300. .primary-item {
  1301. border-bottom-color: #3d3d3d;
  1302. &:active {
  1303. background-color: #3d3d3d;
  1304. }
  1305. &.primary-active {
  1306. background-color: #3d3d3d;
  1307. .primary-text {
  1308. color: #2979ff;
  1309. }
  1310. }
  1311. .primary-text {
  1312. color: #ccc;
  1313. }
  1314. }
  1315. }
  1316. .secondary-list {
  1317. .secondary-item {
  1318. border-bottom-color: #3d3d3d;
  1319. &:active {
  1320. background-color: #3d3d3d;
  1321. }
  1322. &.secondary-active {
  1323. background-color: #2d2d2d;
  1324. }
  1325. .secondary-text {
  1326. color: #fff;
  1327. }
  1328. }
  1329. }
  1330. }
  1331. .popup-footer {
  1332. background-color: #1e1e1e;
  1333. border-top-color: #3d3d3d;
  1334. }
  1335. }
  1336. }
  1337. </style>