选煤厂生产管理平台前端代码
Jay
2024-12-10 58a8ee8eebcf13656445486333d2d3f3e02c938f
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
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
<template>
  <Dialog width="60%" v-model="dialogVisible" :title="dialogTitle">
    <el-tabs>
      <el-tab-pane label="生产运行煤样快速检查">
        <el-form :model="formData" :rules="dataRule" ref="formData"
                 v-loading="formLoading"
                 label-width="120px">
          <el-row>
            <el-col :span="12">
              <el-form-item prop="datetime" label="采样时间">
                <el-date-picker
                  style="width: 100%"
                  type="datetime"
                  format="yyyy-MM-dd HH:mm:ss"
                  value-format="yyyy-MM-dd HH:mm:ss"
                  size="mini"
                  v-model="formData.datetime"
                  placeholder="采样时间"
                />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item prop="mz" label="混煤煤种及比例">
                <el-input
                  style="width: 100%"
                  size="mini"
                  v-model="formData.mz"
                  placeholder="例: 五虎山#9:五虎山#12 = 1:2"
                  clearable
                />
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
      </el-tab-pane>
      <el-tab-pane label="生产运行煤样快速检查详情">
        <el-form :inline="true">
          <el-form-item>
            <el-upload
              class="upload-demo"
              :action="action"
              :on-success="handleExcel"
              :multiple="false"
              :show-file-list="false"
              :on-change="changeFile"
              :file-list="fileList"
            >
              <el-button size="mini" type="primary">点击上传</el-button>
            </el-upload>
          </el-form-item>
          <el-form-item>
            <el-button size="mini" type="success" @click="downloadExcel"
              >下载模板</el-button
            >
          </el-form-item>
        </el-form>
        <el-form
          :model="formData"
          :rules="dataRule"
          ref="formDataDet"
          @keyup.enter.native="formDataSubmitHandle()"
          label-width="120px"
        >
          <el-table
            :data="formData.itemList"
            border
            height="400"
            style="width: 100%"
          >
            <el-table-column
              prop="xm"
              label="项目"
              header-align="center"
              align="center"
              min-width="150"
            >
              <template slot-scope="scope">
                <dict-select-tag
                style="width: 100%"
                size="mini"
                v-model="scope.row.xm"
                placeholder="项目"
                dictCode="sckjxm"
                clearable
                />
              </template>
              </el-table-column>
            <el-table-column
              prop="yl"
              label="压力"
              header-align="center"
              align="center"
              min-width="100"
            >
              <template slot-scope="scope">
                <el-input-number
                  v-model="scope.row.yl"
                  size="mini"
                  placeholder="压力"
                  :precision="2"
                  :controls="false"
                  :min="0"
                  :max="100"
                  class="curves-det-input"
                />
              </template>
            </el-table-column>
            <el-table-column
              prop="md"
              label="密度"
              header-align="center"
              align="center"
              min-width="100"
            >
              <template slot-scope="scope">
                <el-input-number
                  v-model="scope.row.md"
                  size="mini"
                  placeholder="密度"
                  :precision="2"
                  :controls="false"
                  :min="0"
                  :max="100"
                  class="curves-det-input"
                />
              </template>
            </el-table-column>
            <el-table-column
              prop="hf"
              label="灰分"
              header-align="center"
              align="center"
              min-width="100"
            >
              <template slot-scope="scope">
                <el-input-number
                  v-model="scope.row.hf"
                  size="mini"
                  placeholder="灰分"
                  :precision="2"
                  :controls="false"
                  :min="0"
                  :max="100"
                  class="curves-det-input"
                />
              </template>
            </el-table-column>
            <el-table-column
              prop="lf"
              label="硫分"
              header-align="center"
              align="center"
              min-width="100"
            >
              <template slot-scope="scope">
                <el-input-number
                  v-model="scope.row.lf"
                  size="mini"
                  :placeholder="$t('washCurves.lf')"
                  :precision="2"
                  :controls="false"
                  :min="0"
                  :max="100"
                  class="curves-det-input"
                />
              </template>
            </el-table-column>
            <el-table-column label="-1.4浮沉" header-align="center">
              <el-table-column
                prop="cl1"
                :label="$t('washCurves.cl')"
                header-align="center"
                align="center"
                min-width="100"
              >
                <template slot-scope="scope">
                  <el-input-number
                    v-model="scope.row.cl1"
                    size="mini"
                    :placeholder="$t('washCurves.cl')"
                    :precision="2"
                    :controls="false"
                    :min="0"
                    :max="100"
                    class="curves-det-input"
                  />
