createTask.vue 39 KB

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