2024-09-09 修改了大部分下拉组件为模糊筛选,减轻前端渲染压力

This commit is contained in:
2024-09-09 15:26:17 +08:00
parent fe5d3b70df
commit 563132273c
717 changed files with 107188 additions and 138520 deletions

View File

@@ -0,0 +1,248 @@
<template>
<div class="app-container">
<el-card>
<div style="margin-top: 7px; margin-bottom: 7px">
<el-select v-model="customerNameValue" style="width:200px" placeholder="买方名称" size="small" filterable clearable>
<el-option
v-for="item in customerName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span style="font-size: 13px;color: black">提交日期</span>
<el-date-picker
v-model="dateRange"
size="small"
type="daterange"
align="center"
style="width: 240px;"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"/>
<el-select v-model="contractStateValue" style="width:100px;margin-left: 10px" placeholder="合同状态" size="small" filterable clearable>
<el-option
v-for="item in contractState"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button icon="el-icon-search" type="primary" plain size="small" style="margin-left: 10px" @click="pageCurrent = 1;pageSize = 100;searchTable()">查询</el-button>
<el-button type="success" plain icon="el-icon-download" size="small" @click="exportExcel()">导出</el-button>
</div>
</el-card>
<el-card>
<el-table v-loading="loading" :data="tableData" highlight-current-row show-summary border stripe size="small" style="width: 100%" height="750" @sort-change="sortChange">
<el-table-column label="状态" align="center" prop="状态" sortable="custom" width="80px">
<template slot-scope="scope">
{{ scope.row.状态 }}
</template>
</el-table-column>
<el-table-column label="合同编号" align="center" width="140px">
<template slot-scope="scope">
{{ scope.row.合同编号 }}
</template>
</el-table-column>
<el-table-column label="买方名称" align="center" width="150px" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.客户名称 }}
</template>
</el-table-column>
<el-table-column label="合同金额(元)" align="center" prop="合同金额" width="140px">
<template slot-scope="scope">
{{ scope.row.合同金额 }}
</template>
</el-table-column>
<el-table-column label="付款方式" align="center" width="130px">
<template slot-scope="scope">
{{ scope.row.付款方式 }}
</template>
</el-table-column>
<el-table-column label="交货日期" width="90" 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-column label="经手人" align="center" width="80">
<template slot-scope="scope">
{{ scope.row.经手人 }}
</template>
</el-table-column>
<el-table-column label="签订日期" align="center" width="90">
<template slot-scope="scope">
{{ scope.row.签订日期 }}
</template>
</el-table-column>
<el-table-column label="提交日期" align="center" width="90">
<template slot-scope="scope">
{{ scope.row.提交日期 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="120">
<template slot-scope="scope">
<el-tooltip :open-delay="700" effect="dark" content="查看合同订单" placement="top">
<el-button type="text" icon="el-icon-search" size="mini" style="margin-right: 10px" @click="deleteProduct(scope.row)"/>
</el-tooltip>
<el-tooltip :open-delay="700" effect="dark" content="打回合同" placement="top">
<el-button type="text" icon="el-icon-right" size="mini" style="margin-right: 10px" @click="deleteProduct(scope.row)"/>
</el-tooltip>
<el-tooltip :open-delay="700" effect="dark" content="删除合同" placement="top">
<el-button type="text" icon="el-icon-delete" size="mini" @click="deleteProduct(scope.row)"/>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40, 100]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChanges"
@current-change="handleCurrentChanges"/>
</div>
</el-card>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
export default {
data() {
return {
customerNameValue: '', // 买方名称
customerName: [], // 买方名称数组
dateRange: '', // 提交日期
contractStateValue: '', // 合同状态
contractState: [
{
value: 2,
label: '未提交'
}, {
value: 1,
label: '提交'
}
], // 合同状态数组
loading: false, // 数据加载
total: 0, // 分页总数
tableData: [], // 合同信息表
pageCurrent: 1, // 分页当前页
pageSize: 100, // 分页每页显示条数
orderName: '', // 排序列名
order: '' // 排序方式
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
created() {
this.fetchData()
},
methods: {
fetchData() {
this.getCustomer()
},
getCustomer() {
var param = []
var Data = this.CreateData('11', '合同管理_客户信息_查询数据', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.customerName.push({
label: response.data[i].客户名称,
value: response.data[i].客户流水号
})
}
})
},
/* exportExcel() {
if (this.tableData.length !== 0) {
let check, check1, check2, check3
this.dateRange ? check3 = 1 : (check3 = 0, this.dateRange = '')
this.supplierNameValue ? check = 1 : check = 0
this.partNumber ? check1 = 1 : check1 = 0
if (this.MaterialsValue !== '' && this.MaterialsValue !== null) {
check2 = 1
} else {
check2 = 0
}
var param = []
param[0] = ['供应商流水号_check', check]
param[1] = ['供应商流水号', this.supplierNameValue]
param[2] = ['零件图号_check', check1]
param[3] = ['零件图号', this.partNumber]
param[4] = ['备料状态_check', check2]
param[5] = ['备料状态', this.MaterialsValue]
param[6] = ['下单时间_check', check3]
if (check3 === 0) {
param[7] = ['开始时间', '']
param[8] = ['结束时间', '']
} else {
param[7] = ['开始时间', this.dateRange[0]]
param[8] = ['结束时间', this.dateRange[1]]
}
param[9] = ['排序名称', this.ordername]
param[10] = ['排序方式', this.order]
param[11] = ['角色编号', this.token]
param[12] = ['人员编号', this.id]
var Data = this.CreateData('2001', '报表_备料管理_外购备料_综合查询数据', param)
this.exportExcel_NPOI(Data)
} else {
this.$message.warning('暂无数据')
}
},*/
searchTable() {
let customerNameValue_check, dateRange_check, contractStateValue_check
this.customerNameValue ? customerNameValue_check = 1 : customerNameValue_check = 0
this.dateRange ? dateRange_check = 1 : (dateRange_check = 0, this.dateRange = '')
console.log(this.contractStateValue, 123)
this.contractStateValue ? contractStateValue_check = 1 : contractStateValue_check = 0
var param = []
param[0] = ['客户流水号_check', customerNameValue_check]
param[1] = ['客户流水号', this.customerNameValue]
param[2] = ['时间_check', dateRange_check]
param[3] = ['开始时间', this.dateRange[0]]
param[4] = ['结束时间', this.dateRange[1]]
param[5] = ['合同状态_check', contractStateValue_check]
param[6] = ['合同状态', this.contractStateValue]
param[7] = ['排序名称', this.orderName]
param[8] = ['排序方式', this.order]
var Data = this.CreateData('11', 'PDM_项目名称_全部_查询数据', param, this.pageSize, this.pageCurrent)
this.ExecDatabase(Data).then(response => {
this.tableData = response.data.rows
this.total = response.data.total
})
},
sortChange(column) {
if (column.prop === '状态') {
this.orderName = 1
}
if (column.order === 'ascending') {
this.order = 1
} else if (column.order === 'descending') { this.order = 2 } else {
this.order = ''
}
this.searchTable()
},
handleSizeChanges(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable()
},
handleCurrentChanges(val) {
this.pageCurrent = val
this.searchTable()
}
}
}
</script>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,264 @@
<template>
<div>
<el-card>
<span>工位号:</span>
<el-select v-model="MachineValue" filterable size="small" style="width:160px;margin-bottom:10px" placeholder="工位号">
<el-option
v-for="item in Machine"
: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.value2 }}</div>
</el-option>
</el-select>
<span style="margin-left: 10px">时间段:</span>
<el-date-picker
v-model="date1"
style="width:160px;margin:10px;"
size="small"
type="date"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
placeholder="选择日期"/>
<span>~</span>
<el-date-picker
v-model="date2"
style="width:160px;margin:10px;"
size="small"
type="date"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
placeholder="选择日期"/>
<el-button type="primary" plain size="small" icon="el-icon-search" style="margin-left: 15px" @click="searchData()">查询</el-button>
</el-card>
<el-card>
<div id="myChart" style="width: 100%; height: 520px; margin: auto"/>
</el-card>
</div>
</template>
<script>
import { getMachine, searchState, getData3 } from '@/api/BasicData/EquipmentMonitoringNew'
export default {
data() {
return {
date1: '',
date2: '',
MachineValue: '',
Machine: [],
colors: [],
state: [],
table1: [],
num: 0
}
},
watch: {
'$route': {
handler(route) {
if (this.$route.query.模块名称 === '设备监控') {
this.MachineValue = this.$route.query.opname
this.searchData()
}
},
immediate: true
}
},
created() {
this.fetchData()
this.getCurrentTime()
},
methods: {
fetchData() {
getMachine().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.Machine.push({
label: response.data[i].终端编号,
value: response.data[i].终端编号,
value2: response.data[i].设备名称
})
}
})
},
getCurrentTime() {
this.date1 = this.getTime0(-10)
this.date2 = this.getTime0(0)
},
getTime0(num) {
var date0 = new Date()
var date = new Date(date0.getTime() + num * 24 * 60 * 60 * 1000)
var month = this.zeroFill(date.getMonth() + 1)
var day = this.zeroFill(date.getDate())
var hour = this.zeroFill(date.getHours())
var minute = this.zeroFill(date.getMinutes())
var second = this.zeroFill(date.getSeconds())
return date.getFullYear() + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second
},
zeroFill(i) {
if (i >= 0 && i <= 9) {
return '0' + i
} else {
return i
}
},
searchData() {
if (this.date1 === null || this.date2 === null) {
this.$message.warning('请选择开始时间或结束时间')
} else {
console.log(this.date1, this.date2)
this.num = ((new Date(this.date2) - new Date(this.date1)) / (1000 * 60 * 60 * 24)) + 1
searchState().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.colors.push(response.data[i].颜色)
this.state.push(response.data[i].状态)
}
})
getData3(this.MachineValue, this.date1, this.date2).then(response => {
this.table1 = response.data
}).then(() => {
this.drawLine()
})
}
},
drawLine() {
const _this = this
_this.data = []
_this.index = 0
_this.yAxisValue = []
for (let i = 0; i < _this.table1.length; i++) { // 取开始结束时间HH-mm取状态日期yyyy-MM-dd持续时间
_this.fixDate = _this.table1[0].日期.substr(0, 10)
_this.table1[i].开始时间 = _this.fixDate + ' ' + _this.table1[i].开始时间.substr(11, 5)
_this.table1[i].结束时间 = _this.fixDate + ' ' + _this.table1[i].结束时间.substr(11, 5)
_this.table1[i].日期 = _this.table1[i].日期.substr(0, 10)
}
if (_this.table1.length === 1) {
_this.data.push({
itemStyle: { normal: { color: _this.table1[0].颜色 }}, // 条形颜色
name: _this.table1[0].状态,
value: [0, _this.table1[0].开始时间, _this.table1[0].结束时间]
})
} else {
for (let i = 0; i < _this.table1.length; i++) {
if (i < _this.table1.length) {
if (i === 0) {
_this.index = 0
_this.yAxisValue.push(_this.table1[i].日期)
} else if (_this.table1[i].日期 !== _this.table1[i - 1].日期) {
_this.index++ // y轴索引
_this.yAxisValue.push(_this.table1[i].日期)
}
}
_this.data.push({
itemStyle: { normal: { color: _this.table1[i].颜色 }}, // 条形颜色
name: _this.table1[i].状态,
value: [parseInt(_this.index), _this.table1[i].开始时间, _this.table1[i].结束时间]
})
}
}
const myChart = _this.$echarts.init(document.getElementById('myChart'))
myChart.clear()
myChart.setOption({
title: {
left: 'center',
text: '设备状态分布图'
},
color: _this.colors,
tooltip: { // 提示框
formatter(params) {
return params.value[1].substr(11, 5) + '~' + params.value[2].substr(11, 5)
} // 数据的值
},
legend: { // 图例
left: 'left',
selectedMode: false // 图例可点击
},
dataZoom: [{
type: 'inside',
start: 0,
end: 100
}, { // X轴可调
xAxisIndex: 0,
start: 0,
end: 100,
handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
handleSize: '80%',
handleStyle: {
color: '#fff',
shadowBlur: 3,
shadowColor: 'rgba(0, 0, 0, 0.6)',
shadowOffsetX: 2,
shadowOffsetY: 2
}
}],
grid: { // 绘图网格
left: '3%',
right: '3%',
top: '10%',
bottom: '10%',
containLabel: true
},
xAxis: {
type: 'time',
interval: 1000 * 60 * 60 * 2,
axisLabel: {
formatter(value) {
var date = new Date(value)
return getzf(date.getHours()) + ':' + getzf(date.getMinutes())
function getzf(num) {
if (parseInt(num) < 10) {
num = '0' + num
}
return num
}
}
}
},
yAxis: {
data: _this.yAxisValue
},
series: [
// 用空bar来显示几个图例
{ name: _this.state[0], type: 'bar', data: [] },
{ name: _this.state[1], type: 'bar', data: [] },
{ name: _this.state[2], type: 'bar', data: [] },
{ name: _this.state[3], type: 'bar', data: [] },
{
type: 'custom', renderItem(params, api) { // 开发者自定义的图形元素渲染逻辑,是通过书写 renderItem 函数实现的
var categoryIndex = api.value(0) // 这里使用 api.value(0) 取出当前 dataItem 中第一个维度的数值。
var start = api.coord([api.value(1), categoryIndex]) // 这里使用 api.coord(...) 将数值在当前坐标系中转换成为屏幕上的点的像素值。
var end = api.coord([api.value(2), categoryIndex])
var height = 120 // 柱体宽度
return {
type: 'rect', // 表示这个图形元素是矩形。还可以是 'circle', 'sector', 'polygon' 等等。
shape: _this.$echarts.graphic.clipRectByRect({ // 矩形的位置和大小。
x: start[0],
y: start[1] - height / (_this.num > 4 ? 4 : _this.num),
width: end[0] - start[0],
height: height / (_this.num > 4 ? 4 : _this.num)
}, { // 当前坐标系的包围盒。
x: params.coordSys.x,
y: params.coordSys.y,
width: params.coordSys.width,
height: params.coordSys.height
}),
style: api.style()
}
},
encode: {
x: [1, 2], // data 中『维度1』和『维度2』对应到 X 轴
y: 0 // data 中『维度0』对应到 Y 轴
},
data: _this.data
}
]
})
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,294 @@
<template>
<div class="app-container">
<el-card>
<div style="margin-top: 7px; margin-bottom: 7px">
<el-select
v-model="customerNameValue"
:remote-method="getCustomer"
style="width:200px"
placeholder="买方名称"
size="small"
filterable
remote
clearable>
<el-option
v-for="item in customerName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span style="font-size: 13px;color: black">提交日期</span>
<el-date-picker
v-model="dateRange"
size="small"
type="daterange"
align="center"
style="width: 240px;"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"/>
<el-select
v-model="contractStateValue"
style="width:100px;margin-left: 10px"
placeholder="合同状态"
size="small"
filterable
clearable>
<el-option
v-for="item in contractState"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button
icon="el-icon-search"
type="primary"
plain
size="small"
style="margin-left: 10px"
@click="pageCurrent = 1;pageSize = 100;searchTable()">查询
</el-button>
<el-button type="success" plain icon="el-icon-download" size="small" @click="exportExcel()">导出</el-button>
</div>
</el-card>
<el-card>
<el-table
v-loading="loading"
:data="tableData"
highlight-current-row
show-summary
border
stripe
size="small"
style="width: 100%"
height="750"
@sort-change="sortChange">
<el-table-column label="状态" align="center" prop="状态" sortable="custom" width="80px">
<template slot-scope="scope">
{{ scope.row.状态 }}
</template>
</el-table-column>
<el-table-column label="合同编号" align="center" width="140px">
<template slot-scope="scope">
{{ scope.row.合同编号 }}
</template>
</el-table-column>
<el-table-column label="买方名称" align="center" width="150px" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.客户名称 }}
</template>
</el-table-column>
<el-table-column label="合同金额(元)" align="center" prop="合同金额" width="140px">
<template slot-scope="scope">
{{ scope.row.合同金额 }}
</template>
</el-table-column>
<el-table-column label="付款方式" align="center" width="130px">
<template slot-scope="scope">
{{ scope.row.付款方式 }}
</template>
</el-table-column>
<el-table-column label="交货日期" width="90" 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-column label="经手人" align="center" width="80">
<template slot-scope="scope">
{{ scope.row.经手人 }}
</template>
</el-table-column>
<el-table-column label="签订日期" align="center" width="90">
<template slot-scope="scope">
{{ scope.row.签订日期 }}
</template>
</el-table-column>
<el-table-column label="提交日期" align="center" width="90">
<template slot-scope="scope">
{{ scope.row.提交日期 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="120">
<template slot-scope="scope">
<el-tooltip :open-delay="700" effect="dark" content="查看合同订单" placement="top">
<el-button
type="text"
icon="el-icon-search"
size="mini"
style="margin-right: 10px"
@click="deleteProduct(scope.row)"/>
</el-tooltip>
<el-tooltip :open-delay="700" effect="dark" content="打回合同" placement="top">
<el-button
type="text"
icon="el-icon-right"
size="mini"
style="margin-right: 10px"
@click="deleteProduct(scope.row)"/>
</el-tooltip>
<el-tooltip :open-delay="700" effect="dark" content="删除合同" placement="top">
<el-button type="text" icon="el-icon-delete" size="mini" @click="deleteProduct(scope.row)"/>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40, 100]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChanges"
@current-change="handleCurrentChanges"/>
</div>
</el-card>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
export default {
data() {
return {
customerNameValue: '', // 买方名称
customerName: [], // 买方名称数组
dateRange: '', // 提交日期
contractStateValue: '', // 合同状态
contractState: [
{
value: 2,
label: '未提交'
}, {
value: 1,
label: '提交'
}
], // 合同状态数组
loading: false, // 数据加载
total: 0, // 分页总数
tableData: [], // 合同信息表
pageCurrent: 1, // 分页当前页
pageSize: 100, // 分页每页显示条数
orderName: '', // 排序列名
order: '' // 排序方式
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
created() {
this.fetchData()
},
methods: {
fetchData() {
this.getCustomer('')
},
getCustomer(query) {
this.customerName = []
var param = []
param[0] = ['客户名称', query]
var Data = this.CreateData('11', '合同管理_客户信息_查询数据_bak', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.customerName.push({
label: response.data[i].客户名称,
value: response.data[i].客户流水号
})
}
})
},
/* exportExcel() {
if (this.tableData.length !== 0) {
let check, check1, check2, check3
this.dateRange ? check3 = 1 : (check3 = 0, this.dateRange = '')
this.supplierNameValue ? check = 1 : check = 0
this.partNumber ? check1 = 1 : check1 = 0
if (this.MaterialsValue !== '' && this.MaterialsValue !== null) {
check2 = 1
} else {
check2 = 0
}
var param = []
param[0] = ['供应商流水号_check', check]
param[1] = ['供应商流水号', this.supplierNameValue]
param[2] = ['零件图号_check', check1]
param[3] = ['零件图号', this.partNumber]
param[4] = ['备料状态_check', check2]
param[5] = ['备料状态', this.MaterialsValue]
param[6] = ['下单时间_check', check3]
if (check3 === 0) {
param[7] = ['开始时间', '']
param[8] = ['结束时间', '']
} else {
param[7] = ['开始时间', this.dateRange[0]]
param[8] = ['结束时间', this.dateRange[1]]
}
param[9] = ['排序名称', this.ordername]
param[10] = ['排序方式', this.order]
param[11] = ['角色编号', this.token]
param[12] = ['人员编号', this.id]
var Data = this.CreateData('2001', '报表_备料管理_外购备料_综合查询数据', param)
this.exportExcel_NPOI(Data)
} else {
this.$message.warning('暂无数据')
}
},*/
searchTable() {
let customerNameValue_check, dateRange_check, contractStateValue_check
this.customerNameValue ? customerNameValue_check = 1 : customerNameValue_check = 0
this.dateRange ? dateRange_check = 1 : (dateRange_check = 0, this.dateRange = '')
console.log(this.contractStateValue, 123)
this.contractStateValue ? contractStateValue_check = 1 : contractStateValue_check = 0
var param = []
param[0] = ['客户流水号_check', customerNameValue_check]
param[1] = ['客户流水号', this.customerNameValue]
param[2] = ['时间_check', dateRange_check]
param[3] = ['开始时间', this.dateRange[0]]
param[4] = ['结束时间', this.dateRange[1]]
param[5] = ['合同状态_check', contractStateValue_check]
param[6] = ['合同状态', this.contractStateValue]
param[7] = ['排序名称', this.orderName]
param[8] = ['排序方式', this.order]
var Data = this.CreateData('11', 'PDM_项目名称_全部_查询数据', param, this.pageSize, this.pageCurrent)
this.ExecDatabase(Data).then(response => {
this.tableData = response.data.rows
this.total = response.data.total
})
},
sortChange(column) {
if (column.prop === '状态') {
this.orderName = 1
}
if (column.order === 'ascending') {
this.order = 1
} else if (column.order === 'descending') {
this.order = 2
} else {
this.order = ''
}
this.searchTable()
},
handleSizeChanges(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable()
},
handleCurrentChanges(val) {
this.pageCurrent = val
this.searchTable()
}
}
}
</script>

View File

@@ -0,0 +1,290 @@
//订单工时
<template>
<div class="app-container">
<el-card style="height: 850px">
<el-row style="margin-top: 7px; margin-bottom: 7px">
<el-col style="margin-left: 7px;width: 380px">
<!-- <el-card>-->
<div>
<el-input v-model="contractStateValue1" style="width:150px" placeholder="订单编号" size="small" filterable clearable @keyup.enter.native="searchLeftTable()"/>
<el-table
v-loading="loading"
:data="tableData"
:summary-method="getSummaries"
highlight-current-row
show-summary
stripe
border
size="mini"
style="width: 362px;margin-top: 7px"
height="750px"
@row-click="searchTable" >
<el-table-column :width="setColumnWidth('订单编号')" label="订单编号" align="center" prop="订单编号">
<template slot-scope="scope">
{{ scope.row.订单编号 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('产品名称')" label="工艺定额" align="center" prop="总定额工时">
<template slot-scope="scope">
{{ scope.row.工艺定额 }}
</template>
</el-table-column>
<el-table-column label="加工时长M" align="center" show-overflow-tooltip prop="总加工时长H">
<template slot-scope="scope">
{{ scope.row.总加工时长H }}
</template>
</el-table-column>
<!-- <el-table-column :width="setColumnWidth('下单日期')" label="下单日期" align="center" show-overflow-tooltip>-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.下单日期 }}-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
</div>
<!-- </el-card>-->
</el-col>
<el-col style="margin-left: -5px;width: 1191px">
<!-- <el-card>-->
<div>
<el-table
v-loading="loading"
:data="tableData1"
highlight-current-row
show-summary
border
size="mini"
style="width: 1191px;margin-top: 39px"
height="750px"
@sort-change="sortChange">
<el-table-column :width="setColumnWidth('零件名称')" label="零件名称" align="center" prop="零件名称" sortable>
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('补货数')" label="图号" align="center" prop="">
<template slot-scope="scope">
{{ scope.row.图号 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('单位')" label="数量" align="center" prop="数量" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.数量 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('完成数')" label="完成数" align="center" prop="完成数量">
<template slot-scope="scope">
{{ scope.row.完成数 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('工序')" label="工序" align="center" prop="工序" sortable>
<template slot-scope="scope">
{{ scope.row.工序 }}
</template>
</el-table-column>
<el-table-column width="170px" label="生产工位" align="center" show-overflow-tooltip prop="工位号" sortable>
<template slot-scope="scope">
{{ scope.row.工位号 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('仓位')" label="操作者" align="center" prop="操作者" sortable>
<template slot-scope="scope">
{{ scope.row.操作者 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('产品名称')" label="工艺定额" align="center" prop="定额工时" sortable>
<template slot-scope="scope">
{{ scope.row.定额工时 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('产品名称')" label="加工时长M" align="center" show-overflow-tooltip prop="加工时长H" sortable>
<template slot-scope="scope">
{{ scope.row.加工时长 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('时间日期')" label="开始加工" align="center" prop="订单编号">
<template slot-scope="scope">
{{ scope.row.开始加工 }}
</template>
</el-table-column>
<el-table-column label="结束加工" align="center" prop="">
<template slot-scope="scope">
{{ scope.row.结束加工 }}
</template>
</el-table-column>
</el-table>
</div>
</el-col>
</el-row>
</el-card>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
export default {
data() {
return {
orderValue: '', // 订单流水号
loading: false, // 数据加载
loading1: false, //
type: '',
contractStateValue1: '',
multipleSelection: [],
multipleSelection_variable: [],
groupNum: [],
assemblyNum: [],
stockNum: [],
tableData: [], // 订单信息表
tableData1: [], // 产品信息表
orderName: '', // 排序列名
order: '' // 排序方式
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
created() {
// this.searchTable()
this.searchLeftTable()
},
methods: {
searchTable(row) {
var param = []
param[0] = ['订单流水号', row.订单流水号]
param[1] = ['排序名称', this.orderName]
param[2] = ['排序方式', this.order]
var Data = this.CreateData('11', '精工_订单工时_查询明细_查询', param)
this.ExecDatabase(Data).then(response => {
this.tableData1 = response.data
})
},
searchLeftTable() {
this.tableData1 = []
let contractStateValue1_check
this.contractStateValue1 ? contractStateValue1_check = 1 : contractStateValue1_check = 0
var param = []
param[0] = ['订单编号', this.contractStateValue1]
param[1] = ['订单编号_check', contractStateValue1_check]
var Data = this.CreateData('11', '精工_订单工时_查询', param)
this.ExecDatabase(Data).then(response => {
this.tableData = response.data
})
},
sortChange(column) {
if (column.prop === '零件名称') {
this.orderName = 1
} else if (column.prop === '工序') {
this.orderName = 2
} else if (column.prop === '工位号') {
this.orderName = 3
} else if (column.prop === '操作者') {
this.orderName = 4
} else if (column.prop === '定额工时') {
this.orderName = 5
} else if (column.prop === '加工时长H') {
this.orderName = 6
} else {
this.orderName = 0
}
if (column.order === 'ascending') {
this.order1 = 1
} else if (column.order === 'descending') {
this.order1 = 2
} else {
this.order1 = ''
}
this.searchTable()
},
getSummaries(param) {
const { columns, data } = param
const sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计'
return
} else if (index === 1) {
const values = data.map(item => Number(item[column.property]))
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return prev + curr
} else {
return prev
}
}, 0)
sums[index] = sums[index]
} else {
sums[index] = 'N/A'
}
} else if (index === 2) {
const values = data.map(item => Number(item[column.property]))
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return prev + curr
} else {
return prev
}
}, 0)
sums[index] = sums[index]
} else {
sums[index] = 'N/A'
}
}
})
return sums
}
// getSummaries1(param) {
// const { columns, data } = param
// const sums = []
// columns.forEach((column, index) => {
// if (index === 0) {
// sums[index] = '合计'
// return
// } else if (index === 2) {
// const values = data.map(item => Number(item[column.property]))
// if (!values.every(value => isNaN(value))) {
// sums[index] = values.reduce((prev, curr) => {
// const value = Number(curr)
// if (!isNaN(value)) {
// return prev + curr
// } else {
// return prev
// }
// }, 0)
// sums[index] = sums[index]
// } else {
// sums[index] = 'N/A'
// }
// } else if (index === 3) {
// const values = data.map(item => Number(item[column.property]))
// if (!values.every(value => isNaN(value))) {
// sums[index] = values.reduce((prev, curr) => {
// const value = Number(curr)
// if (!isNaN(value)) {
// return prev + curr
// } else {
// return prev
// }
// }, 0)
// sums[index] = sums[index]
// } else {
// sums[index] = 'N/A'
// }
// }
// })
// return sums
// }
}
}
</script>
<style>
>>> .el-input__inner{
padding: 0 50px;
}
</style>

View File

@@ -0,0 +1,345 @@
<template>
<div class="app-container">
<el-card style="height: 850px">
<div style="margin-top: 7px; margin-bottom: 7px">
<el-date-picker
v-model="processingDate"
disabled-date="true"
type="date"
size="small"
style="width: 140px"
placeholder="选择日期"
value-format="yyyy-MM-dd"/>
<el-select v-model="orderNumberTypeValue" style="width:100px" placeholder="操作工" size="small" filterable clearable>
<el-option
v-for="item in orderNumberType"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-input v-model="partNameValue" style="width:210px;" placeholder="零件图号及名称" size="small" clearable/>
<el-input v-model="processName" style="width:210px;" placeholder="工序名称" size="small" clearable/>
<span>完成数量</span>
<el-input-number v-model="completedQuantity" :min= "1" style="width: 120px" size="small" label="完成数量"/>
<span>单件工时</span>
<el-input-number v-model="taktTime" :min="1" style="width: 120px" size="small" label="单件工时"/>
<el-button icon="el-icon-plus" size="small" type="primary" plain @click="addOtherWorkCompleted()">添加</el-button>
<el-date-picker
v-model="queryMonth"
type="month"
size="small"
style="width: 120px;margin-left: 30px"
placeholder="查询月份"
value-format="yyyy-MM"
@change="searchTable()"/>
</div>
<el-table :data="tableData" height="750px" style="width: 1280px" highlight-current-row border>
<el-table-column width="170px" align="center" label="加工日期" show-overflow-tooltip>
<template slot-scope="scope">
<template v-if="scope.row.edit">
<el-date-picker
v-model="scope.row.加工日期"
disabled-date="true"
type="date"
size="small"
style="width: 140px"
placeholder="选择日期"
value-format="yyyy-MM-dd"/>
</template>
<span v-else>{{ scope.row.加工日期 }}</span>
</template>
</el-table-column>
<el-table-column width="110px" align="center" label="操作工" prop="操作者" show-overflow-tooltip>
<template slot-scope="scope">
<template v-if="scope.row.edit">
<el-select v-model="scope.row.操作工流水号" style="width:85px" placeholder="操作工" size="small" filterable clearable @change="searchTable1()">
<el-option
v-for="item in orderNumberType"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</template>
<span v-else>{{ scope.row.操作工 }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="零件图号及名称" prop="零件图号及名称" show-overflow-tooltip>
<template slot-scope="scope">
<template v-if="scope.row.edit">
<el-input v-model="scope.row.零件图号及名称" style="width:97%;margin-right:3px" clearable size="mini" />
</template>
<span v-else>{{ scope.row.零件图号及名称 }}</span>
</template>
</el-table-column>
<el-table-column width="200px" align="center" label="工序名称" prop="工序名称" show-overflow-tooltip>
<template slot-scope="scope">
<template v-if="scope.row.edit">
<el-input v-model="scope.row.工序名称" style="width:97%;" clearable size="mini" />
</template>
<span v-else>{{ scope.row.工序名称 }}</span>
</template>
</el-table-column>
<el-table-column width="140px" align="center" label="数量" show-overflow-tooltip>
<template slot-scope="scope">
<template v-if="scope.row.edit">
<el-input-number v-model="scope.row.数量" :min= "1" style="width: 110px" size="small" label="完成数量"/>
</template>
<span v-else>{{ scope.row.数量 }}</span>
</template>
</el-table-column>
<el-table-column width="140px" align="center" label="单件工时" show-overflow-tooltip>
<template slot-scope="scope">
<template v-if="scope.row.edit">
<el-input-number v-model="scope.row.单件工时" :min= "1" style="width: 110px" size="small" label="完成数量"/>
</template>
<span v-else>{{ scope.row.单件工时 }}</span>
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('工序')" align="center" label="录入人" prop="录入人" show-overflow-tooltip>
<template slot-scope="scope">
<span>{{ scope.row.录入人 }}</span>
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('完工期限')" align="center" label="录入时间" show-overflow-tooltip>
<template slot-scope="scope">
<span>{{ scope.row.操作时间 }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="操作" width="100">
<template slot-scope="scope">
<el-button v-if="scope.row.edit" type="text" size="mini" icon="el-icon-circle-check-outline" @click="confirmEdit(scope.row)">确定</el-button>
<el-button v-if="scope.row.edit" size="mini" type="text" @click="cancelEdit(scope.$index, scope.row)">取消</el-button>
<el-button v-else type="text" size="mini" icon="el-icon-edit" @click="scope.row.edit=!scope.row.edit"/>
<el-button v-if="!scope.row.edit" type="text" size="mini" icon="el-icon-delete" @click="handleDelete(scope.row)"/>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40, 100]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChanges"
@current-change="handleCurrentChanges"/>
</div>
</el-card>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
export default {
data() {
return {
processingDate: '',
editProcessingDate: '',
orderNumberTypeValue: '', // 操作工
orderNumberType: [], // 操作工数组
partNameValue: '', // 零件图号及名称
processName: '', // 工序名称
completedQuantity: '', // 完成数量
taktTime: '', // 单件工时
queryMonth: new Date(), // 查询月份
// 以上是新加的
loading: false, // 数据加载
total: 0, // 分页总数
tableData: [],
pageCurrent: 1, // 分页当前页
pageSize: 20 // 分页每页显示条数
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
created() {
this.getPeople()
this.searchTable()
this.getNowFormatDate()
},
methods: {
getNowFormatDate() {
var year = this.queryMonth.getFullYear()
var month = this.queryMonth.getMonth() + 1
if (month >= 1 && month <= 9) {
month = '0' + month
}
this.queryMonth = year + '-' + month
},
searchTable() {
this.tableData = []
let queryMonth_check
this.queryMonth ? queryMonth_check = 1 : queryMonth_check = 0
var param = []
param[0] = ['月份', this.queryMonth]
param[1] = ['月份_check', queryMonth_check]
var Data = this.CreateData('11', '车间管理_其他完成工时_基础表_查询数据', param)
this.ExecDatabase(Data).then(response => {
// console.log('李显ceshi', response.data)
for (let i = 0; i < response.data.length; i++) {
this.tableData.push({
// 表示将从数据库中查询到的数据,分别对应填充到表格中
ID: response.data[i].ID,
加工日期: (response.data[i].加工日期).substr(0, 10),
操作工流水号: response.data[i].操作工流水号,
操作工: response.data[i].操作工,
零件图号及名称: response.data[i].零件图号及名称,
工序名称: response.data[i].工序名称,
数量: response.data[i].数量,
单件工时: response.data[i].单件工时,
录入人流水号: response.data[i].录入人流水号,
录入人: response.data[i].录入人,
操作时间: response.data[i].操作时间.substr(0, 10),
ID_before: response.data[i].ID,
加工日期_before: response.data[i].加工日期.substr(0, 10),
操作工流水号_before: response.data[i].操作工流水号,
操作工_before: response.data[i].操作工,
零件图号及名称_before: response.data[i].零件图号及名称,
工序名称_before: response.data[i].工序名称,
数量_before: response.data[i].数量,
单件工时_before: response.data[i].单件工时,
录入人流水号_before: response.data[i].录入人流水号,
录入人_before: response.data[i].录入人,
操作时间_before: response.data[i].操作时间.substr(0, 10),
edit: false
})
}
})
},
cancelEdit(index, row) {
row.edit = false
row.加工日期 = this.tableData[index].加工日期_before
row.操作工 = this.tableData[index].操作工_before
row.零件图号及名称 = this.tableData[index].零件图号及名称_before
row.工序名称 = this.tableData[index].工序名称_before
row.数量 = this.tableData[index].数量_before
row.单件工时 = this.tableData[index].单件工时_before
this.$message('取消修改')
},
getPeople() {
var param = []
param[0] = ['考核部门编号', 19]
var Data = this.CreateData('11', '人事档案管理_人员_部门与人员_查询数据_根据部门编号', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.orderNumberType.push({
label: response.data[i].姓名,
value: response.data[i].人员编号
})
}
})
},
addOtherWorkCompleted() {
var param = []
param[0] = ['加工日期', this.processingDate]
param[1] = ['操作工流水号', this.orderNumberTypeValue]
param[2] = ['零件图号及名称', this.partNameValue]
param[3] = ['工序名称', this.processName]
param[4] = ['完成数量', this.completedQuantity]
param[5] = ['单件工时', this.taktTime]
param[6] = ['录入人流水号', this.id]
var Data = this.CreateData('12', '车间管理_其他完成工时_基础表_增加数据', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('新增成功')
this.processingDate = ''
this.orderNumberTypeValue = ''
this.partNameValue = ''
this.processName = ''
this.completedQuantity = 1
this.taktTime = 1
this.searchTable()
} else {
this.$message.success('新增失败')
}
})
},
// 删除
handleDelete(row) {
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
var param = []
param[0] = ['ID', row.ID]
var Data = this.CreateData('12', '车间管理_其他完成工时_基础表_删除数据', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('删除成功')
this.searchTable()
} else {
this.$message.error('删除失败')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
confirmEdit(row) {
var param = []
param[0] = ['加工日期', row.加工日期]
param[1] = ['操作工流水号', row.操作工流水号]
param[2] = ['零件图号及名称', row.零件图号及名称]
param[3] = ['工序名称', row.工序名称]
param[4] = ['完成数量', row.数量]
param[5] = ['单件工时', row.单件工时]
param[6] = ['录入人流水号', this.id]
param[7] = ['ID', row.ID]
var Data = this.CreateData('12', '车间管理_其他完成工时_基础表_修改数据', param)
this.ExecDatabase(Data).then(response => {
console.log('测试修改', response.data)
if (response.data[0].result === '1') {
this.$message.success('编辑成功')
this.searchTable()
} else {
this.$message.success('编辑失败')
}
})
},
// 以上是新新写的
handleSizeChanges(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable()
},
handleCurrentChanges(val) {
this.pageCurrent = val
this.searchTable()
}
}
}
</script>
<style scoped>
.el-form--label-left >>> .el-form-item__label {
text-align: right;
}
>>>.el-dialog--center .el-dialog__body {
text-align: initial;
padding: 20px 30px 20px
}
>>>.el-dialog__header {
padding: 20px 20px 0px;
}
>>>.el-dialog__footer {
padding: 0px 20px 20px;
/*text-align: right;*/
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
>>>.el-form-item {
margin-bottom: 13px;
}
</style>
<style>
.el-table .Urgent {
background: #ff7575 !important;
}
</style>

View File

@@ -0,0 +1,449 @@
<template>
<div class="app-container">
<el-card style="height: 850px">
<el-row>
<div style="margin-top: 7px; margin-bottom: 7px">
<el-select
v-model="orderNameValue"
:remote-method="getOrderName"
style="width:200px"
placeholder="订单号"
size="small"
filterable
clearable
remote
@change="pageCurrent=1;searchTable();getProductName()">
<el-option
v-for="item in orderName1"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-select
v-model="productNameValue"
style="width:200px"
placeholder="产品/部件名称"
size="small"
filterable
clearable
@change="pageCurrent=1;searchTable()">
<el-option
v-for="item in productName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-input
v-model="partNameValue"
style="width: 100px"
size="small"
clearable
placeholder="零件名"
@keyup.enter.native="pageCurrent=1;searchTable()"/>
<el-input
v-model="drawingNo"
style="width: 100px"
size="small"
clearable
placeholder="图号"
@keyup.enter.native="pageCurrent=1;searchTable()"/>
<el-select
v-model="orderStatus"
style="width:100px"
placeholder="状态"
size="small"
filterable
clearable
@change="pageCurrent=1;searchTable()">
<el-option
v-for="item in orderStatus1"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-date-picker
v-model="completionPeriod"
type="date"
size="small"
style="width: 170px;"
value-format="yyyy-MM-dd"
placeholder="完工期限"
@change="pageCurrent=1;searchTable()"/>
<el-button
style="margin-left: 680px"
type="primary"
icon="el-icon-arrow-up"
plain
size="small"
@click="withdrawalProcess()">撤回
</el-button>
</div>
<el-col style="width: 687px">
<!-- <el-card>-->
<div style="margin-top: 10px">
<el-table
v-loading="loading"
ref="table"
:data="tableData"
:row-class-name="tableRowClassName2"
highlight-current-row
show-summary
border
size="mini"
style="width: 687px;margin-top: 10px"
height="750"
@row-click="searchTable1">
<el-table-column width="80px" label="状态" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.状态==='未开始'" type="warning" size="small">未开始</el-tag>
<el-tag v-if="scope.row.状态==='加工中'" type="info" size="small" style="margin: 0px">加工中</el-tag>
<el-tag v-if="scope.row.状态==='完成'" type="primary" size="small" style="margin: 0px">完成</el-tag>
<el-tag v-if="scope.row.状态==='入库'" type="success" size="small" style="margin: 0px">入库</el-tag>
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('零件图号')" label="零件图号" align="center">
<template slot-scope="scope">
{{ scope.row.零件图号 }}
</template>
</el-table-column>
<el-table-column width="95px" label="零件名称" align="center" prop="零件名称">
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column width="60px" label="数量" align="center" prop="数量">
<template slot-scope="scope">
{{ scope.row.数量 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('日期')" label="投产日期" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.投产日期 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('日期')" label="完工期限" align="center" show-overflow-tooltip>
<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 :width="setColumnWidth('产品名称')" label="产品名称" align="center" show-overflow-tooltip>-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.产品名称 }}-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40, 100]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChanges"
@current-change="handleCurrentChanges"/>
</div>
</div>
<!-- </el-card>-->
</el-col>
<el-col style="margin-left: 20px;width: 955px">
<!-- <el-card>-->
<div style="margin-top: 10px">
<el-table
v-loading="loading1"
ref="multipleTable"
:data="tableData1"
:header-cell-style="{background: '#2283D4',color: 'white'}"
:row-class-name="tableRowClassName1"
highlight-current-row
show-summary
border
size="mini"
height="750"
style="width: 1165px;margin-top: 10px"
@selection-change="handleSelectionChange">
<el-table-column :selectable="selectable1" type="selection" align="center" width="50px"/>
<el-table-column width="55px" label="序号" align="center">
<template slot-scope="scope">
{{ scope.row.序号 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('工序')" label="工序" align="center" prop="工序">
<template slot-scope="scope">
{{ scope.row.工序 }}
</template>
</el-table-column>
<el-table-column width="61px" label="投产数" align="center" prop="投产数">
<template slot-scope="scope">
{{ scope.row.投产数 }}
</template>
</el-table-column>
<el-table-column width="61px" label="分配数" align="center" prop="分配数量">
<template slot-scope="scope">
{{ scope.row.分配数量 }}
</template>
</el-table-column>
<el-table-column width="61px" label="完成数" align="center" show-overflow-tooltip prop="完成数">
<template slot-scope="scope">
{{ scope.row.完成数 }}
</template>
</el-table-column>
<el-table-column width="75px" label="未完成数" align="center" show-overflow-tooltip prop="未完成数">
<template slot-scope="scope">
{{ scope.row.未完成数 }}
</template>
</el-table-column>
<el-table-column width="75px" label="报废数" align="center" show-overflow-tooltip prop="不良数">
<template slot-scope="scope">
{{ scope.row.不良数 }}
</template>
</el-table-column>
<el-table-column width="70px" label="操作者" align="center">
<template slot-scope="scope">
{{ scope.row.操作者 }}
</template>
</el-table-column>
<el-table-column label="设备" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.设备 }}
</template>
</el-table-column>
<el-table-column width="135px" label="开始加工" align="center">
<template slot-scope="scope">
{{ scope.row.开始加工 }}
</template>
</el-table-column>
<el-table-column width="135px" label="完成时间" align="center">
<template slot-scope="scope">
{{ scope.row.完成时间 }}
</template>
</el-table-column>
<el-table-column width="135px" label="自检时间" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.检测时间 }}
</template>
</el-table-column>
<el-table-column width="75px" label="自检数量" align="center" show-overflow-tooltip prop="检测数量">
<template slot-scope="scope">
{{ scope.row.检测数量 }}
</template>
</el-table-column>
<el-table-column width="70px" label="派工人" align="center">
<template slot-scope="scope">
{{ scope.row.调拨员 }}
</template>
</el-table-column>
<el-table-column width="135px" label="派工日期" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.分配时间 }}
</template>
</el-table-column>
</el-table>
</div>
<!-- </el-card>-->
</el-col>
</el-row>
</el-card>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
export default {
data() {
return {
drawingNo: '',
dateRange: '', // 提交日期
contractStateValue: '', // 合同状态
partNameValue: '', // 零件名称
productNameValue: '', // 产品部件名称
productName: [],
orderNameValue: '', // 订单名称
orderName1: [],
orderStatus: '',
orderStatus1: [],
completionPeriod: '',
loading: false, // 数据加载
loading1: false, // 数据加载
total: 0, // 分页总数
tableData: [], // 零件表
tableData1: [], // 工序表
pageCurrent: 1, // 分页当前页
pageSize: 40, // 分页每页显示条数
orderName: '', // 排序列名
order: '' // 排序方式
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
updated() {
this.$nextTick(() => {
this.$refs['table'].doLayout()
})
},
created() {
this.getOrderName()
this.searchTable()
this.getState()
},
methods: {
selectable1(row) {
return row.完成状态 === 1 && row.工序类型 === 1
},
handleSelectionChange(val) {
if (val.length > 1) {
this.$refs.multipleTable.clearSelection() // 清除
this.$refs.multipleTable.toggleRowSelection(val.pop()) // pop最后一个
} else {
this.multipleSelection = val // multipleSelection当前选择的数组
}
},
withdrawalProcess() {
var param = []
// param[0] = ['工艺任务流水号', this.multipleSelection[0].工艺计划流水号]
// param[3] = ['工艺流水号', this.multipleSelection[0].工艺流水号]
param[0] = ['设备流水号', this.multipleSelection[0].设备流水号]
param[1] = ['完成数', this.multipleSelection[0].完成数]
param[2] = ['人员编号', this.multipleSelection[0].人员编号]
param[3] = ['完成过程流水号', this.multipleSelection[0].完成过程流水号]
param[4] = ['工艺计划流水号', this.multipleSelection[0].工艺计划流水号]
param[5] = ['工序流水号', this.multipleSelection[0].工序流水号]
param[6] = ['扫码工时', this.multipleSelection[0].扫码工时]
var Data = this.CreateData('12', '车间生产管理工艺_追溯加工_工序撤回', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('撤回成功')
var param1 = []
param1[0] = ['工艺计划流水号', this.multipleSelection[0].工艺计划流水号]
var Data1 = this.CreateData('11', '车间生产管理工艺_追溯加工_查询工序', param1)
this.ExecDatabase(Data1).then(response => {
this.tableData1 = response.data
})
this.searchTable()
} else {
this.$message.success('撤回失败')
}
})
},
getState() {
var param = []
var Data = this.CreateData('11', '精工车间_零件追溯_状态_查询', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.orderStatus1.push({
label: response.data[i].考核状态,
value: response.data[i].考核状态
})
}
})
},
getOrderName(query) {
this.orderName1 = []
var param = []
param[0] = ['订单编号', query]
var Data = this.CreateData('11', '订单信息_列表_查询数据_bak', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.orderName1.push({
label: response.data[i].订单编号,
value: response.data[i].订单流水号
})
}
})
},
getProductName() {
this.productNameValue = ''
this.productName = []
if (this.orderNameValue) {
var param = []
param[0] = ['订单流水号', this.orderNameValue]
var Data = this.CreateData('11', '订单信息_产品信息_查询数据', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.productName.push({
label: response.data[i].产品名称,
value: response.data[i].组件流水号
})
}
})
}
},
searchTable() {
this.tableData1 = []
let orderNameValue_check, productNameValue_check, partNameValue_check, orderStatus_check, completionPeriod_check,
drawingNo_check
this.orderNameValue ? orderNameValue_check = 1 : orderNameValue_check = 0
this.productNameValue ? productNameValue_check = 1 : productNameValue_check = 0
this.drawingNo ? drawingNo_check = 1 : drawingNo_check = 0
this.partNameValue ? partNameValue_check = 1 : partNameValue_check = 0
this.orderStatus ? orderStatus_check = 1 : orderStatus_check = 0
this.completionPeriod ? completionPeriod_check = 1 : completionPeriod_check = 0
var param = []
param[0] = ['订单流水号_check', orderNameValue_check]
param[1] = ['订单流水号', this.orderNameValue]
param[2] = ['组件流水号', this.productNameValue]
param[3] = ['组件流水号_check', productNameValue_check]
param[4] = ['零件名称_check', partNameValue_check]
param[5] = ['零件名称', this.partNameValue]
param[6] = ['订单状态_check', orderStatus_check]
param[7] = ['订单状态', this.orderStatus]
param[8] = ['精工期限_check', completionPeriod_check]
param[9] = ['精工期限', this.completionPeriod]
param[10] = ['图号_check', drawingNo_check]
param[11] = ['图号', this.drawingNo]
var Data = this.CreateData('11', '精工车间_零件追溯_查询', param, this.pageSize, this.pageCurrent)
this.ExecDatabase(Data).then(response => {
console.log('查询工艺', response.data)
this.tableData = response.data.rows
this.total = response.data.total
})
},
searchTable1(row) {
var param = []
param[0] = ['工艺计划流水号', row.工艺计划流水号]
var Data = this.CreateData('11', '车间生产管理工艺_追溯加工_查询工序', param)
this.ExecDatabase(Data).then(response => {
this.tableData1 = response.data
})
},
// 工序状态变色
tableRowClassName1({ row, rowIndex }) {
row.index = rowIndex
if (row.完成时间 || row.完成状态 === 1) {
return 'CompleteColor'
}
},
tableRowClassName2({ row, rowIndex }) {
row.index = rowIndex
if (row.是否有开开始加工的 === '1') {
return 'CompleteColor'
}
},
handleSizeChanges(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable()
},
handleCurrentChanges(val) {
this.pageCurrent = val
this.searchTable()
}
}
}
</script>
<style>
.CompleteColor {
background: #d8e5f6 !important;
}
</style>

