| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- <template>
- <view>
- <uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="转派" @clickLeft="back">
- <template slot="right">
- <text class="btn-right" @click="submitReassign">确定</text>
- </template>
- </uni-nav-bar>
- <TurnSendInfo :list="list" @inputChange="changeUserData" @radioChange="getUserData"></TurnSendInfo>
- </view>
- </template>
- <script>
- import TurnSendInfo from '@/components/TurnSendInfo.vue'
- import {
- postJ
- } from "@/utils/api.js"
- let [page, size, isEnd] = [1, 20, true];
- export default {
- components:{
- TurnSendInfo
- },
- data() {
- return {
- pageId:'',
- executorId:'',
- executorName:'',
- list:[],
- searchForm: {deptCode:''} //筛选条件
- }
- },
- onLoad(option) {
- console.log(option)
- this.searchForm.deptCode = option.code;
- this.getList();
- },
- onReachBottom: function() {
- if (isEnd) {
- return;
- }
- // 显示加载图标
- // uni.showLoading({
- // title: "数据加载中"
- // });
- // this.getMoreLists();
- },
- methods: {
- //获取第一次数据
- getFirstList: function() {
- page = 1;
- isEnd = true;
- uni.showLoading({
- title: "数据加载中"
- });
- this.getList();
- },
- getMoreLists: function() {
- //获取更多数据
- page++;
- this.getList();
- },
- //获取列表数据
- getList() {
- postJ(this.apiUrl + "/main/user/users", this.searchForm).then(res => {
- this.list = res.data;
- // let pageTotal = res.data.pageTotal;
- // if (page === 1) {
- // data.forEach(el => {
- // el.num = 0
- // })
- // this.list = data;
- // } else {
- // data.forEach(element => {
- // element.num = 0;
- // this.list.push(element);
- // });
- // }
- // page < pageTotal ? (isEnd = false) : (isEnd = true);
- }).then(() => {
- uni.hideLoading()
- })
- },
- //筛选-重新获取数据
- changeUserData(data){
- this.searchForm = {
- name: data.name || ''
- };
- this.getFirstList();
- },
- //获取选中信息
- getUserData(data){
- this.executorId = data.executorId;
- this.executorName = data.executorName;
- },
- //确定
- submitReassign(){
- if(!this.executorId){
- uni.showToast({
- title:'请选择转派人员',
- icon:'none'
- })
- return
- }
- let data = {
- executorId: this.executorId,
- executorName: this.executorName
- }
- this.$store.dispatch("tour_tally/setExecutor", data);
- this.back()
- },
-
- }
- }
- </script>
- <style scoped lang="scss">
-
- </style>
|