achievement-details.php 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. <?php
  2. // Yii::$app->loadComponentView('com-dialog-select');
  3. // Yii::$app->loadPluginComponentView('free-goods-choice');
  4. ?>
  5. <template id="achievement-details">
  6. <el-dialog :visible.sync="edit.show" width="30%" center :title="edit_row.title"><!--:title="edit_row.title" -->
  7. <div style="display: flex;justify-content: center;">
  8. <div style="display: flex;align-items: center;margin-bottom: 20px;">
  9. <div style="flex-shrink: 0;">客户名称:</div><el-input clearable @keyup.enter.native="toSearch" type="text" size="small" v-model = 'search.nickname' placeholder="请输入客户名称"></el-input>
  10. </div>
  11. <el-button size="small" type="primary" icon="el-icon-search" style="height: 32px;margin-left: 20px;" @click='toSearch'>搜索</el-button>
  12. </div>
  13. <el-table
  14. v-if="edit_row.currentPerformanceType == 1"
  15. v-loading="dialogLoading"
  16. stripe
  17. :data="detailList"
  18. style="width: 100%"
  19. size="small">
  20. <el-table-column
  21. type="index"
  22. label="序号"
  23. min-width="100"
  24. align="center">
  25. </el-table-column>
  26. <el-table-column
  27. prop="name"
  28. label="客户"
  29. min-width="120"
  30. >
  31. <template slot-scope="scope">
  32. <div style="display: flex;align-items: center;">
  33. <el-image fit="cover" :src="scope.row.avatar_url" style="width: 40px;height: 40px;display: block;margin-right: 5px;flex-shrink: 0;"></el-image>
  34. <div>
  35. <div>{{scope.row.nickname}}</div>
  36. <div>ID {{scope.row.user_id}}</div>
  37. </div>
  38. </div>
  39. </template>
  40. </el-table-column>
  41. <el-table-column
  42. prop="created_at"
  43. label="邀请时间"
  44. min-width="80"
  45. align="center"
  46. >
  47. </el-table-column>
  48. </el-table>
  49. <el-table
  50. v-if="edit_row.currentPerformanceType == 2"
  51. v-loading="dialogLoading"
  52. stripe
  53. :data="detailList"
  54. style="width: 100%"
  55. size="small">
  56. <el-table-column
  57. type="index"
  58. label="序号"
  59. min-width="100"
  60. align="center">
  61. </el-table-column>
  62. <el-table-column
  63. prop="name"
  64. label="客户"
  65. min-width="120">
  66. <template slot-scope="scope">
  67. <div style="display: flex;align-items: center;">
  68. <el-image fit="cover" :src="scope.row.avatar_url" style="width: 40px;height: 40px;display: block;margin-right: 5px;flex-shrink: 0;"></el-image>
  69. <div>
  70. <div>{{scope.row.nickname}}</div>
  71. <div>ID {{scope.row.user_id}}</div>
  72. </div>
  73. </div>
  74. </template>
  75. </el-table-column>
  76. <el-table-column
  77. prop="money"
  78. label="消费金额(元)"
  79. min-width="80"
  80. align="center"
  81. >
  82. </el-table-column>
  83. <el-table-column
  84. prop="created_at"
  85. label="邀请时间"
  86. min-width="80"
  87. align="center"
  88. >
  89. </el-table-column>
  90. </el-table>
  91. <div flex="box:last cross:center" style="margin-top: 15px;"><!-- v-if="list.length > 0" -->
  92. <div></div>
  93. <div>
  94. <el-pagination
  95. style="display: inline-block;float: right;"
  96. background
  97. @current-change="pageChange"
  98. layout="prev, pager, next"
  99. :page-count="pageCount"
  100. >
  101. </el-pagination>
  102. </div>
  103. </div>
  104. </el-dialog>
  105. </template>
  106. <script>
  107. Vue.component('achievement-details', {
  108. template: '#achievement-details',
  109. props: {
  110. value: {
  111. type: Boolean,
  112. default: false
  113. },
  114. edit_row: {
  115. type: Object,
  116. default: null
  117. }
  118. },
  119. data() {
  120. return {
  121. edit: {
  122. show: false,
  123. id: '',
  124. btnLoading: false,
  125. },
  126. ruleForm: {
  127. level: '',
  128. goods_id: 0,
  129. give_goods_num:0,
  130. give_goods_id:0,
  131. name: '',
  132. is_enable: 1,
  133. },
  134. level_list: [],
  135. goods: null,
  136. goods2: null,
  137. loading:false,
  138. pageCount:0,
  139. detailList:[],
  140. currentPerformanceType:1,
  141. dialogLoading:false,
  142. search:{
  143. page:1,
  144. nickname:'',
  145. }
  146. }
  147. },
  148. watch: {
  149. value() {
  150. if (this.value) {
  151. //this.getLevelList();
  152. this.edit.show = true;
  153. //console.log('组件显示得到的参数=',this.edit_row)
  154. if(this.edit_row.currentPerformanceType == 1){
  155. this.getDetailList1()
  156. }else if(this.edit_row.currentPerformanceType == 2){
  157. this.getDetailList2()
  158. }
  159. /* if (this.edit_row.id > 0) {
  160. this.edit.id = this.edit_row.id;
  161. this.loadData();
  162. } else {
  163. this.edit.id = 0;
  164. } */
  165. } else {
  166. this.edit.show = false;
  167. }
  168. },
  169. 'edit.show'() {
  170. if (!this.edit.show) {
  171. /* this.edit_row.id = 0;
  172. this.ruleForm = {
  173. level: '',
  174. goods_id: 0,
  175. give_goods_num:'',
  176. give_goods_id:0,
  177. name: '',
  178. is_enable: 1,
  179. }
  180. this.goods = null,
  181. this.goods2 = null,
  182. this.editCancel(); */
  183. this.editCancel();
  184. }
  185. if (this.edit.id) {
  186. }
  187. }
  188. },
  189. mounted() {
  190. //this.getLevelList();
  191. // console.log(this.edit_row)
  192. //this.edit.id = this.edit_row.id;
  193. },
  194. methods: {
  195. pageChange(page){
  196. this.search.page = page;
  197. if(this.edit_row.currentPerformanceType == 1){
  198. this.getDetailList1()
  199. }else if(this.edit_row.currentPerformanceType == 2){
  200. this.getDetailList2()
  201. }
  202. },
  203. toSearch(){
  204. this.search.page = 1;
  205. if(this.edit_row.currentPerformanceType == 1){
  206. this.getDetailList1()
  207. }else if(this.edit_row.currentPerformanceType == 2){
  208. this.getDetailList2()
  209. }
  210. },
  211. onInput(e) {
  212. this.$forceUpdate();
  213. },
  214. agentClick(row) {
  215. this.edit.id = row.id
  216. },
  217. editCancel() {
  218. this.$emit('input', false);
  219. },
  220. keyUp() {
  221. //console.log('key up')
  222. },
  223. getDetailList1(){
  224. //console.log('请求拉新明细前的参数1='+this.edit_row.activity_id)
  225. //console.log('请求拉新明细前的参数2='+this.edit_row.user_id)
  226. let params = {
  227. r: 'plugin/pk/mall/invite-log/get-list',//拉新明细
  228. activity_id:this.edit_row.activity_id,
  229. user_id:this.edit_row.user_id,
  230. limit:6
  231. };
  232. params = Object.assign(params, this.search);
  233. //console.log('请求详情列表前的params11='+JSON.stringify(params))
  234. this.dialogLoading=true;
  235. request({
  236. params:params,
  237. method: 'get',
  238. }).then(e => {
  239. //console.log('拉新明细11='+JSON.stringify(e))
  240. this.dialogLoading=false;
  241. if (e.data.code == 0) {
  242. this.detailList = e.data.data.list;
  243. this.pageCount = e.data.data.page_count;
  244. /* this.list = e.data.data.list;
  245. this.pageCount = e.data.data.page_count; */
  246. } else {
  247. this.$message.error(e.data.msg);
  248. }
  249. }).catch(e => {
  250. this.dialogLoading=false;
  251. });
  252. },
  253. getDetailList2(){
  254. //console.log('请求业绩明细前的参数1='+this.edit_row.activity_id)
  255. //console.log('请求业绩明细前的参数2='+this.edit_row.user_id)
  256. let params = {
  257. r: 'pk/personal/log-list',//战队队员业绩明细|个人活动队员业绩明细
  258. activity_id:this.edit_row.activity_id,
  259. user_id:this.edit_row.user_id,
  260. limit:6
  261. };
  262. params = Object.assign(params, this.search);
  263. //console.log('请求详情列表前的params22='+JSON.stringify(params))
  264. this.dialogLoading=true;
  265. request({
  266. params:params,
  267. method: 'get',
  268. }).then(e => {
  269. //console.log('业绩明细22='+JSON.stringify(e))
  270. this.dialogLoading=false;
  271. if (e.data.code == 0) {
  272. this.detailList = e.data.data.list;
  273. this.pageCount = e.data.data.page_count;
  274. /* this.list = e.data.data.list;
  275. this.pageCount = e.data.data.page_count; */
  276. } else {
  277. this.$message.error(e.data.msg);
  278. }
  279. }).catch(e => {
  280. this.dialogLoading=false;
  281. });
  282. }
  283. }
  284. });
  285. </script>