选煤厂生产管理平台前端代码
提交 | 用户 | 时间
c3134f 1 <template>
D 2   <!-- 搜索 -->
3   <ContentWrap>
4     <el-form
5       class="-mb-15px"
6       :model="queryParams"
7       ref="queryFormRef"
8       :inline="true"
9       label-width="68px"
10     >
11       <el-form-item label="开始时间">
12         <el-date-picker
13           size="mini"
14           v-model="queryParams.startTime"
15           format="YYYY-MM-DD HH:mm:00"
16           value-format="YYYY-MM-DD HH:mm:00"
17           type="datetime"
18           :clearable="false"
19           placeholder="选择日期时间"/>
20       </el-form-item>
21       <el-form-item label="结束时间">
22         <el-date-picker
23           size="mini"
24           v-model="queryParams.endTime"
25           format="YYYY-MM-DD HH:mm:00"
26           value-format="YYYY-MM-DD HH:mm:00"
27           type="datetime"
28           :clearable="false"
29           placeholder="选择日期时间"/>
30       </el-form-item>
31       <el-form-item label="工单类型" prop="xsmz">
32         <el-select
33           v-model="queryParams.xsmz"
34           class="!w-240px"
35           clearable
36           placeholder="请选择工单类型"
37         >
38           <el-option
39             v-for="dict in getIntDictOptions(DICT_TYPE.PMS_XSMZ)"
40             :key="dict.value"
41             :label="dict.label"
42             :value="dict.value"
43           />
44         </el-select>
45       </el-form-item>
46       <el-form-item>
47         <el-button @click="handleQuery">
48           <Icon icon="ep:search" class="mr-5px"/>
49           搜索
50         </el-button>
51         <el-button @click="resetQuery">
52           <Icon icon="ep:refresh" class="mr-5px"/>
53           重置
54         </el-button>
55         <el-button
56           type="primary"
57           plain
58           @click="openForm('create')"
59           v-hasPermi="['data:point:create']"
60         >
61           <Icon icon="ep:plus" class="mr-5px"/>
62           新增
63         </el-button>
64       </el-form-item>
65     </el-form>
66   </ContentWrap>
67
68   <!-- 列表 -->
69   <ContentWrap>
70     <el-table border stripe v-loading="loading" :data="list">
71
72       <el-table-column type="index" header-align="center" align="center" width="50" label="序号"/>
73       <el-table-column prop="statusName" header-align="center" align="center" width="80" label="状态">
74         <template #default="scope">
75           <el-tag v-if="scope.row.status === '0'" size="small" effect="dark" color="#b8d900"
76                   style="border: 0px; padding-top: 1px">待处理
77           </el-tag>
78           <el-tag v-if="scope.row.status === '1'" size="small" effect="dark" color="#3290f9"
79                   style="border: 0px; padding-top: 1px">处理中
80           </el-tag>
81           <el-tag v-if="scope.row.status === '2'" size="small" effect="dark" color="#00b5ad"
82                   style="border: 0px; padding-top: 1px">已完成
83           </el-tag>
84           <el-tag v-if="scope.row.status === '3'&&scope.row.bpmStatus === 2" size="small"
85                   effect="dark" color="#ffb517" style="border: 0px; padding-top: 1px">待审核
86           </el-tag>
87           <el-tag v-if="scope.row.status === '3'&&scope.row.bpmStatus === 1" size="small"
88                   effect="dark" color="purple" style="border: 0px; padding-top: 1px">未提交
89           </el-tag>
90           <el-tag v-if="scope.row.status === '3'&&scope.row.bpmStatus === 0" size="small"
91                   effect="dark" color="pink" style="border: 0px; padding-top: 1px">已撤回
92           </el-tag>
93         </template>
94       </el-table-column>
95       <el-table-column prop="priorityName" header-align="center" align="center" width="100"
96                        label="优先级"/>
97       <el-table-column prop="orderNumber" header-align="center" align="center" min-width="140"
98                        label="工单编号"/>
99       <el-table-column prop="title" header-align="center" align="left" width="200" label="工单标题"/>
100       <el-table-column prop="content" header-align="center" align="left" min-width="200"
101                        label="工单内容"/>
102       <el-table-column prop="publisherName" header-align="center" align="center" width="80"
103                        label="发布人"/>
104       <el-table-column prop="assignerName" header-align="center" align="center" width="80"
105                        label="办理人"/>
106       <el-table-column prop="publishTime" header-align="center" align="center" min-width="150"
107                        label="发布时间"/>
108       <el-table-column prop="deadline" header-align="center" align="center" min-width="150"
109                        label="截止时间"/>
110       <el-table-column prop="isTimeout" header-align="center" align="center" width="80"
111                        label="是否超时">
112         <template #default="scope">
113           <el-tag v-if="scope.row.isTimeout === '0'">否</el-tag>
114           <el-tag v-if="scope.row.isTimeout === '1'" type="danger">是</el-tag>
115         </template>
116       </el-table-column>
117       <el-table-column prop="processStartTime" header-align="center" align="center" width="120"
118                        label="受理时间"/>
119       <el-table-column label="操作" fixed="right" header-align="center" align="center"
120                        width="180">
121         <template #default="scope">
122           <el-button type="text" size="small" v-if="scope.row.status === '0'"
123                      @click="addOrUpdateHandle(scope.row.id)">修改
124           </el-button>
125           <el-button type="text" size="small" v-if="scope.row.status === '0'"
126                      @click="assign(scope.row.id,scope.row.orderNumber)">指派
127           </el-button>
128           <el-button type="text" size="small" v-if="scope.row.status === '0'"
129                      @click="deleteHandle(scope.row.id)">删除
130           </el-button>
131           <el-button type="text" size="small" @click="orderTaskHandleView(scope.row.id)">详情
132           </el-button>
133           <el-button v-if="scope.row.bpmStatus === 2" @click="clickCancelProcess(scope.row)"
134                      type="text" size="small">撤回
135           </el-button>
136           <el-button v-if="scope.row.bpmStatus === 0" @click="clickSubmitApply(scope.row)"
137                      type="text" size="small">重新申请
138           </el-button>
139           <el-button v-if="scope.row.bpmStatus === 1" @click="clickSubmitApply(scope.row)"
140                      type="text" size="small">提交申请
141           </el-button>
142         </template>
143       </el-table-column>
144     </el-table>
145     <!-- 分页 -->
146     <Pagination
147       :total="total"
148       v-model:page="queryParams.pageNo"
149       v-model:limit="queryParams.pageSize"
150       @pagination="getList"
151     />
152   </ContentWrap>
153   <!--电耗明细-->
154   <Form ref="formRef"/>
155 </template>
156 <script lang="ts" setup>
157   import {DICT_TYPE, getIntDictOptions} from '@/utils/dict'
158   import * as OrderTemp from '@/api/process/temp'
159   import {ref} from "vue";
160
161   defineOptions({name: 'OrderTemp'})
162
163   const message = useMessage() // 消息弹窗
164   const {t} = useI18n() // 国际化
165
166   const loading = ref(true) // 列表的加载中
167   const total = ref(0) // 列表的总页数
168   const list = ref([]) // 列表的数据
169   const queryParams = reactive({
170     pageNo: 1,
171     pageSize: 10,
172     startDate: undefined,
173     endDate: undefined,
174     xsmz: undefined
175   })
176   const queryFormRef = ref() // 搜索的表单
177
178   /** 查询列表 */
179   const getList = async () => {
180     loading.value = true
181     try {
182       const page = await OrderTemp.getOrderTempPage(queryParams)
183       list.value = page.list
184       total.value = page.total
185     } finally {
186       loading.value = false
187     }
188   }
189
190   /** 搜索按钮操作 */
191   const handleQuery = () => {
192     queryParams.pageNo = 1
193     getList()
194   }
195
196   /** 查看数据操作 */
197   const chartView = ref()
198   const chartHandle = (raw: object) => {
199     chartView.value.open(raw)
200   }
201
202   /** 重置按钮操作 */
203   const resetQuery = () => {
204     queryFormRef.value.resetFields()
205     handleQuery()
206   }
207
208   /** 添加/修改操作 */
209   const formRef = ref()
210   const openForm = (type: string, id?: number) => {
211     formRef.value.open(type, id)
212   }
213
214   /** 删除按钮操作 */
215   const handleDelete = async (id: number) => {
216     try {
217       // 删除的二次确认
218       await message.delConfirm()
219       // 发起删除
220       await OrderTemp.deleteOrderTemp(id)
221       message.success(t('common.delSuccess'))
222       // 刷新列表
223       await getList()
224     } catch {
225     }
226   }
227
228   /** 初始化 **/
229   onMounted(async () => {
230     await getList()
231   })
232 </script>