particalDialog.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411
  1. <template>
  2. <div class="container-applydialog">
  3. <!-- 详情的弹框 -->
  4. <div v-if="dialogVisiblepartica">
  5. <el-dialog
  6. v-dialogDrag
  7. :close-on-click-modal="false"
  8. :modal-append-to-body="false"
  9. center
  10. top="10vh"
  11. :visible.sync="dialogVisiblepartica"
  12. customClass="custom-applydialog"
  13. :before-close="confirmPerson"
  14. >
  15. <div slot="title" style="display: flex; align-items: center">
  16. <img :src="$icons.warntop" style="color: #fff; width: 16px; height: 16px; margin-right: 5px" />
  17. <span style="font-size: 16px">{{ particlaDlg.title }}</span>
  18. </div>
  19. <div v-if="particlaDlg">
  20. <el-table :data="tableDataSub" border height="500px" style="width: 100%">
  21. <el-table-column align="center" prop="RealName" label="姓名"> </el-table-column>
  22. <el-table-column align="center" prop="CompanyName" label="公司名称"> </el-table-column>
  23. <el-table-column align="center" v-if="isShowparticulars == '报名详情'" prop="CreateTime" label="报名时间"> </el-table-column>
  24. <el-table-column align="center" v-if="isShowparticulars == '到会详情'" prop="" label="是否到会">
  25. <template slot-scope="scope">
  26. {{ scope.row.IsMeeting == 1 ? (scope.row.IsAirborne == 1 ? "已到会(空降)" : "已到会") : scope.row.IsMeeting == 2 ? "空降" : "未到会" }}
  27. </template>
  28. </el-table-column>
  29. <el-table-column v-if="type === '线下到会'" align="center" prop="SigninTime" label="签到时间"> </el-table-column>
  30. </el-table>
  31. </div>
  32. <div v-if="particlaDlg.title == '到会详情' && type == '线下到会' && listSignin.length > 0" class="meeting-box">
  33. <div>潜在客户:</div>
  34. <div>
  35. <div class="signin-content" v-for="item in listSignin" :key="item.Id">
  36. <el-image
  37. v-if="item.BusinessCard"
  38. style="width: 180px; height: 100px; margin-right: 5px"
  39. :src="item.BusinessCard"
  40. :preview-src-list="[item.BusinessCard]"
  41. >
  42. </el-image>
  43. <span v-else>{{ item.RealName }} {{ item.Mobile }}</span>
  44. <span>{{ item.CreateTime }}</span>
  45. </div>
  46. </div>
  47. </div>
  48. <span slot="footer" class="dialog-footer">
  49. <el-button type="primary" @click="confirmPerson">知道了</el-button>
  50. </span>
  51. </el-dialog>
  52. </div>
  53. <div>
  54. <el-dialog
  55. v-dialogDrag
  56. :close-on-click-modal="false"
  57. :modal-append-to-body="false"
  58. center
  59. top="10vh"
  60. :visible.sync="submitDialog"
  61. customClass="custom-applydialog"
  62. :before-close="handleClose"
  63. >
  64. <div slot="title" style="display: flex; align-items: center">
  65. <img :src="$icons.warntop" style="color: #fff; width: 16px; height: 16px; margin-right: 5px" />
  66. <span style="font-size: 16px">提交到会情况</span>
  67. </div>
  68. <div>
  69. <el-table height="500px" :data="tableDataSub" border style="width: 100%">
  70. <el-table-column align="center" prop="RealName" label="姓名"> </el-table-column>
  71. <el-table-column align="center" prop="CompanyName" label="公司名称"> </el-table-column>
  72. <el-table-column align="center" prop="" label="操作">
  73. <template slot-scope="scope">
  74. <el-switch v-model="scope.row.Operation" active-text="已到会" inactive-text="未到会"> </el-switch>
  75. </template>
  76. </el-table-column>
  77. <el-table-column v-if="type === '线下到会'" align="center" prop="SigninTime" label="签到时间"> </el-table-column>
  78. </el-table>
  79. <div class="add-box">
  80. <img @click="addItem" :src="$icons.addblue" alt="" />
  81. <span @click="addItem">添加空降人员</span>
  82. </div>
  83. <div class="inline" v-for="(item, index) in dynamicItem" :key="index">
  84. <div class="inline-content">
  85. <el-autocomplete
  86. class="inline-input"
  87. v-model="item.name"
  88. :fetch-suggestions="callbackHandle"
  89. placeholder="请输入姓名"
  90. @input="getCompany(item.name)"
  91. @select="selectCompany(item, index)"
  92. @blur="focusCompany(item.name)"
  93. :trigger-on-focus="false"
  94. clearable
  95. ></el-autocomplete>
  96. <img @click="deleteItem(item, index)" src="~@/assets/img/icons/delete-Item.png" :class="index == 0 ? 'defaultyi' : ''" alt="" />
  97. </div>
  98. <p v-if="item.isShow">系统中无此人,请先将其添加到对应公司的联系人列表下</p>
  99. </div>
  100. </div>
  101. <span slot="footer" class="dialog-footer">
  102. <el-button type="primary" @click="confirmSubmit">提交</el-button>
  103. <el-button @click="handleClose">取消</el-button>
  104. </span>
  105. </el-dialog>
  106. </div>
  107. </div>
  108. </template>
  109. <script>
  110. import { raiInterface, raiSpecial } from "@/api/api.js";
  111. export default {
  112. name: "",
  113. components: {},
  114. props: {
  115. dialogVisiblepartica: {
  116. type: Boolean,
  117. default: false,
  118. },
  119. particlaDlg: {
  120. type: Object,
  121. },
  122. submitDialog: {
  123. type: Boolean,
  124. default: false,
  125. },
  126. offlineId: {
  127. type: Number,
  128. default: 0,
  129. },
  130. type: {
  131. type: String,
  132. default: "",
  133. },
  134. },
  135. data() {
  136. return {
  137. tableData: [],
  138. isShow: "",
  139. tableDataSub: [],
  140. dynamicItem: [],
  141. companyList: [], //客户名称的数组
  142. timeout: null, //
  143. isShowparticulars: "到会详情",
  144. user: [],
  145. warningIsShow: false,
  146. userId: "",
  147. listSignin: [],
  148. };
  149. },
  150. computed: {},
  151. watch: {
  152. "particlaDlg.title"() {
  153. if (this.particlaDlg.title) {
  154. this.isShowparticulars = this.particlaDlg.title;
  155. }
  156. },
  157. dialogVisiblepartica: {
  158. handler(newval) {
  159. if (newval) {
  160. if (this.isShowparticulars == "报名详情") {
  161. this.offlineListDetail();
  162. } else {
  163. this.arriveOfflineListDetail();
  164. }
  165. }
  166. },
  167. },
  168. submitDialog: {
  169. handler(newval) {
  170. if (newval) {
  171. this.arriveOfflineListDetail();
  172. }
  173. },
  174. },
  175. },
  176. created() {},
  177. mounted() {},
  178. methods: {
  179. // //报名人数
  180. async offlineListDetail() {
  181. const res = await raiInterface.offlineListDetail({
  182. ActivityId: this.offlineId,
  183. });
  184. if (res.Ret == 200) {
  185. this.tableDataSub = res.Data.List;
  186. }
  187. },
  188. //到会详情
  189. async arriveOfflineListDetail() {
  190. const res = this.particlaDlg.isSpecial
  191. ? await raiSpecial.getSpecialtripmeetDetial({
  192. ActivityId: this.offlineId,
  193. })
  194. : await raiInterface.activityMeetoffline({
  195. ActivityId: this.offlineId,
  196. });
  197. if (res.Ret == 200) {
  198. this.tableDataSub = res.Data.List;
  199. this.listSignin = res.Data.ListSignin || [];
  200. }
  201. },
  202. confirmPerson() {
  203. this.tableDataSub = [];
  204. this.user = [];
  205. this.userId = "";
  206. this.dynamicItem = [];
  207. this.$emit("update:dialogVisiblepartica", false);
  208. },
  209. async confirmSubmit() {
  210. const is = this.dynamicItem.some((item) => item.isShow == true);
  211. if (is) return this.$message.error("姓名有误");
  212. if (this.tableDataSub) {
  213. this.tableDataSub.forEach((item) => {
  214. if (item.Operation) {
  215. this.user.push(item.UserId);
  216. }
  217. });
  218. }
  219. this.dynamicItem.forEach((item) => this.user.push(item.id));
  220. this.userId = this.user.join(",");
  221. const res = this.particlaDlg.isSpecial
  222. ? await raiSpecial.postSpecialtripMeetingDo({
  223. ActivityId: this.offlineId,
  224. UserIds: this.userId,
  225. })
  226. : await raiInterface.activityMeetmeetingDo({
  227. ActivityId: this.offlineId,
  228. Ids: this.userId,
  229. });
  230. if (res.Ret === 200) {
  231. this.user = [];
  232. this.userId = "";
  233. this.dynamicItem = [];
  234. this.$emit("update:submitDialog", false);
  235. this.$parent.getsDataList();
  236. this.$nextTick(() => {
  237. this.$parent.particulars(this.offlineId, "到会详情");
  238. });
  239. }
  240. },
  241. addItem() {
  242. this.dynamicItem.push({
  243. name: "",
  244. isShow: false,
  245. });
  246. },
  247. deleteItem(item, index) {
  248. this.dynamicItem.splice(index, 1);
  249. },
  250. /* 获取客户名称 */
  251. getCompany(query) {
  252. if (query.includes(",")) return;
  253. if (query) {
  254. raiInterface
  255. .activitySignupUserList({
  256. KeyWord: query,
  257. })
  258. .then((res) => {
  259. if (res.Ret === 200) {
  260. let arr = [];
  261. res.Data.List &&
  262. res.Data.List.forEach((item) => {
  263. let obj = {
  264. ...item,
  265. value: item.RealName + " , " + item.Mobile + " , " + item.CompanyName,
  266. };
  267. arr.push(obj);
  268. });
  269. this.companyList = arr;
  270. }
  271. });
  272. } else {
  273. this.companyList = [];
  274. }
  275. },
  276. callbackHandle(data, cb) {
  277. let results = data
  278. ? this.companyList.filter((item) => {
  279. return item.value.includes(data);
  280. })
  281. : this.companyList;
  282. clearTimeout(this.timeout);
  283. this.timeout = setTimeout(() => {
  284. cb(results);
  285. }, 300);
  286. if (results.length == 0) {
  287. this.warningIsShow = true;
  288. } else {
  289. this.warningIsShow = false;
  290. }
  291. },
  292. handleClose() {
  293. (this.dynamicItem = []), (this.$parent.submitDialog = false);
  294. },
  295. focusCompany(name) {
  296. if ((name.length && this.companyList.length == 0) || this.warningIsShow) {
  297. this.dynamicItem.forEach((item) => {
  298. if (item.name == name) {
  299. item.isShow = true;
  300. }
  301. });
  302. } else {
  303. this.dynamicItem.forEach((item) => {
  304. if (item.name == name) {
  305. item.isShow = false;
  306. }
  307. });
  308. }
  309. },
  310. selectCompany(val, index) {
  311. this.companyList.forEach((item) => {
  312. if (item.value == val.name) {
  313. this.dynamicItem.splice(index, 1, { id: item.UserId, ...val });
  314. }
  315. });
  316. },
  317. },
  318. };
  319. </script>
  320. <style lang="scss">
  321. .container-applydialog {
  322. .custom-applydialog {
  323. width: 800px;
  324. }
  325. .add-box {
  326. box-sizing: border-box;
  327. display: flex;
  328. align-items: center;
  329. color: #5882ef;
  330. margin-top: 30px;
  331. margin-bottom: 17px;
  332. cursor: pointer;
  333. img {
  334. width: 16px;
  335. height: 16px;
  336. margin-right: 10px;
  337. }
  338. }
  339. .inline {
  340. margin-bottom: 20px;
  341. width: 440px;
  342. .inline-input {
  343. width: 392px !important;
  344. }
  345. p {
  346. padding-top: 5px;
  347. font-size: 14px;
  348. font-family: PingFang SC;
  349. font-weight: 500;
  350. line-height: 20px;
  351. color: #ef5858;
  352. opacity: 1;
  353. }
  354. }
  355. .inline-content {
  356. padding-right: 20px;
  357. display: flex;
  358. justify-content: space-between;
  359. align-items: center;
  360. img {
  361. width: 14px;
  362. height: 14px;
  363. }
  364. }
  365. .el-input {
  366. width: 392px !important;
  367. }
  368. .el-switch__label {
  369. color: #606266;
  370. font-size: 14px;
  371. font-weight: 400;
  372. }
  373. .is-active {
  374. color: #409eff !important;
  375. }
  376. .el-radio__label {
  377. font-weight: 400;
  378. }
  379. .meeting-box {
  380. margin-top: 20px;
  381. display: flex;
  382. div:first-child {
  383. flex-shrink: 0;
  384. margin-right: 10px;
  385. line-height: 19px;
  386. }
  387. }
  388. .signin-content {
  389. margin-bottom: 20px;
  390. display: flex;
  391. align-items: center;
  392. img {
  393. width: 100%;
  394. height: 100%;
  395. }
  396. span {
  397. margin-right: 5px;
  398. line-height: 19px;
  399. width: 180px;
  400. }
  401. .el-image-viewer__canvas {
  402. img {
  403. max-width: 60% !important;
  404. max-height: 60% !important;
  405. }
  406. }
  407. }
  408. }
  409. </style>