toLead.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  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="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. console.log(process.env.VUE_APP_BASE_API +
  81. '/api/download/fail_data_export?employee_id=' +
  82. this.$getUserData().id
  83. + '&bs_id=' + id
  84. + '&export_type='
  85. + this.export_type)
  86. window.open(
  87. process.env.VUE_APP_BASE_API +
  88. '/api/download/fail_data_export?employee_id=' +
  89. this.$getUserData().id
  90. + '&bs_id=' + id
  91. + '&export_type='
  92. + this.export_type
  93. , '_blank'
  94. );
  95. },
  96. toleadall(err,then){
  97. return err.length + then.length
  98. },
  99. closePopup() {
  100. this.$nextTick(() => {
  101. this.$emit('confirm');
  102. this.$emit('update:visible', false);
  103. });
  104. },
  105. }
  106. }
  107. </script>
  108. <style scoped lang="scss">
  109. .listg{
  110. .indexnum{
  111. width: 30px;
  112. height: 30px;
  113. display: inline-block;
  114. border: 1px solid #cecece;
  115. border-radius: 50%;
  116. text-align: center;
  117. color: #a9a9a9;
  118. line-height: 30px;
  119. margin-right: 5px;
  120. }
  121. .indexnow{
  122. background-color:#409EFF;
  123. color: #fff;
  124. border: 1px solid #fff;
  125. }
  126. .border{
  127. display: inline-block;
  128. width: 160px;
  129. margin: 0 5px 2px 5px;
  130. height: 1px;
  131. background-color: #eaeaea;
  132. }
  133. .border1{
  134. margin-top: 18px;
  135. }
  136. .numicon{
  137. color: #41b9ff;
  138. font-size: 30px;
  139. margin-right: 5px;
  140. }
  141. }
  142. .listg1{
  143. display: flex;
  144. .ramin{
  145. line-height: 32px;
  146. }
  147. }
  148. .leadtree{
  149. .lead-tit{
  150. font-size: 19px;
  151. color: black;
  152. text-align: center;
  153. }
  154. .lead-cent{
  155. width: 280px;
  156. margin: 0 auto;
  157. min-height: 100px;
  158. padding: 10px 0 0 0;
  159. div{
  160. div{
  161. padding: 4px 0;
  162. }
  163. }
  164. }
  165. .lead-but{
  166. text-align: center;
  167. }
  168. }
  169. </style>