This commit is contained in:
liushuai
2020-01-08 20:04:29 +08:00
parent 005652b855
commit 9dc1d181af
5 changed files with 65 additions and 35 deletions

View File

@@ -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`
}
})
}

View File

@@ -26,7 +26,7 @@ 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.110:8002/submit/MESCommonBase.ashx`,
baseURL: `http://192.168.1.231:8411/submit/MESCommonBase.ashx`,
timeout: 1500000 // 请求超时时间
})
export default service

View File

@@ -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].采购状态,

View File

@@ -1109,38 +1109,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 = []

View File

@@ -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: 550px">
@@ -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 = ''