选煤厂生产管理平台前端代码
dongyukun
2024-12-10 5cc1d92af645c2f8f4f6d1d3777283b70df78ccd
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
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
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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
<template>
  <div>
    <el-card shadow="never" class="aui-card--fill">
      <div class="mod-list">
        <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
          <el-form-item v-if="type === 'monthly'">
            <el-date-picker
              v-model="dataForm.ny"
              type="month"
              value-format="yyyy-MM"
              placeholder="选择月">
            </el-date-picker>
          </el-form-item>
          <el-form-item v-if="type === 'yearly'">
            <el-date-picker
              v-model="dataForm.ny"
              type="year"
              value-format="yyyy"
              placeholder="选择年">
            </el-date-picker>
          </el-form-item>
          <el-form-item>
            <el-button @click="getDataList()">查询</el-button>
            <el-button type="primary" @click="openForm()">新增</el-button>
            <el-button @click="exportExcel()">导出</el-button>
          </el-form-item>
        </el-form>
        <el-table
          ref="table"
          v-loading="dataListLoading"
          :data="dataList"
          height="400"
          highlight-current-row
          @current-change="currentChange"
          border
          style="width: 100%;">
          <el-table-column prop="lsh" header-align="center" align="center" min-width="200"
                           label="流水号"></el-table-column>
          <el-table-column prop="ny" header-align="center" align="center" min-width="200"
                           :label="type === 'monthly' ? '月份' : '年份'"></el-table-column>
          <el-table-column prop="bzr" header-align="center" align="center" min-width="150"
                           label="编制人"></el-table-column>
          <el-table-column prop="bzsj" header-align="center" align="center" min-width="200"
                           label="编制时间"></el-table-column>
          <el-table-column prop="bpmCreateDate" header-align="center" align="center" min-width="200"
                           label="上报时间"></el-table-column>
          <el-table-column prop="shsj" header-align="center" align="center" min-width="200"
                           label="审核时间"></el-table-column>
          <el-table-column prop="bpmStatusName" header-align="center" align="center" width="150"
                           label="状态"></el-table-column>
          <el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center"
                           width="100">
            <template slot-scope="scope">
              <el-button type="text" size="small"
                         @click="viewHandle(scope.row.id)">详情
              </el-button>
              <span>|</span>
              <el-dropdown>
              <span class="el-dropdown-link">
                <el-button type="text" size="small">更多</el-button>
                <i class="el-icon-arrow-down el-icon--right"></i>
              </span>
                <el-dropdown-menu slot="dropdown">
                  <el-dropdown-item>
                    <el-button type="text" size="small"
                               v-if="(scope.row.bpmStatus === 1 || scope.row.bpmStatus === 0)"
                               @click="openForm(scope.row.id)">修改
                    </el-button>
                  </el-dropdown-item>
                  <el-dropdown-item>
                    <el-button type="text" size="small"
                               v-if="(scope.row.bpmStatus === 1 || scope.row.bpmStatus === 0)"
                               @click="handleDelete(scope.row.id)">删除
                    </el-button>
                  </el-dropdown-item>
                  <el-dropdown-item>
                    <el-button v-if="scope.row.bpmStatus === 2"
                               @click="clickCancelProcess(scope.row)" type="text"
                               size="small">撤回
                    </el-button>
                  </el-dropdown-item>
                  <el-dropdown-item>
                    <el-button v-if="scope.row.bpmStatus === 0" @click="clickSubmitApply(scope.row)"
                               type="text"
                               size="small">重新申请
                    </el-button>
                  </el-dropdown-item>
                  <el-dropdown-item>
                    <el-button v-if="scope.row.bpmStatus === 1" @click="clickSubmitApply(scope.row)"
                               type="text"
                               size="small">提交申请
                    </el-button>
                  </el-dropdown-item>
                  <el-dropdown-item>
                    <el-button
                      v-if="scope.row.bpmStatus === 2 || scope.row.bpmStatus === 3 || scope.row.bpmStatus === 4"
                      @click="clickProcessHistory(scope.row)" type="text" size="small">审批历史
                    </el-button>
                  </el-dropdown-item>
                </el-dropdown-menu>
              </el-dropdown>
            </template>
          </el-table-column>
        </el-table>
        <el-pagination
          :current-page="page"
          :page-sizes="[10, 20, 50, 100]"
          :page-size="limit"
          :total="total"
          layout="total, sizes, prev, pager, next, jumper"
          @size-change="pageSizeChangeHandle"
          @current-change="pageCurrentChangeHandle">
        </el-pagination>
        <!-- 弹窗, 新增 / 修改 -->
        <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" :type="type"
                       @refreshDataList="getDataList"></add-or-update>
        <!-- 弹窗, 详情 -->
        <info-view v-if="dataViewVisible" ref="dataView" :type="type"></info-view>
        <!-- 弹窗, 详细列表 -->
        <Form v-if="detListVisible" ref="formRef" style="height: 100%"></det-list>
        <!-- 提交申请 -->
        <submit-apply ref="sumbitApplyRef" :row="row" @refreshDataList="getDataList"></submit-apply>
        <!-- 撤回申请 -->
        <cancel-apply ref="cancelRef" :businessKey="row.id" :procInstId="row.procInstId"
                      @refreshDataList="getDataList"></cancel-apply>
        <!-- 审批历史 -->
        <history ref="historyRef" :businessKey="row.id" :procInstId="row.procInstId"></history>
      </div>
    </el-card>
    <el-card shadow="never" class="aui-card--fill">
      <div class="mod-analysis-full-det">
        <data-det ref="dataDet"></data-det>
      </div>
    </el-card>
  </div>
 
