Merge branch 'master' of http://192.168.0.149:10010/r/高精2.0
This commit is contained in:
@@ -35,14 +35,15 @@ export function searchgroup(num) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 组件查询
|
// 组件查询
|
||||||
export function selecttable(check1, value1, check2, value2, check3, value3, check4, value4) {
|
export function selecttable(check1, value1, check2, value2, check3, value3, check4, value4, pageCurrent, pageSize) {
|
||||||
return request({
|
return request({
|
||||||
url: '',
|
url: '',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: {
|
data: {
|
||||||
type: '1',
|
type: '1',
|
||||||
name: '质量管理_质量情况_查询数据',
|
name: '质量管理_质量情况_查询数据',
|
||||||
param: '机床流水号_check=' + check1 + '&机床流水号=' + value1 + '&组件流水号_check=' + check2 + '&组件流水号=' + value2 + '&零件名称_check=' + check3 + '&零件名称=' + value3 + '&质检类型代码_check=' + check4 + '&质检类型代码=' + value4
|
param: '机床流水号_check=' + check1 + '&机床流水号=' + value1 + '&组件流水号_check=' + check2 + '&组件流水号=' + value2 + '&零件名称_check=' + check3 + '&零件名称=' + value3 + '&质检类型代码_check=' + check4 + '&质检类型代码=' + value4,
|
||||||
|
Pagination: pageCurrent + '&' + pageSize
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,14 +24,15 @@ export function searchgroup(num) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 车间生产管理工艺_备料管理_备料出库记录_视图_查询数据
|
// 车间生产管理工艺_备料管理_备料出库记录_视图_查询数据
|
||||||
export function selecttable(check1, value1, check2, value2, check3, value3, check4, value4, check5, value5) {
|
export function selecttable(check1, value1, check2, value2, check3, value3, check4, value4, check5, value5, pageCurrent, pageSize) {
|
||||||
return request({
|
return request({
|
||||||
url: '',
|
url: '',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: {
|
data: {
|
||||||
type: '1',
|
type: '1',
|
||||||
name: '车间生产管理工艺_备料管理_备料出库记录_视图_查询数据',
|
name: '车间生产管理工艺_备料管理_备料出库记录_视图_查询数据',
|
||||||
param: '机床流水号_check=' + check1 + '&机床流水号=' + value1 + '&组件流水号_check=' + check2 + '&组件流水号=' + value2 + '&零件图号_check=' + check3 + '&零件图号=' + value3 + '&开始时间_check=' + check4 + '&开始时间=' + value4 + '&结束时间_check=' + check5 + '&结束时间=' + value5
|
param: '机床流水号_check=' + check1 + '&机床流水号=' + value1 + '&组件流水号_check=' + check2 + '&组件流水号=' + value2 + '&零件图号_check=' + check3 + '&零件图号=' + value3 + '&开始时间_check=' + check4 + '&开始时间=' + value4 + '&结束时间_check=' + check5 + '&结束时间=' + value5,
|
||||||
|
Pagination: pageCurrent + '&' + pageSize
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
122
src/api/Inventory/CreatePickingList.js
Normal file
122
src/api/Inventory/CreatePickingList.js
Normal file
@@ -0,0 +1,122 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 初始化人员
|
||||||
|
export function initPickPerson() {
|
||||||
|
return request({
|
||||||
|
url: '',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
type: '3',
|
||||||
|
name: 'select 姓名,人员编号 from 人事档案管理_人员名单 where 是否离职 = 0'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 初始化机床项目
|
||||||
|
export function initMachineProject() {
|
||||||
|
return request({
|
||||||
|
url: '',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
type: '1',
|
||||||
|
name: 'PDM_项目名称_查询数据'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 组件查询
|
||||||
|
export function searchgroup(num) {
|
||||||
|
return request({
|
||||||
|
url: '',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
type: '1',
|
||||||
|
name: 'PDM_组件名称_查询数据',
|
||||||
|
param: '机床流水号=' + num
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 查询三表
|
||||||
|
export function searchTable(...params) {
|
||||||
|
return request({
|
||||||
|
url: '',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
type: '1',
|
||||||
|
name: '车间装配管理_领料单_三表_查询数据',
|
||||||
|
param: `机床流水号_check=${params[0]}&机床流水号=${params[1]}&组件流水号_check=${params[2]}&组件流水号=${params[3]}&零件类型=${params[6]}`,
|
||||||
|
Pagination: params[4] + '&' + params[5]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 领料单查询
|
||||||
|
export function searchList(pageCurrent, pageSize, listNumber_check, listNumber) {
|
||||||
|
return request({
|
||||||
|
url: '',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
type: '1',
|
||||||
|
name: '车间装配管理_领料单_查询数据',
|
||||||
|
param: '领料单编号_check=' + listNumber_check + '&领料单编号=' + listNumber,
|
||||||
|
Pagination: pageCurrent + '&' + pageSize
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 创建领料单
|
||||||
|
export function createList(num, remark) {
|
||||||
|
return request({
|
||||||
|
url: '',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
type: '2',
|
||||||
|
name: '车间装配管理_领料单_增加数据',
|
||||||
|
param: '领料人流水号=' + num + '&领料单备注=' + remark
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 删除领料单
|
||||||
|
export function dropList(num) {
|
||||||
|
return request({
|
||||||
|
url: '',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
type: '2',
|
||||||
|
name: '车间装配管理_领料单_删除数据',
|
||||||
|
param: '领料单流水号=' + num
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 选入领料单
|
||||||
|
export function searchListDetail(...params) {
|
||||||
|
return request({
|
||||||
|
url: '',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
type: '1',
|
||||||
|
name: '车间装配管理_领料单明细_查询数据',
|
||||||
|
param: `领料单流水号=${params[0]}`
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 选入领料单
|
||||||
|
export function selectIntoList(...params) {
|
||||||
|
return request({
|
||||||
|
url: '',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
type: '2',
|
||||||
|
name: '车间装配管理_领料单明细_增加数据',
|
||||||
|
param: `基本件流水号组=${params[0]}&标准件和外购件流水号组=${params[1]}&领料单流水号=${params[2]}`
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 删除领料单
|
||||||
|
export function dropListDetail(num) {
|
||||||
|
return request({
|
||||||
|
url: '',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
type: '1',
|
||||||
|
name: '车间装配管理_领料单明细_删除数据',
|
||||||
|
param: '领料单明细流水号=' + num
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -13,6 +13,18 @@ export function searchtable(num1, num2, num3, num4, num5, pageCurrent, pageSize)
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 查询人员总工工时
|
||||||
|
export function searchtable11(num1, num2, num3, num4, num5) {
|
||||||
|
return request({
|
||||||
|
url: '',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
type: '1',
|
||||||
|
name: '车间生产管理工艺_工时统计_查询数据2',
|
||||||
|
param: '操作者_check=' + num1 + '&姓名=' + num2 + '&时间_check=' + num3 + '&开始时间=' + num4 + '&结束时间=' + num5
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
// 查询人员具体工序
|
// 查询人员具体工序
|
||||||
export function searchtable2(num1, num2, num3, num4, pageCurrent, pageSize) {
|
export function searchtable2(num1, num2, num3, num4, pageCurrent, pageSize) {
|
||||||
return request({
|
return request({
|
||||||
@@ -26,3 +38,76 @@ export function searchtable2(num1, num2, num3, num4, pageCurrent, pageSize) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 查询人员具体工序
|
||||||
|
export function searchtable22(num1, num2, num3, num4) {
|
||||||
|
return request({
|
||||||
|
url: '',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
type: '1',
|
||||||
|
name: '车间生产管理工艺_工时统计按人员查询_查询数据2',
|
||||||
|
param: '工作者编号=' + num1 + '&时间_check=' + num2 + '&开始时间=' + num3 + '&结束时间=' + num4
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 初始化机床项目
|
||||||
|
export function initProject() {
|
||||||
|
return request({
|
||||||
|
url: '',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
type: '1',
|
||||||
|
name: 'PDM_项目名称_查询数据'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 车间生产管理工艺_工时统计_机床查询_查询数据
|
||||||
|
export function searchtable4(num1, num2, pageCurrent, pageSize) {
|
||||||
|
return request({
|
||||||
|
url: '',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
type: '1',
|
||||||
|
name: '车间生产管理工艺_工时统计_机床查询_查询数据',
|
||||||
|
param: '机床流水号_check=' + num1 + '&机床流水号=' + num2,
|
||||||
|
Pagination: pageCurrent + '&' + pageSize
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 车间生产管理工艺_工时统计_机床查询_查询数据
|
||||||
|
export function searchtable44(num1, num2) {
|
||||||
|
return request({
|
||||||
|
url: '',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
type: '1',
|
||||||
|
name: '车间生产管理工艺_工时统计_机床查询_查询数据',
|
||||||
|
param: '机床流水号_check=' + num1 + '&机床流水号=' + num2
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 车间生产管理工艺_工时统计_组号查询_查询数据
|
||||||
|
export function searchtable5(num1, pageCurrent, pageSize) {
|
||||||
|
return request({
|
||||||
|
url: '',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
type: '1',
|
||||||
|
name: '车间生产管理工艺_工时统计_组号查询_查询数据',
|
||||||
|
param: '机床流水号=' + num1,
|
||||||
|
Pagination: pageCurrent + '&' + pageSize
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 车间生产管理工艺_工时统计_组号查询_查询数据
|
||||||
|
export function searchtable55(num1) {
|
||||||
|
return request({
|
||||||
|
url: '',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
type: '1',
|
||||||
|
name: '车间生产管理工艺_工时统计_组号查询_查询数据',
|
||||||
|
param: '机床流水号=' + num1
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
<span>零件:</span>
|
<span>零件:</span>
|
||||||
<el-input v-model="SpareParts" filterable placeholder="请输入零件名称" style="width: 200px" size="small" clearable/>
|
<el-input v-model="SpareParts" filterable placeholder="请输入零件名称" style="width: 200px" size="small" clearable/>
|
||||||
<el-button type="success" size="small" icon="el-icon-search" style="margin-left: 15px" @click="selecttable">查询</el-button>
|
<el-button type="success" size="small" icon="el-icon-search" style="margin-left: 15px" @click="selecttable()">查询</el-button>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-card>
|
</el-card>
|
||||||
<el-card>
|
<el-card>
|
||||||
@@ -97,6 +97,17 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
<div class="block">
|
||||||
|
<el-pagination
|
||||||
|
v-if="!loading"
|
||||||
|
:current-page="pageCurrent"
|
||||||
|
:page-sizes="[10, 20, 30, 40, 100]"
|
||||||
|
:page-size="pageSize"
|
||||||
|
:total="total"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
@size-change="handleSizeChange"
|
||||||
|
@current-change="handleCurrentChange"/>
|
||||||
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -114,7 +125,11 @@ export default {
|
|||||||
QualityTypeNumber: [],
|
QualityTypeNumber: [],
|
||||||
QualityTypeValue: '',
|
QualityTypeValue: '',
|
||||||
tableData1: [],
|
tableData1: [],
|
||||||
SpareParts: ''
|
SpareParts: '',
|
||||||
|
loading: false,
|
||||||
|
total: null, // 总条数
|
||||||
|
pageSize: 10, // 每页显示条数
|
||||||
|
pageCurrent: 1 // 后台获取页
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@@ -165,10 +180,21 @@ export default {
|
|||||||
if (this.groupNumberValue !== '' && this.groupNumberValue !== null) { this.check2 = 1 } else { this.check2 = 0 }
|
if (this.groupNumberValue !== '' && this.groupNumberValue !== null) { this.check2 = 1 } else { this.check2 = 0 }
|
||||||
if (this.SpareParts !== '' && this.SpareParts !== null) { this.check3 = 1 } else { this.check3 = 0 }
|
if (this.SpareParts !== '' && this.SpareParts !== null) { this.check3 = 1 } else { this.check3 = 0 }
|
||||||
if (this.QualityTypeValue !== '' && this.QualityTypeValue !== null) { this.check4 = 1 } else { this.check4 = 0 }
|
if (this.QualityTypeValue !== '' && this.QualityTypeValue !== null) { this.check4 = 1 } else { this.check4 = 0 }
|
||||||
selecttable(this.check1, this.machineNumberValue, this.check2, this.groupNumberValue, this.check3, this.SpareParts, this.check4, this.QualityTypeValue).then(response => {
|
selecttable(this.check1, this.machineNumberValue, this.check2, this.groupNumberValue, this.check3, this.SpareParts, this.check4, this.QualityTypeValue, this.pageCurrent, this.pageSize).then(response => {
|
||||||
this.tableData1 = response.data
|
this.tableData1 = response.data.rows
|
||||||
console.log(response.data, 1111)
|
this.loading = false
|
||||||
|
this.total = response.data.total
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
// 分页
|
||||||
|
handleSizeChange(val) {
|
||||||
|
this.pageCurrent = 1
|
||||||
|
this.pageSize = val
|
||||||
|
this.selecttable()
|
||||||
|
},
|
||||||
|
handleCurrentChange(val) {
|
||||||
|
this.pageCurrent = val
|
||||||
|
this.selecttable()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
style="width: 160px"
|
style="width: 160px"
|
||||||
type="date"
|
type="date"
|
||||||
placeholder="选择日期"/>
|
placeholder="选择日期"/>
|
||||||
<el-button type="success" size="small" icon="el-icon-search" style="margin-left: 15px" @click="selecttable">查询</el-button>
|
<el-button type="success" size="small" icon="el-icon-search" style="margin-left: 15px" @click="total=0;pageSize=10; pageCurrent=1;selecttable()">查询</el-button>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-card>
|
</el-card>
|
||||||
<el-card>
|
<el-card>
|
||||||
@@ -54,16 +54,6 @@
|
|||||||
{{ scope.row.机床图号 }}
|
{{ scope.row.机床图号 }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="机床名称" align="center">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
{{ scope.row.机床名称 }}
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="组号" align="center">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
{{ scope.row.组号 }}
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="零件图号" align="center">
|
<el-table-column label="零件图号" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ scope.row.零件图号 }}
|
{{ scope.row.零件图号 }}
|
||||||
@@ -74,17 +64,23 @@
|
|||||||
{{ scope.row.零件名称 }}
|
{{ scope.row.零件名称 }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="质检类型" align="center">
|
<el-table-column label="出库时间" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ scope.row.质检类型 }}
|
{{ scope.row.出库时间 }}
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="数量" align="center">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
{{ scope.row.数量 }}
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
<div class="block">
|
||||||
|
<el-pagination
|
||||||
|
v-if="!loading"
|
||||||
|
:current-page="pageCurrent"
|
||||||
|
:page-sizes="[10, 20, 30, 40, 100]"
|
||||||
|
:page-size="pageSize"
|
||||||
|
:total="total"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
@size-change="handleSizeChange"
|
||||||
|
@current-change="handleCurrentChange"/>
|
||||||
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -104,7 +100,11 @@ export default {
|
|||||||
machineNumber: [],
|
machineNumber: [],
|
||||||
groupNumberValue: '',
|
groupNumberValue: '',
|
||||||
groupNumber: [],
|
groupNumber: [],
|
||||||
tableData1: []
|
tableData1: [],
|
||||||
|
loading: false,
|
||||||
|
total: null, // 总条数
|
||||||
|
pageSize: 10, // 每页显示条数
|
||||||
|
pageCurrent: 1 // 后台获取页
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@@ -144,10 +144,21 @@ export default {
|
|||||||
if (this.PartDrawingNumber !== '' && this.PartDrawingNumber !== null) { this.check3 = 1 } else { this.check3 = 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.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 }
|
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).then(response => {
|
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).then(response => {
|
||||||
this.tableData1 = response.data
|
this.tableData1 = response.data.rows
|
||||||
console.log(response.data, 1111)
|
this.loading = false
|
||||||
|
this.total = response.data.total
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
// 分页
|
||||||
|
handleSizeChange(val) {
|
||||||
|
this.pageCurrent = 1
|
||||||
|
this.pageSize = val
|
||||||
|
this.selecttable()
|
||||||
|
},
|
||||||
|
handleCurrentChange(val) {
|
||||||
|
this.pageCurrent = val
|
||||||
|
this.selecttable()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
645
src/views/Inventory/CreatePickingList/index.vue
Normal file
645
src/views/Inventory/CreatePickingList/index.vue
Normal file
@@ -0,0 +1,645 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-card>
|
||||||
|
<div slot="header">
|
||||||
|
<span>机床编号:</span>
|
||||||
|
<el-select v-model="machineNumberValue" filterable placeholder="机床编号" size="small" clearable @change="machineChange">
|
||||||
|
<el-option
|
||||||
|
v-for="item in machineNumber"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value">
|
||||||
|
<div style="float: left">{{ item.label }}</div>
|
||||||
|
<div style="float: right; color: #8492a6; font-size: 13px">{{ item.name }}</div>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
<span>组号:</span>
|
||||||
|
<el-select v-model="groupNumberValue" placeholder="组号" size="small" clearable>
|
||||||
|
<el-option
|
||||||
|
v-for="item in groupNumber"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"/>
|
||||||
|
</el-select>
|
||||||
|
<el-button size="small" type="success" icon="el-icon-search" style="margin: 0 0 0 10px" @click="pageCurrent0=1;pageSize0=20;pageCurrent1=1;pageSize1=20;pageCurrent2=1;pageSize2=20;searchTable()">查询</el-button>
|
||||||
|
</div>
|
||||||
|
<el-tabs v-model="PartType" type="card" @tab-click="searchTable()">
|
||||||
|
<el-tab-pane label="标准件" name="标准件">
|
||||||
|
<el-table ref="multipleTable" :data="tableData0" size="mini" style="max-height: 600px" height="600px" border stripe @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" align="center" width="50"/>
|
||||||
|
<el-table-column align="center" label="机床图号" min-width="100px">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.机床图号 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="组号" min-width="80px">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.组号 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="名称" min-width="100px">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.物料名称 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="型号" min-width="100px">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.物料型号 || '—' }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="规格" min-width="200px">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.物料规格 || '—' }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="单台机床数量" min-width="100px">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.单台机床数量 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="总数量" min-width="100px">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.总数量 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="备件数量" min-width="100px">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.备件总数量 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<div class="block" style="float:right;">
|
||||||
|
<el-pagination
|
||||||
|
:current-page="pageCurrent0"
|
||||||
|
:page-sizes="[10, 20, 30, 40]"
|
||||||
|
:page-size="pageSize0"
|
||||||
|
:total="total0"
|
||||||
|
style="margin-top:10px;display:inline-block;width:50%"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
@size-change="handleSizeChange0"
|
||||||
|
@current-change="handleCurrentChange0"/>
|
||||||
|
</div>
|
||||||
|
</el-tab-pane>
|
||||||
|
<el-tab-pane label="外购件" name="外购件">
|
||||||
|
<el-table ref="multipleTable" :data="tableData1" size="mini" style="max-height: 600px" height="600px" border stripe @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" align="center" width="50"/>
|
||||||
|
<el-table-column align="center" label="机床图号" min-width="100px">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.机床图号 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="组号" min-width="80px">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.组号 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="名称" min-width="100px">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.物料名称 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="型号" min-width="100px">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.物料型号 || '—' }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="规格" min-width="200px">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.物料规格 || '—' }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="总数量" min-width="100px">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.总数量 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="备件数量" min-width="100px">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.备件总数量 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<div class="block" style="float:right;">
|
||||||
|
<el-pagination
|
||||||
|
:current-page="pageCurrent1"
|
||||||
|
:page-sizes="[10, 20, 30, 40]"
|
||||||
|
:page-size="pageSize1"
|
||||||
|
:total="total1"
|
||||||
|
style="margin-top:10px;display:inline-block;width:50%"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
@size-change="handleSizeChange1"
|
||||||
|
@current-change="handleCurrentChange1"/>
|
||||||
|
</div>
|
||||||
|
</el-tab-pane>
|
||||||
|
<el-tab-pane label="基本件" name="基本件">
|
||||||
|
<el-table ref="multipleTable" :data="tableData2" size="mini" style="max-height: 600px" height="600px" border stripe @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" align="center" width="50"/>
|
||||||
|
<el-table-column align="center" label="机床图号" min-width="100px">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.机床图号 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="组号" min-width="80px">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.组号 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="名称" min-width="100px">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.零件名称 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="图号" min-width="100px">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.零件图号 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="规格" min-width="100px">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.规格 || '—' }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="材料" min-width="100px">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.材料 || '—' }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="总数量" min-width="100px">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.总数量 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="备件数量" min-width="100px">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.备件总数量 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<div class="block" style="float:right;">
|
||||||
|
<el-pagination
|
||||||
|
:current-page="pageCurrent2"
|
||||||
|
:page-sizes="[10, 20, 30, 40]"
|
||||||
|
:page-size="pageSize2"
|
||||||
|
:total="total2"
|
||||||
|
style="margin-top:10px;display:inline-block;width:50%"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
@size-change="handleSizeChange2"
|
||||||
|
@current-change="handleCurrentChange2"/>
|
||||||
|
</div>
|
||||||
|
</el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<el-card>
|
||||||
|
<div slot="header">
|
||||||
|
<span style="margin: 5px">领料单编号:</span>
|
||||||
|
<el-input v-model="pickingListNumber" clearable size="small" style="width:200px" />
|
||||||
|
<el-button size="small" type="success" icon="el-icon-search" style="margin: 0 0 0 10px" @click="searchList()">查询</el-button>
|
||||||
|
<el-button size="small" type="primary" icon="el-icon-plus" style="margin: 0 0 0 10px" @click="createList()">创建</el-button>
|
||||||
|
<el-button size="small" type="primary" icon="el-icon-bottom" style="margin: 0 0 0 10px" @click="selectInto()">选入</el-button>
|
||||||
|
</div>
|
||||||
|
<h4 style="margin-top:0">领料单</h4>
|
||||||
|
<el-table :data="pickListTable1" highlight-current-row border style="width: 100%;" size="mini" height="300" @row-click="clickList">
|
||||||
|
<el-table-column label="序号" align="center" type="index" width="50"/>
|
||||||
|
<el-table-column label="领料单编号" align="center" min-width="200">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.领料单编号 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="创建时间" align="center" min-width="200" >
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.操作日期.split(' ')[0] }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="领料人" align="center" min-width="130">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.姓名 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="领料单备注" align="center" min-width="130">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.领料单备注 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="领回确认" align="center" min-width="80">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag v-if="Number(scope.row.是否启用)===1" type="warning">未确认</el-tag>
|
||||||
|
<el-tag v-else type="success">已确认</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" align="center" width="200px">
|
||||||
|
<template slot-scope="scope" align="center">
|
||||||
|
<el-button :disabled="Number(scope.row.是否启用)===0" size="mini" type="primary" icon="el-icon-check" @click="checkList(scope.row)">确认</el-button>
|
||||||
|
<el-button :disabled="Number(scope.row.是否启用)===0" size="mini" type="danger" icon="el-icon-delete" @click="dropList(scope.row)">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<div class="block" style="float:right;margin: 10px 0;">
|
||||||
|
<el-pagination
|
||||||
|
:current-page="pageCurrent3"
|
||||||
|
:page-sizes="[10, 20, 30, 40]"
|
||||||
|
:page-size="pageSize3"
|
||||||
|
:total="total3"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
@size-change="handleSizeChange3"
|
||||||
|
@current-change="handleCurrentChange3"/>
|
||||||
|
</div>
|
||||||
|
<h4>领料单明细:{{ pickingListNumberShow }}</h4>
|
||||||
|
<el-table :data="pickListTable2" border style="width: 100%;" size="mini" height="300">
|
||||||
|
<el-table-column label="序号" align="center" type="index" width="50"/>
|
||||||
|
<el-table-column label="名称" align="center" min-width="100">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.名称 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="图号或型号" align="center" min-width="100">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.图号或型号 || '—' }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="规格" align="center" min-width="100">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.规格 || '—' }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="机床图号" align="center" min-width="100">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.机床图号 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="组号" align="center" min-width="70">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.组号 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="总数量" align="center" min-width="70">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.总数量 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="备件数量" align="center" min-width="70">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.备件数量 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column v-if="true" label="操作" align="center" width="100">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button :disabled="!!scope.row.是否出库" size="mini" type="danger" icon="el-icon-delete" @click="dropListDetail(scope.row)">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<el-dialog :visible.sync="dialogFormVisible1" title="创建领料单" center width="380px">
|
||||||
|
<el-form ref="form1" :model="form1" :rules="rules1" label-position="left">
|
||||||
|
<el-form-item label="领料人" prop="领料人流水号" label-width="100px" size="small">
|
||||||
|
<el-select v-model="form1.领料人流水号" placeholder="请选择" size="small" clearable filterable>
|
||||||
|
<el-option
|
||||||
|
v-for="item in pickPerson"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="领料单备注" prop="领料单备注" label-width="100px">
|
||||||
|
<el-input v-model="form1.领料单备注" size="small" placeholder="备注" style="width: 200px"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="dialogFormVisible1=false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="submitCreateList()">确 定</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { initPickPerson, initMachineProject, searchgroup, searchTable, searchList, createList, dropList, selectIntoList, searchListDetail, dropListDetail } from '@/api/Inventory/CreatePickingList'
|
||||||
|
import request from '@/utils/request'
|
||||||
|
export default {
|
||||||
|
name: 'CreatePickingList',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
PartType: '基本件',
|
||||||
|
machineNumberValue: '',
|
||||||
|
machineNumber: [],
|
||||||
|
groupNumberValue: '',
|
||||||
|
groupNumber: [],
|
||||||
|
tableData0: [],
|
||||||
|
tableData1: [],
|
||||||
|
tableData2: [],
|
||||||
|
pageCurrent0: 1,
|
||||||
|
pageSize0: 20,
|
||||||
|
total0: 0,
|
||||||
|
pageCurrent1: 1,
|
||||||
|
pageSize1: 20,
|
||||||
|
total1: 0,
|
||||||
|
pageCurrent2: 1,
|
||||||
|
pageSize2: 20,
|
||||||
|
total2: 0,
|
||||||
|
pickListTable1: [],
|
||||||
|
pageCurrent3: 1,
|
||||||
|
pageSize3: 20,
|
||||||
|
total3: 0,
|
||||||
|
pickListTable2: [],
|
||||||
|
dialogFormVisible1: false,
|
||||||
|
form1: {
|
||||||
|
领料人流水号: '',
|
||||||
|
领料单备注: ''
|
||||||
|
},
|
||||||
|
rules1: {
|
||||||
|
领料人流水号: [{ required: true, message: '请选择领料人' }]
|
||||||
|
},
|
||||||
|
pickPerson: [],
|
||||||
|
pickingListNumber: '', // 领料单编号
|
||||||
|
pickingListNumberShow: '', // 领料单编号
|
||||||
|
pickingListNum: '', // 领料单流水号
|
||||||
|
multipleSelection: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.fetchData()
|
||||||
|
this.searchTable()
|
||||||
|
this.searchList()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 初始化数据
|
||||||
|
fetchData() {
|
||||||
|
initPickPerson().then(response => {
|
||||||
|
for (let i = 0; i < response.data.length; i++) {
|
||||||
|
this.pickPerson.push({
|
||||||
|
label: response.data[i].姓名,
|
||||||
|
value: response.data[i].人员编号
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
initMachineProject().then(response => {
|
||||||
|
for (let i = 0; i < response.data.length; i++) {
|
||||||
|
this.machineNumber.push({
|
||||||
|
label: response.data[i].机床图号,
|
||||||
|
name: response.data[i].项目名称,
|
||||||
|
value: response.data[i].机床流水号
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 根据机床查分组
|
||||||
|
machineChange() {
|
||||||
|
this.groupNumberValue = ''
|
||||||
|
this.groupNumber = []
|
||||||
|
searchgroup(this.machineNumberValue).then(response => {
|
||||||
|
for (let i = 0; i < response.data.length; i++) {
|
||||||
|
this.groupNumber.push({
|
||||||
|
label: response.data[i].组号,
|
||||||
|
value: response.data[i].组件流水号
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 查三表
|
||||||
|
searchTable() {
|
||||||
|
this.multipleSelection = []
|
||||||
|
if (this.PartType === '标准件') {
|
||||||
|
this.searchTable0()
|
||||||
|
} else if (this.PartType === '外购件') {
|
||||||
|
this.searchTable1()
|
||||||
|
} else if (this.PartType === '基本件') {
|
||||||
|
this.searchTable2()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 标准件
|
||||||
|
searchTable0() {
|
||||||
|
let check1, check2
|
||||||
|
this.machineNumberValue ? check1 = 1 : check1 = 0
|
||||||
|
this.groupNumberValue ? check2 = 1 : check2 = 0
|
||||||
|
searchTable(check1, this.machineNumberValue, check2, this.groupNumberValue, this.pageCurrent0, this.pageSize0, 1).then(response => {
|
||||||
|
this.tableData0 = response.data.rows
|
||||||
|
this.total0 = response.data.total
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 外购件
|
||||||
|
searchTable1() {
|
||||||
|
let check1, check2
|
||||||
|
this.machineNumberValue ? check1 = 1 : check1 = 0
|
||||||
|
this.groupNumberValue ? check2 = 1 : check2 = 0
|
||||||
|
searchTable(check1, this.machineNumberValue, check2, this.groupNumberValue, this.pageCurrent1, this.pageSize1, 2).then(response => {
|
||||||
|
this.tableData1 = response.data.rows
|
||||||
|
this.total1 = response.data.total
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 基本件
|
||||||
|
searchTable2() {
|
||||||
|
let check1, check2
|
||||||
|
this.machineNumberValue ? check1 = 1 : check1 = 0
|
||||||
|
this.groupNumberValue ? check2 = 1 : check2 = 0
|
||||||
|
searchTable(check1, this.machineNumberValue, check2, this.groupNumberValue, this.pageCurrent2, this.pageSize2, 3).then(response => {
|
||||||
|
this.tableData2 = response.data.rows
|
||||||
|
this.total2 = response.data.total
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleSizeChange0(val) {
|
||||||
|
this.pageSize0 = val
|
||||||
|
this.pageCurrent0 = 1
|
||||||
|
this.searchTable0()
|
||||||
|
},
|
||||||
|
handleCurrentChange0(val) {
|
||||||
|
this.pageCurrent0 = val
|
||||||
|
this.searchTable0()
|
||||||
|
},
|
||||||
|
handleSizeChange1(val) {
|
||||||
|
this.pageSize1 = val
|
||||||
|
this.pageCurrent1 = 1
|
||||||
|
this.searchTable1()
|
||||||
|
},
|
||||||
|
handleCurrentChange1(val) {
|
||||||
|
this.pageCurrent1 = val
|
||||||
|
this.searchTable1()
|
||||||
|
},
|
||||||
|
handleSizeChange2(val) {
|
||||||
|
this.pageSize2 = val
|
||||||
|
this.pageCurrent2 = 1
|
||||||
|
this.searchTable2()
|
||||||
|
},
|
||||||
|
handleCurrentChange2(val) {
|
||||||
|
this.pageCurrent2 = val
|
||||||
|
this.searchTable2()
|
||||||
|
},
|
||||||
|
// 查询领料单列表
|
||||||
|
searchList() {
|
||||||
|
let check
|
||||||
|
this.pickingListNumber ? check = 1 : check = 0
|
||||||
|
searchList(this.pageCurrent3, this.pageSize3, check, this.pickingListNumber).then(response => {
|
||||||
|
this.pickListTable1 = response.data.rows
|
||||||
|
this.total3 = response.data.total
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleSizeChange3(val) {
|
||||||
|
this.pageSize3 = val
|
||||||
|
this.pageCurrent3 = 1
|
||||||
|
this.searchList()
|
||||||
|
},
|
||||||
|
handleCurrentChange3(val) {
|
||||||
|
this.pageCurrent3 = val
|
||||||
|
this.searchList()
|
||||||
|
},
|
||||||
|
// 创建领料单
|
||||||
|
createList() {
|
||||||
|
if (this.$refs['form1'] !== undefined) {
|
||||||
|
this.$refs['form1'].resetFields()
|
||||||
|
}
|
||||||
|
this.form1.领料人流水号 = ''
|
||||||
|
this.form1.领料单备注 = ''
|
||||||
|
this.dialogFormVisible1 = true
|
||||||
|
},
|
||||||
|
// 提交创建领料单
|
||||||
|
submitCreateList() {
|
||||||
|
createList(this.form1.领料人流水号, this.form1.领料单备注).then(response => {
|
||||||
|
if (response.data[0].result === '1') {
|
||||||
|
this.$message.success('创建成功')
|
||||||
|
this.dialogFormVisible1 = false
|
||||||
|
this.searchList()
|
||||||
|
} else { this.$message.error('操作失败') }
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 确认领料单
|
||||||
|
checkList(row) {
|
||||||
|
this.$confirm('是否确认领回?', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
const param = {
|
||||||
|
url: '',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
type: '4',
|
||||||
|
name: `update 车间装配管理_领料单 set 是否启用 = 0 where 领料单流水号 = ${row.领料单流水号}`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
request(param).then(res => {
|
||||||
|
if (res.data[0].result === '1') {
|
||||||
|
this.$message.success('操作成功')
|
||||||
|
this.pickingListNumber = ''
|
||||||
|
this.searchList()
|
||||||
|
} else {
|
||||||
|
this.$message.error('操作失败')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}).catch(() => {
|
||||||
|
this.$message({
|
||||||
|
type: 'info',
|
||||||
|
message: '已取消操作'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 删除领料单
|
||||||
|
dropList(row) {
|
||||||
|
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
dropList(row.领料单流水号).then(response => {
|
||||||
|
if (Number(response.data[0].result) === 1) {
|
||||||
|
this.$message.success('删除成功')
|
||||||
|
this.searchList()
|
||||||
|
} else {
|
||||||
|
this.$message.error('数据占用')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}).catch(() => {
|
||||||
|
this.$message({
|
||||||
|
type: 'info',
|
||||||
|
message: '已取消删除'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 多选
|
||||||
|
handleSelectionChange(val) {
|
||||||
|
this.multipleSelection = val
|
||||||
|
},
|
||||||
|
// 选入
|
||||||
|
selectInto() {
|
||||||
|
const basePartGroup = []
|
||||||
|
const purchasePartGroup = []
|
||||||
|
this.multipleSelection.map(v => {
|
||||||
|
v.基本件流水号 ? basePartGroup.push(v.基本件流水号) : purchasePartGroup.push(v.标准件和外购件流水号)
|
||||||
|
})
|
||||||
|
if (basePartGroup.length === 0 && purchasePartGroup.length === 0) {
|
||||||
|
this.$message.warning('请勾选零件')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!this.pickingListNum || !this.pickingListNumberShow) {
|
||||||
|
this.$message.warning('请选择领料单')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (basePartGroup.length) { // 基本件
|
||||||
|
selectIntoList(basePartGroup, null, this.pickingListNum).then(response => {
|
||||||
|
if (response.data[0].result === '1') {
|
||||||
|
this.$message.success('操作成功')
|
||||||
|
this.multipleSelection = []
|
||||||
|
this.clickList()
|
||||||
|
} else { this.$message.error('操作失败') }
|
||||||
|
})
|
||||||
|
} else { // 标准件外购件
|
||||||
|
selectIntoList(null, purchasePartGroup, this.pickingListNum).then(response => {
|
||||||
|
if (response.data[0].result === '1') {
|
||||||
|
this.$message.success('操作成功')
|
||||||
|
this.multipleSelection = []
|
||||||
|
this.clickList()
|
||||||
|
} else { this.$message.error('操作失败') }
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 查看领料单明细
|
||||||
|
clickList(row) {
|
||||||
|
row ? this.pickingListNum = row.领料单流水号 : this.pickingListNum
|
||||||
|
row ? this.pickingListNumberShow = row.领料单编号 : this.pickingListNumberShow
|
||||||
|
searchListDetail(this.pickingListNum).then(res => {
|
||||||
|
this.pickListTable2 = res.data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 删除领料单明细
|
||||||
|
dropListDetail(row) {
|
||||||
|
console.log(row)
|
||||||
|
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
dropListDetail(row.领料单明细流水号).then(response => {
|
||||||
|
if (Number(response.data[0].result) === 1) {
|
||||||
|
this.$message.success('删除成功')
|
||||||
|
this.clickList()
|
||||||
|
} else {
|
||||||
|
this.$message.error('已确认领回,不可删除')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}).catch(() => {
|
||||||
|
this.$message({
|
||||||
|
type: 'info',
|
||||||
|
message: '已取消删除'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.el-card{
|
||||||
|
margin-bottom: 15px;
|
||||||
|
}
|
||||||
|
.el-select{
|
||||||
|
width:200px
|
||||||
|
}
|
||||||
|
.el-input{
|
||||||
|
width:200px
|
||||||
|
}
|
||||||
|
span{
|
||||||
|
margin: 10px 0 10px 10px;
|
||||||
|
}
|
||||||
|
.el-tag{
|
||||||
|
margin: 0
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -155,7 +155,7 @@
|
|||||||
<td class="tg-c3ow">定额员</td>
|
<td class="tg-c3ow">定额员</td>
|
||||||
<td class="tg-c3ow">{{ tableData2[0] ? tableData2[0].定额员 : '' }}</td>
|
<td class="tg-c3ow">{{ tableData2[0] ? tableData2[0].定额员 : '' }}</td>
|
||||||
<td class="tg-c3ow">工艺完成</td>
|
<td class="tg-c3ow">工艺完成</td>
|
||||||
<td class="tg-c3ow">{{ tableData2[0] ? tableData2[0].工艺实际完成时间.split(' ')[0] : '' }}</td>
|
<td class="tg-c3ow">{{ tableData2[0].工艺实际完成时间 ? tableData2[0].工艺实际完成时间.split(' ')[0] : '' }}</td>
|
||||||
<td class="tg-c3ow">加工开始</td>
|
<td class="tg-c3ow">加工开始</td>
|
||||||
<td class="tg-c3ow" colspan="2">{{ tableData2[0] ? tableData2[0].机加工开始时间 : '' }}</td>
|
<td class="tg-c3ow" colspan="2">{{ tableData2[0] ? tableData2[0].机加工开始时间 : '' }}</td>
|
||||||
<td class="tg-c3ow">加工结束</td>
|
<td class="tg-c3ow">加工结束</td>
|
||||||
|
|||||||
@@ -0,0 +1,224 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
require('script-loader!file-saver');
|
||||||
|
// import XLSX from 'xlsx'
|
||||||
|
import XLSX from 'xlsx-style'
|
||||||
|
function generateArray(table) {
|
||||||
|
var out = [];
|
||||||
|
var rows = table.querySelectorAll('tr');
|
||||||
|
var ranges = [];
|
||||||
|
for (var R = 0; R < rows.length; ++R) {
|
||||||
|
var outRow = [];
|
||||||
|
var row = rows[R];
|
||||||
|
var columns = row.querySelectorAll('td');
|
||||||
|
for (var C = 0; C < columns.length; ++C) {
|
||||||
|
var cell = columns[C];
|
||||||
|
var colspan = cell.getAttribute('colspan');
|
||||||
|
var rowspan = cell.getAttribute('rowspan');
|
||||||
|
var cellValue = cell.innerText;
|
||||||
|
if (cellValue !== "" && cellValue == +cellValue) cellValue = +cellValue;
|
||||||
|
|
||||||
|
//Skip ranges
|
||||||
|
ranges.forEach(function (range) {
|
||||||
|
if (R >= range.s.r && R <= range.e.r && outRow.length >= range.s.c && outRow.length <= range.e.c) {
|
||||||
|
for (var i = 0; i <= range.e.c - range.s.c; ++i) outRow.push(null);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//Handle Row Span
|
||||||
|
if (rowspan || colspan) {
|
||||||
|
rowspan = rowspan || 1;
|
||||||
|
colspan = colspan || 1;
|
||||||
|
ranges.push({
|
||||||
|
s: {
|
||||||
|
r: R,
|
||||||
|
c: outRow.length
|
||||||
|
},
|
||||||
|
e: {
|
||||||
|
r: R + rowspan - 1,
|
||||||
|
c: outRow.length + colspan - 1
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
//Handle Value
|
||||||
|
outRow.push(cellValue !== "" ? cellValue : null);
|
||||||
|
|
||||||
|
//Handle Colspan
|
||||||
|
if (colspan)
|
||||||
|
for (var k = 0; k < colspan - 1; ++k) outRow.push(null);
|
||||||
|
}
|
||||||
|
out.push(outRow);
|
||||||
|
}
|
||||||
|
return [out, ranges];
|
||||||
|
};
|
||||||
|
|
||||||
|
function datenum(v, date1904) {
|
||||||
|
if (date1904) v += 1462;
|
||||||
|
var epoch = Date.parse(v);
|
||||||
|
return (epoch - new Date(Date.UTC(1899, 11, 30))) / (24 * 60 * 60 * 1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
function sheet_from_array_of_arrays(data, opts) {
|
||||||
|
var ws = {};
|
||||||
|
var range = {
|
||||||
|
s: {
|
||||||
|
c: 10000000,
|
||||||
|
r: 10000000
|
||||||
|
},
|
||||||
|
e: {
|
||||||
|
c: 0,
|
||||||
|
r: 0
|
||||||
|
}
|
||||||
|
};
|
||||||
|
for (var R = 0; R != data.length; ++R) {
|
||||||
|
for (var C = 0; C != data[R].length; ++C) {
|
||||||
|
if (range.s.r > R) range.s.r = R;
|
||||||
|
if (range.s.c > C) range.s.c = C;
|
||||||
|
if (range.e.r < R) range.e.r = R;
|
||||||
|
if (range.e.c < C) range.e.c = C;
|
||||||
|
var cell = {
|
||||||
|
v: data[R][C]
|
||||||
|
};
|
||||||
|
if (cell.v == null) continue;
|
||||||
|
var cell_ref = XLSX.utils.encode_cell({
|
||||||
|
c: C,
|
||||||
|
r: R
|
||||||
|
});
|
||||||
|
|
||||||
|
if (typeof cell.v === 'number') cell.t = 'n';
|
||||||
|
else if (typeof cell.v === 'boolean') cell.t = 'b';
|
||||||
|
else if (cell.v instanceof Date) {
|
||||||
|
cell.t = 'n';
|
||||||
|
cell.z = XLSX.SSF._table[14];
|
||||||
|
cell.v = datenum(cell.v);
|
||||||
|
} else cell.t = 's';
|
||||||
|
|
||||||
|
ws[cell_ref] = cell;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (range.s.c < 10000000) ws['!ref'] = XLSX.utils.encode_range(range);
|
||||||
|
return ws;
|
||||||
|
}
|
||||||
|
|
||||||
|
function Workbook() {
|
||||||
|
if (!(this instanceof Workbook)) return new Workbook();
|
||||||
|
this.SheetNames = [];
|
||||||
|
this.Sheets = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
function s2ab(s) {
|
||||||
|
var buf = new ArrayBuffer(s.length);
|
||||||
|
var view = new Uint8Array(buf);
|
||||||
|
for (var i = 0; i != s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF;
|
||||||
|
return buf;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function export_table_to_excel(id) {
|
||||||
|
var theTable = document.getElementById(id);
|
||||||
|
var oo = generateArray(theTable);
|
||||||
|
var ranges = oo[1];
|
||||||
|
|
||||||
|
/* original data */
|
||||||
|
var data = oo[0];
|
||||||
|
var ws_name = "SheetJS";
|
||||||
|
|
||||||
|
var wb = new Workbook(),
|
||||||
|
ws = sheet_from_array_of_arrays(data);
|
||||||
|
|
||||||
|
/* add ranges to worksheet */
|
||||||
|
// ws['!cols'] = ['apple', 'banan'];
|
||||||
|
ws['!merges'] = ranges;
|
||||||
|
|
||||||
|
/* add worksheet to workbook */
|
||||||
|
wb.SheetNames.push(ws_name);
|
||||||
|
wb.Sheets[ws_name] = ws;
|
||||||
|
|
||||||
|
var wbout = XLSX.write(wb, {
|
||||||
|
bookType: 'xlsx',
|
||||||
|
bookSST: false,
|
||||||
|
type: 'binary'
|
||||||
|
});
|
||||||
|
|
||||||
|
saveAs(new Blob([s2ab(wbout)], {
|
||||||
|
type: "application/octet-stream"
|
||||||
|
}), "test.xlsx")
|
||||||
|
}
|
||||||
|
|
||||||
|
export function export_json_to_excel({
|
||||||
|
headerGroup,
|
||||||
|
dataGroup,
|
||||||
|
sheetGroup,
|
||||||
|
filename,
|
||||||
|
autoWidth = true,
|
||||||
|
bookType= 'xlsx'
|
||||||
|
} = {}) {
|
||||||
|
var wb = new Workbook()
|
||||||
|
for (let i = 0; i < dataGroup.length; i++) {
|
||||||
|
/* original data */
|
||||||
|
let data = dataGroup[i]
|
||||||
|
filename = filename || 'excel-list'
|
||||||
|
data = [...data]
|
||||||
|
data.unshift(headerGroup[i]);
|
||||||
|
var ws_name = sheetGroup[i];
|
||||||
|
var ws = sheet_from_array_of_arrays(data);
|
||||||
|
|
||||||
|
if (autoWidth) {
|
||||||
|
/*设置worksheet每列的最大宽度*/
|
||||||
|
const colWidth = data.map(row => row.map(val => {
|
||||||
|
/*先判断是否为null/undefined*/
|
||||||
|
if (val == null) {
|
||||||
|
return {
|
||||||
|
'wch': 10
|
||||||
|
};
|
||||||
|
}
|
||||||
|
/*再判断是否为中文*/
|
||||||
|
else if (val.toString().charCodeAt(0) > 255) {
|
||||||
|
return {
|
||||||
|
'wch': val.toString().length * 2
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
return {
|
||||||
|
'wch': val.toString().length
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
/*以第一行为初始值*/
|
||||||
|
let result = colWidth[0];
|
||||||
|
for (let i = 1; i < colWidth.length; i++) {
|
||||||
|
for (let j = 0; j < colWidth[i].length; j++) {
|
||||||
|
if (result[j]['wch'] < colWidth[i][j]['wch']) {
|
||||||
|
result[j]['wch'] = colWidth[i][j]['wch'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ws['!cols'] = result;
|
||||||
|
}
|
||||||
|
let R = 0;
|
||||||
|
data.map(item => {
|
||||||
|
let C = 0;
|
||||||
|
item.map(itm => {
|
||||||
|
var cell_ref = XLSX.utils.encode_cell({c:C,r:R});
|
||||||
|
var cell = {v: itm }
|
||||||
|
cell.s= {
|
||||||
|
alignment: {
|
||||||
|
horizontal: "center"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ws[cell_ref] = cell;
|
||||||
|
C++;
|
||||||
|
})
|
||||||
|
R++;
|
||||||
|
})
|
||||||
|
/* add worksheet to workbook */
|
||||||
|
wb.SheetNames.push(ws_name);
|
||||||
|
wb.Sheets[ws_name] = ws;
|
||||||
|
}
|
||||||
|
var wbout = XLSX.write(wb, {
|
||||||
|
bookType: bookType,
|
||||||
|
bookSST: false,
|
||||||
|
type: 'binary'
|
||||||
|
});
|
||||||
|
saveAs(new Blob([s2ab(wbout)], {
|
||||||
|
type: "application/octet-stream"
|
||||||
|
}), `${filename}.${bookType}`);
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
// 导出Excel方法(表格id,不加扩展名的文件名,sheet名)
|
||||||
|
export function exportExcelMethod(tableId, fileName, sheetName) {
|
||||||
|
tableToExcel(tableId, fileName, sheetName)
|
||||||
|
}
|
||||||
|
const tableToExcel = (function() {
|
||||||
|
const uri = 'data:application/vnd.ms-excel;base64,'
|
||||||
|
// 设置导出表格的单元格默认高度/宽度/边框样式/字体颜色/背景颜色/居中,网页显示表格宽度建议1240,tr/td视情况而定
|
||||||
|
const template = `<html xmlns:x="urn:schemas-microsoft-com:office:excel"><head><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><meta charset="UTF-8"><style type="text/css">table td {border: 1px solid #000000;height:40px;text-align: center;color: #000000;}</style></head><body><table>{table}</table></body></html>`
|
||||||
|
const base64 = function(s) { return window.btoa(unescape(encodeURIComponent(s))) }
|
||||||
|
const format = function(s, c) { return s.replace(/{(\w+)}/g, function(m, p) { return c[p] }) }
|
||||||
|
return function(table, filename, sheetname) {
|
||||||
|
if (!table.nodeType) table = document.getElementById(table)
|
||||||
|
const ctx = { worksheet: sheetname || 'Worksheet', table: table.innerHTML }
|
||||||
|
const blob = new Blob([format(template, ctx)])
|
||||||
|
if ('msSaveOrOpenBlob' in navigator) {
|
||||||
|
window.navigator.msSaveOrOpenBlob(blob, filename + '.xls')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const aTag = document.createElement('a')
|
||||||
|
aTag.href = uri + base64(format(template, ctx))
|
||||||
|
aTag.download = filename
|
||||||
|
aTag.click()
|
||||||
|
}
|
||||||
|
})()
|
||||||
@@ -22,11 +22,12 @@
|
|||||||
type="date"
|
type="date"
|
||||||
placeholder="选择日期"/>
|
placeholder="选择日期"/>
|
||||||
<el-button type="success" class="el-icon-search" size="small" style="margin: 10px 0 0 10px" @click="pageCurrent=1;total = 0;searchTable();">查询</el-button>
|
<el-button type="success" class="el-icon-search" size="small" style="margin: 10px 0 0 10px" @click="pageCurrent=1;total = 0;searchTable();">查询</el-button>
|
||||||
|
<el-button type="primary" size="small" icon="el-icon-download" style="margin-left:10px" @click="exportUninquirySheet1()">导出</el-button>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-card>
|
</el-card>
|
||||||
<el-card>
|
<el-card>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-table v-loading="loading" :data="tableData" highlight-current-row height="580" style="width: 100%;" border element-loading-text="拼命加载中" @row-click="searchTable2">
|
<el-table v-loading="loading" :data="tableData" highlight-current-row height="500" style="width: 100%;" border element-loading-text="拼命加载中" @row-click="searchTable2">
|
||||||
<el-table-column label="操作者" align="center" width="110px">
|
<el-table-column label="操作者" align="center" width="110px">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ scope.row.姓名 }}
|
{{ scope.row.姓名 }}
|
||||||
@@ -55,7 +56,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="17" style="margin-left: 30px;">
|
<el-col :span="17" style="margin-left: 30px;">
|
||||||
<el-table v-loading="loading2" :data="tableData2" height="580" style="width: 100%;" border element-loading-text="拼命加载中">
|
<el-table v-loading="loading2" :data="tableData2" height="500" style="width: 100%;" border element-loading-text="拼命加载中">
|
||||||
<el-table-column label="零件图号" align="center" width="150px">
|
<el-table-column label="零件图号" align="center" width="150px">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ scope.row.零件图号 }}
|
{{ scope.row.零件图号 }}
|
||||||
@@ -104,10 +105,90 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
<el-card>
|
||||||
|
<span>机床编号:</span>
|
||||||
|
<el-select v-model="machineNumberValue" filterable placeholder="机床编号" size="small" clearable @change="searchTable4();searchTable6()">
|
||||||
|
<el-option
|
||||||
|
v-for="item in machineNumber"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value">
|
||||||
|
<div style="float: left">{{ item.label }}</div>
|
||||||
|
<div style="float: right; color: #8492a6; font-size: 13px">{{ item.name }}</div>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
<el-button type="primary" size="small" icon="el-icon-download" style="margin-left:10px" @click="exportUninquirySheet2()">机床导出</el-button>
|
||||||
|
<el-button type="primary" size="small" icon="el-icon-download" style="margin-left:10px" @click="exportUninquirySheet3()">组件导出</el-button>
|
||||||
|
</el-card>
|
||||||
|
<el-card>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-table v-loading="loading3" :data="tableData3" highlight-current-row height="580" style="width: 100%;" border element-loading-text="拼命加载中" @row-click="searchTable5">
|
||||||
|
<el-table-column label="机床编号" align="center" width="110px">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.机床图号 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="理论工时" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.理论加工时间段 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="实际工时" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.实际加工时间段 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<div style="margin: 10px">
|
||||||
|
<el-pagination
|
||||||
|
v-if="!loading3"
|
||||||
|
:current-page="pageCurrent3"
|
||||||
|
:page-size="pageSize3"
|
||||||
|
:total="total3"
|
||||||
|
layout="total, prev, pager, next"
|
||||||
|
@size-change="handleSizeChange3"
|
||||||
|
@current-change="handleCurrentChange3"/>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="17" style="margin-left: 30px;">
|
||||||
|
<el-table v-loading="loading4" :data="tableData4" height="580" style="width: 100%;" border element-loading-text="拼命加载中">
|
||||||
|
<el-table-column label="机床编号" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.机床图号 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="组号" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.组号 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="理论工时" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.理论加工时间段 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="实际工时" align="center" width="120px">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.实际加工时间段 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<div style="margin: 10px">
|
||||||
|
<el-pagination
|
||||||
|
v-if="!loading4"
|
||||||
|
:current-page="pageCurrent4"
|
||||||
|
:page-size="pageSize4"
|
||||||
|
:total="total4"
|
||||||
|
layout="total, prev, pager, next, jumper"
|
||||||
|
@size-change="handleSizeChange4"
|
||||||
|
@current-change="handleCurrentChange4"/>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { searchtable, searchtable2 } from '@/api/ManufacturingCenter/machiningHoursStatistics'
|
import { searchtable, searchtable2, searchtable4, searchtable5, initProject, searchtable55, searchtable11, searchtable44 } from '@/api/ManufacturingCenter/machiningHoursStatistics'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
@@ -118,20 +199,135 @@ export default {
|
|||||||
loading: false,
|
loading: false,
|
||||||
tableData: [], // 表格数据
|
tableData: [], // 表格数据
|
||||||
total: null, // 总条数
|
total: null, // 总条数
|
||||||
pageSize: 20, // 每页显示条数
|
pageSize: 10, // 每页显示条数
|
||||||
pageCurrent: 1, // 后台获取页
|
pageCurrent: 1, // 后台获取页
|
||||||
gongzuozhebianhao: '',
|
gongzuozhebianhao: '',
|
||||||
|
machinenumber: '',
|
||||||
|
personname: '',
|
||||||
|
machineNumberValue: '',
|
||||||
|
machineNumber: [],
|
||||||
loading2: false,
|
loading2: false,
|
||||||
tableData2: [], // 表格数据
|
tableData2: [], // 表格数据
|
||||||
total2: null, // 总条数
|
total2: null, // 总条数
|
||||||
pageSize2: 20, // 每页显示条数
|
pageSize2: 10, // 每页显示条数
|
||||||
pageCurrent2: 1 // 后台获取页
|
pageCurrent2: 1, // 后台获取页
|
||||||
|
loading3: false,
|
||||||
|
tableData3: [], // 表格数据
|
||||||
|
total3: null, // 总条数
|
||||||
|
pageSize3: 10, // 每页显示条数
|
||||||
|
pageCurrent3: 1, // 后台获取页
|
||||||
|
loading4: false,
|
||||||
|
tableData4: [], // 表格数据
|
||||||
|
total4: null, // 总条数
|
||||||
|
pageSize4: 10, // 每页显示条数
|
||||||
|
pageCurrent4: 1 // 后台获取页
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
this.initProject()
|
||||||
this.searchTable()
|
this.searchTable()
|
||||||
|
this.searchTable4()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 导出
|
||||||
|
exportUninquirySheet3() {
|
||||||
|
searchtable55(this.machineNumberValue).then(res1 => {
|
||||||
|
if (res1.data.length === 0) {
|
||||||
|
this.$message.error('请选择机床')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
import('./Export2Excel').then(excel => {
|
||||||
|
const filterVal1 = ['机床图号', '组号', '理论加工时间段', '实际加工时间段'] // tableData1里的属性名
|
||||||
|
const data1 = res1.data.map(v => filterVal1.map(j => v[j]))
|
||||||
|
const dataGroup = []
|
||||||
|
dataGroup.push(data1)
|
||||||
|
const headerGroup = [['机床编号', '组号', '理论工时', '实际工时']]
|
||||||
|
const sheetGroup = ['工时明细表']
|
||||||
|
excel.export_json_to_excel({
|
||||||
|
headerGroup: headerGroup,
|
||||||
|
dataGroup: dataGroup,
|
||||||
|
sheetGroup: sheetGroup,
|
||||||
|
filename: res1.data[0]['机床图号'] + '_工时明细表',
|
||||||
|
autoWidth: true,
|
||||||
|
bookType: 'xlsx'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 导出
|
||||||
|
exportUninquirySheet2() {
|
||||||
|
if (this.machineNumberValue !== '' && this.machineNumberValue !== null) { this.check1 = 1 } else { this.check1 = 0 }
|
||||||
|
searchtable44(0, this.machineNumberValue).then(res1 => {
|
||||||
|
if (res1.data.length === 0) {
|
||||||
|
this.$message.error('请选择机床')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
import('./Export2Excel').then(excel => {
|
||||||
|
const filterVal1 = ['机床图号', '理论加工时间段', '实际加工时间段'] // tableData1里的属性名
|
||||||
|
const data1 = res1.data.map(v => filterVal1.map(j => v[j]))
|
||||||
|
const dataGroup = []
|
||||||
|
dataGroup.push(data1)
|
||||||
|
const headerGroup = [['机床编号', '理论工时', '实际工时']]
|
||||||
|
const sheetGroup = ['工时明细表']
|
||||||
|
excel.export_json_to_excel({
|
||||||
|
headerGroup: headerGroup,
|
||||||
|
dataGroup: dataGroup,
|
||||||
|
sheetGroup: sheetGroup,
|
||||||
|
filename: '机床工时明细表',
|
||||||
|
autoWidth: true,
|
||||||
|
bookType: 'xlsx'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 导出
|
||||||
|
exportUninquirySheet1() {
|
||||||
|
if (this.startTime !== '' && this.startTime !== null && this.endTime !== null && this.endTime !== null) {
|
||||||
|
this.timeCheck = 1
|
||||||
|
} else {
|
||||||
|
this.startTime = ''
|
||||||
|
this.endTime = ''
|
||||||
|
this.timeCheck = 0
|
||||||
|
}
|
||||||
|
if (this.workerName !== '' && this.workerName !== null) {
|
||||||
|
this.workerName_ckeck = 1
|
||||||
|
} else {
|
||||||
|
this.workerName_ckeck = 0
|
||||||
|
}
|
||||||
|
searchtable11(this.workerName_ckeck, this.workerName, this.timeCheck, this.startTime, this.endTime).then(res1 => {
|
||||||
|
if (res1.data.length === 0) {
|
||||||
|
this.$message.error('请选择人员')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
import('./Export2Excel').then(excel => {
|
||||||
|
const filterVal1 = ['姓名', '理论加工时间段', '实际加工时间段'] // tableData1里的属性名
|
||||||
|
const data1 = res1.data.map(v => filterVal1.map(j => v[j]))
|
||||||
|
const dataGroup = []
|
||||||
|
dataGroup.push(data1)
|
||||||
|
const headerGroup = [['操作者', '理论工时', '实际工时']]
|
||||||
|
const sheetGroup = ['人员工时明细表']
|
||||||
|
excel.export_json_to_excel({
|
||||||
|
headerGroup: headerGroup,
|
||||||
|
dataGroup: dataGroup,
|
||||||
|
sheetGroup: sheetGroup,
|
||||||
|
filename: '工时明细表',
|
||||||
|
autoWidth: true,
|
||||||
|
bookType: 'xlsx'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
initProject() {
|
||||||
|
initProject().then(response => {
|
||||||
|
for (let i = 0; i < response.data.length; i++) {
|
||||||
|
this.machineNumber.push({
|
||||||
|
label: response.data[i].机床图号,
|
||||||
|
name: response.data[i].项目名称,
|
||||||
|
value: response.data[i].机床流水号
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
// 查询表格数据
|
// 查询表格数据
|
||||||
searchTable() {
|
searchTable() {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
@@ -166,11 +362,11 @@ export default {
|
|||||||
this.tableData2 = []
|
this.tableData2 = []
|
||||||
this.pageCurrent2 = 1
|
this.pageCurrent2 = 1
|
||||||
this.gongzuozhebianhao = row.人员编号
|
this.gongzuozhebianhao = row.人员编号
|
||||||
|
this.personname = row.姓名
|
||||||
searchtable2(row.人员编号, this.timeCheck, this.startTime, this.endTime, this.pageCurrent2, this.pageSize2).then(response => {
|
searchtable2(row.人员编号, this.timeCheck, this.startTime, this.endTime, this.pageCurrent2, this.pageSize2).then(response => {
|
||||||
if (response.data.total === 0) {
|
if (response.data.total === 0) {
|
||||||
this.loading2 = false
|
this.loading2 = false
|
||||||
} else {
|
} else {
|
||||||
console.log(response.data)
|
|
||||||
this.total2 = response.data.total
|
this.total2 = response.data.total
|
||||||
this.tableData2 = response.data.rows
|
this.tableData2 = response.data.rows
|
||||||
}
|
}
|
||||||
@@ -192,6 +388,54 @@ export default {
|
|||||||
this.loading2 = false
|
this.loading2 = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 查询表格数据
|
||||||
|
searchTable4() {
|
||||||
|
this.loading3 = true
|
||||||
|
this.tableData3 = []
|
||||||
|
this.tableData4 = []
|
||||||
|
this.total3 = 0
|
||||||
|
if (this.machineNumberValue !== '' && this.machineNumberValue !== null) { this.check1 = 1 } else { this.check1 = 0 }
|
||||||
|
searchtable4(this.check1, this.machineNumberValue, this.pageCurrent, this.pageSize).then(response => {
|
||||||
|
if (response.data.total === 0) {
|
||||||
|
this.loading3 = false
|
||||||
|
} else {
|
||||||
|
this.total3 = response.data.total
|
||||||
|
this.tableData3 = response.data.rows
|
||||||
|
}
|
||||||
|
}).then(() => {
|
||||||
|
this.loading3 = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
searchTable5(row) {
|
||||||
|
this.loading4 = true
|
||||||
|
this.tableData4 = []
|
||||||
|
this.pageCurrent4 = 1
|
||||||
|
this.machineNumberValue = parseInt(row.机床流水号)
|
||||||
|
searchtable5(this.machineNumberValue, this.pageCurrent4, this.pageSize4).then(response => {
|
||||||
|
if (response.data.total === 0) {
|
||||||
|
this.loading4 = false
|
||||||
|
} else {
|
||||||
|
this.total4 = response.data.total
|
||||||
|
this.tableData4 = response.data.rows
|
||||||
|
}
|
||||||
|
}).then(() => {
|
||||||
|
this.loading4 = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
searchTable6(row) {
|
||||||
|
this.loading4 = true
|
||||||
|
this.tableData4 = []
|
||||||
|
searchtable5(this.machineNumberValue, this.pageCurrent4, this.pageSize4).then(response => {
|
||||||
|
if (response.data.total === 0) {
|
||||||
|
this.loading4 = false
|
||||||
|
} else {
|
||||||
|
this.total4 = response.data.total
|
||||||
|
this.tableData4 = response.data.rows
|
||||||
|
}
|
||||||
|
}).then(() => {
|
||||||
|
this.loading4 = false
|
||||||
|
})
|
||||||
|
},
|
||||||
// 分页
|
// 分页
|
||||||
handleSizeChange(val) {
|
handleSizeChange(val) {
|
||||||
this.pageCurrent = 1
|
this.pageCurrent = 1
|
||||||
@@ -210,6 +454,25 @@ export default {
|
|||||||
handleCurrentChange2(val) {
|
handleCurrentChange2(val) {
|
||||||
this.pageCurrent2 = val
|
this.pageCurrent2 = val
|
||||||
this.searchTable3()
|
this.searchTable3()
|
||||||
|
},
|
||||||
|
// 分页
|
||||||
|
handleSizeChange3(val) {
|
||||||
|
this.pageCurrent3 = 1
|
||||||
|
this.pageSize3 = val
|
||||||
|
this.searchTable4()
|
||||||
|
},
|
||||||
|
handleCurrentChange3(val) {
|
||||||
|
this.pageCurrent3 = val
|
||||||
|
this.searchTable4()
|
||||||
|
},
|
||||||
|
handleSizeChange4(val) {
|
||||||
|
this.pageCurrent4 = 1
|
||||||
|
this.pageSize4 = val
|
||||||
|
this.searchTable6()
|
||||||
|
},
|
||||||
|
handleCurrentChange4(val) {
|
||||||
|
this.pageCurrent4 = val
|
||||||
|
this.searchTable6()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -641,7 +641,8 @@
|
|||||||
<td>规格</td>
|
<td>规格</td>
|
||||||
<td colspan="2">型号</td>
|
<td colspan="2">型号</td>
|
||||||
<td>数量</td>
|
<td>数量</td>
|
||||||
<td colspan="2">单价</td>
|
<td>单价</td>
|
||||||
|
<td>单位</td>
|
||||||
<td colspan="2">合计</td>
|
<td colspan="2">合计</td>
|
||||||
<td>交货期</td>
|
<td>交货期</td>
|
||||||
<td colspan="2">备注</td>
|
<td colspan="2">备注</td>
|
||||||
@@ -1296,7 +1297,7 @@ export default {
|
|||||||
for (let i = 0; i < length; i++) {
|
for (let i = 0; i < length; i++) {
|
||||||
tr[i] = document.createElement('tr')
|
tr[i] = document.createElement('tr')
|
||||||
tr[i].setAttribute('class', 'tableData')
|
tr[i].setAttribute('class', 'tableData')
|
||||||
tr[i].innerHTML = `<td style="height: 40px"/><td colspan="2" style="height: 40px"/><td style="height: 40px"/><td colspan="2" style="height: 40px"/><td style="height: 40px"/><td colspan="2" style="height: 40px"/><td colspan="2" style="height: 40px"/><td style="height: 40px"/><td colspan="2" style="height: 40px"/>`
|
tr[i].innerHTML = `<td style="height: 40px"/><td colspan="2" style="height: 40px"/><td style="height: 40px"/><td colspan="2" style="height: 40px"/><td style="height: 40px"/><td style="height: 40px"/><td style="height: 40px"/><td colspan="2" style="height: 40px"/><td style="height: 40px"/><td colspan="2" style="height: 40px"/>`
|
||||||
$('#tablehead').after(tr[i])
|
$('#tablehead').after(tr[i])
|
||||||
}
|
}
|
||||||
let total = 0
|
let total = 0
|
||||||
@@ -1307,9 +1308,10 @@ export default {
|
|||||||
document.getElementsByClassName('tableData')[j].children[3].innerHTML = this.tableData3[j].物料型号
|
document.getElementsByClassName('tableData')[j].children[3].innerHTML = this.tableData3[j].物料型号
|
||||||
document.getElementsByClassName('tableData')[j].children[4].innerHTML = this.tableData3[j].数量
|
document.getElementsByClassName('tableData')[j].children[4].innerHTML = this.tableData3[j].数量
|
||||||
document.getElementsByClassName('tableData')[j].children[5].innerHTML = this.tableData3[j].单价
|
document.getElementsByClassName('tableData')[j].children[5].innerHTML = this.tableData3[j].单价
|
||||||
document.getElementsByClassName('tableData')[j].children[6].innerHTML = (this.tableData3[j].数量 * this.tableData3[j].单价).toFixed(2)
|
document.getElementsByClassName('tableData')[j].children[6].innerHTML = this.tableData3[j].计量单位
|
||||||
document.getElementsByClassName('tableData')[j].children[7].innerHTML = this.tableData3[j].交货期要求
|
document.getElementsByClassName('tableData')[j].children[7].innerHTML = (this.tableData3[j].数量 * this.tableData3[j].单价).toFixed(2)
|
||||||
document.getElementsByClassName('tableData')[j].children[8].innerHTML = this.tableData3[j].备注
|
document.getElementsByClassName('tableData')[j].children[8].innerHTML = this.tableData3[j].交货期要求
|
||||||
|
document.getElementsByClassName('tableData')[j].children[9].innerHTML = this.tableData3[j].备注
|
||||||
total += Number(this.tableData3[j].数量 * this.tableData3[j].单价)
|
total += Number(this.tableData3[j].数量 * this.tableData3[j].单价)
|
||||||
}
|
}
|
||||||
total = total.toFixed(2)
|
total = total.toFixed(2)
|
||||||
|
|||||||
Reference in New Issue
Block a user