View File

@@ -0,0 +1,225 @@
<template>
<div class="app-container">
<el-card>
<div style="margin-top: 7px; margin-bottom: 7px">
<span>加工日期{{ dateTime }}</span>
</div>
<el-table v-loading="loading" :data="tableData" highlight-current-row border stripe size="small" style="width: 1451px" height="750" @sort-change="sortChange">
<el-table-column :width="setColumnWidth('零件名称')" label="零件名称" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('零件名称')" label="图号" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.零件图号 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" label="数量" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.数量 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('序号')" label="序号" align="center">
<template slot-scope="scope">
{{ scope.row.工序顺序 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('工序')" label="工序" prop="工序" sortable="工序" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.工序 }}
</template>
</el-table-column>
<el-table-column width="180px" label="设备" align="center" prop="设备" sortable="设备" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.设备 }}
</template>
</el-table-column>
<el-table-column width="85px" label="操作者" align="center" prop="操作者" sortable="操作者" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.操作者 }}
</template>
</el-table-column>
<el-table-column width="127px" label="开始时间" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.开始时间 }}
</template>
</el-table-column>
<el-table-column width="85px" label="完工期限" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.精工期限 }}
</template>
</el-table-column>
<el-table-column width="85px" label="分配时间" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.分配时间 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('产品名称')" label="产品名称" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.产品名称 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('订单号')" label="订单号" align="center" prop="订单号" sortable="订单号" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.订单号 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-tooltip :open-delay="700" effect="dark" content="工艺/派工" placement="top">
<el-button type="text" size="mini" style="margin-right: 10px" @click="productionTraceability(scope.row)">生产追溯</el-button>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40, 100]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChanges"
@current-change="handleCurrentChanges"/>
</div>
</el-card>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible1" center width="851px">
<el-table v-loading="loading" :data="tableData1" highlight-current-row border stripe size="small" style="width: 801px;">
<el-table-column :width="setColumnWidth('序号')" label="序号" align="center" prop="序号">
<template slot-scope="scope">
{{ scope.row.序号 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('工序')" label="工序" align="center" prop="工序">
<template slot-scope="scope">
{{ scope.row.工序 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" label="投产数" align="center">
<template slot-scope="scope">
{{ scope.row.投产数 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" label="完成数" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.完成数 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('姓名')" 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 :width="setColumnWidth('日期时间')" label="开始时间" align="center">
<template slot-scope="scope">
{{ scope.row.开始加工 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('日期时间')" label="结束时间" align="center">
<template slot-scope="scope">
{{ scope.row.完成时间 }}
</template>
</el-table-column>
</el-table>
</el-dialog>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import { getNowShotTime } from '@/utils/tool'
export default {
data() {
return {
dateRange: '', // 提交日期
contractStateValue: '', // 合同状态
dialogFormVisible1: false, // 生产追溯
contractState: [
{
value: 2,
label: '未提交'
}, {
value: 1,
label: '提交'
}
], // 合同状态数组
loading: false, // 数据加载
total: 0, // 分页总数
tableData: [], // 合同信息表
tableData1: [], // 生产追溯
pageCurrent: 1, // 分页当前页
pageSize: 100, // 分页每页显示条数
orderName: '', // 排序列名
order: '', // 排序方式
dateTime: getNowShotTime()
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
created() {
this.searchTable()
},
methods: {
searchTable() {
var param = []
param[0] = ['排序名称', this.orderName]
param[1] = ['排序方式', this.order]
var Data = this.CreateData('11', '精工车间_正加工零件_查询', param, this.pageSize, this.pageCurrent)
this.ExecDatabase(Data).then(response => {
this.tableData = response.data.rows
this.total = response.data.total
})
},
// 生产追溯
productionTraceability(row) {
var param = []
param[0] = ['工艺计划流水号', row.工艺计划流水号]
var Data = this.CreateData('11', '车间生产管理工艺_追溯加工_查询工序', param, this.pageSize, this.pageCurrent)
this.ExecDatabase(Data).then(response => {
this.tableData1 = response.data.rows
this.total = response.data.total
this.dialogFormVisible1 = true
})
},
sortChange(column) {
if (column.prop === '工序') {
this.orderName = 1
} else if (column.prop === '设备') {
this.orderName = 2
} else if (column.prop === '操作者') {
this.orderName = 3
} else if (column.prop === '订单号') {
this.orderName = 4
} else {
this.orderName = 0
}
if (column.order === 'ascending') {
this.order = 1
} else if (column.order === 'descending') { this.order = 2 } else {
this.order = ''
}
this.searchTable()
},
handleSizeChanges(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable()
},
handleCurrentChanges(val) {
this.pageCurrent = val
this.searchTable()
}
}
}
</script>

View File

@@ -0,0 +1,586 @@
<template>
<div class="app-container">
<el-card style="height: 850px">
<div style="margin-top: 7px; margin-bottom: 7px">
<el-select
:disabled="checked"
v-model="orderNumberTypeValue"
:remote-method="getOrderNumberType"
style="width:200px"
placeholder="订单号"
size="small"
filterable
clearable
remote
@change="searchTable();getproductpartName()">
<el-option
v-for="item in orderNumberType"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-select
v-model="productpartNameValue"
style="width:200px;"
placeholder="产品/部件名称"
size="small"
filterable
clearable
@change="searchTable()">
<el-option
v-for="item in productpartName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-input v-model="partNameValue" style="width:150px" placeholder="名称或图号" size="small" clearable/>
<el-button
icon="el-icon-search"
type="primary"
plain
size="small"
style="margin-left: 10px"
@click="pageCurrent = 1;pageSize = 100;searchTable()">查询
</el-button>
<el-checkbox v-model="checked" style="margin-left: 60px" @change="updateCheck">按产品</el-checkbox>
</div>
<el-table
v-show="!checked"
:data="tableData"
:row-class-name="tableRowClassName"
highlight-current-row
border
size="small"
style="width: 1031px; margin-top: 10px"
height="740px">
<el-table-column :width="setColumnWidth('序号')" label="序号" type="index" align="center"/>
<el-table-column :width="setColumnWidth('订单编号')" label="订单编号" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.订单号 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('产品名称')" label="产品名称" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.产品名称 }}
</template>
</el-table-column>
<el-table-column label="零件名称" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('图号')" label="图号" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.零件图号 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" label="数量" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.批次数量 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('姓名')" label="工艺员" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.工艺员 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('日期')" label="编制时间" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.工艺更新时间 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="155px">
<template slot-scope="scope">
<el-button
:disabled="scope.row.工艺单数量 === '0'"
type="text"
icon="el-icon-search"
size="mini"
style="margin-right: 5px"
@click="getProcess(scope.row)">工艺单
</el-button>
<el-button
:disabled="Number(scope.row.有图纸)===0"
type="text"
icon="el-icon-search"
size="mini"
@click="getNum(scope.row)">图纸
</el-button>
</template>
</el-table-column>
</el-table>
<div v-show="!checked" class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40, 100]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChanges"
@current-change="handleCurrentChanges"/>
</div>
<el-table
v-show="checked"
:data="tableData"
highlight-current-row
border
stripe
size="small"
style="width: 1031px; margin-top: 10px"
height="740px">
<el-table-column :width="setColumnWidth('序号')" label="序号" type="index" align="center"/>
<el-table-column width="200px" label="产品名称" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.产品名称 }}
</template>
</el-table-column>
<el-table-column label="零件名称" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.名称 }}
</template>
</el-table-column>
<el-table-column width="200px" label="图号" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.代号 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('姓名')" label="工艺员" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.工艺员 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('日期')" label="编制时间" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.工艺更新时间 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="155px">
<template slot-scope="scope">
<el-button
:disabled="scope.row.工艺单数量 === '0'"
type="text"
icon="el-icon-search"
size="mini"
style="margin-right: 5px"
@click="getProcess(scope.row)">工艺单
</el-button>
<el-button type="text" icon="el-icon-search" size="mini" @click="getNum1(scope.row)">图纸</el-button>
</template>
</el-table-column>
</el-table>
<div v-show="checked" class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40, 100]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChanges"
@current-change="handleCurrentChanges"/>
</div>
</el-card>
<el-dialog v-el-drag-dialog :visible.sync="dialogVisible" width="350px">
<div v-for="(file, key) in hadFile" :key="key">
<div class="wrapper">
<div class="content">
<div v-if="file.suffix==='pdf'" class="icon">
<svg-icon icon-class="pdf"/>
</div>
<div v-else-if="file.suffix==='docx'||file.suffix === 'doc'" class="icon">
<svg-icon icon-class="doc"/>
</div>
<div v-else-if="file.suffix==='xlsx' || file.suffix === 'xls'" class="icon">
<svg-icon icon-class="excel"/>
</div>
<div v-else-if="file.suffix==='pptx' || file.suffix === 'ppt'" class="icon">
<svg-icon icon-class="ppt"/>
</div>
<div v-else-if="file.suffix==='jpg' || file.suffix === 'jpeg'|| file.suffix === 'png'" class="icon">
<svg-icon icon-class="pic"/>
</div>
<div v-else class="icon">
<svg-icon icon-class="file"/>
</div>
<a id="appUrl" :href="file.url" target="view_window">
<div class="info">{{ file.name }}</div>
</a>
</div>
</div>
</div>
</el-dialog>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible1" center width="831px">
<el-table :data="tableData1" highlight-current-row border stripe size="small" style="width: 771px;">
<el-table-column :width="setColumnWidth('序号')" label="序号" align="center" prop="序号">
<template slot-scope="scope">
{{ scope.row.工序顺序 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('工序')" label="工序" align="center" prop="工序">
<template slot-scope="scope">
{{ scope.row.工艺名称 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('工序说明')" label="工艺要求" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.工艺要求 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('定额工时')" label="定额工时" align="center">
<template slot-scope="scope">
{{ scope.row.定额工时 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('准结工时')" label="准结工时" align="center">
<template slot-scope="scope">
{{ scope.row.准结工时 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button
:disabled="!scope.row.工艺名称"
type="text"
size="mini"
style="margin-right: 5px"
@click="getProcessTool(scope.row)">查看工艺指导
</el-button>
</template>
</el-table-column>
</el-table>
</el-dialog>
<el-dialog
v-el-drag-dialog
:visible.sync="dialogVisible1"
:center="dialogName"
title="工艺指导"
width="20%">
<div v-for="(file, key) in hadFile1" :key="key">
<div class="wrapper">
<div class="content">
<div v-if="file.suffix==='pdf'" class="icon">
<svg-icon icon-class="pdf"/>
</div>
<div v-else-if="file.suffix==='docx'||file.suffix === 'doc'" class="icon">
<svg-icon icon-class="doc"/>
</div>
<div v-else-if="file.suffix==='xlsx' || file.suffix === 'xls'" class="icon">
<svg-icon icon-class="excel"/>
</div>
<div v-else-if="file.suffix==='pptx' || file.suffix === 'ppt'" class="icon">
<svg-icon icon-class="ppt"/>
</div>
<div v-else-if="file.suffix==='jpg' || file.suffix === 'jpeg'|| file.suffix === 'png'" class="icon">
<svg-icon icon-class="pic"/>
</div>
<div v-else class="icon">
<svg-icon icon-class="file"/>
</div>
<a id="appUrl1" :href="file.url" target="view_window">
<div class="info">{{ file.name }}</div>
</a>
</div>
</div>
</div>
</el-dialog>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import request, { MESDownloadFile } from '@/utils/request'
export default {
data() {
return {
dialogVisible1: false,
hadFile1: [],
processValue: '',
dialogName: true,
orderNumberTypeValue: '', // 订单号
orderNumberType: [], // 订单号数组
productpartNameValue: '', // 产品部件名称
productpartName: [], // 产品部件名称数组
partNameValue: '', // 零件名称
partName: '',
hadFile: [],
fileList: [],
tableData1: [],
dialogVisible: false,
dialogFormVisible1: false,
checked: false,
loading: false, // 数据加载
total: 0, // 分页总数
tableData: [], // 合同信息表
tableData2: [],
pageCurrent: 1, // 分页当前页
pageSize: 100, // 分页每页显示条数
orderName: '', // 排序列名
order: '' // 排序方式
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
created() {
this.searchTable()
this.getOrderNumberType('')
},
methods: {
getOrderNumberType(query) {
this.orderNumberType = []
var param = []
param[0] = ['客户名称', query]
var Data = this.CreateData('11', '订单信息_列表_查询数据_bak', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.orderNumberType.push({
label: response.data[i].订单编号,
value: response.data[i].订单流水号
})
}
})
},
getproductpartName() {
this.productpartNameValue = ''
this.productpartName = []
if (this.orderNumberTypeValue) {
var param = []
param[0] = ['订单流水号', this.orderNumberTypeValue]
var Data = this.CreateData('11', '订单信息_产品信息_查询数据', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.productpartName.push({
label: response.data[i].产品名称,
value: response.data[i].组件流水号
})
}
})
}
},
getProductName() {
this.productpartNameValue = ''
this.productpartName = []
var param = []
var Data = this.CreateData('11', '产品信息_基础表_查询数据', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.productpartName.push({
label: response.data[i].产品名称,
value: response.data[i].产品流水号
})
}
})
},
searchTable() {
let orderNumberTypeValue_check, productpartNameValue_check, partNameValue_check
this.orderNumberTypeValue ? orderNumberTypeValue_check = 1 : orderNumberTypeValue_check = 0
console.log(this.contractStateValue, 123)
this.productpartNameValue ? productpartNameValue_check = 1 : productpartNameValue_check = 0
this.partNameValue ? partNameValue_check = 1 : partNameValue_check = 0
console.log(this.contractStateValue, 123)
if (this.checked) {
var param = []
param[0] = ['产品流水号', this.productpartNameValue]
param[1] = ['产品流水号_check', productpartNameValue_check]
param[2] = ['零件名称_check', partNameValue_check]
param[3] = ['零件名称', this.partNameValue]
// 参数数量与名称要与存储过程对应
var Data = this.CreateData('11', '工艺_通用_查询新', param, this.pageSize, this.pageCurrent)
this.ExecDatabase(Data).then(response => {
this.tableData = response.data.rows
this.total = response.data.total
})
} else {
var param1 = []
param1[0] = ['订单流水号', this.orderNumberTypeValue]
param1[1] = ['订单流水号_check', orderNumberTypeValue_check]
param1[2] = ['组件流水号', this.productpartNameValue]
param1[3] = ['组件流水号_check', productpartNameValue_check]
param1[4] = ['零件名称_check', partNameValue_check]
param1[5] = ['零件名称', this.partNameValue]
// 参数数量与名称要与存储过程对应
var Data1 = this.CreateData('11', '工艺_查询新', param1, this.pageSize, this.pageCurrent)
this.ExecDatabase(Data1).then(response => {
this.tableData = response.data.rows
this.total = response.data.total
})
}
},
// 查看零件图
getNum(row) {
this.dialogVisible = true
this.getFileList(row.零件图号)
},
// 查看零件图
getNum1(row) {
this.dialogVisible = true
this.getFileList(row.代号)
},
async getFileList(value) {
this.hadFile = []
if (value) {
await request({
url: '',
method: 'post',
data: {
type: '3',
name: `select * from 机加工MES_零件图PDF表 where 是否启用 = 1 and name = '${value}'`
}
}).then(data => {
this.suffix = data.data
if (data.data.length > 0) {
const server = `${MESDownloadFile}`.split('/')
data.data.map(item => {
this.hadFile.push({
url: `http://${server[2]}/webpage/part/${item.uid}.${item.suffix}`,
name: `${item.name}.${item.suffix}`,
suffix: item.suffix,
id: item.uid
})
})
}
})
}
},
updateCheck() {
this.getProductName()
this.searchTable()
},
getProcess(row) {
this.partName = row.零件图号
var param = []
param[0] = ['工艺计划流水号', row.工艺计划流水号]
// 参数数量与名称要与存储过程对应
var Data = this.CreateData('11', '车间生产管理工艺_零件工序_查询数据', param)
this.ExecDatabase(Data).then(response => {
this.tableData1 = response.data
})
this.dialogFormVisible1 = true
},
getProcessTool(row) {
this.processValue = this.partName + '-' + row.工序顺序 + '-' + row.工艺名称
this.hadFile1 = []
var param = []
param[0] = ['name', this.processValue]
var Data = this.CreateData('11', '车间生产管理工艺_零件工序_指导图_查询数据', param)
this.ExecDatabase(Data).then(res => {
this.suffix = res.data
if (res.data.length > 0) {
const server = `${MESDownloadFile}`.split('/')
res.data.map(item => {
this.hadFile1.push({
url: `http://${server[2]}/webpage/part/${item.uid}.${item.suffix}`,
name: `${item.name}.${item.suffix}`,
suffix: item.suffix,
id: item.num
})
})
}
})
this.dialogVisible1 = true
},
tableRowClassName({ row, rowIndex }) {
if (Number(row.是否加急) === 1) {
return 'Urgent'
}
},
handleSizeChanges(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable()
},
handleCurrentChanges(val) {
this.pageCurrent = val
this.searchTable()
}
}
}
</script>
<style scoped>
.el-form--label-left >>> .el-form-item__label {
text-align: right;
}
>>> .el-dialog--center .el-dialog__body {
text-align: initial;
padding: 20px 30px 20px
}
>>> .el-dialog__header {
padding: 20px 20px 0px;
}
>>> .el-dialog__footer {
padding: 0px 20px 20px;
/*text-align: right;*/
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
>>> .el-form-item {
margin-bottom: 13px;
}
.wrapper {
width: 90%;
height: 50px;
overflow: hidden;
border: 1px solid #b8c7d9;
/*float: left;*/
margin: 10px;
}
.content {
position: relative;
padding: 8px 8px 0 8px;
}
.action {
position: absolute;
top: 2px;
right: 8px;
}
.delete {
padding: 0 5px;
border-radius: 3px;
color: #0f84b0;
font-size: 12px;
}
.delete:hover {
background: -webkit-linear-gradient(top, #0ba9e3, #0099d3);
color: #fff;
}
a {
text-decoration: none;
}
.icon {
width: 30px;
height: 30px;
display: inline-block;
margin-right: 7px;
margin-top: 2px;
font-size: 26px;
}
.info {
width: 160px;
height: 50px;
position: absolute;
left: 44px;
line-height: 30px;
display: inline-block;
color: #999;
}
</style>
<style>
.el-table .Urgent {
background: #ff7575 !important;
}
</style>

View File

@@ -0,0 +1,425 @@
<template>
<div class="app-container">
<el-card>
<el-row>
<el-col style="margin-left: 7px;width: 721px">
<el-table
v-loading="loading"
:data="tableData"
highlight-current-row
show-summary
border
stripe
size="small"
style="width: 720px"
height="800"
@row-click="searchTable1">
<el-table-column width="120px" label="采购合同编号" align="center">
<template slot-scope="scope">
{{ scope.row.采购合同编号 }}
</template>
</el-table-column>
<el-table-column width="150px" label="供应商" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.供应商名称 }}
</template>
</el-table-column>
<el-table-column width="60px" label="采购员" align="center">
<template slot-scope="scope">
{{ scope.row.采购员 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('金额')" label="总金额(元)" align="center" prop="合同总额">
<template slot-scope="scope">
{{ scope.row.合同总额 ? Number(scope.row.合同总额).toFixed(2) : '' }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('日期')" label="提交时间" align="center">
<template slot-scope="scope">
{{ scope.row.提交日期 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button
:disabled="Number(scope.row.是否有图片)===0"
size="mini"
type="text"
icon="el-icon-picture-outline"
@click="handlePicture(scope.row)"/>
<el-button type="text" size="mini" icon="el-icon-check" @click="yesApproval(scope.row)">通过</el-button>
<el-button type="text" size="mini" icon="el-icon-close" @click="noApproval(scope.row)">不通过
</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40, 100]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChanges"
@current-change="handleCurrentChanges"/>
</div>
</el-col>
<el-col style="margin-left: 10px;width:921px ">
<el-table
ref="table"
:data="tableData1"
:header-cell-style="{background: '#2283D4',color: 'white'}"
:summary-method="getSummaries"
highlight-current-row
show-summary
border
stripe
size="mini"
style="width: 931px"
height="800"
>
<el-table-column
type="index"
width="50"
label="序号"
align="center"/>
<el-table-column width="150px" label="采购件" align="center" prop="物料名称">
<template slot-scope="scope">
{{ scope.row.采购件 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('图号/规格')" label="图号/型号" align="center">
<template slot-scope="scope">
{{ scope.row.图号或型号 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('材料')" label="材料" align="center">
<template slot-scope="scope">
{{ scope.row.材料 }}
</template>
</el-table-column>
<el-table-column width="60px" label="数量" align="center" prop="采购数">
<template slot-scope="scope">
{{ scope.row.采购数 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('单位')" label="单位" align="center">
<template slot-scope="scope">
{{ scope.row.单位 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('采购备注')" label="采购备注" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.采购备注 }}
</template>
</el-table-column>
<el-table-column width="100px" label="单价(元)" align="center" prop="单价">
<template slot-scope="scope">
{{ scope.row.单价 ? Number(scope.row.单价).toFixed(2) : '' }}
</template>
</el-table-column>
<el-table-column width="100px" label="金额" align="center" show-overflow-tooltip prop="金额">
<template slot-scope="scope">
{{ scope.row.金额 ? Number(scope.row.金额).toFixed(2) : '' }}
</template>
</el-table-column>
<el-table-column width="150px" label="订单编号" align="center" prop="订单号">
<template slot-scope="scope">
{{ scope.row.订单号 }}
</template>
</el-table-column>
<el-table-column width="60px" label="收货人" align="center">
<template slot-scope="scope">
{{ scope.row.收货人员 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('产品名称')" label="产品名称" align="center">
<template slot-scope="scope">
{{ scope.row.产品名称 }}
</template>
</el-table-column>
<el-table-column width="140px" label="产品详情" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.产品详情 }}
</template>
</el-table-column>
<el-table-column width="140px" label="订单备注" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.订单备注 }}
</template>
</el-table-column>
<el-table-column width="80px" label="操作" align="center" fixed="right">
<template slot-scope="scope">
<el-button
:disabled="scope.row.图纸 === null"
type="text"
icon="el-icon-search"
size="mini"
@click="getNum(scope.row)">图纸
</el-button>
</template>
</el-table-column>
</el-table>
</el-col>
</el-row>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible" title="图片" center style="" width="600px">
<el-image
v-for="url in urls"
:key="url"
:src="url"
:preview-src-list="urls"
lazy
style="width: 500px; height: 500px"/>
</el-dialog>
<el-dialog v-el-drag-dialog :visible.sync="dialogVisible" width="350px">
<div v-for="(file, key) in hadFile" :key="key">
<div class="wrapper">
<div class="content">
<div v-if="file.suffix==='pdf'" class="icon">
<svg-icon icon-class="pdf"/>
</div>
<div v-else-if="file.suffix==='docx'||file.suffix === 'doc'" class="icon">
<svg-icon icon-class="doc"/>
</div>
<div v-else-if="file.suffix==='xlsx' || file.suffix === 'xls'" class="icon">
<svg-icon icon-class="excel"/>
</div>
<div v-else-if="file.suffix==='pptx' || file.suffix === 'ppt'" class="icon">
<svg-icon icon-class="ppt"/>
</div>
<div v-else-if="file.suffix==='jpg' || file.suffix === 'jpeg'|| file.suffix === 'png'" class="icon">
<svg-icon icon-class="pic"/>
</div>
<div v-else class="icon">
<svg-icon icon-class="file"/>
</div>
<a id="appUrl" :href="file.url" target="view_window">
<div class="info">{{ file.name }}</div>
</a>
</div>
</div>
</div>
</el-dialog>
</el-card>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import request, { MESDownloadFile } from '@/utils/request'
export default {
data() {
return {
hadFile: [],
loading: false, // 数据加载
dialogVisible: false, // 查看图片
dialogFormVisible: false, // 查看图片
urls: [], // 图片数组
total: 0, // 分页总数
tableData: [], // 合同信息表
tableData1: [], // 合同信息表
pageCurrent: 1, // 分页当前页
pageSize: 100 // 分页每页显示条数
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
updated() {
this.$nextTick(() => {
this.$refs['table'].doLayout()
})
},
created() {
this.searchTable()
},
methods: {
// 查看零件图
getNum(row) {
this.dialogVisible = true
this.getFileList(row.图号或型号)
},
async getFileList(value) {
this.hadFile = []
if (value) {
await request({
url: '',
method: 'post',
data: {
type: '3',
name: `select * from 机加工MES_零件图PDF表 where 是否启用 = 1 and name = '${value}'`
}
}).then(data => {
this.suffix = data.data
if (data.data.length > 0) {
const server = `${MESDownloadFile}`.split('/')
data.data.map(item => {
this.hadFile.push({
url: `http://${server[2]}/webpage/part/${item.uid}.${item.suffix}`,
name: `${item.name}.${item.suffix}`,
suffix: item.suffix,
id: item.uid
})
})
}
})
}
},
searchTable() {
var param = []
var Data = this.CreateData('11', '采购管理_采购合同审批_查询', param, this.pageSize, this.pageCurrent)
this.ExecDatabase(Data).then(response => {
this.tableData = response.data.rows
this.total = response.data.total
})
},
handlePicture(row) {
this.dialogFormVisible = true
this.urls = []
var param = []
param[0] = ['采购合同流水号', row.采购合同流水号]
var Data = this.CreateData('11', '采购合同查询_图片_查询数据', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
if (response.data[i].文件内容 !== null) {
this.urls.push('data:image/png;base64,' + response.data[i].文件内容)
}
}
})
},
yesApproval(row) {
this.$confirm('确定审批通过?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
var param = []
param[0] = ['采购合同流水号', row.采购合同流水号]
param[1] = ['审批情况流水号', 1]
param[2] = ['未通过原因', '']
param[3] = ['审批人', this.id]
var Data = this.CreateData('12', '采购管理_合同审核_采购部_修改数据', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('审批成功')
this.searchTable()
this.tableData1 = []
} else {
this.$message.error('审批失败')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消操作'
})
})
},
noApproval(row) {
this.$prompt('请输入不通过原因', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消'
}).then(({ value }) => {
var param = []
param[0] = ['采购合同流水号', row.采购合同流水号]
param[1] = ['审批情况流水号', 2]
param[2] = ['未通过原因', value]
param[3] = ['审批人', this.id]
var Data = this.CreateData('12', '采购管理_合同审核_采购部_修改数据', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('审批成功')
this.searchTable()
this.tableData1 = []
} else {
this.$message.error('审批失败')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消操作'
})
})
},
searchTable1(row) {
var param = []
param[0] = ['采购合同流水号', row.采购合同流水号]
var Data = this.CreateData('11', '采购管理_采购合同明细_全部_查询数据', param)
this.ExecDatabase(Data).then(response => {
this.tableData1 = response.data
})
},
getSummaries(param) {
const { columns, data } = param
const sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计'
return
} else if (index === 9) {
const values = data.map(item => Number(item[column.property]))
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return prev + curr
} else {
return prev
}
}, 0)
sums[index] = sums[index]
} else {
sums[index] = 'N/A'
}
} else if (index === 11) {
const values = data.map(item => Number(item[column.property]))
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return prev + curr
} else {
return prev
}
}, 0)
sums[index] = sums[index].toFixed(2)
} else {
sums[index] = 'N/A'
}
} else if (index === 12) {
const values = data.map(item => Number(item[column.property]))
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return prev + curr
} else {
return prev
}
}, 0)
sums[index] = sums[index].toFixed(2)
} else {
sums[index] = 'N/A'
}
}
})
return sums
},
handleSizeChanges(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable()
},
handleCurrentChanges(val) {
this.pageCurrent = val
this.searchTable()
}
}
}
</script>

