Blame view

src/components/staff/AStaffDetailItemOutApply.vue 3.5 KB
b25b036d   wuxw   v1.9 优化日期
1
  <template>
a42b3256   wuxw   HC小区管理系统前段vue版正在开发中
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
      <div class="staff-item-out-apply-container">
        <el-table :data="aStaffDetailItemOutApplyInfo.itemOuts" border style="width: 100%" class="margin-top">
          <el-table-column prop="applyOrderId" :label="$t('staffDetailItemOutApply.applyOrderId')" align="center" />
          <el-table-column prop="resourceNames" :label="$t('staffDetailItemOutApply.resourceNames')" align="center" />
          <el-table-column prop="userName" :label="$t('staffDetailItemOutApply.userName')" align="center" />
          <el-table-column prop="createUserName" :label="$t('staffDetailItemOutApply.createUserName')" align="center" />
          <el-table-column prop="createTime" :label="$t('staffDetailItemOutApply.createTime')" align="center" />
          <el-table-column prop="stateName" :label="$t('staffDetailItemOutApply.stateName')" align="center" />
          <el-table-column :label="$t('staffDetailItemOutApply.warehousingWay')" align="center">
            <template slot-scope="scope">
              {{ scope.row.warehousingWay === '10000' ? $t('staffDetailItemOutApply.direct') : $t('staffDetailItemOutApply.review') }}
            </template>
          </el-table-column>
          <el-table-column :label="$t('common.operation')" align="center">
            <template slot-scope="scope">
              <el-button size="mini" type="primary" @click="openDetailItemOutModel(scope.row)">
                {{ $t('common.detail') }}
              </el-button>
            </template>
          </el-table-column>
        </el-table>
        <el-pagination
          :current-page.sync="page.current"
          :page-sizes="[10, 15, 20, 30]"
          :page-size="page.size"
          :total="page.total"
          layout="total, sizes, prev, pager, next, jumper"
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
        />
      </div>
    </template>
    
    <script>
    import { listAdminPurchaseApplys } from '@/api/staff/adminStaffDetailApi'
    
    export default {
      name: 'AStaffDetailItemOutApply',
      data() {
        return {
          aStaffDetailItemOutApplyInfo: {
            itemOuts: [],
            staffId: '',
            tel: ''
          },
          page: {
            current: 1,
            size: 10,
            total: 0
          }
        }
      },
      methods: {
        switchTab(data) {
          this.aStaffDetailItemOutApplyInfo.staffId = data.staffId
          this.aStaffDetailItemOutApplyInfo.tel = data.tel
          this.loadItemOutApplyData(1, this.page.size)
        },
        async loadItemOutApplyData(page, row) {
          try {
            const { data, total } = await listAdminPurchaseApplys({
              resOrderType: '20000',
              endUserTel: this.aStaffDetailItemOutApplyInfo.tel,
              page,
              row
            })
            this.aStaffDetailItemOutApplyInfo.itemOuts = data.purchaseApplys
            this.page.total = total
          } catch (error) {
            this.$message.error(this.$t('staffDetailItemOutApply.fetchError'))
          }
        },
        openDetailItemOutModel(itemOut) {
          this.$router.push(`/views/common/purchaseApplyDetail?applyOrderId=${itemOut.applyOrderId}&resOrderType=20000`)
        },
        handleSizeChange(val) {
          this.page.size = val
          this.loadItemOutApplyData(this.page.current, this.page.size)
        },
        handleCurrentChange(val) {
          this.page.current = val
          this.loadItemOutApplyData(this.page.current, this.page.size)
        }
      }
    }
    </script>
    
    <style lang="scss" scoped>
    .staff-item-out-apply-container {
      padding: 20px;
      .margin-top {
        margin-top: 20px;
      }
    }
    </style>