yangfeng
2024-03-06 b67a17cc810f087f0708c3cb6effa91b7752140f
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
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
<template>
  <div class="add-product-page">
    <div class="top-view">
      <div class="t-left">
        <el-button type="primary" size="small">放弃</el-button>
        <el-button type="primary" size="small">保存</el-button>
        <el-divider direction="vertical"></el-divider>
        <el-button type="primary" size="small">退出</el-button>
      </div>
      <div class="t-right">
        <div class="t-right-circle" :class="isDeviceConnectStatus ? 't-r-bg-green ' : 't-r-bg-red '"></div>
        <div :class="isDeviceConnectStatus ? 't-right-green' : 't-right-red'">计量仪器连接正常</div>
      </div>
    </div>
    <div class="body-card">
      <div class="body-top">
        <div class="b-t-left">
          <el-form
            :model="ruleForm"
            :rules="rules"
            ref="ruleForm"
            label-width="80px"
            label-position="right"
            class="demo-ruleForm"
          >
            <el-row>
              <el-col :span="3">
                <el-form-item label="编号" prop="number">
                  <el-input v-model="ruleForm.number" size="small"></el-input>
                </el-form-item>
                <el-form-item label="生产用时" prop="productTime">
                  <el-input v-model="ruleForm.productTime" size="small"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="3">
                <el-form-item label="生产日期" prop="productDate">
                  <el-date-picker
                    type="date"
                    placeholder="选择日期"
                    v-model="ruleForm.productDate"
                    size="small"
                    style="width: 100%"
                  ></el-date-picker>
                </el-form-item>
                <el-form-item label="回数" prop="numTimes">
                  <el-input v-model="ruleForm.numTimes" size="small"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="3">
                <el-form-item label="庄口" prop="lots">
                  <el-select v-model="ruleForm.lots" placeholder="请选择庄口" size="small">
                    <el-option label="庄口一" value="庄口一"></el-option>
                    <el-option label="庄口二" value="庄口二"></el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="落丝茧量" prop="silkCocoonCount">
                  <el-input v-model="ruleForm.silkCocoonCount" size="small"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="3">
                <el-form-item label="车间" prop="workshop">
                  <el-select v-model="ruleForm.workshop" placeholder="请选择车间" size="small">
                    <el-option label="车间一" value="车间一"></el-option>
                    <el-option label="车间二" value="车间二"></el-option>
                    <el-option label="车间三" value="车间三"></el-option>
                    <el-option label="车间四" value="车间四"></el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="每桶茧量" prop="barrelCocoonCount">
                  <div style="display: flex">
                    <el-input v-model="ruleForm.silkCocoonCount" size="small"></el-input>
                    <span>克</span>
                  </div>
                </el-form-item>
              </el-col>
              <el-col :span="3">
                <el-form-item label="组别" prop="group">
                  <el-select v-model="ruleForm.group" placeholder="请选择组别" size="small">
                    <el-option
                      v-for="item in groupOptions"
                      :key="item.id"
                      :label="item.value"
                      :value="item.id"
                    ></el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="实际车速" prop="actualSpeed">
                  <el-input v-model="ruleForm.actualSpeed" size="small"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="3">
                <el-form-item label="规格" prop="spec">
                  <el-input v-model="ruleForm.spec" size="small"></el-input>
                </el-form-item>
                <el-form-item label="乙班时间" prop="bShiftTime">
                  <el-input v-model="ruleForm.bShiftTime" size="small"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="3">
                <el-form-item label="是否结庄" prop="end">
                  <el-input v-model="ruleForm.spec" size="small"></el-input>
                </el-form-item>
                <el-form-item label="甲班时间" prop="aShiftTime">
                  <el-input v-model="ruleForm.aShiftTime" size="small"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="3">
                <el-form-item label="等级" prop="grade">
                  <el-input v-model="ruleForm.grade" size="small"></el-input>
                </el-form-item>
                <el-form-item label="车组缫折" prop="reelingDiscount">
                  <el-input v-model="ruleForm.reelingDiscount" size="small"></el-input>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="16">
                <el-form-item label="落丝桶数:" prop="doffBarrelage">
                  <div class="doff-barrelage-card">
                    <div class="d-b-common">
                      <el-input v-model="ruleForm.oneInput" size="small" class="d-b-c-input"></el-input>
                      <el-checkbox v-model="ruleForm.isOneDoff"></el-checkbox>
                    </div>
                    <div class="d-b-common">
                      <el-input v-model="ruleForm.twoInput" size="small" class="d-b-c-input"></el-input>
                      <el-checkbox v-model="ruleForm.isTwoDoff"></el-checkbox>
                    </div>
                    <div class="d-b-common">
                      <el-input v-model="ruleForm.threeInput" size="small" class="d-b-c-input"></el-input>
                      <el-checkbox v-model="ruleForm.isThreeDoff"></el-checkbox>
                    </div>
                  </div>
                </el-form-item>
                <el-form-item label="号带颜色:" prop="numBandColor">
                  <div class="doff-barrelage-card">
                    <div class="d-b-common">
                      <div class="n-m-c-label">第一回</div>
                      <el-input v-model="ruleForm.oneInput" size="small" class="d-b-c-input"></el-input>
                    </div>
                    <div class="d-b-common">
                      <div class="n-m-c-label">第二回</div>
                      <el-input v-model="ruleForm.twoInput" size="small" class="d-b-c-input"></el-input>
                    </div>
                    <div class="d-b-common">
                      <div class="n-m-c-label">第三回</div>
                      <el-input v-model="ruleForm.threeInput" size="small" class="d-b-c-input"></el-input>
                    </div>
                  </div>
                </el-form-item>
              </el-col>
              <el-col :span="4">
                <el-form-item label="理论丝量" prop="theorySilkCount">
                  <el-input v-model="ruleForm.theorySilkCount" size="small"></el-input>
                </el-form-item>
                <el-form-item label="总产量" prop="totalOutput">
                  <div style="display: flex">
                    <el-input v-model="ruleForm.totalOutput" size="small"></el-input>
                    <span>kg</span>
                  </div>
                </el-form-item>
              </el-col>
              <el-col :span="4">
                <el-form-item label="台时产量" prop="platformTimeOutput">
                  <el-input v-model="ruleForm.platformTimeOutput" size="small"></el-input>
                </el-form-item>
              </el-col>
            </el-row>
          </el-form>
        </div>
        <div class="b-t-right">
          <div class="b-t-r-icon" :class="isDeviceConnectStatus ? 'c-p' : 'c-n'" @click="deviceConnectClick">
            <i class="el-icon-d-arrow-left"></i>
          </div>
        </div>
      </div>
      <div class="body-table">
        <div class="b-t-unit">单位:克</div>
        <el-table :data="tableData" style="width: 100%" border>
          <el-table-column prop="carNum" label="车号" width="99" align="center"> </el-table-column>
          <el-table-column label="第一回" align="center">
            <el-table-column prop="fist1" label="1" width="60" align="center"> </el-table-column>
            <el-table-column prop="fist2" label="2" width="60" align="center"> </el-table-column>
            <el-table-column prop="fist3" label="3" width="60" align="center"> </el-table-column>
            <el-table-column prop="fist4" label="4" width="60" align="center"> </el-table-column>
          </el-table-column>
          <el-table-column label="第二回" align="center">
            <el-table-column prop="two1" label="1" width="60" align="center"> </el-table-column>
            <el-table-column prop="two2" label="2" width="60" align="center"> </el-table-column>
            <el-table-column prop="two3" label="3" width="60" align="center"> </el-table-column>
            <el-table-column prop="two4" label="4" width="60" align="center"> </el-table-column>
          </el-table-column>
          <el-table-column label="第三回" align="center">
            <el-table-column prop="three1" label="1" width="60" align="center"> </el-table-column>
            <el-table-column prop="three2" label="2" width="60" align="center"> </el-table-column>
            <el-table-column prop="three3" label="3" width="60" align="center"> </el-table-column>
            <el-table-column prop="three4" label="4" width="60" align="center"> </el-table-column>
          </el-table-column>
          <el-table-column prop="date" label="台产量" align="center"> </el-table-column>
          <el-table-column prop="date" label="个人产量" width="60" align="center"> </el-table-column>
          <el-table-column prop="date" label="台时产量" width="60" align="center"> </el-table-column>
          <el-table-column prop="date" label="个人缫折" width="60" align="center"> </el-table-column>
          <el-table-column prop="date" label="一回产量" width="60" align="center"> </el-table-column>
          <el-table-column prop="date" label="一回台产" width="60" align="center"> </el-table-column>
          <el-table-column prop="date" label="一回缫折" width="60" align="center"> </el-table-column>
          <el-table-column prop="date" label="二回产量" width="60" align="center"> </el-table-column>
          <el-table-column prop="date" label="二回台产" width="60" align="center"> </el-table-column>
          <el-table-column prop="date" label="二回缫折" width="60" align="center"> </el-table-column>
          <el-table-column prop="date" label="三回产量" width="60" align="center"> </el-table-column>
          <el-table-column prop="date" label="三回台产" width="60" align="center"> </el-table-column>
          <el-table-column prop="date" label="三回缫折" width="60" align="center"> </el-table-column>
        </el-table>
      </div>
    </div>
    <!-- 仪器连接正常弹窗 -->
    <addProductDialog ref="addProductDialog" />
  </div>