View File

@@ -0,0 +1,768 @@
<template>
<div class="app-container">
<el-card style="height: 850px">
<div style="margin-top: 7px; margin-bottom: 7px">
<el-select v-model="orderNumberTypeValue" style="width:200px" placeholder="订单号" size="small" filterable clearable @change="searchTable();getproductpartName()">
<el-option
v-for="item in orderNumberType"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-select v-model="productpartNameValue" style="width:200px;margin-left: 10px" placeholder="产品/部件名称" size="small" filterable clearable @change="searchTable()">
<el-option
v-for="item in productpartName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-input v-model="partNameValue" style="width:100px;margin-left: 10px" placeholder="零件名" size="small" clearable/>
<el-button icon="el-icon-search" type="primary" plain size="small" style="margin-left: 10px" @click="pageCurrent = 1;pageSize = 100;searchTable()">查询</el-button>
<el-button type="primary" plain icon="el-icon-search" size="small" style="margin-left:60px" @click="categoryMaintenance">工况</el-button>
<!--<el-button plain size="small" @click="externalProcessing()">对外加工</el-button>-->
</div>
<el-table ref="table" :data="tableData" :row-class-name="tableRowClassName" highlight-current-row show-summary border size="small" style="width: 1121px; margin-top: 10px" height="740px" @sort-change="sortChange">
<el-table-column :width="setColumnWidth('序号')" label="序号" type="index" align="center"/>
<el-table-column :width="setColumnWidth('零件名称')" label="零件名称" align="center" sortable="零件名称" prop="零件名称" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('图号')" label="图号" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.零件图号 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" label="数量" align="center" prop="批次数量" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.批次数量 }}
</template>
</el-table-column>
<!--<el-table-column :width="setColumnWidth('日期')" label="加工者" align="center" sortable="custom" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.材料 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('加工设备')" label="生产设备" align="center" sortable="custom" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.订单备注 }}
</template>
</el-table-column>-->
<el-table-column :width="setColumnWidth('订单编号')" label="订单编号" sortable="订单编号" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.订单号 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('日期时间')" label="产品/部件名称" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.产品名称 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('备注')" label="订单备注" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.订单备注 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('日期')" label="下达日期" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.接收任务 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('日期')" label="完工期限" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.精工期限 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<!-- <el-tooltip :open-delay="700" effect="dark" content="查看图纸" placement="top">-->
<!-- <el-button type="text" icon="el-icon-search" size="mini" style="margin-right: 10px" @click="deleteProduct(scope.row)">图纸</el-button>-->
<!-- </el-tooltip>-->
<!--<el-tooltip :open-delay="700" effect="dark" content="工艺/派工" placement="top">
<el-button type="text" icon="el-icon-thumb" size="mini" style="margin-right: 10px" @click="techNology(scope.row)">工艺/派工</el-button>
</el-tooltip>-->
<el-button v-show="Number(scope.row.是否加急)===0" type="text" size="mini" style="margin-right: 10px" @click="Urgent(scope.row)">加急</el-button>
<el-button v-show="Number(scope.row.是否加急)===1" type="text" size="mini" style="margin-right: 10px" @click="CancelUrgent(scope.row)">取消加急</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40, 100]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChanges"
@current-change="handleCurrentChanges"/>
</div>
</el-card>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible4" title="工艺/派工" center width="1202px">
<el-row>
<div style="margin-top: 7px; margin-bottom: 7px">
<span style="margin-left: 20px;font-size: 16px">零件名称{{ partName }}</span>
<span style="margin-left: 20px;font-size: 16px">零件图号{{ partNumber }}</span>
<!-- <el-button icon="el-icon-search" type="primary" plain size="small" style="margin-left: 10px" @click="pageCurrent = 1;pageSize = 100;searchTable()">查询</el-button>-->
<el-date-picker
v-model="finishTime"
size="small"
align="center"
style="width: 200px;margin-left: 370px"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
placeholder="计划完成"/>
<el-button icon="el-icon-search" type="primary" plain size="small" style="margin-left: 10px" @click="pageCurrent = 1;pageSize = 100;searchTable()">图纸</el-button>
<el-button type="success" plain icon="el-icon-download" size="small" style="margin-left: 10px" @click="preservation()">保存</el-button>
<!-- <el-button type="success" plain icon="el-icon-download" size="small" style="margin-left: 760px" @click="exportExcel()">导出</el-button>-->
</div>
<el-col style="margin-left: 7px;width: 158px">
<!-- <el-card>-->
<div style="margin-top: 10px">
<el-table :data="tableData4" :header-cell-style="{background: '#2283D4',color: 'white'}" highlight-current-row border size="mini" style="width: 158px;margin-top: 10px" height="550" @row-click="editProcedure">
<el-table-column :width="setColumnWidth('日期时间')" label="工序" align="center" prop="" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.工艺名称 }}
</template>
</el-table-column>
</el-table>
</div>
</el-col>
<el-col style="width: 971px">
<div style="margin-top: 10px">
<el-table v-loading="loading" :data="tableData5" :header-cell-style="{background: '#19466E',color: 'white'}" highlight-current-row border size="mini" style="width: 971px;margin-top: 10px" height="550" @sort-change="sortChange">
<el-table-column :width="setColumnWidth('序号')" label="序号" align="center" prop="工序" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.工序顺序 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('工序名称')" label="工序名称" align="center" prop="" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.工艺名称 }}
<!-- <el-input v-model="scope.row.工序名称" size="mini" style="margin: 0;width: 100%"/>-->
</template>
</el-table-column>
<el-table-column width="300px" label="工序说明" align="center" prop="" show-overflow-tooltip>
<template slot-scope="scope">
<el-input :disabled="scope.row.加工状态 === 1 || Number(scope.row.是否选进外协单中) === 1" v-model="scope.row.工艺要求" size="mini" style="margin: 0;width: 100%" @change="updateProcess(scope.row)"/>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="180px">
<template slot-scope="scope">
<el-tooltip :open-delay="700" effect="dark" content="下移工序" placement="top">
<el-button :disabled="scope.row.加工状态 === 1 || Number(scope.row.是否选进外协单中) === 1" type="text" icon="el-icon-bottom" size="mini" style="margin-right: 5px" @click="downOne(scope.row)"/>
</el-tooltip>
<el-tooltip :open-delay="700" effect="dark" content="上移工序" placement="top">
<el-button :disabled="scope.row.加工状态 === 1 || Number(scope.row.是否选进外协单中) === 1" type="text" icon="el-icon-top" size="mini" style="margin-right: 5px" @click="upOne(scope.row)"/>
</el-tooltip>
<el-tooltip :open-delay="700" effect="dark" content="插入工序" placement="top">
<el-button :disabled="scope.row.加工状态 === 1 || Number(scope.row.是否选进外协单中) === 1" type="text" icon="el-icon-plus" size="mini" style="margin-right: 5px" @click="insertOne(scope.row)"/>
</el-tooltip>
<el-tooltip :open-delay="700" effect="dark" content="删除工序" placement="top">
<el-button :disabled="scope.row.加工状态 === 1 || Number(scope.row.是否选进外协单中) === 1" type="text" icon="el-icon-minus" size="mini" style="margin-right: 5px" @click="deleteOne(scope.row)"/>
</el-tooltip>
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('日期时间')" label="操作者" align="center" prop="" show-overflow-tooltip>
<template slot-scope="scope">
<el-select :disabled="scope.row.加工状态 === 1 || Number(scope.row.是否选进外协单中) === 1" v-model="scope.row.被派工人员" size="mini" style="margin: 0;width: 100%" placeholder="操作者" filterable clearable @change="updateProcess(scope.row)">
<el-option
v-for="item in people"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</template>
</el-table-column>
<el-table-column label="设备" align="center" prop="" show-overflow-tooltip>
<template slot-scope="scope">
<el-select :disabled="scope.row.加工状态 === 1 || Number(scope.row.是否选进外协单中) === 1" v-model="scope.row.安排设备" size="mini" style="margin: 0;width: 100%" placeholder="设备" filterable clearable @change="updateProcess(scope.row)">
<el-option
v-for="item in machine"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</template>
</el-table-column>
</el-table>
</div>
</el-col>
</el-row>
</el-dialog>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible2" width="1061px">
<div style="width: 100%;display: inline-block">
<span>当前日期{{ dateTime }}</span>
<el-table :data="tableData2" height="558px" highlight-current-row border @sort-change="sortChange1">
<el-table-column width="100px" align="center" label="操作者" sortable="操作者" prop="操作者" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.操作者 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('加工设备')" align="center" label="加工设备" sortable="加工设备" prop="加工设备" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.加工设备 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('工位号')" align="center" label="工位号" sortable="工位号" prop="工位号" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.工位号 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('零件名称')" align="center" label="零件名称" sortable="零件名称" prop="零件名称" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" align="center" label="数量" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.数量 }}
</template>
</el-table-column>
<el-table-column width="60px" align="center" label="序号" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.工序顺序 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('工序')" align="center" label="工序" sortable="工序" prop="工序" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.工序 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('派工日期')" align="center" label="派工日期" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.派工日期 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('完工期限')" align="center" label="完工期限" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.精工期限 }}
</template>
</el-table-column>
<el-table-column align="center" label="已完成数" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.已完成数 }}
</template>
</el-table-column>
</el-table>
</div>
</el-dialog>
<el-dialog :visible.sync="dialogFormVisible1" center width="450px">
<el-form ref="form" :model="form" :rules="rules" label-position="left" class="demo-ruleForm" label-width="120px" style="width: 90%;margin: auto">
<el-form-item label="零件图号" prop="SortValue">
<el-select v-model="form.SortValue" size="small" style="width: 75%" clearable placeholder="零件名称">
<el-option
v-for="item in SortValues"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="数量" prop="production">
<el-input v-model="form.production" size="small" style="width: 75%" clearable placeholder="零件数量"/>
</el-form-item>
<el-row>
<el-col :span="14"/>
<el-form-item >
<!-- <el-button size="small" @click="callOff('form')">取消</el-button>-->
<el-button size="small" type="primary" @click="submit('form')"> </el-button>
</el-form-item>
</el-row>
</el-form>
</el-dialog>
<el-dialog :title="title" :visible.sync="dialogFormVisible3" center width="450px">
<el-form ref="form" :model="form" :rules="rules" label-position="left" class="demo-ruleForm" label-width="120px" style="width: 90%;margin: auto">
<el-form-item label="零件图号" prop="SortValue">
<el-select v-model="form.SortValue" size="small" style="width: 75%" clearable placeholder="零件名称">
<el-option
v-for="item in SortValues"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="数量" prop="production">
<el-input v-model="form.production" size="small" style="width: 75%" clearable placeholder="零件数量"/>
</el-form-item>
<el-row>
<el-col :span="14"/>
<el-form-item >
<!-- <el-button size="small" @click="callOff('form')">取消</el-button>-->
<el-button size="small" type="primary" @click="submit('form')"> </el-button>
</el-form-item>
</el-row>
</el-form>
</el-dialog>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import { getNowShotTime } from '@/utils/tool'
export default {
data() {
return {
process: '', // 工艺计划流水号
orderNumberTypeValue: '', // 订单号
orderNumberType: [], // 订单号数组
productpartNameValue: '', // 产品部件名称
productpartName: [], // 产品部件名称数组
partNameValue: '', // 零件名称
partName: '',
partNumber: '',
finishTime: '', // 计划完成
dateRange: '', // 提交日期
contractStateValue: '', // 合同状态
contractState: [
{
value: 2,
label: '未提交'
}, {
value: 1,
label: '提交'
}
], // 合同状态数组
form: {
SortValue: '',
production: '',
Remarks: ''
},
rules: [],
SortValues: [],
title: '',
machine: [],
machineValue: '',
people: [],
peopleValue: '',
dialogFormVisible2: false,
dialogFormVisible1: false,
dialogFormVisible3: false,
dialogFormVisible4: false, // 工艺
loading: false, // 数据加载
total: 0, // 分页总数
tableData: [], // 合同信息表
tableData2: [],
tableData4: [], // 工艺列表
tableData5: [], // 工艺内容
pageCurrent: 1, // 分页当前页
pageSize: 100, // 分页每页显示条数
orderName: '', // 排序列名
order: '', // 排序方式
orderName1: '', // 排序列名
order1: '', // 排序方式
dateTime: getNowShotTime()
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
updated() {
this.$nextTick(() => {
this.$refs['table'].doLayout()
})
},
created() {
this.searchTable()
this.getOrderNumberType()
this.getMachine()
this.getPeople()
this.getProcess()
},
methods: {
getOrderNumberType() {
var param = []
var Data = this.CreateData('11', '订单信息_列表_查询数据', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.orderNumberType.push({
label: response.data[i].订单编号,
value: response.data[i].订单流水号
})
}
})
},
getproductpartName() {
this.productpartName = []
if (this.orderNumberTypeValue) {
var param = []
param[0] = ['订单流水号', this.orderNumberTypeValue]
var Data = this.CreateData('11', '订单信息_产品信息_查询数据', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.productpartName.push({
label: response.data[i].产品名称,
value: response.data[i].组件流水号
})
}
})
}
},
getMachine() {
var param = []
var Data = this.CreateData('11', '设备信息_查询', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.machine.push({
label: response.data[i].设备名称 !== '外协' ? response.data[i].设备名称 + '_' + response.data[i].工位号 : response.data[i].设备名称,
value: response.data[i].设备流水号
})
}
})
},
getPeople() {
var param = []
param[0] = ['考核部门编号', 19]
var Data = this.CreateData('11', '人事档案管理_人员_部门与人员_查询数据_根据部门编号', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.people.push({
label: response.data[i].姓名,
value: response.data[i].人员编号
})
}
})
},
getProcess() {
var param = []
// 参数数量与名称要与存储过程对应
var Data = this.CreateData('11', '工艺名称_查询', param)
this.ExecDatabase(Data).then(response => {
this.tableData4 = response.data
})
},
searchTable() {
let orderNumberTypeValue_check, productpartNameValue_check, partNameValue_check
this.orderNumberTypeValue ? orderNumberTypeValue_check = 1 : orderNumberTypeValue_check = 0
console.log(this.contractStateValue, 123)
this.productpartNameValue ? productpartNameValue_check = 1 : productpartNameValue_check = 0
this.partNameValue ? partNameValue_check = 1 : partNameValue_check = 0
console.log(this.contractStateValue, 123)
var param = []
param[0] = ['订单流水号', this.orderNumberTypeValue]
param[1] = ['订单流水号_check', orderNumberTypeValue_check]
param[2] = ['组件流水号', this.productpartNameValue]
param[3] = ['组件流水号_check', productpartNameValue_check]
param[4] = ['零件名称_check', partNameValue_check]
param[5] = ['零件名称', this.partNameValue]
param[6] = ['排序名称', this.orderName]
param[7] = ['排序方式', this.order]
// 参数数量与名称要与存储过程对应
var Data = this.CreateData('11', '精工车间_接受任务_查询', param, this.pageSize, this.pageCurrent)
this.ExecDatabase(Data).then(response => {
this.tableData = response.data.rows
this.total = response.data.total
})
},
searchTable1() {
var param = []
param[0] = ['排序名称', this.orderName1]
param[1] = ['排序方式', this.order1]
// 参数数量与名称要与存储过程对应
var Data = this.CreateData('11', '精工车间_工况_查询', param)
this.ExecDatabase(Data).then(response => {
this.tableData2 = response.data
})
},
Urgent(row) {
var param = []
param[0] = ['工艺计划流水号', row.工艺计划流水号]
// 参数数量与名称要与存储过程对应
var Data = this.CreateData('12', '车间生产管理工艺_零件_加急', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('加急成功')
this.searchTable()
} else {
this.$message.error('加急失败')
}
})
},
CancelUrgent(row) {
var param = []
param[0] = ['工艺计划流水号', row.工艺计划流水号]
// 参数数量与名称要与存储过程对应
var Data = this.CreateData('12', '车间生产管理工艺_零件_取消加急', param)
this.ExecDatabase(Data).then(response => {
console.log(response, 123)
if (response.data[0].result === '1') {
this.$message.success('取消成功')
this.searchTable()
} else {
this.$message.error('取消失败')
}
})
},
tableRowClassName({ row, rowIndex }) {
if (Number(row.是否加急) === 1) {
return 'Urgent'
}
},
// 工艺
techNology(row) {
this.loading = true
this.dialogFormVisible4 = true
this.process = row.工艺计划流水号
this.partName = row.零件名称
this.partNumber = row.零件图号
var param = []
param[0] = ['工艺计划流水号', this.process]
// 参数数量与名称要与存储过程对应
var Data = this.CreateData('11', '车间生产管理工艺_零件工序_查询工序信息', param)
this.ExecDatabase(Data).then(response => {
console.log(response, 111)
this.tableData5 = response.data
this.loading = false
})
},
editProcedure(row) {
var param = []
param[0] = ['工艺计划流水号', this.process]
param[1] = ['工艺编号', row.工艺编号]
// 参数数量与名称要与存储过程对应
var Data = this.CreateData('11', '车间生产管理工艺_零件工序_修改数据', param)
this.ExecDatabase(Data).then(response => {
var param1 = []
param1[0] = ['工艺计划流水号', this.process]
var Data1 = this.CreateData('11', '车间生产管理工艺_零件工序_查询工序信息', param1)
this.ExecDatabase(Data1).then(response => {
this.tableData5 = response.data
})
})
},
sortChange(column) {
console.log(column)
if (column.prop === '零件名称') {
this.orderName = 1
} else if (column.prop === '订单编号') {
this.orderName = 2
} else {
this.orderName = 0
}
if (column.order === 'ascending') {
this.order = 1
} else if (column.order === 'descending') { this.order = 2 } else {
this.order = ''
}
this.searchTable()
},
sortChange1(column) {
if (column.prop === '零件名称') {
this.orderName1 = 1
} else if (column.prop === '工序') {
this.orderName1 = 2
} else if (column.prop === '操作者') {
this.orderName1 = 3
} else if (column.prop === '加工设备') {
this.orderName1 = 4
} else if (column.prop === '工位号') {
this.orderName1 = 5
} else {
this.orderName1 = 0
}
if (column.order === 'ascending') {
this.order1 = 1
} else if (column.order === 'descending') { this.order1 = 2 } else {
this.order1 = ''
}
this.searchTable1()
},
updateProcess(row) {
var param = []
param[0] = ['工序流水号', row.工序流水号]
param[1] = ['工艺要求', row.工艺要求]
param[2] = ['人员编号', row.被派工人员]
param[3] = ['设备流水号', row.安排设备]
// 参数数量与名称要与存储过程对应
var Data = this.CreateData('12', '车间生产管理工艺_零件工序_编辑及派工', param)
this.ExecDatabase(Data)
},
insertOne(row) { // 插入行
var param = []
param[0] = ['工艺计划流水号', this.process]
param[1] = ['工序流水号', row.工序流水号]
// 参数数量与名称要与存储过程对应
var Data = this.CreateData('12', '车间生产管理工艺_零件工序_插入工序', param)
this.ExecDatabase(Data)
},
deleteOne(row) { // 删除行
var param = []
param[0] = ['工艺计划流水号', this.process]
param[1] = ['工序流水号', row.工序流水号]
// 参数数量与名称要与存储过程对应
var Data = this.CreateData('11', '车间生产管理工艺_零件工序_删除工序', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].结果 === '成功') {
var param1 = []
param1[0] = ['工艺计划流水号', this.process]
// 参数数量与名称要与存储过程对应
var Data1 = this.CreateData('11', '车间生产管理工艺_零件工序_查询工序信息', param1)
this.ExecDatabase(Data1).then(response => {
this.tableData5 = response.data
})
} else {
this.$message.error('此工序已加工,无法删除')
}
})
},
upOne(row) { // 上移
var param = []
param[0] = ['工艺计划流水号', this.process]
param[1] = ['工序流水号', row.工序流水号]
// 参数数量与名称要与存储过程对应
var Data = this.CreateData('12', '车间生产管理工艺_零件工序_上移工序', param)
this.ExecDatabase(Data).then(response => {
var param1 = []
param1[0] = ['工艺计划流水号', this.process]
// 参数数量与名称要与存储过程对应
var Data1 = this.CreateData('11', '车间生产管理工艺_零件工序_查询工序信息', param1)
this.ExecDatabase(Data1).then(response => {
this.tableData5 = response.data
})
})
},
downOne(row) { // 下移
var param = []
param[0] = ['工艺计划流水号', this.process]
param[1] = ['工序流水号', row.工序流水号]
// 参数数量与名称要与存储过程对应
var Data = this.CreateData('12', '车间生产管理工艺_零件工序_下移工序', param)
this.ExecDatabase(Data).then(response => {
var param1 = []
param1[0] = ['工艺计划流水号', this.process]
// 参数数量与名称要与存储过程对应
var Data1 = this.CreateData('11', '车间生产管理工艺_零件工序_查询工序信息', param1)
this.ExecDatabase(Data1).then(response => {
this.tableData5 = response.data
})
})
},
preservation() {
if (this.finishTime) {
var param = []
param[0] = ['工艺计划流水号', this.process]
// 参数数量与名称要与存储过程对应
var Data = this.CreateData('11', '车间生产管理工艺_零件工序_是否全部填充', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].结果 === 3) {
var param = []
param[0] = ['工艺计划流水号', this.process]
param[1] = ['人员编号', this.id]
param[2] = ['计划完成', this.finishTime]
// 参数数量与名称要与存储过程对应
var Data = this.CreateData('12', '精工车间_工艺保存_派工', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('保存成功')
this.dialogFormVisible4 = false
}
})
} else {
this.$message.warning('有工序未分配或工序为空')
}
})
} else {
this.$message.warning('请选择计划完成时间')
}
},
// 增加
insertOrder() {
this.title = '插图'
if (this.$refs['form'] !== undefined) {
this.$refs['form'].resetFields()
}
this.title = '增加'
this.dialogFormVisible1 = true
this.SortValues = []
this.getSort()
},
// 对外
externalProcessing() {
this.title = '插图'
if (this.$refs['form'] !== undefined) {
this.$refs['form'].resetFields()
}
this.title = '增加'
this.dialogFormVisible3 = true
this.SortValues = []
this.getSort()
},
// 增加确定
submit(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
var param = []
param[0] = ['产品类别代码', this.form.SortValue]
param[1] = ['企业代码', this.id]
param[2] = ['产品名称', this.form.production]
param[3] = ['备注', this.form.Remarks]
var Data = this.CreateData('11', '基础数据_产品_产品类别_增加', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].结果 === 1) {
this.$message({
message: '信息增加成功',
type: 'success'
})
this.searchTable()
} else {
this.$message.error('信息增加失败')
}
})
this.dialogFormVisible = false
} else {
return false
}
})
},
// 增加取消
callOff(formName) {
this.dialogFormVisible = false
this.$refs[formName].resetFields()
},
handleSizeChanges(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable()
},
categoryMaintenance() {
this.dialogFormVisible2 = true
this.searchTable1()
},
handleCurrentChanges(val) {
this.pageCurrent = val
this.searchTable()
}
}
}
</script>
<style scoped>
.el-form--label-left >>> .el-form-item__label {
text-align: right;
}
>>>.el-dialog--center .el-dialog__body {
text-align: initial;
padding: 20px 30px 20px
}
>>>.el-dialog__header {
padding: 20px 20px 0px;
}
>>>.el-dialog__footer {
padding: 0px 20px 20px;
/*text-align: right;*/
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
>>>.el-form-item {
margin-bottom: 13px;
}
</style>
<style>
.el-table .Urgent {
background: #ff7575 !important;
}
</style>

View File

@@ -0,0 +1,457 @@
<template>
<div class="app-container">
<el-card style="height: 850px">
<div style="margin-top: 7px; margin-bottom: 7px">
<el-date-picker
v-model="monthValue"
style="width: 150px"
type="month"
size="small"
value-format="yyyy-M"
placeholder="选择月"/>
<el-input v-model="orderNumberTypeValue" style="width:200px;margin-left: 10px" placeholder="订单号" size="small" clearable/>
<el-input v-model="partNameValue" style="width:150px;margin-left: 10px" placeholder="零件名称或图号" size="small" clearable/>
<el-input v-model="procedureValue" style="width:150px;margin-left: 10px" placeholder="工序名称" size="small" clearable/>
<el-input v-model="machine" style="width:150px;margin-left: 10px" placeholder="设备" size="small" clearable/>
<el-button icon="el-icon-search" type="primary" plain size="small" style="margin-left: 10px" @click="pageCurrent = 1;pageSize = 20;searchTable1()">查询</el-button>
<el-row style="float: right;width: 100px;margin-right: 300px;font-size: 12px"><el-col :span="12"><span>注释</span></el-col><el-col :span="12"><span>计划数</span><br><span>完成数</span><br><span>操作者</span></el-col></el-row>
</div>
<el-table :data="tableData2" height="750px" style="width: 1680px" size="mini" highlight-current-row border @cell-dblclick="dbSelected">
<el-table-column width="140px" align="center" label="订单号" show-overflow-tooltip fixed>
<template slot-scope="scope">
{{ scope.row.订单号 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('零件名称')" align="center" label="零件名称" show-overflow-tooltip fixed>
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('图号')" align="center" label="图号" show-overflow-tooltip fixed>
<template slot-scope="scope">
{{ scope.row.零件图号 }}
</template>
</el-table-column>
<el-table-column width="50px" align="center" label="序号" show-overflow-tooltip fixed>
<template slot-scope="scope">
{{ scope.row.工序顺序 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" align="center" label="工序名称" show-overflow-tooltip fixed>
<template slot-scope="scope">
{{ scope.row.工序 }}
</template>
</el-table-column>
<el-table-column width="130px" align="center" label="设备" show-overflow-tooltip fixed>
<template slot-scope="scope">
{{ scope.row.设备 }}
</template>
</el-table-column>
<el-table-column width="70px" align="center" label="订单数" show-overflow-tooltip fixed>
<template slot-scope="scope">
{{ scope.row.订单数 }}
</template>
</el-table-column>
<el-table-column width="70px" align="center" label="计划数" show-overflow-tooltip fixed>
<template slot-scope="scope">
{{ scope.row.计划数 }}
</template>
</el-table-column>
<el-table-column width="80px" align="center" label="剩余计划" show-overflow-tooltip fixed>
<template slot-scope="scope">
{{ scope.row.剩余数 }}
</template>
</el-table-column>
<el-table-column width="100px" align="center" label="计划开始时间" show-overflow-tooltip fixed>
<template slot-scope="scope">
{{ scope.row.计划开始日期 }}
</template>
</el-table-column>
<el-table-column width="100px" align="center" label="计划完成时间" show-overflow-tooltip fixed>
<template slot-scope="scope">
{{ scope.row.计划完成日期 }}
</template>
</el-table-column>
<el-table-column width="65px" align="center" label="1" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.计划1 }}<br>{{ scope.row.完成1 }}<br>{{ scope.row.操作者1 }}
</template>
</el-table-column>
<el-table-column width="65px" align="center" label="2" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.计划2 }}<br>{{ scope.row.完成2 }}<br>{{ scope.row.操作者2 }}
</template>
</el-table-column>
<el-table-column width="65px" align="center" label="3" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.计划3 }}<br>{{ scope.row.完成3 }}<br>{{ scope.row.操作者3 }}
</template>
</el-table-column>
<el-table-column width="65px" align="center" label="4" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.计划4 }}<br>{{ scope.row.完成4 }}<br>{{ scope.row.操作者4 }}
</template>
</el-table-column>
<el-table-column width="65px" align="center" label="5" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.计划5 }}<br>{{ scope.row.完成5 }}<br>{{ scope.row.操作者5 }}
</template>
</el-table-column>
<el-table-column width="65px" align="center" label="6" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.计划6 }}<br>{{ scope.row.完成6 }}<br>{{ scope.row.操作者6 }}
</template>
</el-table-column>
<el-table-column width="65px" align="center" label="7" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.计划7 }}<br>{{ scope.row.完成7 }}<br>{{ scope.row.操作者7 }}
</template>
</el-table-column>
<el-table-column width="65px" align="center" label="8" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.计划8 }}<br>{{ scope.row.完成8 }}<br>{{ scope.row.操作者8 }}
</template>
</el-table-column>
<el-table-column width="65px" align="center" label="9" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.计划9 }}<br>{{ scope.row.完成9 }}<br>{{ scope.row.操作者9 }}
</template>
</el-table-column>
<el-table-column width="65px" align="center" label="10" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.计划10 }}<br>{{ scope.row.完成10 }}<br>{{ scope.row.操作者10 }}
</template>
</el-table-column>
<el-table-column width="65px" align="center" label="11" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.计划11 }}<br>{{ scope.row.完成11 }}<br>{{ scope.row.操作者11 }}
</template>
</el-table-column>
<el-table-column width="65px" align="center" label="12" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.计划12 }}<br>{{ scope.row.完成12 }}<br>{{ scope.row.操作者12 }}
</template>
</el-table-column>
<el-table-column width="65px" align="center" label="13" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.计划13 }}<br>{{ scope.row.完成13 }}<br>{{ scope.row.操作者13 }}
</template>
</el-table-column>
<el-table-column width="65px" align="center" label="14" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.计划14 }}<br>{{ scope.row.完成14 }}<br>{{ scope.row.操作者14 }}
</template>
</el-table-column>
<el-table-column width="65px" align="center" label="15" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.计划15 }}<br>{{ scope.row.完成15 }}<br>{{ scope.row.操作者15 }}
</template>
</el-table-column>
<el-table-column width="65px" align="center" label="16" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.计划16 }}<br>{{ scope.row.完成16 }}<br>{{ scope.row.操作者16 }}
</template>
</el-table-column>
<el-table-column width="65px" align="center" label="17" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.计划17 }}<br>{{ scope.row.完成17 }}<br>{{ scope.row.操作者17 }}
</template>
</el-table-column>
<el-table-column width="65px" align="center" label="18" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.计划18 }}<br>{{ scope.row.完成18 }}<br>{{ scope.row.操作者18 }}
</template>
</el-table-column>
<el-table-column width="65px" align="center" label="19" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.计划19 }}<br>{{ scope.row.完成19 }}<br>{{ scope.row.操作者19 }}
</template>
</el-table-column>
<el-table-column width="65px" align="center" label="20" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.计划20 }}<br>{{ scope.row.完成20 }}<br>{{ scope.row.操作者20 }}
</template>
</el-table-column>
<el-table-column width="65px" align="center" label="21" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.计划21 }}<br>{{ scope.row.完成21 }}<br>{{ scope.row.操作者21 }}
</template>
</el-table-column>
<el-table-column width="65px" align="center" label="22" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.计划22 }}<br>{{ scope.row.完成22 }}<br>{{ scope.row.操作者22 }}
</template>
</el-table-column>
<el-table-column width="65px" align="center" label="23" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.计划23 }}<br>{{ scope.row.完成23 }}<br>{{ scope.row.操作者23 }}
</template>
</el-table-column>
<el-table-column width="65px" align="center" label="24" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.计划24 }}<br>{{ scope.row.完成24 }}<br>{{ scope.row.操作者24 }}
</template>
</el-table-column>
<el-table-column width="65px" align="center" label="25" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.计划25 }}<br>{{ scope.row.完成25 }}<br>{{ scope.row.操作者25 }}
</template>
</el-table-column>
<el-table-column width="65px" align="center" label="26" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.计划26 }}<br>{{ scope.row.完成26 }}<br>{{ scope.row.操作者26 }}
</template>
</el-table-column>
<el-table-column width="65px" align="center" label="27" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.计划27 }}<br>{{ scope.row.完成27 }}<br>{{ scope.row.操作者27 }}
</template>
</el-table-column>
<el-table-column width="65px" align="center" label="28" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.计划28 }}<br>{{ scope.row.完成28 }}<br>{{ scope.row.操作者28 }}
</template>
</el-table-column>
<el-table-column width="65px" align="center" label="29" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.计划29 }}<br>{{ scope.row.完成29 }}<br>{{ scope.row.操作者29 }}
</template>
</el-table-column>
<el-table-column width="65px" align="center" label="30" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.计划30 }}<br>{{ scope.row.完成30 }}<br>{{ scope.row.操作者30 }}
</template>
</el-table-column>
<el-table-column width="65px" align="center" label="31" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.计划31 }}<br>{{ scope.row.完成31 }}<br>{{ scope.row.操作者31 }}
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40, 100]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChanges"
@current-change="handleCurrentChanges"/>
</div>
</el-card>
<el-dialog v-el-drag-dialog :visible.sync="dialog" title="修改" center width="400px">
<el-form ref="form" :model="form" label-position="center" label-width="110px" class="demo-ruleForm">
<el-row>
<el-col :span="12">
<el-form-item label="计划数">
<el-input-number
v-model="form.计划数"
:min="0"
:step="1"
size="small"
style="width:200px"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="callOff()">取消</el-button>
<el-button type="primary" size="small" @click="submit()">确定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import { getNowShotTime } from '@/utils/tool'
export default {
data() {
return {
form: {
计划数: ''
},
process: '', // 工艺计划流水号
procedureValue: '',
machine: '',
month: [],
monthValue: '',
dialog: false,
numberValue: '',
columnName: '',
orderNumberTypeValue: '', // 操作者
orderNumberType: [], // 操作者数组
productpartNameValue: '', // 产品部件名称
productpartName: [], // 产品部件名称数组
partNameValue: '', // 零件名称
people: [],
peopleValue: '',
loading: false, // 数据加载
total: 0, // 分页总数
tableData2: [],
pageCurrent: 1, // 分页当前页
pageSize: 20, // 分页每页显示条数
orderName: '', // 排序列名
order: '', // 排序方式
orderName1: '', // 排序列名
order1: '', // 排序方式
dateRange: '', // 派工日期
dateTime: getNowShotTime()
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
// updated() {
// this.$nextTick(() => {
// this.$refs['table'].doLayout()
// })
// },
created() {
this.getNowMonth()
this.getPeople()
this.searchTable1()
},
methods: {
dbSelected(row, column, cell) {
console.log(row, column, cell)
if (column.label === '1' || column.label === '2' || column.label === '3' || column.label === '4' || column.label === '5' || column.label === '6' || column.label === '7' || column.label === '8' || column.label === '9' ||
column.label === '10' || column.label === '11' || column.label === '12' || column.label === '13' || column.label === '14' || column.label === '15' || column.label === '16' || column.label === '17' || column.label === '18' ||
column.label === '19' || column.label === '20' || column.label === '21' || column.label === '22' || column.label === '23' || column.label === '24' || column.label === '25' || column.label === '26' || column.label === '27' ||
column.label === '28' || column.label === '29' || column.label === '30' || column.label === '31') {
this.columnName = '计划' + column.label
this.form.计划数 = row[`计划${column.label}`]
this.numberValue = row.工艺任务明细流水号
this.dialog = true
}
},
submit() {
var param = []
param[0] = ['工艺任务明细流水号', this.numberValue]
param[1] = ['列名', this.columnName]
param[2] = ['计划数', this.form.计划数]
var Data = this.CreateData('12', '车间生产管理_生产计划_修改数据', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('修改完成')
this.searchTable1()
this.dialog = false
} else {
this.$message.error('修改失败')
}
})
},
callOff() {
this.dialog = false
},
getNowMonth() {
const nowDate = new Date()
const date = {
year: nowDate.getFullYear(),
month: nowDate.getMonth() + 1
}
this.monthValue = date.year + '-' + date.month
},
getPeople() {
var param = []
param[0] = ['考核部门编号', 19]
var Data = this.CreateData('11', '人事档案管理_人员_部门与人员_查询数据_根据部门编号', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.people.push({
label: response.data[i].姓名,
value: response.data[i].人员编号
})
}
})
},
searchTable1() {
if (this.monthValue) {
let orderNumberTypeValue_check, procedureValue_check, partNameValue_check, machine_check
this.orderNumberTypeValue ? orderNumberTypeValue_check = 1 : orderNumberTypeValue_check = 0
this.procedureValue ? procedureValue_check = 1 : procedureValue_check = 0
this.partNameValue ? partNameValue_check = 1 : partNameValue_check = 0
this.machine ? machine_check = 1 : machine_check = 0
var param = []
param[0] = ['合同编号', this.orderNumberTypeValue]
param[1] = ['合同编号_check', orderNumberTypeValue_check]
param[2] = ['设备', this.machine]
param[3] = ['设备_check', machine_check]
param[4] = ['零件名称_check', partNameValue_check]
param[5] = ['零件名称', this.partNameValue]
param[6] = ['工序名称_check', procedureValue_check]
param[7] = ['工序名称', this.procedureValue]
param[8] = ['月份', this.monthValue]
var Data = this.CreateData('11', '车间生产管理_生产计划_查询数据', param, this.pageSize, this.pageCurrent)
this.ExecDatabase(Data).then(response => {
this.tableData2 = response.data.rows
this.total = response.data.total
})
} else {
this.$message.warning('月份不能为空')
}
},
sortChange1(column) {
if (column.prop === '零件名称') {
this.orderName1 = 1
} else if (column.prop === '工序') {
this.orderName1 = 2
} else if (column.prop === '姓名') {
this.orderName1 = 3
} else if (column.prop === '设备') {
this.orderName1 = 4
} else {
this.orderName1 = 0
}
if (column.order === 'ascending') {
this.order1 = 1
} else if (column.order === 'descending') { this.order1 = 2 } else {
this.order1 = ''
this.orderName1 = 0
}
this.searchTable1()
},
handleSizeChanges(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable1()
},
handleCurrentChanges(val) {
this.pageCurrent = val
this.searchTable1()
}
}
}
</script>
<style scoped>
.el-form--label-left >>> .el-form-item__label {
text-align: right;
}
>>>.el-dialog--center .el-dialog__body {
text-align: initial;
padding: 20px 30px 20px
}
>>>.el-dialog__header {
padding: 20px 20px 0px;
}
>>>.el-dialog__footer {
padding: 0px 20px 20px;
/*text-align: right;*/
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
>>>.el-form-item {
margin-bottom: 13px;
}
>>> .el-table__fixed {
height: calc(100% - 18px) !important;
}
</style>
<style>
.el-table .Urgent {
background: #ff7575 !important;
}
</style>

View File

@@ -0,0 +1,646 @@
<template>
<div class="app-container">
<el-card>
<div style="margin-top: 7px; margin-bottom: 7px">
<span style="font-size: 13px;color: black">投产日期</span>
<el-date-picker
v-model="dateRange"
size="small"
type="daterange"
align="center"
style="width: 240px;"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
@change="searchTable"/>
<el-select v-model="orderNameValue" style="width:200px;margin-right: 0px" placeholder="订单号" size="small" filterable clearable @change="searchTable();getProductName()">
<el-option
v-for="item in orderName1"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-select v-model="productNameValue" style="width:200px;margin-right: 0px" placeholder="产品/部件名称" size="small" filterable clearable @change="searchTable">
<el-option
v-for="item in productName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-input v-model="partNameValue" style="width: 150px" size="small" clearable placeholder="零件名称" @keyup.enter.native="searchTable()"/>
<el-input v-model="drawingNo" style="width: 150px" size="small" clearable placeholder="图号" @keyup.enter.native="searchTable()"/>
<el-select v-model="productionStatusValue" style="width:100px" placeholder="状态" size="small" filterable clearable @change="searchTable">
<el-option
v-for="item in productionStatus"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</div>
<el-table
v-loading="loading"
ref="table"
:data="tableData"
:row-class-name="tableRowClassName"
highlight-current-row
show-summary
border
stripe
size="small"
style="width: 1610px"
height="750px"
@sort-change="sortChange">
<el-table-column :width="setColumnWidth('状态')" label="状态" align="center" prop="状态" sortable="状态" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.状态新 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('零件名称')" label="零件名称" align="center" prop="零件名称" sortable="零件名称" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column width="143px" label="图号" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.零件图号 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" label="数量" prop="批次数量" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.批次数量 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" label="报废数量" prop="报废数量" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.报废数量 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" label="补投数" prop="补投数量" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.补投数量 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('订单编号')" label="订单编号" align="center" prop="订单号" sortable="订单号" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.订单号 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('姓名')" label="收货人" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.收货人员 }}
</template>
</el-table-column>
<el-table-column label="订单备注" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.订单备注 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('产品名称')" label="产品/部件" align="center" prop="产品名称" sortable="产品名称" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.产品名称 }}
</template>
</el-table-column>
<el-table-column width="99px" label="完成日期" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.结束加工 }}
</template>
</el-table-column>
<el-table-column width="99px" label="完成期限" align="center" prop="精工" sortable="精工" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.精工期限 }}
</template>
</el-table-column>
<el-table-column width="99px" label="投产日期" align="center" prop="投产日期" sortable="投产日期" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.投产日期 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="240px">
<template slot-scope="scope">
<el-tooltip :open-delay="500" effect="dark" content="查看客户提供资料" placement="top">
<el-button :disabled="scope.row.客户提供资料 === '0'" type="text" icon="el-icon-picture-outline" size="mini" @click="ContractPhoto(scope.row)"/>
</el-tooltip>
<el-tooltip :open-delay="700" effect="dark" content="图纸" placement="top">
<el-button :disabled="scope.row.图纸 === null" type="text" icon="el-icon-search" size="mini" @click="getNum(scope.row)">图纸</el-button>
</el-tooltip>
<el-button :disabled="scope.row.状态新 === '未开始'" type="text" size="mini" style="margin-right: 0px" @click="partTraceability(scope.row)">零件追溯</el-button>
<el-button :disabled="Number(scope.row.订单类型)!==3" type="text" size="mini" style="margin-right: 0px" @click="partReturn(scope.row)">打回</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40, 100]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChanges"
@current-change="handleCurrentChanges"/>
</div>
</el-card>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible1" center width="1161px">
<el-table v-loading="loading" :data="tableData1" :row-class-name="tableRowClassName1" highlight-current-row border size="small" style="width: 1141px;">
<el-table-column :width="setColumnWidth('序号')" label="序号" align="center" prop="序号">
<template slot-scope="scope">
{{ scope.row.序号 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('工序')" label="工序" align="center" prop="工序">
<template slot-scope="scope">
{{ scope.row.工序 }}
</template>
</el-table-column>
<el-table-column width="70px" label="分配数" align="center">
<template slot-scope="scope">
{{ scope.row.分配数量 }}
</template>
</el-table-column>
<el-table-column width="135px" label="派工日期" align="center">
<template slot-scope="scope">
{{ scope.row.分配时间 }}
</template>
</el-table-column>
<el-table-column width="69px" label="完成数" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.完成数 }}
</template>
</el-table-column>
<el-table-column width="69px" label="质检数" align="center">
<template slot-scope="scope">
{{ scope.row.检测数 }}
</template>
</el-table-column>
<el-table-column width="69px" label="不良数" align="center">
<template slot-scope="scope">
{{ scope.row.不良数 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('姓名')" 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 width="135px" label="开始加工" align="center">
<template slot-scope="scope">
{{ scope.row.开始加工 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('日期时间')" label="完成时间" align="center">
<template slot-scope="scope">
{{ scope.row.完成时间 }}
</template>
</el-table-column>
<el-table-column width="110px" label="加工工时M" align="center">
<template slot-scope="scope">
{{ scope.row.扫码工时 }}
</template>
</el-table-column>
</el-table>
</el-dialog>
<el-dialog v-el-drag-dialog :visible.sync="dialogVisible" width="350px">
<div v-for="(file, key) in hadFile" :key="key">
<div class="wrapper">
<div class="content">
<div v-if="file.suffix==='pdf'" class="icon"><svg-icon icon-class="pdf" /></div>
<div v-else-if="file.suffix==='docx'||file.suffix === 'doc'" class="icon"><svg-icon icon-class="doc" /></div>
<div v-else-if="file.suffix==='xlsx' || file.suffix === 'xls'" class="icon"><svg-icon icon-class="excel" /></div>
<div v-else-if="file.suffix==='pptx' || file.suffix === 'ppt'" class="icon"><svg-icon icon-class="ppt" /></div>
<div v-else-if="file.suffix==='jpg' || file.suffix === 'jpeg'|| file.suffix === 'png'" class="icon"><svg-icon icon-class="pic" /></div>
<div v-else class="icon"><svg-icon icon-class="file" /></div>
<a id="appUrl" :href="file.url" target="view_window"><div class="info">{{ file.name }}</div></a>
</div>
</div>
</div>
</el-dialog>
<el-dialog
v-el-drag-dialog
:visible.sync="dialogVisibleCustomerInformation"
:center="dialogName"
title="客户提供资料"
width="20%">
<div v-for="(file, key) in hadFile1" :key="key">
<div class="wrapper">
<div class="content">
<div v-if="file.suffix==='pdf'" class="icon"><svg-icon icon-class="pdf" /></div>
<div v-else-if="file.suffix==='docx'||file.suffix === 'doc'" class="icon"><svg-icon icon-class="doc" /></div>
<div v-else-if="file.suffix==='xlsx' || file.suffix === 'xls'" class="icon"><svg-icon icon-class="excel" /></div>
<div v-else-if="file.suffix==='pptx' || file.suffix === 'ppt'" class="icon"><svg-icon icon-class="ppt" /></div>
<div v-else-if="file.suffix==='jpg' || file.suffix === 'jpeg'|| file.suffix === 'png'" class="icon"><svg-icon icon-class="pic" /></div>
<div v-else class="icon"><svg-icon icon-class="file" /></div>
<a id="appUrl1" :href="file.url" target="view_window"><div class="info">{{ file.name }}</div></a>
</div>
</div>
</div>
</el-dialog>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisibleReturn" title="打回" center width="390px">
<el-form ref="form" :model="form" label-position="left" label-width="100px" class="demo-ruleForm" style="margin: auto">
<el-row>
<el-form-item label="打回原因:">
<el-input v-model="form.打回原因" type="textarea" clearable size="small" style="width:200px" placeholder="请输入"/>
</el-form-item>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogFormVisibleReturn=false">取消</el-button>
<el-button type="distribution" size="small" @click="submit()"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import request, { MESDownloadFile } from '@/utils/request'
export default {
data() {
return {
form: {
打回原因: ''
},
drawingNo: '',
returnReason: '',
dialogName: true,
dialogVisibleCustomerInformation: false,
dialogFormVisibleReturn: false,
hadFile1: [],
// 查看客户资料
productionStatusValue: '', // 产品状态
productionStatus: [{
value: '未开始',
label: '未开始'
}, {
value: '工艺完成',
label: '工艺完成'
}, {
value: '加工中',
label: '加工中'
}, {
value: '完成',
label: '完成'
}, {
value: '入库',
label: '入库'
}], // 产品状态数组
dateRange: '', // 提交日期
contractStateValue: '', // 合同状态
hadFile: [],
dialogVisible: false,
dialogFormVisible1: false, // 零件追溯
partNameValue: '', // 零件名称
productNameValue: '', // 产品部件名称
productName: [],
orderNameValue: '', // 订单名称
orderName1: [],
contractState: [
{
value: 2,
label: '未提交'
}, {
value: 1,
label: '提交'
}
], // 合同状态数组
orderNumber: '',
partName: '',
partTool: '',
partNumber: '',
partId: '',
loading: false, // 数据加载
total: 0, // 分页总数
tableData: [], // 合同信息表
tableData1: [], // 零件追溯
pageCurrent: 1, // 分页当前页
pageSize: 100, // 分页每页显示条数
orderName: '', // 排序列名
order: '' // 排序方式
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
updated() {
this.$nextTick(() => {
this.$refs['table'].doLayout()
})
},
created() {
this.fetchData()
// this.getProductionStatus()
},
methods: {
partReturn(row) {
this.form.打回原因 = ''
this.orderNumber = row.订单号
this.partName = row.零件名称
this.partTool = row.零件图号
this.partNumber = row.批次数量
this.partId = row.基本件流水号
this.dialogFormVisibleReturn = true
},
submit() {
if (this.form.打回原因) {
var param = []
param[0] = ['订单编号', this.orderNumber]
param[1] = ['名称', this.partName]
param[2] = ['图号或型号', this.partTool]
param[3] = ['补货数量', this.partNumber]
param[4] = ['打回原因', this.form.打回原因]
param[5] = ['打回人', this.id]
param[6] = ['流水号', this.partId]
param[7] = ['打回部门', 1]
var Data = this.CreateData('11', '仓储管理_补货订单打回', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('打回成功')
this.dialogFormVisibleReturn = false
this.searchTable()
} else {
this.$message.error('打回失败')
}
})
} else {
this.$message.warning('请填写打回原因')
}
},
sortChange(column) {
if (column.prop === '状态') {
this.orderName = 1
} else if (column.prop === '零件名称') {
this.orderName = 2
} else if (column.prop === '订单号') {
this.orderName = 3
} else if (column.prop === '产品名称') {
this.orderName = 4
} else if (column.prop === '精工') {
this.orderName = 5
} else if (column.prop === '投产日期') {
this.orderName = 6
} else {
this.orderName = 0
}
if (column.order === 'ascending') {
this.order = 1
} else if (column.order === 'descending') { this.order = 2 } else {
this.order = ''
}
this.searchTable()
},
ContractPhoto(row) {
this.hadFile1 = []
var param = []
param[0] = ['项目流水号', row.项目流水号]
var Data = this.CreateData('11', 'PDM_项目名称_客户提供资料_查询数据', param)
this.ExecDatabase(Data).then(res => {
this.suffix = res.data
if (res.data.length > 0) {
const server = `${MESDownloadFile}`.split('/')
res.data.map(item => {
this.hadFile1.push({
url: `http://${server[2]}/webpage/part/${item.uid}.${item.suffix}`,
name: `${item.name}.${item.suffix}`,
suffix: item.suffix,
id: item.num
})
})
}
})
this.dialogVisibleCustomerInformation = true
},
fetchData() {
this.getOrderName()
this.searchTable()
},
getOrderName() {
var param = []
var Data = this.CreateData('11', '生产任务查询_订单信息_列表_查询数据', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.orderName1.push({
label: response.data[i].订单编号,
value: response.data[i].订单流水号
})
}
})
},
getProductName() {
this.productNameValue = ''
this.productName = []
if (this.orderNameValue) {
var param = []
param[0] = ['订单流水号', this.orderNameValue]
var Data = this.CreateData('11', '订单信息_产品信息_查询数据', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.productName.push({
label: response.data[i].产品名称,
value: response.data[i].组件流水号
})
}
})
}
},
// getProductionStatus() {
// var param = []
// var Data = this.CreateData('11', '零件状态_查询数据', param)
// this.ExecDatabase(Data).then(response => {
// console.log(response, 123234)
// for (let i = 0; i < response.data.length; i++) {
// this.productionStatus.push({
// label: response.data[i].考核状态,
// value: response.data[i].考核状态流水号
// })
// }
// })
// },
// 查看零件图
getNum(row) {
this.dialogVisible = true
this.getFileList(row.零件图号)
},
async getFileList(value) {
this.hadFile = []
if (value) {
await request({
url: '',
method: 'post',
data: {
type: '3',
name: `select * from 机加工MES_零件图PDF表 where 是否启用 = 1 and name = '${value}'`
}
}).then(data => {
this.suffix = data.data
if (data.data.length > 0) {
const server = `${MESDownloadFile}`.split('/')
data.data.map(item => {
this.hadFile.push({
url: `http://${server[2]}/webpage/part/${item.uid}.${item.suffix}`,
name: `${item.name}.${item.suffix}`,
suffix: item.suffix,
id: item.uid
})
})
}
})
}
},
searchTable() {
let orderNameValue_check, dateRange_check, productNameValue_check, productionStatusValue_check, partNameValue_check, drawingNo_check
this.orderNameValue ? orderNameValue_check = 1 : orderNameValue_check = 0
this.dateRange ? dateRange_check = 1 : (dateRange_check = 0, this.dateRange = '')
console.log(this.contractStateValue, 123)
this.productNameValue ? productNameValue_check = 1 : productNameValue_check = 0
this.drawingNo ? drawingNo_check = 1 : drawingNo_check = 0
this.productionStatusValue ? productionStatusValue_check = 1 : productionStatusValue_check = 0
this.partNameValue ? partNameValue_check = 1 : partNameValue_check = 0
var param = []
param[0] = ['时间_check', dateRange_check]
param[1] = ['开始时间', this.dateRange[0]]
param[2] = ['结束时间', this.dateRange[1]]
param[3] = ['订单流水号_check', orderNameValue_check]
param[4] = ['订单流水号', this.orderNameValue]
param[5] = ['组件流水号_check', productNameValue_check]
param[6] = ['组件流水号', this.productNameValue]
param[7] = ['零件名称_check', partNameValue_check]
param[8] = ['零件名称', this.partNameValue]
param[9] = ['状态流水号_check', productionStatusValue_check]
param[10] = ['状态流水号', this.productionStatusValue]
param[11] = ['排序名称', this.orderName]
param[12] = ['排序方式', this.order]
param[13] = ['图号_check', drawingNo_check]
param[14] = ['图号', this.drawingNo]
var Data = this.CreateData('11', '精工车间_生成任务_查询数据', param, this.pageSize, this.pageCurrent)
this.ExecDatabase(Data).then(response => {
this.tableData = response.data.rows
this.total = response.data.total
})
},
// 零件追溯
partTraceability(row) {
var param = []
param[0] = ['工艺计划流水号', row.工艺计划流水号]
var Data = this.CreateData('11', '车间生产管理工艺_追溯加工_查询工序', param)
this.ExecDatabase(Data).then(response => {
this.tableData1 = response.data
this.dialogFormVisible1 = true
})
},
tableRowClassName({ row, rowIndex }) {
if (Number(row.是否为报废补投件) === 1) {
return 'supplementary'
}
},
// 工序状态变色
tableRowClassName1({ row, rowIndex }) {
row.index = rowIndex
if (parseInt(row.工序状态) > 3 || row.加工完成时间 || row.完成状态 === 1) {
return 'CompleteColor'
}
},
handleSizeChanges(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable()
},
handleCurrentChanges(val) {
this.pageCurrent = val
this.searchTable()
}
}
}
</script>
<style scoped lang="scss">
/deep/ .el-table .gray {
background: #bbbbc1 !important;
}
/deep/ .el-table .red {
background: #fff !important;
}
</style>
<style>
.el-table .supplementary {
background: #FFF582!important;
}
.CompleteColor{
background: #d8e5f6 !important;
}
</style>
<style scoped>
.el-form--label-left >>> .el-form-item__label {
text-align: right;
}
>>>.el-dialog--center .el-dialog__body {
text-align: initial;
padding: 20px 30px 20px
}
>>>.el-dialog__header {
padding: 20px 20px 0px;
}
>>>.el-dialog__footer {
padding: 0px 20px 20px;
/*text-align: right;*/
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
>>>.el-form-item {
margin-bottom: 13px;
}
.wrapper{
width: 90%;
height: 50px;
overflow: hidden;
border: 1px solid #b8c7d9;
/*float: left;*/
margin: 10px;
}
.content{
position: relative;
padding: 8px 8px 0 8px;
}
.action{
position: absolute;
top: 2px;
right: 8px;
}
.delete{
padding: 0 5px;
border-radius: 3px;
color: #0f84b0;
font-size: 12px;
}
.delete:hover{
background: -webkit-linear-gradient(top,#0ba9e3,#0099d3);
color: #fff;
}
a{
text-decoration: none;
}
.icon{
width: 30px;
height: 30px;
display: inline-block;
margin-right: 7px;
margin-top: 2px;
font-size: 26px;
}
.info{
width: 160px;
height: 50px;
position: absolute;
left: 44px;
line-height: 30px;
display: inline-block;
color: #999;
}
</style>

View File

@@ -0,0 +1,269 @@
<!--质量信息查询质量信息查询质量信息查询质量信息查询质量信息查询质量信息查询质量信息查询质量信息查询-->
<template>
<div class="app-container">
<el-card style="height: 850px">
<div style="margin-top: 7px">
<!-- <el-select v-model="orderNumberValue" style="width:160px;margin-left: 1px" placeholder="订单号" size="small" filterable clearable>-->
<!-- <el-option-->
<!-- v-for="item in orderNumber"-->
<!-- :key="item.value"-->
<!-- :label="item.label"-->
<!-- :value="item.value"/>-->
<!-- </el-select>-->
<el-input v-model="orderNumberValue" style="width:150px" placeholder="订单编号" size="small" filterable clearable @keyup.enter.native="searchTable()"/>
<el-input v-model="purchaseNumberValue" style="width:150px;margin-left: 10px" placeholder="采购合同编号" size="small" filterable clearable @keyup.enter.native="searchTable()"/>
<el-select v-model="qualityInspectionResultsValue" style="width:100px;margin-left: 10px" placeholder="质检结果" size="small" filterable clearable @change="searchTable">
<el-option
v-for="item in qualityInspectionResults"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-select v-model="treatmentResultsValue" style="width:100px;margin-left: 10px" placeholder="处理结果" size="small" filterable clearable @change="searchTable">
<el-option
v-for="item in treatmentResults"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span style="margin-left: 10px">质检时间</span>
<el-date-picker
v-model="dateRange"
size="small"
type="daterange"
align="center"
style="width: 240px;"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
@change="searchTable"/>
<el-button icon="el-icon-search" type="primary" plain size="small" style="margin-left: 10px" @click="searchTable()">查询</el-button>
<el-table
v-loading="loading"
:data="tableData"
show-summary
border
highlight-current-row
size="mini"
height="750px"
style="width: 1301px;margin-top: 7px">
<el-table-column width="130px" label="合同号" align="center">
<template slot-scope="scope">
{{ scope.row.合同号 }}
</template>
</el-table-column>
<el-table-column width="160px" label="采购件" align="center">
<template slot-scope="scope">
{{ scope.row.采购件 }}
</template>
</el-table-column>
<el-table-column width="150px" label="图号或型号" align="center" prop="">
<template slot-scope="scope">
{{ scope.row.图号或型号 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" label="采购数" prop="采购数" align="center">
<template slot-scope="scope">
{{ scope.row.采购数 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" label="到货数" align="center" prop="到货数">
<template slot-scope="scope">
{{ scope.row.到货数 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" label="质检数" prop="数量" align="center">
<template slot-scope="scope">
{{ scope.row.数量 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" label="不良数" prop="不合格数量" align="center">
<template slot-scope="scope">
{{ scope.row.不合格数量 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('交货日期')" label="处理结果" align="center">
<template slot-scope="scope">
{{ scope.row.不合格处理文本 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('订单编号')" label="订单编号" align="center">
<template slot-scope="scope">
{{ scope.row.订单号 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('交货日期')" label="质检时间" align="center" prop="质检" sortable>
<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 width="80px" align="center" label="操作">
<template slot-scope="scope">
<el-button type="text" size="mini" @click="cancelShipment(scope.row)">撤回质检</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40, 100]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChanges"
@current-change="handleCurrentChanges"/>
</div>
</div>
</el-card>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
export default {
data() {
return {
acknowledgingTimeValue: '',
operatorValue: '',
operator: [],
dateRange: '',
qualityInspectionProcessValue: '',
qualityInspectionProcess: [],
treatmentResultsValue: '',
treatmentResults: [],
orderNumberValue: '',
purchaseNumberValue: '',
// orderNumber: [],
workingProcedureValue: '',
workingProcedure: [],
qualityInspectionResultsValue: '',
qualityInspectionResults: [],
form: {
Sort: '',
Remarks: ''
},
form1: {
完成数量: ''
},
rules1: {
完成数量: [{ required: true, message: '请输入完成数量', trigger: 'blur' }]
},
show: false,
show1: false,
loading: false, // 数据加载
total: 0, // 分页总数
tableData: [], // 合同信息表
pageCurrent: 1, // 分页当前页
pageSize: 100, // 分页每页显示条数
orderName: '', // 排序列名
order: '' // 排序方式
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
created() {
this.searchTable()
// this.getCustomer()
this.getQualityInspectionResults()
this.getTreatmentResults()
},
methods: {
cancelShipment(row) {
var param = []
param[0] = ['质检流水号', row.质检流水号]
var Data = this.CreateData('12', '质检信息查询_撤回质检信息', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('撤回质检信息成功')
this.searchTable()
} else {
this.$message.warning('撤回质检信息失败!')
}
})
},
// getCustomer() {
// var param = []
// var Data = this.CreateData('11', '精工_质量信息_订单编号_查询', param)
// this.ExecDatabase(Data).then(response => {
// for (let i = 0; i < response.data.length; i++) {
// this.orderNumber.push({
// label: response.data[i].订单编号,
// value: response.data[i].订单流水号
// })
// }
// })
// },
getQualityInspectionResults() {
var param = []
var Data = this.CreateData('11', '精工_质量信息_质检结果_查询', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.qualityInspectionResults.push({
label: response.data[i].不合格原因文本,
value: response.data[i].不合格原因
})
}
})
},
getTreatmentResults() {
var param = []
var Data = this.CreateData('11', '精工_质量信息_处理结果_查询', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.treatmentResults.push({
label: response.data[i].不合格处理文本,
value: response.data[i].不合格处理
})
}
})
},
searchTable() {
this.tableData = []
let orderNumberValue_check, qualityInspectionResultsValue_check, treatmentResultsValue_check, purchaseNumberValue_check, dateRange_check
this.orderNumberValue ? orderNumberValue_check = 1 : orderNumberValue_check = 0
this.qualityInspectionResultsValue ? qualityInspectionResultsValue_check = 1 : qualityInspectionResultsValue_check = 0
this.treatmentResultsValue ? treatmentResultsValue_check = 1 : treatmentResultsValue_check = 0
this.purchaseNumberValue ? purchaseNumberValue_check = 1 : purchaseNumberValue_check = 0
this.dateRange ? dateRange_check = 1 : (dateRange_check = 0, this.dateRange = '')
const param = []
param[0] = ['订单编号_check', orderNumberValue_check]
param[1] = ['订单编号', this.orderNumberValue]
param[2] = ['质检结果_check', qualityInspectionResultsValue_check]
param[3] = ['质检结果', this.qualityInspectionResultsValue]
param[4] = ['处理结果_check', treatmentResultsValue_check]
param[5] = ['处理结果', this.treatmentResultsValue]
param[6] = ['采购合同_check', purchaseNumberValue_check]
param[7] = ['合同号', this.purchaseNumberValue]
param[8] = ['质检时间_check', dateRange_check]
param[9] = ['开始时间', this.dateRange[0]]
param[10] = ['结束时间', this.dateRange[1]]
var Data = this.CreateData('11', '采购_质量信息_查询', param, this.pageSize, this.pageCurrent)
this.ExecDatabase(Data).then(response => {
this.tableData = response.data.rows
this.total = response.data.total
})
},
handleSizeChanges(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable()
},
handleCurrentChanges(val) {
this.pageCurrent = val
this.searchTable()
}
}
}
</script>

View File

@@ -0,0 +1,454 @@
<!--质量信息查询质量信息查询质量信息查询质量信息查询质量信息查询质量信息查询质量信息查询质量信息查询-->
<template>
<div class="app-container">
<el-card style="height: 850px">
<div style="margin-top: 7px">
<!-- <el-select v-model="orderNumberValue" style="width:160px;margin-left: 1px" placeholder="订单号" size="small" filterable clearable>-->
<!-- <el-option-->
<!-- v-for="item in orderNumber"-->
<!-- :key="item.value"-->
<!-- :label="item.label"-->
<!-- :value="item.value"/>-->
<!-- </el-select>-->
<el-input v-model="orderNumberValue" style="width:150px" placeholder="订单编号" size="small" filterable clearable @keyup.enter.native="searchTable()"/>
<el-input v-model="partName" style="width:150px" placeholder="零件名称" size="small" filterable clearable @keyup.enter.native="searchTable()"/>
<el-input v-model="partOrder" style="width:150px" placeholder="图号" size="small" filterable clearable @keyup.enter.native="searchTable()"/>
<el-select v-model="qualityInspectionResultsValue" style="width:100px;margin-left: 10px" placeholder="质检结果" size="small" filterable clearable>
<el-option
v-for="item in qualityInspectionResults"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-select v-model="treatmentResultsValue" style="width:100px;margin-left: 10px" placeholder="处理结果" size="small" filterable clearable>
<el-option
v-for="item in treatmentResults"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-select v-model="qualityInspectionProcessValue" style="width:100px;margin-left: 10px" placeholder="质检工序" size="small" filterable clearable>
<el-option
v-for="item in workingProcedure"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-select v-model="operatorValue" style="width:100px;margin-left: 10px" placeholder="操作者" size="small" filterable clearable>
<el-option
v-for="(item, index) in operator"
:key="index.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span style="margin-left: 10px">质检时间</span>
<el-date-picker
v-model="dateRange"
size="small"
type="daterange"
align="center"
style="width: 240px;"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
@change="searchTable"/>
<el-button icon="el-icon-search" type="primary" plain size="small" style="margin-left: 10px" @click="searchTable()">查询</el-button>
<el-table
v-loading="loading"
ref="table"
:data="tableData"
:summary-method="getSummaries"
show-summary
border
highlight-current-row
size="mini"
height="750px"
style="width: 1681px;margin-top: 7px"
@sort-change="sortChange">
<el-table-column :width="setColumnWidth('订单编号')" label="订单编号" align="center" prop="订单编号">
<template slot-scope="scope">
{{ scope.row.订单号 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('零件图号')" label="零件名称" align="center" prop="零件名称" sortable>
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('零件图号')" label="图号" align="center" prop="">
<template slot-scope="scope">
{{ scope.row.零件图号 }}
</template>
</el-table-column>
<el-table-column width="65px" label="数量" prop="数量" align="center">
<template slot-scope="scope">
{{ scope.row.数量 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" label="完成数量" align="center" prop="完成数量" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.完成数量 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" label="工序" align="center" prop="工序" sortable>
<template slot-scope="scope">
{{ scope.row.工序 }}
</template>
</el-table-column>
<el-table-column width="100px" label="生产工位" align="center" prop="工位号" sortable>
<template slot-scope="scope">
{{ scope.row.工位号 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('日期')" label="操作者" align="center" prop="操作者" sortable>
<template slot-scope="scope">
{{ scope.row.操作者 }}
</template>
</el-table-column>
<el-table-column width="70px" label="质检数" prop="质检数" align="center">
<template slot-scope="scope">
{{ scope.row.质检数 }}
</template>
</el-table-column>
<el-table-column width="70px" label="不良数" prop="不良数" align="center">
<template slot-scope="scope">
{{ scope.row.不良数 }}
</template>
</el-table-column>
<el-table-column width="90px" label="处理结果" align="center">
<template slot-scope="scope">
{{ scope.row.处理结果 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('交货日期')" label="不合格原因" align="center">
<template slot-scope="scope">
{{ scope.row.不合格原因文本 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('备注')" label="质检说明" align="center">
<template slot-scope="scope">
{{ scope.row.备注 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('日期时间')" label="质检时间" align="center" prop="质检时间" sortable>
<template slot-scope="scope">
{{ scope.row.质检时间 }}
</template>
</el-table-column>
<el-table-column width="85px" label="质检人" align="center">
<template slot-scope="scope">
{{ scope.row.质检人 }}
</template>
</el-table-column>
<el-table-column align="center" label="操作">
<template slot-scope="scope">
<el-button type="text" size="mini" @click="cancelShipment(scope.row)">撤回质检</el-button>
<el-button
size="mini"
type="text"
@click="viewPicture(scope.row)">查看图片</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40, 100]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChanges"
@current-change="handleCurrentChanges"/>
</div>
</div>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible" title="图片" center style="" width="800px">
<viewer>
<img v-for="url in urls" :key="url" :src="url" lazy style="width: 700px;height: 700px">
</viewer>
</el-dialog>
</el-card>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
export default {
data() {
return {
dialogFormVisible: false,
urls: [],
acknowledgingTimeValue: '',
operatorValue: '',
operator: [],
partName: '',
partOrder: '',
qualityInspectionProcessValue: '',
qualityInspectionProcess: [],
treatmentResultsValue: '',
treatmentResults: [],
orderNumberValue: '',
// orderNumber: [],
workingProcedureValue: '',
workingProcedure: [],
qualityInspectionResultsValue: '',
qualityInspectionResults: [],
dateRange: '', // 提交日期
contractStateTypeValue: '', // 合同状态
contractStateType: [], // 合同状态数组
tableData1: [], // 领料对话框
tableData2: [], // 查看具体参数对话框
number: '',
number1: '',
number2: '',
number3: '',
form: {
Sort: '',
Remarks: ''
},
form1: {
完成数量: ''
},
rules1: {
完成数量: [{ required: true, message: '请输入完成数量', trigger: 'blur' }]
},
show: false,
show1: false,
loading: false, // 数据加载
total: 0, // 分页总数
tableData: [], // 合同信息表
pageCurrent: 1, // 分页当前页
pageSize: 100, // 分页每页显示条数
orderName: '', // 排序列名
order: '' // 排序方式
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
updated() {
this.$nextTick(() => {
this.$refs['table'].doLayout()
})
},
created() {
this.searchTable()
// this.getCustomer()
this.getQualityInspectionResults()
this.getTreatmentResults()
this.getOperator()
this.getWorkingProcedure()
},
methods: {
viewPicture(row) {
this.dialogFormVisible = true
this.urls = []
var param = []
param[0] = ['质检流水号', row.质检流水号]
var Data = this.CreateData('11', '质检管理_图片_查询数据', param)
this.ExecDatabase(Data).then(response => {
// this.URL = readFile + response.data[0].文件标识 + '.' + response.data[0].文件后缀
for (let i = 0; i < response.data.length; i++) {
if (response.data[i].文件内容 !== null) {
// this.urls.push(readFile + response.data[i].文件标识 + '.' + response.data[i].文件后缀)
this.urls.push('data:image/png;base64,' + response.data[i].文件内容)
}
}
})
},
cancelShipment(row) {
var param = []
param[0] = ['质检流水号', row.质检流水号]
var Data = this.CreateData('12', '质检信息查询_撤回质检信息', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('撤回质检信息成功')
this.searchTable()
} else {
this.$message.warning('撤回质检信息失败!')
}
})
},
// getCustomer() {
// var param = []
// var Data = this.CreateData('11', '精工_质量信息_订单编号_查询', param)
// this.ExecDatabase(Data).then(response => {
// for (let i = 0; i < response.data.length; i++) {
// this.orderNumber.push({
// label: response.data[i].订单编号,
// value: response.data[i].订单流水号
// })
// }
// })
// },
getQualityInspectionResults() {
var param = []
var Data = this.CreateData('11', '精工_质量信息_质检结果_查询', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.qualityInspectionResults.push({
label: response.data[i].不合格原因文本,
value: response.data[i].不合格原因
})
}
})
},
getTreatmentResults() {
var param = []
var Data = this.CreateData('11', '精工_质量信息_处理结果_查询', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.treatmentResults.push({
label: response.data[i].不合格处理文本,
value: response.data[i].不合格处理
})
}
})
},
getOperator() {
var param = []
var Data = this.CreateData('11', '精工_质量信息_操作者_查询', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.operator.push({
label: response.data[i].姓名,
value: response.data[i].人员编号
})
}
})
},
getWorkingProcedure() {
var param = []
var Data = this.CreateData('11', '精工_质量信息_工序_查询', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.workingProcedure.push({
label: response.data[i].工艺名称,
value: response.data[i].工艺编号
})
}
})
},
searchTable() {
this.tableData = []
let orderNumberValue_check, qualityInspectionResultsValue_check, treatmentResultsValue_check, qualityInspectionProcessValue_check, operatorValue_check, dateRange_check, partName_check, partOrder_check
this.orderNumberValue ? orderNumberValue_check = 1 : orderNumberValue_check = 0
this.qualityInspectionResultsValue ? qualityInspectionResultsValue_check = 1 : qualityInspectionResultsValue_check = 0
this.treatmentResultsValue ? treatmentResultsValue_check = 1 : treatmentResultsValue_check = 0
this.qualityInspectionProcessValue ? qualityInspectionProcessValue_check = 1 : qualityInspectionProcessValue_check = 0
this.operatorValue ? operatorValue_check = 1 : operatorValue_check = 0
this.dateRange ? dateRange_check = 1 : (dateRange_check = 0, this.dateRange = '')
this.partName ? partName_check = 1 : partName_check = 0
this.partOrder ? partOrder_check = 1 : partOrder_check = 0
const param = []
param[0] = ['订单编号_check', orderNumberValue_check]
param[1] = ['订单编号', this.orderNumberValue]
param[2] = ['质检结果_check', qualityInspectionResultsValue_check]
param[3] = ['质检结果', this.qualityInspectionResultsValue]
param[4] = ['处理结果_check', treatmentResultsValue_check]
param[5] = ['处理结果', this.treatmentResultsValue]
param[6] = ['质检工序_check', qualityInspectionProcessValue_check]
param[7] = ['质检工序', this.qualityInspectionProcessValue]
param[8] = ['操作者_check', operatorValue_check]
param[9] = ['操作者', this.operatorValue]
param[10] = ['质检时间_check', dateRange_check]
param[11] = ['开始时间', this.dateRange[0]]
param[12] = ['结束时间', this.dateRange[1]]
param[13] = ['排序名称', this.orderName]
param[14] = ['排序方式', this.order]
param[15] = ['名称_check', partName_check]
param[16] = ['名称', this.partName]
param[17] = ['图号_check', partOrder_check]
param[18] = ['图号', this.partOrder]
var Data = this.CreateData('11', '精工_质量信息_查询', param, this.pageSize, this.pageCurrent)
this.ExecDatabase(Data).then(response => {
this.tableData = response.data.rows
this.total = response.data.total
})
const param1 = []
param1[0] = ['订单编号_check', orderNumberValue_check]
param1[1] = ['订单编号', this.orderNumberValue]
param1[2] = ['质检结果_check', qualityInspectionResultsValue_check]
param1[3] = ['质检结果', this.qualityInspectionResultsValue]
param1[4] = ['处理结果_check', treatmentResultsValue_check]
param1[5] = ['处理结果', this.treatmentResultsValue]
param1[6] = ['质检工序_check', qualityInspectionProcessValue_check]
param1[7] = ['质检工序', this.qualityInspectionProcessValue]
param1[8] = ['操作者_check', operatorValue_check]
param1[9] = ['操作者', this.operatorValue]
param1[10] = ['质检时间_check', dateRange_check]
param1[11] = ['开始时间', this.dateRange[0]]
param1[12] = ['结束时间', this.dateRange[1]]
param1[13] = ['排序名称', this.orderName]
param1[14] = ['排序方式', this.order]
param1[15] = ['名称_check', partName_check]
param1[16] = ['名称', this.partName]
param1[17] = ['图号_check', partOrder_check]
param1[18] = ['图号', this.partOrder]
var Data1 = this.CreateData('11', '精工_质量信息_查询合计', param1)
this.ExecDatabase(Data1).then(response => {
this.number = response.data[0].数量
this.number1 = response.data[0].完成数量
this.number2 = response.data[0].质检数
this.number3 = response.data[0].不良数
})
},
getSummaries(param) {
const { columns } = param
const sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计'
return
} else if (index === 3) {
sums[index] = this.number
} else if (index === 4) {
sums[index] = this.number1
} else if (index === 8) {
sums[index] = this.number2
} else if (index === 9) {
sums[index] = this.number3
}
})
return sums
},
sortChange(column) {
if (column.prop === '零件名称') {
this.orderName = 1
} else if (column.prop === '工序') {
this.orderName = 2
} else if (column.prop === '工位号') {
this.orderName = 3
} else if (column.prop === '操作者') {
this.orderName = 4
} else if (column.prop === '质检时间1') {
this.orderName = 5
} else {
this.orderName = 0
}
if (column.order === 'ascending') {
this.order1 = 1
} else if (column.order === 'descending') {
this.order1 = 2
} else {
this.order1 = ''
}
this.searchTable()
},
handleSizeChanges(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable()
},
handleCurrentChanges(val) {
this.pageCurrent = val
this.searchTable()
}
}
}
</script>

View File

@@ -0,0 +1,590 @@
<!--质量信息查询质量信息查询质量信息查询质量信息查询质量信息查询质量信息查询质量信息查询质量信息查询-->
<template>
<div class="app-container">
<el-card style="height: 850px">
<div style="margin-top: 7px">
<el-input v-model="orderNumberValue" style="width:150px" placeholder="名称或图号" size="small" filterable clearable @keyup.enter.native="searchTable()"/>
<el-input v-model="procedureValue" style="width:150px;margin-left: 10px" placeholder="工序" size="small" filterable clearable @keyup.enter.native="searchTable()"/>
<el-select v-model="qualityInspectionResultsValue" style="width:100px;margin-left: 10px" placeholder="质检结果" size="small" filterable clearable @change="searchTable">
<el-option
v-for="item in qualityInspectionResults"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-select v-model="treatmentResultsValue" style="width:100px;margin-left: 10px" placeholder="处理结果" size="small" filterable clearable @change="searchTable">
<el-option
v-for="item in treatmentResults"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<!--<el-select v-model="qualityInspectionProcessValue" style="width:100px;margin-left: 10px" placeholder="质检工序" size="small" filterable clearable>
<el-option
v-for="item in workingProcedure"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>-->
<!--<el-select v-model="operatorValue" style="width:100px;margin-left: 10px" placeholder="操作者" size="small" filterable clearable>
<el-option
v-for="(item, index) in operator"
:key="index.value"
:label="item.label"
:value="item.value"/>
</el-select>-->
<span style="margin-left: 10px">质检时间</span>
<el-date-picker
v-model="dateRange"
size="small"
type="daterange"
align="center"
style="width: 240px;"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
@change="searchTable"/>
<el-button icon="el-icon-search" type="primary" plain size="small" style="margin-left: 10px" @click="searchTable()">查询</el-button>
<el-button type="warning" plain icon="el-icon-plus" size="small" @click="editType('form')">记录</el-button>
<el-table
v-loading="loading"
ref="table"
:data="tableData"
:summary-method="getSummaries"
show-summary
border
highlight-current-row
size="mini"
height="750px"
style="width: 1181px;margin-top: 7px"
@sort-change="sortChange">
<el-table-column width="160px" label="零件名称" align="center" prop="零件名称" sortable>
<template slot-scope="scope">
{{ scope.row.名称 }}
</template>
</el-table-column>
<el-table-column width="160px" label="图号" align="center" prop="">
<template slot-scope="scope">
{{ scope.row.图号 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" label="工序" align="center">
<template slot-scope="scope">
{{ scope.row.工序 }}
</template>
</el-table-column>
<el-table-column width="70px" label="质检数" prop="质检数" align="center">
<template slot-scope="scope">
{{ scope.row.质检数 }}
</template>
</el-table-column>
<el-table-column width="70px" label="不良数" prop="不良数" align="center">
<template slot-scope="scope">
{{ scope.row.不良数 }}
</template>
</el-table-column>
<el-table-column width="120px" label="处理结果" align="center">
<template slot-scope="scope">
{{ scope.row.不合格处理文本 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('交货日期')" 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 :width="setColumnWidth('日期时间')" label="质检时间" align="center">
<template slot-scope="scope">
{{ scope.row.质检时间 }}
</template>
</el-table-column>
<el-table-column width="85px" label="质检人" align="center">
<template slot-scope="scope">
{{ scope.row.质检人 }}
</template>
</el-table-column>
<el-table-column align="center" label="操作">
<template slot-scope="scope">
<el-button type="text" icon="el-icon-edit" size="mini" @click="handleEdit(scope.row)"/>
<el-button type="text" icon="el-icon-delete" size="mini" @click="handleDelete(scope.row)"/>
<!--<el-button type="text" size="mini" @click="cancelShipment(scope.row)">撤回质检</el-button>
<el-button
size="mini"
type="text"
@click="viewPicture(scope.row)">查看图片</el-button>-->
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40, 100]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChanges"
@current-change="handleCurrentChanges"/>
</div>
</div>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible1" title="图片" center style="" width="800px">
<viewer>
<img v-for="url in urls" :key="url" :src="url" lazy style="width: 700px;height: 700px">
</viewer>
</el-dialog>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible" :title="title" center width="660px">
<el-form ref="form" :model="form" label-position="center" label-width="100px" class="demo-ruleForm">
<el-form-item label="零件名称" prop="零件名称" style="display: inline-block;">
<el-input v-model="form.零件名称" style="width:180px;display: inline-block" placeholder="零件名称" size="small" clearable/>
</el-form-item>
<el-form-item label="图号或型号" prop="图号或型号" style="display: inline-block;">
<el-input v-model="form.图号或型号" style="width:180px;display: inline-block" placeholder="图号或型号" size="small" clearable/>
</el-form-item>
<el-form-item label="工序" prop="工序" style="display: inline-block;">
<el-input v-model="form.工序" style="width:180px;display: inline-block" placeholder="零件名称" size="small" clearable/>
</el-form-item>
<el-form-item label="质检数" prop="质检数" style="display: inline-block">
<el-input-number v-model="form.质检数" style="width:180px;display: inline-block" placeholder="质检数" size="small" clearable/>
</el-form-item>
<el-form-item label="不良数" prop="不良数" style="display: inline-block">
<el-input-number v-model="form.不良数" style="width:180px;display: inline-block;" placeholder="不良数" size="small" clearable/>
</el-form-item>
<el-form-item label="处理结果" prop="处理结果" style="display: inline-block">
<el-select v-model="form.处理结果" style="width:180px;display: inline-block" placeholder="处理结果" size="small" filterable clearable>
<el-option
v-for="item in treatmentResults"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="不合格原因" prop="不合格原因" style="display: inline-block">
<el-select v-model="form.不合格原因" style="width:180px;display: inline-block" placeholder="不合格原因" size="small" filterable clearable>
<el-option
v-for="item in qualityInspectionResults"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="质检时间" prop="质检时间" style="display: inline-block">
<el-date-picker
v-model="form.质检时间"
size="small"
align="center"
style="width: 180px;display: inline-block"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
placeholder="选择日期"/>
</el-form-item>
<el-form-item label="质检说明" prop="质检说明" style="display: inline-block;">
<el-input v-model="form.质检说明" style="width:180px;display: inline-block" placeholder="质检说明" size="small" clearable/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button v-if="title === '增加记录'" @click="callOff('form')">取消</el-button>
<el-button v-if="title === '增加记录'" type="primary" @click="submit('form')">确定</el-button>
<el-button v-if="title === '编辑记录'" @click="callOff('form')">取消</el-button>
<el-button v-if="title === '编辑记录'" type="primary" @click="submitUpdate('form')">确定</el-button>
</div>
</el-dialog>
</el-card>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
export default {
data() {
return {
dialogFormVisible: false,
dialogFormVisible1: false,
title: '',
urls: [],
acknowledgingTimeValue: '',
operatorValue: '',
operator: [],
qualityInspectionProcessValue: '',
qualityInspectionProcess: [],
treatmentResultsValue: '',
treatmentResults: [],
orderNumberValue: '',
procedureValue: '',
// orderNumber: [],
workingProcedureValue: '',
workingProcedure: [],
qualityInspectionResultsValue: '',
qualityInspectionResults: [],
dateRange: '', // 提交日期
contractStateTypeValue: '', // 合同状态
contractStateType: [], // 合同状态数组
tableData1: [], // 领料对话框
tableData2: [], // 查看具体参数对话框
number: '',
number1: '',
number2: '',
number3: '',
form: {
零件名称: '',
图号或型号: '',
工序: '',
质检数: '',
不良数: '',
处理结果: '',
不合格原因: '',
质检说明: '',
质检时间: ''
},
moldValue: '',
form1: {
完成数量: ''
},
rules1: {
完成数量: [{ required: true, message: '请输入完成数量', trigger: 'blur' }]
},
show: false,
show1: false,
loading: false, // 数据加载
total: 0, // 分页总数
tableData: [], // 合同信息表
pageCurrent: 1, // 分页当前页
pageSize: 100, // 分页每页显示条数
orderName: '', // 排序列名
order: '' // 排序方式
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
updated() {
this.$nextTick(() => {
this.$refs['table'].doLayout()
})
},
created() {
this.searchTable()
// this.getCustomer()
this.getQualityInspectionResults()
this.getTreatmentResults()
this.getOperator()
this.getWorkingProcedure()
},
methods: {
viewPicture(row) {
this.dialogFormVisible = true
this.urls = []
var param = []
param[0] = ['质检流水号', row.质检流水号]
var Data = this.CreateData('11', '质检管理_图片_查询数据', param)
this.ExecDatabase(Data).then(response => {
// this.URL = readFile + response.data[0].文件标识 + '.' + response.data[0].文件后缀
for (let i = 0; i < response.data.length; i++) {
if (response.data[i].文件内容 !== null) {
// this.urls.push(readFile + response.data[i].文件标识 + '.' + response.data[i].文件后缀)
this.urls.push('data:image/png;base64,' + response.data[i].文件内容)
}
}
})
},
cancelShipment(row) {
var param = []
param[0] = ['质检流水号', row.质检流水号]
var Data = this.CreateData('12', '质检信息查询_撤回质检信息', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('撤回质检信息成功')
this.searchTable()
} else {
this.$message.warning('撤回质检信息失败!')
}
})
},
// getCustomer() {
// var param = []
// var Data = this.CreateData('11', '精工_质量信息_订单编号_查询', param)
// this.ExecDatabase(Data).then(response => {
// for (let i = 0; i < response.data.length; i++) {
// this.orderNumber.push({
// label: response.data[i].订单编号,
// value: response.data[i].订单流水号
// })
// }
// })
// },
getQualityInspectionResults() {
var param = []
var Data = this.CreateData('11', '精工_质量信息_质检结果_查询', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.qualityInspectionResults.push({
label: response.data[i].不合格原因文本,
value: response.data[i].不合格原因
})
}
})
},
getTreatmentResults() {
var param = []
var Data = this.CreateData('11', '精工_质量信息_处理结果_查询', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.treatmentResults.push({
label: response.data[i].不合格处理文本,
value: response.data[i].不合格处理
})
}
})
},
getOperator() {
var param = []
var Data = this.CreateData('11', '精工_质量信息_操作者_查询', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.operator.push({
label: response.data[i].姓名,
value: response.data[i].人员编号
})
}
})
},
getWorkingProcedure() {
var param = []
var Data = this.CreateData('11', '精工_质量信息_工序_查询', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.workingProcedure.push({
label: response.data[i].工艺名称,
value: response.data[i].工艺编号
})
}
})
},
searchTable() {
this.tableData = []
let orderNumberValue_check, qualityInspectionResultsValue_check, treatmentResultsValue_check, qualityInspectionProcessValue_check, dateRange_check
this.orderNumberValue ? orderNumberValue_check = 1 : orderNumberValue_check = 0
this.qualityInspectionResultsValue ? qualityInspectionResultsValue_check = 1 : qualityInspectionResultsValue_check = 0
this.treatmentResultsValue ? treatmentResultsValue_check = 1 : treatmentResultsValue_check = 0
this.procedureValue ? qualityInspectionProcessValue_check = 1 : qualityInspectionProcessValue_check = 0
this.dateRange ? dateRange_check = 1 : (dateRange_check = 0, this.dateRange = '')
const param = []
param[0] = ['名称_check', orderNumberValue_check]
param[1] = ['名称', this.orderNumberValue]
param[2] = ['质检结果_check', qualityInspectionResultsValue_check]
param[3] = ['质检结果', this.qualityInspectionResultsValue]
param[4] = ['处理结果_check', treatmentResultsValue_check]
param[5] = ['处理结果', this.treatmentResultsValue]
param[6] = ['质检工序_check', qualityInspectionProcessValue_check]
param[7] = ['工序', this.procedureValue]
param[8] = ['质检时间_check', dateRange_check]
param[9] = ['开始时间', this.dateRange[0]]
param[10] = ['结束时间', this.dateRange[1]]
var Data = this.CreateData('11', '质量管理_额外记录_查询', param, this.pageSize, this.pageCurrent)
this.ExecDatabase(Data).then(response => {
this.tableData = response.data.rows
this.total = response.data.total
})
const param1 = []
param1[0] = ['名称_check', orderNumberValue_check]
param1[1] = ['名称', this.orderNumberValue]
param1[2] = ['质检结果_check', qualityInspectionResultsValue_check]
param1[3] = ['质检结果', this.qualityInspectionResultsValue]
param1[4] = ['处理结果_check', treatmentResultsValue_check]
param1[5] = ['处理结果', this.treatmentResultsValue]
param1[6] = ['质检工序_check', qualityInspectionProcessValue_check]
param1[7] = ['工序', this.procedureValue]
param1[8] = ['质检时间_check', dateRange_check]
param1[9] = ['开始时间', this.dateRange[0]]
param1[10] = ['结束时间', this.dateRange[1]]
var Data1 = this.CreateData('11', '质量管理_额外记录_查询合计', param1)
this.ExecDatabase(Data1).then(response => {
this.number2 = response.data[0].质检数
this.number3 = response.data[0].不良数
})
},
editType(formName) {
if (this.$refs['form'] !== undefined) {
this.$refs['form'].resetFields()
}
this.form.名称 = ''
this.form.图号 = ''
this.form.工序 = ''
this.form.质检数 = ''
this.form.不良数 = ''
this.form.处理结果 = ''
this.form.不合格原因 = ''
this.form.质检说明 = ''
this.form.质检时间 = ''
this.title = '增加记录'
this.dialogFormVisible = true
},
// 增加删除
callOff(formName) {
this.dialogFormVisible = false
this.$refs[formName].resetFields()
},
// 增加确定
submit(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
var param = []
param[0] = ['名称', this.form.零件名称]
param[1] = ['图号', this.form.图号或型号]
param[2] = ['工序', this.form.工序]
param[3] = ['质检数', this.form.质检数]
param[4] = ['不良数', this.form.不良数]
param[5] = ['处理结果', this.form.处理结果]
param[6] = ['不合格原因', this.form.不合格原因]
param[7] = ['备注', this.form.质检说明]
param[8] = ['质检时间', this.form.质检时间]
param[9] = ['操作人', this.id]
var Data = this.CreateData('12', '质量管理_额外记录_增加', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message({
message: '信息增加成功',
type: 'success'
})
this.searchTable()
} else {
this.$message.error('信息增加失败')
}
})
this.dialogFormVisible = false
} else {
return false
}
})
},
// 删除
handleDelete(row) {
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
var param = []
param[0] = ['质量记录流水号', row.质量记录流水号]
var Data = this.CreateData('12', '质量管理_额外记录_删除', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('删除成功')
if (this.tableData && this.tableData.length === 1 && this.pageList > 1) { // 判断删除的是否是最后一页最后一行,如果是且不是第一页,页数减一
this.pageList--
}
this.searchTable()
} else {
this.$message.error('删除失败')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
handleEdit(row) {
if (this.$refs['form'] !== undefined) {
this.$refs['form'].resetFields()
}
this.title = '编辑记录'
this.form.零件名称 = row.名称
this.form.图号或型号 = row.图号
this.form.工序 = row.工序
this.form.质检数 = row.质检数
this.form.不良数 = row.不良数
this.form.处理结果 = Number(row.处理结果)
this.form.不合格原因 = Number(row.不合格原因)
this.form.质检说明 = row.备注
this.form.质检时间 = row.质检时间
this.moldValue = row.质量记录流水号
this.dialogFormVisible = true
},
submitUpdate(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
var param = []
param[0] = ['名称', this.form.零件名称]
param[1] = ['图号', this.form.图号或型号]
param[2] = ['工序', this.form.工序]
param[3] = ['质检数', this.form.质检数]
param[4] = ['不良数', this.form.不良数]
param[5] = ['处理结果', this.form.处理结果]
param[6] = ['不合格原因', this.form.不合格原因]
param[7] = ['备注', this.form.质检说明]
param[8] = ['质检时间', this.form.质检时间]
param[9] = ['质量记录流水号', this.moldValue]
var Data = this.CreateData('12', '质量管理_额外记录_编辑', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('编辑成功')
this.searchTable()
this.dialogFormVisible = false
} else {
this.$message.error('编辑失败')
}
})
}
})
},
getSummaries(param) {
const { columns } = param
const sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计'
return
} else if (index === 3) {
sums[index] = this.number2
} else if (index === 4) {
sums[index] = this.number3
}
})
return sums
},
sortChange(column) {
if (column.prop === '零件名称') {
this.orderName = 1
} else if (column.prop === '工序') {
this.orderName = 2
} else if (column.prop === '工位号') {
this.orderName = 3
} else if (column.prop === '操作者') {
this.orderName = 4
} else if (column.prop === '质检时间1') {
this.orderName = 5
} else {
this.orderName = 0
}
if (column.order === 'ascending') {
this.order1 = 1
} else if (column.order === 'descending') {
this.order1 = 2
} else {
this.order1 = ''
}
this.searchTable()
},
handleSizeChanges(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable()
},
handleCurrentChanges(val) {
this.pageCurrent = val
this.searchTable()
}
}
}
</script>

