选煤厂生产管理平台前端代码
Jay
2024-12-10 3fd76c29b58fd3979e91deed70f9396f26c91059
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
<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="code" label="流水号">
                <el-input size="mini" disabled v-model="formData.code" placeholder="流水号"/>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item prop="ny" label="年月">
                <el-date-picker
                    style="width: 100%;"
                    v-model="formData.ny"
                    type="month"
                    format="yyyy-MM"
                    value-format="yyyy-MM"
                    placeholder="年月"/>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item prop="type" label="实验类别">
                <dict-select-tag style="width: 100%"
                                 size="mini"
                                 v-model="formData.type"
                                 placeholder="实验类别"
                                 dictCode="sylb"
                                 clearable/>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item prop="mz" label="煤种">
                <dict-select-tag style="width: 100%"
                                 size="mini"
                                 v-model="formData.mz"
                                 placeholder="煤种"
                                 dictCode="ymmz"
                                 :clearable="true"/>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item prop="syyp" label="实验样品">
                <dict-select-tag style="width: 100%"
                                 size="mini"
                                 v-model="formData.syyp"
                                 placeholder="实验样品"
                                 dictCode="syyp"
                                 :clearable="true"/>
              </el-form-item>
            </el-col>
<!--            <el-col :span="12">-->
<!--              <el-form-item prop="fcfa" :label="$t('analysis.fcfa')">-->
<!--                <dict-select-tag style="width: 100%"-->
<!--                                 size="mini"-->
<!--                                 v-model="formData.fcfa"-->
<!--                                 :placeholder="$t('analysis.fcfa')"-->
<!--                                 dictCode="analysis-fcfa"-->
<!--                                 :clearable="true"/>-->
<!--              </el-form-item>-->
<!--            </el-col>-->
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item prop="syrq" label="实验日期">
                <el-date-picker
                    style="width: 100%;"
                    v-model="formData.syrq"
                    size="mini"
                    type="date"
                    format="yyyy-MM-dd"
                    value-format="yyyy-MM-dd 00:00:00"
                    placeholder="实验日期"/>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item prop="sybz" label="实验班组">
                <el-input size="mini" v-model="formData.sybz" placeholder="实验班组"/>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item prop="syfzr" label="实验负责人">
                <el-input size="mini" v-model="formData.syfzr" placeholder="实验负责人"/>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item prop="hyy" label="化验员">
                <el-input size="mini" v-model="formData.hyy" placeholder="化验员"/>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item prop="myzz" label="煤样总重">
                <el-input-number size="mini"
                                 style="width: 100%;"
                                 v-model="formData.myzz"
                                 placeholder="煤样总重"
                                 controls-position="right"
                                 :precision="2"
                                 :min="0"
                                 :max="10000"/>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item prop="myzh" label="煤样总灰">
                <el-input-number v-model="formData.myzh"
                                 size="mini"
                                 style="width: 100%;"
                                 placeholder="煤样总灰"
                                 controls-position="right"
                                 :precision="2"
                                 :min="0"
                                 :max="100"/>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item prop="myzl" label="煤样总硫">
                <el-input-number v-model="formData.myzl"
                                 size="mini"
                                 style="width: 100%;"
                                 placeholder="煤样总硫"
                                 controls-position="right"
                                 :precision="2"
                                 :min="0"
                                 :max="100"/>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="24">
              <el-form-item prop="bz" label="备注">
                <el-input size="mini" v-model="formData.bz" placeholder="备注" type="textarea"
                          :rows="2"/>
              </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-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"
                 label-width="120px">
          <el-table
              :data="formData.detList"
              border
              height="400"
              style="width: 100%;">
            <el-table-column prop="mdjName" label="密度级" header-align="center"
                             align="center"/>
            <el-table-column prop="zl" label="重量(kg)" header-align="center" align="center">
              <template #default="scope">
                <el-input-number v-model="scope.row.zl"
                                 size="mini"
                                 style="width: 80px;"
                                 placeholder="重量(kg)"
                                 :precision="2"
                                 :controls="false"
                                 :min="0"
                                 :max="10000"/>
              </template>
            </el-table-column>
            <el-table-column prop="cl" label="产率(%)" header-align="center" align="center">
              <template #default="scope">
                <el-input-number v-model="scope.row.cl"
                                 size="mini"
                                 style="width: 80px;"
                                 placeholder="产率(%)"
                                 :precision="2"
                                 :controls="false"
                                 :min="0"
                                 :max="100"/>
              </template>
            </el-table-column>
            <el-table-column prop="hf" label="灰分(%)" header-align="center" align="center">
              <template #default="scope">
                <el-input-number v-model="scope.row.hf"
                                 size="mini"
                                 style="width: 80px;"
                                 placeholder="灰分(%)"
                                 :precision="2"
                                 :controls="false"
                                 :min="0"
                                 :max="100"/>
              </template>
            </el-table-column>
            <el-table-column prop="lf" label="硫分(%)" header-align="center" align="center">
              <template #default="scope">
                <el-input-number v-model="scope.row.lf"
                                 size="mini"
                                 style="width: 80px;"
                                 placeholder="硫分(%)"
                                 :precision="2"
                                 :controls="false"
                                 :min="0"
                                 :max="100"/>
              </template>
            </el-table-column>
            <el-table-column label="浮物累计" header-align="center">
              <el-table-column prop="fwljcl" label="产率(%)" header-align="center" align="center">
                <template #default="scope">
                  <el-input-number v-model="scope.row.fwljcl"
                                   size="mini"
                                   style="width: 80px;"
                                   placeholder="产率(%)"
                                   :precision="2"
                                   :controls="false"
                                   :min="0"
                                   :max="100"/>
                </template>
              </el-table-column>
              <el-table-column prop="fwljhf" label="灰分(%)" header-align="center" align="center">
                <template #default="scope">
                  <el-input-number v-model="scope.row.fwljhf"
                                   size="mini"
                                   style="width: 80px;"
                                   placeholder="灰分(%)"
                                   :precision="2"
                                   :controls="false"
                                   :min="0"
                                   :max="100"/>
                </template>
              </el-table-column>
            </el-table-column>
            <el-table-column label="沉物累计" header-align="center">
              <el-table-column prop="cwljcl" label="产率(%)" header-align="center" align="center">
                <template #default="scope">
                  <el-input-number v-model="scope.row.cwljcl"
                                   size="mini"
                                   style="width: 80px;"
                                   placeholder="产率(%)"
                                   :precision="2"
                                   :controls="false"
                                   :min="0"
                                   :max="100"/>
                </template>
              </el-table-column>
              <el-table-column prop="cwljhf" label="灰分(%)" header-align="center" align="center">
                <template #default="scope">
                  <el-input-number v-model="scope.row.cwljhf"
                                   size="mini"
                                   style="width: 80px;"
                                   placeholder="灰分(%)"
                                   :precision="2"
                                   :controls="false"
                                   :min="0"
                                   :max="100"/>
                </template>
              </el-table-column>
            </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({
      id: '',
      code: '',
      ny: '',
      type: '',
      mz: '',
      syyp: '',
      fcfa: '',
      syrq: '',
      sybz: '',
      syfzr: '',
      hyy: '',
      myzz: '',
      myzh: '',
      myzl: '',
      bz: '',
      detList: []
    })
 
  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>