toLead.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <template>
  2. <div>
  3. <el-dialog :visible.sync="visible" width="700px" :close-on-click-modal="false" :before-close="closePopup">
  4. <div class="flex-box flex-dv-center" style="padding: 0 20px;">
  5. <div v-for="(item,index) in headStep" :key="index" class="listg" :class="{listg1: item.id < nowIndex}">
  6. <span class="border" :class="{border1: item.id < nowIndex}" v-if="item.id == 2 || item.id == 3"></span>
  7. <span class="indexnum" v-if="item.id >= nowIndex" :class="{indexnow:nowIndex == item.id}">{{item.id}}</span>
  8. <span class="el-icon-circle-check numicon" v-if="item.id < nowIndex"></span>
  9. <span class="ramin">{{item.name}}</span>
  10. </div>
  11. </div>
  12. <div :style="dstyle" style="height:150px;padding: 40px 140px">
  13. <slot name="1" v-if="nowIndex == 1"></slot>
  14. <div v-if="nowIndex == 2" style="text-align: center;">
  15. <div>
  16. <span>导入中</span>
  17. <span class="el-icon-loading"></span>
  18. </div>
  19. <div>
  20. 导入需要一定时间,请不要关闭当前窗口
  21. </div>
  22. </div>
  23. <div v-if="nowIndex == 3" class="leadtree">
  24. <div class="lead-tit">导入结果</div>
  25. <div class="lead-cent">
  26. <div v-if="tolead.id == 1">
  27. <div>共{{toleadall(tolead.error,tolead.success)}}条数据,已处理{{toleadall(tolead.error,tolead.success)}}条,导入情况如下:</div>
  28. <div><svg-icon icon-class="leadThenGreen" /> 导入成功{{tolead.success.length}}条</div>
  29. <div><svg-icon icon-class="leadErrRed" /> 导入失败{{tolead.error.length}}条 &nbsp; &nbsp; <span v-if="tolead.error.length > 0" style="cursor:pointer;color: #409eff;" @click="errClick(tolead.bs_id)">点击下载失败数据</span></div>
  30. </div>
  31. <div v-else-if="tolead.id == 0">
  32. <span><svg-icon icon-class="leadJgRed" /> 导入异常:{{tolead.name}}</span>
  33. </div>
  34. </div>
  35. <div class="lead-but">
  36. <el-button v-if="tolead.id == 1 && tolead.error.length > 0" type="primary" @click="$emit('update:nowIndex', 1)">我已修改文件,重新导入</el-button>
  37. <el-button v-else type="primary" @click="closePopup">确认</el-button>
  38. </div>
  39. </div>
  40. </div>
  41. </el-dialog>
  42. </div>
  43. </template>
  44. <script>
  45. export default {
  46. props: {
  47. visible: {
  48. type: Boolean,
  49. default: false
  50. },
  51. nowIndex: {//当前步骤
  52. type: Number,
  53. default: 1
  54. },
  55. tolead: {//导入数据
  56. type: Object,
  57. default: {}
  58. },
  59. export_type: {//导出类型
  60. type: String,
  61. default: ''
  62. },
  63. dstyle: {
  64. type: String,
  65. default: ''
  66. },
  67. },
  68. name: "toLead",
  69. data() {
  70. return {
  71. headStep:[
  72. {id: 1,name: '选择文件',},
  73. {id: 2,name: '正在处理',},
  74. {id: 3,name: '导入结果',},
  75. ],
  76. }
  77. },
  78. methods: {
  79. errClick(id){
  80. window.open(
  81. process.env.VUE_APP_BASE_API +
  82. '/api/download/fail_data_export?employee_id=' +
  83. this.$getUserData().id
  84. + '&bs_id=' + id
  85. + '&export_type='
  86. + this.export_type
  87. , '_blank'
  88. );
  89. },
  90. toleadall(err,then){
  91. return err.length + then.length
  92. },
  93. closePopup() {
  94. this.$nextTick(() => {
  95. if(this.tolead.success && this.tolead.success.length > 0) this.$emit('confirm');
  96. this.$emit('update:visible', false);
  97. });
  98. },
  99. }
  100. }
  101. </script>
  102. <style scoped lang="scss">
  103. .listg{
  104. .indexnum{
  105. width: 30px;
  106. height: 30px;
  107. display: inline-block;
  108. border: 1px solid #cecece;
  109. border-radius: 50%;
  110. text-align: center;
  111. color: #a9a9a9;
  112. line-height: 30px;
  113. margin-right: 5px;
  114. }
  115. .indexnow{
  116. background-color:#409eff;
  117. color: #fff;
  118. border: 1px solid #fff;
  119. }
  120. .border{
  121. display: inline-block;
  122. width: 160px;
  123. margin: 0 5px 2px 5px;
  124. height: 1px;
  125. background-color: #eaeaea;
  126. }
  127. .border1{
  128. margin-top: 18px;
  129. }
  130. .numicon{
  131. color: #41b9ff;
  132. font-size: 30px;
  133. margin-right: 5px;
  134. }
  135. }
  136. .listg1{
  137. display: flex;
  138. .ramin{
  139. line-height: 32px;
  140. }
  141. }
  142. .leadtree{
  143. .lead-tit{
  144. font-size: 19px;
  145. color: black;
  146. text-align: center;
  147. }
  148. .lead-cent{
  149. width: 280px;
  150. margin: 0 auto;
  151. min-height: 100px;
  152. padding: 10px 0 0 0;
  153. div{
  154. div{
  155. padding: 4px 0;
  156. }
  157. }
  158. }
  159. .lead-but{
  160. text-align: center;
  161. }
  162. }
  163. </style>