View File

@@ -0,0 +1,297 @@
<template>
<div class="app-container">
<el-col :span="10">
<div style="margin: 20px 20px 20px 120px;width: 600px;height: 810px">
<div style="font-size: 24px; margin:20px 0 0 180px">检验信息维护</div>
<el-form ref="form" :model="form" label-position="left" label-width="100px">
<el-form-item label="厂址:" style="margin-top: 30px">
<el-input v-model="form.siteFactory" style="width: 350px"/>
</el-form-item>
<el-form-item label="网址:">
<el-input v-model="form.siteWeb" style="width: 350px"/>
</el-form-item>
<el-form-item label="电话:">
<el-input v-model="form.contactNumber" style="width: 350px"/>
</el-form-item>
<el-form-item label="传真:">
<el-input v-model="form.fax" style="width: 350px"/>
</el-form-item>
<el-form-item label="装配人员:">
<el-input v-model="form.assemblPeople" style="width: 350px"/>
</el-form-item>
<el-form-item label="检验人员:">
<el-input v-model="form.testPeople" style="width: 350px"/>
</el-form-item>
<el-form-item label="审核人员:">
<el-input v-model="form.examinePeople" style="width: 350px"/>
</el-form-item>
<el-form-item label="品管部门:">
<el-input v-model="form.controlPart" style="width: 350px"/>
</el-form-item>
<el-button type="primary" style="margin-top: 20px;margin-left:0px;width: 100px" @click="modifyCompanyInformation()">修改</el-button>
</el-form>
</div>
</el-col>
<el-col style="width: 751px;margin-left: 10px;margin-top: 75px">
<div>
<el-table :data="tableData" :header-cell-style="{background: '#2283D4',color: 'white'}" highlight-current-row border stripe size="small" height="440" style="width: 751px">
<el-table-column width="120px" label="编号" align="center" show-overflow-tooltip>
<template slot-scope="scope">
<template v-if="scope.row.edit">
<el-input v-model="scope.row.编号" style="width:95%;margin-right:3px" clearable size="mini" />
</template>
<span v-else>{{ scope.row.编号 }}</span>
</template>
</el-table-column>
<el-table-column width="340px" label="检测项目" align="center" show-overflow-tooltip>
<template slot-scope="scope">
<template v-if="scope.row.edit">
<el-input v-model="scope.row.检测项目" style="width:97%;margin-right:3px" clearable size="mini" />
</template>
<span v-else>{{ scope.row.检测项目 }}</span>
</template>
</el-table-column>
<el-table-column width="120px" label="允许值" align="center" show-overflow-tooltip>
<template slot-scope="scope">
<template v-if="scope.row.edit">
<el-input v-model="scope.row.允许值" style="width:95%;margin-right:3px" clearable size="mini" />
</template>
<span v-else>{{ scope.row.允许值 }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button v-if="scope.row.edit" type="text" size="mini" icon="el-icon-circle-check-outline" @click="confirmEdit(scope.row)">确定</el-button>
<el-button v-if="scope.row.edit" class="cancel-btn" size="mini" type="text" @click="cancelEdit(scope.$index, scope.row)">取消</el-button>
<el-button v-else type="text" size="mini" icon="el-icon-edit" @click="scope.row.edit=!scope.row.edit"/>
<el-button v-if="!scope.row.edit" type="text" size="mini" icon="el-icon-delete" @click="handleDelete(scope.row)"/>
</template>
</el-table-column>
</el-table>
<el-button icon="el-icon-circle-plus-outline" size="mini" @click="createProductInformation"/>
</div>
</el-col>
<el-dialog v-el-drag-dialog :title="title" :visible.sync="dialogFormVisible" center width="350px">
<el-form ref="form" :model="form1" label-position="left" label-width="100px" class="demo-ruleForm" style="margin: auto">
<el-form-item label="编号:" prop="编号">
<el-input v-model="form1.编号" clearable size="small" style="width:200px" placeholder="请输入编号"/>
</el-form-item>
<el-form-item label="检测项目:" prop="检测项目">
<el-input v-model="form1.检测项目" clearable size="small" style="width:200px" placeholder="请输入检测项目"/>
</el-form-item>
<el-form-item label="允许值:" prop="允许值">
<el-input v-model="form1.允许值" clearable size="small" style="width:200px" placeholder="请输入允许值"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="callOff()">取消</el-button>
<el-button type="distribution" size="small" @click="addProductInformation('form')"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
export default {
data() {
return {
form: {
siteFactory: '',
siteWeb: '',
contactNumber: '',
fax: '',
assemblPeople: '',
testPeople: '',
examinePeople: '',
controlPart: ''
},
form1: {
编号: '',
检测项目: '',
允许值: ''
},
tableData: [],
title: '新增',
dialogFormVisible: false
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
created() {
this.searchCompanyInformation()
this.searchTable()
},
methods: {
searchCompanyInformation() {
var param = []
var Data = this.CreateData('11', '基础表_检验信息维护表_查询', param)
this.ExecDatabase(Data).then(response => {
this.form.siteFactory = response.data[0].厂址
this.form.siteWeb = response.data[0].网址
this.form.contactNumber = response.data[0].电话
this.form.fax = response.data[0].传真
this.form.assemblPeople = response.data[0].装配人员
this.form.testPeople = response.data[0].检验人员
this.form.examinePeople = response.data[0].审核人员
this.form.controlPart = response.data[0].品管部门
})
},
modifyCompanyInformation() {
this.$confirm('是否确认修改检验信息?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
var param = []
param[0] = ['厂址', this.form.siteFactory]
param[1] = ['网址', this.form.siteWeb]
param[2] = ['电话', this.form.contactNumber]
param[3] = ['传真', this.form.fax]
param[4] = ['装配人员', this.form.assemblPeople]
param[5] = ['检验人员', this.form.testPeople]
param[6] = ['审核人员', this.form.examinePeople]
param[7] = ['品管部门', this.form.controlPart]
var Data = this.CreateData('12', '基础表_检验信息维护表_修改', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('修改成功')
this.searchCompanyInformation()
} else {
this.$message.error('修改失败')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消修改'
})
})
},
searchTable() {
this.tableData = []
var param = []
var Data = this.CreateData('11', '检测项目_基础表_查询数据', param)
this.ExecDatabase(Data).then(response => {
if (response.data.length !== 0) {
for (let i = 0; i < response.data.length; i++) {
this.tableData.push({
检测项目流水号: response.data[i].检测项目流水号,
编号: response.data[i].编号,
检测项目: response.data[i].检测项目,
允许值: response.data[i].允许值,
检测项目流水号_before: response.data[i].检测项目流水号,
编号_before: response.data[i].编号,
检测项目_before: response.data[i].检测项目,
允许值_before: response.data[i].允许值,
edit: false
})
}
}
})
},
createProductInformation() {
this.form1 = {}
if (this.$refs['form1'] !== undefined) {
this.$refs['form1'].resetFields()
}
this.dialogFormVisible = true
},
addProductInformation(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
var param = []
param[0] = ['编号', this.form1.编号]
param[1] = ['检测项目', this.form1.检测项目]
param[2] = ['允许值', this.form1.允许值]
var Data = this.CreateData('11', '检测项目_基础表_增加数据', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].结果 === 1) {
this.$message({
message: '信息增加成功',
type: 'success'
})
this.searchTable()
} else {
this.$message.error('信息增加失败')
}
})
this.dialogFormVisible = false
} else {
return false
}
})
},
callOff() {
this.dialogFormVisible = false
this.$message.error('已取消')
},
confirmEdit(row) {
var param = []
param[0] = ['检测项目流水号', row.检测项目流水号]
param[1] = ['编号', row.编号]
param[2] = ['检测项目', row.检测项目]
param[3] = ['允许值', row.允许值]
var Data = this.CreateData('12', '检测项目_基础表_修改数据', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message({
message: '信息编辑成功',
type: 'success'
})
this.searchTable()
row.edit = false
} else {
this.$message.error('信息编辑失败')
}
})
},
cancelEdit(index, row) {
row.edit = false
row.编号 = this.tableData[index].编号_before
row.检测项目 = this.tableData[index].检测项目_before
row.允许值 = this.tableData[index].允许值_before
this.$message('取消修改')
},
handleDelete(row) {
this.$confirm('是否删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
var param = []
param[0] = ['检测项目流水号', row.检测项目流水号]
var Data = this.CreateData('12', '检测项目_基础表_删除数据', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('删除成功')
this.searchTable()
} else {
this.$message.error('删除失败')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
}
}
}
</script>
<style scoped lang="scss">
/deep/ .el-input__inner{
border-radius: 0px;
text-align: center;
}
/deep/.el-button--primary {
color: #409EFF;
background: #ecf5ff;
border-color: #b3d8ff;
}
</style>

