Fixiaobai
2023-10-13 e8308ddac0ba4a1f406e8f63d7e6b6f2541cb770
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
<template>
  <el-dialog
    v-diadrag
    :title="!dataForm.id ? '新增' : '修改'"
    :close-on-click-modal="false"
    :visible.sync="visible"
  >
    <div class="avue-crud">
      <el-card label="检测范围">
        <el-form>
          <el-row>
            <el-col :span="11">
              <el-form-item label="开始">
                <el-input
                  clearable
                  v-model="startSystemNo"
                  placeholder="开始"
                  style="width: 350px"
                >
                  <template slot="prepend"
                    ><span>{{ systemNo }}</span></template
                  >
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="11">
              <el-form-item label="截止">
                <el-input
                  clearable
                  v-model="endSystemNo"
                  placeholder="截止"
                  style="width: 350px"
                >
                  <template slot="prepend"
                    ><span>{{ systemNo }}</span></template
                  >
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="2">
              <el-button type="primary" @click="getDataList()">搜索</el-button>
            </el-col>
          </el-row></el-form
        ></el-card
      >
      <el-card
        ><el-table
          :data="dataList"
          border
          v-loading="dataListLoading"
          class="l-mes-table"
          :height="500"
        >
          <el-table-column type="index" label="序号" width="50">
          </el-table-column>
          <el-table-column
            prop="systemNo"
            header-align="center"
            align="center"
            label="SN码"
          >
          </el-table-column>
          <el-table-column
            prop="createTime"
            header-align="center"
            align="center"
            label="上一道工步的时间"
          >
          </el-table-column>
          <el-table-column
            prop="staffName"
            header-align="center"
            align="center"
            label="上一道工步的扫码人"
          >
          </el-table-column> </el-table
      ></el-card>
    </div>
 
    <div class="avue-crud__pagination">
      <el-pagination
        @size-change="sizeChangeHandle"
        @current-change="currentChangeHandle"
        :current-page="pageIndex"
        :page-sizes="[10, 20, 50, 100]"
        :page-size="pageSize"
        :total="totalPage"
        background
        layout="total, sizes, prev, pager, next, jumper"
      >
      </el-pagination>
    </div>
    <span slot="footer" class="dialog-footer">
      <el-button @click="visible = false">关闭</el-button>
    </span>
  </el-dialog>
</template>
 
<script>
import { mapGetters } from 'vuex'
import { checkProductOutPutStep } from '../../../api/product/personboard'
 
export default {
  data() {
    return {
      systemNo: null,
      stepId: null,
      startSystemNo: null,
      endSystemNo: null,
      newSpanArr: [],
      dataForm: {
        key: ''
      },
      visible: false,
      stateTagArr: [
        {
          value: '01pending',
          label: '等待'
        },
        {
          value: '02inProgress',
          label: '进行中'
        },
        {
          value: '03interrupted',
          label: '已暂停'
        },
        {
          value: '04completed',
          label: '已完成'
        },
        {
          value: '05canceled',
          label: '已取消'
        }
      ],
      paramObject: {},
      dateTimeFiltersThree: {},
      orderRequiredDate: null,
      orderMoNo: null,
      dataList: [],
      pageIndex: 1,
      pageSize: 10,
      totalPage: 0,
      dataListLoading: false,
      addOrUpdateVisible: false
    }
  },
  computed: {
    ...mapGetters(['permissions'])
  },
  methods: {
    isNumber(value) {
      var reg = /^\d{4}$/
      if (
        value == undefined ||
        value == null ||
        value === '' ||
        value.trim === ''
      ) {
        return false
      } else {
        if (!reg.test(value)) {
          return false
        } else {
          return true
        }
      }
    },
    // 获取数据列表
    getDataList() {
      this.dataListLoading = true
      if (!this.isNumber(this.startSystemNo)) {
        this.$message.error('开始的SN码格式错误')
        this.dataListLoading = false
        return
      }
      if (!this.isNumber(this.endSystemNo)) {
        this.$message.error('结束的SN码格式错误')
        this.dataListLoading = false
        return
      }
      const paramObj = {
        stepId: this.stepId,
        startSystemNo: this.systemNo + this.startSystemNo,
        endSystemNo: this.systemNo + this.endSystemNo
      }
      const query = Object.assign(
        {
          current: this.pageIndex,
          size: this.pageSize
        },
        paramObj
      )
      checkProductOutPutStep(query).then((response) => {
        this.dataList = response.data.data.records
        this.totalPage = response.data.data.total
      })
      this.dataListLoading = false
    },
    init(id, param, minNo, maxNo) {
      this.dataList = []
      this.systemNo = null
      this.startSystemNo = null
      this.endSystemNo = null
      this.stepId = null
      if (id) {
        this.stepId = id
      }
      this.startSystemNo = maxNo
      this.endSystemNo = minNo
      this.systemNo = param
      this.visible = true
    },
    // 每页数
    sizeChangeHandle(val) {
      this.pageSize = val
      this.pageIndex = 1
      this.getDataList()
    },
    // 当前页
    currentChangeHandle(val) {
      this.pageIndex = val
      this.getDataList()
    }
  }
}
</script>