OPgroup.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  1. <template>
  2. <div>
  3. <div class="group-list">
  4. <div class="group-title">
  5. <div>团组列表</div>
  6. <div class="group-box">
  7. <el-select v-model="value" clearable placeholder="请选择" @change="filterStatus(value)">
  8. <el-option
  9. v-for="item in options"
  10. :key="item.value"
  11. :label="item.label"
  12. :value="item.value">
  13. </el-option>
  14. </el-select>
  15. <el-input
  16. style="width:200px;"
  17. @input="Inquireclick()"
  18. placeholder="请输入查询内容"
  19. v-model="input"
  20. clearable>
  21. </el-input>
  22. <el-button @click="Inquireclick()" type="primary"><i class="icon-sousuo"></i></el-button>
  23. </div>
  24. </div>
  25. <template>
  26. <el-table
  27. :data="groupDatas.slice((currentPage-1)*pageSize,currentPage*pageSize)"
  28. border
  29. style="width: 100%">
  30. <el-table-column
  31. prop="num"
  32. label="序 号"
  33. width="55">
  34. <template slot-scope="scope">
  35. {{(currentPage - 1) * pageSize + scope.$index + 1}}
  36. </template>
  37. </el-table-column>
  38. <el-table-column
  39. prop="tourCode"
  40. width="100"
  41. label="团 号">
  42. </el-table-column>
  43. <el-table-column
  44. width="100"
  45. prop="salesQuoteNo"
  46. label="销售报价号">
  47. </el-table-column>
  48. <el-table-column
  49. prop="teamType"
  50. label="团组类型"
  51. width="150">
  52. </el-table-column>
  53. <el-table-column
  54. prop="teamLev"
  55. label="级 别"
  56. width="80">
  57. </el-table-column>
  58. <el-table-column
  59. prop="teamName"
  60. label="团队名称"
  61. width="200">
  62. </el-table-column>
  63. <el-table-column
  64. prop="clientName"
  65. label="客户名称"
  66. width="100">
  67. </el-table-column>
  68. <el-table-column
  69. prop="clientUnit"
  70. label="客户单位"
  71. width="200">
  72. </el-table-column>
  73. <el-table-column
  74. prop="visitDate"
  75. :formatter="filteryear"
  76. label="出访时间"
  77. width="100">
  78. </el-table-column>
  79. <el-table-column
  80. prop="visitDays"
  81. label="出访天数"
  82. width="80">
  83. </el-table-column>
  84. <el-table-column
  85. prop="visitPNumber"
  86. label="出访人数"
  87. width="80">
  88. </el-table-column>
  89. <el-table-column
  90. prop="jietuanOperator"
  91. label="接团操作人"
  92. width="110">
  93. </el-table-column>
  94. <el-table-column label="操作">
  95. <template slot-scope="scope">
  96. <el-button
  97. size="mini"
  98. @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
  99. <el-button
  100. size="mini"
  101. type="danger"
  102. @click="handleDelete(scope.$index, scope.row)">删除</el-button>
  103. </template>
  104. </el-table-column>
  105. </el-table>
  106. </template>
  107. <div class="block">
  108. <el-pagination align='center'
  109. @size-change="handleSizeChange"
  110. @current-change="handleCurrentChange"
  111. :current-page="currentPage"
  112. :page-sizes="[10,12,15,20]"
  113. :page-size="pageSize"
  114. layout="total, sizes, prev, pager, next"
  115. :total="groupDatas.length">
  116. </el-pagination>
  117. </div>
  118. </div>
  119. </div>
  120. </template>
  121. <script>
  122. import { co, el } from '@fullcalendar/core/internal-common';
  123. export default {
  124. data() {
  125. return {
  126. options: [
  127. {
  128. value: '0',
  129. label: '全部'
  130. }, {
  131. value: '1',
  132. label: '已完成'
  133. }, {
  134. value: '2',
  135. label: '未完成'
  136. }
  137. ],
  138. value: '0',
  139. groupDatas:[],
  140. groupData: [
  141. ],
  142. groupDatass:[],
  143. currentPage: 1, // 当前页码
  144. pageSize: 12 ,// 每页的数据条数
  145. input:'',
  146. token:''
  147. }
  148. },
  149. methods:{
  150. //每页条数改变时触发 选择一页显示多少行
  151. handleSizeChange(val) {
  152. this.currentPage = 1;
  153. this.pageSize = val;
  154. },
  155. //当前页改变时触发 跳转其他页
  156. handleCurrentChange(val) {
  157. this.currentPage = val;
  158. },
  159. Inquireclick(){
  160. console.log(this.groupDatass)
  161. var newarr=[];
  162. if(this.input==""){
  163. if(this.value=="0"){
  164. console.log(123)
  165. newarr=this.groupData;
  166. }else{
  167. newarr=this.groupDatass;
  168. }
  169. }else{
  170. for(var i=0;i<this.groupDatas.length;i++){
  171. if(this.groupDatas[i].clientName.indexOf(this.input)!=-1){
  172. newarr.push(this.groupDatas[i]);
  173. }
  174. else if(this.groupDatas[i].clientUnit.indexOf(this.input)!=-1){
  175. newarr.push(this.groupDatas[i]);
  176. }
  177. else if(this.groupDatas[i].jietuanOperator.indexOf(this.input)!=-1){
  178. newarr.push(this.groupDatas[i]);
  179. }
  180. else if(this.groupDatas[i].salesQuoteNo.indexOf(this.input)!=-1){
  181. newarr.push(this.groupDatas[i]);
  182. }
  183. else if(this.groupDatas[i].teamLev.indexOf(this.input)!=-1){
  184. newarr.push(this.groupDatas[i]);
  185. }
  186. else if(this.groupDatas[i].teamName.indexOf(this.input)!=-1){
  187. newarr.push(this.groupDatas[i]);
  188. }
  189. else if(this.groupDatas[i].teamType.indexOf(this.input)!=-1){
  190. newarr.push(this.groupDatas[i]);
  191. }
  192. else if(this.groupDatas[i].tourCode.indexOf(this.input)!=-1){
  193. newarr.push(this.groupDatas[i]);
  194. }else if(this.groupDatas[i].visitDate.indexOf(this.input)!=-1){
  195. newarr.push(this.groupDatas[i]);
  196. }
  197. }
  198. }
  199. this.groupDatas=newarr;
  200. },
  201. //
  202. Grouplist(){
  203. var url="/api/Group"
  204. var that=this
  205. this.$axios({
  206. method: 'post',
  207. url:url,
  208. headers:{
  209. Authorization:'Bearer '+this.token
  210. },
  211. data:{
  212. portType: 1,
  213. }
  214. }).then(function(res){
  215. if(res.data.code==200){
  216. that.groupData=res.data.data
  217. that.groupData.forEach(item=>{
  218. if(item.clientName==null){
  219. item.clientName = ''
  220. }
  221. if(item.clientUnit==null){
  222. item.clientUnit = ''
  223. }
  224. if(item.id==null){
  225. item.id = ''
  226. }
  227. if(item.isSure==null){
  228. item.isSure = ''
  229. }
  230. if(item.jietuanOperator==null){
  231. item.jietuanOperator = ''
  232. }
  233. if(item.salesQuoteNo==null){
  234. item.salesQuoteNo = ''
  235. }
  236. if(item.teamName==null){
  237. item.teamName = ''
  238. }
  239. if(item.teamType==null){
  240. item.teamType = ''
  241. }
  242. if(item.tourCode==null){
  243. item.tourCode = ''
  244. }
  245. if(item.visitDate==null){
  246. item.visitDate = ''
  247. }
  248. if(item.visitDays==null){
  249. item.visitDays = ''
  250. }
  251. if(item.visitPNumber==null){
  252. item.visitPNumber = ''
  253. }
  254. })
  255. that.groupDatas=that.groupData;
  256. console.log(that.groupData)
  257. }
  258. })
  259. },
  260. filteryear(val){
  261. let gstime=val.visitDate.split('T')[0]
  262. return gstime;
  263. },
  264. //筛选状态
  265. filterStatus(val){
  266. console.log(val)
  267. var newgroup=[];
  268. if(this.input==""){
  269. if(val=="0"||val==""){
  270. newgroup=this.groupData;
  271. }else if(val=="1"){
  272. for(var j=0;j<this.groupData.length;j++){
  273. if(this.groupData[j].isSure==1){
  274. newgroup.push(this.groupData[j])
  275. }
  276. }
  277. }else if(val=="2"){
  278. for(var j=0;j<this.groupData.length;j++){
  279. if(this.groupData[j].isSure==0){
  280. newgroup.push(this.groupData[j])
  281. }
  282. }
  283. }
  284. this.groupDatas=newgroup
  285. this.groupDatass=newgroup
  286. }else{
  287. if(val=="0"||val==""){
  288. newgroup=this.groupData
  289. }else if(val=="1"){
  290. for(var j=0;j<this.groupData.length;j++){
  291. if(this.groupData[j].isSure==1){
  292. newgroup.push(this.groupData[j])
  293. }
  294. }
  295. }else if(val=="2"){
  296. for(var j=0;j<this.groupData.length;j++){
  297. if(this.groupData[j].isSure==0){
  298. newgroup.push(this.groupData[j])
  299. }
  300. }
  301. }
  302. this.groupDatas=newgroup
  303. this.groupDatass=newgroup
  304. this.Inquireclick()
  305. }
  306. },
  307. //编辑
  308. handleEdit(index, row) {
  309. console.log(index, row.id);
  310. },
  311. //删除
  312. handleDelete(index, row) {
  313. console.log(index, row.id);
  314. }
  315. },
  316. mounted(){
  317. this.token=JSON.parse(localStorage.getItem('userinif')).token;
  318. console.log(this.token)
  319. this.Grouplist();
  320. }
  321. }
  322. </script>
  323. <style>
  324. .group-list{
  325. background-color: #fff;
  326. padding: 10px;
  327. box-shadow: 0 0 5px #0005;
  328. border-radius: 10px;
  329. min-width: 1525px;
  330. }
  331. .group-title{
  332. display: flex;
  333. font-size: 17px;
  334. font-weight:600 ;
  335. color: #555;
  336. margin-top: 8px;
  337. margin-bottom: 2px;
  338. justify-content: space-between;
  339. align-items: center;
  340. }
  341. .group-box{
  342. display: flex;
  343. }
  344. .group-box>button{
  345. margin-left: 10px;
  346. padding: 8px 20px;
  347. }
  348. .el-table td.el-table__cell, .el-table th.el-table__cell.is-leaf{
  349. text-align: center;
  350. }
  351. .group-box>.el-input{
  352. margin-left: 10px;
  353. }
  354. </style>