View File

@@ -0,0 +1,363 @@
<template>
<div class="app-container">
<el-card style="height: 850px">
<div style="margin-top: 7px; margin-bottom: 7px">
<span style="font-size: 13px;color: black;margin-left:10px">质检时间</span>
<el-date-picker
v-model="dateRange"
size="small"
type="daterange"
align="center"
style="width: 240px;"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
@change="searchTable"/>
<el-select
v-model="orderNumberTypeValue"
:remote-method="getOrderNumberType"
style="width:200px;margin-left: 10px"
placeholder="订单号"
size="small"
filterable
clearable
remote
@change="searchTable();getProductpartName()">
<el-option
v-for="item in orderNumberType"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-select
v-model="productpartNameValue"
style="width:200px"
placeholder="产品/部件名称"
size="small"
filterable
clearable
@change="searchTable()">
<el-option
v-for="item in productpartName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-input
v-model="partNameValue"
style="width: 100px"
size="small"
clearable
placeholder="零件名称"
@keyup.enter.native="searchTable()"/>
</div>
<el-table
v-loading="loading"
ref="table"
:data="tableData"
:row-class-name="tableRowClassName"
highlight-current-row
show-summary
border
size="small"
style="width: 1651px; margin-top: 10px"
height="740px"
@sort-change="sortChange">
<el-table-column :width="setColumnWidth('零件名称')" label="零件名称" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('图号')" label="零件图号" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.零件图号 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" label="数量" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.数量 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" label="报废数" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.报废数 }}
</template>
</el-table-column>
<el-table-column
:width="setColumnWidth('日期时间')"
label="报废原因"
sortable="custom"
align="center"
show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.报废原因 }}
</template>
</el-table-column>
<el-table-column
:width="setColumnWidth('日期')"
label="责任人"
sortable="custom"
align="center"
show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.责任人 }}
</template>
</el-table-column>
<el-table-column
:width="setColumnWidth('加工设备')"
label="生产设备"
sortable="custom"
align="center"
show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.生产设备 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('日期')" label="质检时间" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.质检时间 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" label="补投数" align="center" show-overflow-tooltip>
<template slot-scope="scope">
<template v-if="scope.row.edit">
<el-input v-model="scope.row.补投数" type="number" size="mini" style="width: 100%"/>
</template>
<template v-else>
{{ scope.row.补投数 }}
</template>
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('日期')" label="补投时间" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.补投时间 }}
</template>
</el-table-column>
<el-table-column
:width="setColumnWidth('产品名称')"
label="产品名称"
align="center"
sortable="custom"
show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.产品名称 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('订单号')" label="订单编号" align="center">
<template slot-scope="scope">
{{ scope.row.订单编号 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="140px">
<template slot-scope="scope">
<el-button
v-if="!scope.row.edit"
:disabled="Number(scope.row.补投数) >= Number(scope.row.报废数)"
icon="el-icon-first-aid-kit"
type="text"
size="mini"
@click="scope.row.edit=!scope.row.edit">补投
</el-button>
<el-button v-if="scope.row.edit" type="text" size="mini" @click="editProduct(scope.row)">确定</el-button>
<el-button v-if="scope.row.edit" type="text" size="mini" @click="cancel(scope.row)">取消</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40, 100]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChanges"
@current-change="handleCurrentChanges"/>
</div>
</el-card>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
export default {
data() {
return {
orderNumberTypeValue: '', // 订单号
orderNumberType: [], // 订单号数组
productpartNameValue: '', // 产品部件名称
productpartName: [], // 产品部件名称数组
dateRange: '', // 提交日期
contractStateValue: '', // 合同状态
partNameValue: '', // 零件名称
loading: false, // 数据加载
total: 0, // 分页总数
tableData: [], // 合同信息表
tableData2: [],
pageCurrent: 1, // 分页当前页
pageSize: 100, // 分页每页显示条数
orderName: '', // 排序列名
order: '' // 排序方式
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
updated() {
this.$nextTick(() => {
this.$refs['table'].doLayout()
})
},
created() {
this.getOrderNumberType('')
},
methods: {
getOrderNumberType(query) {
this.orderNumberType = []
var param = []
param[0] = ['订单编号', query]
var Data = this.CreateData('11', '订单信息_列表_查询数据_bak', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.orderNumberType.push({
label: response.data[i].订单编号,
value: response.data[i].订单流水号
})
}
})
},
getProductpartName() {
this.productpartNameValue = ''
this.productpartName = []
if (this.orderNumberTypeValue) {
var param = []
param[0] = ['订单流水号', this.orderNumberTypeValue]
var Data = this.CreateData('11', '订单信息_产品信息_查询数据', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.productpartName.push({
label: response.data[i].产品名称,
value: response.data[i].组件流水号
})
}
})
}
},
searchTable() {
this.tableData = []
let orderNumberTypeValue_check, dateRange_check, productpartNameValue_check, partNameValue_check
this.orderNumberTypeValue ? orderNumberTypeValue_check = 1 : orderNumberTypeValue_check = 0
this.dateRange ? dateRange_check = 1 : (dateRange_check = 0, this.dateRange = '')
this.productpartNameValue ? productpartNameValue_check = 1 : productpartNameValue_check = 0
this.partNameValue ? partNameValue_check = 1 : partNameValue_check = 0
var param = []
param[0] = ['时间_check', dateRange_check]
param[1] = ['开始时间', this.dateRange[0]]
param[2] = ['结束时间', this.dateRange[1]]
param[3] = ['订单流水号_check', orderNumberTypeValue_check]
param[4] = ['订单流水号', this.orderNumberTypeValue]
param[5] = ['组件流水号_check', productpartNameValue_check]
param[6] = ['组件流水号', this.productpartNameValue]
param[7] = ['零件名称_check', partNameValue_check]
param[8] = ['零件名称', this.partNameValue]
param[9] = ['排序名称', this.orderName]
param[10] = ['排序方式', this.order]
// 参数数量与名称要与存储过程对应
var Data = this.CreateData('11', '精工车间_报废补投_查询', param, this.pageSize, this.pageCurrent)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.rows.length; i++) {
this.tableData.push({
工艺计划流水号: response.data.rows[i].工艺计划流水号,
补投流水号: response.data.rows[i].补投流水号,
零件名称: response.data.rows[i].零件名称,
零件图号: response.data.rows[i].零件图号,
数量: response.data.rows[i].批次数量,
报废数: response.data.rows[i].报废数量,
报废原因: response.data.rows[i].报废原因,
责任人: response.data.rows[i].责任人,
生产设备: response.data.rows[i].工位号,
质检时间: response.data.rows[i].质检时间,
补投数: response.data.rows[i].补投数,
补投时间: response.data.rows[i].补投时间,
产品名称: response.data.rows[i].产品名称,
订单编号: response.data.rows[i].订单号,
原补投数: response.data.rows[i].补投数,
edit: false
})
}
console.log(this.tableData, 1244)
this.total = response.data.total
})
},
tableRowClassName({ row, rowIndex }) {
if (Number(row.报废数) > Number(row.补投数)) {
return 'No-supplementary'
}
},
sortChange(column) {
if (column.prop === '状态') {
this.orderName = 1
} else {
this.orderName = 0
}
if (column.order === 'ascending') {
this.order = 1
} else if (column.order === 'descending') {
this.order = 2
} else {
this.order = ''
}
this.searchTable()
},
editProduct(row) {
if (Number(row.补投数) === 0) {
this.$message.warning('补投数不能为0')
return
}
if (Number(row.补投数) > Number(row.报废数)) {
this.$message.warning('补投数不能大于报废数')
return
}
row.edit = false
var param = []
param[0] = ['工艺计划流水号', row.工艺计划流水号]
param[1] = ['补投数量', row.补投数]
param[2] = ['补投人', this.id]
param[3] = ['补投流水号', row.补投流水号]
var Data = this.CreateData('12', '车间生产管理工艺_零件工艺计划_报废零件_补投', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('补投成功')
this.searchTable()
} else {
this.$message.error('补投失败')
}
})
},
cancel(row) {
row.补投数 = row.原补投数
row.edit = false
},
handleSizeChanges(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable()
},
handleCurrentChanges(val) {
this.pageCurrent = val
this.searchTable()
}
}
}
</script>
<style>
.el-table .No-supplementary {
background: #F2D1D6 !important;
}
</style>

