GroupStatus.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. <template>
  2. <div>
  3. <div class="groupstatus-all">
  4. <div class="groupstatus-box">
  5. <div>
  6. <el-select style="width:250px" v-model="value" clearable placeholder="请选择" @change="filterStatus(value)">
  7. <el-option
  8. v-for="item in options"
  9. :key="item.value"
  10. :label="item.label"
  11. :value="item.value">
  12. </el-option>
  13. </el-select>
  14. <el-input
  15. style="width:200px;"
  16. placeholder="请输入查询内容"
  17. v-model="input"
  18. clearable>
  19. </el-input>
  20. <el-button @click="Inquireclick()" type="primary">查 询</el-button>
  21. </div>
  22. </div>
  23. <div class="groupstatus-title">
  24. <div>团组列表</div>
  25. </div>
  26. <template>
  27. <el-table
  28. :data="groupData"
  29. border
  30. style="width: 100%">
  31. <el-table-column
  32. prop="num"
  33. label="序 号"
  34. width="55">
  35. <template slot-scope="scope">
  36. {{(currentPage - 1) * pageSize + scope.$index + 1}}
  37. </template>
  38. </el-table-column>
  39. <el-table-column
  40. prop="tourCode"
  41. width="100"
  42. label="团 号">
  43. </el-table-column>
  44. <el-table-column
  45. width="100"
  46. prop="salesQuoteNo"
  47. label="销售报价号">
  48. </el-table-column>
  49. <el-table-column
  50. prop="teamType"
  51. label="团组类型"
  52. width="150">
  53. </el-table-column>
  54. <el-table-column
  55. prop="teamName"
  56. label="团队名称"
  57. >
  58. </el-table-column>
  59. <el-table-column
  60. prop="clientName"
  61. label="客户名称"
  62. width="100">
  63. </el-table-column>
  64. <el-table-column
  65. prop="clientUnit"
  66. label="客户单位">
  67. </el-table-column>
  68. <el-table-column
  69. prop="visitDate"
  70. :formatter="filteryear"
  71. label="出访时间"
  72. width="100">
  73. </el-table-column>
  74. <el-table-column
  75. prop="visitDays"
  76. label="出访天数"
  77. width="80">
  78. </el-table-column>
  79. <el-table-column
  80. prop="visitPNumber"
  81. label="出访人数"
  82. width="80">
  83. </el-table-column>
  84. <el-table-column
  85. prop="jietuanOperator"
  86. label="接团操作人"
  87. width="110">
  88. </el-table-column>
  89. <el-table-column label="操作" width="110">
  90. <template slot-scope="scope">
  91. <el-button
  92. v-if="scope.row.isSure=0"
  93. type="primary"
  94. size="mini"
  95. @click="Complete(scope.$index, scope.row)">操作完成</el-button>
  96. <el-button
  97. v-if="scope.row.isSure=1"
  98. type="primary"
  99. size="mini"
  100. >已完成</el-button>
  101. </template>
  102. </el-table-column>
  103. </el-table>
  104. </template>
  105. <div class="block">
  106. <el-pagination align='center'
  107. @size-change="handleSizeChange"
  108. @current-change="handleCurrentChange"
  109. :current-page="currentPage"
  110. :page-sizes="[10,12,15,20]"
  111. :page-size="pageSize"
  112. layout="total, sizes, prev, pager, next"
  113. :total="count">
  114. </el-pagination>
  115. </div>
  116. </div>
  117. </div>
  118. </template>
  119. <script>
  120. import { el } from '@fullcalendar/core/internal-common'
  121. export default {
  122. data() {
  123. return {
  124. token:'',
  125. userid:'',
  126. value:'-1',
  127. options: [
  128. {
  129. value: '-1',
  130. label: '全部'
  131. }, {
  132. value: '0',
  133. label: '未完成'
  134. }, {
  135. value: '1',
  136. label: '已完成'
  137. }
  138. ],
  139. groupData:[],
  140. count:0,//总条数
  141. currentPage: 1, // 当前页码
  142. pageSize: 10 ,// 每页的数据条数
  143. input:'',
  144. }
  145. },
  146. methods:{
  147. //分页api
  148. PostGroupStatusPageList(){
  149. var url = "/api/Groups/PostGroupStatusPageList"
  150. var that = this
  151. console.log(that.value)
  152. this.$axios({
  153. method: 'post',
  154. url: url,
  155. headers: {
  156. Authorization: 'Bearer ' + this.token
  157. },
  158. data: {
  159. portType: 1,
  160. pageIndex: that.currentPage,
  161. pageSize: that.pageSize,
  162. isSure: that.value,
  163. searchCriteria: that.input,
  164. }
  165. }).then(function (res) {
  166. console.log(res)
  167. if (res.data.code == 200) {
  168. that.groupData=res.data.data
  169. console.log(that.groupData)
  170. that.count=res.data.count
  171. }else{
  172. }
  173. })
  174. },
  175. //每页条数改变时触发 选择一页显示多少行
  176. handleSizeChange(val) {
  177. this.currentPage = 1;
  178. this.pageSize = val;
  179. this.PostGroupStatusPageList()
  180. },
  181. //当前页改变时触发 跳转其他页
  182. handleCurrentChange(val) {
  183. this.currentPage = val;
  184. this.PostGroupStatusPageList()
  185. },
  186. filteryear(val){
  187. let gstime=val.visitDate.split(' ')[0]
  188. return gstime;
  189. },
  190. //模糊查询
  191. Inquireclick(){
  192. this.currentPage=1;
  193. this.PostGroupStatusPageList()
  194. },
  195. //筛选状态
  196. filterStatus(){
  197. this.currentPage=1;
  198. this.PostGroupStatusPageList();
  199. },
  200. //操作完成
  201. Complete(index, row){
  202. console.log(index, row.id)
  203. var url = "/api/Groups/PostGroupStatusSetOperationComplete"
  204. var that = this
  205. this.$axios({
  206. method: 'post',
  207. url: url,
  208. headers: {
  209. Authorization: 'Bearer ' + this.token
  210. },
  211. data: {
  212. id:row.id
  213. }
  214. }).then(function (res) {
  215. if (res.data.code == 200) {
  216. console.log(res)
  217. that.$message({
  218. message: '操作成功',
  219. type: 'success'
  220. });
  221. that.PostGroupStatusPageList();
  222. }else{
  223. that.$message.error('操作失败');
  224. }
  225. })
  226. }
  227. },
  228. mounted(){
  229. this.token=JSON.parse(localStorage.getItem('userinif')).token;
  230. this.userid=JSON.parse(localStorage.getItem('userinif')).userInfo.userId;
  231. this.PostGroupStatusPageList();
  232. }
  233. }
  234. </script>
  235. <style>
  236. .groupstatus-all{
  237. background-color: #fff;
  238. padding: 10px;
  239. box-shadow: 0 0 5px #0005;
  240. border-radius: 10px;
  241. height: 100%;
  242. min-height: 840px;
  243. }
  244. .groupstatus-title{
  245. display: flex;
  246. font-size: 17px;
  247. font-weight:600 ;
  248. color: #555;
  249. margin-top: 10px;
  250. margin-bottom: 8px;
  251. justify-content: space-between;
  252. align-items: center;
  253. }
  254. .groupstatus-box{
  255. display: flex;
  256. justify-content: space-between;
  257. }
  258. .groupstatus-all .block{
  259. margin-top: 10px;
  260. }
  261. </style>