=                </template>
              </el-table-column>
              <el-table-column
                prop="hf1"
                :label="$t('washCurves.hf')"
                header-align="center"
                align="center"
                min-width="100"
              >
                <template slot-scope="scope">
                  <el-input-number
                    v-model="scope.row.hf1"
                    size="mini"
                    :placeholder="$t('washCurves.hf')"
                    :precision="2"
                    :controls="false"
                    :min="0"
                    :max="100"
                    class="curves-det-input"
                  />
                </template>
              </el-table-column>
            </el-table-column>
            <el-table-column label="1.4-1.8浮沉" header-align="center">
              <el-table-column
                prop="cl2"
                :label="$t('washCurves.cl')"
                header-align="center"
                align="center"
                min-width="100"
              >
                <template slot-scope="scope">
                  <el-input-number
                    v-model="scope.row.cl2"
                    size="mini"
                    :placeholder="$t('washCurves.cl')"
                    :precision="2"
                    :controls="false"
                    :min="0"
                    :max="100"
                    class="curves-det-input"
                  />
                </template>
              </el-table-column>
              <el-table-column
                prop="hf2"
                :label="$t('washCurves.hf')"
                header-align="center"
                align="center"
                min-width="100"
              >
                <template slot-scope="scope">
                  <el-input-number
                    v-model="scope.row.hf2"
                    size="mini"
                    :placeholder="$t('washCurves.hf')"
                    :precision="2"
                    :controls="false"
                    :min="0"
                    :max="100"
                    class="curves-det-input"
                  />
                </template>
              </el-table-column>
            </el-table-column>
            <el-table-column label="+1.8浮沉" header-align="center">
              <el-table-column
                prop="cl3"
                :label="$t('washCurves.cl')"
                header-align="center"
                align="center"
                min-width="100"
              >
                <template slot-scope="scope">
                  <el-input-number
                    v-model="scope.row.cl3"
                    size="mini"
                    :placeholder="$t('washCurves.cl')"
                    :precision="2"
                    :controls="false"
                    :min="0"
                    :max="100"
                    class="curves-det-input"
                  />
                </template>
              </el-table-column>
              <el-table-column
                prop="hf3"
                :label="$t('washCurves.hf')"
                header-align="center"
                align="center"
                min-width="100"
              >
                <template slot-scope="scope">
                  <el-input-number
                    v-model="scope.row.hf3"
                    size="mini"
                    :placeholder="$t('washCurves.hf')"
                    :precision="2"
                    :controls="false"
                    :min="0"
                    :max="100"
                    class="curves-det-input"
                  />
                </template>
              </el-table-column>
            </el-table-column>
            <el-table-column
              prop=""
              label="操作"
              min-width="100"
              align="center"
            >
              <template slot-scope="scope">
                <el-button
                  @click.native.prevent="
                    addExpressionRow(scope.$index, formData.itemList)
                  "
                  type="text"
                  size="small"
                >
                  添加
                </el-button>
                <el-button
                  @click.native.prevent="
                    deleteExpressionRow(scope.$index, formData.itemList)
                  "
                  type="text"
                  size="small"
                >
                  删除
                </el-button>
              </template>
            </el-table-column>
          </el-table>
        </el-form>
      </el-tab-pane>
    </el-tabs>
    <template #footer>
      <el-button size="mini" :disabled="formLoading" type="primary" @click="formDataSubmitHandle()">确定</el-button>
      <el-button size="mini" @click="dialogVisible = false">取消</el-button>
    </template>
  </Dialog>
</template>
 
<script lang="ts" setup>
  import * as AnalysisApi from '@/api/xmcpms/coal-quality/analysis/full/index'
 
  defineOptions({name: 'FullForm'})
 
  const {t} = useI18n() // 国际化
  const message = useMessage() // 消息弹窗
  const dialogVisible = ref(false) // 弹窗的是否展示
  const dialogTitle = ref('') // 弹窗的标题
  const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
  const formType = ref('') // 表单的类型:create - 新增;update - 修改
  const formData = ref({
    lsh:"",
    datetime: "",
    mz: "",
  })
 
  const open = async (type: string, id?: string) => {
    dialogVisible.value = true
    dialogTitle.value = t('action.' + type)
    //修改时,设置数据
    if (id) {
      formLoading.value = true
      try {
        formData.value = await AnalysisApi.getAnalysis(id)
      } finally {
        formLoading.value = false
      }
    }
  }
  defineExpose({ open }) // 提供 open 方法,用于打开弹窗
</script>
<style>
.curves-det-input {
  width: 100%;
}
</style>