采购件查询分页金工页面
This commit is contained in:
@@ -110,3 +110,22 @@ export function submitEdit(Number1, completetime, processSerialNumber) {
|
||||
}
|
||||
})
|
||||
}
|
||||
export function getExport(num) {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '3',
|
||||
name: `select s1.* from (
|
||||
select a1.*, row_number() over (partition by 工艺计划流水号 order
|
||||
|
||||
by 工序顺序) as group_idx
|
||||
|
||||
from (select TOP 100 PERCENT 零件图号,工艺计划流水号,机床流水号,工序顺序,工艺名称,材料,零件名称,投产数量,组号,机床图号 from dbo.车间生产管理工艺_零件工序_视图
|
||||
where 考核状态 =6 and 机床流水号 = ${num} and 工艺编号 is not null and 完成日期 is null
|
||||
group by 零件图号,工艺计划流水号,考核状态,机床流水号,工艺名称,工序顺序,材料,零件名称,投产数量,组号,机床图号
|
||||
order by 工艺计划流水号,工序顺序) as a1 ) s1
|
||||
where s1.group_idx= 1`
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -26,7 +26,8 @@ export const downloadFileMachine = `http://192.168.1.231:8411/submit/downloadFil
|
||||
export const MESUploadFile = `http://192.168.1.231:8411/submit/MESUploadFile.ashx`
|
||||
export const MESDownloadFile = `http://192.168.1.231:8411/submit/MESDownloadFile.ashx`
|
||||
const service = axios.create({
|
||||
baseURL: `http://192.168.0.107:8079/submit/MESCommonBase.ashx`,
|
||||
|
||||
baseURL: `http://192.168.1.231:8411/submit/MESCommonBase.ashx`,
|
||||
timeout: 1500000 // 请求超时时间
|
||||
})
|
||||
export default service
|
||||
|
||||
@@ -172,7 +172,7 @@ export default {
|
||||
firstLevel.children = []
|
||||
for (let j = 0; j < response.data.length; j++) {
|
||||
firstLevel.children.push({
|
||||
label: (response.data[j].零件图号 ? response.data[j].零件图号 : '无零件图号') + '\xa0\xa0\xa0\xa0\xa0\xa0' + (response.data[j].规格 ? response.data[j].规格 : '') + '\xa0\xa0\xa0\xa0\xa0\xa0' + (response.data[j].投产总数量 ? response.data[j].投产总数量 : '') + '..........' + (response.data[j].零件名称 ? response.data[j].零件名称 : '无零件名称') + (response.data[j].零件类型 === 1 ? '' : '\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0外购'),
|
||||
label: (response.data[j].零件图号 ? response.data[j].零件图号 : '无零件图号') + '\xa0\xa0\xa0\xa0\xa0\xa0' + (response.data[j].规格 ? response.data[j].规格 : '') + '\xa0\xa0\xa0\xa0\xa0\xa0' + (response.data[j].投产总数量 ? response.data[j].投产总数量 : '') + '..........' + (response.data[j].零件名称 ? response.data[j].零件名称 : '无零件名称') + (response.data[j].零件类型 === 1 ? '\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0' + response.data[j].考核状态名称 : (response.data[j].零件类型 === 2 ? '\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0制造采购' : '\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0外购')),
|
||||
value: response.data[j].工艺计划流水号,
|
||||
考核状态: response.data[j].考核状态,
|
||||
采购状态: response.data[j].采购状态,
|
||||
|
||||
@@ -506,7 +506,6 @@ import {
|
||||
readyChange,
|
||||
TableAddLi1,
|
||||
TableAddLi,
|
||||
getPartnames3,
|
||||
getPartnames4,
|
||||
modifyRemark,
|
||||
detailInfo
|
||||
@@ -1109,38 +1108,21 @@ export default {
|
||||
searchPartsByMachineGroup() {
|
||||
this.tableData = []
|
||||
this.partNum = []
|
||||
if (this.radio === 1) { // 未编制
|
||||
this.disabled = false
|
||||
this.isShow1 = true
|
||||
this.isShow2 = false
|
||||
this.checked1 = true
|
||||
getPartnames3(this.machine_Group_part).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.partNum.push({
|
||||
label: response.data[i].零件图号,
|
||||
value: response.data[i].工艺计划流水号,
|
||||
machine: response.data[i].机床图号,
|
||||
group: response.data[i].组号
|
||||
})
|
||||
}
|
||||
})
|
||||
} else { // 已编制
|
||||
this.isShow = true
|
||||
this.isShow1 = false
|
||||
this.isShow2 = true
|
||||
this.disabled = true
|
||||
this.checked1 = false
|
||||
getPartnames4(this.machine_Group_part).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.partNum.push({
|
||||
label: response.data[i].零件图号,
|
||||
value: response.data[i].工艺计划流水号,
|
||||
machine: response.data[i].机床图号,
|
||||
group: response.data[i].组号
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
this.isShow = true
|
||||
this.isShow1 = false
|
||||
this.isShow2 = true
|
||||
this.disabled = true
|
||||
this.checked1 = false
|
||||
getPartnames4(this.machine_Group_part).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.partNum.push({
|
||||
label: response.data[i].零件图号,
|
||||
value: response.data[i].工艺计划流水号,
|
||||
machine: response.data[i].机床图号,
|
||||
group: response.data[i].组号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
searchParts() { // 根据条件查零件号
|
||||
this.tableData = []
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
</el-select>
|
||||
<el-input v-model="number" placeholder="零件号" clearable size="small" style="width: 170px;margin:0px 10px;"/>
|
||||
<el-button type="success" class="el-icon-search" size="small" style="margin: 0px 10px;" @click="pageCurrent = 1;pageSize = 100;getTableData()">查询</el-button>
|
||||
<el-button type="warning" class="el-icon-download" size="small" style="margin: 10px 0 0 10px" @click="exportExcel">导出</el-button>
|
||||
</el-card>
|
||||
<el-row>
|
||||
<el-col style="width: 37%">
|
||||
@@ -210,7 +211,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getMachines, getGroups, getTable, gettabledata1, getTree, fn, getTable8, submitEdit } from '@/api/ManufacturingCenter/ProcessingStatusNew'
|
||||
import { getMachines, getGroups, getTable, gettabledata1, getTree, fn, getTable8, submitEdit, getExport } from '@/api/ManufacturingCenter/ProcessingStatusNew'
|
||||
import Cookie from 'js-cookie'
|
||||
|
||||
export default {
|
||||
@@ -264,6 +265,33 @@ export default {
|
||||
this.getTable9()
|
||||
},
|
||||
methods: {
|
||||
formatJson(filterVal, jsonData) {
|
||||
return jsonData.map(v => filterVal.map(j => {
|
||||
return v[j]
|
||||
}))
|
||||
},
|
||||
exportExcel() {
|
||||
if (!this.Machine) {
|
||||
this.$message.warning('请选择机床')
|
||||
return
|
||||
}
|
||||
getExport(this.Machine).then(res => {
|
||||
console.log(res.data)
|
||||
import('@/vendor/Export2Excel').then(excel => {
|
||||
const tHeader = ['机床', '组号', '图号及规格', '制品名称', '计划数', '材料', '当前工序名']
|
||||
const filterVal = ['机床图号', '组号', '零件图号', '零件名称', '投产数量', '材料', '工艺名称']
|
||||
const list = res.data
|
||||
const data = this.formatJson(filterVal, list)
|
||||
excel.export_json_to_excel({
|
||||
header: tHeader,
|
||||
data,
|
||||
filename: '加工进度表',
|
||||
autoWidth: true,
|
||||
bookType: 'xlsx'
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
getMachine() {
|
||||
if (Cookie.get('machineValue') !== undefined) {
|
||||
this.Machine = ''
|
||||
|
||||
@@ -130,12 +130,12 @@
|
||||
|
||||
<script>
|
||||
import { searchtable, searchtable2 } from '@/api/ManufacturingCenter/ScheduleCompletionDetails'
|
||||
import { getNowTime, getNowTime1 } from '@/utils/tool'
|
||||
import { getNowShotTime } from '@/utils/tool'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
startTime: getNowTime1(), // 开始时间
|
||||
endTime: getNowTime(), // 结束时间
|
||||
startTime: getNowShotTime(), // 开始时间
|
||||
endTime: getNowShotTime(), // 结束时间
|
||||
tableData: [], // 操作者工时统计
|
||||
loading: '',
|
||||
tableData2: [], // 工序统计表
|
||||
@@ -160,8 +160,11 @@ export default {
|
||||
this.tableData = []
|
||||
this.tableData2 = []
|
||||
this.total2 = 0
|
||||
searchtable(this.startTime, this.endTime, this.pageCurrent, this.pageSize).then(response => {
|
||||
console.log(response.data, 111)
|
||||
var STime = ''
|
||||
var ETime = ''
|
||||
STime = this.startTime + ' 00:00:00'
|
||||
ETime = this.endTime + ' 23:59:59'
|
||||
searchtable(STime, ETime, this.pageCurrent, this.pageSize).then(response => {
|
||||
if (response.data.total === 0) {
|
||||
this.loading = false
|
||||
} else {
|
||||
@@ -171,12 +174,17 @@ export default {
|
||||
}).then(() => {
|
||||
this.loading = false
|
||||
})
|
||||
}, // 获取工序表
|
||||
},
|
||||
// 获取工序表
|
||||
searchTable2(row) {
|
||||
this.loading2 = true
|
||||
this.tableData2 = []
|
||||
this.pageCurrent2 = 1
|
||||
searchtable2(row.人员编号, this.startTime, this.endTime, this.pageCurrent2, this.pageSize2).then(response => {
|
||||
var STime = ''
|
||||
var ETime = ''
|
||||
STime = this.startTime + ' 00:00:00'
|
||||
ETime = this.endTime + ' 23:59:59'
|
||||
searchtable2(row.人员编号, STime, ETime, this.pageCurrent2, this.pageSize2).then(response => {
|
||||
console.log(response.data, 222)
|
||||
if (response.data.rows.length !== 0) {
|
||||
this.tableData2 = response.data.rows
|
||||
|
||||
Reference in New Issue
Block a user