</template>
<script lang="ts" setup>
  import DetList from './prodPlanDet'
  import AddOrUpdate from './prodPlanAddOrUpdate'
  import InfoView from './prodPlanView'
  import SubmitApply from '@/components/process/SubmitApply'
  import CancelApply from '@/components/process/CancelApply'
  import History from '@/components/process/History'
  import DataDet from './prodPlanDet'
  import {exportByDom} from "@/utils/exportUtil";
  import {ref} from "vue";
 
 
  const type = ref('')
 
  const dataForm = reactive({
    jhlb: type,
    ny: '',
    sslb: ''
  })
  const detListVisible = ref(false)
  const dataViewVisible = ref(false)
 
  //工作流需要
  const row = ref({}) //要提交审批的记录
  const assigneeParams = reactive({
    roleName: '', //办理人角色
    sameDept: 0 //是否同部门
  })
 
  // 查看详细
  const currentChange = async (currentRow) => {
      this.$nextTick(() => {
        this.$refs.dataDet.init(currentRow)
      })
    },
    // 删除
    const  handleDelete
  (id)
  {
    this.$confirm(`确定对选中项进行删除操作?`, '提示', {
      confirmButtonText: '确定',
      cancelButtonText: '取消',
      type: 'warning'
    }).then(() => {
      this.$http({
        url: `/iailab-iems-coal-proddisp/wash/plan/delete/${id}`,
        method: 'post',
        params: this.$http.adornParams()
      }).then(({data}) => {
        if (data && data.code === 0) {
          this.$message({
            message: '操作成功',
            type: 'success',
            duration: 1500,
            onClose: () => {
              if (this.pageIndex > 1 && (this.totalPage - 1) % this.pageSize === 0) {
                this.pageIndex = this.pageIndex - 1
              }
              this.getDataList()
            }
          })
        } else {
          this.$message.error(data.msg)
        }
      })
    }).catch(() => {
    })
  }
  ,
 
  // 详情
  viewHandle(id)
  {
    this.dataViewVisible = true
    this.$refs.dataView.dataForm.id = id
    this.$nextTick(() => {
      this.$refs.dataView.init()
    })
  }
  ,
 
  commit(id)
  {
    this.$confirm(`确定对选中项进行提交操作?`, '提示', {
      confirmButtonText: '确定',
      cancelButtonText: '取消',
      type: 'warning'
    }).then(() => {
      this.$http({
        url: `/iailab-iems-coal-proddisp/wash/plan/commit/${id}`,
        method: 'post',
        params: this.$http.adornParams()
      }).then(({data}) => {
        if (data && data.code === 0) {
          this.$message({
            message: '操作成功',
            type: 'success',
            duration: 1500,
            onClose: () => {
              this.getDataList()
            }
          })
        } else {
          this.$message.error(data.msg)
        }
      })
    }).catch(() => {
    })
  }
  ,
 
  // 提交申请
  clickSubmitApply(row)
  {
    this.row = row
    this.$refs.sumbitApplyRef.visible = true
  }
  ,
 
  // 点击审批进度
  clickProcessHistory(row)
  {
    this.row = row
    this.$refs.historyRef.visible = true
  }
  ,
 
  // 撤回申请
  clickCancelProcess(row)
  {
    this.row = row
    this.$refs.cancelRef.visible = true
  }
  ,
  exportExcel()
  {
    let dom = this.$refs.table
    exportByDom(dom, undefined, this.type === 'monthly' ? '生产月计划' : '生产年计划')
  }
  }
  }
</script>