View File

@@ -0,0 +1,231 @@
<!--质量信息查询质量信息查询质量信息查询质量信息查询质量信息查询质量信息查询质量信息查询质量信息查询-->
<template>
<div class="app-container">
<el-card style="height: 850px">
<div style="margin-top: 7px">
<el-date-picker
v-model="dateRange"
size="small"
type="daterange"
align="center"
style="width: 240px;"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
@change="pageCurrent = 1;pageSize = 20;searchTable()"/>
<el-select v-model="operatorValue" style="width:100px;margin-left: 10px" placeholder="操作者" size="small" filterable clearable @change="pageCurrent = 1;pageSize = 20;searchTable()">
<el-option
v-for="(item, index) in operator"
:key="index.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-table
v-loading="loading"
:data="tableData"
border
highlight-current-row
size="mini"
height="750px"
style="width: 1401px;margin-top: 7px">
<el-table-column :width="setColumnWidth('订单编号')" label="订单编号" align="center" prop="订单编号">
<template slot-scope="scope">
{{ scope.row.订单号 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('零件图号')" label="零件名称" align="center" prop="零件名称">
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('零件图号')" label="图号" align="center" prop="">
<template slot-scope="scope">
{{ scope.row.零件图号 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" label="工序" align="center" prop="工序">
<template slot-scope="scope">
{{ scope.row.工序 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('日期')" label="自检者" align="center" prop="自检者">
<template slot-scope="scope">
{{ scope.row.自检者 }}
</template>
</el-table-column>
<el-table-column label="工艺要求" prop="质检数" align="center">
<template slot-scope="scope">
{{ scope.row.工艺要求 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('交货日期')" label="自检尺寸" align="center">
<template slot-scope="scope">
{{ scope.row.自检尺寸 }}
</template>
</el-table-column>
<el-table-column width="90px" label="是否超差" align="center">
<template slot-scope="scope">
{{ scope.row.是否超差文本 }}
</template>
</el-table-column>
<el-table-column label="备注" prop="备注" align="center">
<template slot-scope="scope">
{{ scope.row.备注 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('交货日期')" label="质检时间" align="center">
<template slot-scope="scope">
{{ scope.row.质检时间 }}
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40, 100]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChanges"
@current-change="handleCurrentChanges"/>
</div>
</div>
</el-card>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
export default {
data() {
return {
acknowledgingTimeValue: '',
operatorValue: '',
operator: [],
qualityInspectionProcessValue: '',
qualityInspectionProcess: [],
treatmentResultsValue: '',
treatmentResults: [],
orderNumberValue: '',
// orderNumber: [],
workingProcedureValue: '',
workingProcedure: [],
qualityInspectionResultsValue: '',
qualityInspectionResults: [],
dateRange: '', // 提交日期
contractStateTypeValue: '', // 合同状态
contractStateType: [], // 合同状态数组
tableData1: [], // 领料对话框
tableData2: [], // 查看具体参数对话框
form: {
Sort: '',
Remarks: ''
},
form1: {
完成数量: ''
},
rules1: {
完成数量: [{ required: true, message: '请输入完成数量', trigger: 'blur' }]
},
show: false,
show1: false,
loading: false, // 数据加载
total: 0, // 分页总数
tableData: [], // 合同信息表
pageCurrent: 1, // 分页当前页
pageSize: 20, // 分页每页显示条数
orderName: '', // 排序列名
order: '' // 排序方式
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
created() {
this.searchTable()
// this.getCustomer()
this.getOperator()
},
methods: {
// getCustomer() {
// var param = []
// var Data = this.CreateData('11', '精工_质量信息_订单编号_查询', param)
// this.ExecDatabase(Data).then(response => {
// for (let i = 0; i < response.data.length; i++) {
// this.orderNumber.push({
// label: response.data[i].订单编号,
// value: response.data[i].订单流水号
// })
// }
// })
// },
getOperator() {
var param = []
var Data = this.CreateData('11', '精工_质量信息_操作者_查询', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.operator.push({
label: response.data[i].姓名,
value: response.data[i].人员编号
})
}
})
},
searchTable() {
this.tableData = []
let operatorValue_check, dateRange_check
this.operatorValue ? operatorValue_check = 1 : operatorValue_check = 0
this.dateRange ? dateRange_check = 1 : (dateRange_check = 0, this.dateRange = '')
const param = []
param[0] = ['人员编号_check', operatorValue_check]
param[1] = ['人员编号', this.operatorValue]
param[2] = ['下单日期_check', dateRange_check]
param[3] = ['开始时间', this.dateRange[0]]
param[4] = ['结束时间', this.dateRange[1]]
var Data = this.CreateData('11', '车间生产管理_自检质检数据_查询数据', param, this.pageSize, this.pageCurrent)
this.ExecDatabase(Data).then(response => {
this.tableData = response.data.rows
this.total = response.data.total
})
},
sortChange(column) {
if (column.prop === '零件名称') {
this.orderName = 1
} else if (column.prop === '工序') {
this.orderName = 2
} else if (column.prop === '工位号') {
this.orderName = 3
} else if (column.prop === '操作者') {
this.orderName = 4
} else if (column.prop === '质检时间1') {
this.orderName = 5
} else {
this.orderName = 0
}
if (column.order === 'ascending') {
this.order1 = 1
} else if (column.order === 'descending') {
this.order1 = 2
} else {
this.order1 = ''
}
this.searchTable()
},
handleSizeChanges(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable()
},
handleCurrentChanges(val) {
this.pageCurrent = val
this.searchTable()
}
}
}
</script>

View File

@@ -0,0 +1,778 @@
<template>
<div class="app-container">
<el-card style="height: 850px">
<div style="margin-top: 7px; margin-bottom: 7px">
<el-input v-model="piciNumber" size="small" style="width: 200px" placeholder="批次编号" clearable/>
<el-select
v-model="orderNumberTypeValue"
style="width:200px"
placeholder="订单号"
size="small"
filterable
clearable
@change="searchTable()">
<el-option
v-for="item in orderNumberType"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span style="margin-left: 10px">检测时间:</span>
<el-date-picker
v-model="dateRange"
size="small"
type="daterange"
align="center"
style="width: 240px;"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
range-separator=""
start-placeholder="开始时间"
end-placeholder="结束时间"
@change="searchTable()"/>
<el-button
icon="el-icon-search"
type="primary"
plain
size="small"
style="margin-left: 20px"
@click="pageCurrent = 1;pageSize = 20;searchTable()">查询
</el-button>
</div>
<el-table
:data="tableData"
:header-cell-td-style="{background: '#2283D4',color: 'white'}"
highlight-current-row
border
size="small"
height="730px"
style="width: 831px;">
<el-table-column :width="setColumnWidth('序号')" label="序号" type="index" align="center"/>
<el-table-column width="180px" label="主轴批次号" align="center">
<template slot-scope="scope">
{{ scope.row.批次编号 }}
</template>
</el-table-column>
<el-table-column width="80px" label="数量" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.出库数量 }}
</template>
</el-table-column>
<el-table-column width="200px" label="订单编号" align="center" prop="订单编号">
<template slot-scope="scope">
<template v-if="scope.row.edit">
<el-select
v-model="scope.row.订单流水号"
:remote-method="getOrderNumberType"
style="width:100%"
placeholder="订单编号"
size="small"
filterable
remote
clearable>
<el-option
v-for="item in orderNumberType"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</template>
<span v-else>{{ scope.row.订单编号 }}</span>
</template>
</el-table-column>
<el-table-column width="90px" label="检测时间" align="center">
<template slot-scope="scope">
{{ scope.row.检测时间 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button
v-if="scope.row.edit"
type="text"
size="mini"
icon="el-icon-circle-check-outline"
@click="confirmEdit2(scope.row)">确定
</el-button>
<el-button v-if="scope.row.edit" size="mini" type="text" @click="cancelEdit(scope.$index, scope.row)">取消
</el-button>
<el-button v-else type="text" size="mini" @click="scope.row.edit=!scope.row.edit">绑定订单</el-button>
<el-tooltip :open-delay="700" effect="dark" content="检测" placement="top">
<el-button type="text" icon="el-icon-aim" size="mini" content="检测" @click="tesTing(scope.row)"/>
</el-tooltip>
<el-tooltip :open-delay="700" effect="dark" content="查看" placement="top">
<el-button type="text" icon="el-icon-search" size="mini" content="查看" @click="lookCheck(scope.row)"/>
</el-tooltip>
<el-tooltip :open-delay="700" effect="dark" content="打印" placement="top">
<el-button type="text" icon="el-icon-printer" size="mini" content="打印" @click="exportTable()"/>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40, 100]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChanges"
@current-change="handleCurrentChanges"/>
</div>
<el-dialog
v-el-drag-dialog
id="dialog1"
:visible.sync="dialogFormVisible1"
title="镗铣动力头数据录入"
center
width="861px">
<div style="width: 880px">
<div style="width: 800px;height: 100%;">
<div
class="process"
style="width: 800px;height: 240px;border: solid 2px black; border-bottom: 0px!important;"/>
<table
cellspacing="0px"
align="center"
style="table-layout:fixed;border-color: black!important;"
border="1 solid black"
width="100%">
<tr style="height: 40px">
<td colspan="2" style="text-align: center;width: 60px;padding: 0 10px 0 10px">产品名称</td>
<td colspan="10" style="text-align: center;">
<el-input
v-model="productName1Value"
style="width:95%"
placeholder="产品名称"
size="small"
clearable
@blur="confirmEdit1()"/>
</td>
<td colspan="2" style="text-align: center;">产品ID</td>
<td colspan="10" style="text-align: center;">
<el-input
v-model="productIDValue"
style="width:200px"
placeholder="产品ID"
size="small"
clearable
@blur="confirmEdit1()"/>
</td>
</tr>
<tr style="height: 40px">
<td colspan="2" style="text-align: center;width: 60px;padding: 0 10px 0 10px">规格型号</td>
<td colspan="10" style="text-align: center;">
<el-input
v-model="specificationModel"
style="width:95%"
placeholder="规格型号"
size="small"
clearable
@blur="confirmEdit1()"/>
</td>
<td colspan="2" style="text-align: center;">&nbsp;&nbsp;</td>
<td colspan="10" style="text-align: center;">
<el-input
v-model="turnSpeedValue"
style="width:200px"
placeholder="转速"
size="small"
clearable
@blur="confirmEdit1()"/>
</td>
</tr>
</table>
<el-table
:data="tableData1"
:header-cell-style="{ border: '1px solid', borderColor: 'black'}"
:row-style="{ border: '1px solid', borderColor: 'black'}"
class="qqqqwww"
border
size="small"
max-height="600px"
style="width: 801px;">
<el-table-column width="60px" label="编号" align="center" prop="编号" style="border-left: 0px!important;">
<template slot-scope="scope">
{{ scope.row.编号 }}
</template>
</el-table-column>
<el-table-column width="335px" label="检测项" align="center" prop="检测项">
<template slot-scope="scope">
{{ scope.row.检测项目 }}
</template>
</el-table-column>
<el-table-column width="67px" label="允许值" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.允许值 }}
</template>
</el-table-column>
<el-table-column width="140px" label="实测值" align="center" show-overflow-tooltip>
<template slot-scope="scope">
<el-input
v-model="scope.row.实测值"
clearable
size="mini"
style="width:110px"
@change="confirmEdit(scope.row)"/>
</template>
</el-table-column>
<el-table-column width="195px" label="判定" align="center" show-overflow-tooltip>
<template slot-scope="scope">
<el-checkbox v-model="scope.row.判定状态1" style="margin: 0" @change="confirmEdit(scope.row)">精密级
</el-checkbox>
<el-checkbox v-model="scope.row.判定状态2" style="margin-left: 10px" @change="confirmEdit(scope.row)">
高精密级
</el-checkbox>
</template>
</el-table-column>
</el-table>
</div>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitUpdate()"> </el-button>
</div>
</el-dialog>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible" center width="851px">
<div id="WGBLD" style="width: 880px">
<div>
<div><span style="font-size: 23px;margin-left: 260px">浙江景耀数控科技有限公司</span></div>
<div style=";margin-top: 10px"><span style="font-size: 20px;margin-left: 295px">镗铣动力头出厂检验单</span>
</div>
<el-row style="margin: 10px 0 10px 20px">
<el-col :span="17"><span>&nbsp;</span></el-col>
<el-col :span="7">
<span>&nbsp;:&nbsp; {{ dateTime }}</span>
</el-col>
</el-row>
<el-row style="margin: 10px 0 10px 20px">
<el-col :span="17">
<span>&nbsp;:&nbsp;{{ siteFactory }}</span>
</el-col>
<el-col :span="7">
<span>&nbsp;:&nbsp;{{ Telephone }}</span>
</el-col>
</el-row>
<el-row style="margin: 10px 0 10px 20px">
<el-col :span="17">
<span>&nbsp;:&nbsp;{{ webSite }}</span>
</el-col>
<el-col :span="7">
<span>&nbsp;:&nbsp;{{ Fax }}</span>
</el-col>
</el-row>
</div>
<div style="width: 800px;height: 100%;">
<div style="width: 800px;height: 240px;border: solid 2px black; border-bottom: 0px!important;">
<img src="../../../assets/img/zhuzhou.png">
</div>
<table
cellspacing="0px"
align="center"
style="table-layout:fixed;border-color: black!important; border-bottom: 0px!important;"
border="1px solid black"
width="100%">
<tr style="height: 40px">
<td colspan="2" style="text-align: center;width: 60px;padding: 0 10px 0 10px">产品名称</td>
<td colspan="10" style="text-align: center;">{{ productName1Value }}</td>
<td colspan="2" style="text-align: center;">产品ID</td>
<td colspan="10" style="text-align: center;">{{ productIDValue }}</td>
</tr>
<tr style="height: 40px">
<td colspan="2" style="text-align: center;width: 60px;padding: 0 10px 0 10px">规格型号</td>
<td colspan="10" style="text-align: center;">{{ specificationModel }}</td>
<td colspan="2" style="text-align: center;">&nbsp;&nbsp;</td>
<td colspan="10" style="text-align: center;">{{ turnSpeedValue }}</td>
</tr>
<tr style="height: 40px">
<td colspan="2" style="text-align: center;width: 60px;padding: 0 10px 0 10px">编号</td>
<td colspan="10" style="text-align: center;">检测项</td>
<td colspan="2" style="text-align: center;">允许值</td>
<td colspan="4" style="text-align: center;">实测值</td>
<td colspan="6" style="text-align: center;">判定</td>
</tr>
<tr v-for="(list,index) in tableData20" :key="index" style="height: 40px">
<td colspan="2" style="text-align: center;width: 60px;padding: 0 10px 0 10px">{{ list.编号 }}</td>
<td colspan="10" style="text-align: center;">{{ list.检测项 }}</td>
<td colspan="2" style="text-align: center;">{{ list.允许值 }}</td>
<td colspan="4" style="text-align: center;">{{ list.实测值 }}</td>
<td colspan="6" style="text-align: center;">
<el-checkbox v-model="list.checkNum1" disabled style="margin: 0">精密级</el-checkbox>
<el-checkbox v-model="list.checkNum2" disabled style="margin-left: 10px">高精密级</el-checkbox>
</td>
</tr>
</table>
<table
cellspacing="0px"
align="center"
style="table-layout:fixed;border-color: black!important;"
border="1px solid black"
width="100%; ">
<tr style="height: 40px">
<td colspan="24" style="font-size: 20px">
&nbsp;&nbsp;结论&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{ conclusion }}
</td>
</tr>
<tr style="height: 40px">
<td colspan="3" style="text-align: center;">装配人员</td>
<td colspan="3" style="text-align: center;">{{ assemblerPeople }}</td>
<td colspan="2" style="text-align: center;">检验</td>
<td colspan="4" style="text-align: center;">{{ testPeople }}</td>
<td colspan="2" style="text-align: center;">审核</td>
<td colspan="4" style="text-align: center;">{{ toExamine }}</td>
<td colspan="2" style="text-align: center;">品检部</td>
<td colspan="4" style="text-align: center;">{{ qualitDepartment }}</td>
</tr>
</table>
</div>
</div>
</el-dialog>
</el-card>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import $ from 'jquery'
export default {
data() {
return {
dateRange: '',
batchNumber: '',
productID1: '',
warehouseNumber: '',
productOrder: '', // 产品流水号
orderNumberTypeValue: '', // 订单号
orderNumberType: [], // 订单号数组
testItemValue111: '', // 检测项流水号
testItemValue: '', // 检测项
testItem: [], // 检测项数组
productName1: [], // 产品名称数组
productName1Value: '', // 产品名称
// productpartNameValue: '', // 产品名称
// productpartName: [], // 产品名称数组
productID: [], // 产品ID
productIDValue: '', // 产品ID
acknowledgingTimeValue: '', // 检测时间
tableData: [],
tableData1: [],
tableData2: [],
tableData20: [],
tableData3: [],
tableData10: [],
// dialogFormVisible: false,
dialogFormVisible: false, // 质检
dialogFormVisible1: false, // 质检
siteFactory: '',
Telephone: '',
webSite: '', // 网址
Fax: '', // 传真
qdrawing: '', // 图纸
productName: '', // 产品名称
productBarcode: '', // 产品条形码
specificationModel: '', // 规格型号
turnSpeed1: '',
turnSpeed: [], // 转速
turnSpeedValue: '', // 转速
conclusion: '本产品检验符合要求,准予出厂。', // 结论
assemblerPeople: '', // 装配人员
testPeople: '', // 检验
toExamine: '', // 审核
qualitDepartment: '', // 品检部
numberOne: '', // 编号1
numberTwo: '', // 编号2
numberThree: '', // 编号3
numberFour: '', // 编号4
numberFive: '', // 编号5
numberSix: '', // 编号6
testItemsOne: '', // 检测项目1
testItemsTwo: '', // 检测项目2
testItemsThree: '', // 检测项目3
testItemsFour: '', // 检测项目4
testItemsFive: '', // 检测项目5
testItemsSix: '', // 检测项目6
allowablevalueOne: '', // 允许值1
allowablevalueTwo: '', // 允许值2
allowablevalueThree: '', // 允许值3
allowablevalueFour: '', // 允许值4
allowablevalueFive: '', // 允许值5
allowablevalueSix: '', // 允许值6
classmeasuredvalue: '0.05', // 类测值
classmeasuredvalueOne: '0.05', // 类测值1
classmeasuredvalueTwo: '0.05', // 类测值2
classmeasuredvalueThree: '0.05', // 类测值3
classmeasuredvalueFour: '0.05', // 类测值4
classmeasuredvalueFive: '0.05', // 类测值5
classmeasuredvalueSix: '0.05', // 类测值6
numberTest: '', // 编号
piciNumber: '',
total: 0, // 分页总数
pageCurrent: 1, // 分页当前页
pageSize: 20, // 分页每页显示条数
form: {
siteFactory: '', // 厂址
siteWeb: '', // 网址
telePhone: '', // 电话
teleFax: '', // 传真
testItems: '', // 检测项目
allowableValue: '', // 允许值
peopleAssembler: '', // 装配人员
peopleTest: '', // 检验
peopleExamine: '', // 审核
qualityDepartment: '' // 品检部
},
title: '',
dateTime: '',
rules: {}
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
updated() {
if (this.$refs['table']) {
this.$nextTick(() => {
this.$refs['table'].doLayout()
})
}
},
created() {
this.searchTable()
this.getOrderNumberType('')
},
methods: {
// changeState(row) {
// if (row.判定状态1 === false) {
// row.判定状态1 = '1'
// } else {
// row.判定状态1 = '0'
// }
// },
getOrderNumberType(query) {
this.orderNumberType = []
var param = []
param[0] = ['订单编号', query]
var Data = this.CreateData('11', '检测数据录入_订单信息_列表_查询数据_bak', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.orderNumberType.push({
label: response.data[i].订单编号,
value: response.data[i].订单流水号
})
}
})
},
searchTable() {
this.tableData10 = []
let orderNumberTypeValue_check, dateRange_check, piciNumber_check
this.orderNumberTypeValue ? orderNumberTypeValue_check = 1 : orderNumberTypeValue_check = 0
this.dateRange ? dateRange_check = 1 : (dateRange_check = 0, this.dateRange = '')
this.piciNumber ? piciNumber_check = 1 : piciNumber_check = 0
const param = []
param[0] = ['订单号_check', orderNumberTypeValue_check]
param[1] = ['订单号', this.orderNumberTypeValue]
param[2] = ['时间_check', dateRange_check]
param[3] = ['开始时间', this.dateRange[0]]
param[4] = ['结束时间', this.dateRange[1]]
param[5] = ['批次编号_check', piciNumber_check]
param[6] = ['批次编号', this.piciNumber]
var Data = this.CreateData('11', '检测数据录入_查询', param, this.pageSize, this.pageCurrent)
this.ExecDatabase(Data).then(response => {
// console.log(response.data)
if (response.data.rows.length !== 0) {
for (let i = 0; i < response.data.rows.length; i++) {
console.log(response.data.rows[i].订单流水号, 2222)
this.tableData10.push({
// 表示将从数据库中查询到的数据,分别对应填充到表格中
订单流水号: response.data.rows[i].订单流水号 ? Number(response.data.rows[i].订单流水号) : '',
订单编号: response.data.rows[i].订单编号,
批次编号: response.data.rows[i].批次编号,
出库数量: response.data.rows[i].出库数量,
检测时间: response.data.rows[i].检测时间,
物料编号: response.data.rows[i].物料编码,
出库记录流水号: response.data.rows[i].出库记录流水号,
订单流水号_before: response.data.rows[i].订单流水号,
edit: false
})
}
}
this.total = response.data.total
this.loading = false
}).then(() => {
this.tableData = this.tableData10
console.log(this.tableData, 11111)
})
},
searchTable1() {
var param = []
param[0] = ['主轴批次号', this.batchNumber]
var Data = this.CreateData('11', '检测项录入_检测项维护_查询', param)
this.ExecDatabase(Data).then(response => {
this.tableData1 = []
for (let i = 0; i < response.data.length; i++) {
let 判定状态1, 判定状态2
if (Number(response.data[i].判定状态1) === 1) {
判定状态1 = true
} else {
判定状态1 = false
}
if (Number(response.data[i].判定状态2) === 1) {
判定状态2 = true
} else {
判定状态2 = false
}
this.tableData1.push({
id: response.data[i].id,
编号: response.data[i].编号,
检测项目: response.data[i].检测项目,
允许值: response.data[i].允许值,
实测值: response.data[i].实测值,
判定状态1: 判定状态1,
判定状态2: 判定状态2
})
}
})
},
searchTable2() {
this.tableData20 = []
var param = []
param[0] = ['主轴批次号', this.batchNumber]
var Data = this.CreateData('11', '[检测项录入_检测项维护_查询]', param)
this.ExecDatabase(Data).then(response => {
console.log(response.data)
for (let i = 0; i < response.data.length; i++) {
this.tableData20.push({
编号: response.data[i].编号,
检测项: response.data[i].检测项目,
允许值: response.data[i].允许值,
实测值: response.data[i].实测值,
checkNum1: response.data[i].判定状态1,
checkNum2: response.data[i].判定状态2
})
}
})
},
searchTable3() {
var param = []
param[0] = ['主轴批次号', this.batchNumber]
var Data = this.CreateData('11', '检测数据录入_产品查询_基础表_查询', param)
this.ExecDatabase(Data).then(response => {
if (response.data.length > 0) {
for (let i = 0; i < response.data.length; i++) {
this.productIDValue = response.data[i].产品ID
this.turnSpeedValue = response.data[i].转速
this.productName1Value = response.data[i].产品名称
this.specificationModel = response.data[i].产品规格
}
} else {
this.productIDValue = ''
this.turnSpeedValue = ''
}
})
},
searchTable4() {
var param = []
var Data = this.CreateData('11', '基础表_检验信息维护表_查询', param)
this.ExecDatabase(Data).then(response => {
if (response.data.length > 0) {
for (let i = 0; i < response.data.length; i++) {
this.siteFactory = response.data[i].厂址
this.Telephone = response.data[i].电话
this.webSite = response.data[i].网址
this.Fax = response.data[i].传真
this.assemblerPeople = response.data[i].装配人员
this.testPeople = response.data[i].检验人员
this.toExamine = response.data[i].审核人员
this.qualitDepartment = response.data[i].品管部门
}
}
})
},
cancelEdit(index, row) {
row.edit = false
row.订单流水号 = this.tableData[index].订单流水号_before
this.$message('取消修改')
},
confirmEdit2(row) {
var param = []
param[0] = ['出库记录流水号', row.出库记录流水号]
param[1] = ['订单流水号', row.订单流水号]
var Data = this.CreateData('12', '检测项录入_绑定订单', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('绑定成功')
this.searchTable()
} else {
this.$message.success('绑定失败')
}
})
},
submitUpdate() {
var param = []
param[0] = ['出库记录流水号', this.warehouseNumber]
var Data = this.CreateData('12', '检测项录入_检测完成', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('检测完成')
this.dialogFormVisible1 = false
this.searchTable()
} else {
this.$message.error('检测失败')
}
})
},
tesTing(row) {
this.warehouseNumber = row.出库记录流水号
this.batchNumber = row.批次编号
this.productName1Value = row.产品名称
this.specificationModel = row.产品详情
this.searchTable3()
this.searchTable1()
this.dialogFormVisible1 = true
},
lookCheck(row) {
this.batchNumber = row.批次编号
this.dateTime = row.检测时间
this.productName1Value = row.产品名称
this.specificationModel = row.产品详情
this.searchTable2()
this.searchTable3()
this.searchTable4()
this.dialogFormVisible = true
},
// 确定编辑
confirmEdit(row) {
var param = []
param[0] = ['id', row.id]
param[1] = ['实测值', row.实测值]
param[2] = ['判定状态1', row.判定状态1]
param[3] = ['判定状态2', row.判定状态2]
var Data = this.CreateData('12', '检测项录入_检测项维护_编辑', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
console.log('编辑成功')
// this.$message.success('编辑成功')
} else {
this.$message.error('编辑失败')
}
})
},
// 产品名称新增
confirmEdit1() {
var param = []
param[0] = ['主轴批次号', this.batchNumber]
param[1] = ['产品名称', this.productName1Value]
param[2] = ['产品ID', this.productIDValue]
param[3] = ['转速', this.turnSpeedValue]
param[4] = ['产品规格', this.specificationModel]
var Data = this.CreateData('12', '检测数据录入_产品查询_基础表_插入', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('编辑成功')
this.searchTable1()
} else {
this.$message.error('编辑失败')
}
})
},
handleSizeChanges(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable()
},
handleCurrentChanges(val) {
this.pageCurrent = val
this.searchTable()
},
exportTable() {
const htmlNode = $('#WGBLD').html()
const body = $('body')
body.children().hide()
const printNode = $(htmlNode)
body.append(printNode)
window.print()
body.children().not('script').show()
body.children().not('#app').hide()
printNode.remove()
}
}
}
</script>
<style scoped lang="scss">
/deep/ .el-checkbox__label {
padding-left: 5px;
}
/deep/ .el-table {
margin: 0;
}
/deep/ .qqqqwww {
border-right: 2px solid black !important;
border-bottom: 2px solid black !important;
border-top: 0px !important;
border-left: 1px solid black !important;
}
/deep/ .qqqqwww td {
border: 1px solid black !important;
/*border-left: 0px!important;*/
}
/deep/ .qqqqwww th.is-leaf {
border: 1px solid black !important;
border-top: 0px !important;
}
/deep/ .qqqqwww1 {
border-right: 2px solid black !important;
border-bottom: 0px !important;
border-top: 0px !important;
border-left: 1px solid black !important;
}
/deep/ .qqqqwww1 td {
border: 1px solid black !important;
/*border-left: 0px!important;*/
}
/deep/ .qqqqwww1 th.is-leaf {
border: 1px solid black !important;
border-top: 0px !important;
}
/*/deep/ .el-table .cell{*/
/* padding: 0px!important;*/
/*}*/
/*/deep/ .el-table .cell, .el-table--border td:first-child .cell, .el-table--border th:first-child .cell{*/
/* padding: 0px!important;*/
/*}*/
/deep/ .el-checkbox__input.is-disabled + span.el-checkbox__label {
color: #858689 !important;
}
/deep/ .el-checkbox__input.is-disabled .el-checkbox__inner {
border-color: black !important;
background-color: white;
}
/deep/ .el-checkbox__input.is-disabled.is-checked .el-checkbox__inner::after {
border-color: black !important;
}
</style>
<style scoped>
.process {
position: relative;
text-align: center;
/*border: 1px solid red;*/
background: url('../../../assets/img/zhuzhou.png') repeat;
background-repeat: no-repeat;
background-size: 100% 100%;
-moz-background-size: 100% 100%;
overflow: hidden;
}
</style>

