byCell.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458
  1. <template>
  2. <view class="addactiyity-container">
  3. <van-form>
  4. <van-field
  5. :value="formatRsLable(formData.selectResearchers[0].researcherId)"
  6. is-link
  7. readonly
  8. clickable
  9. name="picker"
  10. label="研究员"
  11. type="textarea"
  12. rows="1"
  13. autosize
  14. placeholder="选择研究员"
  15. @click.native="clickRsChoose(0,'disable')"
  16. disabled
  17. />
  18. <van-field
  19. :value="formatterLabelTime(formData.selectResearchers[0].startTime)"
  20. is-link
  21. readonly
  22. clickable
  23. name="datetimePicker"
  24. label="开始时间"
  25. placeholder="选择开始时间"
  26. @click.native="clickTimeChoose(0,'start')"
  27. />
  28. <van-field
  29. :value="formatterLabelTime(formData.selectResearchers[0].endTime)"
  30. is-link
  31. readonly
  32. clickable
  33. name="datetimePicker"
  34. label="结束时间"
  35. placeholder="选择结束时间"
  36. @click.native="clickTimeChoose(0,'end')"
  37. />
  38. <van-field
  39. :value="formData.activityType"
  40. is-link
  41. readonly
  42. clickable
  43. name="picker"
  44. label="活动类型"
  45. placeholder="选择活动类型"
  46. @click.native="() => { isActivityPicker = true }"
  47. />
  48. <van-field
  49. :value="formData.roadshowType"
  50. v-if="['路演','公开会议', '沙龙'].includes(formData.activityType)"
  51. is-link
  52. readonly
  53. clickable
  54. name="picker"
  55. :label="`${dynamic_prefix}形式`"
  56. :placeholder="`选择${dynamic_prefix}形式`"
  57. @click.native="isRoadshowTypePicker = true"
  58. />
  59. <van-field
  60. :value="formData.roadshowPlatform"
  61. v-if="['路演','公开会议', '沙龙'].includes(formData.activityType) && formData.roadshowType === '线上'"
  62. clickable
  63. :label="`${dynamic_prefix}平台`"
  64. :placeholder="`输入${dynamic_prefix}平台(eg:进门财经、腾讯会议)`"
  65. @change="bindInputHandle('roadshowPlatform',$event)"
  66. />
  67. <van-field
  68. :value="formData.roadshowCity"
  69. v-if="['路演','公开会议', '沙龙'].includes(formData.activityType) && formData.roadshowType === '线下'"
  70. is-link
  71. readonly
  72. clickable
  73. :label="`${dynamic_prefix}城市`"
  74. :placeholder="`选择${dynamic_prefix}城市`"
  75. @click.native="clickAreaChoose"
  76. />
  77. <van-field
  78. :value="formData.companyName"
  79. v-if="['路演'].includes(formData.activityType)"
  80. is-link
  81. readonly
  82. clickable
  83. label="客户名称"
  84. placeholder="客户名称"
  85. @click.native="goSearchCompany"
  86. />
  87. <view class="company-info" v-if="formData.activityType === '路演' && formData.companyId && companyInfo">
  88. <!-- ficc角色看ficc信息 -->
  89. <template v-if="!isRaiRole">
  90. <template v-if="companyInfo.EnglishCompany===1">
  91. <p>所属国家:{{companyInfo.EnglishCountry}}</p>
  92. <p>累计点击量:{{companyInfo.EnglishViewTotal}}</p>
  93. </template>
  94. <template v-else>
  95. <p>客户状态:{{ companyInfo.Status }}</p>
  96. <p>所属行业:{{ companyInfo.IndustryName }}</p>
  97. <p>开通品种:{{ companyInfo.PermissionName }}</p>
  98. <p>累计报告阅读次数:{{ companyInfo.ReportReadTotal }}</p>
  99. </template>
  100. </template>
  101. <!-- 权益角色看权益信息 -->
  102. <template v-else>
  103. <p>客户状态:{{companyInfo.Status}}</p>
  104. <p>所属行业:{{companyInfo.IndustryName}}</p>
  105. <p>行业权限:{{companyInfo.PermissionName}}</p>
  106. <p>累计互动次数:{{companyInfo.ReportReadTotal}}</p>
  107. </template>
  108. </view>
  109. <van-field
  110. :value="formData.meetingTheme"
  111. v-if="['公开会议','沙龙'].includes(formData.activityType)"
  112. clickable
  113. label="会议主题"
  114. type="textarea"
  115. rows="1"
  116. autosize
  117. placeholder="请输入会议主题"
  118. @change="bindInputHandle('meetingTheme',$event)"
  119. />
  120. <van-field
  121. :value="formData.partnersName"
  122. v-if="['公开会议'].includes(formData.activityType)"
  123. clickable
  124. label="合作方名称"
  125. type="textarea"
  126. rows="1"
  127. autosize
  128. placeholder="请输入合作方名称(多个合作方用','隔开)"
  129. @change="bindInputHandle('partnersName',$event)"
  130. />
  131. <van-field
  132. :value="formData.activityClass"
  133. v-if="['报告电话会'].includes(formData.activityType)"
  134. is-link
  135. readonly
  136. clickable
  137. label="活动类别"
  138. placeholder="请选择活动类别"
  139. @click.native="isActivityClassPicker = true"
  140. />
  141. <!-- 追加后的研究员 -->
  142. <view class="add-user-list" v-for="addindex in addResearchersIdx" :key="addindex" v-if="addResearchersIdx.length">
  143. <view class="del-cont" @click="delResearcherHandle(addindex)">
  144. <van-icon name="close" />
  145. </view>
  146. <van-field
  147. :value="formatRsLable(formData.selectResearchers[addindex].researcherId)"
  148. is-link
  149. readonly
  150. clickable
  151. name="picker"
  152. label="研究员"
  153. placeholder="选择研究员"
  154. @click.native="clickRsChoose(addindex)"
  155. />
  156. <van-field
  157. :value="formatterLabelTime(formData.selectResearchers[addindex].startTime)"
  158. is-link
  159. readonly
  160. clickable
  161. name="datetimePicker"
  162. label="开始时间"
  163. placeholder="选择开始时间"
  164. :formatter="formatterLabelTime"
  165. @click.native="clickTimeChoose(addindex,'start')"
  166. />
  167. <van-field
  168. :value="formatterLabelTime(formData.selectResearchers[addindex].endTime)"
  169. is-link
  170. readonly
  171. clickable
  172. name="datetimePicker"
  173. label="结束时间"
  174. placeholder="选择结束时间"
  175. :formatter="formatterLabelTime"
  176. @click.native="clickTimeChoose(addindex,'end')"
  177. />
  178. </view>
  179. <view class="add-user-btn" @click="addResearcherHandle"
  180. v-if="['路演', '公开会议'].includes(formData.activityType) && !edit_id">
  181. <van-icon name="add-o" />添加研究员
  182. </view>
  183. </van-form>
  184. <div class="submit-bot">
  185. <van-button type="primary" plain color="#3385FF" class="btn" size="small" block round @click="cancelHandle">取消</van-button>
  186. <van-button type="primary" color="#3385FF" class="btn" size="small" block round @click="submitHandle">确定</van-button>
  187. </div>
  188. <!-- 选择活动类型 -->
  189. <van-popup :show="isActivityPicker" position="bottom">
  190. <van-picker
  191. show-toolbar
  192. :columns="activiytyTypes"
  193. :default-index="activiytyTypes.indexOf(formData.activityType)"
  194. @confirm="confirmActivityType"
  195. @cancel="isActivityPicker=false"
  196. />
  197. </van-popup>
  198. <!-- 选择活动类别 -->
  199. <van-popup :show="isActivityClassPicker" position="bottom">
  200. <van-picker
  201. show-toolbar
  202. :columns="telTypeList"
  203. :default-index="telTypeList.indexOf(formData.activityClass)"
  204. @confirm="confirmActivityClass"
  205. @cancel="isActivityClassPicker=false"
  206. />
  207. </van-popup>
  208. <!-- 选择路演形式 -->
  209. <van-popup :show="isRoadshowTypePicker" position="bottom">
  210. <van-picker
  211. show-toolbar
  212. :columns="['线上','线下']"
  213. :default-index="['线上','线下'].indexOf(formData.roadshowType)"
  214. @confirm="confirmRoadshowType"
  215. @cancel="isRoadshowTypePicker=false"
  216. />
  217. </van-popup>
  218. <!-- 选择研究员 -->
  219. <van-popup :show="isResearcherPicker" position="bottom">
  220. <!-- 内部会议可多选研究员,且只有ficc会有内部会议 -->
  221. <template v-if="!['路演', '公开会议'].includes(formData.activityType)">
  222. <view class="select-rs-header">
  223. <text class="cancel" @click="cancelResearcher">取消</text>
  224. <text class="ensure" @click="confirmResearcher">确认</text>
  225. </view>
  226. <van-tree-select
  227. :items="ficcReasearcherList"
  228. :main-active-index="rs_picker.firstindex"
  229. :active-id="rs_picker.id"
  230. @click-nav="clickFirstHandle"
  231. @click-item="clickItemHandle"
  232. />
  233. </template>
  234. <template v-else>
  235. <van-cascader
  236. v-if="isResearcherPicker"
  237. v-model="this.formData.selectResearchers[this.selectRsIndex].researcherId"
  238. title="请选择研究员"
  239. active-color="#3385FF"
  240. :options="researcherList"
  241. @close="isResearcherPicker=false"
  242. @finish="chooseResearcher"
  243. />
  244. </template>
  245. </van-popup>
  246. <!-- 选择时间 -->
  247. <van-popup :show="isTimePicker" position="bottom">
  248. <van-datetime-picker
  249. :value="pickerForm.time"
  250. type="datetime"
  251. :formatter="formatterPickerTime"
  252. @confirm="confirmTime"
  253. @cancel="() => {isTimePicker = false;pickerForm.time=''}"
  254. />
  255. </van-popup>
  256. <!-- 选择地区 -->
  257. <van-popup :show="isAreaPicker" position="bottom">
  258. <van-area
  259. :value="pickerForm.area"
  260. :area-list="areaList"
  261. :columns-num="isRaiRole?3:2"
  262. @confirm="confirmArea"
  263. @cancel="isAreaPicker = false"
  264. />
  265. </van-popup>
  266. </view>
  267. </template>
  268. <script>
  269. import {
  270. addActivity,
  271. editActivity
  272. } from '@/api/roadshow/index.js';
  273. import {
  274. getDefaultOption
  275. } from './common.js';
  276. import mixin from './mixin.js';
  277. import { validateForm } from '../utils/validate.js';
  278. const moment = require('../utils/_moment.js');
  279. moment.locale('zh-cn');
  280. export default {
  281. mixins: [mixin],
  282. data() {
  283. return {
  284. defaultResearcher: []
  285. };
  286. },
  287. methods: {
  288. /* 设置默认状态 */
  289. initSetState(options) {
  290. const {
  291. RoleTypeCode
  292. } = JSON.parse(uni.getStorageSync('userInfo')) || null;
  293. const {
  294. defaultActivityType,
  295. activityTypeList
  296. } = getDefaultOption(RoleTypeCode, 1);
  297. this.activiytyTypes = activityTypeList;
  298. this.formData.activityType = defaultActivityType;
  299. if(this.isRaiRole){
  300. this.formData.activityType = "路演"
  301. }/* else{
  302. delete this.areaList.county_list
  303. } */
  304. if(options.defaultOpt) {
  305. this.defaultResearcher = JSON.parse(options.defaultOpt);
  306. // 研究员默认结构 内部会议/电话会为数组
  307. this.formData.selectResearchers = ['内部会议','报告电话会'].includes(defaultActivityType)
  308. ? [{
  309. researcherId: [ this.defaultResearcher[0].researcherId ],
  310. startTime: this.defaultResearcher[0].startTime,
  311. endTime: this.defaultResearcher[0].endTime
  312. }]
  313. : this.defaultResearcher;
  314. }
  315. uni.setNavigationBarTitle({
  316. title: this.edit_id ? '修改活动' : '添加活动'
  317. })
  318. },
  319. },
  320. onLoad(options) {
  321. this.initSetState(options);
  322. },
  323. onShow() {
  324. this.getResearcherList();
  325. this.getTelType();
  326. if(uni.getStorageSync('roadshow_compantyId')) {
  327. this.formData.companyId = Number(uni.getStorageSync('roadshow_compantyId'));
  328. this.formData.englishCompany = Number(uni.getStorageSync('roadshow_isEnglishCompany'))
  329. this.getCompanyInfo();
  330. uni.removeStorageSync('roadshow_compantyId');
  331. uni.removeStorageSync('roadshow_isEnglishCompany');
  332. }
  333. }
  334. }
  335. </script>
  336. <style lang="scss" scoped>
  337. .addactiyity-container {
  338. padding-bottom: 200rpx;
  339. .add-user-btn {
  340. background-color: #fff;
  341. margin-top: 20rpx;
  342. padding: 20rpx 0;
  343. color: #3385ff;
  344. display: flex;
  345. align-items: center;
  346. justify-content: center;
  347. }
  348. .del-cont {
  349. font-size: 50rpx;
  350. color: #f00;
  351. display: flex;
  352. justify-content: flex-end;
  353. padding: 10rpx 30rpx;
  354. }
  355. .submit-bot {
  356. position: fixed;
  357. left: 0;
  358. right: 0;
  359. bottom: 0;
  360. z-index: 99;
  361. height: 140rpx;
  362. padding: 0 150rpx;
  363. background-color: #fff;
  364. display: flex;
  365. align-items: center;
  366. justify-content: center;
  367. padding-bottom: constant(safe-area-inset-bottom);
  368. padding-bottom: env(safe-area-inset-bottom);
  369. box-shadow: 0px -2px 6px rgba(110, 119, 141, 0.07);
  370. .btn {
  371. // width: 100%;
  372. width: 260rpx;
  373. height: 60rpx;
  374. margin-right: 30rpx;
  375. }
  376. }
  377. .select-rs-header {
  378. display: flex;
  379. align-items: center;
  380. justify-content: space-between;
  381. padding: 30rpx 20rpx;
  382. .cancel {
  383. color: #969799;
  384. }
  385. .ensure {
  386. color: #576b95;
  387. }
  388. }
  389. }
  390. </style>
  391. <style lang="scss">
  392. .addactiyity-container {
  393. .van-tree-select {
  394. .van-tree-select__item--active {
  395. color: #1989fa !important;
  396. }
  397. .van-sidebar-item--selected {
  398. border-color: #1989fa !important;
  399. }
  400. }
  401. .van-tree-select__item { font-weight: normal; }
  402. .company-info {
  403. background: #D5E6FF;
  404. padding: 10rpx 30rpx;
  405. margin-bottom: 20rpx;
  406. view {
  407. margin: 12rpx 0;
  408. color: #666;
  409. text-indent: -140rpx;
  410. margin-left: 140rpx;
  411. }
  412. }
  413. }
  414. </style>