Blame view

src/views/resource/allocationStorehouseAuditOrdersList.vue 6.98 KB
9c311762   wuxw   工作办理测试中
1
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
  <template>
    <div class="allocation-storehouse-audit-orders-container animated fadeInRight">
      <el-row>
        <el-col :span="24">
          <el-card class="box-card">
            <div slot="header" class="clearfix">
              <span>{{ $t('allocationStorehouseAuditOrders.title') }}</span>
              <div class="card-header-actions">
                <el-button type="primary" size="small" @click="goBack">
                  <i class="el-icon-close"></i>
                  {{ $t('allocationStorehouseAuditOrders.back') }}
                </el-button>
                <el-button type="primary" size="small" @click="queryAuditOrders">
                  <i class="el-icon-refresh"></i>
                  {{ $t('allocationStorehouseAuditOrders.refresh') }}
                </el-button>
              </div>
            </div>
  
            <el-table :data="allocationStorehouseAuditOrdersInfo.auditOrders" border style="width: 100%"
              v-loading="loading">
              <el-table-column prop="applyId" :label="$t('allocationStorehouseAuditOrders.scheduleNo')" align="center" />
              <el-table-column prop="applyCount" :label="$t('allocationStorehouseAuditOrders.allocationCount')"
                align="center" />
              <el-table-column prop="startUserName" :label="$t('allocationStorehouseAuditOrders.applicant')"
                align="center" />
              <el-table-column prop="stateName" :label="$t('allocationStorehouseAuditOrders.status')" align="center" />
              <el-table-column prop="createTime" :label="$t('allocationStorehouseAuditOrders.time')" align="center" />
              <el-table-column :label="$t('allocationStorehouseAuditOrders.operation')" align="center" width="250">
                <template slot-scope="scope">
                  <el-button-group>
                    <el-button size="mini" @click="toDetail(scope.row)">
                      {{ $t('allocationStorehouseAuditOrders.view') }}
                    </el-button>
                    <el-button size="mini"
                      v-if="scope.row.startUserId === allocationStorehouseAuditOrdersInfo.currentUserId"
                      @click="openEditPurchaseModel(scope.row)">
                      {{ $t('allocationStorehouseAuditOrders.edit') }}
                    </el-button>
                    <el-button size="mini" v-if="scope.row.curTaskName === '仓库管理员'"
                      @click="allocationStorehouseEnter(scope.row)">
                      {{ $t('allocationStorehouseAuditOrders.allocation') }}
                    </el-button>
                    <el-button size="mini" v-else @click="openAuditOrderModel(scope.row)">
                      {{ $t('allocationStorehouseAuditOrders.approve') }}
                    </el-button>
                  </el-button-group>
                </template>
              </el-table-column>
            </el-table>
  
            <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
              :current-page="pagination.currentPage" :page-sizes="[10, 20, 30, 50]" :page-size="pagination.pageSize"
              layout="total, sizes, prev, pager, next, jumper" :total="pagination.total" class="pagination">
            </el-pagination>
          </el-card>
        </el-col>
      </el-row>
    </div>
  </template>
  
  <script>
  import { listAllocationStoreAuditOrders, listWorkflowStepStaffs } from '@/api/resource/allocationStorehouseAuditOrdersApi'
  import { getCommunityId } from '@/api/community/communityApi'
19bafb73   wuxw   v1.9 优化采购相关bug
65
  import { getUserId } from '@/api/user/userApi'
9c311762   wuxw   工作办理测试中
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
  
  export default {
    name: 'AllocationStorehouseAuditOrdersList',
    data() {
      return {
        loading: false,
        communityId: '',
        allocationStorehouseAuditOrdersInfo: {
          auditOrders: [],
          currentUserId: '',
          conditions: {
            AuditOrdersId: '',
            userName: '',
            auditLink: '',
            page: 1,
            row: 10
          },
          procure: false,
          audit: '1'
        },
        pagination: {
          currentPage: 1,
          pageSize: 10,
          total: 0
        }
      }
    },
    created() {
      this.communityId = getCommunityId()
19bafb73   wuxw   v1.9 优化采购相关bug
95
      this.allocationStorehouseAuditOrdersInfo.currentUserId = getUserId()
9c311762   wuxw   工作办理测试中
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
      this.listAuditOrders()
      this.loadStepStaff()
    },
    methods: {
      async listAuditOrders() {
        this.loading = true
        try {
          const params = {
            ...this.allocationStorehouseAuditOrdersInfo.conditions,
            communityId: this.communityId
          }
          const res = await listAllocationStoreAuditOrders(params)
          this.allocationStorehouseAuditOrdersInfo.auditOrders = res.data
          this.pagination.total = res.total
        } catch (error) {
          console.error('获取审核订单列表失败:', error)
        } finally {
          this.loading = false
        }
      },
      async loadStepStaff() {
        try {
          const params = {
            page: 1,
            row: 1,
            staffId: this.allocationStorehouseAuditOrdersInfo.currentUserId,
            staffRole: '3003',
            requestType: 'allocationHandle'
          }
          const res = await listWorkflowStepStaffs(params)
          if (res.data.length > 0) {
            this.allocationStorehouseAuditOrdersInfo.procure = true
          }
        } catch (error) {
          console.error('获取步骤员工失败:', error)
        }
      },
      queryAuditOrders() {
        this.pagination.currentPage = 1
        this.listAuditOrders()
      },
      openAuditOrderModel(auditOrder) {
        this.$router.push({
          path: '/pages/common/allocationStorehouseDetail',
          query: {
            applyId: auditOrder.applyId,
            action: 'audit',
19bafb73   wuxw   v1.9 优化采购相关bug
143
144
            taskId: auditOrder.taskId,
            flowId: auditOrder.flowId
9c311762   wuxw   工作办理测试中
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
          }
        })
      },
      openEditPurchaseModel(auditOrder) {
        this.$router.push({
          path: '/pages/resource/editAllocationStorehouseApply',
          query: { applyId: auditOrder.applyId }
        })
      },
      allocationStorehouseEnter(auditOrder) {
        this.$router.push({
          path: '/pages/resource/allocationStorehouseEnter',
          query: {
            applyId: auditOrder.applyId,
            taskId: auditOrder.taskId
          }
        })
      },
      toDetail(item) {
        this.$router.push({
          path: '/pages/common/allocationStorehouseDetail',
          query: { applyId: item.applyId }
        })
      },
      goBack() {
        this.$router.go(-1)
      },
      handleSizeChange(val) {
        this.pagination.pageSize = val
        this.allocationStorehouseAuditOrdersInfo.conditions.row = val
        this.listAuditOrders()
      },
      handleCurrentChange(val) {
        this.pagination.currentPage = val
        this.allocationStorehouseAuditOrdersInfo.conditions.page = val
        this.listAuditOrders()
      }
    }
  }
  </script>
  
  <style lang="scss" scoped>
  .allocation-storehouse-audit-orders-container {
    padding: 20px;
  
    .box-card {
      margin-bottom: 20px;
  
      .clearfix {
        display: flex;
        justify-content: space-between;
        align-items: center;
      }
  
      .card-header-actions {
        display: flex;
        gap: 10px;
      }
    }
  
    .pagination {
      margin-top: 20px;
      text-align: right;
    }
  
    .el-button-group {
      display: flex;
      flex-wrap: wrap;
      gap: 5px;
    }
  }
  </style>