View File

@@ -0,0 +1,475 @@
<template>
<div class="app-container">
<el-card style="height: 850px;padding: 0">
<el-tabs v-model="PartType" type="border-card" @tab-click="pageCurrent0=1;pageCurrent1=1;pageCurrent2=1;getData()">
<el-tab-pane label="员工工时统计" name="员工工时统计">
<el-row>
<div style="margin-top: 7px; margin-bottom: 7px">
<span style="font-size: 13px;color: black;margin-left:10px">日期</span>
<el-date-picker
v-model="dateRange"
size="small"
type="daterange"
align="center"
style="width: 240px;"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
@change="searchTable"/>
<el-button type="success" plain icon="el-icon-download" size="small" style="margin-left: 60px" @click="exportExcel()">导出</el-button>
</div>
<el-col style="margin-left: 7px;width: 281px">
<!-- <el-card>-->
<div style="margin-top: 10px">
<el-table
v-loading="loading"
ref="table"
:data="tableData"
highlight-current-row
show-summary
border
stripe
size="mini"
style="width: 281px;margin-top: 10px"
height="740"
@row-click="searchTable1">
<el-table-column :width="setColumnWidth('操作者')" label="操作者" align="center" prop="">
<template slot-scope="scope">
{{ scope.row.操作者 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" label="完成数量" align="center" prop="总数量">
<template slot-scope="scope">
{{ scope.row.总数量 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('加工工时M')" label="加工工时M" align="center" show-overflow-tooltip prop="加工工时">
<template slot-scope="scope">
{{ scope.row.加工工时 }}
</template>
</el-table-column>
</el-table>
</div>
<!-- </el-card>-->
</el-col>
<el-col style="margin-left: 10px;width: 1361px">
<!-- <el-card>-->
<div style="margin-top: 10px">
<el-table
v-loading="loading"
ref="table1"
:data="tableData1"
:header-cell-style="{background: '#2283D4',color: 'white'}"
highlight-current-row
show-summary
border
stripe
size="mini"
style="width: 1361px;margin-top: 10px"
height="740"
@sort-change="sortChange">
<el-table-column :width="setColumnWidth('序号')" type="index" label="序号" align="center"/>
<el-table-column :width="setColumnWidth('工序')" label="工序" align="center" prop="工序">
<template slot-scope="scope">
{{ scope.row.工序 }}
</template>
</el-table-column>
<el-table-column width="75px" label="工序顺序" align="center">
<template slot-scope="scope">
{{ scope.row.工序顺序 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('零件名称')" label="零件名称" align="center" prop="零件名称">
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column width="117px" label="零件图号" align="center">
<template slot-scope="scope">
{{ scope.row.图号 }}
</template>
</el-table-column>
<el-table-column width="95px" label="物料编号" align="center">
<template slot-scope="scope">
{{ scope.row.物料编码 }}
</template>
</el-table-column>
<el-table-column width="60px" label="加工数" align="center" prop="完成数">
<template slot-scope="scope">
{{ scope.row.完成数 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('加工工时M')" label="加工工时M" align="center" show-overflow-tooltip prop="加工时长">
<template slot-scope="scope">
{{ scope.row.加工时长 }}
</template>
</el-table-column>
<el-table-column width="90px" label="暂停时长" align="center" show-overflow-tooltip prop="暂停时间">
<template slot-scope="scope">
{{ scope.row.暂停时间 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('日期时间')" label="开始加工时间" align="center">
<template slot-scope="scope">
{{ scope.row.开始加工 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('日期时间')" label="完成时间" align="center" prop="完成时间" sortable="完成时间">
<template slot-scope="scope">
{{ scope.row.结束加工 }}
</template>
</el-table-column>
<el-table-column label="设备" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.工位号 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('订单编号')" 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>
<!-- </el-card>-->
</el-col>
</el-row>
</el-tab-pane>
<el-tab-pane label="设备工时统计" name="设备工时统计">
<el-row>
<div style="margin-top: 7px; margin-bottom: 7px">
<span style="font-size: 13px;color: black;margin-left:10px">日期</span>
<el-date-picker
v-model="dateRange"
size="small"
type="daterange"
align="center"
style="width: 240px;"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
@change="searchTable2"/>
<!-- <el-button type="success" plain icon="el-icon-download" size="small" style="margin-left: 760px" @click="exportExcel()">导出</el-button>-->
</div>
<el-col style="margin-left: 7px;width: 321px">
<!-- <el-card>-->
<div style="margin-top: 10px">
<el-table
v-loading="loading"
ref="table2"
:data="tableData2"
highlight-current-row
show-summary
border
stripe
size="mini"
style="width: 323px;margin-top: 10px"
height="740"
@row-click="searchTable3">
<el-table-column label="设备" align="center" prop="">
<template slot-scope="scope">
{{ scope.row.设备 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" label="完成数量" align="center" prop="总数量">
<template slot-scope="scope">
{{ scope.row.总数量 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('加工工时M')" label="加工工时M" align="center" show-overflow-tooltip prop="加工工时">
<template slot-scope="scope">
{{ scope.row.加工工时 }}
</template>
</el-table-column>
</el-table>
</div>
<!-- </el-card>-->
</el-col>
<el-col style="margin-left: 10px;width: 1301px">
<!-- <el-card>-->
<div style="margin-top: 10px">
<el-table
v-loading="loading"
ref="table3"
:data="tableData3"
:header-cell-style="{background: '#2283D4',color: 'white'}"
highlight-current-row
show-summary
border
stripe
size="mini"
style="width: 1301px;margin-top: 10px"
height="740"
@sort-change="sortChange1">
<el-table-column :width="setColumnWidth('序号')" type="index" label="序号" align="center"/>
<el-table-column :width="setColumnWidth('工序')" label="工序" align="center" prop="工序">
<template slot-scope="scope">
{{ scope.row.工序 }}
</template>
</el-table-column>
<el-table-column width="75px" label="工序顺序" align="center">
<template slot-scope="scope">
{{ scope.row.工序顺序 }}
</template>
</el-table-column>
<el-table-column label="零件名称" align="center" prop="零件名称">
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column width="117px" label="零件图号" align="center">
<template slot-scope="scope">
{{ scope.row.图号 }}
</template>
</el-table-column>
<el-table-column width="95px" label="物料编号" align="center">
<template slot-scope="scope">
{{ scope.row.物料编码 }}
</template>
</el-table-column>
<el-table-column width="60px" label="加工数" align="center" prop="完成数">
<template slot-scope="scope">
{{ scope.row.完成数 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('加工工时M')" label="加工工时M" align="center" show-overflow-tooltip prop="加工时长">
<template slot-scope="scope">
{{ scope.row.加工时长 }}
</template>
</el-table-column>
<el-table-column width="90px" label="暂停时长" align="center" show-overflow-tooltip prop="暂停时间">
<template slot-scope="scope">
{{ scope.row.暂停时间 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('日期时间')" label="开始加工时间" align="center">
<template slot-scope="scope">
{{ scope.row.开始加工 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('日期时间')" label="完成时间" align="center" prop="完成时间" sortable="完成时间">
<template slot-scope="scope">
{{ scope.row.结束加工 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('姓名')" label="操作者" align="center">
<template slot-scope="scope">
{{ scope.row.操作者 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('订单编号')" 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>
<!-- </el-card>-->
</el-col>
</el-row>
</el-tab-pane>
</el-tabs>
</el-card>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
export default {
data() {
return {
PartType: '员工工时统计',
rowNumber: '',
rowNumber1: '',
customerNameValue: '', // 买方名称
customerName: [], // 买方名称数组
dateRange: '', // 提交日期
contractStateValue: '', // 合同状态
contractState: [
{
value: 2,
label: '未提交'
}, {
value: 1,
label: '提交'
}
], // 合同状态数组
loading: false, // 数据加载
total: 0, // 分页总数
total1: 0, // 分页总数
total2: 0, // 分页总数
total3: 0, // 分页总数
tableData: [], // 员工工时
tableData1: [], // 员工工时明细
tableData2: [], // 设备工时
tableData3: [], // 设备工时明细
pageCurrent: 1, // 分页当前页
pageSize: 100, // 分页每页显示条数
pageCurrent1: 1, // 分页当前页
pageSize1: 100, // 分页每页显示条数
pageCurrent2: 1, // 分页当前页
pageSize2: 100, // 分页每页显示条数
pageCurrent3: 1, // 分页当前页
pageSize3: 100, // 分页每页显示条数
orderName: '', // 排序列名
order: '', // 排序方式
orderName1: '', // 排序列名
order1: '' // 排序方式
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
updated() {
this.$nextTick(() => {
this.$refs['table'].doLayout()
this.$refs['table1'].doLayout()
this.$refs['table2'].doLayout()
this.$refs['table3'].doLayout()
})
},
methods: {
getData() {
if (this.PartType === '员工工时统计') {
this.searchTable()
} else if (this.PartType === '设备工时统计') {
this.searchTable2()
}
},
searchTable() {
var param = []
param[0] = ['开始时间', this.dateRange[0]]
param[1] = ['结束时间', this.dateRange[1]]
var Data = this.CreateData('11', '车间生产管理_工人工时统计_查询数据', param)
this.ExecDatabase(Data).then(response => {
this.tableData = response.data
})
},
exportExcel() {
if (this.dateRange[0] && this.dateRange[1]) {
var param = []
param[0] = ['开始时间', this.dateRange[0]]
param[1] = ['结束时间', this.dateRange[1]]
param[2] = ['排序名称', this.orderName]
param[3] = ['排序方式', this.order]
var Data = this.CreateData('2001', '报表_精工车间_员工工时统计_查询数据', param)
this.exportExcel_NPOI(Data)
} else {
this.$message.warning('暂无数据')
}
},
searchTable1(row) {
this.rowNumber = row.操作者编号
var param = []
param[0] = ['操作者编号', row.操作者编号]
param[1] = ['开始时间', this.dateRange[0]]
param[2] = ['结束时间', this.dateRange[1]]
param[3] = ['排序名称', this.orderName]
param[4] = ['排序方式', this.order]
var Data = this.CreateData('11', '精工车间_员工工时统计_详情_查询数据', param)
this.ExecDatabase(Data).then(response => {
this.tableData1 = response.data
})
},
searchTable2() {
var param = []
param[0] = ['开始时间', this.dateRange[0]]
param[1] = ['结束时间', this.dateRange[1]]
var Data = this.CreateData('11', '车间生产管理_设备工时统计_查询数据', param)
this.ExecDatabase(Data).then(response => {
this.tableData2 = response.data
})
},
searchTable3(row) {
this.rowNumber1 = row.设备
var param = []
param[0] = ['设备', row.设备]
param[1] = ['开始时间', this.dateRange[0]]
param[2] = ['结束时间', this.dateRange[1]]
param[3] = ['排序名称', this.orderName1]
param[4] = ['排序方式', this.order1]
var Data = this.CreateData('11', '精工车间_设备工时统计_详情_查询数据', param)
this.ExecDatabase(Data).then(response => {
this.tableData3 = response.data
})
},
sortChange(column) {
if (column.prop === '完成时间') {
this.orderName = 1
} else {
this.orderName = 0
}
if (column.order === 'ascending') {
this.order = 1
} else if (column.order === 'descending') { this.order = 2 } else {
this.order = ''
}
var param = []
param[0] = ['操作者编号', this.rowNumber]
param[1] = ['开始时间', this.dateRange[0]]
param[2] = ['结束时间', this.dateRange[1]]
param[3] = ['排序名称', this.orderName]
param[4] = ['排序方式', this.order]
var Data = this.CreateData('11', '精工车间_员工工时统计_详情_查询数据', param)
this.ExecDatabase(Data).then(response => {
this.tableData1 = response.data
})
},
sortChange1(column) {
if (column.prop === '完成时间') {
this.orderName1 = 1
} else {
this.orderName1 = 0
}
if (column.order === 'ascending') {
this.order1 = 1
} else if (column.order === 'descending') { this.order1 = 2 } else {
this.order1 = ''
}
var param = []
param[0] = ['设备', this.rowNumber1]
param[1] = ['开始时间', this.dateRange[0]]
param[2] = ['结束时间', this.dateRange[1]]
param[3] = ['排序名称', this.orderName1]
param[4] = ['排序方式', this.order1]
var Data = this.CreateData('11', '精工车间_设备工时统计_详情_查询数据', param)
this.ExecDatabase(Data).then(response => {
this.tableData3 = response.data
})
},
handleSizeChanges(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable()
},
handleCurrentChanges(val) {
this.pageCurrent = val
this.searchTable()
}
}
}
</script>
<style scoped lang="scss">
/deep/ .el-card__body{
padding: 0px!important;
}
</style>

View File

@@ -0,0 +1,934 @@
<template>
<div class="app-container">
<el-card style="height: 850px">
<el-row>
<el-col style="width: 51%">
<!-- <el-card>-->
<div style="margin-top: 10px">
<div style="margin-top: 7px; margin-bottom: 7px">
<el-select
v-model="orderNameValue"
:remote-method="getOrderName"
style="width:200px"
placeholder="订单号"
size="small"
filterable
clearable
remote
@change="pageCurrent=1;searchTable();getProductName()">
<el-option
v-for="item in orderName1"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-select
v-model="productNameValue"
style="width:200px"
placeholder="产品/部件名称"
size="small"
filterable
clearable
@change="pageCurrent=1;searchTable()">
<el-option
v-for="item in productName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-input
v-model="partNameValue"
style="width: 150px"
size="small"
clearable
placeholder="名称或图号"
@keyup.enter.native="pageCurrent=1;searchTable()"/>
<el-button
icon="el-icon-search"
type="primary"
plain
size="small"
style="margin-left: 10px"
@click="pageCurrent = 1;searchTable()">查询
</el-button>
<el-button
v-show="IsItUrgent===0"
type="warning"
plain
size="small"
style="margin-left: 10px"
@click="Urgent()">加急
</el-button>
<el-button
v-show="IsItUrgent===1"
type="warning"
plain
size="small"
style="margin-left: 10px"
@click="CancelUrgent()">取消加急
</el-button>
<el-button type="success" plain size="small" style="margin-left: 10px" @click="getNum()">查看图纸
</el-button>
</div>
<el-table
v-loading="loading"
:data="tableData"
:row-class-name="tableRowClassName"
:row-key="getRowKeys"
:cell-class-name="rowStyle"
highlight-current-row
border
size="mini"
style="width: 100%;margin-top: 10px"
height="750"
@row-click="searchTable1">
<el-table-column :width="setColumnWidth('序号')" label="序号" type="index" align="center"/>
<el-table-column :width="setColumnWidth('订单号')" label="订单号" align="center">
<template slot-scope="scope">
{{ scope.row.订单号 }}
</template>
</el-table-column>
<el-table-column
:width="setColumnWidth('产品名称')"
label="产品名称"
align="center"
show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.产品名称 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('零件图号')" label="零件图号" align="center">
<template slot-scope="scope">
{{ scope.row.零件图号 }}
</template>
</el-table-column>
<el-table-column width="100px" label="零件名称" align="center">
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" label="数量" align="center">
<template slot-scope="scope">
{{ scope.row.数量 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" label="毛坯库存" align="center">
<template slot-scope="scope">
{{ scope.row.库存 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('日期')" label="下达日期" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.接收任务 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('日期')" label="完工期限" align="center">
<template slot-scope="scope">
{{ scope.row.精工期限 }}
</template>
</el-table-column>
<el-table-column width="100px" label="订单备注" align="center">
<template slot-scope="scope">
{{ scope.row.订单备注 }}
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40, 100]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChanges"
@current-change="handleCurrentChanges"/>
</div>
</div>
<!-- </el-card>-->
</el-col>
<el-col style="margin-left: 1%;width: 44%;">
<!-- <el-card>-->
<div style="margin-top: 10px">
<div style="margin-top: 7px; margin-bottom: 7px">
<el-select
v-model="peopleValue"
style="width:100px"
placeholder="操作者"
size="small"
filterable
clearable>
<el-option
v-for="item in people"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-select
v-model="machineValue"
style="width:200px"
placeholder="设备"
size="small"
filterable
clearable>
<el-option
v-for="item in machine"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</div>
<el-table
v-loading="loading1"
:data="tableData1"
:header-cell-style="{background: '#2283D4',color: 'white'}"
:row-class-name="tableRowClassName1"
highlight-current-row
border
size="mini"
height="370px"
style="width: 100%;margin-top: 10px"
@row-click="XUANCHU">
<!--<el-table-column :width="setColumnWidth('零件名称')" label="零件名称" align="center">
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('图号或型号')" label="图号" align="center">
<template slot-scope="scope">
{{ scope.row.图号或型号 }}
</template>
</el-table-column>-->
<el-table-column :width="setColumnWidth('序号')" label="序号" align="center">
<template slot-scope="scope">
{{ scope.row.工序顺序 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('工序')" label="工序名" align="center">
<template slot-scope="scope">
{{ scope.row.工序 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" label="投产数" align="center">
<template slot-scope="scope">
{{ scope.row.数量 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" label="完成数" align="center">
<template slot-scope="scope">
{{ scope.row.完成数 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('姓名')" label="操作者" align="center">
<template slot-scope="scope">
{{ scope.row.姓名 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" label="报废数量" align="center">
<template slot-scope="scope">
{{ scope.row.报废数量 }}
</template>
</el-table-column>
<el-table-column width="180px" label="加工设备" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.设备 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('日期')" label="派工时间" align="center">
<template slot-scope="scope">
{{ scope.row.分配时间 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button
:disabled="Number(scope.row.是否加工中)===1 || Number(scope.row.完成数)===0 || (Number(scope.row.数量)-Number(scope.row.完成数))===0 || scope.row.姓名==='外协'"
type="text"
icon="el-icon-edit"
size="mini"
@click="editData(scope.row)">编辑
</el-button>
</template>
</el-table-column>
</el-table>
</div>
<!-- </el-card>-->
</el-col>
<el-col style="margin-left: 1%;width: 44%">
<!-- <el-card>-->
<div style="margin-top: 10px">
<el-table
v-loading="loading1"
:data="tableData2"
:header-cell-style="{background: '#2283D4',color: 'white'}"
:row-class-name="tableRowClassName2"
highlight-current-row
border
size="mini"
height="370px"
style="width: 100%;margin-top: 10px"
@row-click="XUANRU">
<el-table-column width="50px" label="序号" align="center" prop="序号">
<template slot-scope="scope">
{{ scope.row.工序顺序 }}
</template>
</el-table-column>
<el-table-column label="工序" width="90px" align="center" prop="工序">
<template slot-scope="scope">
{{ scope.row.工序 }}
</template>
</el-table-column>
<el-table-column width="140px" label="分配数" align="center">
<template slot-scope="scope">
<el-input-number
v-model="scope.row.分配数"
:min="0"
:max="scope.row.最大分配数"
size="small"
style="width: 100%"
@click.native.stop/>
</template>
</el-table-column>
<el-table-column label="已分配数" width="85px" align="center">
<template slot-scope="scope">
{{ scope.row.已分配数 }}
</template>
</el-table-column>
<el-table-column label="投产数" width="85px" align="center">
<template slot-scope="scope">
{{ scope.row.数量 }}
</template>
</el-table-column>
<el-table-column label="计划开始" align="center">
<template slot-scope="scope">
<el-date-picker
v-model="scope.row.计划开始日期"
size="small"
align="center"
style="width: 135px;margin-right: 20px"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
placeholder="选择日期"
@click.native.stop/>
</template>
</el-table-column>
<el-table-column label="计划完成" align="center">
<template slot-scope="scope">
<el-date-picker
v-model="scope.row.计划完成日期"
size="small"
align="center"
style="width: 135px;margin-right: 20px"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
placeholder="选择日期"
@click.native.stop/>
</template>
</el-table-column>
</el-table>
</div>
<!-- </el-card>-->
</el-col>
</el-row>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible" title="修改投产数" center width="400px">
<el-form
ref="form"
:model="form"
:rules="rules"
label-position="center"
label-width="110px"
class="demo-ruleForm">
<el-row>
<el-col :span="12">
<el-form-item label="投产数" prop="投产数">
<el-input-number
v-model="form.投产数"
:max="productionNum"
:min="finishNum"
:step="1"
size="small"
style="width:200px"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="callOff()">取消</el-button>
<el-button type="distribution" size="small" @click="submit()">确定</el-button>
</div>
</el-dialog>
<el-dialog v-el-drag-dialog :visible.sync="dialogVisible" width="350px">
<div v-for="(file, key) in hadFile" :key="key">
<div class="wrapper">
<div class="content">
<div v-if="file.suffix==='pdf'" class="icon">
<svg-icon icon-class="pdf"/>
</div>
<div v-else-if="file.suffix==='docx'||file.suffix === 'doc'" class="icon">
<svg-icon icon-class="doc"/>
</div>
<div v-else-if="file.suffix==='xlsx' || file.suffix === 'xls'" class="icon">
<svg-icon icon-class="excel"/>
</div>
<div v-else-if="file.suffix==='pptx' || file.suffix === 'ppt'" class="icon">
<svg-icon icon-class="ppt"/>
</div>
<div v-else-if="file.suffix==='jpg' || file.suffix === 'jpeg'|| file.suffix === 'png'" class="icon">
<svg-icon icon-class="pic"/>
</div>
<div v-else class="icon">
<svg-icon icon-class="file"/>
</div>
<a id="appUrl" :href="file.url" target="view_window">
<div class="info">{{ file.name }}</div>
</a>
</div>
</div>
</div>
</el-dialog>
</el-card>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import request, { MESDownloadFile, wsuri } from '@/utils/request'
export default {
data() {
return {
tableData2: [],
machine: [],
machineValue: '',
people: [],
peopleValue: '',
processValue: '',
productionNum: '',
finishNum: '',
partTool: '',
dateRange: '', // 提交日期
contractStateValue: '', // 合同状态
partNameValue: '', // 零件名称
productNameValue: '', // 产品部件名称
productName: [],
orderNameValue: '', // 订单名称
orderName1: [],
proccessStateValue: '',
processSequence: '',
IsItUrgent: 0,
dialogVisible: false,
dialogFormVisible: false,
hadFile: [],
form: {
投产数: ''
},
loading2: true,
rules: {
投产数: [{ required: true, message: '请输入投产数', trigger: 'blur' }]
},
machineName: '',
loading: false, // 数据加载
loading1: false, // 数据加载
total: 0, // 分页总数
tableData: [], // 零件表
tableData1: [], // 工序表
pageCurrent: 1, // 分页当前页
pageSize: 40, // 分页每页显示条数
orderName: '', // 排序列名
order: '' // 排序方式
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
watch: {
machineValue(val) {
for (let i = 0; i < this.machine.length; i++) {
if (val === this.machine[i].value) {
this.machineName = this.machine[i].name
}
}
}
},
created() {
this.getOrderName('')
this.searchTable()
this.getMachine()
this.getPeople()
this.initWebpack()
},
methods: {
// 初始化websocket
initWebpack() {
this.websock = new WebSocket(wsuri)// 这里面的this都指向vue
this.websock.onopen = this.websocketopen
this.websock.onclose = this.websocketclose
this.websock.onerror = this.websocketerror
},
// 打开
websocketopen() {
console.log('WebSocket连接成功')
},
// 数据接收
websocketonmessage(msg) {
// this.partNumberP = msg.data.split('|')[3]
// this.partNumber = this.partNumberP.slice(1)
// this.getscantable(this.partNumber)
},
// 关闭
websocketclose() {
console.log('WebSocket关闭')
},
// 失败
websocketerror() {
console.log('WebSocket连接失败')
},
// 查看零件图
getNum() {
if (this.partTool) {
this.dialogVisible = true
this.getFileList(this.partTool)
} else {
this.$message.warning('请先选择零件')
}
},
async getFileList(value) {
value = value.replace('B1', '')
console.log(value, 66666)
this.hadFile = []
if (value) {
await request({
url: '',
method: 'post',
data: {
type: '3',
name: `select * from 机加工MES_零件图PDF表 where 是否启用 = 1 and name = '${value}'`
}
}).then(data => {
this.suffix = data.data
if (data.data.length > 0) {
const server = `${MESDownloadFile}`.split('/')
data.data.map(item => {
this.hadFile.push({
url: `http://${server[2]}/webpage/part/${item.uid}.${item.suffix}`,
name: `${item.name}.${item.suffix}`,
suffix: item.suffix,
id: item.uid
})
})
}
})
}
},
saveDate(row) {
var param = []
param[0] = ['工序流水号', row.工序流水号]
param[1] = ['计划完成日期', row.计划完成日期]
var Data = this.CreateData('12', '车间生产管理工艺_零件工序_派工_设置计划完成日期', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('日期更新成功')
} else {
this.$message.error('日期更新失败')
}
})
},
getMachine() {
var param = []
var Data = this.CreateData('11', '设备信息_查询', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.machine.push({
label: response.data[i].设备名称 !== '外协' ? response.data[i].设备名称 + '_' + response.data[i].工位号 : response.data[i].设备名称,
value: response.data[i].设备流水号,
name: response.data[i].工位号
})
}
})
},
getPeople() {
var param = []
param[0] = ['考核部门编号', 19]
var Data = this.CreateData('11', '人事档案管理_人员_部门与人员_派工_查询数据_根据部门编号', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.people.push({
label: response.data[i].姓名,
value: response.data[i].人员编号
})
}
})
},
rowStyle({ row, column, rowIndex, columnIndex }) {
if (Number(row.是否加急) === 1 && columnIndex === 0) {
return 'red'
}
},
getOrderName(query) {
this.orderName1 = []
var param = []
param[0] = ['订单编号', query]
var Data = this.CreateData('11', '订单信息_列表_查询数据_bak', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.orderName1.push({
label: response.data[i].订单编号,
value: response.data[i].订单流水号
})
}
})
},
getProductName() {
this.productNameValue = ''
this.productName = []
if (this.orderNameValue) {
var param = []
param[0] = ['订单流水号', this.orderNameValue]
var Data = this.CreateData('11', '订单信息_产品信息_查询数据', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.productName.push({
label: response.data[i].产品名称,
value: response.data[i].组件流水号
})
}
})
}
},
searchTable() {
this.tableData1 = []
this.tableData2 = []
let orderNameValue_check, productNameValue_check, partNameValue_check
this.orderNameValue ? orderNameValue_check = 1 : orderNameValue_check = 0
this.productNameValue ? productNameValue_check = 1 : productNameValue_check = 0
this.partNameValue ? partNameValue_check = 1 : partNameValue_check = 0
var param = []
param[0] = ['订单流水号_check', orderNameValue_check]
param[1] = ['订单流水号', this.orderNameValue]
param[2] = ['组件流水号', this.productNameValue]
param[3] = ['组件流水号_check', productNameValue_check]
param[4] = ['零件名称_check', partNameValue_check]
param[5] = ['零件名称', this.partNameValue]
var Data = this.CreateData('11', '精工车间_车间派工_查询', param, this.pageSize, this.pageCurrent)
this.ExecDatabase(Data).then(response => {
this.tableData = response.data.rows
this.total = response.data.total
})
},
searchTable1(row) {
this.partTool = row.零件图号
this.processValue = row.工艺计划流水号
this.IsItUrgent = Number(row.是否加急)
var param = []
param[0] = ['工艺计划流水号', row.工艺计划流水号]
var Data = this.CreateData('11', '车间生产管理工艺_零件工序_已派工查询', param)
this.ExecDatabase(Data).then(response => {
this.tableData1 = response.data
})
var param1 = []
param1[0] = ['工艺计划流水号', row.工艺计划流水号]
var Data1 = this.CreateData('11', '车间生产管理工艺_零件工序_派工_工序查询', param1)
this.ExecDatabase(Data1).then(response => {
this.tableData2 = response.data
})
},
sortChange1(column) {
if (column.prop === '完工期限') {
this.orderName = 1
} else {
this.orderName = 0
}
if (column.order === 'ascending') {
this.order = 1
} else if (column.order === 'descending') {
this.order = 2
} else {
this.order = ''
this.orderName = 0
}
this.searchTable()
},
getRowKeys(row) {
return row.工艺计划流水号
},
tableRowClassName({ row, rowIndex }) {
row.index = rowIndex
if (Number(row.已分配) === 1 && Number(row.考核状态) < 3) {
return 'CompleteColor'
}
if (Number(row.考核状态) >= 3) {
return 'gray'
}
},
// 工序状态变色
tableRowClassName1({ row, rowIndex }) {
row.index = rowIndex
if (Number(row.完成数) === Number(row.数量) || Number(row.工序状态) === 4) {
return 'CompleteColor'
}
},
tableRowClassName2({ row, rowIndex }) {
row.index = rowIndex
if (Number(row.已分配数) === Number(row.数量)) {
return 'CompleteColor'
}
},
editData(row) {
this.productionNum = row.数量
this.form.投产数 = row.数量
this.finishNum = row.完成数
this.proccessStateValue = row.工艺任务流水号
this.processSequence = row.工序顺序
this.dialogFormVisible = true
},
submit() {
this.$refs['form'].validate((valid) => {
if (valid) {
if (this.productionNum === this.form.投产数) {
this.$message.warning('数量未发生改变')
} else {
var param = []
param[0] = ['工艺任务流水号', this.proccessStateValue]
param[1] = ['原数量', this.productionNum]
param[2] = ['数量', this.form.投产数]
param[3] = ['工序顺序', this.processSequence]
var Data = this.CreateData('12', '车间生产管理工艺_零件工序_派工_修改数量', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('修改成功')
var param = []
param[0] = ['工艺计划流水号', this.processValue]
var Data = this.CreateData('11', '车间生产管理工艺_零件工序_已派工查询', param)
this.ExecDatabase(Data).then(response => {
this.tableData1 = response.data
})
var param1 = []
param1[0] = ['工艺计划流水号', this.processValue]
var Data1 = this.CreateData('11', '车间生产管理工艺_零件工序_派工_工序查询', param1)
this.ExecDatabase(Data1).then(response => {
this.tableData2 = response.data
})
this.dialogFormVisible = false
} else {
this.$message.error('修改失败')
}
})
}
} else {
return false
}
})
},
callOff() {
this.dialogFormVisible = false
},
XUANRU(row) {
if (!this.peopleValue) {
this.$message.warning('操作者不能为空')
return
}
if (!this.machineValue) {
this.$message.warning('设备不能为空')
return
}
if (row.分配数 === 0) {
return
}
if (this.loading2) {
this.loading2 = false
var param = []
param[0] = ['工序流水号', row.工序流水号]
param[1] = ['数量', row.分配数]
param[2] = ['人员编号', this.peopleValue]
param[3] = ['设备流水号', this.machineValue]
param[4] = ['调拨员编号', this.id]
param[5] = ['计划完成日期', row.计划完成日期]
param[6] = ['计划开始日期', row.计划开始日期]
// 参数数量与名称要与存储过程对应
var Data = this.CreateData('12', '车间生产管理工艺_零件工序_派工', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.searchTable()
this.$message.success('派工成功')
var sendMessage
sendMessage = `TOBS??${this.machineName}?MES|RefreshWorkTasks`
this.websock.send(sendMessage)
var param = []
param[0] = ['工艺计划流水号', row.工艺计划流水号]
var Data = this.CreateData('11', '车间生产管理工艺_零件工序_已派工查询', param)
this.ExecDatabase(Data).then(response => {
this.tableData1 = response.data
})
var param1 = []
param1[0] = ['工艺计划流水号', row.工艺计划流水号]
var Data1 = this.CreateData('11', '车间生产管理工艺_零件工序_派工_工序查询', param1)
this.ExecDatabase(Data1).then(response => {
this.tableData2 = response.data
})
this.loading2 = true
} else {
this.$message.error('派工失败')
}
})
}
},
XUANCHU(row) {
if (Number(row.完成数) === 0 && Number(row.是否加工中) === 0) {
if (Number(row.报废数量) === 0) {
var param = []
param[0] = ['工序流水号', row.工序流水号]
param[1] = ['数量', row.数量]
param[2] = ['工艺任务流水号', row.工艺任务流水号]
// 参数数量与名称要与存储过程对应
var Data = this.CreateData('12', '车间生产管理工艺_零件工序_取消派工', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('取消成功')
var sendMessage
sendMessage = `TOBS??${row.工位号}?MES|RefreshWorkTasks`
this.websock.send(sendMessage)
this.searchTable()
var param = []
param[0] = ['工艺计划流水号', row.工艺计划流水号]
var Data = this.CreateData('11', '车间生产管理工艺_零件工序_已派工查询', param)
this.ExecDatabase(Data).then(response => {
this.tableData1 = response.data
})
var param1 = []
param1[0] = ['工艺计划流水号', row.工艺计划流水号]
var Data1 = this.CreateData('11', '车间生产管理工艺_零件工序_派工_工序查询', param1)
this.ExecDatabase(Data1).then(response => {
this.tableData2 = response.data
})
} else {
this.$message.error('取消失败')
}
})
} else {
this.$message.warning('零件存在质检记录!不能取消派工')
}
} else {
this.$message.warning('零件已加工!不能取消派工')
}
},
Urgent() {
if (this.processValue) {
var param = []
param[0] = ['工艺计划流水号', this.processValue]
// 参数数量与名称要与存储过程对应
var Data = this.CreateData('12', '车间生产管理工艺_零件_加急', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('加急成功')
this.searchTable()
} else {
this.$message.error('加急失败')
}
})
} else {
this.$message.warning('请选择要加急的零件')
}
},
CancelUrgent() {
if (this.processValue) {
var param = []
param[0] = ['工艺计划流水号', this.processValue]
// 参数数量与名称要与存储过程对应
var Data = this.CreateData('12', '车间生产管理工艺_零件_取消加急', param)
this.ExecDatabase(Data).then(response => {
console.log(response, 123)
if (response.data[0].result === '1') {
this.$message.success('取消成功')
this.searchTable()
} else {
this.$message.error('取消失败')
}
})
} else {
this.$message.warning('请选择要取消加急的零件')
}
},
handleSizeChanges(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable()
},
handleCurrentChanges(val) {
this.pageCurrent = val
this.searchTable()
}
}
}
</script>
<style>
.CompleteColor {
background: #d8e5f6 !important;
}
.el-table .red {
background: #ff7575;
}
.gray {
background: #E0E0E0 !important;
}
</style>
<style scoped>
.wrapper {
width: 90%;
height: 50px;
overflow: hidden;
border: 1px solid #b8c7d9;
/*float: left;*/
margin: 10px;
}
.content {
position: relative;
padding: 8px 8px 0 8px;
}
.action {
position: absolute;
top: 2px;
right: 8px;
}
.delete {
padding: 0 5px;
border-radius: 3px;
color: #0f84b0;
font-size: 12px;
}
.delete:hover {
background: -webkit-linear-gradient(top, #0ba9e3, #0099d3);
color: #fff;
}
a {
text-decoration: none;
}
.icon {
width: 30px;
height: 30px;
display: inline-block;
margin-right: 7px;
margin-top: 2px;
font-size: 26px;
}
.info {
width: 160px;
height: 50px;
position: absolute;
left: 44px;
line-height: 30px;
display: inline-block;
color: #999;
}
</style>

View File

@@ -0,0 +1,80 @@
<!-- 菜单页代码 contextButton/index.vue -->
<template>
<div id="contextmenu" class="contextmenu">
<div class="contextmenu__item" @click="handleOne()">菜单一</div>
<div class="contextmenu__item" @click="handleTwo()">菜单二</div>
<div class="contextmenu__item" @click="handleThree()">菜单三</div>
</div>
</template>
<script>
export default {
name: 'Index',
data() {
return {
}
},
methods: {
init(row, column, event) {
// 设置菜单出现的位置
// 具体显示位置根据自己需求进行调节
const menu = document.querySelector('#contextmenu')
const cha = document.body.clientHeight - event.clientY
console.log(document.body.clientHeight, event.clientY, cha)
// 防止菜单太靠底,根据可视高度调整菜单出现位置
if (cha < 150) {
menu.style.top = event.clientY - 120 + 'px'
} else if (cha > 750) {
menu.style.top = event.clientY - 170 + 'px'
} else {
menu.style.top = event.clientY - 190 + 'px'
}
menu.style.left = event.clientX - 200 + 'px'
document.addEventListener('click', this.foo) // 给整个document添加监听鼠标事件点击任何位置执行foo方法
},
foo() {
this.$emit('foo')
},
handleOne() {
this.$emit('handleOne')
},
handleTwo() {
this.$emit('handleTwo')
},
handleThree() {
this.$emit('handleThree')
}
}
}
</script>
<style scoped>
.contextmenu__item {
display: block;
line-height: 34px;
text-align: center;
}
.contextmenu__item:not(:last-child) {
border-bottom: 1px solid rgba(64,158,255,.2);
}
.contextmenu {
position: absolute;
background-color: #ecf5ff;
width: 100px;
/*height: 106px;*/
font-size: 12px;
color: #409EFF;
border-radius: 4px;
-webkit-box-sizing: border-box;
box-sizing: border-box;
border: 1px solid rgba(64,158,255,.2);
white-space: nowrap;
z-index: 1000;
}
.contextmenu__item:hover {
cursor: pointer;
background: #66b1ff;
border-color: #66b1ff;
color: #fff;
}
</style>

View File

@@ -0,0 +1,707 @@
<template>
<div class="app-container">
<el-card style="height: 850px">
<el-row>
<el-button type="text" size="small" @click="openDia">自定义模板</el-button>
</el-row>
<el-row>
<el-col>
<!-- <el-card>-->
<div style="max-width: 1500px">
<el-table
v-loading="loading"
:data="tableData"
:row-key="getRowKeys"
highlight-current-row
border
size="mini"
style="width: fit-content"
height="750"
@cell-dblclick="handleEdit"
@row-contextmenu="handleDel"
@row-click="searchTable1">
<el-table-column :width="setColumnWidth('序号')" label="序号" type="index" align="center"/>
<el-table-column v-for="items in header" :key="items.index" :label="items" :width="setColumnWidth(items)" :prop="items" sortable="custom" align="center">
<template slot-scope="scope">
{{ getDataName(scope.row, items) }}
</template>
</el-table-column>
<!--<el-table-column :width="setColumnWidth('序号')" label="序号" type="index" align="center"/>
<el-table-column :width="setColumnWidth('订单号')" label="订单号" align="center">
<template slot-scope="scope">
{{ scope.row.订单号 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('产品名称')" label="产品名称" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.产品名称 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('零件图号')" 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 :width="setColumnWidth('数量')" label="数量" align="center">
<template slot-scope="scope">
{{ scope.row.数量 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" label="毛坯库存" align="center">
<template slot-scope="scope">
{{ scope.row.库存 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('日期')" label="下达日期" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.接收任务 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('日期')" label="完工期限" align="center">
<template slot-scope="scope">
{{ scope.row.精工期限 }}
</template>
</el-table-column>-->
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40, 100]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChanges"
@current-change="handleCurrentChanges"/>
</div>
</div>
<!-- </el-card>-->
</el-col>
</el-row>
<context-button v-if="menuVisible" ref="contextbutton" @foo="foo" @handleOne="handleOne" @handleTwo="handleTwo" @handleThree="handleThree"/>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible" title="修改投产数" center width="400px">
<el-form ref="form" :model="form" :rules="rules" label-position="center" label-width="110px" class="demo-ruleForm">
<el-row>
<el-col :span="12">
<el-form-item label="投产数" prop="投产数">
<el-input-number
v-model="form.投产数"
:max="productionNum"
:min="finishNum"
:step="1"
size="small"
style="width:200px"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="callOff()">取消</el-button>
<el-button type="distribution" size="small" @click="submit()">确定</el-button>
</div>
</el-dialog>
<el-dialog v-el-drag-dialog :visible.sync="dialogVisible" width="350px">
<div v-for="(file, key) in hadFile" :key="key">
<div class="wrapper">
<div class="content">
<div v-if="file.suffix==='pdf'" class="icon"><svg-icon icon-class="pdf" /></div>
<div v-else-if="file.suffix==='docx'||file.suffix === 'doc'" class="icon"><svg-icon icon-class="doc" /></div>
<div v-else-if="file.suffix==='xlsx' || file.suffix === 'xls'" class="icon"><svg-icon icon-class="excel" /></div>
<div v-else-if="file.suffix==='pptx' || file.suffix === 'ppt'" class="icon"><svg-icon icon-class="ppt" /></div>
<div v-else-if="file.suffix==='jpg' || file.suffix === 'jpeg'|| file.suffix === 'png'" class="icon"><svg-icon icon-class="pic" /></div>
<div v-else class="icon"><svg-icon icon-class="file" /></div>
<a id="appUrl" :href="file.url" target="view_window"><div class="info">{{ file.name }}</div></a>
</div>
</div>
</div>
</el-dialog>
<el-dialog v-el-drag-dialog :visible.sync="dialogVisible1" width="350px">
<el-checkbox-group v-model="headerCheck">
<el-checkbox v-for="city in headers" :label="city" :key="city">{{ city }}</el-checkbox>
</el-checkbox-group>
<div slot="footer" class="dialog-footer">
<el-button type="distribution" size="small" @click="handleCheckedCitiesChange">确定</el-button>
</div>
</el-dialog>
</el-card>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import { MESDownloadFile } from '@/utils/request'
import request from '@/utils/request'
import { wsuri } from '@/utils/request'
import contextButton from './contextButton'
export default {
components: {
contextButton
},
data() {
return {
menuVisible: false,
headerCheck: [],
headers: [],
dialogVisible1: false,
tableData2: [],
machine: [],
machineValue: '',
people: [],
peopleValue: '',
processValue: '',
productionNum: '',
finishNum: '',
partTool: '',
dateRange: '', // 提交日期
contractStateValue: '', // 合同状态
partNameValue: '', // 零件名称
productNameValue: '', // 产品部件名称
productName: [],
orderNameValue: '', // 订单名称
orderName1: [],
proccessStateValue: '',
processSequence: '',
IsItUrgent: 0,
dialogVisible: false,
dialogFormVisible: false,
hadFile: [],
form: {
投产数: ''
},
rules: {
投产数: [{ required: true, message: '请输入投产数', trigger: 'blur' }]
},
machineName: '',
header: [],
loading: false, // 数据加载
loading1: false, // 数据加载
total: 0, // 分页总数
tableData: [], // 零件表
tableData1: [], // 工序表
pageCurrent: 1, // 分页当前页
pageSize: 40, // 分页每页显示条数
orderName: '', // 排序列名
order: '' // 排序方式
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
watch: {
machineValue(val) {
for (let i = 0; i < this.machine.length; i++) {
if (val === this.machine[i].value) {
this.machineName = this.machine[i].name
}
}
}
},
created() {
this.getOrderName()
this.searchTable()
this.getMachine()
this.getPeople()
this.initWebpack()
},
methods: {
handleDel(row, column, event) {
this.menuVisible = false
this.menuVisible = true
event.preventDefault()
this.$nextTick(() => {
this.$refs.contextbutton.init(row, column, event)
})
},
handleEdit(row, column, cell, event) {
},
foo() {
this.menuVisible = false
document.removeEventListener('click', this.foo)
},
handleOne() {
console.log('点击菜单一')
},
handleTwo() {
console.log('点击菜单二')
},
handleThree() {
console.log('点击菜单三')
},
aaa(row) {
for (let i = 0; i < this.tableData.length; i++) {
console.log(this.tableData[i].工艺计划流水号, row.工艺计划流水号)
if (this.tableData[i].工艺计划流水号 === row.工艺计划流水号) {
row.visible = true
return
} else {
row.visible = false
}
}
},
bbb(row) {
row.visible = false
},
openStock(row) {
row.visible = false
this.typeValue = row.类型流水号
this.stockValue = row.累计库存流水号
this.form.最低库存 = Number(row.最低库存)
this.dialogFormVisible = true
},
handleCheckedCitiesChange() {
console.log(this.headerCheck, 111)
var param = []
param[0] = ['数组', this.headerCheck]
var Data = this.CreateData('12', '测试_获取表头_是否显示', param)
this.ExecDatabase(Data).then(response => {
this.searchTable()
})
},
openDia() {
this.dialogVisible1 = true
},
getDataName(scope, items) {
return scope[items]
},
// 初始化websocket
initWebpack() {
this.websock = new WebSocket(wsuri)// 这里面的this都指向vue
this.websock.onopen = this.websocketopen
this.websock.onclose = this.websocketclose
this.websock.onerror = this.websocketerror
},
// 打开
websocketopen() {
console.log('WebSocket连接成功')
},
// 数据接收
websocketonmessage(msg) {
// this.partNumberP = msg.data.split('|')[3]
// this.partNumber = this.partNumberP.slice(1)
// this.getscantable(this.partNumber)
},
// 关闭
websocketclose() {
console.log('WebSocket关闭')
},
// 失败
websocketerror() {
console.log('WebSocket连接失败')
},
// 查看零件图
getNum() {
if (this.partTool) {
this.dialogVisible = true
this.getFileList(this.partTool)
} else {
this.$message.warning('请先选择零件')
}
},
async getFileList(value) {
this.hadFile = []
if (value) {
await request({
url: '',
method: 'post',
data: {
type: '3',
name: `select * from 机加工MES_零件图PDF表 where 是否启用 = 1 and name = '${value}'`
}
}).then(data => {
this.suffix = data.data
if (data.data.length > 0) {
const server = `${MESDownloadFile}`.split('/')
data.data.map(item => {
this.hadFile.push({
url: `http://${server[2]}/webpage/part/${item.uid}.${item.suffix}`,
name: `${item.name}.${item.suffix}`,
suffix: item.suffix,
id: item.uid
})
})
}
})
}
},
getMachine() {
var param = []
var Data = this.CreateData('11', '设备信息_查询', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.machine.push({
label: response.data[i].设备名称 !== '外协' ? response.data[i].设备名称 + '_' + response.data[i].工位号 : response.data[i].设备名称,
value: response.data[i].设备流水号,
name: response.data[i].工位号
})
}
})
},
getPeople() {
var param = []
param[0] = ['考核部门编号', 19]
var Data = this.CreateData('11', '人事档案管理_人员_部门与人员_派工_查询数据_根据部门编号', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.people.push({
label: response.data[i].姓名,
value: response.data[i].人员编号
})
}
})
},
rowStyle({ row, column, rowIndex, columnIndex }) {
if (Number(row.是否加急) === 1 && columnIndex === 0) {
return 'red'
}
},
getOrderName() {
var param = []
var Data = this.CreateData('11', '订单信息_列表_查询数据', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.orderName1.push({
label: response.data[i].订单编号,
value: response.data[i].订单流水号
})
}
})
},
getProductName() {
this.productNameValue = ''
this.productName = []
if (this.orderNameValue) {
var param = []
param[0] = ['订单流水号', this.orderNameValue]
var Data = this.CreateData('11', '订单信息_产品信息_查询数据', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.productName.push({
label: response.data[i].产品名称,
value: response.data[i].组件流水号
})
}
})
}
},
searchTable() {
this.tableData1 = []
this.tableData2 = []
this.header = []
this.headers = []
this.headerCheck = []
let orderNameValue_check, productNameValue_check, partNameValue_check
this.orderNameValue ? orderNameValue_check = 1 : orderNameValue_check = 0
this.productNameValue ? productNameValue_check = 1 : productNameValue_check = 0
this.partNameValue ? partNameValue_check = 1 : partNameValue_check = 0
var param1 = []
var Data1 = this.CreateData('11', '测试_获取表头', param1)
this.ExecDatabase(Data1).then(response => {
for (let i = 0; i < response.data.length; i++) {
if (Number(response.data[i].是否显示) === 1) {
this.header.push(response.data[i].header)
this.headerCheck.push(response.data[i].header)
}
this.headers.push(response.data[i].header)
}
})
console.log(this.header, 123344)
var param = []
param[0] = ['订单流水号_check', orderNameValue_check]
param[1] = ['订单流水号', this.orderNameValue]
param[2] = ['组件流水号', this.productNameValue]
param[3] = ['组件流水号_check', productNameValue_check]
param[4] = ['零件名称_check', partNameValue_check]
param[5] = ['零件名称', this.partNameValue]
var Data = this.CreateData('11', '精工车间_零件追溯_查询', param, this.pageSize, this.pageCurrent)
this.ExecDatabase(Data).then(response => {
this.tableData = response.data.rows
console.log(this.tableData[0].header, 2222)
this.total = response.data.total
})
},
searchTable1(row) {
this.partTool = row.零件图号
this.processValue = row.工艺计划流水号
this.IsItUrgent = Number(row.是否加急)
var param = []
param[0] = ['工艺计划流水号', row.工艺计划流水号]
var Data = this.CreateData('11', '车间生产管理工艺_零件工序_已派工查询', param)
this.ExecDatabase(Data).then(response => {
this.tableData1 = response.data
})
var param1 = []
param1[0] = ['工艺计划流水号', row.工艺计划流水号]
var Data1 = this.CreateData('11', '车间生产管理工艺_零件工序_派工_工序查询', param1)
this.ExecDatabase(Data1).then(response => {
this.tableData2 = response.data
})
},
getRowKeys(row) {
return row.工艺计划流水号
},
tableRowClassName({ row, rowIndex }) {
row.index = rowIndex
if (Number(row.已分配) === 1 && Number(row.考核状态) < 3) {
return 'CompleteColor'
}
if (Number(row.考核状态) >= 3) {
return 'gray'
}
},
// 工序状态变色
tableRowClassName1({ row, rowIndex }) {
row.index = rowIndex
if (Number(row.完成数) === Number(row.数量)) {
return 'CompleteColor'
}
},
tableRowClassName2({ row, rowIndex }) {
row.index = rowIndex
if (Number(row.已分配数) === Number(row.数量)) {
return 'CompleteColor'
}
},
editData(row) {
this.productionNum = row.数量
this.form.投产数 = row.数量
this.finishNum = row.完成数
this.proccessStateValue = row.工艺任务流水号
this.processSequence = row.工序顺序
this.dialogFormVisible = true
},
submit() {
this.$refs['form'].validate((valid) => {
if (valid) {
if (this.productionNum === this.form.投产数) {
this.$message.warning('数量未发生改变')
} else {
var param = []
param[0] = ['工艺任务流水号', this.proccessStateValue]
param[1] = ['原数量', this.productionNum]
param[2] = ['数量', this.form.投产数]
param[3] = ['工序顺序', this.processSequence]
var Data = this.CreateData('12', '车间生产管理工艺_零件工序_派工_修改数量', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('修改成功')
var param = []
param[0] = ['工艺计划流水号', this.processValue]
var Data = this.CreateData('11', '车间生产管理工艺_零件工序_已派工查询', param)
this.ExecDatabase(Data).then(response => {
this.tableData1 = response.data
})
var param1 = []
param1[0] = ['工艺计划流水号', this.processValue]
var Data1 = this.CreateData('11', '车间生产管理工艺_零件工序_派工_工序查询', param1)
this.ExecDatabase(Data1).then(response => {
this.tableData2 = response.data
})
this.dialogFormVisible = false
} else {
this.$message.error('修改失败')
}
})
}
} else {
return false
}
})
},
callOff() {
this.dialogFormVisible = false
},
XUANRU(row) {
if (!this.peopleValue) {
this.$message.warning('操作者不能为空')
return
}
if (!this.machineValue) {
this.$message.warning('设备不能为空')
return
}
if (row.分配数 === 0) {
return
}
var param = []
param[0] = ['工序流水号', row.工序流水号]
param[1] = ['数量', row.分配数]
param[2] = ['人员编号', this.peopleValue]
param[3] = ['设备流水号', this.machineValue]
param[4] = ['调拨员编号', this.id]
// 参数数量与名称要与存储过程对应
var Data = this.CreateData('12', '车间生产管理工艺_零件工序_派工', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.searchTable()
this.$message.success('派工成功')
var sendMessage
sendMessage = `TOBS??${this.machineName}?MES|RefreshWorkTasks`
this.websock.send(sendMessage)
var param = []
param[0] = ['工艺计划流水号', row.工艺计划流水号]
var Data = this.CreateData('11', '车间生产管理工艺_零件工序_已派工查询', param)
this.ExecDatabase(Data).then(response => {
this.tableData1 = response.data
})
var param1 = []
param1[0] = ['工艺计划流水号', row.工艺计划流水号]
var Data1 = this.CreateData('11', '车间生产管理工艺_零件工序_派工_工序查询', param1)
this.ExecDatabase(Data1).then(response => {
this.tableData2 = response.data
})
} else {
this.$message.error('派工失败')
}
})
},
XUANCHU(row) {
if (Number(row.完成数) === 0 && Number(row.是否加工中) === 0) {
var param = []
param[0] = ['工序流水号', row.工序流水号]
param[1] = ['数量', row.数量]
param[2] = ['工艺任务流水号', row.工艺任务流水号]
// 参数数量与名称要与存储过程对应
var Data = this.CreateData('12', '车间生产管理工艺_零件工序_取消派工', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('取消成功')
var sendMessage
sendMessage = `TOBS??${row.工位号}?MES|RefreshWorkTasks`
this.websock.send(sendMessage)
this.searchTable()
var param = []
param[0] = ['工艺计划流水号', row.工艺计划流水号]
var Data = this.CreateData('11', '车间生产管理工艺_零件工序_已派工查询', param)
this.ExecDatabase(Data).then(response => {
this.tableData1 = response.data
})
var param1 = []
param1[0] = ['工艺计划流水号', row.工艺计划流水号]
var Data1 = this.CreateData('11', '车间生产管理工艺_零件工序_派工_工序查询', param1)
this.ExecDatabase(Data1).then(response => {
this.tableData2 = response.data
})
} else {
this.$message.error('取消失败')
}
})
} else {
this.$message.warning('零件已加工!不能取消派工')
}
},
Urgent() {
if (this.processValue) {
var param = []
param[0] = ['工艺计划流水号', this.processValue]
// 参数数量与名称要与存储过程对应
var Data = this.CreateData('12', '车间生产管理工艺_零件_加急', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('加急成功')
this.searchTable()
} else {
this.$message.error('加急失败')
}
})
} else {
this.$message.warning('请选择要加急的零件')
}
},
CancelUrgent() {
if (this.processValue) {
var param = []
param[0] = ['工艺计划流水号', this.processValue]
// 参数数量与名称要与存储过程对应
var Data = this.CreateData('12', '车间生产管理工艺_零件_取消加急', param)
this.ExecDatabase(Data).then(response => {
console.log(response, 123)
if (response.data[0].result === '1') {
this.$message.success('取消成功')
this.searchTable()
} else {
this.$message.error('取消失败')
}
})
} else {
this.$message.warning('请选择要取消加急的零件')
}
},
handleSizeChanges(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable()
},
handleCurrentChanges(val) {
this.pageCurrent = val
this.searchTable()
}
}
}
</script>
<style>
.CompleteColor{
background: #d8e5f6 !important;
}
.el-table .red{
background: #ff7575;
}
.gray {
background: #E0E0E0 !important;
}
</style>
<style scoped>
.wrapper{
width: 90%;
height: 50px;
overflow: hidden;
border: 1px solid #b8c7d9;
/*float: left;*/
margin: 10px;
}
.content{
position: relative;
padding: 8px 8px 0 8px;
}
.action{
position: absolute;
top: 2px;
right: 8px;
}
.delete{
padding: 0 5px;
border-radius: 3px;
color: #0f84b0;
font-size: 12px;
}
.delete:hover{
background: -webkit-linear-gradient(top,#0ba9e3,#0099d3);
color: #fff;
}
a{
text-decoration: none;
}
.icon{
width: 30px;
height: 30px;
display: inline-block;
margin-right: 7px;
margin-top: 2px;
font-size: 26px;
}
.info{
width: 160px;
height: 50px;
position: absolute;
left: 44px;
line-height: 30px;
display: inline-block;
color: #999;
}
</style>

View File

@@ -0,0 +1,127 @@
<template>
<div class="app-container">
<el-card style="height: 790px">
<div style="margin-top: 7px; margin-bottom: 7px">
<el-input v-model="drawingNameValue" style="width:200px" placeholder="名称" size="small" clearable @keyup.enter.native="searchTable()"/>
<el-button icon="el-icon-search" type="primary" plain size="small" @click="searchTable()">查询</el-button>
</div>
<el-table v-loading="loading" :data="tableData" highlight-current-row border stripe size="small" style="width: 500px" height="680px">
<el-table-column width="160px" label="名称" align="center">
<template slot-scope="scope">
{{ scope.row.name }}
</template>
</el-table-column>
<el-table-column width="200px" label="上传时间" align="center">
<template slot-scope="scope">
{{ scope.row.上传时间 }}
</template>
</el-table-column>
<el-table-column align="center" label="操作">
<template slot-scope="scope">
<el-button type="text" size="mini" icon="el-icon-edit" @click="ProcessTool(scope.row)">查看</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<el-dialog
v-el-drag-dialog
:visible.sync="dialogVisible1"
:center="dialogName"
title="工艺指导"
width="20%">
<div v-for="(file, key) in hadFile1" :key="key">
<div class="wrapper">
<div class="content">
<div v-if="file.suffix==='pdf'" class="icon"><svg-icon icon-class="pdf" /></div>
<div v-else-if="file.suffix==='docx'||file.suffix === 'doc'" class="icon"><svg-icon icon-class="doc" /></div>
<div v-else-if="file.suffix==='xlsx' || file.suffix === 'xls'" class="icon"><svg-icon icon-class="excel" /></div>
<div v-else-if="file.suffix==='pptx' || file.suffix === 'ppt'" class="icon"><svg-icon icon-class="ppt" /></div>
<div v-else-if="file.suffix==='jpg' || file.suffix === 'jpeg'|| file.suffix === 'png'" class="icon"><svg-icon icon-class="pic" /></div>
<div v-else class="icon"><svg-icon icon-class="file" /></div>
<a id="appUrl1" :href="file.url" target="view_window"><div class="info">{{ file.name }}</div></a>
</div>
</div>
</div>
</el-dialog>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import { MESDownloadFile } from '@/utils/request'
export default {
data() {
return {
dialogName: true,
hadFile1: [],
drawingNameValue: '', // 图纸名称
loading: false, // 数据加载
dialogVisible1: false,
total: 0, // 分页总数
tableData: [],
pageCurrent: 1, // 分页当前页
pageSize: 100, // 分页每页显示条数
orderName: '', // 排序列名
order: '' // 排序方式
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
created() {
this.searchTable()
},
methods: {
ProcessTool(row) {
this.hadFile1 = []
var param = []
param[0] = ['name', row.name]
var Data = this.CreateData('11', '车间生产管理工艺_零件工序_指导图_查询数据', param)
this.ExecDatabase(Data).then(res => {
this.suffix = res.data
if (res.data.length > 0) {
const server = `${MESDownloadFile}`.split('/')
res.data.map(item => {
this.hadFile1.push({
url: `http://${server[2]}/webpage/part/${item.uid}.${item.suffix}`,
name: `${item.name}.${item.suffix}`,
suffix: item.suffix,
id: item.num
})
})
}
})
this.dialogVisible1 = true
},
searchTable() {
let check
this.drawingNameValue ? check = 1 : check = 0
var param = []
param[0] = ['name_check', check]
param[1] = ['mane', this.drawingNameValue]
var Data = this.CreateData('11', '车间生产管理工艺_零件工序_指导图_查询数据_表格', param)
this.ExecDatabase(Data).then(response => {
this.tableData = response.data
})
},
handleSizeChanges(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable()
},
handleCurrentChanges(val) {
this.pageCurrent = val
this.searchTable()
}
}
}
</script>
<style>
.ziduan {
width: 50px!important;
}
</style>

View File

@@ -0,0 +1,299 @@
<template>
<div class="app-container">
<el-card style="height: 850px">
<div style="margin-top: 7px; margin-bottom: 7px">
<el-select v-model="orderNumberTypeValue" style="width:200px" placeholder="操作者" size="small" filterable clearable @change="searchTable1()">
<el-option
v-for="item in orderNumberType"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<!--<el-select v-model="productpartNameValue" style="width:200px;margin-left: 10px" placeholder="工位号" size="small" filterable clearable @change="searchTable1()">
<el-option
v-for="item in productpartName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>-->
<el-input v-model="productpartNameValue" style="width:200px;margin-left: 10px" placeholder="加工设备" size="small" clearable/>
<el-input v-model="partNameValue" style="width:100px;margin-left: 10px" placeholder="零件名称" size="small" clearable/>
<span style="font-size: 13px;color: black;margin-left: 20px">派工日期:</span>
<el-date-picker
v-model="dateRange"
size="small"
type="daterange"
align="center"
style="width: 240px;"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
@change="searchTable1()"/>
<el-button icon="el-icon-search" type="primary" plain size="small" style="margin-left: 10px" @click="pageCurrent = 1;pageSize = 20;searchTable1()">查询</el-button>
</div>
<el-table :data="tableData2" height="750px" style="width: 1280px" highlight-current-row border @sort-change="sortChange1">
<el-table-column width="100px" align="center" label="操作者" sortable="姓名" prop="姓名" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.姓名 }}
</template>
</el-table-column>
<el-table-column align="center" label="加工设备" sortable="设备" prop="设备" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.设备 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('零件名称')" align="center" label="零件名称" sortable="零件名称" prop="零件名称" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('图号')" align="center" label="图号" prop="图号" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.零件图号 }}
</template>
</el-table-column>
<el-table-column width="170px" align="center" label="订单编号" prop="订单编号" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.订单号 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" align="center" label="数量" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.数量 }}
</template>
</el-table-column>
<el-table-column width="60px" align="center" label="序号" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.工序顺序 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('工序')" align="center" label="工序" sortable="工序" prop="工序" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.工序 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('派工日期')" align="center" label="派工日期" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.分配时间 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('完工期限')" align="center" label="完工期限" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.精工期限 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" align="center" label="已完成数" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.完成数 }}
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40, 100]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChanges"
@current-change="handleCurrentChanges"/>
</div>
</el-card>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import { getNowShotTime } from '@/utils/tool'
export default {
data() {
return {
process: '', // 工艺计划流水号
orderNumberTypeValue: '', // 操作者
orderNumberType: [], // 操作者数组
productpartNameValue: '', // 产品部件名称
productpartName: [], // 产品部件名称数组
partNameValue: '', // 零件名称
machine: [],
machineValue: '',
people: [],
peopleValue: '',
loading: false, // 数据加载
total: 0, // 分页总数
tableData2: [],
pageCurrent: 1, // 分页当前页
pageSize: 20, // 分页每页显示条数
orderName: '', // 排序列名
order: '', // 排序方式
orderName1: '', // 排序列名
order1: '', // 排序方式
dateRange: '', // 派工日期
dateTime: getNowShotTime()
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
// updated() {
// this.$nextTick(() => {
// this.$refs['table'].doLayout()
// })
// },
created() {
this.getOrderNumberType()
this.getMachine()
this.getPeople()
this.getProcess()
this.searchTable1()
this.getproductpartName()
},
methods: {
getOrderNumberType() {
var param = []
param[0] = ['考核部门编号', 19]
var Data = this.CreateData('11', '人事档案管理_人员_部门与人员_查询数据_根据部门编号', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.orderNumberType.push({
label: response.data[i].姓名,
value: response.data[i].人员编号
})
}
})
},
getproductpartName() {
var param = []
var Data = this.CreateData('11', '设备信息_查询', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.productpartName.push({
label: response.data[i].工位号,
value: response.data[i].设备流水号
})
}
})
},
getMachine() {
var param = []
var Data = this.CreateData('11', '设备信息_查询', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.machine.push({
label: response.data[i].设备名称 !== '外协' ? response.data[i].设备名称 + '_' + response.data[i].工位号 : response.data[i].设备名称,
value: response.data[i].设备流水号
})
}
})
},
getPeople() {
var param = []
param[0] = ['考核部门编号', 19]
var Data = this.CreateData('11', '人事档案管理_人员_部门与人员_查询数据_根据部门编号', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.people.push({
label: response.data[i].姓名,
value: response.data[i].人员编号
})
}
})
},
getProcess() {
var param = []
// 参数数量与名称要与存储过程对应
var Data = this.CreateData('11', '工艺名称_查询', param)
this.ExecDatabase(Data).then(response => {
this.tableData4 = response.data
})
},
searchTable1() {
let orderNumberTypeValue_check, productpartNameValue_check, partNameValue_check, dateRange_check
this.dateRange ? dateRange_check = 1 : (dateRange_check = 0, this.dateRange = '')
this.orderNumberTypeValue ? orderNumberTypeValue_check = 1 : orderNumberTypeValue_check = 0
this.productpartNameValue ? productpartNameValue_check = 1 : productpartNameValue_check = 0
this.partNameValue ? partNameValue_check = 1 : partNameValue_check = 0
var param = []
param[0] = ['人员编号', this.orderNumberTypeValue]
param[1] = ['人员编号_check', orderNumberTypeValue_check]
param[2] = ['设备流水号', this.productpartNameValue]
param[3] = ['设备流水号_check', productpartNameValue_check]
param[4] = ['零件名称_check', partNameValue_check]
param[5] = ['零件名称', this.partNameValue]
param[6] = ['排序名称', this.orderName1]
param[7] = ['排序方式', this.order1]
param[8] = ['开始时间', this.dateRange[0]]
param[9] = ['结束时间', this.dateRange[1]]
param[10] = ['时间_check', dateRange_check]
param[11] = ['PageCurrent', this.pageCurrent]
param[12] = ['PageSize', this.pageSize]
param[13] = ['PageCount', '1111', 'int', '1']
param[14] = ['ItemCount', '1111', 'int', '1']
var Data = this.CreateData('11', '精工车间_工况_分页查询', param)
this.ExecDatabase(Data).then(response => {
this.tableData2 = response.data.result
this.total = parseInt(response.data.output[0].ItemCount)
})
},
sortChange1(column) {
if (column.prop === '零件名称') {
this.orderName1 = 1
} else if (column.prop === '工序') {
this.orderName1 = 2
} else if (column.prop === '姓名') {
this.orderName1 = 3
} else if (column.prop === '设备') {
this.orderName1 = 4
} else {
this.orderName1 = 0
}
if (column.order === 'ascending') {
this.order1 = 1
} else if (column.order === 'descending') { this.order1 = 2 } else {
this.order1 = ''
this.orderName1 = 0
}
this.searchTable1()
},
handleSizeChanges(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable1()
},
handleCurrentChanges(val) {
this.pageCurrent = val
this.searchTable1()
}
}
}
</script>
<style scoped>
.el-form--label-left >>> .el-form-item__label {
text-align: right;
}
>>>.el-dialog--center .el-dialog__body {
text-align: initial;
padding: 20px 30px 20px
}
>>>.el-dialog__header {
padding: 20px 20px 0px;
}
>>>.el-dialog__footer {
padding: 0px 20px 20px;
/*text-align: right;*/
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
>>>.el-form-item {
margin-bottom: 13px;
}
</style>
<style>
.el-table .Urgent {
background: #ff7575 !important;
}
</style>