Blame view

src/views/resource/myItemOutAuditOrdersList.vue 6.29 KB
b25b036d   wuxw   v1.9 优化日期
1
  <template>
9c311762   wuxw   工作办理测试中
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
    <div class="animated fadeInRight ecommerce padding">
      <el-row>
        <el-col :span="24">
          <el-card class="box-card">
            <div slot="header" class="flex justify-between">
              <div>{{ $t('myItemOutAuditOrders.title') }}</div>
              <div class="ibox-tools">
                <el-button type="primary" size="small" @click="goBack">
                  <i class="el-icon-close"></i>
                  {{ $t('myItemOutAuditOrders.back') }}
                </el-button>
                <el-button type="primary" size="small" @click="_queryAuditOrdersMethod">
                  <i class="el-icon-refresh"></i>
                  {{ $t('myItemOutAuditOrders.refresh') }}
                </el-button>
              </div>
            </div>
            <div class="">
              <el-table :data="auditOrdersInfo.auditOrders" style="width: 100%" border stripe>
                <el-table-column prop="applyOrderId" :label="$t('myItemOutAuditOrders.orderNo')" align="center" />
                <el-table-column prop="resOrderTypeName" :label="$t('myItemOutAuditOrders.orderType')" align="center" />
                <el-table-column prop="stateName" :label="$t('myItemOutAuditOrders.orderStatus')" align="center" />
                <el-table-column prop="userName" :label="$t('myItemOutAuditOrders.applicant')" align="center" />
                <el-table-column prop="createTime" :label="$t('myItemOutAuditOrders.createTime')" align="center" />
                <el-table-column :label="$t('myItemOutAuditOrders.operation')" align="center" width="300">
                  <template slot-scope="scope">
                    <el-button-group>
                      <el-button size="mini" @click="_openDetailPurchaseApplyModel(scope.row)">
                        {{ $t('myItemOutAuditOrders.view') }}
                      </el-button>
                      <el-button v-if="scope.row.createUserId === auditOrdersInfo.currentUserId" size="mini"
                        @click="_openEditPurchaseModel(scope.row)">
                        {{ $t('myItemOutAuditOrders.edit') }}
                      </el-button>
                      <el-button v-if="scope.row.curTaskName === '仓库管理员'" size="mini"
                        @click="_distributionOrder(scope.row)">
                        {{ $t('myItemOutAuditOrders.itemDistribution') }}
                      </el-button>
                      <el-button v-else size="mini" @click="_openAuditOrderModel(scope.row)">
                        {{ $t('myItemOutAuditOrders.audit') }}
                      </el-button>
                    </el-button-group>
                  </template>
                </el-table-column>
              </el-table>
              <el-pagination :current-page.sync="currentPage" :page-size="pageSize" :total="total"
                layout="total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange"
                @current-change="handleCurrentChange" />
            </div>
          </el-card>
        </el-col>
      </el-row>
    </div>
  </template>
  
  <script>
  import { getCollectionAuditOrder } from '@/api/resource/myItemOutAuditOrdersApi'
  import { getCommunityId } from '@/api/community/communityApi'
19bafb73   wuxw   v1.9 优化采购相关bug
60
  import { getUserId } from '@/api/user/userApi'
9c311762   wuxw   工作办理测试中
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
  
  export default {
    name: 'MyItemOutAuditOrdersList',
    data() {
      return {
        DEFAULT_PAGE: 1,
        DEFAULT_ROWS: 10,
        currentPage: 1,
        pageSize: 10,
        total: 0,
        auditOrdersInfo: {
          auditOrders: [],
          total: 0,
          records: 1,
          moreCondition: false,
          userName: '',
          currentUserId: '',
          conditions: {
            AuditOrdersId: '',
            userName: '',
            auditLink: '',
            page: 1,
            row: 10
          },
          orderInfo: '',
          procure: false,
          audit: '1'
        }
      }
    },
    created() {
19bafb73   wuxw   v1.9 优化采购相关bug
92
      this.auditOrdersInfo.currentUserId = getUserId()
9c311762   wuxw   工作办理测试中
93
94
95
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
      this._listAuditOrders(this.DEFAULT_PAGE, this.DEFAULT_ROWS)
    },
    methods: {
      async _listAuditOrders(page, rows) {
        this.auditOrdersInfo.audit = '1'
        this.auditOrdersInfo.conditions.page = page
        this.auditOrdersInfo.conditions.row = rows
        const params = {
          ...this.auditOrdersInfo.conditions,
          communityId: getCommunityId()
        }
  
        try {
          const { data, total } = await getCollectionAuditOrder(params)
          this.auditOrdersInfo.total = total
          this.auditOrdersInfo.records = total
          this.auditOrdersInfo.auditOrders = data
          this.total = total
        } catch (error) {
          console.error('请求失败:', error)
        }
      },
      _openAuditOrderModel(auditOrder) {
        this.$router.push({
          path: '/views/resource/purchaseApplyDetail',
          query: {
            applyOrderId: auditOrder.applyOrderId,
            resOrderType: auditOrder.resOrderType,
19bafb73   wuxw   v1.9 优化采购相关bug
121
            flowId: auditOrder.flowId,
9c311762   wuxw   工作办理测试中
122
123
124
125
126
127
128
129
130
131
            action: 'audit',
            taskId: auditOrder.taskId
          }
        })
      },
      _queryAuditOrdersMethod() {
        this._listAuditOrders(this.DEFAULT_PAGE, this.DEFAULT_ROWS)
      },
      _openDetailPurchaseApplyModel(purchaseApply) {
        this.$router.push({
19bafb73   wuxw   v1.9 优化采购相关bug
132
          path: '/views/resource/purchaseApplyDetail',
9c311762   wuxw   工作办理测试中
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
          query: {
            applyOrderId: purchaseApply.applyOrderId,
            resOrderType: purchaseApply.resOrderType
          }
        })
      },
      _openEditPurchaseModel(purchaseApply) {
        this.$router.push({
          path: '/pages/resource/editPurchaseApply',
          query: {
            applyOrderId: purchaseApply.applyOrderId,
            resOrderType: purchaseApply.resOrderType
          }
        })
      },
      _distributionOrder(purchaseApply) {
        this.$router.push({
19bafb73   wuxw   v1.9 优化采购相关bug
150
          path: '/pages/admin/resourceOutManage',
9c311762   wuxw   工作办理测试中
151
152
153
          query: {
            applyOrderId: purchaseApply.applyOrderId,
            resOrderType: purchaseApply.resOrderType,
19bafb73   wuxw   v1.9 优化采购相关bug
154
155
            taskId: purchaseApply.taskId,
            flowId: purchaseApply.flowId
9c311762   wuxw   工作办理测试中
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
          }
        })
      },
      goBack() {
        this.$router.go(-1)
      },
      handleSizeChange(val) {
        this.pageSize = val
        this._listAuditOrders(this.currentPage, val)
      },
      handleCurrentChange(val) {
        this.currentPage = val
        this._listAuditOrders(val, this.pageSize)
      }
    }
  }
  </script>
  
  <style scoped>
  .ibox-tools {
    float: right;
  }
  
  .clearfix:before,
  .clearfix:after {
    display: table;
    content: "";
  }
  
  .clearfix:after {
    clear: both;
  }
  
  .box-card {
    margin-bottom: 20px;
  }
  
  .el-pagination {
    margin-top: 15px;
    text-align: right;
  }
  </style>