<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>
|