</template>
 
<script>
import addProductDialog from "./components/addProductDialog"
export default {
  name: "addProductRegisterPage",
  props: {},
  mixins: [],
  components: { addProductDialog },
  computed: {},
  data() {
    return {
      isDeviceConnectStatus: false,
      ruleForm: {
        number: "",
        productTime: "",
        productDate: "",
        numTimes: "",
        lots: "庄口一",
        silkCocoonCount: "",
        workshop: "车间一",
        barrelCocoonCount: "",
        group: 1,
        actualSpeed: "",
        spec: "",
        bShiftTime: "",
        aShiftTime: "",
        end: false,
        reelingDiscount: "",
        grade: "",
        oneInput: "",
        isOneDoff: false,
        twoInput: "",
        isTwoDoff: false,
        threeInput: "",
        isThreeDoff: false,
        theorySilkCount: "",
        totalOutput: "",
        platformTimeOutput: ""
      },
      rules: {
        number: [{ required: true, message: "请输入编号", trigger: "blur" }],
        productDate: [{ required: true, message: "请选择生产日期", trigger: "change" }],
        workshop: [{ type: "date", required: true, message: "请选择车间", trigger: "change" }]
      },
      groupOptions: [
        { id: 1, value: 1 },
        { id: 2, value: 2 },
        { id: 3, value: 3 },
        { id: 4, value: 4 },
        { id: 5, value: 5 },
        { id: 6, value: 6 },
        { id: 7, value: 7 },
        { id: 8, value: 8 },
        { id: 9, value: 9 }
      ],
      tableData: []
    }
  },
  created() {},
  methods: {
    // 仪器连接弹窗
    deviceConnectClick() {
      console.log("dddd")
      if (this.isDeviceConnectStatus) {
        this.$refs.addProductDialog.editDialogVisible = true
      }
    }
  }
}
</script>
 
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
.add-product-page {
  height: 100%;
  .top-view {
    margin: 20px 30px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px 0 20px;
    border-radius: 12px;
    background-color: #fff;
    .t-right {
      display: flex;
      font-size: 14px;
      // color: #ff0000;
      .t-right-circle {
        width: 18px;
        height: 18px;
        border-radius: 9px;
        // background: #ff0000;
        margin-right: 10px;
      }
    }
  }
  .body-card {
    margin: 0 30px;
    background-color: #fff;
    padding: 10px 15px;
    height: calc(100% - 180px);
    border-radius: 4px;
    .body-top {
      display: flex;
      .b-t-left {
        width: 95%;
        padding-top: 15px;
        .doff-barrelage-card {
          display: flex;
          .d-b-common {
            width: 33.3%;
            display: flex;
            justify-content: center;
            .d-b-c-input {
              width: 50%;
              margin-right: 10px;
            }
            .n-m-c-label {
              color: #606266;
              margin-right: 10px;
            }
          }
        }
      }
      .b-t-right {
        width: 60px;
        .b-t-r-icon {
          width: 50px;
          height: 50px;
          border-radius: 25px;
          border: 1px solid #1890ff;
          color: #1890ff;
          font-size: 30px;
          line-height: 50px;
          text-align: center;
          margin-top: 15px;
          margin-left: 30px;
        }
      }
    }
    .body-table {
      position: relative;
      .b-t-unit {
        position: absolute;
        top: -25px;
        right: 20px;
      }
    }
  }
}
.t-right-red {
  color: #ff0000;
}
.t-right-green {
  color: #00ff00;
}
.t-r-bg-red {
  background: #ff0000;
}
.t-r-bg-green {
  background: #00ff00;
}
.c-p {
  cursor: pointer;
}
.c-n {
  cursor: no-drop;
}
 
::v-deep {
}
</style>