This commit is contained in:
Vergil
2020-02-14 15:18:43 +08:00
parent e8eeade817
commit 1895977eb2
25 changed files with 1304 additions and 738 deletions

View File

@@ -22,46 +22,58 @@
<!--:value="item.value"/>-->
<!--</el-select>-->
<span style="margin-left: 10px">零件图号:</span>
<el-input v-model="PartDrawingNumber" filterable placeholder="零件图号" style="width: 150px" size="small" clearable/>
<el-input v-model="PartDrawingNumber" filterable placeholder="零件图号" style="width: 180px" size="small" clearable/>
<span class="demonstration" style="margin-left: 10px">时间区间:</span>
<el-date-picker
v-model="startTime"
value-format="yyyy-MM-dd"
v-model="dateRange"
:picker-options="pickerOptions"
size="small"
style="width: 130px"
type="date"
placeholder="选择日期"/>
<span class="demonstration">~</span>
<el-date-picker
v-model="endTime"
type="daterange"
align="center"
style="width: 240px;margin: 3px 0"
value-format="yyyy-MM-dd"
size="small"
style="width: 130px"
type="date"
placeholder="选择日期"/>
format="yyyy-MM-dd"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"/>
<!--<el-date-picker-->
<!--v-model="startTime"-->
<!--value-format="yyyy-MM-dd"-->
<!--size="small"-->
<!--style="width: 130px"-->
<!--type="date"-->
<!--placeholder="选择日期"/>-->
<!--<span class="demonstration">~</span>-->
<!--<el-date-picker-->
<!--v-model="endTime"-->
<!--value-format="yyyy-MM-dd"-->
<!--size="small"-->
<!--style="width: 130px"-->
<!--type="date"-->
<!--placeholder="选择日期"/>-->
<el-tooltip :open-delay="1200" effect="dark" content="查询备料出库记录" placement="top">
<el-button type="primary" plain size="small" icon="el-icon-search" style="margin-left: 15px" @click="total=0;pageSize=40; pageCurrent=1;selecttable()">查询</el-button>
</el-tooltip>
</el-row>
</el-card>
<el-card>
<el-table :data="tableData1" border stripe size="mini" highlight-current-row style="width: 700px;margin-top: 3px" height="800px" @sort-change="sortChange">
<el-table :data="tableData1" border stripe size="mini" highlight-current-row style="width: 580px;margin-top: 3px" height="800px" @sort-change="sortChange">
<!--<el-table-column label="项目名称" prop="项目名称" align="center" width="150" show-overflow-tooltip>-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.项目名称 }}-->
<!--</template>-->
<!--</el-table-column>-->
<el-table-column label="机床图号" prop="机床图号" align="center" width="180" show-overflow-tooltip>
<el-table-column label="机床图号" prop="机床图号" align="center" width="120" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.机床图号 }}
</template>
</el-table-column>
<el-table-column label="零件图号" prop="零件图号" align="center" width="233" sortable="custom" show-overflow-tooltip>
<el-table-column label="零件图号" prop="零件图号" align="center" width="180" sortable="custom" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.零件图号 }}
</template>
</el-table-column>
<el-table-column label="零件名称" prop="零件名称" align="center" width="150" sortable="custom" show-overflow-tooltip>
<el-table-column label="零件名称" prop="零件名称" align="center" width="140" sortable="custom" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
@@ -93,6 +105,35 @@ import { initProject, searchgroup, selecttable } from '@/api/Assembly/SpareParts
export default {
data() {
return {
dateRange: '',
expands: [],
pickerOptions: {
shortcuts: [{
text: '上季度',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setTime(end.getTime() - 3600 * 1000 * 24 * 30 * 3)
picker.$emit('pick', [start, end])
}
}, {
text: '过去半年',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setTime(end.getTime() - 3600 * 1000 * 24 * 366 / 2)
picker.$emit('pick', [start, end])
}
}, {
text: '过去一年',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setTime(end.getTime() - 3600 * 1000 * 24 * 365)
picker.$emit('pick', [start, end])
}
}]
},
PartDrawingNumber: '',
startTime: '',
endTime: '',
@@ -164,9 +205,9 @@ export default {
if (this.machineNumberValue !== '' && this.machineNumberValue !== null) { this.check1 = 1 } else { this.check1 = 0 }
if (this.groupNumberValue !== '' && this.groupNumberValue !== null) { this.check2 = 1 } else { this.check2 = 0 }
if (this.PartDrawingNumber !== '' && this.PartDrawingNumber !== null) { this.check3 = 1 } else { this.check3 = 0 }
if (this.startTime === '' || this.startTime === null) { this.startTime_check = 0 } else { this.startTime_check = 1 }
if (this.endTime === '' || this.endTime === null) { this.endTime_check = 0 } else { this.endTime_check = 1 }
selecttable(this.check1, this.machineNumberValue, this.check2, this.groupNumberValue, this.check3, this.PartDrawingNumber, this.startTime_check, this.startTime, this.endTime_check, this.endTime, this.pageCurrent, this.pageSize, this.ordername, this.order).then(response => {
this.dateRange ? this.startTime_check = 1 : (this.startTime_check = 0, this.dateRange = '')
this.dateRange ? this.endTime_check = 1 : (this.endTime_check = 0, this.dateRange = '')
selecttable(this.check1, this.machineNumberValue, this.check2, this.groupNumberValue, this.check3, this.PartDrawingNumber, this.startTime_check, this.dateRange[0], this.endTime_check, this.dateRange[1], this.pageCurrent, this.pageSize, this.ordername, this.order).then(response => {
this.tableData1 = response.data.rows
this.loading = false
this.total = response.data.total