Blame view

src/views/resource/myAuditOrdersList.vue 6.95 KB
e5777926   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
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
97
98
99
100
101
102
103
104
105
106
  <template>
    <div class="animated fadeInRight ecommerce">
      <el-row>
        <el-col :span="24">
          <el-card>
            <div slot="header" class="flex justify-between">
              <div>{{ $t('myAuditOrders.todoList') }}</div>
              <div class="ibox-tools" style="float: right;">
                <el-button type="primary" size="small" @click="goBack">
                  <i class="el-icon-close"></i>
                  {{ $t('myAuditOrders.back') }}
                </el-button>
                <el-button type="primary" size="small" @click="_queryAuditOrdersMethod">
                  <i class="el-icon-refresh"></i>
                  {{ $t('myAuditOrders.refresh') }}
                </el-button>
              </div>
            </div>
            <div class="">
              <el-table :data="auditOrdersInfo.auditOrders" style="width: 100%" border stripe
                :default-sort="{ prop: 'createTime', order: 'descending' }">
                <el-table-column prop="applyOrderId" :label="$t('myAuditOrders.orderNumber')"
                  align="center"></el-table-column>
                <el-table-column prop="resOrderTypeName" :label="$t('myAuditOrders.orderType')"
                  align="center"></el-table-column>
                <el-table-column prop="stateName" :label="$t('myAuditOrders.orderStatus')"
                  align="center"></el-table-column>
                <el-table-column prop="userName" :label="$t('myAuditOrders.applicant')" align="center"></el-table-column>
                <el-table-column prop="createTime" :label="$t('myAuditOrders.createTime')" align="center"
                  sortable></el-table-column>
                <el-table-column :label="$t('myAuditOrders.operation')" align="center" width="300">
                  <template slot-scope="scope">
                    <el-button-group>
                      <el-button size="mini" @click="_openDetailPurchaseApplyModel(scope.row)">
                        {{ $t('myAuditOrders.view') }}
                      </el-button>
                      <el-button size="mini" v-if="scope.row.createUserId == auditOrdersInfo.currentUserId"
                        @click="_openEditPurchaseModel(scope.row)">
                        {{ $t('myAuditOrders.edit') }}
                      </el-button>
                      <el-button size="mini" v-if="scope.row.curTaskName == '仓库管理员'"
                        @click="_procureEnterOrder(scope.row)">
                        {{ $t('myAuditOrders.procurement') }}
                      </el-button>
                      <el-button size="mini" v-else @click="_openAuditOrderModel(scope.row)">
                        {{ $t('myAuditOrders.audit') }}
                      </el-button>
                    </el-button-group>
                  </template>
                </el-table-column>
              </el-table>
              <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
                :current-page="currentPage" :page-sizes="[10, 20, 30, 50]" :page-size="pageSize"
                layout="total, sizes, prev, pager, next, jumper" :total="total" style="margin-top: 20px;"></el-pagination>
            </div>
          </el-card>
        </el-col>
      </el-row>
    </div>
  </template>
  
  <script>
  import { listAuditOrders, listWorkflowStepStaffs } from '@/api/resource/myAuditOrdersApi'
  //import { getCommunityId } from '@/api/community/communityApi'
  
  export default {
    name: 'MyAuditOrdersList',
    data() {
      return {
        DEFAULT_PAGE: 1,
        DEFAULT_ROWS: 10,
        auditOrdersInfo: {
          auditOrders: [],
          total: 0,
          records: 1,
          moreCondition: false,
          userName: '',
          currentUserId: '',
          conditions: {
            AuditOrdersId: '',
            userName: '',
            auditLink: '',
            page: 1,
            row: 10
          },
          orderInfo: '',
          procure: false,
          audit: '1'
        },
        currentPage: 1,
        pageSize: 10,
        total: 0
      }
    },
    created() {
      this._initMethod()
    },
    mounted() {
      this._initEvent()
    },
    methods: {
      _initMethod() {
        this._listAuditOrders(this.DEFAULT_PAGE, this.DEFAULT_ROWS)
        this._loadStepStaff()
      },
      _initEvent() {
9c311762   wuxw   工作办理测试中
107
  
e5777926   wuxw   优化工作办理
108
109
110
111
112
113
114
      },
      async _listAuditOrders(_page, _rows) {
        this.auditOrdersInfo.audit = '1'
        this.auditOrdersInfo.conditions.page = _page
        this.auditOrdersInfo.conditions.row = _rows
        try {
          const res = await listAuditOrders(this.auditOrdersInfo.conditions)
19bafb73   wuxw   v1.9 优化采购相关bug
115
116
117
118
119
          this.auditOrdersInfo.total = res.total
          this.auditOrdersInfo.records = res.records
          this.auditOrdersInfo.auditOrders = res.data
          console.log(res)
          this.total = res.total
e5777926   wuxw   优化工作办理
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
          this.currentPage = _page
        } catch (error) {
          console.error('请求失败:', error)
        }
      },
      _openAuditOrderModel(_purchaseApply) {
        this.$router.push({
          path: '/views/resource/purchaseApplyDetail',
          query: {
            applyOrderId: _purchaseApply.applyOrderId,
            resOrderType: _purchaseApply.resOrderType,
            action: 'audit',
            taskId: _purchaseApply.taskId,
            flowId: _purchaseApply.flowId
          }
        })
      },
      _queryAuditOrdersMethod() {
        this._listAuditOrders(this.DEFAULT_PAGE, this.DEFAULT_ROWS)
      },
      _openDetailPurchaseApplyModel(_purchaseApply) {
        this.$router.push({
19bafb73   wuxw   v1.9 优化采购相关bug
142
          path: '/views/resource/purchaseApplyDetail',
e5777926   wuxw   优化工作办理
143
144
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
217
218
219
220
221
          query: {
            applyOrderId: _purchaseApply.applyOrderId,
            resOrderType: _purchaseApply.resOrderType
          }
        })
      },
      async _loadStepStaff() {
        try {
          const res = await listWorkflowStepStaffs({
            page: 1,
            row: 1,
            staffId: this.auditOrdersInfo.currentUserId,
            staffRole: '2002',
            requestType: 'purchaseHandle'
          })
          if (res.data.length > 0) {
            this.auditOrdersInfo.procure = true
          }
        } catch (error) {
          console.error('请求失败:', error)
        }
      },
      _procureEnterOrder(_purchaseApply) {
        this.$router.push({
          path: '/views/resource/resourceEnterManage',
          query: {
            applyOrderId: _purchaseApply.applyOrderId,
            resOrderType: _purchaseApply.resOrderType,
            taskId: _purchaseApply.taskId
          }
        })
      },
      _openEditPurchaseModel(_purchaseApply) {
        this.$router.push({
          path: '/pages/resource/editPurchaseApply',
          query: {
            applyOrderId: _purchaseApply.applyOrderId,
            resOrderType: _purchaseApply.resOrderType
          }
        })
      },
      handleSizeChange(val) {
        this.pageSize = val
        this._listAuditOrders(this.currentPage, val)
      },
      handleCurrentChange(val) {
        this.currentPage = val
        this._listAuditOrders(val, this.pageSize)
      },
      goBack() {
        this.$router.go(-1)
      }
    }
  }
  </script>
  
  <style lang="scss" scoped>
  .ecommerce {
    padding: 20px;
  }
  
  .ibox-tools {
    display: inline-block;
    float: right;
    margin-top: 0;
    position: relative;
    padding: 0;
  }
  
  .clearfix:before,
  .clearfix:after {
    display: table;
    content: "";
  }
  
  .clearfix:after {
    clear: both;
  }
  </style>